Hermes, OpenClaw and SDKs
The Hermes and OpenClaw agents, and your scripts built on the official SDKs, connect to codexkey with one address and one key.
Hermes Agent
Open ~/.hermes/config.yaml:
yaml (~/.hermes/config.yaml)
model:
provider: custom
default: gpt-6-astra
context_length: 1000000
base_url: https://api.codexkey.online/v1
api_mode: chat_completions
api_key: sk_cdx_YOUR_KEYFor Claude, set api_mode: anthropic_messages and put a Claude model in default. The context_length parameter is required: without it Hermes assumes a 128K model.
OpenClaw
Open ~/.openclaw/openclaw.json:
json (~/.openclaw/openclaw.json)
{
"models": {
"mode": "merge",
"providers": {
"codexkey": {
"baseUrl": "https://api.codexkey.online/v1",
"apiKey": "sk_cdx_YOUR_KEY",
"api": "openai-completions",
"models": [
{ "id": "gpt-6-astra", "name": "GPT-6 Astra", "contextWindow": 1000000, "maxTokens": 128000 },
{ "id": "claude-sonnet-5", "name": "Claude Sonnet 5", "contextWindow": 1000000, "maxTokens": 32000 }
]
}
}
},
"agents": { "defaults": { "model": { "primary": "codexkey/gpt-6-astra" } } }
}Then run openclaw gateway restart and openclaw doctor.
SDKs and your own scripts
- OpenAI SDK:
base_url = https://api.codexkey.online/v1, enter the key as usual. - Anthropic SDK:
base_url = https://api.codexkey.online, enter the key as usual.
See request examples in the API reference and on the Python, TypeScript and cURL pages.