03 / 05Advanced
Configure your API key
The chat agent needs an API key before it can run. Out of the box, the project targets xAI. You can also use Groq or any other API that is compatible with OpenAI.
Default option: xAI
-
Open the xAI API page.
-
Log in, or register if you don't have an account.
-
Generate an API key.
-
Add these values to your
.envfile:plaintext XAI_API_KEY=your_api_key_here
When this is done, go to Test your setup.
Alternative option: Groq
-
Open the Groq console.
-
Log in, or register if you don't have an account.
-
Generate an API key.
-
Add these values to your
.envfile:plaintext XAI_API_KEY=your_api_key_here -
In
/agent/services/openai.ts, change thebaseURLto:typescript baseURL: "https://api.groq.com/openai/v1", -
Set your model in two places:
agent/config.yml: put your model in themodelfield, for examplellama-3.1-8b-instant.agent/tools/memory.ts: put your model in themodelvariable.
agent/config.ymlexample:yaml model: "llama-3.1-8b-instant"agent/tools/memory.tsexample:typescript model: string = "llama-3.1-8b-instant";The Groq model list shows which models you can use.
Once these changes are in place, go to Test your setup.
Using other OpenAI-compatible APIs
-
Get an API key from your provider.
-
Add these values to your
.envfile:plaintext XAI_API_KEY=your_api_key_here -
In
/agent/services/openai.ts, set thebaseURLto your provider's endpoint. -
Adjust the configuration files, such as
agent/config.yml, and any hardcoded values, such as themodelvariable inagent/tools/memory.ts, so they fit the model and API you are using.