Anthropic Messages token-counting compatible endpoint. Returns the number of input tokens a Messages request would consume, without creating a message. Mirrors Anthropic’s POST /v1/messages/count_tokens (same request body as the Messages endpoint, minus the required max_tokens).
The model resolves exactly as it does on the Messages endpoint, so every model a message accepts can be counted, and one a message would reject fails the same way (404 for an unknown model, 403 for one the allowlist or an entitlement denies). Claude models are counted exactly by their own backend, in the model’s region. Every other model, and a dynamic route, gets Opper’s estimate in the same shape: characters / 4 over the system prompt, messages and tool declarations, plus 1 (within about 20% on English prose), with a flat amount per image and 3,000 tokens per PDF page. The X-Opper-Count-Source response header says which.
Comma-separated key:value usage-attribution tags (e.g. tenant:acme,project:demo, max 8). Recorded on the generation's billing/metrics rows; group spend by any key via GET /v2/analytics/usage?group_by=. Header-borne twin of the /v3/session URL prefix tags (which win per key when both are present); opper.-prefixed keys and session_id are reserved. Malformed values return 400.
Opt in to top-level automatic prompt caching: {"type":"ephemeral"} (optionally "ttl":"1h"). Places one moving breakpoint on the largest cacheable prefix. Explicit per-block cache_control on system/message/tool content takes precedence. Caching is off unless set. Cache writes cost 1.25x input and reads 0.1x
Fallback models tried in order when the model before them fails for any reason (provider error; rate limit; timeout; a member blocked by one of your rules). Same OpenRouter shape: send the primary in model and the rest here; or omit model and the first entry is the primary. Each entry is any model string: a bare pooled name; a provider/model id; an org alias. Not allowed together with a dynamic/ route. At most 10 entries. Which model answered is in the X-Opper-Served-Model header; the model field still echoes what you sent.
Output configuration. A format of {"type":"json_schema" + "schema":{...}} constrains the response to that JSON Schema. An effort of low|medium|high sets adaptive-thinking effort. Sending a format here and a top-level output_format is a 400.
Structured output; superseded by output_config.format. Accepts either the Messages API shape ({"type":"json_schema" + "schema":{...}}) or the OpenAI-style envelope ({"type":"json_schema" + "json_schema":{"name":... + "schema":{...}}}).
Processing tier. Anthropic values auto and standard_only run at the default tier; the OpenAI names flex; priority (alias fast) and ultrafast and Opper's economy pick that tier where the model has an endpoint for it. The tier that ran is in the X-Opper-Served-Service-Tier header.
The number of input tokens the request would consume.
Last modified on June 8, 2026
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"Opper","description":"The European AI gateway for agents: 700+ models from 50+ providers through one EU-hosted API, drop-in for the OpenAI, Anthropic and Gemini SDKs.","colors":{"primary":"#14cdcd","light":"#24cdcd","dark":"#2d9393"},"logo":{"light":"https://mintcdn.com/opper/EXrQN6z6604ZsBuP/logo/light.svg?fit=max\u0026auto=format\u0026n=EXrQN6z6604ZsBuP\u0026q=85\u0026s=fd4170c482c6cebc3c20d8f7f7e033f8","dark":"https://mintcdn.com/opper/EXrQN6z6604ZsBuP/logo/dark.svg?fit=max\u0026auto=format\u0026n=EXrQN6z6604ZsBuP\u0026q=85\u0026s=328888ac1f44b63c468d022fda86421d"},"favicon":"https://mintcdn.com/opper/EXrQN6z6604ZsBuP/favicon.png?fit=max\u0026auto=format\u0026n=EXrQN6z6604ZsBuP\u0026q=85\u0026s=f1229b80ac7eee56ba2c14789e5fe22e","api":{"examples":{"defaults":"required","languages":["Shell","python","typescript"]}},"appearance":{"default":"system"},"navbar":{"links":[{"href":"mailto:support@opper.ai","label":"Support"},{"href":"https://discord.gg/wcT3bc7Y4Y","label":"Discord"}],"primary":{"type":"button","label":"Login","href":"https://platform.opper.ai/auth/signin"}},"footer":{"socials":{"x":"https://x.com/opperai","github":"https://github.com/opper-ai","linkedin":"https://linkedin.com/company/opper-ai"}},"integrations":{"plausible":{"domain":"docs.opper.ai"}},"contextual":{"options":["copy","view"],"display":"header"},"metadata":{"timestamp":true},"styling":{"latex":true},"navigation":{"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"opper","hasAudioNarration":false,"actualSubdomain":"opper","customDomains":["docs.opper.ai"],"gitSource":{"type":"github","owner":"opper-ai","repo":"mintlify-docs","deployBranch":"main","contentDirectory":"","isPrivate":true,"mountPath":"","label":""},"chroma":{"liveDeploymentHistoryId":"6ae31a1886c7ae22426d0b9f","collectionId":"62e1b5b0-1252-4190-812e-7548a827b5dd","schemaVersion":"v3","latestBuiltDeploymentHistoryId":"6ae31a1886c7ae22426d0b9f"},"feedback":{"thumbs":false},"entitlements":{"AI_CHAT":{"status":"ENABLED"},"WEB_MCP":{"status":"ENABLED"},"NARRATION":{"status":"ENABLED"}},"buildId":"6ae34b6a9195f5361a7f1e09","clientVersion":"0.0.4006","searchFilterCounts":[{"language":"default","tag":"Documentation","count":88},{"language":"default","tag":"API Reference","count":78},{"language":"default","tag":"Platform APIs","count":41},{"language":"default","tag":"Management","count":30},{"language":"default","tag":"Apps","count":29},{"language":"default","tag":"Build","count":26},{"language":"default","tag":"Multimodality","count":22},{"language":"default","tag":"Observe \u0026 Control","count":15},{"language":"default","tag":"Gateway","count":14},{"language":"default","tag":"Compatibility","count":13}]},"assistantConfig":{},"basePath":"","hasChatPermissions":true,"hasWebMcpPermissions":true,"toggles":[{"name":"kill-isr","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":"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":"workos-onboarding","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"pause-universal-search-reconcile","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":"per-site-search-delta","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":"editor-private-page-search","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":"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":"workspace-projects","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"assistant-v5","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"byok-sep-25","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":"vite-origin","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-updated-9-15","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-sso-scim","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":"workos-signup","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-enabled","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"googleFontsInlined":false},"customCss":[{"filePath":"style.css","content":"@keyframes oppFade{0%{opacity:0;transform:translateY(5px)}to{opacity:1;transform:none}}@keyframes oppBlink{0%,49%{opacity:1}50%,to{opacity:0}}@keyframes oppDot{0%,80%,to{opacity:.25}40%{opacity:1}}.opp-term .opp-line{opacity:0;animation:oppFade .4s ease forwards}.opp-term a{color:inherit;text-decoration:none;cursor:default}.opp-cursor{display:inline-block;width:7px;height:1em;margin-left:5px;vertical-align:text-bottom;border-radius:1px;background:#14cdcd;animation:oppBlink 1.1s step-end infinite}.opp-dots span{display:inline-block;width:5px;height:5px;margin-right:3px;border-radius:50%;background:#6e7681;animation:oppDot 1.2s infinite}.opp-dots span:nth-child(2){animation-delay:.2s}.opp-dots span:nth-child(3){animation-delay:.4s}.opp-replay{margin-left:auto;background:0 0;border:1px solid #2b3440;color:#8b949e;font:inherit;font-size:11px;padding:2px 9px;border-radius:6px;cursor:pointer;opacity:0;pointer-events:none;transition:opacity .3s,color .2s,border-color .2s}.opp-replay.show{opacity:1;pointer-events:auto}.opp-replay:hover{color:#14cdcd;border-color:#14cdcd}"}],"page":{"pagePath":"v3-api-reference/compatibility/count-message-tokens","slug":"/v3-api-reference/compatibility/count-message-tokens","pageMetadata":{"title":"Count Tokens","openapi":"post /v3/compat/v1/messages/count_tokens","description":"Anthropic Messages token-counting compatible endpoint. Returns the number of input tokens a Messages request would consume, without creating a message. Mirrors Anthropic's POST /v1/messages/count_tokens (same request body as the Messages endpoint, minus the required max_tokens).\n\nThe model resolves exactly as it does on the Messages endpoint, so every model a message accepts can be counted, and one a message would reject fails the same way (404 for an unknown model, 403 for one the allowlist or an entitlement denies). Claude models are counted exactly by their own backend, in the model's region. Every other model, and a dynamic route, gets Opper's estimate in the same shape: characters / 4 over the system prompt, messages and tool declarations, plus 1 (within about 20% on English prose), with a flat amount per image and 3,000 tokens per PDF page. The `X-Opper-Count-Source` response header says which.","href":"/v3-api-reference/compatibility/count-message-tokens"},"description":{"compiledSource":"\"use strict\";\nconst {Fragment: _Fragment, jsx: _jsx, jsxs: _jsxs} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n code: \"code\",\n p: \"p\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsxs(_Fragment, {\n children: [_jsx(_components.p, {\n children: \"Anthropic Messages token-counting compatible endpoint. Returns the number of input tokens a Messages request would consume, without creating a message. Mirrors Anthropic’s POST /v1/messages/count_tokens (same request body as the Messages endpoint, minus the required max_tokens).\"\n }), \"\\n\", _jsxs(_components.p, {\n children: [\"The model resolves exactly as it does on the Messages endpoint, so every model a message accepts can be counted, and one a message would reject fails the same way (404 for an unknown model, 403 for one the allowlist or an entitlement denies). Claude models are counted exactly by their own backend, in the model’s region. Every other model, and a dynamic route, gets Opper’s estimate in the same shape: characters / 4 over the system prompt, messages and tool declarations, plus 1 (within about 20% on English prose), with a flat amount per image and 3,000 tokens per PDF page. The \", _jsx(_components.code, {\n children: \"X-Opper-Count-Source\"\n }), \" response header says which.\"]\n })]\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}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){return _jsx(_Fragment,{})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent}","frontmatter":{},"scope":{"config":{},"pageMetadata":{"title":"Count Tokens","openapi":"post /v3/compat/v1/messages/count_tokens","description":"Anthropic Messages token-counting compatible endpoint. Returns the number of input tokens a Messages request would consume, without creating a message. Mirrors Anthropic's POST /v1/messages/count_tokens (same request body as the Messages endpoint, minus the required max_tokens).\n\nThe model resolves exactly as it does on the Messages endpoint, so every model a message accepts can be counted, and one a message would reject fails the same way (404 for an unknown model, 403 for one the allowlist or an entitlement denies). Claude models are counted exactly by their own backend, in the model's region. Every other model, and a dynamic route, gets Opper's estimate in the same shape: characters / 4 over the system prompt, messages and tool declarations, plus 1 (within about 20% on English prose), with a flat amount per image and 3,000 tokens per PDF page. The `X-Opper-Count-Source` response header says which.","href":"/v3-api-reference/compatibility/count-message-tokens"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[],"codeExamples":{}},"jsLinks":["/_mintlify/custom/opper/40a2b9bd0ec03258/script.js"],"openApiReferenceData":{"operation":{"description":"Anthropic Messages token-counting compatible endpoint. Returns the number of input tokens a Messages request would consume, without creating a message. Mirrors Anthropic's POST /v1/messages/count_tokens (same request body as the Messages endpoint, minus the required max_tokens).\n\nThe model resolves exactly as it does on the Messages endpoint, so every model a message accepts can be counted, and one a message would reject fails the same way (404 for an unknown model, 403 for one the allowlist or an entitlement denies). Claude models are counted exactly by their own backend, in the model's region. Every other model, and a dynamic route, gets Opper's estimate in the same shape: characters / 4 over the system prompt, messages and tool declarations, plus 1 (within about 20% on English prose), with a flat amount per image and 3,000 tokens per PDF page. The `X-Opper-Count-Source` response header says which.","operationId":"countMessageTokens","parameters":["080d5232-8b9f-45b5-8c7e-878283696d50","216612b0-ec99-4a57-867e-127532adf285","843be9f2-ae8c-43fc-8e20-5d832bead737"],"requestBody":"5a408b32-4dc5-4f57-8c30-8ceff4df66e7","responses":{"200":"d910d3f8-4e40-43b1-9155-839361c9b936","400":"f5b34c16-8eba-4b5a-a11f-75082d822fea","401":"d12cfbc0-5bd2-4f10-a213-753e29003ac6","500":"7daba827-89ff-45b3-ba5d-2913b92d57f8"},"summary":"Count Message tokens","tags":["Compatibility"],"method":"post","type":"path","servers":["2c9c30ae-6d66-4614-b4a0-e353449fb124","7fa77d9f-a74b-4946-8960-ce25a925a27f"],"security":["ce2882f6-980e-482a-a089-9f4bf414c35e"],"path":"/v3/compat/v1/messages/count_tokens","baseUrlOptions":["https://api.opper.ai","http://localhost:8080"],"title":"Count Message tokens","codeSamples":[],"requestExampleLanguages":["bash","python","typescript"],"requiredOnlyExamples":true,"requestExampleType":"generated","responseExampleType":"generated"},"dependencies":{"parameters":{"080d5232-8b9f-45b5-8c7e-878283696d50":{"description":"Function name for tracing and project-level guardrail function-scope filtering.","in":"header","name":"X-Opper-Name","schema":{"type":"string","description":"Function name for tracing and project-level guardrail function-scope filtering.","uniqueKey":"","typeLabel":"string"}},"216612b0-ec99-4a57-867e-127532adf285":{"description":"Parent span ID for distributed tracing context.","in":"header","name":"X-Opper-Parent-Span-Id","schema":{"format":"uuid","type":"string","description":"Parent span ID for distributed tracing context.","uniqueKey":"","typeLabel":"string\u003cuuid>"}},"843be9f2-ae8c-43fc-8e20-5d832bead737":{"description":"Comma-separated `key:value` usage-attribution tags (e.g. `tenant:acme,project:demo`, max 8). Recorded on the generation's billing/metrics rows; group spend by any key via GET /v2/analytics/usage?group_by=\u003ckey>. Header-borne twin of the /v3/session URL prefix tags (which win per key when both are present); `opper.`-prefixed keys and `session_id` are reserved. Malformed values return 400.","in":"header","name":"X-Opper-Tags","schema":{"type":"string","description":"Comma-separated `key:value` usage-attribution tags (e.g. `tenant:acme,project:demo`, max 8). Recorded on the generation's billing/metrics rows; group spend by any key via GET /v2/analytics/usage?group_by=\u003ckey>. Header-borne twin of the /v3/session URL prefix tags (which win per key when both are present); `opper.`-prefixed keys and `session_id` are reserved. Malformed values return 400.","uniqueKey":"","typeLabel":"string"}}},"requestBody":{"content":{"application/json":{"schema":{"properties":{"max_tokens":{"type":"integer","isRequired":true,"uniqueKey":"max_tokens","typeLabel":"integer"},"messages":{"items":{"properties":{"content":{"description":"Any value","isRequired":true,"uniqueKey":"messages.items.[INDEX].content","typeLabel":"any"},"role":{"type":"string","isRequired":true,"uniqueKey":"messages.items.[INDEX].role","typeLabel":"string"}},"required":["role","content"],"type":"object","uniqueKey":"messages.items.[INDEX]","typeLabel":"object"},"type":"array","isRequired":true,"uniqueKey":"messages","typeLabel":"object[]"},"model":{"type":"string","isRequired":true,"uniqueKey":"model","typeLabel":"string"},"cache_control":{"description":"Opt in to top-level automatic prompt caching: {\"type\":\"ephemeral\"} (optionally \"ttl\":\"1h\"). Places one moving breakpoint on the largest cacheable prefix. Explicit per-block cache_control on system/message/tool content takes precedence. Caching is off unless set. Cache writes cost 1.25x input and reads 0.1x","type":"object","uniqueKey":"cache_control","typeLabel":"object"},"metadata":{"type":"object","uniqueKey":"metadata","typeLabel":"object"},"models":{"description":"Fallback models tried in order when the model before them fails for any reason (provider error; rate limit; timeout; a member blocked by one of your rules). Same OpenRouter shape: send the primary in model and the rest here; or omit model and the first entry is the primary. Each entry is any model string: a bare pooled name; a provider/model id; an org alias. Not allowed together with a dynamic/\u003cname> route. At most 10 entries. Which model answered is in the X-Opper-Served-Model header; the model field still echoes what you sent.","items":{"type":"string","uniqueKey":"models.items.[INDEX]","typeLabel":"string"},"type":"array","uniqueKey":"models","typeLabel":"string[]"},"output_config":{"description":"Output configuration. A format of {\"type\":\"json_schema\" + \"schema\":{...}} constrains the response to that JSON Schema. An effort of low|medium|high sets adaptive-thinking effort. Sending a format here and a top-level output_format is a 400.","type":"object","uniqueKey":"output_config","typeLabel":"object"},"output_format":{"description":"Structured output; superseded by output_config.format. Accepts either the Messages API shape ({\"type\":\"json_schema\" + \"schema\":{...}}) or the OpenAI-style envelope ({\"type\":\"json_schema\" + \"json_schema\":{\"name\":... + \"schema\":{...}}}).","type":"object","uniqueKey":"output_format","typeLabel":"object"},"service_tier":{"description":"Processing tier. Anthropic values auto and standard_only run at the default tier; the OpenAI names flex; priority (alias fast) and ultrafast and Opper's economy pick that tier where the model has an endpoint for it. The tier that ran is in the X-Opper-Served-Service-Tier header.","type":"string","uniqueKey":"service_tier","typeLabel":"string"},"speed":{"description":"fast asks for Anthropic fast mode (the priority tier; premium price) where the model has an endpoint for it; standard or empty is the default tier.","type":"string","uniqueKey":"speed","typeLabel":"string"},"stop_sequences":{"items":{"type":"string","uniqueKey":"stop_sequences.items.[INDEX]","typeLabel":"string"},"type":"array","uniqueKey":"stop_sequences","typeLabel":"string[]"},"stream":{"type":"boolean","uniqueKey":"stream","typeLabel":"boolean"},"system":{"description":"Any value","uniqueKey":"system","typeLabel":"any"},"temperature":{"type":"number","uniqueKey":"temperature","typeLabel":"number"},"thinking":{"description":"Any value","uniqueKey":"thinking","typeLabel":"any"},"tool_choice":{"description":"Any value","uniqueKey":"tool_choice","typeLabel":"any"},"tools":{"items":{"properties":{"name":{"type":"string","isRequired":true,"uniqueKey":"tools.items.[INDEX].name","typeLabel":"string"},"cache_control":{"type":"object","uniqueKey":"tools.items.[INDEX].cache_control","typeLabel":"object"},"description":{"type":"string","uniqueKey":"tools.items.[INDEX].description","typeLabel":"string"},"input_schema":{"type":"object","uniqueKey":"tools.items.[INDEX].input_schema","typeLabel":"object"},"type":{"type":"string","uniqueKey":"tools.items.[INDEX].type","typeLabel":"string"}},"required":["name"],"type":"object","uniqueKey":"tools.items.[INDEX]","typeLabel":"object"},"type":"array","uniqueKey":"tools","typeLabel":"object[]"},"top_k":{"type":"integer","uniqueKey":"top_k","typeLabel":"integer"},"top_p":{"type":"number","uniqueKey":"top_p","typeLabel":"number"}},"required":["model","messages","max_tokens"],"type":"object","uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"max_tokens":123,"messages":[{"content":"\u003cunknown>","role":"\u003cstring>"}],"model":"\u003cstring>","cache_control":{},"metadata":{},"models":["\u003cstring>"],"output_config":{},"output_format":{},"service_tier":"\u003cstring>","speed":"\u003cstring>","stop_sequences":["\u003cstring>"],"stream":true,"system":"\u003cunknown>","temperature":123,"thinking":"\u003cunknown>","tool_choice":"\u003cunknown>","tools":[{"name":"\u003cstring>","cache_control":{},"description":"\u003cstring>","input_schema":{},"type":"\u003cstring>"}],"top_k":123,"top_p":123}}},"exampleType":"generated"}},"required":true,"exampleType":"generated"},"responses":{"d910d3f8-4e40-43b1-9155-839361c9b936":{"content":{"application/json":{"schema":{"additionalProperties":false,"properties":{"input_tokens":{"description":"The number of input tokens the request would consume.","type":"integer","isRequired":true,"uniqueKey":"input_tokens","typeLabel":"integer"}},"required":["input_tokens"],"type":"object","uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"input_tokens":123}}},"exampleType":"generated"}},"description":"Successful response","headers":{"X-Opper-Count-Source":{"description":"Where `input_tokens` came from: `provider` when the model's provider counted it exactly, `estimate` when it is Opper's estimate.","schema":{"enum":["provider","estimate"],"type":"string"}}},"exampleType":"generated"},"f5b34c16-8eba-4b5a-a11f-75082d822fea":{"content":{"application/json":{"schema":{"properties":{"error":{"properties":{"code":{"type":"string","isRequired":true,"uniqueKey":"error.code","typeLabel":"string"},"message":{"type":"string","isRequired":true,"uniqueKey":"error.message","typeLabel":"string"},"details":{"description":"Any value","uniqueKey":"error.details","typeLabel":"any"}},"required":["code","message"],"type":"object","isRequired":true,"uniqueKey":"error","typeLabel":"object"},"meta":{"type":"object","uniqueKey":"meta","typeLabel":"object"}},"required":["error"],"type":"object","uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"error":{"code":"\u003cstring>","message":"\u003cstring>","details":"\u003cunknown>"},"meta":{}}}},"exampleType":"generated"}},"description":"Bad request","exampleType":"generated"},"d12cfbc0-5bd2-4f10-a213-753e29003ac6":{"description":"Unauthorized - missing or invalid API key","content":{"_mintlify/placeholder":{"schema":{"type":"object","description":""}}}},"7daba827-89ff-45b3-ba5d-2913b92d57f8":{"content":{"application/json":{"schema":{"properties":{"error":{"properties":{"code":{"type":"string","isRequired":true,"uniqueKey":"error.code","typeLabel":"string"},"message":{"type":"string","isRequired":true,"uniqueKey":"error.message","typeLabel":"string"},"details":{"description":"Any value","uniqueKey":"error.details","typeLabel":"any"}},"required":["code","message"],"type":"object","isRequired":true,"uniqueKey":"error","typeLabel":"object"},"meta":{"type":"object","uniqueKey":"meta","typeLabel":"object"}},"required":["error"],"type":"object","uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"error":{"code":"\u003cstring>","message":"\u003cstring>","details":"\u003cunknown>"},"meta":{}}}},"exampleType":"generated"}},"description":"Internal server error","exampleType":"generated"}},"security":{"ce2882f6-980e-482a-a089-9f4bf414c35e":{"BearerAuth":{"bearerFormat":"API Key","description":"API key authentication. Pass your API key as a Bearer token.","scheme":"bearer","type":"http","scopes":[],"schemeName":"BearerAuth"}}},"servers":{"2c9c30ae-6d66-4614-b4a0-e353449fb124":{"description":"Production","url":"https://api.opper.ai"},"7fa77d9f-a74b-4946-8960-ce25a925a27f":{"description":"Local development","url":"http://localhost:8080"}},"processedSecurityOptions":[{"schemes":[{"scheme":{"bearerFormat":"API Key","description":"API key authentication. Pass your API key as a Bearer token.","scheme":"bearer","type":"http","scopes":[],"schemeName":"BearerAuth"},"schema":{"title":"Bearer Auth","type":"string","isRequired":true,"description":"API key authentication. Pass your API key as a Bearer token.","format":"bearer","typeLabel":"string\u003cbearer>","deprecated":false},"schemeName":"BearerAuth","name":"Authorization"}],"title":"BearerAuth"}]},"originalFileLocation":"openapi-v3.json"},"subdomain":"opper","siteName":"Opper","title":"Count Tokens - Opper","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-09-17T07:26:53.597Z","gitLastModified":"2026-06-08T13:52:28.000Z","originalFileLocation":"v3-api-reference/compatibility/count-message-tokens.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=\"Anthropic Messages token-counting compatible endpoint. Returns the number of input tokens a Messages request would consume, without creating a message. Mirrors Anthropic\u0026#x27;s POST /v1/messages/count_tokens (same request body as the Messages endpoint, minus the required max_tokens). The model resolves exactly as it does on the Messages endpoint, so every model a message accepts can be counted, and one a message would reject fails the same way (404 for an unknown model, 403 for one the allowlist or an entitlement denies). Claude models are counted exactly by their own backend, in the model\u0026#x27;s region. Every other model, and a dynamic route, gets Opper\u0026#x27;s estimate in the same shape: characters / 4 over the system prompt, messages and tool declarations, plus 1 (within about 20% on English prose), with a flat amount per image and 3,000 tokens per PDF page. The X-Opper-Count-Source response header says which.\">\u003cmeta data-mint-head name=\"application-name\" content=\"Opper\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/opper/QTlMDo19G0sAM5ID/_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=\"/mintlify-assets/_mintlify/favicons/opper/QTlMDo19G0sAM5ID/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/opper/QTlMDo19G0sAM5ID/_generated/favicon/favicon-16x16.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/opper/QTlMDo19G0sAM5ID/_generated/favicon/favicon-32x32.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/opper/QTlMDo19G0sAM5ID/_generated/favicon/favicon.ico\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/opper/QTlMDo19G0sAM5ID/_generated/favicon-dark/android-chrome-192x192.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/opper/QTlMDo19G0sAM5ID/_generated/favicon-dark/favicon-16x16.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/opper/QTlMDo19G0sAM5ID/_generated/favicon-dark/favicon-32x32.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/opper/QTlMDo19G0sAM5ID/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Count Tokens - Opper\">\u003cmeta data-mint-head property=\"og:description\" content=\"Anthropic Messages token-counting compatible endpoint. Returns the number of input tokens a Messages request would consume, without creating a message. Mirrors Anthropic\u0026#x27;s POST /v1/messages/count_tokens (same request body as the Messages endpoint, minus the required max_tokens). The model resolves exactly as it does on the Messages endpoint, so every model a message accepts can be counted, and one a message would reject fails the same way (404 for an unknown model, 403 for one the allowlist or an entitlement denies). Claude models are counted exactly by their own backend, in the model\u0026#x27;s region. Every other model, and a dynamic route, gets Opper\u0026#x27;s estimate in the same shape: characters / 4 over the system prompt, messages and tool declarations, plus 1 (within about 20% on English prose), with a flat amount per image and 3,000 tokens per PDF page. The X-Opper-Count-Source response header says which.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"Opper\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.opper.ai/v3-api-reference/compatibility/count-message-tokens\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://opper.mintlify.app/_mintlify/api/og/v2?division=Anthropic\u0026amp;title=Count+Tokens\u0026amp;description=Anthropic+Messages+token-counting+compatible+endpoint.+Returns+the+number+of+input+tokens+a+Messages+request+would+consume%2C+without+creating+a+message.+Mirrors+\u0026amp;theme=2bfe23844db8025c327f2519\u0026amp;signature=19b883a04e6d0b9a022dfdeccca4526e13282f54ec536375d45b1a92bbb2121e\">\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=\"Count Tokens - Opper\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Anthropic Messages token-counting compatible endpoint. Returns the number of input tokens a Messages request would consume, without creating a message. Mirrors Anthropic\u0026#x27;s POST /v1/messages/count_tokens (same request body as the Messages endpoint, minus the required max_tokens). The model resolves exactly as it does on the Messages endpoint, so every model a message accepts can be counted, and one a message would reject fails the same way (404 for an unknown model, 403 for one the allowlist or an entitlement denies). Claude models are counted exactly by their own backend, in the model\u0026#x27;s region. Every other model, and a dynamic route, gets Opper\u0026#x27;s estimate in the same shape: characters / 4 over the system prompt, messages and tool declarations, plus 1 (within about 20% on English prose), with a flat amount per image and 3,000 tokens per PDF page. The X-Opper-Count-Source response header says which.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://opper.mintlify.app/_mintlify/api/og/v2?division=Anthropic\u0026amp;title=Count+Tokens\u0026amp;description=Anthropic+Messages+token-counting+compatible+endpoint.+Returns+the+number+of+input+tokens+a+Messages+request+would+consume%2C+without+creating+a+message.+Mirrors+\u0026amp;theme=2bfe23844db8025c327f2519\u0026amp;signature=19b883a04e6d0b9a022dfdeccca4526e13282f54ec536375d45b1a92bbb2121e\">\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=\"/mintlify-assets/_mintlify/favicons/opper/QTlMDo19G0sAM5ID/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"Opper\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#14cdcd\">\u003clink data-mint-head rel=\"canonical\" href=\"https://docs.opper.ai/v3-api-reference/compatibility/count-message-tokens\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/v3-api-reference/compatibility/count-message-tokens.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://docs.opper.ai/#organization\",\"name\":\"Opper\",\"url\":\"https://docs.opper.ai\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/opper/EXrQN6z6604ZsBuP/logo/light.svg?fit=max\u0026auto=format\u0026n=EXrQN6z6604ZsBuP\u0026q=85\u0026s=fd4170c482c6cebc3c20d8f7f7e033f8\"}},{\"@type\":\"WebSite\",\"@id\":\"https://docs.opper.ai#website\",\"name\":\"Opper\",\"url\":\"https://docs.opper.ai\",\"publisher\":{\"@id\":\"https://docs.opper.ai/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://docs.opper.ai/v3-api-reference/compatibility/count-message-tokens#webpage\",\"url\":\"https://docs.opper.ai/v3-api-reference/compatibility/count-message-tokens\",\"name\":\"Count Tokens\",\"description\":\"Anthropic Messages token-counting compatible endpoint. Returns the number of input tokens a Messages request would consume, without creating a message. Mirrors Anthropic's POST /v1/messages/count_tokens (same request body as the Messages endpoint, minus the required max_tokens). The model resolves exactly as it does on the Messages endpoint, so every model a message accepts can be counted, and one a message would reject fails the same way (404 for an unknown model, 403 for one the allowlist or an entitlement denies). Claude models are counted exactly by their own backend, in the model's region. Every other model, and a dynamic route, gets Opper's estimate in the same shape: characters / 4 over the system prompt, messages and tool declarations, plus 1 (within about 20% on English prose), with a flat amount per image and 3,000 tokens per PDF page. The X-Opper-Count-Source response header says which.\",\"dateModified\":\"2026-06-08T13:52:28.000Z\",\"isPartOf\":{\"@id\":\"https://docs.opper.ai#website\"},\"breadcrumb\":{\"@id\":\"https://docs.opper.ai/v3-api-reference/compatibility/count-message-tokens#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.opper.ai/v3-api-reference/compatibility/count-message-tokens#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Compatibility\",\"item\":\"https://docs.opper.ai/v3-api-reference/compatibility/chat-completions\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Anthropic\",\"item\":\"https://docs.opper.ai/v3-api-reference/compatibility/create-message\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Count Tokens\",\"item\":\"https://docs.opper.ai/v3-api-reference/compatibility/count-message-tokens\"}]},{\"@type\":[\"TechArticle\",\"APIReference\"],\"@id\":\"https://docs.opper.ai/v3-api-reference/compatibility/count-message-tokens#apireference\",\"headline\":\"Count Tokens\",\"name\":\"Count Tokens\",\"description\":\"Anthropic Messages token-counting compatible endpoint. Returns the number of input tokens a Messages request would consume, without creating a message. Mirrors Anthropic's POST /v1/messages/count_tokens (same request body as the Messages endpoint, minus the required max_tokens). The model resolves exactly as it does on the Messages endpoint, so every model a message accepts can be counted, and one a message would reject fails the same way (404 for an unknown model, 403 for one the allowlist or an entitlement denies). Claude models are counted exactly by their own backend, in the model's region. Every other model, and a dynamic route, gets Opper's estimate in the same shape: characters / 4 over the system prompt, messages and tool declarations, plus 1 (within about 20% on English prose), with a flat amount per image and 3,000 tokens per PDF page. The X-Opper-Count-Source response header says which.\",\"url\":\"https://docs.opper.ai/v3-api-reference/compatibility/count-message-tokens\",\"mainEntityOfPage\":{\"@id\":\"https://docs.opper.ai/v3-api-reference/compatibility/count-message-tokens#webpage\"},\"dateModified\":\"2026-06-08T13:52:28.000Z\",\"publisher\":{\"@id\":\"https://docs.opper.ai/#organization\"},\"isPartOf\":{\"@id\":\"https://docs.opper.ai#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"Opper\",\"creator\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","siteName":"Opper","nav":{"global":null,"tabs":[{"tab":"Documentation","icon":"book-open","pages":[{"title":"Documentation","href":"/overview/about"}]},{"tab":"Cookbook","icon":"github","href":"https://github.com/opper-ai/opper-cookbook"},{"tab":"API Reference","icon":"square-terminal","groups":[{"group":"Compatibility","pages":[{"group":"OpenAI","expanded":true,"pages":[{"title":"Chat Completions","openapi":"post /v3/compat/chat/completions","href":"/v3-api-reference/compatibility/chat-completions"},{"title":"Responses","openapi":"post /v3/compat/responses","href":"/v3-api-reference/compatibility/create-response"},{"title":"Embeddings","openapi":"post /v3/compat/embeddings","href":"/v3-api-reference/compatibility/create-embeddings"},{"title":"Decisions","openapi":"post /v3/compat/decisions","href":"/v3-api-reference/compatibility/create-decision"},{"title":"List Models","openapi":"get /v3/compat/models","href":"/v3-api-reference/compatibility/list-models"}]},{"group":"Anthropic","expanded":true,"pages":[{"title":"Messages","openapi":"post /v3/compat/v1/messages","description":"Anthropic Messages API compatible endpoint. Supports streaming via the stream parameter.","href":"/v3-api-reference/compatibility/create-message"},{"title":"Count Tokens","openapi":"post /v3/compat/v1/messages/count_tokens","href":"/v3-api-reference/compatibility/count-message-tokens"}]},{"group":"Google","expanded":true,"pages":[{"title":"Interactions","openapi":"post /v3/compat/v1beta/interactions","description":"Google Interactions API compatible endpoint. Supports streaming via the stream parameter.","href":"/v3-api-reference/compatibility/create-interaction"},{"title":"Generate Content","openapi":"post /v3/compat/v1beta/models/{model}:generateContent","href":"/v3-api-reference/compatibility/generate-content"},{"title":"Stream Generate Content","openapi":"post /v3/compat/v1beta/models/{model}:streamGenerateContent","href":"/v3-api-reference/compatibility/stream-generate-content"},{"title":"Count Tokens","openapi":"post /v3/compat/v1beta/models/{model}:countTokens","href":"/v3-api-reference/compatibility/count-tokens"}]},{"group":"TypeSafe","expanded":true,"pages":[{"title":"System One evaluation","openapi":"post /v3/compat/v1/systemone","href":"/v3-api-reference/compatibility/systemone"}]},{"group":"Other","expanded":true,"pages":[{"title":"OpenResponses","openapi":"post /v3/compat/openresponses","href":"/v3-api-reference/compatibility/openresponses"}]}]},{"group":"Multimodality","pages":[{"group":"Images","pages":[{"title":"Generate an image","openapi":"post /v3/images","href":"/v3-api-reference/images/create-image"},{"title":"List image models","openapi":"get /v3/images/models","href":"/v3-api-reference/images/list-image-models"}]},{"group":"Audio","pages":[{"title":"Generate speech","openapi":"post /v3/audio/speech","href":"/v3-api-reference/audio/create-speech"},{"title":"Transcribe audio","openapi":"post /v3/audio/transcriptions","href":"/v3-api-reference/audio/create-transcription"},{"title":"Generate audio","openapi":"post /v3/audio/generations","href":"/v3-api-reference/audio/create-audio-generation"},{"title":"List audio models","openapi":"get /v3/audio/models","href":"/v3-api-reference/audio/list-audio-models"},{"title":"Create Voice","openapi":"post /v3/audio/voices","href":"/v3-api-reference/audio/create-voice"},{"title":"List Voices","openapi":"get /v3/audio/voices","href":"/v3-api-reference/audio/list-voices"},{"title":"Get Voice","openapi":"get /v3/audio/voices/{id}","href":"/v3-api-reference/audio/get-voice"},{"title":"Delete Voice","openapi":"delete /v3/audio/voices/{id}","href":"/v3-api-reference/audio/delete-voice"}]},{"group":"Video","pages":[{"title":"Generate a video","openapi":"post /v3/videos","href":"/v3-api-reference/video/create-video"},{"title":"List video models","openapi":"get /v3/videos/models","href":"/v3-api-reference/video/list-video-models"}]},{"group":"Rerank","pages":[{"title":"Rerank documents","openapi":"post /v3/rerank","href":"/v3-api-reference/rerank/rerank-documents"}]},{"group":"OCR","pages":[{"title":"Extract text (OCR)","openapi":"post /v3/ocr","href":"/v3-api-reference/ocr/extract-text"},{"title":"List OCR models","openapi":"get /v3/ocr/models","href":"/v3-api-reference/ocr/list-ocr-models"}]}]},{"group":"Files","pages":[{"title":"Upload a file","openapi":"post /v3/files","href":"/v3-api-reference/files/upload-file"},{"title":"List files","openapi":"get /v3/files","href":"/v3-api-reference/files/list-files"},{"title":"Get file metadata","openapi":"get /v3/files/{id}","href":"/v3-api-reference/files/get-file"},{"title":"Get a file download URL","openapi":"get /v3/files/{id}/content","href":"/v3-api-reference/files/get-file-content"},{"title":"Set or clear a file's expiry","openapi":"patch /v3/files/{id}","href":"/v3-api-reference/files/update-file"},{"title":"Delete a file","openapi":"delete /v3/files/{id}","href":"/v3-api-reference/files/delete-file"}]},{"group":"Realtime","pages":[{"title":"Realtime protocol","href":"/v3-api-reference/realtime/protocol"},{"title":"Mint realtime ticket","href":"/v3-api-reference/realtime/create-realtime-session"}]},{"group":"Roundtable","pages":[{"openapi":"post /v3/roundtable","title":"Roundtable","href":"/v3-api-reference/roundtable/create-roundtable"}]},{"group":"Platform APIs","pages":[{"group":"Generations","pages":[{"openapi":"get /v3/generations","title":"List generations","href":"/v3-api-reference/generations/list-generations"},{"openapi":"get /v3/generations/{id}","title":"Get generation","href":"/v3-api-reference/generations/get-generation"},{"openapi":"delete /v3/generations/{id}","title":"Delete generation","href":"/v3-api-reference/generations/delete-generation"}]},{"group":"Management","pages":[{"openapi":"get /management/v1/projects","title":"List projects","href":"/v3-api-reference/management/list-projects"},{"openapi":"post /management/v1/projects","title":"Create a project","href":"/v3-api-reference/management/create-project"},{"openapi":"get /management/v1/projects/{uuid}","title":"Get a project","href":"/v3-api-reference/management/get-project"},{"openapi":"patch /management/v1/projects/{uuid}","title":"Update a project","href":"/v3-api-reference/management/update-project"},{"openapi":"delete /management/v1/projects/{uuid}","title":"Delete a project","href":"/v3-api-reference/management/delete-project"},{"openapi":"get /management/v1/projects/{uuid}/api-keys","title":"List a project's API keys","href":"/v3-api-reference/management/list-api-keys"},{"openapi":"post /management/v1/projects/{uuid}/api-keys","title":"Mint an API key","href":"/v3-api-reference/management/create-api-key"},{"openapi":"delete /management/v1/projects/{uuid}/api-keys/{id}","title":"Delete an API key","href":"/v3-api-reference/management/delete-api-key"},{"openapi":"get /management/v1/members","title":"List members","href":"/v3-api-reference/management/list-members"},{"openapi":"delete /management/v1/members/{user_uuid}","title":"Remove a member","href":"/v3-api-reference/management/remove-member"},{"openapi":"get /management/v1/invites","title":"List invitations","href":"/v3-api-reference/management/list-invites"},{"openapi":"post /management/v1/invites","title":"Invite a member","href":"/v3-api-reference/management/create-invite"},{"openapi":"delete /management/v1/invites/{id}","title":"Revoke an invitation","href":"/v3-api-reference/management/revoke-invite"},{"openapi":"get /management/v1/dynamic-routes","title":"List dynamic routes","href":"/v3-api-reference/management/list-dynamic-routes"},{"openapi":"post /management/v1/dynamic-routes","title":"Create a dynamic route","href":"/v3-api-reference/management/create-dynamic-route"},{"openapi":"get /management/v1/dynamic-routes/{name}","title":"Get a dynamic route","href":"/v3-api-reference/management/get-dynamic-route"},{"openapi":"put /management/v1/dynamic-routes/{name}/draft","title":"Replace the draft","href":"/v3-api-reference/management/update-dynamic-route-draft"},{"openapi":"post /management/v1/dynamic-routes/{name}/deploy","title":"Deploy the draft","href":"/v3-api-reference/management/deploy-dynamic-route"},{"openapi":"post /management/v1/dynamic-routes/{name}/simulate","title":"Simulate a request through the route","href":"/v3-api-reference/management/simulate-dynamic-route"},{"openapi":"get /management/v1/dynamic-routes/{name}/versions","title":"List a route's versions","href":"/v3-api-reference/management/list-dynamic-route-versions"},{"openapi":"get /management/v1/dynamic-routes/{name}/versions/{version_number}","title":"Get a version","href":"/v3-api-reference/management/get-dynamic-route-version"},{"openapi":"post /management/v1/dynamic-routes/{name}/versions/{version_number}/rollback","title":"Roll back to a version","href":"/v3-api-reference/management/rollback-dynamic-route"},{"openapi":"post /management/v1/dynamic-routes/{name}/versions/{version_number}/restore-to-draft","title":"Copy a version into the draft","href":"/v3-api-reference/management/restore-dynamic-route-version-to-draft"},{"openapi":"delete /management/v1/dynamic-routes/{name}","title":"Delete a dynamic route","href":"/v3-api-reference/management/delete-dynamic-route"},{"openapi":"get /management/v1/controls/rules","title":"List control rules","href":"/v3-api-reference/management/list-control-rules"},{"openapi":"post /management/v1/controls/rules","title":"Create a control rule","href":"/v3-api-reference/management/create-control-rule"},{"openapi":"patch /management/v1/controls/rules/{uuid}","title":"Update a control rule","href":"/v3-api-reference/management/update-control-rule"},{"openapi":"delete /management/v1/controls/rules/{uuid}","title":"Delete a control rule","href":"/v3-api-reference/management/delete-control-rule"},{"openapi":"get /management/v1/usage","title":"Get usage and cost","href":"/v3-api-reference/management/get-usage"},{"openapi":"post /management/v1/management-keys/_self/disable","title":"Disable the calling management key","href":"/v3-api-reference/management/disable-management-key"}]},{"group":"Models","pages":[{"openapi":"get /v3/models","title":"List models","href":"/v3-api-reference/models/list-models"}]},{"group":"Spans","pages":[{"openapi":"post /v3/spans","title":"Create span","href":"/v3-api-reference/spans/create-span"},{"openapi":"patch /v3/spans/{id}","title":"Update span","href":"/v3-api-reference/spans/update-span"}]},{"group":"Tools","pages":[{"openapi":"post /v3/tools/web/fetch","title":"Web fetch","href":"/v3-api-reference/tools/web-fetch"},{"openapi":"post /v3/tools/web/search","title":"Web search","href":"/v3-api-reference/tools/web-search"}]},{"group":"System","pages":[{"openapi":"get /health","title":"Health check","href":"/v3-api-reference/system/health-check"},{"openapi":"get /v3/openapi.json","title":"OpenAPI spec (JSON)","href":"/v3-api-reference/system/openapi-spec-json"},{"openapi":"get /v3/openapi.yaml","title":"OpenAPI spec (YAML)","href":"/v3-api-reference/system/openapi-spec-yaml"}]}]}]}]},"title":"Count Tokens - Opper","buildId":"dpl_2xiSHD9XEvLsPGPcfoMtkLTB3dy9","deploymentId":"dpl_2xiSHD9XEvLsPGPcfoMtkLTB3dy9","dynamics":["c2aa737661","2b790eda92","b0f84f53ff","a9bb46feb3"],"chunks":["OpenApiReferenceProvider-DmVyH30O.js","utils-BHQqGGOd.js","cloneDeep-izs3Hzxb.js","_Uint8Array-BVIqJ90l.js","isObjectLike-C8vmzPEN.js","isArray-Dcu1dQ5t.js","utils-CD-E4BIt.js","toString-BX-iyh8G.js","isSymbol-CSH9U2Gm.js","addUniqueKeysToSchema-Bp5Lq9Ds.js","snippetPresets-C4xAVCFP.js","style-to-object-BY3JEAdk.js","v4-DIgz8zy6.js","ApiExamples-CgXVLxUC.js","isEqual-BfaiBbcl.js","usePlaygroundInputsStore-BF8I5oUf.js","shallow-Byd0lWnC.js","getApiPlaygroundDisplay-BGOZG1OK.js","CodeSnippet-CpvQL0CY.js","CodeSnippets-B8wkBKXa.js","Page-CBCH2P7b.js","getPastedJson-Ry3scI3Y.js","icon-D7a9HcdD.js","MethodPill-CJ8pmHhz.js","DuplicateIcon-rh1HJF0t.js","createIcon-DvGznqYs.js","DynamicMarkdown-Cc6AuSHS.js","SectionHeading-B4A0S-ep.js","axios-vUo_bRtp.js","Markdown-Cc16CX65.js","clsx-Cs6nMGht.js","lib-DuNMoZ05.js","lib-B8HbPgcC.js","html-void-elements-mCSPHezU.js","dist-zbf22OZA.js","katex-YMM-FMeD.js","marked.esm-CZWythHk.js","AssistantPageLink-C_fs-y5n.js"]}