OpenCode
Configure the CodeNodex provider and model access in OpenCode.
Prepare a key
YOUR_API_KEY is a placeholder in public documentation. Sign in to generate a configuration using one of your API keys.
Generate configuration with my API keyConfigure the endpoint
This tool uses the OpenAI-compatible protocol. Enter the URL below as the client's Base URL.
https://your-domain.example/v1
One-click CLI setup (recommended)
Install the CodeNodex CLI to sign in, validate your API key, and prepare the matching local configuration.
Install CodeNodex CLI
curl -fsSL https://token.codenodex.com/cli/install.sh | bashiex "& { $(irm https://token.codenodex.com/cli/install.ps1) }"Sign in and configure OpenCode
Select an API key after signing in. The CLI verifies it and generates the OpenCode configuration for you to copy.
codenodex login -o "https://token.codenodex.com"
codenodex setup --client opencodeCopy configuration manually
If you do not use the CLI, replace YOUR_API_KEY with your API key. For real use, prefer the personalized configuration generator after signing in.
Manual configuration examples
{
"provider": {
"openai": {
"options": {
"baseURL": "https://your-domain.example/v1",
"apiKey": "YOUR_API_KEY"
},
"models": {
"gpt-5.2": {
"name": "GPT-5.2",
"limit": {
"context": 400000,
"output": 128000
},
"options": {
"store": false
},
"variants": {
"low": {},
"medium": {},
"high": {},
"xhigh": {}
}
},
"gpt-5.4": {
"name": "GPT-5.4",
"limit": {
"context": 1050000,
"output": 128000
},
"options": {
"store": false
},
"variants": {
"low": {},
"medium": {},
"high": {},
"xhigh": {}
}
},
"gpt-5.5": {
"name": "GPT-5.5",
"limit": {
"context": 1050000,
"output": 128000
},
"options": {
"store": false
},
"variants": {
"low": {},
"medium": {},
"high": {},
"xhigh": {}
}
},
"gpt-5.4-mini": {
"name": "GPT-5.4 Mini",
"limit": {
"context": 400000,
"output": 128000
},
"options": {
"store": false
},
"variants": {
"low": {},
"medium": {},
"high": {},
"xhigh": {}
}
},
"gpt-5.3-codex": {
"name": "GPT-5.3 Codex",
"limit": {
"context": 400000,
"output": 128000
},
"options": {
"store": false
},
"variants": {
"low": {},
"medium": {},
"high": {},
"xhigh": {}
}
},
"gpt-5.3-codex-spark": {
"name": "GPT-5.3 Codex Spark",
"limit": {
"context": 128000,
"output": 32000
},
"options": {
"store": false
},
"variants": {
"low": {},
"medium": {},
"high": {},
"xhigh": {}
}
}
}
}
},
"agent": {
"build": {
"options": {
"store": false
}
},
"plan": {
"options": {
"store": false
}
}
},
"$schema": "https://opencode.ai/config.json"
}Verify connectivity
Run this command. A successful model list means the endpoint and API key are working.
curl "https://your-domain.example/v1/models" -H "Authorization: Bearer YOUR_API_KEY"