One Coding Budget, Three API Protocols: Route Claude Code, Codex, and OpenCode Correctly
AceDataCloud Coding Plan is for developers who want one time-limited, usage-metered budget across several coding-model families without pretending that every client speaks the same API protocol. At the time of writing, t
AceDataCloud Coding Plan is for developers who want one time-limited, usage-metered budget across several coding-model families without pretending that every client speaks the same API protocol. At the time of writing, the entry tier is Coding Plus: $14.645677 for 500 Credits over 30 days (with a Β₯99 CNY display anchor). Higher tiers provide 1,600, 4,000, or 10,000 Credits for the same 30-day duration.
The useful architectural idea is simple: keep one Coding Application credential, but route each client through the protocol it actually supports.
Start with the protocol, not the model logo
The plan exposes three relevant interface shapes:
- Claude Messages for Claude-native clients such as Claude Code.
- OpenAI Responses for clients built around the Responses API, including Codex workflows.
- OpenAI-compatible Chat Completions for configurable clients such as OpenCode and Kimi Code.
The public service currently covers Claude, GPT/Codex, GLM, Kimi, and DeepSeek coding families, while the exact model directory can change. This distinction matters: a model family being available does not mean every client can call it through every protocol.
A practical routing policy is:
| Workload | Client/protocol choice | Budget reason |
|---|---|---|
| Repository exploration and Claude-native agent loops | Claude Code / Messages | Preserve the client's native request format and tool behavior |
| Codex-oriented implementation tasks | Codex / Responses | Avoid translating a Responses workflow into Chat Completions |
| Model comparison, smaller edits, or configurable automation | OpenCode / Chat Completions | Easy provider configuration and explicit model selection |
Do not hard-code a model name copied from an old article. Query the live directory, then cross-check the selected ID against your Coding credential's API scope and the protocol supported by the client.
curl https://api.acedata.cloud/v1/models \
-H "Authorization: Bearer $ACEDATACLOUD_API_KEY"
Each returned id is a model name suitable for the API model field. The directory is global, so its presence alone does not prove that your Coding Application can use that model.
Minimal Claude Code configuration
For Claude Code, use the Anthropic-style endpoint instead of forcing an OpenAI-compatible adapter. Keep the token out of a shared repository:
export ANTHROPIC_BASE_URL="https://api.acedata.cloud"
export ANTHROPIC_AUTH_TOKEN="YOUR_CODING_APPLICATION_KEY"
unset ANTHROPIC_API_KEY
cd /path/to/project
claude
For project-local configuration, create a gitignored .claude/settings.local.json:
{
"env": {
"ANTHROPIC_BASE_URL": "https://api.acedata.cloud",
"ANTHROPIC_AUTH_TOKEN": "YOUR_CODING_APPLICATION_KEY"
}
}
Choose one method, not both. A stale ANTHROPIC_API_KEY can send authentication down the wrong path, which is why the shell example removes it rather than assigning an empty value.
Validate with a bounded, read-only prompt such as: βRead README.md and summarize it in one sentence.β Then check the Coding Application's usage history. This is a real metered request, so keep the first verification small.
Minimal OpenCode configuration
OpenCode is useful when you want explicit model routing through Chat Completions. Put the key in an environment variable:
export ACEDATACLOUD_API_KEY="YOUR_CODING_APPLICATION_KEY"
Then configure ~/.config/opencode/opencode.json:
{
"$schema": "https://opencode.ai/config.json",
"provider": {
"acedatacloud": {
"npm": "@ai-sdk/openai-compatible",
"name": "Ace Data Cloud",
"options": {
"baseURL": "https://api.acedata.cloud/v1",
"apiKey": "{env:ACEDATACLOUD_API_KEY}"
},
"models": {
"MODEL_ID": {
"name": "MODEL_ID"
}
}
}
}
}
Replace both MODEL_ID values with the same exact id returned by /v1/models. The OpenCode adapter above uses Chat Completions; it is not a generic guarantee that the selected model supports every other interface.
Run a configuration check before a large repository task:
opencode auth list
opencode models acedatacloud
opencode run --model acedatacloud/MODEL_ID "Reply only OK"
The final command is metered. If the model is absent, check the JSON path, exact ID, credential scope, and protocol before changing anything else.
Make Credits a routing constraint
Credits are deducted by usage, not by a flat βunlimited requestsβ promise. Consumption can vary with model, input context, cache behavior, output length, tools, and parallel agents. That makes task design part of budget control.
Use three guardrails:
- Set a task ceiling. Ask for a plan or repository map before allowing edits across many files.
- Route by difficulty. Use a stronger model for architecture or a difficult refactor, and a lower-cost eligible model for formatting, tests, or repetitive changes.
- Measure after the first representative run. Check usage history, estimate how many similar tasks fit the remaining Credits, and revise the route before launching parallel agents.
The effective package acquisition cost is easy to audit. For Coding Plus, it is $14.645677 / 500 = $0.029291354 per acquired Credit at the currently published package price and amount. That number is not a model token price: the model's Credit deductions still depend on the metered request. Avoid comparing it directly with a consumer subscription fee or with an API token rate that uses different cache, context, or service assumptions.
Failure checklist
- 401: verify that the key belongs to the Coding Application, remove conflicting environment variables, and restart the client completely.
-
Model not found: refresh
/v1/models, copy the exactid, and check credential API permissions. - Client still calls its old host: confirm that you edited the config for the same OS user and workspace that launches the client.
- Balance appears unavailable: the Coding Application does not fall back to a general platform balance; renew or add Credits to the Coding Application.
The complete Coding Plan setup center links client-specific guides. Current plans and checkout details are on the Coding Plan product page, and the underlying plan fields are available from the public service JSON.
The main takeaway is not βuse one model everywhere.β It is: keep one measurable budget, preserve each client's native protocol, and select models only after validating the live directory, credential scope, and task cost.
Originally published by Dev.to AI. Aggregated on AIWithGhost for educational purposes β full credit and traffic to the original publisher.