Skip to Content
Quick StartsOpenCode

Install

npm install -g opencode-ai

For other installation methods, see the OpenCode documentation .

Authenticate

Set the API key for your preferred provider:

export ANTHROPIC_API_KEY="sk-ant-..." export OPENAI_API_KEY="sk-..."

See opencode.ai/docs/providers  for all supported providers.

Launch

Open a terminal with ++1, then type opencode.

Terminal
$ opencode --model claude-sonnet-4-5
OpenCode ready. Type your task below.
 
$ Add input validation to the signup form
Updated src/components/SignupForm.tsx
Updated src/lib/validation.ts
$
FlagDescription
--model <model>Choose the AI model (e.g. claude-sonnet-4-5, gpt-4o)
--provider <provider>Select the provider (e.g. anthropic, openai)
--no-auto-applyPreview changes before they are written to disk
--verboseShow detailed tool call output

Full reference: opencode.ai/docs 

Last updated on