OpenCode
Start OpenCode in a shell with DODO_ROUTER_URL and DODO_ROUTER_API_KEY set. Verify your router URL and key.
Add this provider to your project's opencode.jsonc. The {env:NAME} references are resolved by OpenCode, so you can share the configuration without saving the key in the project.
{
"$schema": "https://opencode.ai/config.json",
"provider": {
"dodorouter": {
"npm": "@ai-sdk/openai-compatible",
"options": {
"baseURL": "{env:DODO_ROUTER_URL}/v1",
"apiKey": "{env:DODO_ROUTER_API_KEY}"
},
"models": {
"default": { "name": "DodoRouter" }
}
}
}
}
Run a single prompt from that project. The -m flag selects the provider and model entry defined above.
opencode run -m dodorouter/default "Reply with the word pong."
In Logs, select the router and open the request containing your prompt to inspect the model and response. If OpenCode cannot find the model, run opencode models dodorouter from the same project and look for dodorouter/default.
This example uses the OpenCode 1 configuration format. OpenCode also documents how to migrate providers into its native version 2 format. OpenCode configuration migration.