Looking at the code flowsint-api/app/api/routes/chat.py it appears that adding Mistral API key as environment variable MISTRAL_API_KEY in .env would allow me to use Mistral AI. But even after adding the API key there Chat generates error saying Failed to get AI completion: 500: Mistral API key not configured . Adding the key in Vault does not resolve the issue either.
Originally created by @caseypaite on GitHub (Nov 15, 2025).
Original GitHub issue: https://github.com/reconurge/flowsint/issues/57
Looking at the code `flowsint-api/app/api/routes/chat.py` it appears that adding Mistral API key as environment variable `MISTRAL_API_KEY` in `.env` would allow me to use Mistral AI. But even after adding the API key there Chat generates error saying `Failed to get AI completion: 500: Mistral API key not configured` . Adding the key in Vault does not resolve the issue either.
The chat should normally work if you add the api key in the .env file.
But you need to restart the services and make sure the env is correctly setup.
I'd suggest deleting all .env files in app/api/core then add your api key in .env.example and relaunch the install.
I'll work on a better documentation and Vault support.
Let me know !
<!-- gh-comment-id:3536268489 -->
@dextmorgn commented on GitHub (Nov 15, 2025):
Hello @caseypaite,
Thanks for raising this issue.
The chat should normally work if you add the api key in the `.env` file.
But you need to restart the services and make sure the env is correctly setup.
I'd suggest deleting all `.env` files in app/api/core then add your api key in `.env.example` and relaunch the install.
I'll work on a better documentation and Vault support.
Let me know !
Added MISTRAL_API_KEY=key_from_mistral to the .env.example file, then: make prod
Issue still not resolved.
PDCP_API_KEY and ASNMAP added through Vault worked perfectly fine. Wished Mistral integration can also be done through Valut.
<!-- gh-comment-id:3536297790 -->
@caseypaite commented on GitHub (Nov 15, 2025):
Hi @dextmorgn , thanks for the suggestion and also thank you for developing this whole package.
Here is what i did:
```
make stop
docker image rm flowsint-prod-api
docker image rm flowsint-prod-app
docker image rm flowsint-prod-celery
rm .env
rm flowsint-api/.env
rm flowsint-app/.env
rm flowsint-core/.env
```
Added `MISTRAL_API_KEY=key_from_mistral` to the `.env.example` file, then:
`make prod`
Issue still not resolved.
`PDCP_API_KEY` and `ASNMAP` added through Vault worked perfectly fine. Wished Mistral integration can also be done through Valut.
I'll work on this probably next week, and let you know on this thread.
<!-- gh-comment-id:3536308453 -->
@dextmorgn commented on GitHub (Nov 15, 2025):
Cool, thank you for testing and letting me know.
I'll work on this probably next week, and let you know on this thread.
Finally figured it out.
The MISTRAL_API_KEY environment variable was not declared in docker-compose.prod.yml, this API Key is required only by the API backend. So, I added the environment variable in the docker-compose file:
@dextmorgn It would be convenient for users if .env.example contain placeholders for the variable names (could be commented out). Also the docker-compose files should also contain references to all the environment variables to be imported from the .env files.
I'm closing the issue at my end.
Regards.
<!-- gh-comment-id:3536490090 -->
@caseypaite commented on GitHub (Nov 15, 2025):
Finally figured it out.
The `MISTRAL_API_KEY` environment variable was not declared in `docker-compose.prod.yml`, this API Key is required only by the API backend. So, I added the environment variable in the docker-compose file:
```
# FastAPI Backend (Production)
api:
...
environment:
...
- REDIS_URL=redis://redis:6379/0
- MISTRAL_API_KEY=${MISTRAL_API_KEY}
```
This resolved the issue.
@dextmorgn It would be convenient for users if `.env.example` contain placeholders for the variable names (could be commented out). Also the docker-compose files should also contain references to all the environment variables to be imported from the `.env` files.
I'm closing the issue at my end.
Regards.
<!-- gh-comment-id:3536573318 -->
@dextmorgn commented on GitHub (Nov 15, 2025):
@caseypaite,
Thanks for figuring it out.
Would you mind creating a PR for this fix ?
Thanks !
Hi @dextmorgn , I have commited changes to files .env.example and docker-compose.prod.yml. But managed to create PR for one of them. I'm not so good with git operations.
<!-- gh-comment-id:3536622351 -->
@caseypaite commented on GitHub (Nov 15, 2025):
Hi @dextmorgn , I have commited changes to files `.env.example` and `docker-compose.prod.yml`. But managed to create PR for one of them. I'm not so good with git operations.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Originally created by @caseypaite on GitHub (Nov 15, 2025).
Original GitHub issue: https://github.com/reconurge/flowsint/issues/57
Looking at the code
flowsint-api/app/api/routes/chat.pyit appears that adding Mistral API key as environment variableMISTRAL_API_KEYin.envwould allow me to use Mistral AI. But even after adding the API key there Chat generates error sayingFailed to get AI completion: 500: Mistral API key not configured. Adding the key in Vault does not resolve the issue either.@dextmorgn commented on GitHub (Nov 15, 2025):
Hello @caseypaite,
Thanks for raising this issue.
The chat should normally work if you add the api key in the
.envfile.But you need to restart the services and make sure the env is correctly setup.
I'd suggest deleting all
.envfiles in app/api/core then add your api key in.env.exampleand relaunch the install.I'll work on a better documentation and Vault support.
Let me know !
@caseypaite commented on GitHub (Nov 15, 2025):
Hi @dextmorgn , thanks for the suggestion and also thank you for developing this whole package.
Here is what i did:
Added
MISTRAL_API_KEY=key_from_mistralto the.env.examplefile, then:make prodIssue still not resolved.
PDCP_API_KEYandASNMAPadded through Vault worked perfectly fine. Wished Mistral integration can also be done through Valut.@dextmorgn commented on GitHub (Nov 15, 2025):
Cool, thank you for testing and letting me know.
I'll work on this probably next week, and let you know on this thread.
@caseypaite commented on GitHub (Nov 15, 2025):
Finally figured it out.
The
MISTRAL_API_KEYenvironment variable was not declared indocker-compose.prod.yml, this API Key is required only by the API backend. So, I added the environment variable in the docker-compose file:This resolved the issue.
@dextmorgn It would be convenient for users if
.env.examplecontain placeholders for the variable names (could be commented out). Also the docker-compose files should also contain references to all the environment variables to be imported from the.envfiles.I'm closing the issue at my end.
Regards.
@dextmorgn commented on GitHub (Nov 15, 2025):
@caseypaite,
Thanks for figuring it out.
Would you mind creating a PR for this fix ?
Thanks !
@caseypaite commented on GitHub (Nov 15, 2025):
Hi @dextmorgn , I have commited changes to files
.env.exampleanddocker-compose.prod.yml. But managed to create PR for one of them. I'm not so good with git operations.