Point the official anthropic package at the gateway — host root, no /v1 — and reach every gateway model.
Keep the official anthropic package: change the base URL to the host root without
/v1 (the SDK appends /v1/messages itself), use your AI Reserve API key, and every
gateway model — not just Claude — answers the same call.
import osfrom anthropic import Anthropicclient = Anthropic( base_url="https://api.aireserve.com", # host root — NO /v1 api_key=os.environ["AIRESERVE_API_KEY"],)# Works with Claude models — and with GPT model IDs too (bridged).res = client.messages.create( model="claude-haiku-4-5-20251001", max_tokens=256, messages=[{"role": "user", "content": "hello"}],)print(res.content[0].text)
import Anthropic from "@anthropic-ai/sdk";const client = new Anthropic({ baseURL: "https://api.aireserve.com", // host root — NO /v1 apiKey: process.env.AIRESERVE_API_KEY,});// Works with Claude models — and with GPT model IDs too (bridged).const res = await client.messages.create({ model: "claude-haiku-4-5-20251001", max_tokens: 256, messages: [{ role: "user", content: "hello" }],});
Migrating an existing Anthropic codebase? The Migrating from Anthropic
guide covers the full concept mapping. Using Claude Code or the Claude Agent SDK instead?
They are configured entirely through environment variables — see the
Claude Code recipe.
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"AI Reserve Developer Documentation","colors":{"primary":"#8a7a50","light":"#c8c0a8","dark":"#b0a890"},"logo":{"light":"https://mintcdn.com/ai-reserve/kVGnXF7MyJRszayb/logo/light.svg?fit=max\u0026auto=format\u0026n=kVGnXF7MyJRszayb\u0026q=85\u0026s=4305e52131e25c047cb3dcee7304ebe1","dark":"https://mintcdn.com/ai-reserve/kVGnXF7MyJRszayb/logo/dark.svg?fit=max\u0026auto=format\u0026n=kVGnXF7MyJRszayb\u0026q=85\u0026s=8d7ceae367a63973571659fbe14964e7","href":"https://docs.aireserve.com"},"favicon":"https://mintcdn.com/ai-reserve/kVGnXF7MyJRszayb/favicon.svg?fit=max\u0026auto=format\u0026n=kVGnXF7MyJRszayb\u0026q=85\u0026s=a25b27a5ffce06736ec9f529f4150ca3","api":{"playground":{"display":"interactive"},"examples":{"languages":["curl","python","javascript"]}},"appearance":{"default":"dark"},"background":{"decoration":"grid","color":{"light":"#faf8f1","dark":"#07172a"}},"navbar":{"links":[{"href":"https://portal.aireserve.com","label":"Portal"}],"primary":{"type":"button","label":"Get an API key","href":"https://portal.aireserve.com/keys"}},"footer":{"links":[{"header":"Developers","items":[{"label":"Get an API key","href":"https://portal.aireserve.com/keys"},{"label":"Portal","href":"https://portal.aireserve.com"},{"label":"Connect wizard","href":"https://portal.aireserve.com/connect"}]},{"header":"Trust \u0026 disclosures","items":[{"label":"Provider Data Handling","href":"https://privacy.aireserve.com/data-handling"},{"label":"Subprocessors","href":"https://privacy.aireserve.com/subprocessors"}]},{"header":"For AI agents","items":[{"label":"llms.txt","href":"https://docs.aireserve.com/llms.txt"},{"label":"llms-full.txt","href":"https://docs.aireserve.com/llms-full.txt"}]}]},"fonts":{"family":"Sora"},"icons":{"library":"lucide"},"styling":{"codeblocks":"dark","latex":true},"navigation":{"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"ai-reserve","hasAudioNarration":false,"actualSubdomain":"ai-reserve","customDomains":["docs.aireserve.com"],"gitSource":{"type":"github","owner":"audacity-investments","repo":"audacity","deployBranch":"main","contentDirectory":"apps/docs","isPrivate":true,"mountPath":"","label":""},"chroma":{"latestBuiltDeploymentHistoryId":"6aec5573252b547dce07c46a","collectionId":"15171975-7a06-4e21-90de-672e205c7a7d","liveDeploymentHistoryId":"6aec5573252b547dce07c46a","schemaVersion":"v3"},"entitlements":{"AI_CHAT":{"status":"DISABLED"}},"buildId":"6aec5573252b547dce07c46a","clientVersion":"0.0.4067","searchFilterCounts":[{"language":"default","tag":"Models","count":292},{"language":"default","tag":"By maker","count":285},{"language":"default","tag":"API Reference","count":264},{"language":"default","tag":"Endpoints","count":258},{"language":"default","tag":"Documentation","count":82},{"language":"default","tag":"GPU Infrastructure","count":67},{"language":"default","tag":"Anthropic","count":40},{"language":"default","tag":"DeepSeek","count":38},{"language":"default","tag":"OpenAI","count":37},{"language":"default","tag":"Fine-tuning","count":28}]},"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":"rbac-expansion","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-pr-grouping","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-prefix","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"analytics-v7","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"user-flows-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"no-publish-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"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":"full-page-search","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workspace-projects","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"assistant-v5","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":"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":"turbopuffer-dual-write","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},{"name":"approve-review-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"sso-setup-deadline-banner","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-serve","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"live-agents","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"googleFontsInlined":true},"customCss":[{"filePath":"style.css","content":"/* cyrillic-ext */\n@font-face {\n font-family: 'Cormorant Garamond';\n font-style: normal;\n font-weight: 400;\n font-display: swap;\n src: url(/_mintlify/assets/fonts/google/s/cormorantgaramond/v21/co3bmX5slCNuHLi8bLeY9MK7whWMhyjYpHtKgS4.woff2) format('woff2');\n unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;\n}\n/* cyrillic */\n@font-face {\n font-family: 'Cormorant Garamond';\n font-style: normal;\n font-weight: 400;\n font-display: swap;\n src: url(/_mintlify/assets/fonts/google/s/cormorantgaramond/v21/co3bmX5slCNuHLi8bLeY9MK7whWMhyjYrXtKgS4.woff2) format('woff2');\n unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;\n}\n/* vietnamese */\n@font-face {\n font-family: 'Cormorant Garamond';\n font-style: normal;\n font-weight: 400;\n font-display: swap;\n src: url(/_mintlify/assets/fonts/google/s/cormorantgaramond/v21/co3bmX5slCNuHLi8bLeY9MK7whWMhyjYpntKgS4.woff2) format('woff2');\n unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;\n}\n/* latin-ext */\n@font-face {\n font-family: 'Cormorant Garamond';\n font-style: normal;\n font-weight: 400;\n font-display: swap;\n src: url(/_mintlify/assets/fonts/google/s/cormorantgaramond/v21/co3bmX5slCNuHLi8bLeY9MK7whWMhyjYp3tKgS4.woff2) format('woff2');\n unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;\n}\n/* latin */\n@font-face {\n font-family: 'Cormorant Garamond';\n font-style: normal;\n font-weight: 400;\n font-display: swap;\n src: url(/_mintlify/assets/fonts/google/s/cormorantgaramond/v21/co3bmX5slCNuHLi8bLeY9MK7whWMhyjYqXtK.woff2) format('woff2');\n unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;\n}\n/* cyrillic-ext */\n@font-face {\n font-family: 'Cormorant Garamond';\n font-style: normal;\n font-weight: 500;\n font-display: swap;\n src: url(/_mintlify/assets/fonts/google/s/cormorantgaramond/v21/co3bmX5slCNuHLi8bLeY9MK7whWMhyjYpHtKgS4.woff2) format('woff2');\n unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;\n}\n/* cyrillic */\n@font-face {\n font-family: 'Cormorant Garamond';\n font-style: normal;\n font-weight: 500;\n font-display: swap;\n src: url(/_mintlify/assets/fonts/google/s/cormorantgaramond/v21/co3bmX5slCNuHLi8bLeY9MK7whWMhyjYrXtKgS4.woff2) format('woff2');\n unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;\n}\n/* vietnamese */\n@font-face {\n font-family: 'Cormorant Garamond';\n font-style: normal;\n font-weight: 500;\n font-display: swap;\n src: url(/_mintlify/assets/fonts/google/s/cormorantgaramond/v21/co3bmX5slCNuHLi8bLeY9MK7whWMhyjYpntKgS4.woff2) format('woff2');\n unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;\n}\n/* latin-ext */\n@font-face {\n font-family: 'Cormorant Garamond';\n font-style: normal;\n font-weight: 500;\n font-display: swap;\n src: url(/_mintlify/assets/fonts/google/s/cormorantgaramond/v21/co3bmX5slCNuHLi8bLeY9MK7whWMhyjYp3tKgS4.woff2) format('woff2');\n unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;\n}\n/* latin */\n@font-face {\n font-family: 'Cormorant Garamond';\n font-style: normal;\n font-weight: 500;\n font-display: swap;\n src: url(/_mintlify/assets/fonts/google/s/cormorantgaramond/v21/co3bmX5slCNuHLi8bLeY9MK7whWMhyjYqXtK.woff2) format('woff2');\n unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;\n}\n/* cyrillic-ext */\n@font-face {\n font-family: 'Cormorant Garamond';\n font-style: normal;\n font-weight: 600;\n font-display: swap;\n src: url(/_mintlify/assets/fonts/google/s/cormorantgaramond/v21/co3bmX5slCNuHLi8bLeY9MK7whWMhyjYpHtKgS4.woff2) format('woff2');\n unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;\n}\n/* cyrillic */\n@font-face {\n font-family: 'Cormorant Garamond';\n font-style: normal;\n font-weight: 600;\n font-display: swap;\n src: url(/_mintlify/assets/fonts/google/s/cormorantgaramond/v21/co3bmX5slCNuHLi8bLeY9MK7whWMhyjYrXtKgS4.woff2) format('woff2');\n unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;\n}\n/* vietnamese */\n@font-face {\n font-family: 'Cormorant Garamond';\n font-style: normal;\n font-weight: 600;\n font-display: swap;\n src: url(/_mintlify/assets/fonts/google/s/cormorantgaramond/v21/co3bmX5slCNuHLi8bLeY9MK7whWMhyjYpntKgS4.woff2) format('woff2');\n unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;\n}\n/* latin-ext */\n@font-face {\n font-family: 'Cormorant Garamond';\n font-style: normal;\n font-weight: 600;\n font-display: swap;\n src: url(/_mintlify/assets/fonts/google/s/cormorantgaramond/v21/co3bmX5slCNuHLi8bLeY9MK7whWMhyjYp3tKgS4.woff2) format('woff2');\n unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;\n}\n/* latin */\n@font-face {\n font-family: 'Cormorant Garamond';\n font-style: normal;\n font-weight: 600;\n font-display: swap;\n src: url(/_mintlify/assets/fonts/google/s/cormorantgaramond/v21/co3bmX5slCNuHLi8bLeY9MK7whWMhyjYqXtK.woff2) format('woff2');\n unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;\n}\n/* latin-ext */\n@font-face {\n font-family: 'DM Mono';\n font-style: normal;\n font-weight: 400;\n font-display: swap;\n src: url(/_mintlify/assets/fonts/google/s/dmmono/v16/aFTU7PB1QTsUX8KYthSQBLyM.woff2) format('woff2');\n unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;\n}\n/* latin */\n@font-face {\n font-family: 'DM Mono';\n font-style: normal;\n font-weight: 400;\n font-display: swap;\n src: url(/_mintlify/assets/fonts/google/s/dmmono/v16/aFTU7PB1QTsUX8KYthqQBA.woff2) format('woff2');\n unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;\n}\n/* latin-ext */\n@font-face {\n font-family: 'DM Mono';\n font-style: normal;\n font-weight: 500;\n font-display: swap;\n src: url(/_mintlify/assets/fonts/google/s/dmmono/v16/aFTR7PB1QTsUX8KYvumzEY2tbZX9.woff2) format('woff2');\n unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;\n}\n/* latin */\n@font-face {\n font-family: 'DM Mono';\n font-style: normal;\n font-weight: 500;\n font-display: swap;\n src: url(/_mintlify/assets/fonts/google/s/dmmono/v16/aFTR7PB1QTsUX8KYvumzEYOtbQ.woff2) format('woff2');\n unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;\n}\n:root{--ar-navy: #07172a;--ar-navy-deep: #050f1d;--ar-card: #0c1e33;--ar-raised: #122840;--ar-ivory: #f2ede3;--ar-gold: #b0a890;--ar-gold-lt: #c8c0a8;--ar-gold-rule: rgba(176, 168, 144, 0.28);--ar-border: rgba(120, 144, 155, 0.22);--ar-mono: \"DM Mono\", \"SF Mono\", ui-monospace, Menlo, Consolas, \"Liberation Mono\",\n monospace}code,kbd,samp,pre,pre *{font-family:var(--ar-mono)!important}#page-title,#content-area h2{font-family:\"Cormorant Garamond\", \"Iowan Old Style\", \"Palatino Linotype\",\n Palatino, Georgia, serif;font-weight:500;letter-spacing:0.005em}#page-title{font-size:2.75rem;line-height:1.12}#content-area h2{font-size:1.85rem}sidebar-group-header,#sidebar h5,#sidebar h6{font-family:var(--ar-mono);font-size:0.6875rem;font-weight:500;letter-spacing:0.14em;text-transform:uppercase}.dark sidebar-group-header,.dark #sidebar h5,.dark #sidebar h6{color:#78909b}.dark #navbar{border-bottom:1px solid var(--ar-gold-rule)}.dark card{background:rgba(12, 30, 51, 0.55);border-color:var(--ar-border)}.dark card:hover{border-color:rgba(120, 144, 155, 0.38)}.dark .callout[data-callout-type=\"note\"]{background:rgba(176, 168, 144, 0.07);border-color:rgba(176, 168, 144, 0.26)}.dark .callout[data-callout-type=\"note\"] [data-component-part=\"callout-content\"],.dark .callout[data-callout-type=\"note\"] [data-component-part=\"callout-icon\"] svg{color:#d9d2bf}.callout[data-callout-type=\"note\"]{background:rgba(138, 122, 80, 0.07);border-color:rgba(138, 122, 80, 0.3)}.callout[data-callout-type=\"note\"] [data-component-part=\"callout-content\"],.callout[data-callout-type=\"note\"] [data-component-part=\"callout-icon\"] svg{color:#6b5f3e}"}],"page":{"pagePath":"connect/anthropic-sdk","slug":"/connect/anthropic-sdk","pageMetadata":{"title":"Anthropic SDK","description":"Point the official anthropic package at the gateway — host root, no /v1 — and reach every gateway model.","icon":"code-xml","href":"/connect/anthropic-sdk"},"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: \"Point the official anthropic package at the gateway — host root, no /v1 — and reach every gateway model.\"\n });\n}\nfunction MDXContent(props = {}) {\n const {wrapper: MDXLayout} = {\n ..._provideComponents(),\n ...props.components\n };\n return MDXLayout ? _jsx(MDXLayout, {\n ...props,\n children: _jsx(_createMdxContent, {\n ...props\n })\n }) : _createMdxContent(props);\n}\nreturn {\n default: MDXContent\n};\n","frontmatter":{},"scope":{}},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){const _components={a:`a`,code:`code`,p:`p`,pre:`pre`,span:`span`,strong:`strong`,..._provideComponents(),...props.components},{CodeBlock,CodeGroup}=_components;if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!CodeGroup)_missingMdxReference(`CodeGroup`,true);return _jsxs(_Fragment,{children:[_jsxs(_components.p,{children:[`Keep the official `,_jsx(_components.code,{children:`anthropic`}),` package: change the base URL to the `,_jsxs(_components.strong,{children:[`host root without\n`,_jsx(_components.code,{children:`/v1`})]}),` (the SDK appends `,_jsx(_components.code,{children:`/v1/messages`}),` itself), use your AI Reserve API key, and every\ngateway model — not just Claude — answers the same call.`]}),`\n`,_jsxs(CodeGroup,{children:[_jsx(CodeBlock,{filename:`Python`,numberOfLines:`15`,language:`python`,children:_jsx(_components.pre,{className:`shiki shiki-themes dark-plus dark-plus`,style:{backgroundColor:`#0B0C0E`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},language:`python`,children:_jsxs(_components.code,{language:`python`,numberOfLines:`15`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#C586C0`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` os`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#C586C0`,\"--shiki-dark\":`#C586C0`},children:`from`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` anthropic `}),_jsx(_components.span,{style:{color:`#C586C0`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` Anthropic`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`client = Anthropic(`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:` base_url`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"https://api.aireserve.com\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#6A9955`,\"--shiki-dark\":`#6A9955`},children:`# host root — NO /v1`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:` api_key`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`=os.environ[`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"AIRESERVE_API_KEY\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`],`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`)`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6A9955`,\"--shiki-dark\":`#6A9955`},children:`# Works with Claude models — and with GPT model IDs too (bridged).`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`res = client.messages.create(`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:` model`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"claude-haiku-4-5-20251001\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:` max_tokens`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#B5CEA8`,\"--shiki-dark\":`#B5CEA8`},children:`256`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:` messages`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`=[{`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"role\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"user\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"content\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"hello\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`}],`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`)`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:`print`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`(res.content[`}),_jsx(_components.span,{style:{color:`#B5CEA8`,\"--shiki-dark\":`#B5CEA8`},children:`0`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`].text)`})]}),`\n`]})})}),_jsx(CodeBlock,{filename:`TypeScript`,numberOfLines:`13`,language:`typescript`,children:_jsx(_components.pre,{className:`shiki shiki-themes dark-plus dark-plus`,style:{backgroundColor:`#0B0C0E`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},language:`typescript`,children:_jsxs(_components.code,{language:`typescript`,numberOfLines:`13`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#C586C0`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:` Anthropic`}),_jsx(_components.span,{style:{color:`#C586C0`,\"--shiki-dark\":`#C586C0`},children:` from`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` \"@anthropic-ai/sdk\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:`const`}),_jsx(_components.span,{style:{color:`#4FC1FF`,\"--shiki-dark\":`#4FC1FF`},children:` client`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` = `}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:`new`}),_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:` Anthropic`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`({`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:` baseURL:`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` \"https://api.aireserve.com\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#6A9955`,\"--shiki-dark\":`#6A9955`},children:`// host root — NO /v1`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:` apiKey:`}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:` process`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`env`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#4FC1FF`,\"--shiki-dark\":`#4FC1FF`},children:`AIRESERVE_API_KEY`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`});`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6A9955`,\"--shiki-dark\":`#6A9955`},children:`// Works with Claude models — and with GPT model IDs too (bridged).`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:`const`}),_jsx(_components.span,{style:{color:`#4FC1FF`,\"--shiki-dark\":`#4FC1FF`},children:` res`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` = `}),_jsx(_components.span,{style:{color:`#C586C0`,\"--shiki-dark\":`#C586C0`},children:`await`}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:` client`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`messages`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:`create`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`({`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:` model:`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` \"claude-haiku-4-5-20251001\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:` max_tokens:`}),_jsx(_components.span,{style:{color:`#B5CEA8`,\"--shiki-dark\":`#B5CEA8`},children:` 256`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:` messages:`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` [{ `}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`role:`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` \"user\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`content:`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` \"hello\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` }],`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`});`})}),`\n`]})})})]}),`\n`,_jsxs(_components.p,{children:[`Migrating an existing Anthropic codebase? The `,_jsx(_components.a,{href:`/migrate/from-anthropic`,children:`Migrating from Anthropic`}),`\nguide covers the full concept mapping. Using Claude Code or the Claude Agent SDK instead?\nThey are configured entirely through environment variables — see the\n`,_jsx(_components.a,{href:`/connect/claude-code`,children:`Claude Code recipe`}),`.`]})]})}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":{"codeStyling":"dark","config":{},"pageMetadata":{"title":"Anthropic SDK","description":"Point the official anthropic package at the gateway — host root, no /v1 — and reach every gateway model.","icon":"code-xml","href":"/connect/anthropic-sdk"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[],"codeExamples":{}},"jsLinks":[],"subdomain":"ai-reserve","siteName":"AI Reserve Developer Documentation","title":"Anthropic SDK - AI Reserve Developer Documentation","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-08-25T15:41:32.137Z","originalFileLocation":"connect/anthropic-sdk.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=\"dark\"}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=\"Point the official anthropic package at the gateway — host root, no /v1 — and reach every gateway model.\">\u003cmeta data-mint-head name=\"application-name\" content=\"AI Reserve Developer Documentation\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/ai-reserve/6c4vKdK5wwkhGrb_/_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/ai-reserve/6c4vKdK5wwkhGrb_/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/ai-reserve/6c4vKdK5wwkhGrb_/_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/ai-reserve/6c4vKdK5wwkhGrb_/_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/ai-reserve/6c4vKdK5wwkhGrb_/_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/ai-reserve/6c4vKdK5wwkhGrb_/_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/ai-reserve/6c4vKdK5wwkhGrb_/_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/ai-reserve/6c4vKdK5wwkhGrb_/_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/ai-reserve/6c4vKdK5wwkhGrb_/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Anthropic SDK - AI Reserve Developer Documentation\">\u003cmeta data-mint-head property=\"og:description\" content=\"Point the official anthropic package at the gateway — host root, no /v1 — and reach every gateway model.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"AI Reserve Developer Documentation\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.aireserve.com/connect/anthropic-sdk\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://ai-reserve.mintlify.app/_mintlify/api/og/v2?division=Connect+your+tool\u0026amp;title=Anthropic+SDK\u0026amp;description=Point+the+official+anthropic+package+at+the+gateway+%E2%80%94+host+root%2C+no+%2Fv1+%E2%80%94+and+reach+every+gateway+model.\u0026amp;theme=9ad3102375139745a61bf236\u0026amp;signature=e355ce27fd601902b4e2f9dfddfdb2abeadcd9599d9ba32d4bc6aaac3c22a9cc\">\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 SDK - AI Reserve Developer Documentation\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Point the official anthropic package at the gateway — host root, no /v1 — and reach every gateway model.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://ai-reserve.mintlify.app/_mintlify/api/og/v2?division=Connect+your+tool\u0026amp;title=Anthropic+SDK\u0026amp;description=Point+the+official+anthropic+package+at+the+gateway+%E2%80%94+host+root%2C+no+%2Fv1+%E2%80%94+and+reach+every+gateway+model.\u0026amp;theme=9ad3102375139745a61bf236\u0026amp;signature=e355ce27fd601902b4e2f9dfddfdb2abeadcd9599d9ba32d4bc6aaac3c22a9cc\">\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/ai-reserve/6c4vKdK5wwkhGrb_/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"AI Reserve Developer Documentation\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#8a7a50\">\u003clink data-mint-head rel=\"canonical\" href=\"https://docs.aireserve.com/connect/anthropic-sdk\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/connect/anthropic-sdk.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://docs.aireserve.com/#organization\",\"name\":\"AI Reserve Developer Documentation\",\"url\":\"https://docs.aireserve.com\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/ai-reserve/kVGnXF7MyJRszayb/logo/light.svg?fit=max\u0026auto=format\u0026n=kVGnXF7MyJRszayb\u0026q=85\u0026s=4305e52131e25c047cb3dcee7304ebe1\"}},{\"@type\":\"WebSite\",\"@id\":\"https://docs.aireserve.com#website\",\"name\":\"AI Reserve Developer Documentation\",\"url\":\"https://docs.aireserve.com\",\"publisher\":{\"@id\":\"https://docs.aireserve.com/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://docs.aireserve.com/connect/anthropic-sdk#webpage\",\"url\":\"https://docs.aireserve.com/connect/anthropic-sdk\",\"name\":\"Anthropic SDK\",\"description\":\"Point the official anthropic package at the gateway — host root, no /v1 — and reach every gateway model.\",\"dateModified\":\"2026-08-25T15:41:32.137Z\",\"isPartOf\":{\"@id\":\"https://docs.aireserve.com#website\"},\"breadcrumb\":{\"@id\":\"https://docs.aireserve.com/connect/anthropic-sdk#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.aireserve.com/connect/anthropic-sdk#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Connect your tool\",\"item\":\"https://docs.aireserve.com/connect/index\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Anthropic SDK\",\"item\":\"https://docs.aireserve.com/connect/anthropic-sdk\"}]},{\"@type\":[\"Article\",\"TechArticle\"],\"@id\":\"https://docs.aireserve.com/connect/anthropic-sdk#article\",\"headline\":\"Anthropic SDK\",\"name\":\"Anthropic SDK\",\"description\":\"Point the official anthropic package at the gateway — host root, no /v1 — and reach every gateway model.\",\"url\":\"https://docs.aireserve.com/connect/anthropic-sdk\",\"mainEntityOfPage\":{\"@id\":\"https://docs.aireserve.com/connect/anthropic-sdk#webpage\"},\"dateModified\":\"2026-08-25T15:41:32.137Z\",\"publisher\":{\"@id\":\"https://docs.aireserve.com/#organization\"},\"isPartOf\":{\"@id\":\"https://docs.aireserve.com#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"AI Reserve Developer Documentation\",\"creator\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","siteName":"AI Reserve Developer Documentation","nav":{"global":null,"tabs":[{"tab":"Documentation","groups":[{"group":"Getting started","pages":[{"title":"Getting started for your team","icon":"rocket","href":"/getting-started/for-your-team"},{"title":"Every frontier model. One API key.","sidebarTitle":"Overview","icon":"compass","href":"/index"},{"title":"Get an API key","icon":"key-round","href":"/getting-started/get-an-api-key"},{"title":"SDK quickstart","icon":"rocket","href":"/getting-started/quickstart"}]},{"group":"Connect your tool","pages":[{"title":"Connect your tool","sidebarTitle":"Overview","icon":"cable","href":"/connect/index"},{"title":"Slack","icon":"slack","href":"/connect/slack"},{"title":"aireserve CLI","icon":"wand-sparkles","href":"/connect/cli"},{"title":"Claude Code","icon":"terminal","href":"/connect/claude-code"},{"title":"Codex","icon":"square-terminal","href":"/connect/codex"},{"title":"Cursor","icon":"mouse-pointer-2","href":"/connect/cursor"},{"title":"GitHub Copilot","icon":"github","href":"/connect/github-copilot"},{"title":"Zed","icon":"zap","href":"/connect/zed"},{"title":"Cline","icon":"bot","href":"/connect/cline"},{"title":"Devin Desktop","icon":"app-window","href":"/connect/devin-desktop"},{"title":"Factory Droid","icon":"factory","href":"/connect/droid"},{"title":"Microsoft Office","icon":"layout-grid","href":"/connect/microsoft-office"},{"title":"GitHub Actions (CI)","icon":"workflow","href":"/connect/github-actions"},{"title":"Aider","icon":"square-pen","href":"/connect/aider"},{"title":"Continue","icon":"infinity","href":"/connect/continue"},{"title":"Goose","icon":"bird","href":"/connect/goose"},{"title":"OpenCode","icon":"square-code","href":"/connect/opencode"},{"title":"OpenHands","icon":"hand","href":"/connect/openhands"},{"title":"Roo Code","icon":"rabbit","href":"/connect/roo-code"},{"title":"OpenAI SDK","description":"Point the official openai package — or any OpenAI-compatible framework — at the gateway with a base-URL swap.","icon":"code","href":"/connect/openai-sdk"},{"title":"Anthropic SDK","icon":"code-xml","href":"/connect/anthropic-sdk"},{"title":"Terminal coding agents","description":"Run Claude Code or Codex in your terminal on your AI Reserve API key — one command installs the aireserve CLI and connects both to the gateway.","icon":"square-chevron-right","href":"/connect/code-cli"},{"title":"AWS SDK (boto3) / Bedrock migration","sidebarTitle":"AWS SDK (boto3)","icon":"cloud","href":"/connect/aws-sdk"},{"title":"MCP server","icon":"plug","href":"/connect/mcp"},{"title":"Operation reference","icon":"list-tree","href":"/connect/mcp-tools"}]},{"group":"GPU Infrastructure","pages":[{"title":"GPU Infrastructure","icon":"server","href":"/gpu-infrastructure/index"},{"title":"Quickstart","icon":"rocket","href":"/gpu-infrastructure/quickstart"},{"group":"Frontier model playbooks","expanded":false,"pages":[{"title":"Frontier model serving playbooks","icon":"book-open-check","href":"/gpu-infrastructure/playbooks"},{"title":"Serve GLM-5.3","icon":"braces","href":"/gpu-infrastructure/playbooks/glm-5-3"},{"title":"Serve Kimi K3","icon":"scan-eye","href":"/gpu-infrastructure/playbooks/kimi-k3"},{"title":"Serve DeepSeek V4 Pro 0813","icon":"brain-circuit","href":"/gpu-infrastructure/playbooks/deepseek-v4-pro-0813"},{"title":"Serve DeepSeek V4.1 Flash","icon":"zap","href":"/gpu-infrastructure/playbooks/deepseek-v4-1-flash"}]},{"title":"Configure and launch","icon":"play","href":"/gpu-infrastructure/launch-instances"},{"title":"Connect and manage","icon":"sliders-horizontal","href":"/gpu-infrastructure/manage-instances"},{"title":"Storage and persistence","icon":"hard-drive","href":"/gpu-infrastructure/storage"},{"title":"Multi-node clusters","icon":"network","href":"/gpu-infrastructure/clusters"},{"title":"Keys, registries, and usage","icon":"key","href":"/gpu-infrastructure/supporting-resources"},{"title":"Operations, pricing, and errors","icon":"rotate-cw","href":"/gpu-infrastructure/operations"},{"title":"Migrate from RunPod","icon":"arrow-left-right","href":"/gpu-infrastructure/migrate-from-runpod"}]},{"group":"AWS Hub","pages":[{"title":"AWS Hub","icon":"boxes","href":"/containers/index"},{"title":"Repoint Amazon ECS to AI Reserve","sidebarTitle":"Amazon ECS","icon":"container","href":"/containers/ecs"},{"title":"Secrets Manager","sidebarTitle":"Secrets Manager","icon":"key","href":"/containers/secrets"},{"title":"Understand AWS Billing","sidebarTitle":"AWS Billing","icon":"receipt-text","href":"/containers/aws-billing"}]},{"group":"Capabilities","pages":[{"title":"Streaming","icon":"activity","href":"/capabilities/streaming"},{"title":"Tool use","icon":"wrench","href":"/capabilities/tool-use"},{"title":"Images (vision)","icon":"eye","href":"/capabilities/vision"},{"title":"Image generation","icon":"image","href":"/capabilities/image-generation"},{"title":"Video input (understanding)","sidebarTitle":"Video input","icon":"film","href":"/capabilities/video-input"},{"title":"Video generation","icon":"clapperboard","href":"/capabilities/video-generation"},{"title":"Prompt caching","icon":"database-zap","href":"/capabilities/prompt-caching"},{"title":"Fallback models","icon":"arrow-right-left","href":"/capabilities/fallbacks"},{"title":"JSON response healing","icon":"braces","href":"/capabilities/response-healing"},{"title":"Customer attribution","icon":"tags","href":"/capabilities/customer-attribution"},{"title":"Budgets","icon":"circle-dollar-sign","href":"/capabilities/budgets"},{"title":"Admin API","icon":"shield-check","href":"/capabilities/admin-api"},{"title":"Dedicated GPU endpoints","icon":"cpu","href":"/capabilities/dedicated-gpu-endpoints"},{"title":"Fine-tuning","icon":"layers-3","href":"/capabilities/fine-tuning"},{"title":"Bring your own key (BYOK)","icon":"key-round","href":"/capabilities/byok"},{"title":"Chat specialists","icon":"chart-candlestick","href":"/capabilities/chat-specialists"},{"title":"Managed content moderation","icon":"shield-check","href":"/capabilities/content-moderation"},{"title":"Text-to-speech","icon":"volume-2","href":"/capabilities/text-to-speech"},{"title":"Realtime voice sessions","icon":"mic","href":"/capabilities/realtime-voice"},{"title":"Live search","icon":"search","href":"/capabilities/live-search"},{"title":"Decisions","icon":"scale","href":"/capabilities/decisions"},{"title":"Extractions","icon":"table","href":"/capabilities/extractions"},{"title":"Data endpoints","icon":"database","href":"/capabilities/data-endpoints"},{"title":"AWS CLI v2 native login","icon":"terminal","href":"/capabilities/aws-cli-login"}]},{"group":"Migrate","pages":[{"title":"Migrating from OpenAI","icon":"arrow-right-left","href":"/migrate/from-openai"},{"title":"Migrating from Anthropic","icon":"arrow-right-left","href":"/migrate/from-anthropic"},{"title":"Migrating from Bedrock","icon":"arrow-right-left","href":"/migrate/from-bedrock"},{"title":"Migrating from RunPod","icon":"arrow-right-left","href":"/migrate/from-runpod"},{"title":"Migrating from Fish Audio","icon":"arrow-right-left","href":"/migrate/from-fish-audio"},{"title":"Migrating from Inworld","icon":"arrow-right-left","href":"/migrate/from-inworld"}]},{"group":"Performance","pages":[{"title":"Gateway latency benchmark","icon":"gauge","href":"/performance/gateway-latency"}]},{"group":"Data \u0026 privacy","pages":[{"title":"Data \u0026 privacy","icon":"shield-check","href":"/trust/data-privacy"},{"title":"Single sign-on","icon":"key-round","href":"/trust/single-sign-on"}]},{"group":"Reliability","pages":[{"title":"How the gateway stays up","icon":"heart-pulse","href":"/reliability/index"},{"title":"Handling provider downtime","icon":"shield-check","href":"/reliability/business-continuity"}]}]},{"tab":"Models","pages":[{"title":"Models","href":"/models"}]},{"tab":"API Reference","pages":[{"title":"API Reference","href":"/api-reference"}]}]},"basePath":"","title":"Anthropic SDK - AI Reserve Developer Documentation","buildId":"dpl_9VVk5y1P8k1ATeJguVngy9Q3cmbD","deploymentId":"dpl_9VVk5y1P8k1ATeJguVngy9Q3cmbD","dynamics":[],"chunks":[]}