Request Signature lets you prove that a request actually reached the Kimi API itself, rather than being forwarded elsewhere or served by a different model through an intermediary. Anyone holding the nonce, timestamp, model, and signature can use this endpoint to verify that the Kimi API accepted the request for the specified model at that time — for example, to show users or third parties that a service is backed by the official Kimi API, to check that a proxy has not substituted the model, or for auditing and dispute resolution.When calling the Chat Completions, Responses, or Messages API, send a random nonce (a UUID v4 is recommended) in the X-Msh-Request-Nonce request header. The response then carries Msh-Request-Timestamp (the Unix millisecond timestamp at which the Kimi API accepted the request) and Msh-Request-Signature (a signature token prefixed with reqsigv1_), for both streaming and non-streaming requests. Submit the nonce, timestamp, the request’s model, and the signature to this endpoint; it returns valid: true when the signature matches all three exactly, and valid: false otherwise.The signature only proves that the Kimi API accepted this nonce and request model at that time; it does not prove that the request ultimately succeeded or that the response is complete. The server does not record nonces, so replaying the same parameters still returns valid: true — replay protection and validity windows are the caller’s responsibility.
The Authorization header expects a Bearer token. Use an MOONSHOT_API_KEY as the token. This is a server-side secret key. Generate one on the API keys page in your dashboard.
Body
application/json
nonce
string
required
The nonce sent in the X-Msh-Request-Nonce request header of the model call, exactly as sent.
Minimum string length: 1
Example:
"7d929748-0ae6-41c2-ab5d-a186498ad721"
timestamp
integer<int64>
required
The Unix millisecond timestamp returned in the Msh-Request-Timestamp response header of the model call.
Required range: x >= 1
Example:
1786338000123
model
string
required
The model value from the request body of the model call, exactly as sent.
Minimum string length: 1
Example:
"kimi-k3.1-pro"
signature
string
required
The signature token returned in the Msh-Request-Signature response header of the model call.
Minimum string length: 1
Example:
"reqsigv1_<opaque-token>"
Response
Verification result
valid
boolean
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.
{"docsConfig":{"theme":"luma","$schema":"https://mintlify.com/docs.json","name":"Kimi API Platform","description":"Kimi K3.1 Pro is our flagship model for long-horizon coding and end-to-end knowledge work, with a 1M-token context window and industry-leading intelligence. The Kimi API Platform provides a range of large language model APIs with long context, multimodal understanding, and Tool Calling.","colors":{"primary":"#111111","light":"#F5F5F5","dark":"#111111"},"logo":{"light":"https://mintcdn.com/moonshotai/X_5b_eA1iuJP595e/assets/logo/light.svg?fit=max\u0026auto=format\u0026n=X_5b_eA1iuJP595e\u0026q=85\u0026s=f68cf2d80f8d7f0363e088d2b988a598","dark":"https://mintcdn.com/moonshotai/X_5b_eA1iuJP595e/assets/logo/dark.svg?fit=max\u0026auto=format\u0026n=X_5b_eA1iuJP595e\u0026q=85\u0026s=297861f343cd86556341fb85b17cb13d","href":"https://platform.kimi.ai"},"favicon":{"light":"https://mintcdn.com/moonshotai/X_5b_eA1iuJP595e/assets/pics/favicon.ico?fit=max\u0026auto=format\u0026n=X_5b_eA1iuJP595e\u0026q=85\u0026s=f5dbc381f82faaf2356c1d1bd7199526","dark":"https://mintcdn.com/moonshotai/X_5b_eA1iuJP595e/assets/pics/favicon-dark.ico?fit=max\u0026auto=format\u0026n=X_5b_eA1iuJP595e\u0026q=85\u0026s=0330e19f739be705f4a0bacdbdea87a3"},"api":{"openapi":["openapi.json","admin-api/openapi.yaml"],"examples":{"defaults":"required"}},"navbar":{"links":[{"href":"https://www.kimi.com/membership/pricing?from=platform_page\u0026open=business","label":"Kimi Business"},{"href":"https://www.kimi.ai/contact-sales","label":"Contact Sales"},{"href":"https://platform.kimi.ai/console/account","label":"User Center"}]},"footer":{"socials":{"x":"https://x.com/Kimi_Moonshot","github":"https://github.com/MoonshotAI","linkedin":"https://www.linkedin.com/company/kimi-ai-linkedin","discord":"https://discord.com/invite/TYU2fdJykW?source=docs_footer","website":"https://forum.moonshot.ai/?source=docs_footer"}},"seo":{"metatags":{"og:site_name":"Kimi API Platform","og:locale":"en-US","og:image":"https://platform.kimi.ai/og.png?v=1","og:image:alt":"Kimi API Platform","robots":"index,follow","canonical":"https://platform.kimi.ai/docs","description":"Kimi K3.1 Pro is our flagship model for long-horizon coding and end-to-end knowledge work, with a 1M-token context window and industry-leading intelligence. The Kimi API Platform provides a range of large language model APIs with long context, multimodal understanding, and Tool Calling.","keywords":"Kimi K3.1 Pro,kimi-k3.1-pro,Kimi K3,Moonshot AI,K3 Large Language Model,AI API,Tool Calling,Code Generation,Intelligent Dialogue,AI Agent,Open-source Model,Long Context,Claw Bot"}},"styling":{"eyebrows":"breadcrumbs","latex":false},"integrations":{"clarity":{"projectId":"r1wlk72gay"},"ga4":{"measurementId":"G-Z0ZTEN03PZ"}},"banner":{"content":"🎉 Kimi K3.1 Pro has launched! [Start exploring now!](https://platform.kimi.ai/docs/guide/kimi-k3-1-pro-quickstart)","dismissible":true},"errors":{"404":{"redirect":true}},"contextual":{"options":["copy","view",{"title":"Open in Kimi","description":"Ask questions about this page","icon":"/assets/logo/kimi-context.svg","href":{"base":"https://www.kimi.ai/","query":[{"key":"prefill_prompt","value":"Read from https://platform.kimi.ai/docs$path so I can ask questions about it."}]}}],"display":"header"},"navigation":{"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"moonshotai","hasAudioNarration":false,"actualSubdomain":"moonshotai","customDomains":["platform.kimi.ai"],"gitSource":{"type":"github","owner":"moonshotai","repo":"kimi-platform-docs","deployBranch":"master","contentDirectory":"global","isPrivate":true,"mountPath":"","label":""},"feedback":{"thumbs":true},"entitlements":{"AI_CHAT":{"status":"ENABLED"},"REMOVE_BRANDING":{"status":"ENABLED"},"CONTEXTUAL_FEEDBACK":{"status":"ENABLED"},"CODE_SNIPPET_FEEDBACK":{"status":"ENABLED"},"WEB_MCP":{"status":"ENABLED"},"NARRATION":{"status":"ENABLED"}},"buildId":"6b0d429d20e809d325b5bece","clientVersion":"0.0.4352","searchFilterCounts":[{"language":"default","tag":"API Reference","count":66},{"language":"default","tag":"Admin API","count":37},{"language":"default","tag":"Guides","count":31},{"language":"default","tag":"Organization","count":29},{"language":"default","tag":"Learning and support","count":22},{"language":"default","tag":"Resources","count":21},{"language":"default","tag":"Help Center","count":12},{"language":"default","tag":"Model Capabilities","count":9},{"language":"default","tag":"Configuration","count":8},{"language":"default","tag":"Members \u0026 Invitations","count":7}]},"assistantConfig":{"enableAskAiButton":false,"enableStarterQuestions":false,"enableAskAiSearchBar":true},"basePath":"/docs","hasChatPermissions":false,"hasWebMcpPermissions":true,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-rbac-roles","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-mintlify-slack","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-integrations-settings","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"rbac-expansion","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-pr-grouping","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-prefix","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"analytics-v7","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"user-flows-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"no-publish-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving-live","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"stripTemperatureMiddleware","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"support-platform-pylon-zendesk","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"instant-rollback","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications-server","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-fable","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fixed-ai-action-pricing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"site-roles","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automation-resolve-merge-conflict","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"scoped-publishing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"mintql","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"page-level-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-version-history-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-page-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"full-page-search","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workspace-projects","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fork-pr-previews","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"revalidation-jwt","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"hobby-abuse-scan","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"dashboard-inbox","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-dual-write","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"approve-review-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-metadata","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-serve","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"live-agents","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"starter-pricing","enabled":true,"variant":{"name":"control","enabled":true,"payload":{"type":"string","value":"control"},"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"wildcard-email-auth","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"starterQuestions":[],"googleFontsInlined":false},"customCss":[{"filePath":"custom.css","content":":root{--brand-primary: #111111;--brand-primary-strong: #2a2a2a;--brand-primary-soft: rgba(17, 17, 17, 0.08);--brand-text: #171717;--brand-text-muted: #5f5f68;--brand-border: #e5e7eb;--brand-border-strong: #d4d4d8;--brand-surface: #f5f5f5;--brand-card-bg: rgba(255, 255, 255, 0.9);--brand-overlay: linear-gradient(to top, rgba(10, 10, 10, 0.78), rgba(10, 10, 10, 0.28), transparent)}.dark,[data-theme=\"dark\"]{--brand-primary: #f5f5f5;--brand-primary-strong: #ffffff;--brand-primary-soft: rgba(245, 245, 245, 0.14);--brand-text: #fafafa;--brand-text-muted: #a1a1aa;--brand-border: #303038;--brand-border-strong: #3f3f46;--brand-surface: #151515;--brand-card-bg: rgba(24, 24, 27, 0.88);--brand-overlay: linear-gradient(to top, rgba(0, 0, 0, 0.84), rgba(0, 0, 0, 0.3), transparent)}#footer>*>div:last-child,#footer>*>div:nth-last-child(2){display:none!important}#footer a[href^=\"https://forum.moonshot.ai/\"] svg{display:none!important}#footer a[href^=\"https://forum.moonshot.ai/\"]::before{content:\"\";display:block;width:1.25rem;height:1.25rem;background-color:currentColor;-webkit-mask:url(\"/assets/icons/community.svg\") center / contain no-repeat;mask:url(\"/assets/icons/community.svg\") center / contain no-repeat}#search-bar-entry,#search-bar-entry-mobile{border:1px solid var(--brand-border)!important;background:var(--brand-card-bg)!important;box-shadow:none!important}#search-input{color:var(--brand-text)!important}#search-input::placeholder{color:var(--brand-text-muted)!important}#topbar,#topbar-content-container,#topbar-content-wrapper{color:var(--brand-text)!important}@media (min-width: 1024px){#sidebar{top:calc(7rem + var(--banner-height, 0px))!important}}#sidebar-content li[data-active]{background:var(--brand-primary-soft)!important;border-radius:14px}#sidebar-content li[data-active] a,#sidebar-content li[data-active] button{color:var(--brand-primary)!important}#sidebar-content a,#sidebar-content button{font-weight:inherit!important;text-shadow:none!important}.sidebar-group[data-active]>.sidebar-group-header,.sidebar-group[data-active]>.sidebar-group-header *{color:var(--brand-primary)!important}.method-nav-pill,.method-pill{border-radius:999px!important;box-shadow:none!important}#request-example,#response-example,#api-playground-input,#panel,#page-context-menu-button{border-color:var(--brand-border)!important}#request-example,#response-example,#api-playground-input{background:var(--brand-card-bg)!important}.dark .method-nav-pill,.dark .method-pill,[data-theme=\"dark\"] .method-nav-pill,[data-theme=\"dark\"] .method-pill{border-color:transparent!important}.dark li[role=\"tab\"][aria-selected=\"true\"]>div,[data-theme=\"dark\"] li[role=\"tab\"][aria-selected=\"true\"]>div{color:#ffffff!important;border-color:#ffffff!important}.nav-tabs-item[data-active],.mobile-nav-tabs-item[data-active]{color:var(--brand-primary)!important}.navbar-link:hover,.nav-tabs-item:hover,.mobile-nav-tabs-item:hover{color:var(--brand-primary)!important}.toc-item[data-active],.toc-item[data-active-deepest]{color:var(--brand-primary)!important}.toc-item[data-active] a,.toc-item[data-active-deepest] a{color:var(--brand-primary)!important}#header>div.mt-2.prose{font-size:1rem;line-height:1.5rem}#header>div.mt-2.prose{color:#73737c}.dark #header>div.mt-2.prose,[data-theme=\"dark\"] #header>div.mt-2.prose{color:#a1a1aa}.mdx-content a{color:var(--brand-primary);text-decoration-color:color-mix(in srgb, var(--brand-primary) 58%, transparent)}.mdx-content a:hover{color:var(--brand-primary-strong);text-decoration-color:color-mix(in srgb, var(--brand-primary-strong) 72%, transparent)}.mdx-content a strong,.mdx-content a b,.mdx-content a code{color:inherit}.quickstart-cta-wrap{display:flex;justify-content:center;margin:48px 0 64px}.mdx-content .quickstart-cta{display:inline-flex;align-items:center;justify-content:center;padding:10px 20px;border-radius:8px;background:var(--brand-primary);color:var(--brand-surface);font-size:14px;font-weight:500;line-height:1.25;text-decoration:none}.mdx-content .quickstart-cta:hover{background:var(--brand-primary-strong);color:var(--brand-surface)}.code-block,pre{border-color:var(--brand-border)!important}code:not(pre code){background:var(--brand-surface)!important;border:1px solid var(--brand-border);color:var(--brand-text)!important}.mdx-content table td code{white-space:nowrap}#page-context-menu-button:hover,.pagination-next:hover,.pagination-prev:hover,.topbar-cta-button:hover{border-color:var(--brand-primary)!important}.overview-page{color:var(--brand-text)}.overview-page a{border-bottom:none!important;box-shadow:none!important;text-decoration:none!important}.overview-page .overview-overlay-link{position:absolute!important;inset:0!important;display:block!important;border:0!important;border-bottom:0!important;box-shadow:none!important;text-decoration:none!important;z-index:4!important}.overview-page .overview-grid-2,.overview-page .overview-grid-3,.overview-page .overview-grid-4{display:grid;align-items:stretch;gap:16px}.overview-page .overview-grid-2{grid-template-columns:repeat(2, minmax(0, 1fr))}.overview-page .overview-grid-3{grid-template-columns:repeat(3, minmax(0, 1fr))}.overview-page .overview-grid-4{grid-template-columns:repeat(2, minmax(0, 1fr))}.overview-page .overview-link-card,.overview-page .overview-resource-card{position:relative;overflow:hidden;display:flex;height:100%;border:1px solid var(--brand-border);border-radius:12px;background:var(--brand-card-bg);backdrop-filter:blur(10px);transition:border-color 0.2s, background-color 0.2s, box-shadow 0.2s}.overview-page .overview-link-card:hover,.overview-page .overview-resource-card:hover{border-color:var(--brand-primary);box-shadow:0 10px 30px rgba(15, 23, 42, 0.08)}.overview-page .overview-link-card__body,.overview-page .overview-resource-card__body{display:flex;padding:20px 16px;width:100%;flex-direction:row;gap:12px;align-items:flex-start}.overview-page .overview-link-card__content{display:flex;flex:1;flex-direction:column}.overview-page .overview-link-card__icon{display:flex;width:24px;min-width:24px;align-items:center;justify-content:center;line-height:1;margin-top:3px;color:var(--brand-text-muted)}.overview-page .overview-link-card__title,.overview-page .overview-resource-card__title{font-size:16px;font-weight:500;line-height:1.2;color:var(--brand-text)}.overview-page .overview-link-card__description,.overview-page .overview-resource-card__description{margin-top:4px;font-size:14px;color:var(--brand-text-muted);line-height:1.4}.overview-page .overview-model-card{position:relative;overflow:hidden;border:1px solid var(--brand-border);border-radius:12px;background:var(--brand-surface)}.overview-page .overview-model-card__media{position:relative;aspect-ratio:123 / 92;line-height:0}.overview-page .overview-model-card__image{display:block;width:100%;height:100%;object-fit:cover;transition:transform 0.5s}.overview-page .overview-model-card:hover .overview-model-card__image{transform:scale(1.05)}.overview-page .overview-model-card__overlay{position:absolute;inset:0;display:flex;align-items:flex-end;background:var(--brand-overlay)}.overview-page .overview-model-card__content{width:100%;padding:16px}.overview-page .overview-model-card__name{color:white;font-weight:600;line-height:1.2;font-size:16px}.overview-page .overview-model-card__tag-row{margin-top:8px;line-height:1}.overview-page .overview-hero-card{background:var(--brand-surface);border-color:var(--brand-border)!important}.overview-page .overview-hero-card__cta{display:inline-flex;align-items:center;gap:6px;padding:10px 20px;border:1px solid rgba(255, 255, 255, 0.14);border-radius:8px;background:rgba(255, 255, 255, 0.96);color:#111111!important;font-size:14px;font-weight:500;white-space:nowrap;position:relative;z-index:10;transition:transform 0.2s ease, background-color 0.2s ease, border-color 0.2s ease}.overview-page .overview-hero-card__cta:hover{background:#ffffff;border-color:rgba(255, 255, 255, 0.3);transform:translateY(-1px)}.overview-page .overview-section-link{color:var(--brand-primary)!important;text-decoration:underline!important;text-underline-offset:0.18em}.overview-page .overview-section-link:hover{color:var(--brand-primary-strong)!important}.overview-page .overview-resource-card a,.overview-page .overview-link-card a,.overview-page .overview-model-card a{color:inherit!important}@media (max-width: 1100px){.overview-page .overview-grid-3{grid-template-columns:repeat(2, minmax(0, 1fr))}}#choose-the-right-api+div table:first-of-type{min-width:680px;table-layout:fixed}#choose-the-right-api+div table:first-of-type th,#choose-the-right-api+div table:first-of-type td{min-width:0}#choose-the-right-api+div table:first-of-type th:nth-child(1),#choose-the-right-api+div table:first-of-type td:nth-child(1){width:16%}#choose-the-right-api+div table:first-of-type th:nth-child(2),#choose-the-right-api+div table:first-of-type td:nth-child(2){width:32%}#choose-the-right-api+div table:first-of-type td:nth-child(2),#choose-the-right-api+div table:first-of-type td:nth-child(2) code{white-space:nowrap}#content-side-layout:has(.code-group){display:none!important}@media (max-width: 700px){.overview-page .overview-grid-2,.overview-page .overview-grid-3,.overview-page .overview-grid-4{grid-template-columns:1fr}}.doc-table-wrap{width:100%;max-width:100%}.doc-table-wrap table{display:table!important;width:100%!important;max-width:100%!important;min-width:0!important;table-layout:fixed!important;margin:0!important}.doc-table-wrap th,.doc-table-wrap td{white-space:normal!important;overflow-wrap:anywhere;word-break:break-word;text-align:left!important;vertical-align:middle}.doc-table-wrap td ul{margin-top:0!important;margin-bottom:0!important}.doc-table-bordered{border:1px solid rgba(128, 128, 128, 0.25);container-type:inline-size}.doc-table-bordered th,.doc-table-bordered td{padding:12px 16px!important}.doc-table-legal th,.doc-table-legal td{vertical-align:top}.doc-table-legal td{line-height:1.75}.doc-table-legal th:nth-child(2),.doc-table-legal td:nth-child(2){border-right:1px solid rgba(128, 128, 128, 0.25)}.doc-table-bordered th:first-child,.doc-table-bordered td:first-child{border-right:1px solid rgba(128, 128, 128, 0.25)}.doc-table-bordered .doc-table-group-start,.doc-table-bordered thead tr.doc-table-groups th:nth-child(n+3){border-left:1px solid rgba(128, 128, 128, 0.25)}.doc-table-corner-sub{font-weight:400;opacity:0.6}.doc-table-unit{opacity:0.55;font-size:0.85em}@container (min-width: 840px){.doc-table-bordered .doc-table-price{white-space:nowrap}}.doc-table-wrap thead tr.doc-table-groups th{text-align:left!important;font-weight:600;border-bottom:1px solid rgba(128, 128, 128, 0.25)}.doc-table-wrap thead tr.doc-table-groups th:empty{border-bottom:none}.doc-table-bordered thead tr.doc-table-groups th{background-color:rgba(128, 128, 128, 0.16)}.doc-table-bordered thead tr:not(.doc-table-groups) th{background-color:rgba(128, 128, 128, 0.06)}@media (max-width: 900px){.doc-table-wrap th,.doc-table-wrap td{padding:10px 8px!important;font-size:13px;line-height:1.45}}@media (max-width: 640px){.doc-table-wrap{width:100%}.doc-table-wrap th,.doc-table-wrap td{padding:8px 6px!important;font-size:12px;line-height:1.4}.doc-table-wrap td:first-child,.doc-table-wrap th:first-child{word-break:break-all;overflow-wrap:anywhere}.doc-table-wrap code{font-size:11px;white-space:normal!important;word-break:break-all}}.sidebar-group-header{font-size:0.875rem!important}nav[aria-label=\"Pages\"] ul.bottom-0.border-t{display:none!important}li.navbar-link>a{border:1px solid var(--brand-border, #e5e7eb);border-radius:9999px;padding:0.3rem 0.9rem}li.navbar-link>a:hover{border-color:var(--brand-primary)!important;color:var(--brand-primary)!important}div.relative:has(>#search-bar-entry){flex:none!important;justify-content:flex-end!important}#search-bar-entry{width:2.25rem!important;min-width:2.25rem!important;flex:none!important;padding:0!important;justify-content:center!important;border-radius:9999px!important}#search-bar-entry *{font-size:0!important}#search-bar-entry kbd{display:none!important}div[data-top-chrome]{padding-left:1rem!important;padding-right:1rem!important}#search-bar-entry{width:1.75rem!important;min-width:1.75rem!important;height:1.75rem!important;display:flex!important;align-items:center!important;justify-content:center!important}#search-bar-entry>div{margin:0!important;gap:0!important}#search-bar-entry{width:2.1rem!important;min-width:2.1rem!important;height:2.1rem!important}#search-bar-entry>div{flex:none!important;width:auto!important;justify-content:center!important}#search-bar-entry svg{display:block!important;margin:0 auto!important}#theme-preference-menu-trigger{position:fixed!important;left:1rem;bottom:1rem;z-index:40;background:var(--brand-surface, #ffffff)!important;border:1px solid var(--brand-border, #e5e7eb)!important}#theme-preference-menu-trigger{left:auto!important;right:1rem!important}@media (min-width: 1024px){#content-area{margin-left:auto!important;margin-right:auto!important}}@media (min-width: 1280px){#content-area{max-width:56rem!important}#content-side-layout{margin-right:1.5rem!important;padding-left:1.5rem!important}}@media (min-width: 91.875rem){#sidebar-content{width:18rem!important}#body-content{padding-left:18rem!important}}.strike-price{white-space:nowrap}.strike-price-original{color:#9ca3af;margin-right:0.375rem}.strike-price-current{color:#dc2626;font-weight:600}.dark .strike-price-current,[data-theme=\"dark\"] .strike-price-current{color:#f87171}#banner button{width:1.25rem!important;height:1.25rem!important;right:0.75rem!important;border-radius:9999px!important;opacity:0.55;transition:opacity 0.15s ease, background-color 0.15s ease}#banner button:hover{opacity:1;background:rgba(255, 255, 255, 0.14)!important}#banner button svg{width:12px!important;height:12px!important;stroke-width:1.5}@media (min-width: 1280px){#content-container:not(:has(#table-of-contents-layout))::after{content:\"\";flex:none;width:19.5rem}}.video-intro{margin-top:4px;font-size:0.85em;line-height:1.6}.video-intro-toggle{display:none}.video-intro>label{cursor:pointer;color:#888}.video-intro>label::before{content:\"▸ \"}.video-intro-toggle:checked+label::before{content:\"▾ \"}.video-intro-body{display:none;color:#666;margin-top:4px}.video-intro-toggle:checked~.video-intro-body{display:block}.video-intro-body p{margin:0 0 6px}.video-grid video{margin:0}"}]}
{"page":{"pagePath":"api/signatures-verify","slug":"/api/signatures-verify","pageMetadata":{"title":"Verify Request Signature","sidebarTitle":"Verify Request Signature","description":"Verify a request signature to prove that a request was handled by the Kimi API for the specified model, rather than routed elsewhere.","openapi":"POST /v1/signatures/verify","href":"/api/signatures-verify"},"description":{"compiledSource":"\"use strict\";\nconst {jsx: _jsx} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n p: \"p\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsx(_components.p, {\n children: \"Verify a request signature to prove that a request was handled by the Kimi API for the specified model, rather than routed elsewhere.\"\n });\n}\nfunction MDXContent(props = {}) {\n const {wrapper: MDXLayout} = {\n ..._provideComponents(),\n ...props.components\n };\n return MDXLayout ? _jsx(MDXLayout, {\n ...props,\n children: _jsx(_createMdxContent, {\n ...props\n })\n }) : _createMdxContent(props);\n}\nreturn {\n default: MDXContent\n};\n","frontmatter":{},"scope":{}},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){const _components={a:`a`,code:`code`,p:`p`,pre:`pre`,span:`span`,..._provideComponents(),...props.components},{Accordion,CodeBlock,CodeGroup}=_components;if(!Accordion)_missingMdxReference(`Accordion`,true);if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!CodeGroup)_missingMdxReference(`CodeGroup`,true);return _jsxs(_Fragment,{children:[_jsx(_components.p,{children:`Request Signature lets you prove that a request actually reached the Kimi API itself, rather than being forwarded elsewhere or served by a different model through an intermediary. Anyone holding the nonce, timestamp, model, and signature can use this endpoint to verify that the Kimi API accepted the request for the specified model at that time — for example, to show users or third parties that a service is backed by the official Kimi API, to check that a proxy has not substituted the model, or for auditing and dispute resolution.`}),`\n`,_jsxs(_components.p,{children:[`When calling the `,_jsx(_components.a,{href:`/api/chat`,children:`Chat Completions`}),`, `,_jsx(_components.a,{href:`/api/responses`,children:`Responses`}),`, or `,_jsx(_components.a,{href:`/api/messages`,children:`Messages`}),` API, send a random nonce (a UUID v4 is recommended) in the `,_jsx(_components.code,{children:`X-Msh-Request-Nonce`}),` request header. The response then carries `,_jsx(_components.code,{children:`Msh-Request-Timestamp`}),` (the Unix millisecond timestamp at which the Kimi API accepted the request) and `,_jsx(_components.code,{children:`Msh-Request-Signature`}),` (a signature token prefixed with `,_jsx(_components.code,{children:`reqsigv1_`}),`), for both streaming and non-streaming requests. Submit the nonce, timestamp, the request’s `,_jsx(_components.code,{children:`model`}),`, and the signature to this endpoint; it returns `,_jsx(_components.code,{children:`valid: true`}),` when the signature matches all three exactly, and `,_jsx(_components.code,{children:`valid: false`}),` otherwise.`]}),`\n`,_jsxs(_components.p,{children:[`The signature only proves that the Kimi API accepted this nonce and request model at that time; it does not prove that the request ultimately succeeded or that the response is complete. The server does not record nonces, so replaying the same parameters still returns `,_jsx(_components.code,{children:`valid: true`}),` — replay protection and validity windows are the caller’s responsibility.`]}),`\n`,_jsx(Accordion,{title:`Example`,id:`example`,children:_jsxs(CodeGroup,{children:[_jsx(CodeBlock,{filename:`python`,expandable:`true`,numberOfLines:`38`,language:`python`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`python`,children:_jsxs(_components.code,{language:`python`,numberOfLines:`38`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` os`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` uuid`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` requests`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`from`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` openai `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` OpenAI`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`client `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` OpenAI(`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` api_key`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`os.environ[`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"MOONSHOT_API_KEY\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`],`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` base_url`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"https://api.moonshot.ai/v1\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`nonce: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:`str`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:` str`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(uuid.uuid4())`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`model: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:`str`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"kimi-k3.1-pro\"`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`# 1. Call the model endpoint with X-Msh-Request-Nonce and read the response headers`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`raw `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` client.chat.completions.with_raw_response.create(`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` model`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`model,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` messages`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`[{`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"role\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"user\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"content\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"Hello\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}],`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` extra_headers`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"X-Msh-Request-Nonce\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: nonce},`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`timestamp: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:`int`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:` int`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(raw.headers[`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"Msh-Request-Timestamp\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`])`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`signature: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:`str`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` raw.headers[`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"Msh-Request-Signature\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`]`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`# 2. Verify the signature`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`verify `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` requests.post(`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"https://api.moonshot.ai/v1/signatures/verify\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` headers`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"Authorization\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`f`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"Bearer `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`{`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`os.environ[`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'MOONSHOT_API_KEY'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`]`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`}`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"Content-Type\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"application/json\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` },`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` json`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"nonce\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: nonce,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"timestamp\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: timestamp,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"model\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: model,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"signature\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: signature,`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` },`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#DCDCAA`},children:`print`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(verify.json()) `}),_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`# {\"valid\": true}`})]}),`\n`]})})}),_jsx(CodeBlock,{filename:`curl`,expandable:`true`,numberOfLines:`19`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`19`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`NONCE`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"$(`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`uuidgen`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`)\"`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`MODEL`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"kimi-k3.1-pro\"`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`# 1. Call the model endpoint with X-Msh-Request-Nonce and save the response headers`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`curl`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -sS`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -D`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` response.headers`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -o`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` response.json`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` https://api.moonshot.ai/v1/chat/completions`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -H`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"Authorization: Bearer `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`$MOONSHOT_API_KEY`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -H`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"Content-Type: application/json\"`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -H`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"X-Msh-Request-Nonce: `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`$NONCE`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -d`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"{`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:`\\\\\"`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`model`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:`\\\\\"`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`: `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:`\\\\\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`$MODEL`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:`\\\\\"`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`, `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:`\\\\\"`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`messages`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:`\\\\\"`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`: [{`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:`\\\\\"`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`role`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:`\\\\\"`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`: `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:`\\\\\"`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`user`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:`\\\\\"`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`, `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:`\\\\\"`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`content`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:`\\\\\"`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`: `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:`\\\\\"`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`Hello`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:`\\\\\"`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`}]}\"`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`TIMESTAMP`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"$(`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`awk`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -F`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`': ' 'tolower($1)==\"msh-request-timestamp\" {gsub(\"\\\\\\\\r\", \"\", $2); print $2}' response.headers)\"`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`SIGNATURE`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"$(`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`awk`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -F`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`': ' 'tolower($1)==\"msh-request-signature\" {gsub(\"\\\\\\\\r\", \"\", $2); print $2}' response.headers)\"`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`# 2. Verify the signature`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`curl`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -sS`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` https://api.moonshot.ai/v1/signatures/verify`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -H`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"Authorization: Bearer `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`$MOONSHOT_API_KEY`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -H`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"Content-Type: application/json\"`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -d`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"{`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:`\\\\\"`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`nonce`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:`\\\\\"`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`: `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:`\\\\\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`$NONCE`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:`\\\\\"`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`, `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:`\\\\\"`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`timestamp`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:`\\\\\"`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`: `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`$TIMESTAMP`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`, `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:`\\\\\"`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`model`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:`\\\\\"`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`: `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:`\\\\\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`$MODEL`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:`\\\\\"`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`, `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:`\\\\\"`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`signature`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:`\\\\\"`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`: `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:`\\\\\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`$SIGNATURE`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:`\\\\\"`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`}\"`})]}),`\n`]})})}),_jsx(CodeBlock,{filename:`node.js`,expandable:`true`,numberOfLines:`36`,language:`javascript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`javascript`,children:_jsxs(_components.code,{language:`javascript`,numberOfLines:`36`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`const`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` { `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:`randomUUID`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` } `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` require`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"crypto\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`);`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`const`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` OpenAI`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` require`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"openai\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`);`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`const`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` apiKey`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` process`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`env`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:`MOONSHOT_API_KEY`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`const`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` client`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` new`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` OpenAI`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`({`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` apiKey`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` baseURL:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"https://api.moonshot.ai/v1\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`});`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`async`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` function`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` main`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`() {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` const`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` nonce`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` randomUUID`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`();`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` const`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` model`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"kimi-k3.1-pro\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` // 1. Call the model endpoint with X-Msh-Request-Nonce and read the response headers`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` const`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` { `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:`response`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` } `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` await`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` client`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`chat`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`completions`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` .`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`create`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` { `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`model`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`messages:`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` [{ `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`role:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"user\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`content:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"Hello\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }] },`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` { `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`headers:`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` { `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"X-Msh-Request-Nonce\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`:`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` nonce`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` } },`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` )`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` .`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`withResponse`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`();`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` const`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` timestamp`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` Number`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`response`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`headers`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`get`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"Msh-Request-Timestamp\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`));`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` const`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` signature`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` response`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`headers`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`get`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"Msh-Request-Signature\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`);`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` // 2. Verify the signature`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` const`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` verify`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` await`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` fetch`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"https://api.moonshot.ai/v1/signatures/verify\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` method:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"POST\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` headers:`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` Authorization:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:\" `Bearer \"}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#569CD6`},children:\"${\"}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`apiKey`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#569CD6`},children:`}`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:\"`\"}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"Content-Type\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"application/json\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` },`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` body:`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` JSON`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`stringify`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`({ `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`nonce`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`timestamp`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`model`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`signature`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }),`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` });`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` console`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`log`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`await`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` verify`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`json`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`()); `}),_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`// { valid: true }`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`main`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`();`})]}),`\n`]})})})]})})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent};function _missingMdxReference(id,component){throw new Error(`Expected `+(component?`component`:`object`)+\" `\"+id+\"` to be defined: you likely forgot to import, pass, or provide it.\")}","frontmatter":{},"scope":{"config":{},"pageMetadata":{"title":"Verify Request Signature","sidebarTitle":"Verify Request Signature","description":"Verify a request signature to prove that a request was handled by the Kimi API for the specified model, rather than routed elsewhere.","openapi":"POST /v1/signatures/verify","href":"/api/signatures-verify"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[],"codeExamples":{}},"jsLinks":[],"openApiReferenceData":{"operation":{"summary":"Verify Request Signature","description":"Verify a request signature to prove that a request was handled by the Kimi API for the specified model, rather than routed elsewhere.","tags":["Utilities"],"security":["e33f86ff-0930-4fb6-9772-b94452f0854c"],"requestBody":"19bdc23b-848b-4635-a079-731493ce3e37","responses":{"200":"cb8217a3-538d-4990-8c81-0e418d0bdcd1","400":"6f9efe31-e1c8-4c11-b5ba-929ea7ca9fe0","401":"7504e05d-b48a-4fe1-9dc6-83ef3a506a01","429":"3e0c5cbc-c6e4-4a72-a7fc-89c7ffed8c20","500":"aed5ec28-f33b-44f6-ba5e-d70a4bc90413"},"method":"post","type":"path","servers":["0ba739b9-d5bb-4489-8d45-dee9bb1dbc06"],"path":"/v1/signatures/verify","baseUrlOptions":["https://api.moonshot.ai"],"title":"Verify Request Signature","codeSamples":[],"requiredOnlyExamples":true,"requestExampleType":"generated","responseExampleType":"generated"},"dependencies":{"parameters":{},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"nonce":{"type":"string","description":"The nonce sent in the `X-Msh-Request-Nonce` request header of the model call, exactly as sent.","minLength":1,"example":"7d929748-0ae6-41c2-ab5d-a186498ad721","isRequired":true,"uniqueKey":"nonce","typeLabel":"string"},"timestamp":{"type":"integer","format":"int64","description":"The Unix millisecond timestamp returned in the `Msh-Request-Timestamp` response header of the model call.","minimum":1,"example":1786338000123,"isRequired":true,"uniqueKey":"timestamp","typeLabel":"integer\u003cint64>"},"model":{"type":"string","description":"The `model` value from the request body of the model call, exactly as sent.","minLength":1,"example":"kimi-k3.1-pro","isRequired":true,"uniqueKey":"model","typeLabel":"string"},"signature":{"type":"string","description":"The signature token returned in the `Msh-Request-Signature` response header of the model call.","minLength":1,"example":"reqsigv1_\u003copaque-token>","isRequired":true,"uniqueKey":"signature","typeLabel":"string"}},"required":["nonce","timestamp","model","signature"],"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"nonce":"7d929748-0ae6-41c2-ab5d-a186498ad721","timestamp":1786338000123,"model":"kimi-k3.1-pro","signature":"reqsigv1_\u003copaque-token>"}}},"exampleType":"generated"}},"exampleType":"generated"},"responses":{"cb8217a3-538d-4990-8c81-0e418d0bdcd1":{"description":"Verification result","headers":{"Cache-Control":{"description":"Always `no-store`; verification results must not be cached.","schema":{"type":"string","example":"no-store"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"valid":{"type":"boolean","description":"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":true,"isRequired":true,"uniqueKey":"valid","typeLabel":"boolean"}},"required":["valid"],"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"valid":true}}},"exampleType":"generated"}},"exampleType":"generated"},"6f9efe31-e1c8-4c11-b5ba-929ea7ca9fe0":{"description":"Bad request - Invalid parameters or missing required fields","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string","description":"Error message describing what went wrong","isRequired":true,"uniqueKey":"error.message","typeLabel":"string"},"type":{"type":"string","description":"Error type","uniqueKey":"error.type","typeLabel":"string"},"code":{"type":"string","description":"Error code","uniqueKey":"error.code","typeLabel":"string"}},"required":["message"],"isRequired":true,"uniqueKey":"error","typeLabel":"object"}},"required":["error"],"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"error":{"message":"\u003cstring>","type":"\u003cstring>","code":"\u003cstring>"}}}},"exampleType":"generated"}},"exampleType":"generated"},"7504e05d-b48a-4fe1-9dc6-83ef3a506a01":{"description":"Unauthorized - Invalid or missing API key","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string","description":"Error message describing what went wrong","isRequired":true,"uniqueKey":"error.message","typeLabel":"string"},"type":{"type":"string","description":"Error type","uniqueKey":"error.type","typeLabel":"string"},"code":{"type":"string","description":"Error code","uniqueKey":"error.code","typeLabel":"string"}},"required":["message"],"isRequired":true,"uniqueKey":"error","typeLabel":"object"}},"required":["error"],"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"error":{"message":"\u003cstring>","type":"\u003cstring>","code":"\u003cstring>"}}}},"exampleType":"generated"}},"exampleType":"generated"},"3e0c5cbc-c6e4-4a72-a7fc-89c7ffed8c20":{"description":"Rate limited","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string","description":"Error message describing what went wrong","isRequired":true,"uniqueKey":"error.message","typeLabel":"string"},"type":{"type":"string","description":"Error type","uniqueKey":"error.type","typeLabel":"string"},"code":{"type":"string","description":"Error code","uniqueKey":"error.code","typeLabel":"string"}},"required":["message"],"isRequired":true,"uniqueKey":"error","typeLabel":"object"}},"required":["error"],"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"error":{"message":"\u003cstring>","type":"\u003cstring>","code":"\u003cstring>"}}}},"exampleType":"generated"}},"exampleType":"generated"},"aed5ec28-f33b-44f6-ba5e-d70a4bc90413":{"description":"Server error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string","description":"Error message describing what went wrong","isRequired":true,"uniqueKey":"error.message","typeLabel":"string"},"type":{"type":"string","description":"Error type","uniqueKey":"error.type","typeLabel":"string"},"code":{"type":"string","description":"Error code","uniqueKey":"error.code","typeLabel":"string"}},"required":["message"],"isRequired":true,"uniqueKey":"error","typeLabel":"object"}},"required":["error"],"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"error":{"message":"\u003cstring>","type":"\u003cstring>","code":"\u003cstring>"}}}},"exampleType":"generated"}},"exampleType":"generated"}},"security":{"e33f86ff-0930-4fb6-9772-b94452f0854c":{"bearerAuth":{"type":"http","scheme":"bearer","description":"The Authorization header expects a Bearer token. Use an MOONSHOT_API_KEY as the token. This is a server-side secret key. Generate one on the [API keys page](https://platform.kimi.ai/console/api-keys) in your dashboard.","scopes":[],"schemeName":"bearerAuth"}}},"servers":{"0ba739b9-d5bb-4489-8d45-dee9bb1dbc06":{"url":"https://api.moonshot.ai","description":"Production"}},"processedSecurityOptions":[{"schemes":[{"scheme":{"type":"http","scheme":"bearer","description":"The Authorization header expects a Bearer token. Use an MOONSHOT_API_KEY as the token. This is a server-side secret key. Generate one on the [API keys page](https://platform.kimi.ai/console/api-keys) in your dashboard.","scopes":[],"schemeName":"bearerAuth"},"schema":{"title":"Bearer Auth","type":"string","isRequired":true,"description":"The Authorization header expects a Bearer token. Use an MOONSHOT_API_KEY as the token. This is a server-side secret key. Generate one on the [API keys page](https://platform.kimi.ai/console/api-keys) in your dashboard.","format":"bearer","typeLabel":"string\u003cbearer>","deprecated":false},"schemeName":"bearerAuth","name":"Authorization"}],"title":"bearerAuth"}]},"originalFileLocation":"openapi.json"},"subdomain":"moonshotai","siteName":"Kimi API Platform","title":"Verify Request Signature - Kimi API Platform","contextualStarterQuestions":[],"navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-11-12T05:48:22.772Z","originalFileLocation":"api/signatures-verify.mdx"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=null;if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"system\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"description\" content=\"Verify a request signature to prove that a request was handled by the Kimi API for the specified model, rather than routed elsewhere.\">\u003cmeta data-mint-head name=\"keywords\" content=\"Kimi K3.1 Pro,kimi-k3.1-pro,Kimi K3,Moonshot AI,K3 Large Language Model,AI API,Tool Calling,Code Generation,Intelligent Dialogue,AI Agent,Open-source Model,Long Context,Claw Bot\">\u003cmeta data-mint-head name=\"application-name\" content=\"Kimi API Platform\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003cmeta data-mint-head name=\"robots\" content=\"index,follow\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/docs/mintlify-assets/_mintlify/favicons/moonshotai/6rzjGwhLi_bSodW_/_generated/favicon/android-chrome-192x192.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"/docs/mintlify-assets/_mintlify/favicons/moonshotai/6rzjGwhLi_bSodW_/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/docs/mintlify-assets/_mintlify/favicons/moonshotai/6rzjGwhLi_bSodW_/_generated/favicon/favicon-16x16.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/docs/mintlify-assets/_mintlify/favicons/moonshotai/6rzjGwhLi_bSodW_/_generated/favicon/favicon-32x32.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/docs/mintlify-assets/_mintlify/favicons/moonshotai/6rzjGwhLi_bSodW_/_generated/favicon/favicon.ico\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/docs/mintlify-assets/_mintlify/favicons/moonshotai/6rzjGwhLi_bSodW_/_generated/favicon-dark/android-chrome-192x192.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/docs/mintlify-assets/_mintlify/favicons/moonshotai/6rzjGwhLi_bSodW_/_generated/favicon-dark/favicon-16x16.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/docs/mintlify-assets/_mintlify/favicons/moonshotai/6rzjGwhLi_bSodW_/_generated/favicon-dark/favicon-32x32.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/docs/mintlify-assets/_mintlify/favicons/moonshotai/6rzjGwhLi_bSodW_/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Verify Request Signature - Kimi API Platform\">\u003cmeta data-mint-head property=\"og:description\" content=\"Verify a request signature to prove that a request was handled by the Kimi API for the specified model, rather than routed elsewhere.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"Kimi API Platform\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://platform.kimi.ai/docs/api/signatures-verify\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://platform.kimi.ai/og.png?v=1\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"Verify Request Signature - Kimi API Platform\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Verify a request signature to prove that a request was handled by the Kimi API for the specified model, rather than routed elsewhere.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://platform.kimi.ai/og.png?v=1\">\u003cmeta data-mint-head name=\"twitter:image:width\" content=\"1200\">\u003cmeta data-mint-head name=\"twitter:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"/docs/mintlify-assets/_mintlify/favicons/moonshotai/6rzjGwhLi_bSodW_/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"Kimi API Platform\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#111111\">\u003cmeta data-mint-head name=\"og:locale\" content=\"en-US\">\u003cmeta data-mint-head name=\"og:image:alt\" content=\"Kimi API Platform\">\u003clink data-mint-head rel=\"canonical\" href=\"https://platform.kimi.ai/docs/api/signatures-verify\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/docs/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/docs/api/signatures-verify.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://platform.kimi.ai/#organization\",\"name\":\"Kimi API Platform\",\"url\":\"https://platform.kimi.ai\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/moonshotai/X_5b_eA1iuJP595e/assets/logo/light.svg?fit=max\u0026auto=format\u0026n=X_5b_eA1iuJP595e\u0026q=85\u0026s=f68cf2d80f8d7f0363e088d2b988a598\"}},{\"@type\":\"WebSite\",\"@id\":\"https://platform.kimi.ai/docs#website\",\"name\":\"Kimi API Platform\",\"url\":\"https://platform.kimi.ai/docs\",\"publisher\":{\"@id\":\"https://platform.kimi.ai/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://platform.kimi.ai/docs/api/signatures-verify#webpage\",\"url\":\"https://platform.kimi.ai/docs/api/signatures-verify\",\"name\":\"Verify Request Signature\",\"description\":\"Verify a request signature to prove that a request was handled by the Kimi API for the specified model, rather than routed elsewhere.\",\"dateModified\":\"2026-11-12T05:48:22.772Z\",\"isPartOf\":{\"@id\":\"https://platform.kimi.ai/docs#website\"},\"breadcrumb\":{\"@id\":\"https://platform.kimi.ai/docs/api/signatures-verify#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://platform.kimi.ai/docs/api/signatures-verify#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"API Reference\",\"item\":\"https://platform.kimi.ai/docs/api/chat\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Verify Request Signature\",\"item\":\"https://platform.kimi.ai/docs/api/signatures-verify\"}]},{\"@type\":[\"TechArticle\",\"APIReference\"],\"@id\":\"https://platform.kimi.ai/docs/api/signatures-verify#apireference\",\"headline\":\"Verify Request Signature\",\"name\":\"Verify Request Signature\",\"description\":\"Verify a request signature to prove that a request was handled by the Kimi API for the specified model, rather than routed elsewhere.\",\"url\":\"https://platform.kimi.ai/docs/api/signatures-verify\",\"mainEntityOfPage\":{\"@id\":\"https://platform.kimi.ai/docs/api/signatures-verify#webpage\"},\"image\":\"https://platform.kimi.ai/og.png?v=1\",\"dateModified\":\"2026-11-12T05:48:22.772Z\",\"publisher\":{\"@id\":\"https://platform.kimi.ai/#organization\"},\"isPartOf\":{\"@id\":\"https://platform.kimi.ai/docs#website\"}}]}\u003c/script>","agentPointerHref":"/docs/api/signatures-verify.md","siteName":"Kimi API Platform","nav":{"global":null,"tabs":[{"tab":"Guides","pages":[{"title":"Guides","href":"/get-your-api-key"}]},{"tab":"API Reference","groups":[{"group":"Using the API","pages":[{"title":"API Overview","sidebarTitle":"API Overview","href":"/api/overview"},{"title":"Model Parameter Reference","sidebarTitle":"Model Parameter Reference","href":"/api/models-overview"},{"title":"Common Error Codes","sidebarTitle":"Error Codes","href":"/api/errors"}]},{"group":"API Reference","pages":[{"title":"Chat Completions API","sidebarTitle":"Chat Completions API","openapi":"POST /v1/chat/completions","href":"/api/chat"},{"title":"Responses API","sidebarTitle":"Responses API","openapi":"POST /v1/responses","href":"/api/responses"},{"title":"Messages API","sidebarTitle":"Messages API","openapi":"POST /anthropic/v1/messages","href":"/api/messages"},{"title":"List Models","sidebarTitle":"List Models","openapi":"GET /v1/models","href":"/api/list-models"},{"title":"Estimate Tokens","sidebarTitle":"Estimate Tokens","openapi":"POST /v1/tokenizers/estimate-token-count","href":"/api/estimate"},{"title":"Check Balance","sidebarTitle":"Check Balance","description":"Check the available balance of the current account.","openapi":"GET /v1/users/me/balance","href":"/api/balance"},{"title":"Verify Request Signature","sidebarTitle":"Verify Request Signature","openapi":"POST /v1/signatures/verify","href":"/api/signatures-verify"}]},{"group":"Tools","pages":[{"title":"Web Search Basic","sidebarTitle":"Web Search Basic","description":"Run a web search via the /v1/tools/search endpoint and get structured search results.","openapi":"POST /v1/tools/search","href":"/api/tools-search"},{"title":"Web Search Pro","sidebarTitle":"Web Search Pro","openapi":"POST /v1/tools/search_pro","href":"/api/tools-search-pro"},{"title":"URL Fetch","sidebarTitle":"URL Fetch","openapi":"POST /v1/tools/fetch","href":"/api/tools-fetch"}]},{"group":"Files","pages":[{"title":"Upload File","sidebarTitle":"Upload File","openapi":"POST /v1/files","href":"/api/files-upload"},{"title":"List Files","sidebarTitle":"List Files","openapi":"GET /v1/files","href":"/api/files-list"},{"title":"Get File Information","sidebarTitle":"Get File Information","openapi":"GET /v1/files/{file_id}","href":"/api/files-retrieve"},{"title":"Delete File","sidebarTitle":"Delete File","openapi":"DELETE /v1/files/{file_id}","href":"/api/files-delete"},{"title":"Get File Content","sidebarTitle":"Get File Content","openapi":"GET /v1/files/{file_id}/content","href":"/api/files-content"}]},{"group":"Batch API","pages":[{"title":"Create Batch","sidebarTitle":"Create Batch","openapi":"POST /v1/batches","href":"/api/batch-create"},{"title":"List Batches","sidebarTitle":"List Batches","openapi":"GET /v1/batches","href":"/api/batch-list"},{"title":"Retrieve Batch","sidebarTitle":"Retrieve Batch","openapi":"GET /v1/batches/{batch_id}","href":"/api/batch-retrieve"},{"title":"Cancel Batch","sidebarTitle":"Cancel Batch","openapi":"POST /v1/batches/{batch_id}/cancel","href":"/api/batch-cancel"}]},{"group":"Admin API","tag":"Beta","pages":[{"title":"Admin API overview","sidebarTitle":"Overview","href":"/admin-api/overview"},{"group":"Billing","pages":[{"title":"List daily bills","openapi":"GET /v1/admin/organizations/billings/daily_bills","href":"/admin-api/billing-daily-bills"},{"title":"List product bills","openapi":"GET /v1/admin/organizations/billings/product_bills","href":"/admin-api/billing-product-bills"},{"title":"List request details","openapi":"GET /v1/admin/organizations/billings/request_details","href":"/admin-api/billing-request-details"},{"title":"List interrupted requests","openapi":"GET /v1/admin/organizations/billings/interrupted_requests","href":"/admin-api/billing-interrupted-requests"},{"title":"Get account balance","openapi":"GET /v1/admin/organizations/account","href":"/admin-api/billing-account"}]},{"group":"Audit Logs","pages":[{"title":"List audit log events","openapi":"GET /v1/admin/organizations/audit_logs","href":"/admin-api/audit-logs"}]},{"group":"Usage","pages":[{"title":"Get usage aggregation","openapi":"GET /v1/admin/organizations/usage/{usage_type}","href":"/admin-api/usage"}]},{"group":"Organization","pages":[{"title":"Get organization info","openapi":"GET /v1/admin/organizations","href":"/admin-api/organization"},{"group":"Members \u0026 Invitations","pages":[{"title":"List members","openapi":"GET /v1/admin/organizations/members","href":"/admin-api/members"},{"title":"Get member","openapi":"GET /v1/admin/organizations/members/{uid}","href":"/admin-api/member"},{"title":"Update member role","openapi":"PATCH /v1/admin/organizations/members/{uid}","href":"/admin-api/member-update-role"},{"title":"Remove member","openapi":"DELETE /v1/admin/organizations/members/{uid}","href":"/admin-api/member-remove"},{"title":"List invitations","openapi":"GET /v1/admin/organizations/invites","href":"/admin-api/invites"},{"title":"Get invitation","openapi":"GET /v1/admin/organizations/invites/{code}","href":"/admin-api/invite"},{"title":"Create invitation","openapi":"POST /v1/admin/organizations/invites","href":"/admin-api/invite-create"}]},{"group":"Projects","pages":[{"title":"List projects","openapi":"GET /v1/admin/organizations/projects","href":"/admin-api/projects"},{"title":"Get project","openapi":"GET /v1/admin/organizations/projects/{pid}","href":"/admin-api/project"},{"title":"Create project","openapi":"POST /v1/admin/organizations/projects","href":"/admin-api/project-create"},{"title":"Update project","openapi":"PATCH /v1/admin/organizations/projects/{pid}","href":"/admin-api/project-update"},{"title":"Archive project","openapi":"POST /v1/admin/organizations/projects/{pid}/archive","href":"/admin-api/project-archive"}]},{"group":"Project Members","pages":[{"title":"List project members","openapi":"GET /v1/admin/organizations/projects/{pid}/members","href":"/admin-api/project-members"},{"title":"Add project member","openapi":"POST /v1/admin/organizations/projects/{pid}/members","href":"/admin-api/project-member-add"},{"title":"Update project member role","openapi":"PATCH /v1/admin/organizations/projects/{pid}/members/{uid}","href":"/admin-api/project-member-update-role"},{"title":"Remove project member","openapi":"DELETE /v1/admin/organizations/projects/{pid}/members/{uid}","href":"/admin-api/project-member-remove"}]},{"group":"API Keys","pages":[{"title":"List project API keys","openapi":"GET /v1/admin/organizations/projects/{pid}/api_keys","href":"/admin-api/project-api-keys"},{"title":"Get API key metadata","openapi":"GET /v1/admin/organizations/api_keys/{key}","href":"/admin-api/api-key"},{"title":"Rename API key","openapi":"PATCH /v1/admin/organizations/projects/{pid}/api_keys/{key}","href":"/admin-api/api-key-rename"},{"title":"Revoke API key","openapi":"DELETE /v1/admin/organizations/projects/{pid}/api_keys/{key}","href":"/admin-api/api-key-revoke"}]},{"group":"Configuration","pages":[{"title":"Get organization rate limits","openapi":"GET /v1/admin/organizations/rate_limits","href":"/admin-api/rate-limits"},{"group":"Project Model Rate Limits","pages":[{"title":"List project model rate limits","openapi":"GET /v1/admin/organizations/projects/{pid}/model_limits","href":"/admin-api/project-model-limits"},{"title":"Create project model rate limit","openapi":"POST /v1/admin/organizations/projects/{pid}/model_limits","href":"/admin-api/project-model-limit-create"},{"title":"Get project model rate limit","openapi":"GET /v1/admin/organizations/projects/{pid}/model_limits/{model_id}","href":"/admin-api/project-model-limit"},{"title":"Update project model rate limit","openapi":"PATCH /v1/admin/organizations/projects/{pid}/model_limits/{model_id}","href":"/admin-api/project-model-limit-update"},{"title":"Delete project model rate limit","openapi":"DELETE /v1/admin/organizations/projects/{pid}/model_limits/{model_id}","href":"/admin-api/project-model-limit-delete"}]},{"title":"Get project spend limit","openapi":"GET /v1/admin/organizations/projects/{pid}/spend_limits","href":"/admin-api/project-spend-limits"},{"title":"Update project spend limit","openapi":"PATCH /v1/admin/organizations/projects/{pid}/spend_limits","href":"/admin-api/project-spend-limits-update"}]}]}]}]},{"tab":"Models \u0026 Pricing","pages":[{"title":"Models \u0026 Pricing","href":"/pricing/chat"}]},{"tab":"Resources","menu":[{"item":"Community","icon":"users","pages":[{"title":"Community","href":"/api/join-the-community"}]},{"item":"Playground","icon":"terminal","href":"https://platform.kimi.ai/playground"},{"item":"Help Center","icon":"circle-question","pages":[{"title":"Help Center","href":"/guide/account-and-payments"}]},{"item":"Learning and support","icon":"book-open","pages":[{"title":"Learning and support","href":"/guide/compact-conversation-history"}]},{"item":"Legal","icon":"file-text","pages":[{"title":"Legal","href":"/agreement/modeluse"}]},{"item":"Changelog","icon":"list","pages":[{"title":"Changelog","href":"/platform-changelog"}]}],"pages":[{"title":"Resources","href":"/api/join-the-community"}]}]},"basePath":"","title":"Verify Request Signature - Kimi API Platform","deploymentId":"dpl_CsF4Fp7CD8Gg1DEmR1C2gpC2wJMd","buildId":"dpl_CsF4Fp7CD8Gg1DEmR1C2gpC2wJMd","dynamics":["10e4515597","c2aa737661","b0f84f53ff","a9bb46feb3","2b790eda92"],"chunks":["BannerMarkdown-Bt8auxFN.js","dist-DZGh42zv.js","lib-DMeTj1gb.js","lib-B8HbPgcC.js","katex-Dbtb6Wk7.js","html-void-elements-mCSPHezU.js","marked.esm-CZWythHk.js","OpenApiReferenceProvider-DLvtMaUc.js","snippetPresets-Ba3x3vVd.js","utils-BAajSwWm.js","style-to-object-BY3JEAdk.js","utils-wFwV0uS5.js","v4-DIgz8zy6.js","addTypeLabelsToSchema-s45YhRZe.js","conditional-requirements-CFM0id0Q.js","cloneDeep-CtLIM-at.js","_Uint8Array-DY6C0W7i.js","isObject-FP1Yky1u.js","Page-ti1P8cSW.js","api-description-markdown-BKDCMKFV.js","DynamicMarkdown-DMZkxYUv.js","CodeSnippet-DmqY_oBM.js","use-playground-group-access-DOwL5KG1.js","SectionHeading-45yLRhye.js","ApiExamples-C_cT4XCt.js","usePlaygroundInputsStore-LLcTKnvt.js","shallow-0pZD3vuo.js","isEqual-Ez5HiY1q.js","CodeSnippets-Sj0bP4yD.js","MethodPill-DWuqoPCw.js","getPastedJson-D4w__qxl.js","Check2Icon-BT8wuU18.js","axios-CsQoIw0U.js","Markdown-CZShaIQG.js","AssistantPageLink-DJG0_VXd.js"]}