opencode configures providers in opencode.json using AI-SDK adapters. Use @ai-sdk/openai-compatible, set baseURL to DaoXE, and list your model IDs. One provider block then unlocks every vendor behind your key — see the cheapest APIs guide.
Why route opencode through DaoXE#
- Terminal agent. opencode runs multi-step tasks from your shell using your DaoXE model.
- Declarative providers. One JSON block adds DaoXE and its models.
- One key, many vendors. GPT, Claude, Gemini, DeepSeek and Kimi behind a single key.
Set it up in opencode#
- Open opencode.json. Create/edit
opencode.json(project) or~/.config/opencode/opencode.json(global). - Add the provider. Under
provider, usenpm: "@ai-sdk/openai-compatible"and setoptions.baseURLtohttps://daoxe.com/v1. - List exact model IDs. Under
models, add keys that match IDs fromGET /v1/models. Set the key via env inoptions.apiKey. - Restart & verify. Restart opencode and run
/modelsto confirm DaoXE and its models appear.
// opencode.json (project) or ~/.config/opencode/opencode.json (global)
{
"$schema": "https://opencode.ai/config.json",
"provider": {
"daoxe": {
"npm": "@ai-sdk/openai-compatible",
"name": "DaoXE",
"options": {
"baseURL": "https://daoxe.com/v1",
"apiKey": "{env:DAOXE_API_KEY}"
},
"models": {
"YOUR_EXACT_MODEL_ID": { "name": "DaoXE model" }
}
}
}
}Caveats worth knowing
Use @ai-sdk/openai-compatible for /v1/chat/completions; if a specific model requires /v1/responses, use @ai-sdk/openai for it instead. Model keys must exactly match your account's IDs (GET /v1/models). You can hydrate limits/pricing metadata from models.dev, but the model key still has to be the real ID. Restart after editing the config.
Verify you actually get the model#
Prove the endpoint works before blaming the client — if this fails, no setting will fix it:
export DAOXE_API_KEY="your_api_key"
# List the exact model IDs your account can call
curl --fail-with-body --show-error --silent \
https://daoxe.com/v1/models \
-H "Authorization: Bearer ${DAOXE_API_KEY}"Confirm the endpoint independently, then diff a fixed prompt against the official API at temperature 0:
curl --fail-with-body --show-error --silent \
https://daoxe.com/v1/chat/completions \
-H "Authorization: Bearer ${DAOXE_API_KEY}" \
-H "Content-Type: application/json" \
-d '{
"model": "YOUR_EXACT_MODEL_ID",
"max_tokens": 64,
"messages": [{"role": "user", "content": "Say hello in one sentence."}]
}'Verify us — don't trust us
Point the open benchmark at DaoXE and at the official API and compare at temperature 0. Then learn to detect model swapping so a cheaper endpoint can't quietly swap you to a smaller model.
Frequently asked questions#
Which npm adapter do I use?
@ai-sdk/openai-compatible for chat completions. For a model that needs /v1/responses, use @ai-sdk/openai.
Where does the base URL go?
In options.baseURL = https://daoxe.com/v1 inside your provider block.
My model doesn't show in /models — why?
The model key must equal an exact ID from GET /v1/models, and you must restart opencode after editing the config.
How do I keep my key out of the file?
Reference an environment variable in options.apiKey and export DAOXE_API_KEY.
Try DaoXE — and benchmark it yourself
One key for GPT, Claude, Gemini, DeepSeek and more. Point the open benchmark at us and compare — don't take our word for it.