
內容簡介
AI Provider for Command Code 外掛為 WordPress AI 客戶端新增 Command Code 作為提供者,透過單一 API 路由多個頂尖 AI 模型,簡化 API 金鑰管理,提升使用便利性。
【主要功能】
• 支援 Claude、GPT、Gemini 等多個模型
• 單一 API 金鑰涵蓋所有模型
• 實時獲取可用模型列表
• 支援工具調用與結構化輸出
• 可選擇零數據保留模式
外掛標籤
開發者團隊
② 後台搜尋「AI Provider for Command Code」→ 直接安裝(推薦)
原文外掛簡介
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.
The model list is fetched live from GET /provider/v1/models, including newly added models.
Claude models are called on the Anthropic Messages endpoint, everything else on the
OpenAI-compatible chat completions endpoint — matching the supported_endpoints field the API
reports for each model.
Tool calling, structured output (JSON schema), chat history, stop sequences and multi-candidate
generation are supported where the model supports them.
Zero data retention can be requested per request (see below).
Configuration
The API key is read, in order of precedence, from:
The COMMANDCODE_API_KEY environment variable
The COMMANDCODE_API_KEY PHP constant
The connectors_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.
Default: claude-sonnet-5.
COMMANDCODE_ZDR — set to 1 to send x-cmd-zdr: 1 and route only through zero-data-retention
upstreams. Requests fail with a 422 when the chosen model has no ZDR-capable upstream instead of
silently falling back. Default: off.
COMMANDCODE_BASE_URL — Provider API base URL.
Default: https://api.commandcode.ai/provider/v1.
COMMANDCODE_MODEL_INPUT_MODALITIES — comma-separated list of modalities your models accept.
Include 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.
If a feature that needs JSON (e.g. Editorial Notes) fails with
400 … “param”:”response_format”, try 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;
} );
External services
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 checks
whether your credentials work. No user content is sent; only your API key, so Command Code can
return the models available to your account.
POST /chat/completions — called whenever any plugin or theme on your site uses the WordPress AI
Client to generate text with a non-Claude model. The request carries your API key and the prompt:
messages, system instruction, tool definitions, and any other parameters the calling code supplied
(conversation history, a JSON schema for structured output, or files attached to the prompt).
POST /messages — the same as above, for Claude models, which Command Code serves only on this
endpoint.
No 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:
Provider API documentation: https://commandcode.ai/docs/provider
Terms of Service: https://commandcode.ai/terms
Privacy Policy: https://commandcode.ai/privacy
Zero data retention: https://commandcode.ai/docs/resources/zdr
