Command Code Provider API
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.
This page is about calling Command Code's models from your own code. Going the other way, bringing a third-party endpoint into the Command Code CLI is in BYOK Providers.
- Every top model: The best open & closed models on one API: Claude, GPT, Gemini, & top open-models.
- Fast, no limits: Best-in-class speed and performance, with rate limits built for production, not demos.
- Build anything: Standard OpenAI and Anthropic endpoints. Use any agent, anywhere. No lock-in.
Pay as you go from credits. Buy them from Studio > Billing. Requests bill at the underlying API rates, no markup.
Credits never expire: any unused credit rolls over. Plans from GOAT up also include API access, and your plan allowance pays list price. Go uses it with credits: the Go allowance never pays an API request.
Per-model rates and the full plan comparison live on Pricing & Limits.
| Endpoint | Method | Format |
|---|---|---|
https://api.commandcode.ai/provider/v1/chat/completions | POST | OpenAI Chat Completions |
https://api.commandcode.ai/provider/v1/responses | POST | OpenAI Responses |
https://api.commandcode.ai/provider/v1/messages | POST | Anthropic Messages |
https://api.commandcode.ai/provider/v1/models | GET | Models list |
https://api.commandcode.ai/provider/v1/systemone | POST | System One decisions (typesafe/jev) |
Get access and an API key
GOAT, Pro, Max, and Team include API access, metered against their own credits and per-model access. The Go plan uses it with credits: free and purchased credits pay, and the Go allowance never does. Without a plan, pay as you go from credits (see Pricing above). Then create your API key from Studio. The same key authenticates the CLI and the API.
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.
OpenAI Responses /v1/responses
Request and response bodies follow the OpenAI Responses schema. Available for OpenAI models and open models. Claude models stay on /v1/messages.
Tool arrays pass through as you send them. function and custom tools are executed by your client, and built-in declarations such as web_search are forwarded for the upstream to accept or refuse, so an agent client that sends a mixed array works unchanged. Two exceptions. Remote type: "mcp" tools are rejected, because the upstream would dial your server on our credential. Run the MCP server on your side and declare its tools as type: "function" instead. Requests sent with x-cmd-zdr: 1 accept only tools your own client executes, which today means function, custom and local_shell. Anything else is refused, because running it would send your content somewhere zero data retention cannot cover.
Anthropic Messages /v1/messages
Request and response bodies follow the Anthropic Messages schema. Available for Claude models, and for GLM-5.3 Flash, Kimi K3 and DeepSeek V4.1 Flash.
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.
OpenAI and open models answer on /v1/chat/completions, and most of them on /v1/responses as well. Claude models answer on /v1/messages only, and GLM-5.3 Flash, Kimi K3 and DeepSeek V4.1 Flash answer there too. Each model in the models list https://api.commandcode.ai/provider/v1/models carries a supported_endpoints field with the routes that serve it, so check there before you pick an endpoint.
List models
typesafe/jev is a decision model that is available on a separate endpoint v1/systemone on Provider API. It takes a state and typed questions and returns probabilities, never text. It has its own endpoint because its request is not a chat message, and it never streams.
typesafe/jev-1.14.0 is the 1.14.0 release of Jev, pinned. Send it as the model on the same endpoint, with the same request shape and the same price.
The request and response follow TypeSafe's System One shape:
| Type | Asks | criteria | Returns |
|---|---|---|---|
noul | Is this true? | optional {"true": ..., "false": ...} descriptions | noul, the probability of yes |
choice | Which one? | object, option to description | choice, confidence, and probabilities |
score | Where on a rubric? | array of at least two levels, lowest first | score, confidence, legend, and probabilities |
One request takes up to 100 questions. They share one state, so send related questions together instead of splitting them across calls. The model's own budget is 64K tokens for the state plus all questions, and 32K for the state plus the longest single question.
Streaming is supported and can be received by setting stream: true.
Streaming
Every endpoint emits token usage at the end of every stream. Chat Completions clients see a final usage chunk. Responses clients see usage on the terminal response.completed event. 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.
The decision model typesafe/jev has no ZDR-capable upstream, so a request for it with the header set is refused with that same 422, and so is typesafe/jev-1.14.0. On models where ZDR is included, the header keeps the same price and plan usage. On the rest it 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 already, so the header is accepted there for parity but doesn't affect routing. For how ZDR routing and pass-through pricing work, and how to negotiate committed ZDR rates, see Zero Data Retention.
Zero data retention
OpenAI clients see the standard error envelope:
Anthropic clients see:
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 /responses, or a model /responses or /messages cannot serve), 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 with no credits: "Go plans use the Provider API with credits. Add credits or upgrade to GOAT." Go uses the API on free and purchased credits only. |
403 | model_region_unavailable | The model isn't served in your region. Other models on your plan still work, and the refused request isn't charged. |
403 | content_policy_refused | The model refused the request under its content policy. The refused request isn't charged. |
403 | upstream_refused | The model's provider refused the request for another reason. The refused request isn't charged. |
413 | request_too_large | Request body over 32 MiB (33,554,432 bytes), the same limit as Anthropic's API. Usually base64 images resent with the history: cap the total image bytes per request, drop earlier images, or compact. Don't retry the same body. The Anthropic envelope carries it as type: request_too_large. |
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. |
502 | model_temporarily_unavailable | The model is unavailable because of an issue on our side. Other models on your plan still work, and the failed request isn't charged. |
502 | upstream_unavailable | We couldn't reach the model because of an issue on our side. Retry later; the failed request isn't charged. |
503 | overloaded_error | /messages only: no Messages lane can serve GLM-5.3 Flash, Kimi K3 or DeepSeek V4.1 Flash right now. Retry later. |
5xx | server_error / api_error | Upstream failure. The message is generic; retry with backoff. |
The code values above are on the OpenAI envelope only; on /messages the same errors carry just the status, type and message.
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. The Go plan uses it with credits. Without a plan, pay as you go from credits with no usage windows.
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/v1 and send your first request.
Provider API Example Requests
Read the Quickstart above for more details.
What is Command Provider?
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?
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?
Will it work with my agent?
Yes. The provider api has OpenAI Chat Completions, OpenAI Responses, and Anthropic compatible endpoints, any client or agent can use them. No lock-in. Use it anywhere.
Which models can I call?
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 or /responses for OpenAI and open-source. /messages for Anthropic, and for GLM-5.3 Flash, Kimi K3 and DeepSeek V4.1 Flash. Send a Claude model to /chat/completions or /responses and you get a 400 pointing you to /messages, and a model /messages cannot serve gets a 400 pointing you to /chat/completions.
What can I send in a message?
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?
What does it cost?
Pay as you go from credits. Requests bill at the underlying rates, no markup. Spend only on what you call. Credits roll over and never expire.
Which plan do I need to access Command models via API?
Which plan do I need to access Command models via API?
Are the deals included?
Are the deals included?
Yes. Every active deal applies to every request, automatically. The discounts. The usage multipliers. See the live list on Pricing & Limits.
Can I cancel?
Can I cancel?
Any time. No commitments. Cancel a plan from Studio > Billing. Your credits roll over and never expire.
What happens to my data?
What happens to my data?
When you enable zero data retention, we enforce it with upstream providers, or the request fails. Some models are served by providers that don't offer zero data retention or no-training 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)?
Do you support zero data retention (ZDR)?
Yes. 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. Some models don't have a ZDR-capable upstream yet; under CMD_ZDR=1 those requests fail rather than route through a non-ZDR provider. We're actively adding ZDR coverage to the remaining models. 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.