Use OpenCode with Bifrost through a generated provider, Enterprise SSO, or a virtual key.
OpenCode is a terminal coding agent that supports custom
providers. Bifrost CLI generates an isolated OpenCode provider for the selected
gateway model.
OpenCode sends x-session-affinity and x-session-id on every request, so a
session sticks to the provider and key that served it and keeps hitting the same
prompt cache, with nothing to configure. See
Session Affinity.
bifrost context add production \ --base-url https://gateway.example.com \ --use# Enterprise user-scoped inferencebifrost auth login# Or configure a virtual keyprintf '%s\n' "$BIFROST_VIRTUAL_KEY" | bifrost auth set-virtual-key --stdinbifrost run opencode --model openai/gpt-5
Bifrost creates a temporary OpenCode runtime configuration with:
a provider named bifrost;
the Bifrost /openai endpoint;
the selected provider-qualified model; and
the effective SSO agent token or virtual key.
OpenCode sees the selected model as bifrost/<provider>/<model>, for example
bifrost/openai/gpt-5. The temporary configuration is removed when the process
exits.Enterprise SSO and virtual keys are both supported.
OpenCode receives one agent access token when it starts. If a long-running
session reaches token expiry, exit and relaunch it through Bifrost so the CLI
can refresh the Enterprise session first.
Bifrost’s generated OpenCode provider contains the model selected when the
harness starts. Relaunch from the Bifrost chooser or command line to use a model
that is not in that generated provider:
bifrost run opencode --model anthropic/claude-sonnet-4-6
The target must support the tool calls and streaming behavior OpenCode uses for
file access, terminal commands, and editing.
The OpenCode conversation, prompt boxes, activity lines, and model footer are
rendered by OpenCode. Harnesses selected through bifrost launch receive native
terminal passthrough, matching the rendering used by bifrost opencode.
The optional bifrost launch --tabs mode uses Bifrost’s virtual terminal and
may render modern terminal features differently.Bifrost currently checks ~/.config/opencode/tui.json. If that file has no
explicit theme, Bifrost supplies a temporary OpenCode TUI configuration with:
{ "theme": "system"}
OpenCode’s system theme uses the terminal ANSI palette and background. It can
therefore have low contrast on some terminal palettes even though Bifrost does
not reinterpret the harness output.To keep the normal OpenCode appearance, create
~/.config/opencode/tui.json:
You can replace opencode with another built-in or custom OpenCode theme. Use
tui.json for the launcher-detected global setting; TUI options are separate
from the provider settings in opencode.json.
Check the model/provider shown in OpenCode’s footer. A Bifrost-launched model
should use the generated bifrost/... provider. If OpenCode is using its native
Google provider instead, relaunch with:
bifrost run opencode --model gemini/gemini-2.5-pro
This is separate from Gemini CLI’s authentication behavior.
OpenCode traffic through Bifrost is logged and attributed to the selected
provider, model, user or virtual key, and application. Use the Bifrost logs view
or bifrost logs list to inspect it.
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/schema.json","name":"Bifrost","colors":{"primary":"#0C3B43","light":"#07C983"},"logo":{"light":"https://mintcdn.com/bifrost/qFMmk8bNSnvgFYDI/media/bifrost-logo.png?fit=max\u0026auto=format\u0026n=qFMmk8bNSnvgFYDI\u0026q=85\u0026s=6af701a560aee4103444fa017b226cf0","dark":"https://mintcdn.com/bifrost/qFMmk8bNSnvgFYDI/media/bifrost-logo-dark.png?fit=max\u0026auto=format\u0026n=qFMmk8bNSnvgFYDI\u0026q=85\u0026s=84d264aad5f421c526dd17893e7c5739"},"favicon":"https://mintcdn.com/bifrost/qFMmk8bNSnvgFYDI/favicon.ico?fit=max\u0026auto=format\u0026n=qFMmk8bNSnvgFYDI\u0026q=85\u0026s=a57bad8c37d798efcb53dca5d96d8b45","navbar":{"links":[{"href":"https://www.getmaxim.ai/enterprise?utm_source=bifrost_docs\u0026utm_medium=Bifrost_Navbar#free-license","label":"Request License"}],"primary":{"type":"button","label":"Book a Demo","href":"https://www.getmaxim.ai/book-a-demo?utm_source=bifrost_docs\u0026utm_medium=Bifrost_Navbar"}},"footer":{"socials":{"x":"https://x.com/getbifrost","linkedin":"https://linkedin.com/company/maxim-ai","github":"https://github.com/maximhq/bifrost"},"links":[{"header":"Company","items":[{"label":"Book a Demo","href":"https://www.getmaxim.ai/book-a-demo?utm_source=bifrost_docs\u0026utm_medium=Bifrost_Footer"},{"label":"Partner Program","href":"https://www.getmaxim.ai/partners-program?utm_source=bifrost_docs\u0026utm_medium=Bifrost_Footer"},{"label":"Careers","href":"https://www.getmaxim.ai/careers?utm_source=bifrost_docs\u0026utm_medium=Bifrost_Footer"},{"label":"Contact Us","href":"mailto:[email protected]"},{"label":"Security","href":"https://docs.getbifrost.ai/security"},{"label":"Trust Center","href":"https://trust.getmaxim.ai/"},{"label":"Terms of Service","href":"https://www.getmaxim.ai/terms-of-service?utm_source=bifrost_docs\u0026utm_medium=Bifrost_Footer"},{"label":"Privacy Policy","href":"https://www.getmaxim.ai/privacy-policy?utm_source=bifrost_docs\u0026utm_medium=Bifrost_Footer"}]},{"header":"Products","items":[{"label":"LLM Gateway","href":"https://www.getmaxim.ai/llm-gateway?utm_source=bifrost_docs\u0026utm_medium=Bifrost_Footer"},{"label":"MCP Gateway","href":"https://www.getmaxim.ai/mcp-gateway?utm_source=bifrost_docs\u0026utm_medium=Bifrost_Footer"},{"label":"Governance","href":"https://www.getmaxim.ai/ai-governance?utm_source=bifrost_docs\u0026utm_medium=Bifrost_Footer"},{"label":"Guardrails","href":"https://www.getmaxim.ai/ai-guardrails?utm_source=bifrost_docs\u0026utm_medium=Bifrost_Footer"},{"label":"Observability","href":"https://www.getmaxim.ai/ai-observability?utm_source=bifrost_docs\u0026utm_medium=Bifrost_Footer"},{"label":"Bifrost Edge","href":"https://www.getmaxim.ai/edge?utm_source=bifrost_docs\u0026utm_medium=Bifrost_Footer"}]},{"header":"Resources","items":[{"label":"Bifrost Enterprise","href":"https://www.getmaxim.ai/enterprise?utm_source=bifrost_docs\u0026utm_medium=Bifrost_Footer"},{"label":"Performance Benchmarks","href":"https://www.getmaxim.ai/bifrost/resources/benchmarks?utm_source=bifrost_docs\u0026utm_medium=Bifrost_Footer"},{"label":"LLM Gateway Buyer's Guide","href":"https://www.getmaxim.ai/bifrost/resources/buyers-guide?utm_source=bifrost_docs\u0026utm_medium=Bifrost_Footer"},{"label":"Claude Code Integration","href":"https://www.getmaxim.ai/bifrost/resources/claude-code?utm_source=bifrost_docs\u0026utm_medium=Bifrost_Footer"},{"label":"Migrating from LiteLLM","href":"https://www.getmaxim.ai/bifrost/resources/migrating-from-litellm?utm_source=bifrost_docs\u0026utm_medium=Bifrost_Footer"},{"label":"Blogs","href":"https://www.getmaxim.ai/bifrost/blog?utm_source=bifrost_docs\u0026utm_medium=Bifrost_Footer"}]},{"header":"For LLMs","items":[{"label":"llms-full.txt","href":"https://docs.getbifrost.ai/llms-full.txt"},{"label":"llms.txt","href":"https://docs.getbifrost.ai/llms.txt"},{"label":"llm-info","href":"https://www.getmaxim.ai/llm-info?utm_source=bifrost_docs\u0026utm_medium=Bifrost_Footer"}]}]},"styling":{"latex":true},"navigation":{"global":{"anchors":[{"anchor":"Discord","icon":"discord","href":"https://discord.gg/exN5KAydbU"},{"anchor":"GitHub","icon":"github","href":"https://github.com/maximhq/bifrost"},{"anchor":"Try Enterprise","icon":"building","href":"https://www.getmaxim.ai/bifrost/enterprise"}]},"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"bifrost","hasAudioNarration":false,"actualSubdomain":"bifrost","customDomains":["docs.getbifrost.ai"],"gitSource":{"type":"github","owner":"maximhq","repo":"bifrost","deployBranch":"main","contentDirectory":"docs","isPrivate":true,"mountPath":"","label":""},"chroma":{"liveDeploymentHistoryId":"6ad8fd602935fc338a4fe596","collectionId":"986aa4ff-c7f8-4478-a290-044dc988ad79","schemaVersion":"v3","latestBuiltDeploymentHistoryId":"6ad8fd602935fc338a4fe596"},"feedback":{"thumbs":true},"entitlements":{"AI_CHAT":{"status":"ENABLED"},"WEB_MCP":{"status":"ENABLED"},"NARRATION":{"status":"ENABLED"}},"buildId":"6ad8fd602935fc338a4fe596","clientVersion":"0.0.3965","searchFilterCounts":[{"language":"default","tag":"API","count":665},{"language":"default","tag":"Changelogs","count":313},{"language":"default","tag":"Integrations","count":248},{"language":"default","tag":"Platform","count":212},{"language":"default","tag":"Open Source","count":163},{"language":"default","tag":"OSS","count":141},{"language":"default","tag":"Governance","count":132},{"language":"default","tag":"Enterprise","count":101},{"language":"default","tag":"Helm","count":74},{"language":"default","tag":"Inference","count":71}]},"assistantConfig":{},"hasChatPermissions":true,"hasWebMcpPermissions":true,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-mintlify-slack","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-v7-file-tree","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-integrations-settings","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-pr-grouping","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-prefix","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"analytics-v7","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"user-flows-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"no-publish-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-onboarding","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"pause-universal-search-reconcile","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving-live","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"stripTemperatureMiddleware","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"per-site-search-delta","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"support-platform-pylon-zendesk","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"instant-rollback","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications-server","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-private-page-search","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-fable","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fixed-ai-action-pricing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automation-resolve-merge-conflict","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"scoped-publishing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"mintql","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"page-level-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-version-history-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-nav-generations","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-page-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workspace-projects","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"assistant-v5","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"byok-sep-25","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fork-pr-previews","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"revalidation-jwt","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"vite-origin","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-agent-model-picker","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-updated-9-15","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"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}],"isAtlas":false,"googleFontsInlined":false},"customCss":[{"filePath":"style.css","content":".nav-logo{height:1.5rem}div:has(>nav[aria-label=Main]){gap:1.5rem}nav[aria-label=Main]>ul{gap:1rem}nav[aria-label=Main] a[href*=book-a-demo]{padding:.4375rem .625rem}nav[aria-label=Main] a[href*=book-a-demo] svg{display:none}div:has(>nav[aria-label=Main])>*,nav[aria-label=Main]>ul>*{margin-inline:0}nav[aria-label=Main] .navbar-link a[href*=\"#free-license\"]{display:inline-flex;align-items:center;border:1px solid rgb(var(--primary-dark));border-radius:.75rem;box-sizing:border-box;padding:calc(.4375rem - 1px) .625rem;color:rgb(var(--primary-dark));background:0 0;font-size:.875rem;font-weight:500;line-height:1.25rem}nav[aria-label=Main] .navbar-link a[href*=\"#free-license\"]:hover{background-color:rgb(var(--primary-dark)/.1)}.dark nav[aria-label=Main] .navbar-link a[href*=\"#free-license\"]{border-color:rgb(var(--primary-light));color:rgb(var(--primary-light))}.dark nav[aria-label=Main] .navbar-link a[href*=\"#free-license\"]:hover{background-color:rgb(var(--primary-light)/.12)}#sidebar-group>li>button>div{line-height:normal}.footer-compliance{display:flex;align-items:center;flex-wrap:wrap;gap:.5rem;max-width:100%}.footer-compliance img{width:2.5rem;height:2.5rem;flex:none;object-fit:contain}@media (max-width:767px){footer.advanced-footer>div>div:first-child>div:first-child{flex-direction:column;align-items:flex-start;justify-content:flex-start;row-gap:1rem;width:100%;height:auto}footer.advanced-footer>div>div:first-child>div:first-child>div:last-child{justify-content:flex-start;min-width:0;max-width:100%}footer.advanced-footer a[class*=truncate],footer.advanced-footer>div>div:first-child>div:last-child,footer.advanced-footer>div>div:first-child>div:last-child>div{white-space:normal!important}}@media (min-width:768px){footer.advanced-footer>div>div:first-child{justify-content:flex-start;column-gap:3rem}footer.advanced-footer>div>div:first-child>div:first-child{min-width:0;justify-content:flex-start;align-items:flex-start;row-gap:1.25rem}footer.advanced-footer>div>div:first-child>div:first-child>div:last-child{margin-top:auto}footer.advanced-footer>div>div:first-child>div:last-child{flex:0 1 auto;justify-content:start;grid-template-columns:repeat(4,max-content)!important;column-gap:4rem!important}footer.advanced-footer>div>div:first-child>div:last-child>div{align-items:flex-start;width:auto;flex:none}footer.advanced-footer a[class*=truncate]{max-width:none!important;overflow:visible!important;text-overflow:unset!important;white-space:nowrap!important}}"}],"page":{"pagePath":"cli-agents/opencode","slug":"/cli-agents/opencode","pageMetadata":{"title":"OpenCode","description":"Use OpenCode with Bifrost through a generated provider, Enterprise SSO, or a virtual key.","icon":"codepen","href":"/cli-agents/opencode"},"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: \"Use OpenCode with Bifrost through a generated provider, Enterprise SSO, or a virtual key.\"\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`,li:`li`,p:`p`,pre:`pre`,span:`span`,ul:`ul`,..._provideComponents(),...props.components},{CodeBlock,Heading,Tip,Warning}=_components;if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!Tip)_missingMdxReference(`Tip`,true);if(!Warning)_missingMdxReference(`Warning`,true);return _jsxs(_Fragment,{children:[_jsxs(_components.p,{children:[_jsx(_components.a,{href:`https://opencode.ai/`,children:`OpenCode`}),` is a terminal coding agent that supports custom\nproviders. Bifrost CLI generates an isolated OpenCode provider for the selected\ngateway model.`]}),`\n`,_jsx(Tip,{children:_jsxs(_components.p,{children:[`OpenCode sends `,_jsx(_components.code,{children:`x-session-affinity`}),` and `,_jsx(_components.code,{children:`x-session-id`}),` on every request, so a\nsession sticks to the provider and key that served it and keeps hitting the same\nprompt cache, with nothing to configure. See\n`,_jsx(_components.a,{href:`/providers/session-affinity`,children:`Session Affinity`}),`.`]})}),`\n`,_jsx(Heading,{level:`2`,id:`recommended-launch-with-bifrost-cli`,children:`Recommended: launch with Bifrost CLI`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`12`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`12`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`bifrost`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` context`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` add`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` production`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` --base-url`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` https://gateway.example.com`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` --use`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`# Enterprise user-scoped inference`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`bifrost`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` auth`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` login`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`# Or configure a virtual key`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#DCDCAA`},children:`printf`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` '%s\\\\n'`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`$BIFROST_VIRTUAL_KEY`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` |`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:` bifrost`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` auth`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` set-virtual-key`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` --stdin`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`bifrost`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` run`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` opencode`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` --model`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` openai/gpt-5`})]}),`\n`]})})}),`\n`,_jsx(_components.p,{children:`Bifrost creates a temporary OpenCode runtime configuration with:`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[`a provider named `,_jsx(_components.code,{children:`bifrost`}),`;`]}),`\n`,_jsxs(_components.li,{children:[`the Bifrost `,_jsx(_components.code,{children:`/openai`}),` endpoint;`]}),`\n`,_jsx(_components.li,{children:`the selected provider-qualified model; and`}),`\n`,_jsx(_components.li,{children:`the effective SSO agent token or virtual key.`}),`\n`]}),`\n`,_jsxs(_components.p,{children:[`OpenCode sees the selected model as `,_jsx(_components.code,{children:`bifrost/\u003cprovider>/\u003cmodel>`}),`, for example\n`,_jsx(_components.code,{children:`bifrost/openai/gpt-5`}),`. The temporary configuration is removed when the process\nexits.`]}),`\n`,_jsx(_components.p,{children:`Enterprise SSO and virtual keys are both supported.`}),`\n`,_jsx(Warning,{children:_jsx(_components.p,{children:`OpenCode receives one agent access token when it starts. If a long-running\nsession reaches token expiry, exit and relaunch it through Bifrost so the CLI\ncan refresh the Enterprise session first.`})}),`\n`,_jsx(Heading,{level:`2`,id:`configure-opencode-manually-with-a-virtual-key`,children:`Configure OpenCode manually with a virtual key`}),`\n`,_jsxs(_components.p,{children:[`Create or update `,_jsx(_components.code,{children:`~/.config/opencode/opencode.json`}),`:`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`19`,language:`jsonc`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`jsonc`,children:_jsxs(_components.code,{language:`jsonc`,numberOfLines:`19`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"$schema\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"https://opencode.ai/config.json\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"model\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"bifrost/openai/gpt-5\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"provider\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"bifrost\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"npm\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"@ai-sdk/openai-compatible\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"name\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"Bifrost\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"options\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"baseURL\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"http://localhost:8080/openai\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"apiKey\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"your-bifrost-virtual-key\"`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` },`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"models\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"openai/gpt-5\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: {},`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"anthropic/claude-sonnet-4-6\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: {},`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"gemini/gemini-2.5-pro\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: {}`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`]})})}),`\n`,_jsx(_components.p,{children:`Use the provider/model pair as OpenCode’s model reference:`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`4`,language:`text`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`text`,children:_jsxs(_components.code,{language:`text`,numberOfLines:`4`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`bifrost/openai/gpt-5`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`bifrost/anthropic/claude-sonnet-4-6`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`bifrost/gemini/gemini-2.5-pro`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})})]})})}),`\n`,_jsx(_components.p,{children:`When configuring multiple teams or environments, use a separate Bifrost virtual\nkey for each required governance boundary.`}),`\n`,_jsx(Heading,{level:`2`,id:`model-selection`,children:`Model selection`}),`\n`,_jsx(_components.p,{children:`Bifrost’s generated OpenCode provider contains the model selected when the\nharness starts. Relaunch from the Bifrost chooser or command line to use a model\nthat is not in that generated provider:`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`1`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`1`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`bifrost`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` run`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` opencode`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` --model`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` anthropic/claude-sonnet-4-6`})]}),`\n`]})})}),`\n`,_jsx(_components.p,{children:`The target must support the tool calls and streaming behavior OpenCode uses for\nfile access, terminal commands, and editing.`}),`\n`,_jsx(Heading,{level:`2`,id:`theme-and-terminal-appearance`,children:`Theme and terminal appearance`}),`\n`,_jsxs(_components.p,{children:[`The OpenCode conversation, prompt boxes, activity lines, and model footer are\nrendered by OpenCode. Harnesses selected through `,_jsx(_components.code,{children:`bifrost launch`}),` receive native\nterminal passthrough, matching the rendering used by `,_jsx(_components.code,{children:`bifrost opencode`}),`.\nThe optional `,_jsx(_components.code,{children:`bifrost launch --tabs`}),` mode uses Bifrost’s virtual terminal and\nmay render modern terminal features differently.`]}),`\n`,_jsxs(_components.p,{children:[`Bifrost currently checks `,_jsx(_components.code,{children:`~/.config/opencode/tui.json`}),`. If that file has no\nexplicit theme, Bifrost supplies a temporary OpenCode TUI configuration with:`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`3`,language:`json`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`json`,children:_jsxs(_components.code,{language:`json`,numberOfLines:`3`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"theme\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"system\"`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[`OpenCode’s `,_jsx(_components.code,{children:`system`}),` theme uses the terminal ANSI palette and background. It can\ntherefore have low contrast on some terminal palettes even though Bifrost does\nnot reinterpret the harness output.`]}),`\n`,_jsxs(_components.p,{children:[`To keep the normal OpenCode appearance, create\n`,_jsx(_components.code,{children:`~/.config/opencode/tui.json`}),`:`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`4`,language:`json`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`json`,children:_jsxs(_components.code,{language:`json`,numberOfLines:`4`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"$schema\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"https://opencode.ai/tui.json\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"theme\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"opencode\"`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[`You can replace `,_jsx(_components.code,{children:`opencode`}),` with another built-in or custom OpenCode theme. Use\n`,_jsx(_components.code,{children:`tui.json`}),` for the launcher-detected global setting; TUI options are separate\nfrom the provider settings in `,_jsx(_components.code,{children:`opencode.json`}),`.`]}),`\n`,_jsx(Heading,{level:`2`,id:`troubleshooting`,children:`Troubleshooting`}),`\n`,_jsx(Heading,{level:`3`,id:`opencode-reports-a-google-api-key-is-missing`,children:`OpenCode reports a Google API key is missing`}),`\n`,_jsxs(_components.p,{children:[`Check the model/provider shown in OpenCode’s footer. A Bifrost-launched model\nshould use the generated `,_jsx(_components.code,{children:`bifrost/...`}),` provider. If OpenCode is using its native\nGoogle provider instead, relaunch with:`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`1`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`1`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`bifrost`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` run`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` opencode`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` --model`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` gemini/gemini-2.5-pro`})]}),`\n`]})})}),`\n`,_jsx(_components.p,{children:`This is separate from Gemini CLI’s authentication behavior.`}),`\n`,_jsx(Heading,{level:`3`,id:`opencode-colors-look-different`,children:`OpenCode colors look different`}),`\n`,_jsxs(_components.p,{children:[`Set an explicit theme in `,_jsx(_components.code,{children:`~/.config/opencode/tui.json`}),` and restart Bifrost CLI.`]}),`\n`,_jsxs(Heading,{level:`3`,id:`401-unauthorized-during-a-long-session`,children:[_jsx(_components.code,{children:`401 Unauthorized`}),` during a long session`]}),`\n`,_jsx(_components.p,{children:`Exit and relaunch OpenCode through Bifrost. The preflight refreshes the SSO\nsession before starting the new child process.`}),`\n`,_jsx(Heading,{level:`2`,id:`observability`,children:`Observability`}),`\n`,_jsxs(_components.p,{children:[`OpenCode traffic through Bifrost is logged and attributed to the selected\nprovider, model, user or virtual key, and application. Use the Bifrost logs view\nor `,_jsx(_components.code,{children:`bifrost logs list`}),` to inspect it.`]}),`\n`,_jsx(Heading,{level:`2`,id:`next-steps`,children:`Next steps`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsx(_components.li,{children:_jsx(_components.a,{href:`/quickstart/cli/getting-started`,children:`Bifrost CLI`})}),`\n`,_jsx(_components.li,{children:_jsx(_components.a,{href:`/features/governance/virtual-keys`,children:`Virtual keys`})}),`\n`,_jsx(_components.li,{children:_jsx(_components.a,{href:`/features/observability/default`,children:`Built-in observability`})}),`\n`]})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent};function _missingMdxReference(id,component){throw new Error(`Expected `+(component?`component`:`object`)+\" `\"+id+\"` to be defined: you likely forgot to import, pass, or provide it.\")}","frontmatter":{},"scope":{"config":{},"pageMetadata":{"title":"OpenCode","description":"Use OpenCode with Bifrost through a generated provider, Enterprise SSO, or a virtual key.","icon":"codepen","href":"/cli-agents/opencode"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"Recommended: launch with Bifrost CLI","slug":"recommended-launch-with-bifrost-cli","depth":2,"children":[]},{"title":"Configure OpenCode manually with a virtual key","slug":"configure-opencode-manually-with-a-virtual-key","depth":2,"children":[]},{"title":"Model selection","slug":"model-selection","depth":2,"children":[]},{"title":"Theme and terminal appearance","slug":"theme-and-terminal-appearance","depth":2,"children":[]},{"title":"Troubleshooting","slug":"troubleshooting","depth":2,"children":[{"title":"OpenCode reports a Google API key is missing","slug":"opencode-reports-a-google-api-key-is-missing","depth":3,"children":[]},{"title":"OpenCode colors look different","slug":"opencode-colors-look-different","depth":3,"children":[]},{"title":"401 Unauthorized during a long session","slug":"401-unauthorized-during-a-long-session","depth":3,"children":[]}]},{"title":"Observability","slug":"observability","depth":2,"children":[]},{"title":"Next steps","slug":"next-steps","depth":2,"children":[]}],"codeExamples":{}},"jsLinks":["/_mintlify/custom/bifrost/62ad9b1aea461302/googleTag.js","/_mintlify/custom/bifrost/c4c9272fd1c525e5/jsonLd.js","/_mintlify/custom/bifrost/5a8b9314a2dac891/supportWidget.js","/_mintlify/custom/bifrost/088e287583b748b0/baseUrlSwitcher.js","/_mintlify/custom/bifrost/aa532cead633d329/tally-embed.js","/_mintlify/custom/bifrost/fe58824b4f1a0ad5/footerCompliance.js"],"subdomain":"bifrost","siteName":"Bifrost","title":"OpenCode - Bifrost","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-10-12T22:24:50.061Z","originalFileLocation":"cli-agents/opencode.mdx"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=null;if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"system\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"description\" content=\"Use OpenCode with Bifrost through a generated provider, Enterprise SSO, or a virtual key.\">\u003cmeta data-mint-head name=\"application-name\" content=\"Bifrost\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/bifrost/kXIL-Qs6IzN4ZLK4/_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/bifrost/kXIL-Qs6IzN4ZLK4/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/bifrost/kXIL-Qs6IzN4ZLK4/_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/bifrost/kXIL-Qs6IzN4ZLK4/_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/bifrost/kXIL-Qs6IzN4ZLK4/_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/bifrost/kXIL-Qs6IzN4ZLK4/_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/bifrost/kXIL-Qs6IzN4ZLK4/_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/bifrost/kXIL-Qs6IzN4ZLK4/_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/bifrost/kXIL-Qs6IzN4ZLK4/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"OpenCode - Bifrost\">\u003cmeta data-mint-head property=\"og:description\" content=\"Use OpenCode with Bifrost through a generated provider, Enterprise SSO, or a virtual key.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"Bifrost\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.getbifrost.ai/cli-agents/opencode\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://bifrost.mintlify.app/_mintlify/api/og/v2?division=CLI+Agents+%26+Editors\u0026amp;title=OpenCode\u0026amp;description=Use+OpenCode+with+Bifrost+through+a+generated+provider%2C+Enterprise+SSO%2C+or+a+virtual+key.\u0026amp;theme=4d1d84bec9a8c3ee0c7cd8ee\u0026amp;signature=e374a40d32454d08b40a768b5ce9ab19243ef78ba5f92923c416259a4a142839\">\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=\"OpenCode - Bifrost\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Use OpenCode with Bifrost through a generated provider, Enterprise SSO, or a virtual key.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://bifrost.mintlify.app/_mintlify/api/og/v2?division=CLI+Agents+%26+Editors\u0026amp;title=OpenCode\u0026amp;description=Use+OpenCode+with+Bifrost+through+a+generated+provider%2C+Enterprise+SSO%2C+or+a+virtual+key.\u0026amp;theme=4d1d84bec9a8c3ee0c7cd8ee\u0026amp;signature=e374a40d32454d08b40a768b5ce9ab19243ef78ba5f92923c416259a4a142839\">\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/bifrost/kXIL-Qs6IzN4ZLK4/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"Bifrost\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#0C3B43\">\u003clink data-mint-head rel=\"canonical\" href=\"https://docs.getbifrost.ai/cli-agents/opencode\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/cli-agents/opencode.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://docs.getbifrost.ai/#organization\",\"name\":\"Bifrost\",\"url\":\"https://docs.getbifrost.ai\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/bifrost/qFMmk8bNSnvgFYDI/media/bifrost-logo.png?fit=max\u0026auto=format\u0026n=qFMmk8bNSnvgFYDI\u0026q=85\u0026s=6af701a560aee4103444fa017b226cf0\"}},{\"@type\":\"WebSite\",\"@id\":\"https://docs.getbifrost.ai#website\",\"name\":\"Bifrost\",\"url\":\"https://docs.getbifrost.ai\",\"publisher\":{\"@id\":\"https://docs.getbifrost.ai/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://docs.getbifrost.ai/cli-agents/opencode#webpage\",\"url\":\"https://docs.getbifrost.ai/cli-agents/opencode\",\"name\":\"OpenCode\",\"description\":\"Use OpenCode with Bifrost through a generated provider, Enterprise SSO, or a virtual key.\",\"dateModified\":\"2026-10-12T22:24:50.061Z\",\"isPartOf\":{\"@id\":\"https://docs.getbifrost.ai#website\"},\"breadcrumb\":{\"@id\":\"https://docs.getbifrost.ai/cli-agents/opencode#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.getbifrost.ai/cli-agents/opencode#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"CLI Agents \u0026 Editors\",\"item\":\"https://docs.getbifrost.ai/cli-agents/overview\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"OpenCode\",\"item\":\"https://docs.getbifrost.ai/cli-agents/opencode\"}]},{\"@type\":[\"Article\",\"TechArticle\"],\"@id\":\"https://docs.getbifrost.ai/cli-agents/opencode#article\",\"headline\":\"OpenCode\",\"name\":\"OpenCode\",\"description\":\"Use OpenCode with Bifrost through a generated provider, Enterprise SSO, or a virtual key.\",\"url\":\"https://docs.getbifrost.ai/cli-agents/opencode\",\"mainEntityOfPage\":{\"@id\":\"https://docs.getbifrost.ai/cli-agents/opencode#webpage\"},\"dateModified\":\"2026-10-12T22:24:50.061Z\",\"publisher\":{\"@id\":\"https://docs.getbifrost.ai/#organization\"},\"isPartOf\":{\"@id\":\"https://docs.getbifrost.ai#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"Bifrost\",\"creator\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","siteName":"Bifrost","nav":{"global":{"anchors":[{"anchor":"Discord","icon":"discord","href":"https://discord.gg/exN5KAydbU"},{"anchor":"GitHub","icon":"github","href":"https://github.com/maximhq/bifrost"},{"anchor":"Try Enterprise","icon":"building","href":"https://www.getmaxim.ai/bifrost/enterprise"}]},"tabs":[{"tab":"OSS","icon":"book-open-cover","pages":[{"title":"OSS","href":"/overview"}]},{"tab":"Enterprise","icon":"building","pages":[{"title":"Enterprise","href":"/enterprise/overview"}]},{"tab":"Edge","icon":"globe","pages":[{"title":"Edge","href":"/edge/overview"}]},{"tab":"Integrations","icon":"plug","groups":[{"group":"Runbooks","icon":"book-open","pages":[{"title":"Set up Claude Code with Amazon Bedrock","icon":"star-of-life","href":"/runbooks/claude-code-bedrock"},{"title":"Set up Codex CLI with Amazon Bedrock","icon":"openai","href":"/runbooks/codex-bedrock"}]},{"group":"CLI Agents \u0026 Editors","icon":"command","pages":[{"title":"Overview","icon":"Book","href":"/cli-agents/overview"},{"title":"Cursor","icon":"arrow-pointer","href":"/cli-agents/cursor"},{"title":"LibreChat","icon":"message","href":"/cli-agents/librechat"},{"title":"Claude Code","icon":"star-of-life","href":"/cli-agents/claude-code"},{"title":"Claude Desktop","icon":"desktop","href":"/cli-agents/claude-desktop"},{"title":"Claude for Office","icon":"file-word","href":"/cli-agents/claude-for-office"},{"title":"GitHub Copilot","icon":"github","href":"/cli-agents/github-copilot"},{"title":"Codex CLI","icon":"openai","href":"/cli-agents/codex-cli"},{"title":"Gemini CLI","icon":"diamond","href":"/cli-agents/gemini-cli"},{"title":"Qwen Code","description":"Use Alibaba's Qwen Code with Bifrost for AI-powered coding with any provider, virtual keys, and observability.","icon":"q","href":"/cli-agents/qwen-code"},{"title":"OpenCode","icon":"codepen","href":"/cli-agents/opencode"},{"title":"Zed Editor","description":"Integrate Zed editor with Bifrost to use any AI provider for code assistance with virtual keys and observability.","icon":"z","href":"/cli-agents/zed-editor"},{"title":"Roo Code","icon":"code","href":"/cli-agents/roo-code"},{"title":"Open WebUI","icon":"globe","href":"/cli-agents/open-webui"}]},{"group":"SDKs \u0026 Frameworks","icon":"code","pages":[{"group":"OpenAI SDK","icon":"openai","pages":[{"title":"Overview","icon":"book","href":"/integrations/openai-sdk/overview"},{"title":"Files and Batch API","tag":"Beta","icon":"folder-open","href":"/integrations/openai-sdk/files-and-batch"}]},{"group":"Anthropic SDK","icon":"asterisk","pages":[{"title":"Overview","icon":"book","href":"/integrations/anthropic-sdk/overview"},{"title":"Files and Batch API","tag":"Beta","icon":"folder-open","href":"/integrations/anthropic-sdk/files-and-batch"}]},{"group":"Bedrock SDK","icon":"aws","pages":[{"title":"Overview","icon":"book","href":"/integrations/bedrock-sdk/overview"},{"title":"Files and Batch API","tag":"Beta","icon":"folder-open","href":"/integrations/bedrock-sdk/files-and-batch"}]},{"group":"GenAI SDK","icon":"diamond","pages":[{"title":"Overview","icon":"book","href":"/integrations/genai-sdk/overview"}]},{"group":"Cohere SDK","icon":"c","pages":[{"title":"Overview","icon":"book","href":"/integrations/cohere-sdk/overview"}]},{"title":"LiteLLM SDK","icon":"train","href":"/integrations/litellm-sdk"},{"title":"Langchain SDK","icon":"crow","href":"/integrations/langchain-sdk"},{"title":"Pydantic AI SDK","icon":"triangle","href":"/integrations/pydanticai-sdk"},{"title":"TypeSafe SDK","icon":"scale-balanced","href":"/integrations/typesafe-sdk"},{"title":"Passthrough","icon":"route","href":"/integrations/passthrough"}]},{"group":"Identity Providers (SSO)","icon":"id-card","pages":[{"group":"Okta","icon":"/media/okta-icon.svg","pages":[{"title":"SSO using OIDC","href":"/enterprise/setting-up-okta/oidc"},{"title":"Setup SCIM","href":"/enterprise/setting-up-okta/scim"}]},{"group":"Microsoft Entra","icon":"microsoft","pages":[{"title":"SSO using OIDC","href":"/enterprise/setting-up-entra/oidc"}]},{"group":"Zitadel","icon":"/media/zitadel-icon.svg","pages":[{"title":"SSO using OIDC","href":"/enterprise/setting-up-zitadel/oidc"}]},{"group":"Keycloak","icon":"/media/keycloak-icon.svg","pages":[{"title":"SSO using OIDC","href":"/enterprise/setting-up-keycloak/oidc"}]},{"group":"Google Workspace","icon":"google","pages":[{"title":"Setting up Google Workspace","icon":"google","href":"/enterprise/setting-up-google-workspace"}]},{"group":"Auth0","icon":"/media/auth0-icon.svg","pages":[{"title":"SSO using OIDC","href":"/enterprise/setting-up-auth0/oidc"}]},{"group":"Generic OIDC","icon":"fingerprint","pages":[{"title":"SSO using OIDC","href":"/enterprise/setting-up-generic-oidc/oidc"},{"title":"Setup SCIM","href":"/enterprise/setting-up-generic-oidc/scim"}]},{"group":"Auth Proxy","icon":"shield-halved","pages":[{"title":"Cloudflare ZTNA (Access)","href":"/enterprise/auth-proxy/cloudflare-ztna"},{"title":"AWS ALB (Application Load Balancer)","href":"/enterprise/auth-proxy/aws-alb"},{"title":"Generic OIDC Proxy","href":"/enterprise/auth-proxy/generic-proxy"}]}]},{"group":"Content Safety (Guardrails)","icon":"road-barrier","pages":[{"title":"Secrets Detection","icon":"key","href":"/enterprise/guardrails/secrets-detection"},{"title":"Prompt Guardrails","icon":"shield-check","href":"/enterprise/guardrails/prompt-guardrails"},{"title":"Custom Regex","icon":"code","href":"/enterprise/guardrails/custom-regex"},{"title":"Microsoft Presidio","icon":"microsoft","href":"/integrations/guardrails/presidio"},{"title":"Azure AI Language PII","icon":"microsoft","href":"/integrations/guardrails/azure-language-pii"},{"title":"AWS Bedrock Guardrails","icon":"aws","href":"/integrations/guardrails/aws-bedrock"},{"title":"Azure Content Safety","icon":"microsoft","href":"/integrations/guardrails/azure-content-safety"},{"title":"Google Model Armor","icon":"https://mintlify.s3.us-west-1.amazonaws.com/bifrost/media/google-model-armor-nav.svg","href":"/integrations/guardrails/google-model-armor"},{"title":"CrowdStrike AIDR","icon":"https://mintlify.s3.us-west-1.amazonaws.com/bifrost/media/crowdstrike-nav.svg","href":"/integrations/guardrails/crowdstrike-aidr"},{"title":"Gray Swan Cygnal","icon":"https://mintlify.s3.us-west-1.amazonaws.com/bifrost/media/grayswan-logo-nav.svg","href":"/integrations/guardrails/grayswan"},{"title":"Patronus AI","icon":"https://mintlify.s3.us-west-1.amazonaws.com/bifrost/media/patronus-logo-nav.svg","href":"/integrations/guardrails/patronus-ai"},{"title":"Check Point's AI Agent Security","icon":"https://mintlify.s3.us-west-1.amazonaws.com/bifrost/media/lakera-logo-nav-v5.svg","href":"/integrations/guardrails/checkpoint"},{"title":"Repello Argus","icon":"https://mintlify.s3.us-west-1.amazonaws.com/bifrost/media/repello-argus-logo-nav.svg","href":"/integrations/guardrails/repello-argus"},{"title":"Singulr AI","icon":"https://mintlify.s3.us-west-1.amazonaws.com/bifrost/media/singulr-logo-nav.svg","href":"/integrations/guardrails/singulr-ai"},{"title":"A10 Guardrails","icon":"https://mintlify.s3.us-west-1.amazonaws.com/bifrost/media/a10-logo-nav.svg","href":"/integrations/guardrails/a10"}]},{"group":"Observability","icon":"binoculars","pages":[{"title":"Built-in Observability","icon":"cube","href":"/features/observability/default"},{"title":"Maxim AI","icon":"infinity","href":"/features/observability/maxim"},{"title":"Datadog","icon":"dog","href":"/features/observability/datadog"},{"title":"OpenTelemetry (OTel)","icon":"bolt","href":"/features/observability/otel"},{"title":"Prometheus","icon":"chart-line","href":"/features/observability/prometheus"},{"title":"Kafka","icon":"database","href":"/features/observability/kafka"},{"title":"BigQuery","icon":"table","href":"/features/observability/bigquery"},{"title":"Pub/Sub","icon":"database","href":"/features/observability/pubsub"},{"title":"Splunk","icon":"database","href":"/features/observability/splunk"}]},{"group":"Vector Databases","icon":"database","pages":[{"title":"Weaviate","icon":"database","href":"/integrations/vector-databases/weaviate"},{"title":"Redis / Valkey","icon":"database","href":"/integrations/vector-databases/redis"},{"title":"Qdrant","icon":"database","href":"/integrations/vector-databases/qdrant"},{"title":"Pinecone","icon":"database","href":"/integrations/vector-databases/pinecone"}]}]},{"tab":"Deployment Guides","icon":"server","pages":[{"title":"Deployment Guides","href":"/deployment-guides/overview"}]},{"tab":"API","icon":"code","pages":[{"title":"API","href":"/api/procuring-api-keys"}]},{"tab":"Contributing","icon":"code-pull-request","pages":[{"title":"Contributing","href":"/contributing/setting-up-repo"}]},{"tab":"Benchmarks","icon":"chart-line","pages":[{"title":"Benchmarks","href":"/benchmarking/getting-started"}]},{"tab":"Changelogs","icon":"bolt","menu":[{"item":"Open Source","icon":"rocket","pages":[{"title":"Open Source","href":"/changelogs/v2.3.2"}]},{"item":"Enterprise","icon":"building","pages":[{"title":"Enterprise","href":"/changelogs/ent-v2.3.2"}]},{"item":"Edge","icon":"grip","pages":[{"title":"Edge","href":"/changelogs/edge-v0.9.4"}]},{"item":"Bifrost CLI","icon":"laptop-code","pages":[{"title":"Bifrost CLI","href":"/changelogs/cli-v1.0.0"}]},{"item":"Helm","icon":"box","pages":[{"title":"Helm","href":"/changelogs/helm-v2.1.45"}]}],"pages":[{"title":"Changelogs","href":"/changelogs/v2.3.2"}]}]},"title":"OpenCode - Bifrost","buildId":"dpl_849ArpqvBiCczQiT1Y1stNGpbqHT","deploymentId":"dpl_849ArpqvBiCczQiT1Y1stNGpbqHT","dynamics":[],"chunks":[]}