Summary
Moonshot's agent-support docs document the env var
ANTHROPIC_BASE_URL=https://api.moonshot.ai/anthropic for Claude Code integration,
and we can confirm the endpoint POST /anthropic/v1/messages works end-to-end.
However, the request/response contract, supported headers, and feature matrix for
this endpoint are not published anywhere we can find. We're asking for canonical
reference docs so we (and other agentic-tool builders) can pin against a stable
contract rather than empirical probing.
What works today (observed)
POST https://api.moonshot.ai/anthropic/v1/messages with an Anthropic-shape body
accepts: model, messages, system, tools, tool_choice, max_tokens,
temperature, stream.
Authorization: Bearer <moonshot_api_key> is accepted (claude-code-router's
anthropic transformer uses UseBearer: true against this base URL).
- Streaming (SSE) returns Anthropic event types (
message_start, content_block_delta,
message_delta, message_stop) compatible enough for Claude Code's SDK to consume.
- Temperature is documented as rescaled:
real_temperature = request_temperature * 0.6.
kimi-k2.5 and kimi-k2.6 both respond on this endpoint.
What is undocumented
- Endpoint contract. No published spec for request/response shape, only the
env-var setup blurb. Is the contract guaranteed to match Anthropic Messages API
v1? Which version?
- Header support. Is
anthropic-version honored / required / ignored? Does
anthropic-beta (e.g. tools-2024-04-04, prompt-caching-2024-07-31,
extended-cache-ttl-2025-04-11) do anything?
- Feature matrix. Which Anthropic features are supported / translated /
silently dropped?
cache_control blocks (prompt caching)
- Vision (
{type: image, source: ...} content blocks)
- Document content blocks (
{type: document, ...}) — we observe 400s and
have to strip these client-side
thinking: {type: enabled} (we observe Kimi K2.6 supports thinking but
400s in multi-turn tool-calling when prior assistant tool_use lacks
reasoning_content — what's the contract here?)
tool_choice: {type: any|auto|tool} semantics
- Stop sequences, parallel tool use
- Version skew + deprecation. Where is the changelog for this endpoint?
How are breaking changes announced? Is there a way to pin to a specific
API version (header)?
- Rate limits + error shapes. Are Anthropic-style error bodies
({type: error, error: {type, message}}) guaranteed, or is OpenAI-shape
leakage possible?
Why it matters
We operate a federated AI control plane (SemanticGate fleet) where Kimi K2 is a
first-class cascade tier alongside Anthropic-native and DeepSeek's
/anthropic/v1/messages compat endpoint. Provider switches in our cascade
need a stable contract so we can:
- Detect feature-availability deterministically (rather than empirical probing
that's brittle across model upgrades).
- Pin clients against documented behavior so model-version bumps on Moonshot's
side don't silently break our agents.
- Author transformers/shims with confidence (we currently maintain
kimi-document-strip and kimi-tool-thinking-strip based on empirical
probing — would prefer to map these to documented contracts).
What would help
A reference page under platform.kimi.ai/docs/api/anthropic/ covering:
- Endpoint URL + auth (
Authorization: Bearer) + accepted headers
- Request body fields supported / unsupported / partial (with a clean
"Anthropic feature → Kimi support" table)
- Response shape + streaming event types
- Error format
- Versioning policy + changelog link
- Known divergences from upstream Anthropic spec (e.g. the temperature
rescaling note already in your migrating-from-anthropic-claude page)
Happy to contribute a docs PR if you'd accept community input on the page
structure.
References
Summary
Moonshot's agent-support docs document the env var
ANTHROPIC_BASE_URL=https://api.moonshot.ai/anthropicfor Claude Code integration,and we can confirm the endpoint
POST /anthropic/v1/messagesworks end-to-end.However, the request/response contract, supported headers, and feature matrix for
this endpoint are not published anywhere we can find. We're asking for canonical
reference docs so we (and other agentic-tool builders) can pin against a stable
contract rather than empirical probing.
What works today (observed)
POST https://api.moonshot.ai/anthropic/v1/messageswith an Anthropic-shape bodyaccepts:
model,messages,system,tools,tool_choice,max_tokens,temperature,stream.Authorization: Bearer <moonshot_api_key>is accepted (claude-code-router'santhropictransformer usesUseBearer: trueagainst this base URL).message_start,content_block_delta,message_delta,message_stop) compatible enough for Claude Code's SDK to consume.real_temperature = request_temperature * 0.6.kimi-k2.5andkimi-k2.6both respond on this endpoint.What is undocumented
env-var setup blurb. Is the contract guaranteed to match Anthropic Messages API
v1? Which version?anthropic-versionhonored / required / ignored? Doesanthropic-beta(e.g.tools-2024-04-04,prompt-caching-2024-07-31,extended-cache-ttl-2025-04-11) do anything?silently dropped?
cache_controlblocks (prompt caching){type: image, source: ...}content blocks){type: document, ...}) — we observe 400s andhave to strip these client-side
thinking: {type: enabled}(we observe Kimi K2.6 supports thinking but400s in multi-turn tool-calling when prior assistant tool_use lacks
reasoning_content— what's the contract here?)tool_choice: {type: any|auto|tool}semanticsHow are breaking changes announced? Is there a way to pin to a specific
API version (header)?
(
{type: error, error: {type, message}}) guaranteed, or is OpenAI-shapeleakage possible?
Why it matters
We operate a federated AI control plane (SemanticGate fleet) where Kimi K2 is a
first-class cascade tier alongside Anthropic-native and DeepSeek's
/anthropic/v1/messagescompat endpoint. Provider switches in our cascadeneed a stable contract so we can:
that's brittle across model upgrades).
side don't silently break our agents.
kimi-document-stripandkimi-tool-thinking-stripbased on empiricalprobing — would prefer to map these to documented contracts).
What would help
A reference page under
platform.kimi.ai/docs/api/anthropic/covering:Authorization: Bearer) + accepted headers"Anthropic feature → Kimi support" table)
rescaling note already in your migrating-from-anthropic-claude page)
Happy to contribute a docs PR if you'd accept community input on the page
structure.
References
https://platform.kimi.ai/docs/guide/migrating-from-anthropic-claude
https://github.com/musistudio/claude-code-router (transformers/anthropic.ts)