OpenCode
Multi-provider AI agent with OAuth subscription support
OpenCode is a flexible AI coding agent that supports 85+ providers from models.dev. Unlike other agents that are locked to a single provider, OpenCode lets you connect multiple AI providers and switch between models freely.
Key Features
- 85+ Providers: Access models from Anthropic, OpenAI, Google, Mistral, Groq, and many more
- OAuth Support: Use your Claude Pro/Max or ChatGPT Plus/Pro subscription instead of API keys
- Multi-Provider: Connect multiple providers and switch models per-session
- Dynamic Models: Model list updates automatically from models.dev
Sesame automatically downloads and caches the OpenCode CLI binary when a session starts. You do not need to install it manually.
Getting Started
1. Open Provider Management
- When creating a session, select OpenCode as the agent
- Click Manage Providers next to the model dropdown
- You'll see a list of all available providers
2. Connect a Provider
For each provider, you can authenticate with either:
- Subscription (OAuth): Use your existing Claude Pro/Max or ChatGPT Plus/Pro subscription
- API Key: Traditional pay-per-token authentication
Using OAuth (Recommended for Anthropic/OpenAI)
- Click Connect on Anthropic or OpenAI
- Select Use Subscription (default when OAuth is available)
- Click Sign in with [Provider]
- Complete the authentication flow:
- Anthropic: Visit the URL, copy the code, paste it back
- OpenAI: Visit the URL, enter the device code shown
- Once authenticated, you're connected!
Using API Key
- Click Connect on any provider
- Select Use API Key
- Enter your API key
- Click Connect
3. Select a Model
After connecting at least one provider, you can select models from the dropdown:
- Models are grouped by provider
- Only models from connected providers are shown
- The list updates dynamically from models.dev
OAuth Authentication
Claude Pro/Max (Anthropic)
Supported subscriptions: Claude Pro, Claude Max
The OAuth flow for Anthropic uses a "code" method:
- Click Sign in with Anthropic
- A browser window opens to Anthropic's authorization page
- Log in and authorize the application
- Copy the authorization code shown
- Paste it back in Sesame
- Click Submit Code
ChatGPT Plus/Pro (OpenAI)
Supported subscriptions: ChatGPT Plus, ChatGPT Pro
The OAuth flow for OpenAI uses a "device code" method:
- Click Sign in with OpenAI
- You'll see a URL and a device code (e.g.,
ABCD-1234) - Visit the URL in your browser
- Enter the device code when prompted
- Authorize the application
- Sesame automatically detects completion and connects
OAuth tokens are stored encrypted and may expire. If authentication fails, disconnect and reconnect the provider.
Provider Management
Viewing Connected Providers
The provider dialog shows:
- Connected section: Providers you've authenticated
- Available section: Providers you can connect
- Each provider shows the number of available models
Disconnecting a Provider
- Open Manage Providers
- Find the connected provider
- Click the trash icon to disconnect
- Both API key and OAuth credentials are removed
Multiple Providers
You can connect multiple providers simultaneously:
- Use Anthropic for Claude models
- Use OpenAI for GPT models
- Use Groq for fast inference
- Switch between them per-session via the model dropdown
MCP Server Integration
OpenCode supports Model Context Protocol (MCP) servers. Any MCP servers configured in Sesame are automatically available to OpenCode tasks.
Troubleshooting
"No providers configured"
Connect at least one provider via Manage Providers before running a session.
OAuth Flow Fails
- Check your subscription is active
- Ensure you're logged into the correct account
- For Anthropic: make sure you copy the full authorization code
- For OpenAI: wait for the device code flow to complete automatically
Token Expired
OAuth tokens may expire over time. Disconnect and reconnect the provider to refresh.
Model Not Available
- Verify the provider is connected (check for green checkmark)
- Some models require specific subscription tiers
- Model availability updates from models.dev; try refreshing
Bootstrap failed
If the agent binary fails to download:
- Check that the sandbox has internet access
- Verify network/firewall rules allow HTTPS to
github.com - Check the session logs for specific download errors