Migrate from Anthropic Messages
AI Credits provides a compatible /v1/messages endpoint. Prefer the Anthropic SDK-compatible x-api-key header with an AICredits API Key; the credential is not an official key issued by Anthropic or any other model service. Authorization: Bearer remains compatible.
/v1/messages is a protocol entry point. Use the Messages shape when /api/v1/public/models declares anthropic_messages in protocols and your authenticated /v1/models lists that model. Enabled OpenAI, Claude, Gemini, and Grok compatibility paths must meet these conditions; do not infer a protocol from the model name.
curl --fail-with-body "$API_BASE_URL/v1/messages" \
-H "x-api-key: $AICREDITS_API_KEY" \
-H "anthropic-version: 2023-06-01" \
-H "Content-Type: application/json" \
--data '{"model":"<MODEL_FROM_V1_MODELS>","max_tokens":128,"messages":[{"role":"user","content":"<YOUR_PROMPT>"}]}'Protocol badges come from the public capability catalog. /v1/models confirms accessible models and does not return protocols. Use /v1/messages/count_tokens for Messages counting; Claude counting is implemented, subject to model configuration and permissions.
Messages compatibility for Chinese models
DeepSeek, Kimi, MiniMax and Zhipu GLM have Messages compatibility paths. Confirm anthropic_messages for the selected model before calling. Compatibility does not imply every Claude parameter, tool behavior or token-counting API is supported. See Chinese model integration, preserve complete context and validate your application outputs.