Use xAI in your terminal
Use xAI models with your own key. You pay xAI directly; kunji never sees your bill.
Set up
Section titled “Set up”- Create an API key at https://console.x.ai.
- Run
kunji keys add xaiand paste the key. kunji checks it works, then stores it in your OS keychain. - Pick a default model from the list (type to search).
- Run
kunjiand start chatting.
Details
Section titled “Details”| Provider id | xai |
| Type | OpenAI-compatible API |
| API address | https://api.x.ai/v1 |
| Key variable | XAI_API_KEY |
Use it
Section titled “Use it”kunji models xai # see available modelskunji use xai:<model> # make one your defaultkunji chat -m xai:<model> # or chat with it onceInside a chat, switch to it with /model xai:<model>; the conversation carries over.
Use an environment variable instead
Section titled “Use an environment variable instead”For CI or scripts you can skip the keychain:
export XAI_API_KEY=your-key-herekunji ask -m xai:<model> "Hello"