feat(provider): add Command Code (commandcode.ai) as a first-class provider
Author: dlivxprCreated Sep 2, 2026Updated Sep 2, 2026
Labelsnew: provider/gateway
Summary
Request to add Command Code (Provider API / GOAT & Pro Plans) as a first-class provider in OpenClaude.
Command Code provides unified access to 30+ top open-source and closed-source models (DeepSeek, GLM, MiniMax, Kimi, Claude, GPT, etc.) with prompt caching, usage-based metering, and standard OpenAI / Anthropic compatibility.
Provider Technical Specifications
- Provider ID:
commandcode - Base URL:
https://api.commandcode.ai/provider/v1 - Authentication:
- Environment Variable:
CMD_API_KEY(fallback:COMMANDCODE_API_KEY) - Header:
Authorization: Bearer <CMD_API_KEY>(also supportsx-api-key: <CMD_API_KEY>for Anthropic endpoint) - Security: Restrict via
dedicatedCredentialsOnly: trueto prevent genericOPENAI_API_KEYcross-contamination.
- Environment Variable:
- Dual-Endpoint Contract:
- OpenAI / Open-Source Models (e.g.,
deepseek/deepseek-v4-flash,moonshotai/kimi-k2.5):- Endpoint:
POST https://api.commandcode.ai/provider/v1/chat/completions - Format: OpenAI Chat Completions schema (streaming supported with
stream_options: {"include_usage": true}).
- Endpoint:
- Anthropic Claude Models (e.g.,
claude-sonnet-5,claude-sonnet-4-6):- Endpoint:
POST https://api.commandcode.ai/provider/v1/messages - Format: Native Anthropic Messages schema (usage emitted via
message_delta).
- Endpoint:
- Note: Command Code strictly returns
400if Claude models are sent to/chat/completionsor vice versa.
- OpenAI / Open-Source Models (e.g.,
- Model Discovery:
- Endpoint:
GET https://api.commandcode.ai/provider/v1/models - Default Fallback Model:
deepseek/deepseek-v4-flash
- Endpoint:
- Optional Headers:
x-cmd-zdr: 1(Enforces zero data retention / no-training mode when enabled).
Proposed Implementation
- Descriptor (
src/integrations/):- Register a
commandcodegateway/vendor descriptor withCMD_API_KEYcredential setup. - Configure model discovery pointing to
https://api.commandcode.ai/provider/v1/models. - Implement route-level transport selection: route Claude model identifiers to the Anthropic Messages transport, and OpenAI/open-source models to the OpenAI-compatible shim.
- Register a
- Interactive Preset (
/provider):- Add Command Code to the interactive
/providersetup wizard. - Support startup auto-detection when
CMD_API_KEYis present in the environment.
- Add Command Code to the interactive
- CLI & Profile Integration:
- Support
--provider commandcodeand persistent provider profiles.
- Support
Acceptance Criteria
-
commandcodeappears in/providerinteractive setup and--provider commandcodeCLI flag. - Correct credential isolation (
CMD_API_KEYis not leaked or overridden by genericOPENAI_API_KEY). - Dynamic model catalog is fetched from
https://api.commandcode.ai/provider/v1/models. - OpenAI/open-source models route cleanly to
/v1/chat/completionsand Claude models to/v1/messages. - Unit tests, lint, and typechecks pass.
References
- Command Code Provider API: https://commandcode.ai/docs/provider
- Available Models Catalog: https://commandcode.ai/docs/reference/cli/models
- GOAT Plan: https://commandcode.ai/docs/plans/goat
- Zero Data Retention (ZDR): https://commandcode.ai/docs/resources/zdr
Source: Gitlawb/openclaude