Repository navigation
Description
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/messageswith 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
anthropictransformer usesUseBearer: trueagainst 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.5andkimi-k2.6both 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-versionhonored / 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_controlblocks (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-stripandkimi-tool-thinking-stripbased 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
- Existing setup docs: https://platform.kimi.ai/docs/guide/agent-support
- Migration page (mentions temperature rescaling):
https://platform.kimi.ai/docs/guide/migrating-from-anthropic-claude - claude-code-router transformer using this endpoint:
https://github.com/musistudio/claude-code-router (transformers/anthropic.ts)
Activity
goodboyasia commentedon Jun 22, 2026
Related: #141 — another manifestation of undocumented
thinkingbehavior withkimi-k2.7-code+ Claude Code Agent/Workflow.