Inference APIs
Reference/Errors/Moonshot AI (Kimi)

"Extra inputs are not permitted, field: safety_identifier": OpenAI-only parameters rejected by Kimi and other strict hosts

OpenAI keeps adding optional request fields: safety_identifier replaced user for abuse tracking, store and metadata feed its dashboard, prompt_cache_key steers its cache. Clients built on the OpenAI SDK send them to every "OpenAI-compatible" endpoint. Most hosts ignore what they do not understand. Moonshot validates the request against a strict schema and rejects the whole call for one unknown field, so a tool that works against OpenAI fails against Kimi with nothing changed but the base URL.

Last verified September 18, 2026 against anomalyco/opencode #20133 (👍11), Kilo-Org/kilocode #11521 · 3 min read

ProviderMoonshot AI (api.moonshot.ai); a few other hosts validate the same way
HTTP status400 Bad Request
MessageExtra inputs are not permitted, field: 'safety_identifier' (the field name varies)
Parameters reportedsafety_identifier, store, metadata, prompt_cache_key, service_tier
Who hits itopencode (its OpenAI-compatible helper adds safety_identifier), Kilo Code, anything on a recent OpenAI SDK with those options set
Can you wait it out?No
Short answer
  • Your own code: do not set the OpenAI-only options when the base URL is not OpenAI's, or send them through a host that ignores them.
  • opencode: the report is closed as fixed; update to a current release.
  • Any host: the table below says which fields are safe where.

What the error looks like

HTTP 400 · Moonshot AI (Kimi)
Error: Extra inputs are not permitted, field: 'safety_identifier'

The message names the offending field. Fix that one and the next unknown field, if any, produces the same error, so check the whole request once rather than one field at a time.

Which parameters, and which hosts

ParameterSent byMoonshotInference APIs
safety_identifieropencode (all providers), OpenAI SDK helpers400Accepted and ignored
storeCodex CLI, Responses API clientsRejected by some hostsAccepted and ignored
metadataLangChain, LlamaIndex tracingRejected by some hostsAccepted and ignored
prompt_cache_keyOpenAI SDKRejected by some hostsAccepted and ignored
service_tierOpenAI SDKRejected by some hostsAccepted and ignored
userAlmost every clientAcceptedAccepted and ignored
max_completion_tokensOpenAI SDK, Codex, CopilotAcceptedAccepted (same as max_tokens)
stopAider, Continue, custom codeAcceptedAccepted; dropped for GPT-OSS with header X-Dropped-Params: stop

"Accepted and ignored" means the request succeeds and the field has no effect. That is what OpenAI-compatible should mean for optional fields; strict validation is a choice some hosts make. Neither is wrong, but you need to know which you are talking to.

Fix

In the OpenAI Python SDK, the fields are only sent if you set them, so remove them from the call when the base URL is a third party. opencode closed #20133 as fixed; if you still see it, update. For frameworks that inject metadata for tracing, most have a per-provider switch.

If you would rather not audit every client, use a host that ignores unknown optional fields. Ours does; the exact request that fails on Moonshot with all five fields set succeeds here on Kimi K2.7 Code.

Frequently asked questions

Is safety_identifier the same as user?

OpenAI introduced it as the replacement for the abuse-tracking use of user. Third-party hosts do not use either for that purpose.

Why does the same request work on OpenRouter?

Gateways normalise requests per provider before forwarding. A direct call to Moonshot gets no such translation, so the client's request has to be clean.

Where Inference APIs fits

Our endpoint accepts every parameter in the table and ignores the ones the upstream model does not use, so a client that sends safety_identifier, store or metadata works unchanged against all nine chat models, Kimi K2.7 Code included. Tested September 18, 2026.

Something changed or wrong? Tell us and we will re-verify the entry.