Integrations
Coding agent configuration
Choose the agent you want to use, then enter the KHaiXAPI Base URL, API Key, and model as described in its section. After configuration, check the connection with a text request, streaming output, and one read-only tool call. Use the Image API separately for image generation.
Choose a protocol first
| Agent | Recommended protocol | Base URL |
|---|---|---|
| Codex, OpenCode, Kilo, OpenClaw, Pi | OpenAI Responses | https://api.khaix.net/v1 |
| Hermes Agent | Choose either Responses or Chat Completions | https://api.khaix.net/v1 |
| Cline, Aider | OpenAI Chat Completions | https://api.khaix.net/v1 |
The table shows Base URLs. Clients append /responses or /chat/completions themselves. When a field is named Base URL, enter the address through /v1.
Codex
Codex CLI, IDE extensions, and the app all read the current user's .codex configuration. The Windows path is %USERPROFILE%\.codex\; macOS, Linux, WSL, and SSH environments use ~/.codex/.
Add the following fields to config.toml:
model = "gpt-5.6-sol"
model_provider = "openai"
openai_base_url = "https://api.khaix.net/v1"Then save the key with the Codex login command:
export KHAIX_API_KEY="sk-replace-with-your-key"
printenv KHAIX_API_KEY | codex login --with-api-key
codex login statusRestart Codex, then use /status to check the current model. Configure the approval policy, sandbox, Web Search, and command network permissions separately after the API is connected.
OpenCode
Edit ~/.config/opencode/opencode.json and connect through the @ai-sdk/openai Responses provider. If you already have a configuration, merge the provider below into it while preserving existing fields.
{
"$schema": "https://opencode.ai/config.json",
"model": "api/gpt-5.6-sol",
"provider": {
"api": {
"npm": "@ai-sdk/openai",
"name": "KHaiXAPI",
"options": {
"baseURL": "https://api.khaix.net/v1"
},
"models": {
"gpt-5.6-sol": {
"name": "GPT-5.6 Sol",
"reasoning": true,
"options": {
"store": false,
"reasoningEffort": "high",
"reasoningSummary": "auto"
}
}
}
}
}
}opencode auth login
opencode auth listSelect the configured api provider during authentication. In OpenCode, use /models to check the model. To remove old credentials, run opencode auth logout and select the provider when prompted.
Hermes Agent
Hermes Agent supports both Responses and Chat Completions modes. Start with Responses. If tool calls encounter protocol compatibility issues, switch to Chat Completions and test it separately.
Responses mode
custom_providers:
- name: khaix-responses
base_url: https://api.khaix.net/v1
key_env: KHAIX_API_KEY
api_mode: codex_responses
model:
provider: custom:khaix-responses
default: gpt-5.6-solChat Completions mode
custom_providers:
- name: khaix-chat
base_url: https://api.khaix.net/v1
key_env: KHAIX_API_KEY
api_mode: chat_completions
model:
provider: custom:khaix-chat
default: gpt-5.6-solWrite KHAIX_API_KEY=sk-replace-with-your-key to ~/.hermes/.env. Responses requests /v1/responses, while Chat mode requests /v1/chat/completions. If the model does not appear automatically, keep the manually configured model ID and test a conversation directly.
Cline
Cline connects through the OpenAI-compatible Chat Completions endpoint:
- Open Cline settings and select
OpenAI Compatibleas the API Provider. - Set the Base URL to
https://api.khaix.net/v1. - Enter the API Key and set Model ID to
gpt-5.6-sol. - Keep advanced model parameters at their defaults, then run Verify.
- After the connection succeeds, test a text task and one read-only tool call.
Enter the Base URL through /v1; Cline appends /chat/completions automatically.
Kilo Code
The following configuration applies to the current Kilo Code VS Code version and CLI. The JetBrains version has different provider capabilities and interface, so the fields in this section do not apply.
- Open Settings → Providers and select
Custom provider. - Set Provider ID to
khaixand Display name toKHaiXAPI. - Select
OpenAI Responsesfor Provider API. - Set the Base URL to
https://api.khaix.net/v1. - Enter the API Key and set Model to
gpt-5.6-sol. - Save and send a short text task. If the model does not appear automatically, add the model ID manually.
OpenClaw
Using the OpenClaw custom provider format, edit ~/.openclaw/openclaw.json. The configuration below enables text input only and reads the key from an environment variable.
{
"models": {
"providers": {
"api": {
"baseUrl": "https://api.khaix.net/v1",
"apiKey": "${KHAIX_API_KEY}",
"auth": "api-key",
"api": "openai-responses",
"authHeader": true,
"models": [
{
"id": "gpt-5.6-sol",
"name": "GPT-5.6 Sol",
"reasoning": true,
"input": ["text"]
}
]
}
}
},
"agents": {
"defaults": {
"model": {
"primary": "api/gpt-5.6-sol"
}
}
}
}Set KHAIX_API_KEY before starting, or use an OpenClaw SecretRef. After saving, restart the gateway or main process, then test text output and tool calls.
Pi and Aider
Pi Agent
Edit ~/.pi/agent/models.json. The configuration below uses Responses; for Chat Completions, change api to openai-completions.
{
"providers": {
"khaix": {
"baseUrl": "https://api.khaix.net/v1",
"api": "openai-responses",
"apiKey": "$KHAIX_API_KEY",
"models": [
{
"id": "gpt-5.6-sol",
"reasoning": true
}
]
}
}
}Aider
export OPENAI_API_BASE="https://api.khaix.net/v1"
export OPENAI_API_KEY="sk-replace-with-your-key"
aider --model openai/gpt-5.6-solVerification and permissions
- Text: Ask the agent to reply with a fixed phrase, then check the model, status code, and console record.
- Streaming: Send a longer text-only task and check for midstream disconnects or duplicated output.
- Tools: Allow reading only one non-sensitive file in the current directory, then check tool arguments, result submission, and the next model request.
- Errors: Enter a nonexistent model and confirm that the client displays an error instead of switching to another provider.
For authentication, URL, status-code, or interrupted-stream issues, follow the “cURL first, client second” sequence in Troubleshooting and security.