AIMirrorXAIMirrorX
AIMirrorX Customer GuideHelp & SupportBusiness CooperationPolicies & TermsUser GuideAPI ReferenceAI Applications

Protocols and URLs: Chat, Responses, Claude and Gemini

Service origins, SDK base URLs and native protocol prefixes differ.

Endpoint reference

ProtocolComplete request URLAuthentication and requirements
Model listGET https://api.aimirrorx.com/v1/modelsAuthorization: Bearer YOUR_API_KEY
OpenAI ChatPOST https://api.aimirrorx.com/v1/chat/completionsBearer; requires a Chat-compatible model/channel
OpenAI ResponsesPOST https://api.aimirrorx.com/v1/responsesBearer; requires a Responses-compatible model/channel
Claude MessagesPOST https://api.aimirrorx.com/v1/messagesx-api-key and anthropic-version; requires a Messages-compatible channel
Native GeminiPOST https://api.aimirrorx.com/v1beta/models/MODEL_ID:generateContentx-goog-api-key; requires a Gemini-protocol channel

Each protocol needs a compatible channel and model. Select a model from /v1/models and confirm protocol compatibility. Image inputs, tool calls, structured outputs, caching and reasoning parameters also vary by model and channel.

Responses

curl https://api.aimirrorx.com/v1/responses \
  -H "Authorization: Bearer $AIMIRRORX_API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{"model":"MODEL_ID_FROM_V1_MODELS","input":"你好"}'

Responses and Chat have different response structures. Do not reuse a Chat response parser after changing only the URL. Do not assume support for background-task retrieval, cancellation, storage or response history. Availability of GET /v1/responses/:id depends on task-plugin support.

Claude Messages

Claude SDKs usually use the service origin https://api.aimirrorx.com and append /v1/messages. Avoid an OpenAI-style /v1 base URL if the SDK would append /v1 again.

curl https://api.aimirrorx.com/v1/messages \
  -H "x-api-key: $AIMIRRORX_API_KEY" \
  -H 'anthropic-version: 2023-06-01' \
  -H 'Content-Type: application/json' \
  -d '{"model":"MODEL_ID_FROM_V1_MODELS","max_tokens":256,"messages":[{"role":"user","content":"你好"}]}'

/v1/messages/count_tokens is currently disabled. Do not assume that every native Claude endpoint is available.

Gemini generateContent

Native requests use /v1beta, not /v1/v1beta. Pass keys in a request header rather than URL query parameters, where they could be exposed in access logs.

curl 'https://api.aimirrorx.com/v1beta/models/MODEL_ID_FROM_V1_MODELS:generateContent' \
  -H "x-goog-api-key: $AIMIRRORX_API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{"contents":[{"role":"user","parts":[{"text":"你好"}]}]}'

The streaming operation is :streamGenerateContent; set SSE options according to your SDK version and client requirements. Native Gemini request bodies differ from OpenAI format. Do not send OpenAI messages directly to native Gemini endpoints.