Utilities

Verify Request Signature

Verifies a request signature returned in the response headers of the Chat Completions, Responses, or Messages API, proving that the request was handled by the Kimi API for the specified model rather than routed elsewhere. Submit the nonce used in the call, the timestamp from the response headers, the request's model, and the signature; the endpoint returns valid: true when the signature matches these three attributes exactly, and valid: false otherwise.

post/v1/signatures/verify

Request

  • Base URL: https://api.moonshot.ai
  • URL: https://api.moonshot.ai/v1/signatures/verify
  • Auth: HTTP bearer

Request body

noncestring required

The nonce sent in the X-Msh-Request-Nonce request header of the model call, exactly as sent.

timestampinteger required

The Unix millisecond timestamp returned in the Msh-Request-Timestamp response header of the model call.

modelstring required

The model value from the request body of the model call, exactly as sent.

signaturestring required

The signature token returned in the Msh-Request-Signature response header of the model call.

Example request

{
  "nonce": "7d929748-0ae6-41c2-ab5d-a186498ad721",
  "timestamp": 1786338000123,
  "model": "kimi-k2.7-code",
  "signature": "reqsigv1_<opaque-token>"
}

Response

Verification result

validboolean required

Whether the signature is valid. true means the signature was issued by the Kimi API and matches the submitted nonce, timestamp, and model exactly; otherwise false.

Example response

{
  "valid": true
}

Changes

No recorded changes to this operation across all 1 revision of this API.