If you already use the official Anthropic SDK, or want native Claude capabilities such as system prompts, Tool Use, and Prompt Caching, call /v1/messages directly. It follows the official Anthropic protocol.
Anthropic Messages and all other public APIs use api-direct.dimilinks.com. The complete request URL is https://api-direct.dimilinks.com/v1/messages, and all protocols share the same Bearer key.
POST https://api-direct.dimilinks.com/v1/messagesContent-Type: application/jsonAuthorization: Bearer <DIMILINKS_API_KEY>anthropic-version: 2023-06-01
We recommend including the anthropic-version header explicitly to match Anthropic’s official documentation. Requests without it are also supported and use the server’s default version.
Add "stream": true. The server then returns native Anthropic events in this order: message_start / content_block_start / content_block_delta / content_block_stop / message_delta / message_stop.
curl "https://api-direct.dimilinks.com/v1/messages" \ -H "Authorization: Bearer $DIMILINKS_API_KEY" \ -H "anthropic-version: 2023-06-01" \ -H "Content-Type: application/json" \ -d '{ "model": "claude-sonnet-5", "max_tokens": 1024, "tools": [ { "name": "get_weather", "description": "Retrieve the current weather for a city", "input_schema": { "type": "object", "properties": { "city": {"type": "string"} }, "required": ["city"] } } ], "messages": [ {"role": "user", "content": "Check the current weather in Tokyo."} ] }'
If the model response contains content[].type === "tool_use", execute the tool, then continue the conversation with a tool_result content block in a role=user message.
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"DimiLinks API","colors":{"primary":"#10B981","light":"#34D399","dark":"#059669"},"logo":{"light":"https://mintcdn.com/dimilinks/Q9_PMAWcY1CQAY-u/logo/light.svg?fit=max\u0026auto=format\u0026n=Q9_PMAWcY1CQAY-u\u0026q=85\u0026s=fbfe5d159491af77f71b53dce63cecf9","dark":"https://mintcdn.com/dimilinks/Q9_PMAWcY1CQAY-u/logo/dark.svg?fit=max\u0026auto=format\u0026n=Q9_PMAWcY1CQAY-u\u0026q=85\u0026s=a181b25b848e37947025fa06d9f39099"},"favicon":"https://mintcdn.com/dimilinks/Q9_PMAWcY1CQAY-u/favicon.svg?fit=max\u0026auto=format\u0026n=Q9_PMAWcY1CQAY-u\u0026q=85\u0026s=595c2321ffdaf0e642c42c27e31617e9","footer":{"socials":{}},"contextual":{"options":["copy","view","chatgpt","claude","perplexity","mcp","cursor","vscode"],"display":"header"},"styling":{"latex":false},"navigation":{"languages":[{"language":"cn","navbar":{"links":[{"href":"https://dimilinks.com","label":"主页"},{"href":"https://dimilinks.com/pricing","label":"价格"}],"primary":{"type":"button","label":"打开控制台","href":"https://dimilinks.com/console"}},"href":""},{"language":"en","navbar":{"links":[{"href":"https://dimilinks.com/en","label":"Home"},{"href":"https://dimilinks.com/en/pricing","label":"Pricing"}],"primary":{"type":"button","label":"Open console","href":"https://dimilinks.com/console"}},"href":"en"},{"language":"jp","navbar":{"links":[{"href":"https://dimilinks.com/ja","label":"ホーム"},{"href":"https://dimilinks.com/ja/pricing","label":"料金"}],"primary":{"type":"button","label":"コンソールを開く","href":"https://dimilinks.com/console"}},"href":"jp"}]}},"deployment":{"deploymentMetadataValue":{"subdomain":"dimilinks","hasAudioNarration":false,"actualSubdomain":"dimilinks","customDomains":["docs.dimilinks.com"],"gitSource":{"type":"github","owner":"abca12a","repo":"docs","deployBranch":"main","contentDirectory":"","isPrivate":false,"mountPath":"","label":""},"chroma":{"liveDeploymentHistoryId":"6aa254c6e16a9b5f298b986a","collectionId":"ac2abd7e-4a33-4e29-b658-899dec1f3101","schemaVersion":"v3","latestBuiltDeploymentHistoryId":"6aa254c6e16a9b5f298b986a"},"entitlements":{"AI_CHAT":{"status":"DISABLED"}},"buildId":"6aa25627c7207f700ce730eb","clientVersion":"0.0.4021","searchFilterCounts":[{"language":"cn","tag":"API Reference","count":24},{"language":"en","tag":"API Reference","count":24},{"language":"jp","tag":"API リファレンス","count":18},{"language":"cn","tag":"基础","count":6},{"language":"en","tag":"Basics","count":6},{"language":"jp","tag":"基本","count":6},{"language":"cn","tag":"图片 / gpt-image-2","count":4},{"language":"cn","tag":"IDE 与 CLI 接入","count":4},{"language":"cn","tag":"视频 / 统一视频 API","count":4},{"language":"en","tag":"Images / gpt-image-2","count":4},{"language":"en","tag":"IDE and CLI integrations","count":4},{"language":"en","tag":"Videos / unified video API","count":4},{"language":"jp","tag":"画像 / gpt-image-2","count":4},{"language":"jp","tag":"IDE / CLI 連携","count":4},{"language":"cn","tag":"对话 / Chat","count":2},{"language":"cn","tag":"图片 / 更多模型","count":2},{"language":"cn","tag":"视频 / grok-imagine-video","count":2},{"language":"cn","tag":"指南","count":2},{"language":"cn","tag":"开始使用","count":2},{"language":"en","tag":"Chat","count":2},{"language":"en","tag":"Images / more models","count":2},{"language":"en","tag":"Video / grok-imagine-video","count":2},{"language":"en","tag":"Guides","count":2},{"language":"en","tag":"Get started","count":2},{"language":"jp","tag":"チャット","count":2},{"language":"jp","tag":"動画 / grok-imagine-video","count":2},{"language":"jp","tag":"ガイド","count":2},{"language":"jp","tag":"はじめに","count":2}]},"assistantConfig":{"enableAskAiButton":false,"enableStarterQuestions":false,"enableContextualStarterQuestions":false,"enableAskAiSearchBar":true},"basePath":"","hasChatPermissions":false,"hasWebMcpPermissions":false,"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":"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":"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":[],"page":{"pagePath":"en/api-reference/chat/anthropic-messages","slug":"/en/api-reference/chat/anthropic-messages","pageMetadata":{"title":"Anthropic Messages","description":"Call the full Claude model family through the native Anthropic protocol.","openapi":"POST /messages","icon":"brain","href":"/en/api-reference/chat/anthropic-messages"},"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: \"Call the full Claude model family through the native Anthropic protocol.\"\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={code:`code`,p:`p`,pre:`pre`,span:`span`,tbody:`tbody`,td:`td`,th:`th`,thead:`thead`,tr:`tr`,..._provideComponents(),...props.components},{CodeBlock,Heading,Note,Table}=_components;if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!Note)_missingMdxReference(`Note`,true);if(!Table)_missingMdxReference(`Table`,true);return _jsxs(_Fragment,{children:[_jsxs(_components.p,{children:[`If you already use the official Anthropic SDK, or want native Claude capabilities such as system prompts, Tool Use, and Prompt Caching, call `,_jsx(_components.code,{children:`/v1/messages`}),` directly. It follows the official Anthropic protocol.`]}),`\n`,_jsx(Note,{children:_jsxs(_components.p,{children:[`Anthropic Messages and all other public APIs use `,_jsx(_components.code,{children:`api-direct.dimilinks.com`}),`. The complete request URL is `,_jsx(_components.code,{children:`https://api-direct.dimilinks.com/v1/messages`}),`, and all protocols share the same Bearer key.`]})}),`\n`,_jsx(Heading,{level:`2`,id:`request-url`,children:`Request URL`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`4`,language:`http`,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:`http`,children:_jsxs(_components.code,{language:`http`,numberOfLines:`4`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`POST`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` https://api-direct.dimilinks.com/v1/messages`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:`Content-Type`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` application/json`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:`Authorization`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` Bearer \u003cDIMILINKS_API_KEY>`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:`anthropic-version`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 2023-06-01`})]}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[`We recommend including the `,_jsx(_components.code,{children:`anthropic-version`}),` header explicitly to match Anthropic’s official documentation. Requests without it are also supported and use the server’s default version.`]}),`\n`,_jsx(Heading,{level:`2`,id:`basic-example`,children:`Basic example`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`12`,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:`12`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`curl`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"https://api-direct.dimilinks.com/v1/messages\"`}),_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:`$DIMILINKS_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:` \"anthropic-version: 2023-06-01\"`}),_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:` '{`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"model\": \"claude-sonnet-5\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"max_tokens\": 1024,`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"system\": \"You are a concise assistant.\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"messages\": [`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` {\"role\": \"user\", \"content\": \"Explain Pluto in one sentence.\"}`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` ]`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` }'`})}),`\n`]})})}),`\n`,_jsx(_components.p,{children:`Response (abridged):`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`14`,language:`json`,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:`json`,children:_jsxs(_components.code,{language:`json`,numberOfLines:`14`,children:[_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:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"id\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"msg_xxx\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"type\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"message\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"role\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"assistant\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"model\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"claude-sonnet-5\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"content\"`}),_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:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:`\"type\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"text\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:`\"text\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"Pluto is a dwarf planet at the outer edge of the Solar System.\"`}),_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:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"stop_reason\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"end_turn\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"usage\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"input_tokens\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`32`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"output_tokens\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`24`})]}),`\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`]})})}),`\n`,_jsx(Heading,{level:`2`,id:`streaming`,children:`Streaming`}),`\n`,_jsxs(_components.p,{children:[`Add `,_jsx(_components.code,{children:`\"stream\": true`}),`. The server then returns native Anthropic events in this order: `,_jsx(_components.code,{children:`message_start`}),` / `,_jsx(_components.code,{children:`content_block_start`}),` / `,_jsx(_components.code,{children:`content_block_delta`}),` / `,_jsx(_components.code,{children:`content_block_stop`}),` / `,_jsx(_components.code,{children:`message_delta`}),` / `,_jsx(_components.code,{children:`message_stop`}),`.`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`13`,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:`13`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`curl`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"https://api-direct.dimilinks.com/v1/messages\"`}),_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:`$DIMILINKS_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:` \"anthropic-version: 2023-06-01\"`}),_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:` -N`}),_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:` '{`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"model\": \"claude-opus-4-8\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"max_tokens\": 1024,`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"stream\": true,`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"messages\": [`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` {\"role\": \"user\", \"content\": \"Write a four-line poem about a rainy night.\"}`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` ]`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` }'`})}),`\n`]})})}),`\n`,_jsx(Heading,{level:`2`,id:`parameters`,children:`Parameters`}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Parameter`}),_jsx(_components.th,{children:`Type`}),_jsx(_components.th,{children:`Required`}),_jsx(_components.th,{children:`Description`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`model`})}),_jsx(_components.td,{children:`string`}),_jsx(_components.td,{children:`Yes`}),_jsxs(_components.td,{children:[`Claude model ID, such as `,_jsx(_components.code,{children:`claude-opus-4-8`}),`, `,_jsx(_components.code,{children:`claude-sonnet-5`}),`, or `,_jsx(_components.code,{children:`claude-haiku-4-5`}),`.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`max_tokens`})}),_jsx(_components.td,{children:`integer`}),_jsx(_components.td,{children:`Yes`}),_jsx(_components.td,{children:`Maximum output tokens for one response.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`messages`})}),_jsx(_components.td,{children:`array`}),_jsx(_components.td,{children:`Yes`}),_jsxs(_components.td,{children:[`Message array. `,_jsx(_components.code,{children:`role`}),` supports `,_jsx(_components.code,{children:`user`}),` / `,_jsx(_components.code,{children:`assistant`}),`; `,_jsx(_components.code,{children:`content`}),` supports a string or `,_jsx(_components.code,{children:`[{type:\"text\",...}]`}),` content blocks.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`system`})}),_jsx(_components.td,{children:`string | array`}),_jsx(_components.td,{children:`No`}),_jsxs(_components.td,{children:[`System prompt, either a string or an array such as `,_jsx(_components.code,{children:`[{type:\"text\",...}]`}),`.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`temperature`})}),_jsx(_components.td,{children:`number`}),_jsx(_components.td,{children:`No`}),_jsx(_components.td,{children:`Sampling temperature from 0 to 1.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`top_p`})}),_jsx(_components.td,{children:`number`}),_jsx(_components.td,{children:`No`}),_jsx(_components.td,{children:`Nucleus sampling probability from 0 to 1.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`top_k`})}),_jsx(_components.td,{children:`integer`}),_jsx(_components.td,{children:`No`}),_jsx(_components.td,{children:`Top-k sampling.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`stop_sequences`})}),_jsx(_components.td,{children:`string[]`}),_jsx(_components.td,{children:`No`}),_jsx(_components.td,{children:`Stop generation when one of these sequences is matched.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`stream`})}),_jsx(_components.td,{children:`boolean`}),_jsx(_components.td,{children:`No`}),_jsxs(_components.td,{children:[`When `,_jsx(_components.code,{children:`true`}),`, returns SSE streaming events.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`tools`})}),_jsx(_components.td,{children:`array`}),_jsx(_components.td,{children:`No`}),_jsx(_components.td,{children:`Native Anthropic Tool Use definitions.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`tool_choice`})}),_jsx(_components.td,{children:`object`}),_jsx(_components.td,{children:`No`}),_jsx(_components.td,{children:`Controls whether a specific tool must be used.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`metadata`})}),_jsx(_components.td,{children:`object`}),_jsx(_components.td,{children:`No`}),_jsx(_components.td,{children:`Metadata such as an end-user identifier.`})]})]})]}),`\n`,_jsx(Heading,{level:`2`,id:`call-with-the-anthropic-sdk`,children:`Call with the Anthropic SDK`}),`\n`,_jsx(_components.p,{children:`Python:`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`14`,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:`14`,children:[_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:` anthropic `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` Anthropic`})]}),`\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:` Anthropic(`})]}),`\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:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"sk-...\"`}),_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-direct.dimilinks.com/\"`}),_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:`message `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` client.messages.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:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"claude-sonnet-5\"`}),_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:` max_tokens`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`1024`}),_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:` 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`,_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:`#0550AE`,\"--shiki-dark\":`#DCDCAA`},children:`print`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(message.content[`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`0`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`].text)`})]}),`\n`]})})}),`\n`,_jsx(_components.p,{children:`Node.js:`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`12`,language:`typescript`,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:`typescript`,children:_jsxs(_components.code,{language:`typescript`,numberOfLines:`12`,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\":`#9CDCFE`},children:` Anthropic`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` from`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` '@anthropic-ai/sdk'`})]}),`\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:` 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:` Anthropic`}),_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\":`#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:`DIMILINKS_API_KEY`}),_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-direct.dimilinks.com/'`}),_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:`const`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` message`}),_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:`messages`}),_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\":`#9CDCFE`},children:` model:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'claude-opus-4-8'`}),_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:` max_tokens:`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:` 1024`}),_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:` 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`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`})`})}),`\n`]})})}),`\n`,_jsx(Note,{children:_jsxs(_components.p,{children:[`Set the Anthropic SDK `,_jsx(_components.code,{children:`base_url`}),` to `,_jsx(_components.code,{children:`https://api-direct.dimilinks.com/`}),`. The SDK appends `,_jsx(_components.code,{children:`/v1/messages`}),` automatically.`]})}),`\n`,_jsx(Heading,{level:`2`,id:`tool-use`,children:`Tool Use`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`22`,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:`22`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`curl`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"https://api-direct.dimilinks.com/v1/messages\"`}),_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:`$DIMILINKS_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:` \"anthropic-version: 2023-06-01\"`}),_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:` '{`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"model\": \"claude-sonnet-5\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"max_tokens\": 1024,`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"tools\": [`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` {`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"name\": \"get_weather\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"description\": \"Retrieve the current weather for a city\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"input_schema\": {`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"type\": \"object\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"properties\": { \"city\": {\"type\": \"string\"} },`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"required\": [\"city\"]`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` ],`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"messages\": [`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` {\"role\": \"user\", \"content\": \"Check the current weather in Tokyo.\"}`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` ]`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` }'`})}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[`If the model response contains `,_jsx(_components.code,{children:`content[].type === \"tool_use\"`}),`, execute the tool, then continue the conversation with a `,_jsx(_components.code,{children:`tool_result`}),` content block in a `,_jsx(_components.code,{children:`role=user`}),` message.`]})]})}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":"Anthropic Messages","description":"Call the full Claude model family through the native Anthropic protocol.","openapi":"POST /messages","icon":"brain","href":"/en/api-reference/chat/anthropic-messages"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"Request URL","slug":"request-url","depth":2,"children":[]},{"title":"Basic example","slug":"basic-example","depth":2,"children":[]},{"title":"Streaming","slug":"streaming","depth":2,"children":[]},{"title":"Parameters","slug":"parameters","depth":2,"children":[]},{"title":"Call with the Anthropic SDK","slug":"call-with-the-anthropic-sdk","depth":2,"children":[]},{"title":"Tool Use","slug":"tool-use","depth":2,"children":[]}],"codeExamples":{}},"jsLinks":[],"openApiReferenceData":{"operation":{"tags":["Chat"],"summary":"Create Anthropic message","description":"Call the full Claude model family through the native Anthropic protocol.","operationId":"createAnthropicMessage","servers":["6af988e0-20e5-41ed-8c1f-96fcea59f3d0"],"parameters":["62695715-917f-4ef8-9298-137899ac38d3"],"requestBody":"117e3605-dc88-4c42-bc52-6ac44e1d2ded","responses":{"200":"3bf03633-a16c-4640-a7f6-420236117edc","400":"76322318-ddfa-441d-98a2-bd3f09db4f20","401":"ec72f81f-0317-4eb9-a6f8-8ab5ffdb5808","403":"ba9c7a44-7a11-41b4-b7b7-8e71223e8b62","429":"6c0fe431-76b9-4a97-a53e-7e74382ff15d"},"method":"post","type":"path","security":["1aeffa9f-8a31-4ae9-9508-6c88da44205c"],"path":"/messages","baseUrlOptions":["https://api-direct.dimilinks.com"],"title":"Create Anthropic message","codeSamples":[],"requiredOnlyExamples":false,"requestExampleType":"generated","responseExampleType":"generated"},"dependencies":{"parameters":{"62695715-917f-4ef8-9298-137899ac38d3":{"name":"anthropic-version","in":"header","required":false,"description":"Anthropic API version, e.g. 2023-06-01.","schema":{"type":"string","example":"2023-06-01","isRequired":false,"description":"Anthropic API version, e.g. 2023-06-01.","uniqueKey":"","typeLabel":"string"}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"model":{"type":"string","example":"claude-sonnet-5","isRequired":true,"uniqueKey":"model","typeLabel":"string"},"max_tokens":{"type":"integer","example":1024,"isRequired":true,"uniqueKey":"max_tokens","typeLabel":"integer"},"messages":{"type":"array","items":{"type":"object","properties":{"role":{"type":"string","enum":["user","assistant"],"isRequired":true,"uniqueKey":"messages.items.[INDEX].role","typeLabel":"enum\u003cstring>"},"content":{"oneOf":[{"type":"string","isRequired":true,"uniqueKey":"messages.items.[INDEX].content.oneOf.0","typeLabel":"string"},{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","example":"text","uniqueKey":"messages.items.[INDEX].content.oneOf.1.items.[INDEX].type","typeLabel":"string"},"text":{"type":"string","uniqueKey":"messages.items.[INDEX].content.oneOf.1.items.[INDEX].text","typeLabel":"string"}},"additionalProperties":true,"uniqueKey":"messages.items.[INDEX].content.oneOf.1.items.[INDEX]","typeLabel":"object"},"isRequired":true,"uniqueKey":"messages.items.[INDEX].content.oneOf.1","typeLabel":"object[]"}],"isRequired":true,"uniqueKey":"messages.items.[INDEX].content","typeLabel":"string | object[]"}},"required":["role","content"],"uniqueKey":"messages.items.[INDEX]","typeLabel":"object"},"isRequired":true,"uniqueKey":"messages","typeLabel":"object[]"},"system":{"oneOf":[{"type":"string","uniqueKey":"system.oneOf.0","typeLabel":"string"},{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","example":"text","uniqueKey":"system.oneOf.1.items.[INDEX].type","typeLabel":"string"},"text":{"type":"string","uniqueKey":"system.oneOf.1.items.[INDEX].text","typeLabel":"string"}},"additionalProperties":true,"uniqueKey":"system.oneOf.1.items.[INDEX]","typeLabel":"object"},"uniqueKey":"system.oneOf.1","typeLabel":"object[]"}],"uniqueKey":"system","typeLabel":"string | object[]"},"temperature":{"type":"number","uniqueKey":"temperature","typeLabel":"number"},"top_p":{"type":"number","uniqueKey":"top_p","typeLabel":"number"},"top_k":{"type":"integer","uniqueKey":"top_k","typeLabel":"integer"},"stop_sequences":{"type":"array","items":{"type":"string","uniqueKey":"stop_sequences.items.[INDEX]","typeLabel":"string"},"uniqueKey":"stop_sequences","typeLabel":"string[]"},"stream":{"type":"boolean","default":false,"uniqueKey":"stream","typeLabel":"boolean"},"tools":{"type":"array","items":{"type":"object","additionalProperties":true,"uniqueKey":"tools.items.[INDEX]","typeLabel":"object"},"uniqueKey":"tools","typeLabel":"object[]"},"tool_choice":{"type":"object","additionalProperties":true,"uniqueKey":"tool_choice","typeLabel":"object"},"metadata":{"type":"object","additionalProperties":true,"uniqueKey":"metadata","typeLabel":"object"},"thinking":{"type":"object","additionalProperties":true,"uniqueKey":"thinking","typeLabel":"object"}},"required":["model","max_tokens","messages"],"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"model":"claude-sonnet-5","max_tokens":1024,"messages":[{"content":"\u003cstring>"}],"system":"\u003cstring>","temperature":123,"top_p":123,"top_k":123,"stop_sequences":["\u003cstring>"],"stream":false,"tools":[{}],"tool_choice":{},"metadata":{},"thinking":{}}}},"exampleType":"generated"}},"exampleType":"generated"},"responses":{"3bf03633-a16c-4640-a7f6-420236117edc":{"description":"Anthropic message response. When `stream` is true the response is text/event-stream with Anthropic native events.","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","example":"msg_xxx","uniqueKey":"id","typeLabel":"string"},"type":{"type":"string","example":"message","uniqueKey":"type","typeLabel":"string"},"role":{"type":"string","example":"assistant","uniqueKey":"role","typeLabel":"string"},"model":{"type":"string","example":"claude-sonnet-5","uniqueKey":"model","typeLabel":"string"},"content":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","example":"text","uniqueKey":"content.items.[INDEX].type","typeLabel":"string"},"text":{"type":"string","uniqueKey":"content.items.[INDEX].text","typeLabel":"string"}},"additionalProperties":true,"uniqueKey":"content.items.[INDEX]","typeLabel":"object"},"uniqueKey":"content","typeLabel":"object[]"},"stop_reason":{"type":"string","uniqueKey":"stop_reason","typeLabel":"string"},"stop_sequence":{"type":"string","uniqueKey":"stop_sequence","typeLabel":"string"},"usage":{"type":"object","properties":{"input_tokens":{"type":"integer","uniqueKey":"usage.input_tokens","typeLabel":"integer"},"output_tokens":{"type":"integer","uniqueKey":"usage.output_tokens","typeLabel":"integer"}},"uniqueKey":"usage","typeLabel":"object"}},"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"id":"msg_xxx","type":"message","role":"assistant","model":"claude-sonnet-5","content":[{"type":"text","text":"\u003cstring>"}],"stop_reason":"\u003cstring>","stop_sequence":"\u003cstring>","usage":{"input_tokens":123,"output_tokens":123}}}},"exampleType":"generated"},"text/event-stream":{"schema":{"type":"string","uniqueKey":"","typeLabel":"string"},"examples":{"Example":{"title":"Example","value":"\u003cstring>"}},"exampleType":"generated"}},"exampleType":"generated"},"76322318-ddfa-441d-98a2-bd3f09db4f20":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string","uniqueKey":"error.message","typeLabel":"string"},"type":{"type":"string","example":"invalid_request_error","uniqueKey":"error.type","typeLabel":"string"},"code":{"oneOf":[{"type":"string","uniqueKey":"error.code.oneOf.0","typeLabel":"string"},{"type":"integer","uniqueKey":"error.code.oneOf.1","typeLabel":"integer"}],"uniqueKey":"error.code","typeLabel":"string | integer"}},"uniqueKey":"error","typeLabel":"object"}},"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"error":{"message":"\u003cstring>","type":"invalid_request_error","code":"\u003cstring>"}}}},"exampleType":"generated"}},"exampleType":"generated"},"ec72f81f-0317-4eb9-a6f8-8ab5ffdb5808":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string","uniqueKey":"error.message","typeLabel":"string"},"type":{"type":"string","example":"invalid_request_error","uniqueKey":"error.type","typeLabel":"string"},"code":{"oneOf":[{"type":"string","uniqueKey":"error.code.oneOf.0","typeLabel":"string"},{"type":"integer","uniqueKey":"error.code.oneOf.1","typeLabel":"integer"}],"uniqueKey":"error.code","typeLabel":"string | integer"}},"uniqueKey":"error","typeLabel":"object"}},"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"error":{"message":"\u003cstring>","type":"invalid_request_error","code":"\u003cstring>"}}}},"exampleType":"generated"}},"exampleType":"generated"},"ba9c7a44-7a11-41b4-b7b7-8e71223e8b62":{"description":"Model is not allowed for this API key","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string","uniqueKey":"error.message","typeLabel":"string"},"type":{"type":"string","example":"invalid_request_error","uniqueKey":"error.type","typeLabel":"string"},"code":{"oneOf":[{"type":"string","uniqueKey":"error.code.oneOf.0","typeLabel":"string"},{"type":"integer","uniqueKey":"error.code.oneOf.1","typeLabel":"integer"}],"uniqueKey":"error.code","typeLabel":"string | integer"}},"uniqueKey":"error","typeLabel":"object"}},"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"error":{"message":"\u003cstring>","type":"invalid_request_error","code":"\u003cstring>"}}}},"exampleType":"generated"}},"exampleType":"generated"},"6c0fe431-76b9-4a97-a53e-7e74382ff15d":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string","uniqueKey":"error.message","typeLabel":"string"},"type":{"type":"string","example":"invalid_request_error","uniqueKey":"error.type","typeLabel":"string"},"code":{"oneOf":[{"type":"string","uniqueKey":"error.code.oneOf.0","typeLabel":"string"},{"type":"integer","uniqueKey":"error.code.oneOf.1","typeLabel":"integer"}],"uniqueKey":"error.code","typeLabel":"string | integer"}},"uniqueKey":"error","typeLabel":"object"}},"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"error":{"message":"\u003cstring>","type":"invalid_request_error","code":"\u003cstring>"}}}},"exampleType":"generated"}},"exampleType":"generated"}},"security":{"1aeffa9f-8a31-4ae9-9508-6c88da44205c":{"bearerAuth":{"type":"http","scheme":"bearer","scopes":[]}}},"servers":{"6af988e0-20e5-41ed-8c1f-96fcea59f3d0":{"url":"https://api-direct.dimilinks.com","description":"Anthropic 原生入口"}},"processedSecurityOptions":[{"schemes":[{"scheme":{"type":"http","scheme":"bearer","scopes":[]},"schema":{"title":"Bearer Auth","type":"string","isRequired":true,"description":"Bearer authentication header of the form `Bearer \u003ctoken>`, where `\u003ctoken>` is your auth token.","format":"bearer","typeLabel":"string\u003cbearer>","deprecated":false},"schemeName":"bearerAuth","name":"Authorization"}],"title":"bearerAuth"}]},"originalFileLocation":"api-reference/openapi.json"},"subdomain":"dimilinks","siteName":"DimiLinks API","title":"Anthropic Messages - DimiLinks API","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{"cn":{"href":"/api-reference/chat/anthropic-messages","matchLevel":1},"en":{"href":"/en/api-reference/chat/anthropic-messages","matchLevel":0},"jp":{"href":"/jp/api-reference/chat/anthropic-messages","matchLevel":1}}},"lastModified":"2026-08-21T03:33:17.056Z","originalFileLocation":"en/api-reference/chat/anthropic-messages.mdx","locale":"en"},"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=\"Call the full Claude model family through the native Anthropic protocol.\">\u003cmeta data-mint-head name=\"application-name\" content=\"DimiLinks API\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/dimilinks/K08tUZ6IquZnl6l7/_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/dimilinks/K08tUZ6IquZnl6l7/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/dimilinks/K08tUZ6IquZnl6l7/_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/dimilinks/K08tUZ6IquZnl6l7/_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/dimilinks/K08tUZ6IquZnl6l7/_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/dimilinks/K08tUZ6IquZnl6l7/_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/dimilinks/K08tUZ6IquZnl6l7/_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/dimilinks/K08tUZ6IquZnl6l7/_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/dimilinks/K08tUZ6IquZnl6l7/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Anthropic Messages - DimiLinks API\">\u003cmeta data-mint-head property=\"og:description\" content=\"Call the full Claude model family through the native Anthropic protocol.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"DimiLinks API\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.dimilinks.com/en/api-reference/chat/anthropic-messages\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://dimilinks.mintlify.app/_mintlify/api/og/v2?division=Chat\u0026amp;title=Anthropic+Messages\u0026amp;description=Call+the+full+Claude+model+family+through+the+native+Anthropic+protocol.\u0026amp;theme=b7e2bb269bbc94669c8f53d3\u0026amp;signature=007427a2d0a25b71b1957ba2eb4b22bee9f65baacf561c9ee85eddad41101954\">\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=\"Anthropic Messages - DimiLinks API\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Call the full Claude model family through the native Anthropic protocol.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://dimilinks.mintlify.app/_mintlify/api/og/v2?division=Chat\u0026amp;title=Anthropic+Messages\u0026amp;description=Call+the+full+Claude+model+family+through+the+native+Anthropic+protocol.\u0026amp;theme=b7e2bb269bbc94669c8f53d3\u0026amp;signature=007427a2d0a25b71b1957ba2eb4b22bee9f65baacf561c9ee85eddad41101954\">\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/dimilinks/K08tUZ6IquZnl6l7/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"DimiLinks API\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#10B981\">\u003clink data-mint-head rel=\"canonical\" href=\"https://docs.dimilinks.com/en/api-reference/chat/anthropic-messages\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/en/api-reference/chat/anthropic-messages.md\">\u003clink data-mint-head rel=\"alternate\" hreflang=\"en\" href=\"https://docs.dimilinks.com/en/api-reference/chat/anthropic-messages\">\u003clink data-mint-head rel=\"alternate\" hreflang=\"zh\" href=\"https://docs.dimilinks.com/api-reference/chat/anthropic-messages\">\u003clink data-mint-head rel=\"alternate\" hreflang=\"ja\" href=\"https://docs.dimilinks.com/jp/api-reference/chat/anthropic-messages\">\u003clink data-mint-head rel=\"alternate\" hreflang=\"x-default\" href=\"https://docs.dimilinks.com/api-reference/chat/anthropic-messages\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://docs.dimilinks.com/#organization\",\"name\":\"DimiLinks API\",\"url\":\"https://docs.dimilinks.com\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/dimilinks/Q9_PMAWcY1CQAY-u/logo/light.svg?fit=max\u0026auto=format\u0026n=Q9_PMAWcY1CQAY-u\u0026q=85\u0026s=fbfe5d159491af77f71b53dce63cecf9\"}},{\"@type\":\"WebSite\",\"@id\":\"https://docs.dimilinks.com#website\",\"name\":\"DimiLinks API\",\"url\":\"https://docs.dimilinks.com\",\"publisher\":{\"@id\":\"https://docs.dimilinks.com/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://docs.dimilinks.com/en/api-reference/chat/anthropic-messages#webpage\",\"url\":\"https://docs.dimilinks.com/en/api-reference/chat/anthropic-messages\",\"name\":\"Anthropic Messages\",\"description\":\"Call the full Claude model family through the native Anthropic protocol.\",\"dateModified\":\"2026-08-21T03:33:17.056Z\",\"isPartOf\":{\"@id\":\"https://docs.dimilinks.com#website\"},\"breadcrumb\":{\"@id\":\"https://docs.dimilinks.com/en/api-reference/chat/anthropic-messages#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.dimilinks.com/en/api-reference/chat/anthropic-messages#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Chat\",\"item\":\"https://docs.dimilinks.com/en/api-reference/chat/completions\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Anthropic Messages\",\"item\":\"https://docs.dimilinks.com/en/api-reference/chat/anthropic-messages\"}]},{\"@type\":[\"TechArticle\",\"APIReference\"],\"@id\":\"https://docs.dimilinks.com/en/api-reference/chat/anthropic-messages#apireference\",\"headline\":\"Anthropic Messages\",\"name\":\"Anthropic Messages\",\"description\":\"Call the full Claude model family through the native Anthropic protocol.\",\"url\":\"https://docs.dimilinks.com/en/api-reference/chat/anthropic-messages\",\"mainEntityOfPage\":{\"@id\":\"https://docs.dimilinks.com/en/api-reference/chat/anthropic-messages#webpage\"},\"dateModified\":\"2026-08-21T03:33:17.056Z\",\"publisher\":{\"@id\":\"https://docs.dimilinks.com/#organization\"},\"isPartOf\":{\"@id\":\"https://docs.dimilinks.com#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"DimiLinks API\",\"creator\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","siteName":"DimiLinks API","nav":{"global":null,"languages":[{"language":"cn","navbar":{"links":[{"href":"https://dimilinks.com","label":"主页"},{"href":"https://dimilinks.com/pricing","label":"价格"}],"primary":{"type":"button","label":"打开控制台","href":"https://dimilinks.com/console"}},"pages":[{"title":"cn","href":"/api-reference/chat/anthropic-messages"}]},{"language":"en","navbar":{"links":[{"href":"https://dimilinks.com/en","label":"Home"},{"href":"https://dimilinks.com/en/pricing","label":"Pricing"}],"primary":{"type":"button","label":"Open console","href":"https://dimilinks.com/console"}},"tabs":[{"tab":"Guides","pages":[{"title":"Guides","href":"/en"}]},{"tab":"API Reference","groups":[{"group":"Basics","pages":[{"title":"API reference","icon":"terminal","href":"/en/api-reference/introduction"},{"title":"Authentication","icon":"key","href":"/en/api-reference/authentication"},{"title":"List models","openapi":"GET /models","icon":"boxes-stacked","href":"/en/api-reference/models"},{"title":"Model selection and updates","icon":"wand-magic-sparkles","href":"/en/api-reference/model-guide"},{"title":"Model groups \u0026 pricing","icon":"scale-balanced","href":"/en/api-reference/groups-and-pricing"},{"title":"Errors","icon":"circle-exclamation","href":"/en/api-reference/errors"}]},{"group":"Chat","pages":[{"title":"Create chat completion","description":"Call Claude, GPT, and other text models through the OpenAI-compatible protocol.","openapi":"POST /chat/completions","icon":"message","href":"/en/api-reference/chat/completions"},{"title":"Anthropic Messages","openapi":"POST /messages","icon":"brain","href":"/en/api-reference/chat/anthropic-messages"}]},{"group":"Images / gpt-image-2","pages":[{"title":"Create image generation","description":"Generate images with gpt-image-2, including asynchronous tasks and JSON reference images.","openapi":"POST /images/generations","icon":"image","href":"/en/api-reference/images/gpt-image-2/generation"},{"title":"Create image edit","openapi":"POST /images/edits","icon":"wand-magic-sparkles","href":"/en/api-reference/images/gpt-image-2/edits"},{"title":"Retrieve image task","openapi":"GET /tasks/{task_id}","icon":"bars-progress","href":"/en/api-reference/images/gpt-image-2/tasks"},{"title":"Sizes and resolution","icon":"expand","href":"/en/api-reference/images/gpt-image-2/sizes"}]},{"group":"Images / more models","pages":[{"title":"Create image generation (Nano Banana Pro)","openapi":"POST /images/generations","icon":"image","href":"/en/api-reference/images/nano-banana-pro/generation"},{"title":"Create image generation (GPT Image 2.5)","openapi":"POST /images/generations","icon":"image","href":"/en/api-reference/images/gpt-image-2.5/generation"}]},{"group":"Videos / unified video API","pages":[{"title":"Video groups and billing rules","icon":"layer-group","href":"/en/api-reference/videos/groups"},{"title":"Create video generation (MiniMax-H3)","openapi":"POST /videos","icon":"film","href":"/en/api-reference/videos/minimax-h3/generation"},{"title":"Create video generation (Seedance 2.0 / 2.5)","openapi":"POST /videos","icon":"film","href":"/en/api-reference/videos/seedance/generation"},{"title":"Retrieve video task","openapi":"GET /videos/{task_id}","icon":"clock","href":"/en/api-reference/videos/tasks"}]},{"group":"Video / grok-imagine-video","pages":[{"title":"Create video generation","openapi":"POST /videos/generations","icon":"film","href":"/en/api-reference/videos/grok-imagine-video/generation"},{"title":"Retrieve video task","openapi":"GET /tasks/{task_id}","icon":"bars-progress","href":"/en/api-reference/videos/grok-imagine-video/tasks"}]},{"group":"IDE and CLI integrations","pages":[{"title":"One-click import into CC Switch / Cherry Studio","icon":"share-from-square","href":"/en/api-reference/integrations/ccswitch"},{"title":"Claude Code integration","icon":"robot","href":"/en/api-reference/integrations/claude-code"},{"title":"Codex CLI integration","icon":"terminal","href":"/en/api-reference/integrations/codex-cli"},{"title":"VS Code and other IDEs","icon":"code","href":"/en/api-reference/integrations/vscode-and-ides"}]}]}]},{"language":"jp","navbar":{"links":[{"href":"https://dimilinks.com/ja","label":"ホーム"},{"href":"https://dimilinks.com/ja/pricing","label":"料金"}],"primary":{"type":"button","label":"コンソールを開く","href":"https://dimilinks.com/console"}},"pages":[{"title":"jp","href":"/jp/api-reference/chat/anthropic-messages"}]}]},"title":"Anthropic Messages - DimiLinks API","buildId":"dpl_EnxDqhjaNc9a8MVa833TGULPd9uJ","deploymentId":"dpl_EnxDqhjaNc9a8MVa833TGULPd9uJ","dynamics":["c2aa737661","2b790eda92","b0f84f53ff","a9bb46feb3"],"chunks":["OpenApiReferenceProvider-26-lDe7V.js","utils-CWQmgYtH.js","cloneDeep-izs3Hzxb.js","_Uint8Array-BVIqJ90l.js","isObjectLike-C8vmzPEN.js","isArray-Dcu1dQ5t.js","utils-4-Aw3rSD.js","toString-BX-iyh8G.js","isSymbol-CSH9U2Gm.js","addUniqueKeysToSchema-C2zjXYA5.js","snippetPresets-DFmpFA7C.js","style-to-object-BY3JEAdk.js","v4-DIgz8zy6.js","ApiExamples-FJpQavWq.js","isEqual-BfaiBbcl.js","usePlaygroundInputsStore-D_GvPF7k.js","shallow-Bs2ZB0NO.js","getApiPlaygroundDisplay-DCcqJJk-.js","CodeSnippet-DzDxawVe.js","CodeSnippets-aUr7fU-7.js","Page-CT9uE8Ip.js","getPastedJson-Y1fKsj_I.js","icon-DI4zTsDr.js","MethodPill-C0nDlmSQ.js","DuplicateIcon-NUXbx2nQ.js","createIcon-BdTHrPAi.js","DynamicMarkdown-CtpgKJwj.js","SectionHeading-B3x35tOt.js","axios-vUo_bRtp.js","Markdown-3OmurJMP.js","clsx-DMKzROTp.js","lib-DuNMoZ05.js","lib-B8HbPgcC.js","html-void-elements-mCSPHezU.js","dist-1ms6tsT-.js","katex-YMM-FMeD.js","marked.esm-CZWythHk.js","AssistantPageLink-Ke9xIMFx.js"]}