Agdi supports OAuth and API keys for model providers. For always-on gateway
hosts, API keys are usually the most predictable option. Subscription/OAuth
flows are also supported when they match your provider account model.See /concepts/oauth for the full OAuth flow and storage
layout.
For SecretRef-based auth (env/file/exec providers), see Secrets Management.
For credential eligibility/reason-code rules used by models status --probe, see
Auth Credential Semantics.
Recommended setup (API key, any provider)
If you’re running a long-lived gateway, start with an API key for your chosen
provider.
For Anthropic specifically, API key auth is the safe path and is recommended
over subscription setup-token auth.
Create an API key in your provider console.
Put it on the gateway host (the machine running agdi gateway).
export <PROVIDER>_API_KEY="..."agdi models status
If the Gateway runs under systemd/launchd, prefer putting the key in
~/.agdi/.env so the daemon can read it:
Then restart the daemon (or restart your Gateway process) and re-check:
agdi models statusagdi doctor
If you’d rather not manage env vars yourself, onboarding can store
API keys for daemon use: agdi onboard.See Help for details on env inheritance (env.shellEnv,
~/.agdi/.env, systemd/launchd).
Anthropic: setup-token (subscription auth)
If you’re using a Claude subscription, the setup-token flow is supported. Run
it on the gateway host:
claude setup-token
Then paste it into Agdi:
agdi models auth setup-token --provider anthropic
If the token was created on another machine, paste it manually:
agdi models auth paste-token --provider anthropic
If you see an Anthropic error like:
This credential is only authorized for use with Claude Code and cannot be used for other API requests.
…use an Anthropic API key instead.
Anthropic setup-token support is technical compatibility only. Anthropic has blocked
some subscription usage outside Claude Code in the past. Use it only if you decide
the policy risk is acceptable, and verify Anthropic’s current terms yourself.
Some providers support retrying a request with alternative keys when an API call
hits a provider rate limit.
Priority order:
OPENCLAW_LIVE_<PROVIDER>_KEY (single override)
<PROVIDER>_API_KEYS
<PROVIDER>_API_KEY
<PROVIDER>_API_KEY_*
Google providers also include GOOGLE_API_KEY as an additional fallback.
The same key list is deduplicated before use.
Agdi retries with the next key only for rate-limit errors (for example
429, rate_limit, quota, resource exhausted).
Non-rate-limit errors are not retried with alternate keys.
If all keys fail, the final error from the last attempt is returned.
Controlling which credential is used
Per-session (chat command)
Use /model <alias-or-id>@<profileId> to pin a specific provider credential for the current session (example profile ids: anthropic:default, anthropic:work).Use /model (or /model list) for a compact picker; use /model status for the full view (candidates + next auth profile, plus provider endpoint details when configured).
Per-agent (CLI override)
Set an explicit auth profile order override for an agent (stored in that agent’s auth-profiles.json):
agdi models auth order get --provider anthropicagdi models auth order set --provider anthropic anthropic:defaultagdi models auth order clear --provider anthropic
Use --agent <id> to target a specific agent; omit it to use the configured default agent.
Troubleshooting
”No credentials found”
If the Anthropic token profile is missing, run claude setup-token on the
gateway host, then re-check:
agdi models status
Token expiring/expired
Run agdi models status to confirm which profile is expiring. If the profile
is missing, rerun claude setup-token and paste the token again.
Requirements
Anthropic subscription account (for claude setup-token)
Claude Code CLI installed (claude command available)
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"Agdi","description":"Local-first agent workspace for assistants, automations, connected chat apps, and real tool execution on your own machine or private host.","colors":{"primary":"#2D7FF5","light":"#5BA0FF","dark":"#2266CC"},"logo":{"light":"https://mintcdn.com/agdiai-597e782f/655WPadtB96t29Rn/assets/agdi-mark.svg?fit=max\u0026auto=format\u0026n=655WPadtB96t29Rn\u0026q=85\u0026s=6ee0846be8797573d4bffde5f0eff316","dark":"https://mintcdn.com/agdiai-597e782f/655WPadtB96t29Rn/assets/agdi-mark.svg?fit=max\u0026auto=format\u0026n=655WPadtB96t29Rn\u0026q=85\u0026s=6ee0846be8797573d4bffde5f0eff316"},"favicon":"https://mintcdn.com/agdiai-597e782f/655WPadtB96t29Rn/assets/agdi-mark.svg?fit=max\u0026auto=format\u0026n=655WPadtB96t29Rn\u0026q=85\u0026s=6ee0846be8797573d4bffde5f0eff316","navbar":{"links":[{"icon":"github","href":"https://github.com/anassagd432/Agdi","label":"GitHub"},{"icon":"package","href":"https://github.com/anassagd432/Agdi/releases","label":"Releases"}]},"fonts":{"heading":{"family":"DM Sans"},"body":{"family":"Fragment Mono"}},"icons":{"library":"lucide"},"styling":{"codeblocks":{"theme":{"light":"min-light","dark":"min-dark"}},"latex":true},"navigation":{"languages":[{"language":"en","href":""},{"language":"zh-Hans","href":"zh-CN"},{"language":"ja","href":"ja-JP"}]}},"deployment":{"deploymentMetadataValue":{"subdomain":"agdiai-597e782f","hasAudioNarration":false,"actualSubdomain":"agdiai-597e782f","customDomains":[],"gitSource":{"type":"github","owner":"anassagd432","repo":"agdi","deployBranch":"main","contentDirectory":"docs","isPrivate":false,"mountPath":"","label":""},"entitlements":{},"buildId":"6ab33d680f22712cd987acc8","clientVersion":"0.0.4143","searchFilterCounts":[{"language":"en","tag":"Reference","count":73},{"language":"zh-Hans","tag":"参考","count":63},{"language":"en","tag":"Tools \u0026 Plugins","count":61},{"language":"en","tag":"Workspace \u0026 Ops","count":55},{"language":"zh-Hans","tag":"工具","count":48},{"language":"en","tag":"CLI commands","count":47},{"language":"en","tag":"Models","count":41},{"language":"zh-Hans","tag":"CLI 命令","count":41},{"language":"zh-Hans","tag":"网关与运维","count":37},{"language":"en","tag":"Providers","count":36},{"language":"en","tag":"Runtime","count":34},{"language":"en","tag":"Channels","count":30},{"language":"en","tag":"Install","count":28},{"language":"zh-Hans","tag":"消息渠道","count":28},{"language":"en","tag":"Tools","count":27},{"language":"zh-Hans","tag":"网关","count":26},{"language":"zh-Hans","tag":"平台","count":26},{"language":"zh-Hans","tag":"模型","count":24},{"language":"zh-Hans","tag":"帮助","count":20},{"language":"zh-Hans","tag":"消息平台","count":20},{"language":"ja","tag":"はじめに","count":3},{"language":"ja","tag":"初回セットアップ","count":2},{"language":"ja","tag":"概要","count":1}]},"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":"custom-rbac-roles","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-mintlify-slack","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-integrations-settings","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"rbac-expansion","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-pr-grouping","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-prefix","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"analytics-v7","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"user-flows-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"no-publish-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-onboarding","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":"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":"editor-metadata","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},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"googleFontsInlined":true},"customCss":[{"filePath":"style.css","content":"#content>h1:first-of-type{display:none!important}.nav-tabs{position:relative}.nav-tabs-item>div{opacity:0}.nav-tabs-underline{position:absolute;left:0;bottom:0;height:1.5px;width:var(--nav-tab-underline-width, 0);transform:translateX(var(--nav-tab-underline-x, 0));background-color:rgb(var(--primary));border-radius:999px;pointer-events:none;opacity:0;transition:transform 260ms ease-in-out,\n width 260ms ease-in-out,\n opacity 160ms ease-in-out;will-change:transform, width}html.dark .nav-tabs-underline{background-color:rgb(var(--primary-light))}.nav-tabs-underline-ready .nav-tabs-underline{opacity:1}"}],"page":{"pagePath":"gateway/authentication","slug":"/gateway/authentication","pageMetadata":{"summary":"Model authentication: OAuth, API keys, and setup-token","read_when":["Debugging model auth or OAuth expiry","Documenting authentication or credential storage"],"title":"Authentication","description":null,"href":"/gateway/authentication"},"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`,blockquote:`blockquote`,code:`code`,li:`li`,ol:`ol`,p:`p`,pre:`pre`,span:`span`,strong:`strong`,ul:`ul`,..._provideComponents(),...props.components},{CodeBlock,Heading,Warning}=_components;if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!Warning)_missingMdxReference(`Warning`,true);return _jsxs(_Fragment,{children:[_jsx(Heading,{level:`1`,id:`authentication`,children:`Authentication`}),`\n`,_jsx(_components.p,{children:`Agdi supports OAuth and API keys for model providers. For always-on gateway\nhosts, API keys are usually the most predictable option. Subscription/OAuth\nflows are also supported when they match your provider account model.`}),`\n`,_jsxs(_components.p,{children:[`See `,_jsx(_components.a,{href:`/concepts/oauth`,children:`/concepts/oauth`}),` for the full OAuth flow and storage\nlayout.\nFor SecretRef-based auth (`,_jsx(_components.code,{children:`env`}),`/`,_jsx(_components.code,{children:`file`}),`/`,_jsx(_components.code,{children:`exec`}),` providers), see `,_jsx(_components.a,{href:`/gateway/secrets`,children:`Secrets Management`}),`.\nFor credential eligibility/reason-code rules used by `,_jsx(_components.code,{children:`models status --probe`}),`, see\n`,_jsx(_components.a,{href:`/auth-credential-semantics`,children:`Auth Credential Semantics`}),`.`]}),`\n`,_jsx(Heading,{level:`2`,id:`recommended-setup-api-key-any-provider`,children:`Recommended setup (API key, any provider)`}),`\n`,_jsx(_components.p,{children:`If you’re running a long-lived gateway, start with an API key for your chosen\nprovider.\nFor Anthropic specifically, API key auth is the safe path and is recommended\nover subscription setup-token auth.`}),`\n`,_jsxs(_components.ol,{children:[`\n`,_jsx(_components.li,{children:`Create an API key in your provider console.`}),`\n`,_jsxs(_components.li,{children:[`Put it on the `,_jsx(_components.strong,{children:`gateway host`}),` (the machine running `,_jsx(_components.code,{children:`agdi gateway`}),`).`]}),`\n`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`2`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes min-light min-dark`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#1f1f1f`,color:`#24292eff`,\"--shiki-dark\":`#b392f0`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`2`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#D32F2F`,\"--shiki-dark\":`#F97583`},children:`export`}),_jsx(_components.span,{style:{color:`#D32F2F`,\"--shiki-dark\":`#F97583`},children:` \u003c`}),_jsx(_components.span,{style:{color:`#24292EFF`,\"--shiki-dark\":`#B392F0`},children:`PROVIDER`}),_jsx(_components.span,{style:{color:`#D32F2F`,\"--shiki-dark\":`#F97583`},children:`>`}),_jsx(_components.span,{style:{color:`#24292EFF`,\"--shiki-dark\":`#B392F0`},children:`_API_KEY`}),_jsx(_components.span,{style:{color:`#D32F2F`,\"--shiki-dark\":`#F97583`},children:`=`}),_jsx(_components.span,{style:{color:`#22863A`,\"--shiki-dark\":`#FFAB70`},children:`\"...\"`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#6F42C1`,\"--shiki-dark\":`#B392F0`},children:`agdi`}),_jsx(_components.span,{style:{color:`#2B5581`,\"--shiki-dark\":`#9DB1C5`},children:` models`}),_jsx(_components.span,{style:{color:`#2B5581`,\"--shiki-dark\":`#9DB1C5`},children:` status`})]}),`\n`]})})}),`\n`,_jsxs(_components.ol,{start:`3`,children:[`\n`,_jsxs(_components.li,{children:[`If the Gateway runs under systemd/launchd, prefer putting the key in\n`,_jsx(_components.code,{children:`~/.agdi/.env`}),` so the daemon can read it:`]}),`\n`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`3`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes min-light min-dark`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#1f1f1f`,color:`#24292eff`,\"--shiki-dark\":`#b392f0`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`3`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#6F42C1`,\"--shiki-dark\":`#B392F0`},children:`cat`}),_jsx(_components.span,{style:{color:`#D32F2F`,\"--shiki-dark\":`#F97583`},children:` >>`}),_jsx(_components.span,{style:{color:`#2B5581`,\"--shiki-dark\":`#9DB1C5`},children:` ~/.agdi/.env`}),_jsx(_components.span,{style:{color:`#D32F2F`,\"--shiki-dark\":`#F97583`},children:` \u003c\u003c`}),_jsx(_components.span,{style:{color:`#24292EFF`,\"--shiki-dark\":`#B392F0`},children:`'EOF'`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#22863A`,\"--shiki-dark\":`#FFAB70`},children:`\u003cPROVIDER>_API_KEY=...`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#24292EFF`,\"--shiki-dark\":`#B392F0`},children:`EOF`})}),`\n`]})})}),`\n`,_jsx(_components.p,{children:`Then restart the daemon (or restart your Gateway process) and re-check:`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`2`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes min-light min-dark`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#1f1f1f`,color:`#24292eff`,\"--shiki-dark\":`#b392f0`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`2`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#6F42C1`,\"--shiki-dark\":`#B392F0`},children:`agdi`}),_jsx(_components.span,{style:{color:`#2B5581`,\"--shiki-dark\":`#9DB1C5`},children:` models`}),_jsx(_components.span,{style:{color:`#2B5581`,\"--shiki-dark\":`#9DB1C5`},children:` status`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#6F42C1`,\"--shiki-dark\":`#B392F0`},children:`agdi`}),_jsx(_components.span,{style:{color:`#2B5581`,\"--shiki-dark\":`#9DB1C5`},children:` doctor`})]}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[`If you’d rather not manage env vars yourself, onboarding can store\nAPI keys for daemon use: `,_jsx(_components.code,{children:`agdi onboard`}),`.`]}),`\n`,_jsxs(_components.p,{children:[`See `,_jsx(_components.a,{href:`/help`,children:`Help`}),` for details on env inheritance (`,_jsx(_components.code,{children:`env.shellEnv`}),`,\n`,_jsx(_components.code,{children:`~/.agdi/.env`}),`, systemd/launchd).`]}),`\n`,_jsx(Heading,{level:`2`,id:`anthropic-setup-token-subscription-auth`,children:`Anthropic: setup-token (subscription auth)`}),`\n`,_jsxs(_components.p,{children:[`If you’re using a Claude subscription, the setup-token flow is supported. Run\nit on the `,_jsx(_components.strong,{children:`gateway host`}),`:`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`1`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes min-light min-dark`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#1f1f1f`,color:`#24292eff`,\"--shiki-dark\":`#b392f0`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`1`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#6F42C1`,\"--shiki-dark\":`#B392F0`},children:`claude`}),_jsx(_components.span,{style:{color:`#2B5581`,\"--shiki-dark\":`#9DB1C5`},children:` setup-token`})]}),`\n`]})})}),`\n`,_jsx(_components.p,{children:`Then paste it into Agdi:`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`1`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes min-light min-dark`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#1f1f1f`,color:`#24292eff`,\"--shiki-dark\":`#b392f0`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`1`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#6F42C1`,\"--shiki-dark\":`#B392F0`},children:`agdi`}),_jsx(_components.span,{style:{color:`#2B5581`,\"--shiki-dark\":`#9DB1C5`},children:` models`}),_jsx(_components.span,{style:{color:`#2B5581`,\"--shiki-dark\":`#9DB1C5`},children:` auth`}),_jsx(_components.span,{style:{color:`#2B5581`,\"--shiki-dark\":`#9DB1C5`},children:` setup-token`}),_jsx(_components.span,{style:{color:`#2B5581`,\"--shiki-dark\":`#9DB1C5`},children:` --provider`}),_jsx(_components.span,{style:{color:`#2B5581`,\"--shiki-dark\":`#9DB1C5`},children:` anthropic`})]}),`\n`]})})}),`\n`,_jsx(_components.p,{children:`If the token was created on another machine, paste it manually:`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`1`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes min-light min-dark`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#1f1f1f`,color:`#24292eff`,\"--shiki-dark\":`#b392f0`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`1`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#6F42C1`,\"--shiki-dark\":`#B392F0`},children:`agdi`}),_jsx(_components.span,{style:{color:`#2B5581`,\"--shiki-dark\":`#9DB1C5`},children:` models`}),_jsx(_components.span,{style:{color:`#2B5581`,\"--shiki-dark\":`#9DB1C5`},children:` auth`}),_jsx(_components.span,{style:{color:`#2B5581`,\"--shiki-dark\":`#9DB1C5`},children:` paste-token`}),_jsx(_components.span,{style:{color:`#2B5581`,\"--shiki-dark\":`#9DB1C5`},children:` --provider`}),_jsx(_components.span,{style:{color:`#2B5581`,\"--shiki-dark\":`#9DB1C5`},children:` anthropic`})]}),`\n`]})})}),`\n`,_jsx(_components.p,{children:`If you see an Anthropic error like:`}),`\n`,_jsx(CodeBlock,{numberOfLines:`2`,language:`text`,children:_jsx(_components.pre,{className:`shiki shiki-themes min-light min-dark`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#1f1f1f`,color:`#24292eff`,\"--shiki-dark\":`#b392f0`},language:`text`,children:_jsxs(_components.code,{language:`text`,numberOfLines:`2`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`This credential is only authorized for use with Claude Code and cannot be used for other API requests.`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})})]})})}),`\n`,_jsx(_components.p,{children:`…use an Anthropic API key instead.`}),`\n`,_jsx(Warning,{children:_jsx(_components.p,{children:`Anthropic setup-token support is technical compatibility only. Anthropic has blocked\nsome subscription usage outside Claude Code in the past. Use it only if you decide\nthe policy risk is acceptable, and verify Anthropic’s current terms yourself.`})}),`\n`,_jsxs(_components.p,{children:[`Manual token entry (any provider; writes `,_jsx(_components.code,{children:`auth-profiles.json`}),` + updates config):`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`2`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes min-light min-dark`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#1f1f1f`,color:`#24292eff`,\"--shiki-dark\":`#b392f0`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`2`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#6F42C1`,\"--shiki-dark\":`#B392F0`},children:`agdi`}),_jsx(_components.span,{style:{color:`#2B5581`,\"--shiki-dark\":`#9DB1C5`},children:` models`}),_jsx(_components.span,{style:{color:`#2B5581`,\"--shiki-dark\":`#9DB1C5`},children:` auth`}),_jsx(_components.span,{style:{color:`#2B5581`,\"--shiki-dark\":`#9DB1C5`},children:` paste-token`}),_jsx(_components.span,{style:{color:`#2B5581`,\"--shiki-dark\":`#9DB1C5`},children:` --provider`}),_jsx(_components.span,{style:{color:`#2B5581`,\"--shiki-dark\":`#9DB1C5`},children:` anthropic`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#6F42C1`,\"--shiki-dark\":`#B392F0`},children:`agdi`}),_jsx(_components.span,{style:{color:`#2B5581`,\"--shiki-dark\":`#9DB1C5`},children:` models`}),_jsx(_components.span,{style:{color:`#2B5581`,\"--shiki-dark\":`#9DB1C5`},children:` auth`}),_jsx(_components.span,{style:{color:`#2B5581`,\"--shiki-dark\":`#9DB1C5`},children:` paste-token`}),_jsx(_components.span,{style:{color:`#2B5581`,\"--shiki-dark\":`#9DB1C5`},children:` --provider`}),_jsx(_components.span,{style:{color:`#2B5581`,\"--shiki-dark\":`#9DB1C5`},children:` openrouter`})]}),`\n`]})})}),`\n`,_jsx(_components.p,{children:`Auth profile refs are also supported for static credentials:`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`api_key`}),` credentials can use `,_jsx(_components.code,{children:`keyRef: { source, provider, id }`})]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`token`}),` credentials can use `,_jsx(_components.code,{children:`tokenRef: { source, provider, id }`})]}),`\n`]}),`\n`,_jsxs(_components.p,{children:[`Automation-friendly check (exit `,_jsx(_components.code,{children:`1`}),` when expired/missing, `,_jsx(_components.code,{children:`2`}),` when expiring):`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`1`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes min-light min-dark`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#1f1f1f`,color:`#24292eff`,\"--shiki-dark\":`#b392f0`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`1`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#6F42C1`,\"--shiki-dark\":`#B392F0`},children:`agdi`}),_jsx(_components.span,{style:{color:`#2B5581`,\"--shiki-dark\":`#9DB1C5`},children:` models`}),_jsx(_components.span,{style:{color:`#2B5581`,\"--shiki-dark\":`#9DB1C5`},children:` status`}),_jsx(_components.span,{style:{color:`#2B5581`,\"--shiki-dark\":`#9DB1C5`},children:` --check`})]}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[`Optional ops scripts (systemd/Termux) are documented here:\n`,_jsx(_components.a,{href:`/automation/auth-monitoring`,children:`/automation/auth-monitoring`})]}),`\n`,_jsxs(_components.blockquote,{children:[`\n`,_jsxs(_components.p,{children:[_jsx(_components.code,{children:`claude setup-token`}),` requires an interactive TTY.`]}),`\n`]}),`\n`,_jsx(Heading,{level:`2`,id:`checking-model-auth-status`,children:`Checking model auth status`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`2`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes min-light min-dark`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#1f1f1f`,color:`#24292eff`,\"--shiki-dark\":`#b392f0`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`2`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#6F42C1`,\"--shiki-dark\":`#B392F0`},children:`agdi`}),_jsx(_components.span,{style:{color:`#2B5581`,\"--shiki-dark\":`#9DB1C5`},children:` models`}),_jsx(_components.span,{style:{color:`#2B5581`,\"--shiki-dark\":`#9DB1C5`},children:` status`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#6F42C1`,\"--shiki-dark\":`#B392F0`},children:`agdi`}),_jsx(_components.span,{style:{color:`#2B5581`,\"--shiki-dark\":`#9DB1C5`},children:` doctor`})]}),`\n`]})})}),`\n`,_jsx(Heading,{level:`2`,id:`api-key-rotation-behavior-gateway`,children:`API key rotation behavior (gateway)`}),`\n`,_jsx(_components.p,{children:`Some providers support retrying a request with alternative keys when an API call\nhits a provider rate limit.`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[`Priority order:`,`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`OPENCLAW_LIVE_\u003cPROVIDER>_KEY`}),` (single override)`]}),`\n`,_jsx(_components.li,{children:_jsx(_components.code,{children:`\u003cPROVIDER>_API_KEYS`})}),`\n`,_jsx(_components.li,{children:_jsx(_components.code,{children:`\u003cPROVIDER>_API_KEY`})}),`\n`,_jsx(_components.li,{children:_jsx(_components.code,{children:`\u003cPROVIDER>_API_KEY_*`})}),`\n`]}),`\n`]}),`\n`,_jsxs(_components.li,{children:[`Google providers also include `,_jsx(_components.code,{children:`GOOGLE_API_KEY`}),` as an additional fallback.`]}),`\n`,_jsx(_components.li,{children:`The same key list is deduplicated before use.`}),`\n`,_jsxs(_components.li,{children:[`Agdi retries with the next key only for rate-limit errors (for example\n`,_jsx(_components.code,{children:`429`}),`, `,_jsx(_components.code,{children:`rate_limit`}),`, `,_jsx(_components.code,{children:`quota`}),`, `,_jsx(_components.code,{children:`resource exhausted`}),`).`]}),`\n`,_jsx(_components.li,{children:`Non-rate-limit errors are not retried with alternate keys.`}),`\n`,_jsx(_components.li,{children:`If all keys fail, the final error from the last attempt is returned.`}),`\n`]}),`\n`,_jsx(Heading,{level:`2`,id:`controlling-which-credential-is-used`,children:`Controlling which credential is used`}),`\n`,_jsx(Heading,{level:`3`,id:`per-session-chat-command`,children:`Per-session (chat command)`}),`\n`,_jsxs(_components.p,{children:[`Use `,_jsx(_components.code,{children:`/model \u003calias-or-id>@\u003cprofileId>`}),` to pin a specific provider credential for the current session (example profile ids: `,_jsx(_components.code,{children:`anthropic:default`}),`, `,_jsx(_components.code,{children:`anthropic:work`}),`).`]}),`\n`,_jsxs(_components.p,{children:[`Use `,_jsx(_components.code,{children:`/model`}),` (or `,_jsx(_components.code,{children:`/model list`}),`) for a compact picker; use `,_jsx(_components.code,{children:`/model status`}),` for the full view (candidates + next auth profile, plus provider endpoint details when configured).`]}),`\n`,_jsx(Heading,{level:`3`,id:`per-agent-cli-override`,children:`Per-agent (CLI override)`}),`\n`,_jsxs(_components.p,{children:[`Set an explicit auth profile order override for an agent (stored in that agent’s `,_jsx(_components.code,{children:`auth-profiles.json`}),`):`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`3`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes min-light min-dark`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#1f1f1f`,color:`#24292eff`,\"--shiki-dark\":`#b392f0`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`3`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#6F42C1`,\"--shiki-dark\":`#B392F0`},children:`agdi`}),_jsx(_components.span,{style:{color:`#2B5581`,\"--shiki-dark\":`#9DB1C5`},children:` models`}),_jsx(_components.span,{style:{color:`#2B5581`,\"--shiki-dark\":`#9DB1C5`},children:` auth`}),_jsx(_components.span,{style:{color:`#2B5581`,\"--shiki-dark\":`#9DB1C5`},children:` order`}),_jsx(_components.span,{style:{color:`#2B5581`,\"--shiki-dark\":`#9DB1C5`},children:` get`}),_jsx(_components.span,{style:{color:`#2B5581`,\"--shiki-dark\":`#9DB1C5`},children:` --provider`}),_jsx(_components.span,{style:{color:`#2B5581`,\"--shiki-dark\":`#9DB1C5`},children:` anthropic`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#6F42C1`,\"--shiki-dark\":`#B392F0`},children:`agdi`}),_jsx(_components.span,{style:{color:`#2B5581`,\"--shiki-dark\":`#9DB1C5`},children:` models`}),_jsx(_components.span,{style:{color:`#2B5581`,\"--shiki-dark\":`#9DB1C5`},children:` auth`}),_jsx(_components.span,{style:{color:`#2B5581`,\"--shiki-dark\":`#9DB1C5`},children:` order`}),_jsx(_components.span,{style:{color:`#2B5581`,\"--shiki-dark\":`#9DB1C5`},children:` set`}),_jsx(_components.span,{style:{color:`#2B5581`,\"--shiki-dark\":`#9DB1C5`},children:` --provider`}),_jsx(_components.span,{style:{color:`#2B5581`,\"--shiki-dark\":`#9DB1C5`},children:` anthropic`}),_jsx(_components.span,{style:{color:`#2B5581`,\"--shiki-dark\":`#9DB1C5`},children:` anthropic:default`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#6F42C1`,\"--shiki-dark\":`#B392F0`},children:`agdi`}),_jsx(_components.span,{style:{color:`#2B5581`,\"--shiki-dark\":`#9DB1C5`},children:` models`}),_jsx(_components.span,{style:{color:`#2B5581`,\"--shiki-dark\":`#9DB1C5`},children:` auth`}),_jsx(_components.span,{style:{color:`#2B5581`,\"--shiki-dark\":`#9DB1C5`},children:` order`}),_jsx(_components.span,{style:{color:`#2B5581`,\"--shiki-dark\":`#9DB1C5`},children:` clear`}),_jsx(_components.span,{style:{color:`#2B5581`,\"--shiki-dark\":`#9DB1C5`},children:` --provider`}),_jsx(_components.span,{style:{color:`#2B5581`,\"--shiki-dark\":`#9DB1C5`},children:` anthropic`})]}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[`Use `,_jsx(_components.code,{children:`--agent \u003cid>`}),` to target a specific agent; omit it to use the configured default agent.`]}),`\n`,_jsx(Heading,{level:`2`,id:`troubleshooting`,children:`Troubleshooting`}),`\n`,_jsx(Heading,{level:`3`,id:`”no-credentials-found”`,children:`”No credentials found”`}),`\n`,_jsxs(_components.p,{children:[`If the Anthropic token profile is missing, run `,_jsx(_components.code,{children:`claude setup-token`}),` on the\n`,_jsx(_components.strong,{children:`gateway host`}),`, then re-check:`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`1`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes min-light min-dark`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#1f1f1f`,color:`#24292eff`,\"--shiki-dark\":`#b392f0`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`1`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#6F42C1`,\"--shiki-dark\":`#B392F0`},children:`agdi`}),_jsx(_components.span,{style:{color:`#2B5581`,\"--shiki-dark\":`#9DB1C5`},children:` models`}),_jsx(_components.span,{style:{color:`#2B5581`,\"--shiki-dark\":`#9DB1C5`},children:` status`})]}),`\n`]})})}),`\n`,_jsx(Heading,{level:`3`,id:`token-expiring/expired`,children:`Token expiring/expired`}),`\n`,_jsxs(_components.p,{children:[`Run `,_jsx(_components.code,{children:`agdi models status`}),` to confirm which profile is expiring. If the profile\nis missing, rerun `,_jsx(_components.code,{children:`claude setup-token`}),` and paste the token again.`]}),`\n`,_jsx(Heading,{level:`2`,id:`requirements`,children:`Requirements`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[`Anthropic subscription account (for `,_jsx(_components.code,{children:`claude setup-token`}),`)`]}),`\n`,_jsxs(_components.li,{children:[`Claude Code CLI installed (`,_jsx(_components.code,{children:`claude`}),` command available)`]}),`\n`]})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent};function _missingMdxReference(id,component){throw new Error(`Expected `+(component?`component`:`object`)+\" `\"+id+\"` to be defined: you likely forgot to import, pass, or provide it.\")}","frontmatter":{},"scope":{"codeStyling":{"theme":{"light":"min-light","dark":"min-dark"}},"config":{},"pageMetadata":{"summary":"Model authentication: OAuth, API keys, and setup-token","read_when":["Debugging model auth or OAuth expiry","Documenting authentication or credential storage"],"title":"Authentication","description":null,"href":"/gateway/authentication"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"Authentication","slug":"authentication","depth":1,"children":[]},{"title":"Recommended setup (API key, any provider)","slug":"recommended-setup-api-key-any-provider","depth":2,"children":[]},{"title":"Anthropic: setup-token (subscription auth)","slug":"anthropic-setup-token-subscription-auth","depth":2,"children":[]},{"title":"Checking model auth status","slug":"checking-model-auth-status","depth":2,"children":[]},{"title":"API key rotation behavior (gateway)","slug":"api-key-rotation-behavior-gateway","depth":2,"children":[]},{"title":"Controlling which credential is used","slug":"controlling-which-credential-is-used","depth":2,"children":[{"title":"Per-session (chat command)","slug":"per-session-chat-command","depth":3,"children":[]},{"title":"Per-agent (CLI override)","slug":"per-agent-cli-override","depth":3,"children":[]}]},{"title":"Troubleshooting","slug":"troubleshooting","depth":2,"children":[{"title":"”No credentials found”","slug":"”no-credentials-found”","depth":3,"children":[]},{"title":"Token expiring/expired","slug":"token-expiring/expired","depth":3,"children":[]}]},{"title":"Requirements","slug":"requirements","depth":2,"children":[]}],"codeExamples":{}},"jsLinks":["/_mintlify/custom/agdiai-597e782f/27fa1e35cfee10a0/nav-tabs-underline.js"],"subdomain":"agdiai-597e782f","siteName":"Agdi","title":"Authentication - Agdi","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{"en":{"href":"/gateway/authentication","matchLevel":0},"zh-Hans":{"href":"/zh-CN/gateway/authentication","matchLevel":1},"ja":{"href":"/ja-JP","matchLevel":4}}},"lastModified":"2026-05-19T00:09:28.456Z","originalFileLocation":"gateway/authentication.md","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=\"application-name\" content=\"Agdi\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/agdiai-597e782f/RRAJpq1o960cFJkG/_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/agdiai-597e782f/RRAJpq1o960cFJkG/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/agdiai-597e782f/RRAJpq1o960cFJkG/_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/agdiai-597e782f/RRAJpq1o960cFJkG/_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/agdiai-597e782f/RRAJpq1o960cFJkG/_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/agdiai-597e782f/RRAJpq1o960cFJkG/_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/agdiai-597e782f/RRAJpq1o960cFJkG/_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/agdiai-597e782f/RRAJpq1o960cFJkG/_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/agdiai-597e782f/RRAJpq1o960cFJkG/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Authentication - Agdi\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"Agdi\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://agdiai-597e782f.mintlify.app/gateway/authentication\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://agdiai-597e782f.mintlify.site/_mintlify/api/og/v2?division=Configuration+and+operations\u0026amp;title=Authentication\u0026amp;theme=5f7e62ada99f9144d8a99b50\u0026amp;signature=ed6ef48c5f687c9aab39fee4aafb789c0ebef7944c97654f6be10b27948b26eb\">\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=\"Authentication - Agdi\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://agdiai-597e782f.mintlify.site/_mintlify/api/og/v2?division=Configuration+and+operations\u0026amp;title=Authentication\u0026amp;theme=5f7e62ada99f9144d8a99b50\u0026amp;signature=ed6ef48c5f687c9aab39fee4aafb789c0ebef7944c97654f6be10b27948b26eb\">\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/agdiai-597e782f/RRAJpq1o960cFJkG/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"Agdi\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#2D7FF5\">\u003clink data-mint-head rel=\"canonical\" href=\"https://agdiai-597e782f.mintlify.app/gateway/authentication\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/gateway/authentication.md\">\u003clink data-mint-head rel=\"alternate\" hreflang=\"en\" href=\"https://agdiai-597e782f.mintlify.app/gateway/authentication\">\u003clink data-mint-head rel=\"alternate\" hreflang=\"zh-Hans\" href=\"https://agdiai-597e782f.mintlify.app/zh-CN/gateway/authentication\">\u003clink data-mint-head rel=\"alternate\" hreflang=\"x-default\" href=\"https://agdiai-597e782f.mintlify.app/gateway/authentication\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://agdiai-597e782f.mintlify.app/#organization\",\"name\":\"Agdi\",\"url\":\"https://agdiai-597e782f.mintlify.app\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/agdiai-597e782f/655WPadtB96t29Rn/assets/agdi-mark.svg?fit=max\u0026auto=format\u0026n=655WPadtB96t29Rn\u0026q=85\u0026s=6ee0846be8797573d4bffde5f0eff316\"}},{\"@type\":\"WebSite\",\"@id\":\"https://agdiai-597e782f.mintlify.app#website\",\"name\":\"Agdi\",\"url\":\"https://agdiai-597e782f.mintlify.app\",\"publisher\":{\"@id\":\"https://agdiai-597e782f.mintlify.app/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://agdiai-597e782f.mintlify.app/gateway/authentication#webpage\",\"url\":\"https://agdiai-597e782f.mintlify.app/gateway/authentication\",\"name\":\"Authentication\",\"dateModified\":\"2026-05-19T00:09:28.456Z\",\"isPartOf\":{\"@id\":\"https://agdiai-597e782f.mintlify.app#website\"},\"breadcrumb\":{\"@id\":\"https://agdiai-597e782f.mintlify.app/gateway/authentication#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://agdiai-597e782f.mintlify.app/gateway/authentication#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Runtime\",\"item\":\"https://agdiai-597e782f.mintlify.app/gateway\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Configuration and operations\",\"item\":\"https://agdiai-597e782f.mintlify.app/gateway/configuration\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Authentication\",\"item\":\"https://agdiai-597e782f.mintlify.app/gateway/authentication\"}]},{\"@type\":[\"Article\",\"TechArticle\"],\"@id\":\"https://agdiai-597e782f.mintlify.app/gateway/authentication#article\",\"headline\":\"Authentication\",\"name\":\"Authentication\",\"url\":\"https://agdiai-597e782f.mintlify.app/gateway/authentication\",\"mainEntityOfPage\":{\"@id\":\"https://agdiai-597e782f.mintlify.app/gateway/authentication#webpage\"},\"dateModified\":\"2026-05-19T00:09:28.456Z\",\"publisher\":{\"@id\":\"https://agdiai-597e782f.mintlify.app/#organization\"},\"isPartOf\":{\"@id\":\"https://agdiai-597e782f.mintlify.app#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"Agdi\",\"publisher\":{\"@type\":\"Organization\",\"name\":\"Agdi\"},\"provider\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","agentPointerHref":"/gateway/authentication.md","siteName":"Agdi","nav":{"global":null,"languages":[{"language":"en","tabs":[{"tab":"Get started","pages":[{"title":"Get started","href":""}]},{"tab":"Install","pages":[{"title":"Install","href":"/install"}]},{"tab":"Channels","pages":[{"title":"Channels","href":"/channels"}]},{"tab":"Agents","pages":[{"title":"Agents","href":"/concepts/architecture"}]},{"tab":"Tools \u0026 Plugins","pages":[{"title":"Tools \u0026 Plugins","href":"/tools"}]},{"tab":"Models","pages":[{"title":"Models","href":"/providers"}]},{"tab":"Platforms","pages":[{"title":"Platforms","href":"/platforms"}]},{"tab":"Workspace \u0026 Ops","groups":[{"group":"Runtime","pages":[{"title":"Gateway Runbook","href":"/gateway"},{"group":"Configuration and operations","pages":[{"title":"Configuration","href":"/gateway/configuration"},{"title":"Configuration Reference","href":"/gateway/configuration-reference"},{"title":"Configuration Examples","description":null,"href":"/gateway/configuration-examples"},{"title":"Authentication","href":"/gateway/authentication"},{"title":"Auth Credential Semantics","description":null,"href":"/auth-credential-semantics"},{"title":"Secrets Management","href":"/gateway/secrets"},{"title":"Secrets Apply Plan Contract","href":"/gateway/secrets-plan-contract"},{"title":"Trusted Proxy Auth","href":"/gateway/trusted-proxy-auth"},{"title":"Health Checks","href":"/gateway/health"},{"title":"Heartbeat","href":"/gateway/heartbeat"},{"title":"Doctor","href":"/gateway/doctor"},{"title":"Gateway Logging","href":"/gateway/logging"},{"title":"Logging Overview","href":"/logging"},{"title":"Gateway Lock","href":"/gateway/gateway-lock"},{"title":"Background Exec and Process Tool","href":"/gateway/background-process"},{"title":"Multiple Gateways","href":"/gateway/multiple-gateways"},{"title":"Troubleshooting","href":"/gateway/troubleshooting"}]},{"group":"Security and sandboxing","pages":[{"title":"Security","href":"/gateway/security/index"},{"title":"Sandboxing","href":"/gateway/sandboxing"},{"title":"OpenShell","href":"/gateway/openshell"},{"title":"Sandbox vs Tool Policy vs Elevated","href":"/gateway/sandbox-vs-tool-policy-vs-elevated"}]},{"group":"Protocols and APIs","pages":[{"title":"Gateway Protocol","href":"/gateway/protocol"},{"title":"Bridge Protocol","href":"/gateway/bridge-protocol"},{"title":"OpenAI Chat Completions","href":"/gateway/openai-http-api"},{"title":"OpenResponses API","href":"/gateway/openresponses-http-api"},{"title":"Tools Invoke API","href":"/gateway/tools-invoke-http-api"},{"title":"CLI Backends","href":"/gateway/cli-backends"},{"title":"Local Models","href":"/gateway/local-models"}]},{"group":"Networking and discovery","pages":[{"title":"Network","href":"/network"},{"title":"Network model","href":"/gateway/network-model"},{"title":"Gateway-Owned Pairing","href":"/gateway/pairing"},{"title":"Discovery and Transports","href":"/gateway/discovery"},{"title":"Bonjour Discovery","href":"/gateway/bonjour"}]}]},{"group":"Remote access","pages":[{"title":"Remote Access","href":"/gateway/remote"},{"title":"Remote Gateway Setup","href":"/gateway/remote-gateway-readme"},{"title":"Tailscale","href":"/gateway/tailscale"}]},{"group":"Security","pages":[{"title":"Formal Verification (Security Models)","href":"/security/formal-verification"},{"title":"Threat Model (MITRE ATLAS)","href":"/security/THREAT-MODEL-ATLAS"},{"title":"Contributing to the Threat Model","href":"/security/CONTRIBUTING-THREAT-MODEL"}]},{"group":"Nodes and devices","pages":[{"title":"Nodes","href":"/nodes/index"},{"title":"Node Troubleshooting","href":"/nodes/troubleshooting"},{"title":"Media Understanding","href":"/nodes/media-understanding"},{"title":"Image and Media Support","href":"/nodes/images"},{"title":"Audio and Voice Notes","href":"/nodes/audio"},{"title":"Camera Capture","href":"/nodes/camera"},{"title":"Talk Mode","href":"/nodes/talk"},{"title":"Voice Wake","href":"/nodes/voicewake"},{"title":"Location Command","href":"/nodes/location-command"},{"title":"Text-to-Speech","href":"/tools/tts"}]},{"group":"Web interfaces","pages":[{"title":"Web","href":"/web/index"},{"title":"Control UI","href":"/web/control-ui"},{"title":"Dashboard","href":"/web/dashboard"},{"title":"WebChat","href":"/web/webchat"},{"title":"TUI","href":"/web/tui"}]}]},{"tab":"Reference","pages":[{"title":"Reference","href":"/cli"}]},{"tab":"Help","pages":[{"title":"Help","href":"/help"}]}]},{"language":"zh-Hans","pages":[{"title":"zh-Hans","href":"/zh-CN/gateway/authentication"}]},{"language":"ja","pages":[{"title":"ja","href":"/ja-JP"}]}]},"basePath":"","title":"Authentication - Agdi","buildId":"dpl_Fyv1NbzwP68g2bEH2Roy98uY1zmE","deploymentId":"dpl_Fyv1NbzwP68g2bEH2Roy98uY1zmE","dynamics":[],"chunks":[]}