opencode
opencode is a terminal AI coding agent. It can usually be configured with an OpenAI-compatible provider, which makes it suitable for DDTokens.
Configuration Values
Create an OpenAI-compatible provider with these values:
| Setting | Value |
|---|---|
| API Key | Your DDTokens API key |
| Base URL | https://apiddt.com/v1 |
| Model | gpt-4o-mini or a model shown in the dashboard |
Environment Variables
If your opencode configuration reads OpenAI environment variables, set:
bash
export OPENAI_API_KEY="$DDDT_API_KEY"
export OPENAI_BASE_URL="https://apiddt.com/v1"Verify
Open a test project and run a read-only task:
bash
opencode "summarize this repository"For the first verification, use a read-only question instead of asking the tool to edit files.
Troubleshooting
401: the API key is invalid or unavailable to the current terminal.404: the Base URL or request path is incorrect.429: a rate limit was reached; reduce concurrency and retry.- Model unavailable: use a model name from the dashboard model list.