Adds Command Code as a provider for the WordPress AI Client.
Command Code routes Claude, GPT, Gemini and the top open models through a single API with
OpenAI-compatible and Anthropic-compatible endpoints, so one API key covers every model the
AI plugin can use.
GET /provider/v1/models, including newly added models.supported_endpoints field the APIThe API key is read, in order of precedence, from:
COMMANDCODE_API_KEY environment variableCOMMANDCODE_API_KEY PHP constantconnectors_ai_commandcode_api_key option (Settings Connectors)All optional settings are environment variables or PHP constants:
COMMANDCODE_DEFAULT_MODEL — model ID to prefer in pickers and feature filters.claude-sonnet-5.COMMANDCODE_ZDR — set to 1 to send x-cmd-zdr: 1 and route only through zero-data-retentionCOMMANDCODE_BASE_URL — Provider API base URL.https://api.commandcode.ai/provider/v1.COMMANDCODE_MODEL_INPUT_MODALITIES — comma-separated list of modalities your models accept.image (e.g. text,image) for deployments that require vision features. Default: text only.COMMANDCODE_REQUEST_TIMEOUT — request timeout in seconds. Default: 120.COMMANDCODE_CONNECT_TIMEOUT — connection timeout in seconds. Default: 10.COMMANDCODE_STRUCTURED_OUTPUT — how JSON response requests are shaped. One of:
json_schema (default) — sends the JSON schema. Use this by default.json_object — asks only for valid JSON, without the schema. Widely supported fallback.none — sends no response_format at all. Use this when a model rejects every form of it.json_object.To influence which models the AI plugin picks for its features, use the standard filters in your own
plugin or theme — this plugin already puts its preferred model first:
add_filter( 'wpai_preferred_text_models', function ( $models ) {
array_unshift( $models, array( 'commandcode', 'gpt-5.6-luna' ) );
return $models;
} );<h3>External services</h3>
This plugin connects to the Command Code Provider API, an external service operated by Command Code.
It is required so the WordPress AI Client can route requests to models from your site. Command Code is
a paid service: a plan with API access is needed (the free Go plan has none), and requests are billed
to your Command Code account.
The plugin contacts the following endpoints under https://api.commandcode.ai/provider/v1:
GET /models — called when the AI Client refreshes its list of available models, and when it checksPOST /chat/completions — called whenever any plugin or theme on your site uses the WordPress AIPOST /messages — the same as above, for Claude models, which Command Code serves only on thisNo request is made until something on your site asks the AI Client for a generation, or the AI Client
refreshes its model list. Your API key is stored on your own site and is only ever sent to
api.commandcode.ai.
Optional: setting COMMANDCODE_ZDR=1 adds an x-cmd-zdr: 1 header, asking Command Code to route the
request only through zero-data-retention upstreams. Requests fail with a 422 when a chosen model has
no such upstream, rather than falling back silently.
This service is provided by Command Code: