Skip to main content
OpenCode is an open source AI coding assistant that runs in your terminal. It supports OpenAI-compatible APIs.

Configuration

Set these environment variables:
Then run:
Or configure in your settings file:
See all model aliases for shortcuts.

Prompt Caching

Prompt caching is automatic. Your system prompt and tool definitions are cached for 5 minutes, reducing costs by up to 90% on subsequent requests. No code changes needed. See Prompt Caching for details.