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, and the repeated part then bills at that model’s cached-input rate instead of its input rate. No code changes needed. See Prompt Caching for details.