OpenCode’s share feature allows you to create public links to your OpenCode conversations, so you can collaborate with teammates or get help from others.
How it works
When you share a conversation, OpenCode:
Creates a unique public URL for your session
Syncs your conversation history to our servers
Makes the conversation accessible via the shareable link — opencode.ai/s/<share-id>
Share
By default, conversations are not shared automatically. You can manually share them using the /share command:
/share
Un-share
To stop sharing a conversation and remove it from public access:
/unshare
This will remove the share link and delete the data related to the conversation.Learn more about sharing conversations.
IDE Extensions
OpenCode integrates with VS Code, Cursor, or any IDE that supports a terminal.
Installation
To install OpenCode on VS Code and popular forks like Cursor, Windsurf, VSCodium:
Open VS Code
Open the integrated terminal
Run opencode - the extension installs automatically
Usage
Quick Launch: Use Cmd+Esc (Mac) or Ctrl+Esc (Windows/Linux) to open OpenCode in a split terminal view, or focus an existing terminal session if one is already running.
New Session: Use Cmd+Shift+Esc (Mac) or Ctrl+Shift+Esc (Windows/Linux) to start a new OpenCode terminal session, even if one is already open. You can also click the OpenCode button in the UI.
Context Awareness: Automatically share your current selection or tab with OpenCode.
File Reference Shortcuts: Use Cmd+Option+K (Mac) or Alt+Ctrl+K (Linux/Windows) to insert file references. For example, @File#L37-42.
OpenCode integrates with your GitHub workflow. Mention /opencode or /oc in your comment, and OpenCode will execute tasks within your GitHub Actions runner.
Features
Triage issues: Ask OpenCode to look into an issue and explain it to you.
Fix and implement: Ask OpenCode to fix an issue or implement a feature. And it will work in a new branch and submits a PR with all the changes.
Secure: OpenCode runs inside your GitHub’s runners.
Installation
Run the following command in a project that is in a GitHub repo:
opencode github install
This will walk you through installing the GitHub app, creating the workflow, and setting up secrets.
Examples
Here are some examples of how you can use OpenCode in GitHub.
Explain an issue
Add this comment in a GitHub issue.
/opencode explain this issue
OpenCode will read the entire thread, including all comments, and reply with a clear explanation.
Fix an issue
In a GitHub issue, say:
/opencode fix this
And OpenCode will create a new branch, implement the changes, and open a PR with the changes.
Review PRs and make changes
Leave the following comment on a GitHub PR.
Delete the attachment from S3 when the note is removed /oc
OpenCode will implement the requested change and commit it to the same PR.Learn more about GitHub workflow.
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"Overview - Z.AI DEVELOPER DOCUMENT","description":"Use GLM models like GLM-5.3 \u0026 GLM-5.3-FLASH for AI coding in Claude Code, Kilo Code, Cline, OpenCode, Clawdbot/OpenClaw and more. Plans from $18/month—fast, reliable code generation and tool use for daily dev work.","colors":{"primary":"#141618","light":"#9fa0a0","dark":"#141618"},"logo":{"light":"https://mintcdn.com/zhipu-32152247/B_E8wI-eiNa1QlPV/logo/dark.svg?fit=max\u0026auto=format\u0026n=B_E8wI-eiNa1QlPV\u0026q=85\u0026s=75deefa9dea5bdbc84d4da68885c267f","dark":"https://mintcdn.com/zhipu-32152247/B_E8wI-eiNa1QlPV/logo/light.svg?fit=max\u0026auto=format\u0026n=B_E8wI-eiNa1QlPV\u0026q=85\u0026s=c1ecf1af358fa8eeab8c06052337f8f6","href":"https://z.ai/model-api"},"favicon":"https://mintcdn.com/zhipu-32152247/ZWmez2h5N6TCeIMS/favicon.svg?fit=max\u0026auto=format\u0026n=ZWmez2h5N6TCeIMS\u0026q=85\u0026s=f41adc4aa1fc28f2be33d46791810b1f","api":{"openapi":["openapi.json"],"params":{"expanded":"all"},"playground":{"display":"interactive","proxy":false},"examples":{"defaults":"all","languages":["bash","python","javascript","java"],"prefill":true}},"appearance":{"default":"dark","strict":false},"navbar":{"links":[{"href":"https://z.ai/manage-apikey/apikey-list","label":"API Keys"},{"href":"https://z.ai/manage-apikey/billing","label":"Payment Method"}]},"footer":{"socials":{"x":"https://x.com/Zai_org","github":"https://github.com/zai-org","discord":"https://discord.gg/QR7SARHRxK","linkedin":"https://www.linkedin.com/company/zdotai"}},"contextual":{"options":["copy","view"],"display":"header"},"styling":{"latex":false},"navigation":{"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"zhipu-32152247","hasAudioNarration":false,"actualSubdomain":"zhipu-32152247","customDomains":["docs.z.ai"],"gitSource":{"type":"github","owner":"zai-doc","repo":"zai-docs","deployBranch":"main","contentDirectory":"","isPrivate":true,"mountPath":"","label":""},"feedback":{"thumbs":true},"entitlements":{},"buildId":"6af2e811011c1c69443c6962","clientVersion":"0.0.4142","searchFilterCounts":[{"language":"default","tag":"Guides","count":25},{"language":"default","tag":"API Reference","count":18},{"language":"default","tag":"Coding Plan","count":18},{"language":"default","tag":"Get Started","count":10},{"language":"default","tag":"Guide","count":8},{"language":"default","tag":"Capabilities","count":7},{"language":"default","tag":"SDKs Guide","count":5},{"language":"default","tag":"Agent API","count":4},{"language":"default","tag":"Tool API","count":4},{"language":"default","tag":"GLM Coding Plan","count":4}]},"assistantConfig":{},"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":false},"customCss":[{"filePath":"style.css","content":"#footer div:last-child{display:none}.md\\:h-10{height:3rem}.prose-dark :where(a):not(:where([class~=not-prose],[class~=not-prose] *)){font-weight:900}.prose-dark :where(strong):not(:where([class~=not-prose],[class~=not-prose] *)){font-weight:900}"}],"page":{"pagePath":"scenario-example/develop-tools/opencode","slug":"/scenario-example/develop-tools/opencode","pageMetadata":{"title":"Open Code","description":null,"href":"/scenario-example/develop-tools/opencode"},"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`,br:`br`,code:`code`,em:`em`,li:`li`,ol:`ol`,p:`p`,pre:`pre`,span:`span`,strong:`strong`,ul:`ul`,..._provideComponents(),...props.components},{CodeBlock,Heading,OptimizedImage,Warning}=_components;if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!OptimizedImage)_missingMdxReference(`OptimizedImage`,true);if(!Warning)_missingMdxReference(`Warning`,true);return _jsxs(_Fragment,{children:[_jsxs(_components.blockquote,{children:[`\n`,_jsx(_components.p,{children:`Complete guide to integrating Z.AI GLM models with OpenCode CLI`}),`\n`]}),`\n`,_jsx(_components.p,{children:`OpenCode is a powerful AI coding agent that can be configured to use Z.AI’s GLM models.`}),`\n`,_jsx(OptimizedImage,{src:`https://mintcdn.com/zhipu-32152247/fQm1SxNtD2jBDQ3i/resource/opencode.png?fit=max\u0026auto=format\u0026n=fQm1SxNtD2jBDQ3i\u0026q=85\u0026s=305c63488f76257bb7a8ad31d6540ea7`,alt:`Description`,\"data-og-width\":`2210`,width:`2210`,\"data-og-height\":`1156`,height:`1156`,\"data-path\":`resource/opencode.png`,\"data-optimize\":`true`,\"data-opv\":`3`,srcset:`https://mintcdn.com/zhipu-32152247/fQm1SxNtD2jBDQ3i/resource/opencode.png?w=280\u0026fit=max\u0026auto=format\u0026n=fQm1SxNtD2jBDQ3i\u0026q=85\u0026s=07cb36b2249e7349db467f8f7ee61c51 280w, https://mintcdn.com/zhipu-32152247/fQm1SxNtD2jBDQ3i/resource/opencode.png?w=560\u0026fit=max\u0026auto=format\u0026n=fQm1SxNtD2jBDQ3i\u0026q=85\u0026s=6f454cae9fa436b923b0055123a01c1d 560w, https://mintcdn.com/zhipu-32152247/fQm1SxNtD2jBDQ3i/resource/opencode.png?w=840\u0026fit=max\u0026auto=format\u0026n=fQm1SxNtD2jBDQ3i\u0026q=85\u0026s=be698a4b0961ae0c1622a32bca0d67e9 840w, https://mintcdn.com/zhipu-32152247/fQm1SxNtD2jBDQ3i/resource/opencode.png?w=1100\u0026fit=max\u0026auto=format\u0026n=fQm1SxNtD2jBDQ3i\u0026q=85\u0026s=5e8a8596548a2c6f6da8c4909b69ca74 1100w, https://mintcdn.com/zhipu-32152247/fQm1SxNtD2jBDQ3i/resource/opencode.png?w=1650\u0026fit=max\u0026auto=format\u0026n=fQm1SxNtD2jBDQ3i\u0026q=85\u0026s=e66b304d4d298a7cb0c734ef41b85f9e 1650w, https://mintcdn.com/zhipu-32152247/fQm1SxNtD2jBDQ3i/resource/opencode.png?w=2500\u0026fit=max\u0026auto=format\u0026n=fQm1SxNtD2jBDQ3i\u0026q=85\u0026s=cf84497282fd05f311b289a5c4b66f9c 2500w`}),`\n`,_jsx(Warning,{children:_jsxs(_components.p,{children:[`For users who have used the service before 2025-12-22: `,_jsx(_components.br,{}),`\n`,`The default model has been upgraded to GLM-4.7. Please update your config accordingly.`]})}),`\n`,_jsx(Heading,{level:`2`,id:`step-1-installing-opencode`,children:`Step 1: Installing OpenCode`}),`\n`,_jsx(_components.p,{children:`The easiest way to install OpenCode is through the install script.`}),`\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:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`curl`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` -fsSL https://opencode.ai/install | bash`})]}),`\n`]})})}),`\n`,_jsx(_components.p,{children:`You can also install it with npm:`}),`\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:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`npm`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` install -g opencode-ai`})]}),`\n`]})})}),`\n`,_jsx(Heading,{level:`2`,id:`step-2-getting-started`,children:`Step 2: Getting Started`}),`\n`,_jsxs(_components.ol,{children:[`\n`,_jsxs(_components.li,{children:[`Head over to the `,_jsx(_components.a,{href:`https://z.ai/manage-apikey/apikey-list`,children:`Z.AI API Console`}),` to get your API key.`]}),`\n`,_jsxs(_components.li,{children:[`Run `,_jsx(_components.code,{children:`opencode auth login`}),` and select `,_jsx(_components.strong,{children:`Z.AI`}),`.`]}),`\n`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`8`,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:`8`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`$ opencode auth login`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`┌ Add credential`})}),`\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:`◆ Select provider`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`│ ● Z.AI`})}),`\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`,_jsxs(_components.p,{children:[`If you are subscribed to the `,_jsx(_components.strong,{children:`GLM Coding Plan`}),`, select `,_jsx(_components.strong,{children:`Z.AI Coding Plan`}),`.`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`8`,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:`8`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`$ opencode auth login`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`┌ Add credential`})}),`\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:`◆ Select provider`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`│ ● Z.AI Coding Plan`})}),`\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`,_jsxs(_components.ol,{start:`3`,children:[`\n`,_jsx(_components.li,{children:`Enter your Z.AI API key.`}),`\n`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`10`,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:`10`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`$ opencode auth login`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`┌ Add credential`})}),`\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:`◇ Select provider`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`│ Z.AI Coding Plan`})}),`\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:`◇ Enter your API key`})}),`\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`,_jsxs(_components.ol,{start:`4`,children:[`\n`,_jsxs(_components.li,{children:[`Run `,_jsx(_components.code,{children:`opencode`}),` to launch OpenCode.`]}),`\n`]}),`\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:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`$ opencode`})}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[`Use the `,_jsx(_components.code,{children:`/models`}),` command to select a model like `,_jsx(_components.em,{children:`GLM-4.7`}),`.`]}),`\n`,_jsx(CodeBlock,{numberOfLines:`2`,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:`2`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`/models`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})})]})})}),`\n`,_jsxs(_components.ol,{start:`5`,children:[`\n`,_jsx(_components.li,{children:`Vision Search Reader MCP`}),`\n`]}),`\n`,_jsxs(_components.p,{children:[`Refer to the `,_jsx(_components.a,{href:`/devpack/mcp/vision-mcp-server`,children:`Vision MCP Server`}),` , `,_jsx(_components.a,{href:`/devpack/mcp/search-mcp-server`,children:`Search MCP Server`}),` and `,_jsx(_components.a,{href:`/devpack/mcp/reader-mcp-server`,children:`Web Reader MCP Server`}),` documentation; once configured, you can use them in OpenCode.`]}),`\n`,_jsx(Heading,{level:`2`,id:`share`,children:`Share`}),`\n`,_jsx(_components.p,{children:`OpenCode’s share feature allows you to create public links to your OpenCode conversations, so you can collaborate with teammates or get help from others.`}),`\n`,_jsx(Heading,{level:`4`,id:`how-it-works`,children:`How it works`}),`\n`,_jsx(_components.p,{children:`When you share a conversation, OpenCode:`}),`\n`,_jsxs(_components.ol,{children:[`\n`,_jsx(_components.li,{children:`Creates a unique public URL for your session`}),`\n`,_jsx(_components.li,{children:`Syncs your conversation history to our servers`}),`\n`,_jsxs(_components.li,{children:[`Makes the conversation accessible via the shareable link — `,_jsx(_components.code,{children:`opencode.ai/s/\u003cshare-id>`})]}),`\n`]}),`\n`,_jsx(Heading,{level:`4`,id:`share-2`,children:`Share`}),`\n`,_jsxs(_components.p,{children:[`By default, conversations are not shared automatically. You can manually share them using the `,_jsx(_components.code,{children:`/share`}),` command:`]}),`\n`,_jsx(CodeBlock,{numberOfLines:`2`,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:`2`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`/share`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})})]})})}),`\n`,_jsx(Heading,{level:`4`,id:`un-share`,children:`Un-share`}),`\n`,_jsx(_components.p,{children:`To stop sharing a conversation and remove it from public access:`}),`\n`,_jsx(CodeBlock,{numberOfLines:`2`,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:`2`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`/unshare`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})})]})})}),`\n`,_jsx(_components.p,{children:`This will remove the share link and delete the data related to the conversation.`}),`\n`,_jsxs(_components.p,{children:[`Learn more about `,_jsx(_components.a,{href:`https://opencode.ai/docs/share/`,children:`sharing conversations`}),`.`]}),`\n`,_jsx(Heading,{level:`2`,id:`ide-extensions`,children:`IDE Extensions`}),`\n`,_jsx(_components.p,{children:`OpenCode integrates with VS Code, Cursor, or any IDE that supports a terminal.`}),`\n`,_jsx(Heading,{level:`4`,id:`installation`,children:`Installation`}),`\n`,_jsx(_components.p,{children:`To install OpenCode on VS Code and popular forks like Cursor, Windsurf, VSCodium:`}),`\n`,_jsxs(_components.ol,{children:[`\n`,_jsx(_components.li,{children:`Open VS Code`}),`\n`,_jsx(_components.li,{children:`Open the integrated terminal`}),`\n`,_jsxs(_components.li,{children:[`Run `,_jsx(_components.code,{children:`opencode`}),` - the extension installs automatically`]}),`\n`]}),`\n`,_jsx(Heading,{level:`4`,id:`usage`,children:`Usage`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Quick Launch`}),`: Use `,_jsx(_components.code,{children:`Cmd+Esc`}),` (Mac) or `,_jsx(_components.code,{children:`Ctrl+Esc`}),` (Windows/Linux) to open OpenCode in a split terminal view, or focus an existing terminal session if one is already running.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`New Session`}),`: Use `,_jsx(_components.code,{children:`Cmd+Shift+Esc`}),` (Mac) or `,_jsx(_components.code,{children:`Ctrl+Shift+Esc`}),` (Windows/Linux) to start a new OpenCode terminal session, even if one is already open. You can also click the OpenCode button in the UI.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Context Awareness`}),`: Automatically share your current selection or tab with OpenCode.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`File Reference Shortcuts`}),`: Use `,_jsx(_components.code,{children:`Cmd+Option+K`}),` (Mac) or `,_jsx(_components.code,{children:`Alt+Ctrl+K`}),` (Linux/Windows) to insert file references. For example, `,_jsx(_components.code,{children:`@File#L37-42`}),`.`]}),`\n`]}),`\n`,_jsxs(_components.p,{children:[`Learn more about `,_jsx(_components.a,{href:`https://opencode.ai/docs/ide/`,children:`IDE integrations`}),`.`]}),`\n`,_jsx(Heading,{level:`2`,id:`github-workflow`,children:`GitHub Workflow`}),`\n`,_jsxs(_components.p,{children:[`OpenCode integrates with your GitHub workflow. Mention `,_jsx(_components.code,{children:`/opencode`}),` or `,_jsx(_components.code,{children:`/oc`}),` in your comment, and OpenCode will execute tasks within your GitHub Actions runner.`]}),`\n`,_jsx(Heading,{level:`4`,id:`features`,children:`Features`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Triage issues`}),`: Ask OpenCode to look into an issue and explain it to you.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Fix and implement`}),`: Ask OpenCode to fix an issue or implement a feature. And it will work in a new branch and submits a PR with all the changes.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Secure`}),`: OpenCode runs inside your GitHub’s runners.`]}),`\n`]}),`\n`,_jsx(Heading,{level:`4`,id:`installation-2`,children:`Installation`}),`\n`,_jsx(_components.p,{children:`Run the following command in a project that is in a GitHub repo:`}),`\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:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`opencode github install`})}),`\n`]})})}),`\n`,_jsx(_components.p,{children:`This will walk you through installing the GitHub app, creating the workflow, and setting up secrets.`}),`\n`,_jsx(Heading,{level:`4`,id:`examples`,children:`Examples`}),`\n`,_jsx(_components.p,{children:`Here are some examples of how you can use OpenCode in GitHub.`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsx(_components.li,{children:_jsx(_components.strong,{children:`Explain an issue`})}),`\n`]}),`\n`,_jsx(_components.p,{children:`Add this comment in a GitHub issue.`}),`\n`,_jsx(CodeBlock,{numberOfLines:`2`,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:`2`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`/opencode explain this issue`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})})]})})}),`\n`,_jsx(_components.p,{children:`OpenCode will read the entire thread, including all comments, and reply with a clear explanation.`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsx(_components.li,{children:_jsx(_components.strong,{children:`Fix an issue`})}),`\n`]}),`\n`,_jsx(_components.p,{children:`In a GitHub issue, say:`}),`\n`,_jsx(CodeBlock,{numberOfLines:`2`,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:`2`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`/opencode fix this`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})})]})})}),`\n`,_jsx(_components.p,{children:`And OpenCode will create a new branch, implement the changes, and open a PR with the changes.`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsx(_components.li,{children:_jsx(_components.strong,{children:`Review PRs and make changes`})}),`\n`]}),`\n`,_jsx(_components.p,{children:`Leave the following comment on a GitHub PR.`}),`\n`,_jsx(CodeBlock,{numberOfLines:`2`,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:`2`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`Delete the attachment from S3 when the note is removed /oc`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})})]})})}),`\n`,_jsx(_components.p,{children:`OpenCode will implement the requested change and commit it to the same PR.`}),`\n`,_jsxs(_components.p,{children:[`Learn more about `,_jsx(_components.a,{href:`https://opencode.ai/docs/github/`,children:`GitHub workflow`}),`.`]}),`\n`,_jsx(Heading,{level:`2`,id:`resources`,children:`Resources`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Documentation`}),`: `,_jsx(_components.a,{href:`https://opencode.ai/docs`,children:`opencode.ai/docs`})]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`GitHub Issues`}),`: `,_jsx(_components.a,{href:`https://github.com/sst/opencode/issues`,children:`github.com/sst/opencode/issues`})]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Discord`}),`: `,_jsx(_components.a,{href:`https://opencode.ai/discord`,children:`opencode.ai/discord`})]}),`\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":"Open Code","description":null,"href":"/scenario-example/develop-tools/opencode"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"Step 1: Installing OpenCode","slug":"step-1-installing-opencode","depth":2,"children":[]},{"title":"Step 2: Getting Started","slug":"step-2-getting-started","depth":2,"children":[]},{"title":"Share","slug":"share","depth":2,"children":[{"title":"How it works","slug":"how-it-works","depth":4,"children":[]},{"title":"Share","slug":"share-2","depth":4,"children":[]},{"title":"Un-share","slug":"un-share","depth":4,"children":[]}]},{"title":"IDE Extensions","slug":"ide-extensions","depth":2,"children":[{"title":"Installation","slug":"installation","depth":4,"children":[]},{"title":"Usage","slug":"usage","depth":4,"children":[]}]},{"title":"GitHub Workflow","slug":"github-workflow","depth":2,"children":[{"title":"Features","slug":"features","depth":4,"children":[]},{"title":"Installation","slug":"installation-2","depth":4,"children":[]},{"title":"Examples","slug":"examples","depth":4,"children":[]}]},{"title":"Resources","slug":"resources","depth":2,"children":[]}],"codeExamples":{}},"jsLinks":[],"subdomain":"zhipu-32152247","siteName":"Overview - Z.AI DEVELOPER DOCUMENT","title":"Open Code - Overview - Z.AI DEVELOPER DOCUMENT","navMaps":{"firstHrefInVersion":{"English":{"href":"/scenario-example/develop-tools/opencode","matchLevel":0}},"firstHrefInLanguage":{}},"lastModified":"2026-11-02T09:24:26.189Z","originalFileLocation":"scenario-example/develop-tools/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=\"dark\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"application-name\" content=\"Overview - Z.AI DEVELOPER DOCUMENT\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/zhipu-32152247/ksfquWFAc8TQf_Hb/_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/zhipu-32152247/ksfquWFAc8TQf_Hb/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/zhipu-32152247/ksfquWFAc8TQf_Hb/_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/zhipu-32152247/ksfquWFAc8TQf_Hb/_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/zhipu-32152247/ksfquWFAc8TQf_Hb/_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/zhipu-32152247/ksfquWFAc8TQf_Hb/_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/zhipu-32152247/ksfquWFAc8TQf_Hb/_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/zhipu-32152247/ksfquWFAc8TQf_Hb/_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/zhipu-32152247/ksfquWFAc8TQf_Hb/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Open Code - Overview - Z.AI DEVELOPER DOCUMENT\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"Overview - Z.AI DEVELOPER DOCUMENT\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.z.ai/scenario-example/develop-tools/opencode\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://zhipu-32152247.mintlify.site/_mintlify/api/og/v2?division=Documentation\u0026amp;title=Open+Code\u0026amp;theme=e598d81587661c063148304b\u0026amp;signature=f10a4fa85fddc88c34298c415e4c55d4fc5919f58416116925a3f7f266f8c5b1\">\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=\"Open Code - Overview - Z.AI DEVELOPER DOCUMENT\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://zhipu-32152247.mintlify.site/_mintlify/api/og/v2?division=Documentation\u0026amp;title=Open+Code\u0026amp;theme=e598d81587661c063148304b\u0026amp;signature=f10a4fa85fddc88c34298c415e4c55d4fc5919f58416116925a3f7f266f8c5b1\">\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/zhipu-32152247/ksfquWFAc8TQf_Hb/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"Overview - Z.AI DEVELOPER DOCUMENT\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#141618\">\u003clink data-mint-head rel=\"canonical\" href=\"https://docs.z.ai/scenario-example/develop-tools/opencode\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/scenario-example/develop-tools/opencode.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"Overview - Z.AI DEVELOPER DOCUMENT\",\"publisher\":{\"@type\":\"Organization\",\"name\":\"Overview - Z.AI DEVELOPER DOCUMENT\"},\"provider\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","agentPointerHref":"/scenario-example/develop-tools/opencode.md","siteName":"Overview - Z.AI DEVELOPER DOCUMENT","nav":{"global":null,"versions":[{"version":"English","tabs":[{"tab":"Guides","groups":[{"group":"Get Started","pages":[{"title":"Quick Start","href":"/guides/overview/quick-start"},{"title":"Overview","href":"/guides/overview/overview"},{"title":"Pricing","href":"/guides/overview/pricing"},{"title":"Core Parameters","href":"/guides/overview/concept-param"},{"group":"SDKs Guide","pages":[{"title":"HTTP API Calls","href":"/guides/develop/http/introduction"},{"title":"Official Python SDK","href":"/guides/develop/python/introduction"},{"title":"Official Java SDK","href":"/guides/develop/java/introduction"},{"title":"OpenAI Python SDK","href":"/guides/develop/openai/python"},{"title":"LangChain Integration","href":"/guides/develop/langchain/introduction"}]},{"title":"Migrate to GLM-5.3","href":"/guides/overview/migrate-to-glm-new"}]},{"group":"Models","pages":[{"title":"GLM-5.3-Flash/FlashX","tag":"New","href":"/guides/vlm/glm-5.3-flash"},{"title":"GLM-5.3","tag":"Hot","href":"/guides/llm/glm-5.3"},{"title":"GLM-5.2","href":"/guides/llm/glm-5.2"}]},{"group":"Capabilities","pages":[{"title":"Thinking Mode","href":"/guides/capabilities/thinking-mode"},{"title":"Deep Thinking","href":"/guides/capabilities/thinking"},{"title":"Streaming Messages","href":"/guides/capabilities/streaming"},{"title":"Tool Streaming Output","href":"/guides/capabilities/stream-tool"},{"title":"Function Calling","href":"/guides/capabilities/function-calling"},{"title":"Context Caching","href":"/guides/capabilities/cache"},{"title":"Structured Output","href":"/guides/capabilities/struct-output"}]},{"group":"Tools","pages":[{"title":"Web Search","href":"/guides/tools/web-search"},{"title":"Stream Tool Call","href":"/guides/tools/stream-tool"}]},{"group":"Agents","pages":[{"title":"GLM Slide/Poster Agent(beta)","href":"/guides/agents/slide"},{"title":"Translation Agent","href":"/guides/agents/translation"},{"title":"Video Effect Template Agent","href":"/guides/agents/video-template"}]}]},{"tab":"API Reference","groups":[{"group":"Using the APIs","pages":[{"title":"Introduction","href":"/api-reference/introduction"},{"title":"Errors","href":"/api-reference/api-code"},{"title":"Rate Limits","url":"https://z.ai/manage-apikey/rate-limits","href":"/api-reference/rate-limit"}]},{"group":"Model API","pages":[{"title":"Chat Completion","openapi":"POST /paas/v4/chat/completions","href":"/api-reference/llm/chat-completion"}]},{"group":"Image API","pages":[{"title":"Generate Image","openapi":"POST /paas/v4/images/generations","href":"/api-reference/image/generate-image"},{"title":"Generate Image(Async)","openapi":"POST /paas/v4/async/images/generations","href":"/api-reference/image/generate-image-async"},{"title":"Retrieve Result","openapi":"GET /paas/v4/async-result/{id}","href":"/api-reference/image/get-image-status"}]},{"group":"Video API","pages":[{"title":"Generate Video(Async)","openapi":"POST /paas/v4/videos/generations","href":"/api-reference/video/generate-video"},{"title":"Retrieve Result","openapi":"GET /paas/v4/async-result/{id}","href":"/api-reference/video/get-video-status"}]},{"group":"Audio API","pages":[{"title":"Audio Transcriptions","openapi":"POST /paas/v4/audio/transcriptions","href":"/api-reference/audio/audio-transcriptions"}]},{"group":"Tool API","pages":[{"title":"Tokenizer","openapi":"POST /paas/v4/tokenizer","href":"/api-reference/tools/tokenizer"},{"title":"Layout Parsing","openapi":"POST /paas/v4/layout_parsing","href":"/api-reference/tools/layout-parsing"},{"title":"Web Search","openapi":"POST /paas/v4/web_search","href":"/api-reference/tools/web-search"},{"title":"Web Reader","openapi":"POST /paas/v4/reader","href":"/api-reference/tools/web-reader"}]},{"group":"Agent API","pages":[{"title":"Agent Chat","openapi":"POST /v1/agents","href":"/api-reference/agents/agent"},{"title":"File Upload","openapi":"POST /paas/v4/files","href":"/api-reference/agents/file-upload"},{"title":"Retrieve Result","openapi":"POST /v1/agents/async-result","href":"/api-reference/agents/get-async-result"},{"title":"Conversation History","openapi":"POST /v1/agents/conversation","href":"/api-reference/agents/agent-conversation"}]}]},{"tab":"Coding Plan","pages":[{"group":"GLM Coding Plan","pages":[{"title":"Overview","href":"/devpack/overview"},{"title":"Usage Policy","href":"/devpack/usage-policy"},{"title":"FAQ","href":"/devpack/faq"},{"title":"Team Plan Benefits","href":"/devpack/teamplan"}]},{"group":"Guide","pages":[{"title":"Quick Start","href":"/devpack/quick-start"},{"title":"Coding Tool Helper","href":"/devpack/extension/coding-tool-helper"},{"title":"Tool Integration","href":"/devpack/tool/others"},{"title":"How to Switch Models","href":"/devpack/latest-model"},{"group":"MCP Integration","pages":[{"title":"Vision MCP Server","href":"/devpack/mcp/vision-mcp-server"},{"title":"Web Search MCP Server","href":"/devpack/mcp/search-mcp-server"},{"title":"Web Reader MCP Server","href":"/devpack/mcp/reader-mcp-server"},{"title":"Zread MCP Server","href":"/devpack/mcp/zread-mcp-server"}]}]},{"group":"Notice","pages":[{"title":"API Key Management Guide","href":"/devpack/notice/api-key-management"},{"title":"Plan Update Announcement","href":"/devpack/notice/usage-revision"},{"title":"Legacy Plan Migration Notice","href":"/devpack/transition"}]},{"group":"Learning Resources","pages":[{"title":"Best Practice","href":"/devpack/resources/best-practice"},{"title":"Memory-mechanism","href":"/devpack/resources/memory-mechanism"}]},{"group":"Campaign Rules","pages":[{"title":"Invite Friends, Get Credits","href":"/devpack/credit-campaign-rules"}]}]},{"tab":"Released Notes","pages":[{"title":"New Released","href":"/release-notes/new-released"}]},{"tab":"Terms and Policy","pages":[{"title":"Privacy Policy","href":"/legal-agreement/privacy-policy"},{"title":"Terms of Use","href":"/legal-agreement/terms-of-use"},{"title":"Subscriptions, Fees, and Payment","href":"/legal-agreement/subscription-terms"}]},{"tab":"Help Center","pages":[{"title":"FAQ","href":"/help/faq"}]}]}]},"basePath":"","title":"Open Code - Overview - Z.AI DEVELOPER DOCUMENT","buildId":"dpl_G2Qd45vZZ7MkBiGF9yYx8ZsbbKXX","deploymentId":"dpl_G2Qd45vZZ7MkBiGF9yYx8ZsbbKXX","dynamics":["a74be98ba7"],"chunks":["zoom-image-lightbox-BLUesUNd.js","lightbox-handle-r17bVUz3.js"]}