| [ Web Proxy ] |
| Viewing: https://commandcode.ai/docs/provider | [Back] [Original] |
Every top model, one API. Call Command Code's models from any OpenAI- or Anthropic-compatible client. Pay as you go, no markup, every deal applied automatically.
The Provider plan starts at $15/month + $1.01 card processing fee. Pay as you go, no markup.
Per-model rates and the full plan comparison live on Pricing & Limits.
| Endpoint | Method | Format |
|---|---|---|
https://api.commandcode.ai/provider/v1/chat/completionsCopy | POST | OpenAI Chat Completions |
https://api.commandcode.ai/provider/v1/messagesCopy | POST | Anthropic Messages |
https://api.commandcode.ai/provider/v1/modelsCopy | GET | Models list |
Subscribe and get an API key
Every plan except the Go plan has API access - GOAT, Pro, Max, Team, and Provider all use these endpoints (see Pricing above). Subscribe, then create your API key from Studio. The same key authenticates the CLI and the API. Coding plans meter API usage against their own credits and per-model access; the Provider plan is the pay-as-you-go tier built for production API traffic.
Send a request
Once you have your API key, you can send a request to one of the following endpoints.
OpenAI Chat Completions /v1/chat/completions
Request and response bodies follow the OpenAI Chat Completions schema.
curl https://api.commandcode.ai/provider/v1/chat/completions \
-H "Authorization: Bearer <CMD_API_KEY>" \
-H "Content-Type: application/json" \
-d '{
"model": "deepseek/deepseek-v4-flash",
"messages": [{"role": "user", "content": "Write a haiku about race conditions."}]
}'
Anthropic Messages /v1/messages
Request and response bodies follow the Anthropic Messages schema.
curl https://api.commandcode.ai/provider/v1/messages \
-H "Authorization: Bearer <CMD_API_KEY>" \
-H "Content-Type: application/json" \
-d '{
"model": "claude-sonnet-4-6",
"max_tokens": 1024,
"messages": [{"role": "user", "content": "Write a haiku about race conditions."}]
}'
All Command Code models are available via the API, see Pricing & Limits for the full model list and per-model pricing. You can fetch the live models list at runtime from /provider/v1/models.
curl https://api.commandcode.ai/provider/v1/models
Streaming is supported and can be received by setting stream: true.
curl https://api.commandcode.ai/provider/v1/chat/completions \
-H "Authorization: Bearer <CMD_API_KEY>" \
-H "Content-Type: application/json" \
--no-buffer \
-d '{
"model": "deepseek/deepseek-v4-flash",
"messages": [{"role": "user", "content": "Count to 5."}],
"stream": true,
"stream_options": {"include_usage": true}
}'
Both endpoints emit token usage at the end of every stream - OpenAI clients see a final usage chunk, Anthropic clients see usage in the message_delta event. No opt-in required.
Send the header x-cmd-zdr: 1 on any request to enforce zero data retention and no prompt training - the same opt-in the CLI exposes via CMD_ZDR=1. When set, the request routes only through ZDR-capable upstreams: if a model has no ZDR-capable upstream the request fails with a 422 (cmd_zdr_no_providers) rather than falling back to a non-ZDR provider.
ZDR can change which upstream serves your request, so it may cost more depending on the provider. Anthropic models on /v1/messages are zero-data-retention at the account level, so the header is accepted there for parity but does not change routing.
curl https://api.commandcode.ai/provider/v1/chat/completions \
-H "Authorization: Bearer <CMD_API_KEY>" \
-H "Content-Type: application/json" \
-H "x-cmd-zdr: 1" \
-d '{
"model": "deepseek/deepseek-v4-flash",
"messages": [{"role": "user", "content": "Write a haiku about race conditions."}]
}'
OpenAI clients see the standard error envelope:
{
"error": {
"message": "",
"type": "invalid_request_error" | "authentication_error" | "permission_error" | "rate_limit_error" | "server_error",
"code": "",
"param": ""
}
}
Anthropic clients see:
{
"type": "error",
"error": {
"type": "invalid_request_error" | "authentication_error" | "permission_error" | "rate_limit_error" | "api_error",
"message": ""
}
}
Here are the common error cases:
| Status | Code / Type | When |
|---|---|---|
400 | unsupported_model | Model isn't in the catalog (OpenAI shape only - code is on the OpenAI envelope; the Anthropic envelope has type: invalid_request_error instead). |
400 | invalid_request_error | Wrong endpoint for the model (Claude on /chat/completions or non-Anthropic on /messages), bad request body, or malformed JSON. |
401 | authentication_error | Missing or invalid auth - pass Authorization: Bearer <token> (any route) or x-api-key: <token> (Anthropic SDK on /messages). |
403 | upgrade_required | You're on the Go plan, the only plan without API access. Upgrade to GOAT or higher. |
422 | cmd_zdr_no_providers | x-cmd-zdr: 1 was set but the model has no zero-data-retention upstream. Remove the header or pick a different model. |
429 | rate_limit_error | Rate-limited by the upstream. Retry with backoff. |
5xx | server_error / api_error | Upstream failure. The body carries the upstream provider's error message. |
Every plan except the Go plan has API access. GOAT, Pro, Max, and Team have API access. You can call the Provider API with your Command Code API key, and your usage is metered against the plan credits. Provider plan is pay as you go, and has no usage windows/limits.
Subscribe
Pick the Provider plan from Studio > Billing or the pricing page. You pay as you go at API rates, see Pricing above.
Create an API key
The same key authenticates the CLI and the API. Create one from your API keys page in Studio.
Call the API
Point any OpenAI or Anthropic compatible client at https://api.commandcode.ai/provider/v1Copy and send your first request.
curl https://api.commandcode.ai/provider/v1/chat/completions \
-H "Authorization: Bearer <CMD_API_KEY>" \
-H "Content-Type: application/json" \
-d '{
"model": "deepseek/deepseek-v4-flash",
"messages": [{"role": "user", "content": "Write a haiku about race conditions."}]
}'
Read the Quickstart above for more details.
What is Command Provider?
Command Provider is every top AI model (commercial & open) on one API. OpenAI or Anthropic compatible API endpoints. Pay as you go. No markup. Superb speed, reliability, and extended limits. Every deal auto applied.
Why use it?
There are thousands of models available how do you pick the best one? We got you covered. You get the exact model you ask for, at the rate it costs. Nothing downgraded. Nothing rerouted.
Will it work with my agent?
Yes. The provider api has both OpenAI and Anthropic compatible endpoints, any client or agent can use them. No lock-in. Use it anywhere.
Which models can I call?
Anthropic, OpenAI, Google, and the strongest open-source, listed in the Models section. Each endpoint takes its native shape. /chat/completions for OpenAI and open-source. /messages for Anthropic. Send a Claude model to /chat/completions and you get a 400 pointing you to /messages, and the reverse.
What can I send in a message?
Text and images. Audio, file, and document parts are rejected by the schema. Pick a model without vision and the upstream provider returns its own error, we don't pre-gate per model.
What does it cost?
$15 a month, plus a card processing fee. You get $15 of usage included. After that, pay as you go. Requests bill at the underlying rates, no markup. Spend only on what you call. Top-ups roll over and never expire.
Which plan do I need to access Command models via API?
Every plan except the Go plan can call the Provider API - GOAT, Pro, Max, and Team all use these endpoints, metered against their own credits and per-model access. The Provider plan is the one built for API traffic: full access to every Command Code model, OpenAI or Anthropic compatible endpoints, pay as you go, no markup, superb speed, reliability, extended limits, and every deal auto applied.
Are the deals included?
Yes. Every active deal applies to every request, automatically. The permanent discounts. The usage multipliers. See the live list on Pricing & Limits.
Can I cancel?
Any time. No commitments. Cancel from Studio > Billing. Your top-up credits roll over and never expire.
What happens to my data?
It stays yours. We never train on your data or sell it. We enable zero-data-retention and no-training settings with upstream providers wherever they offer them, and CMD_ZDR=1 routes only through ZDR-capable providers or fails the request. Some models are served by providers that don't offer these settings, and free or promotional models may run under different provider terms; in those cases, the provider's own policies apply. We want AI agents to work for everyone. Open-source models are available globally with infrastructure in the US, EU, and Singapore for reliable access worldwide. For more options, contact us at support@commandcode.ai to discuss Team & Enterprise plans. Read the Privacy Policy.
Do you support zero data retention (ZDR)?
Yes. 99% of our models route through ZDR-capable upstreams. Run the CLI with CMD_ZDR=1 (for example, CMD_ZDR=1 cmd) to enforce both zero data retention and no prompt training on every request across all plans. A small handful of models don't yet have a ZDR-capable upstream; under CMD_ZDR=1 those requests will either pass to a ZDR-capable provider or fail rather than route through a non-zdr provider. We're actively adding ZDR coverage to the remaining models. ZDR can change which upstream provider that serves your request, and so it may charge more depending on the provider. Need ZDR on a specific model that doesn't have it today? Email support@commandcode.ai. On the Provider API, send the x-cmd-zdr: 1 header to enforce the same opt-in - see Zero data retention.
| Web Proxy Viewer | New URL | Original Page |