Last Updated: May 18, 2026Documentation Index
Fetch the complete documentation index at: https://docs.salad.com/llms.txt
Use this file to discover all available pages before exploring further.
Introduction
OpenCode is an open-source AI coding agent that runs as a terminal UI. Built in Go, it provides a rich interactive interface for coding, planning, reviewing, and debugging directly from your terminal. OpenCode was built with custom model providers in mind and includes first-class support for OpenAI-compatible endpoints. OpenCode works with SaladCloud in two ways:- Salad AI Gateway - no infrastructure to deploy or manage. Sign up for access, point OpenCode at a single shared endpoint, and use your Salad API key directly. Currently in closed beta with monthly flat-rate access.
- Self-hosted model - deploy your own SaladCloud container group for full control over the model, hardware, and configuration. Still very easy to set up and use.
Prerequisites
Before getting started, make sure you have:- A SaladCloud account
- Node.js 18+ installed (for the
@ai-sdk/openai-compatiblepackage used internally by OpenCode) - A terminal environment (Linux, macOS, or WSL on Windows)
Step-by-Step Setup
Step 1: Choose Your Backend
- Salad AI Gateway
- Self-Hosted on SaladCloud
Salad AI Gateway is the fastest way to get started - no container groups to deploy, no cold starts to wait for.
- Sign up for early access at salad.com/ai-gateway.
- Once approved, find your Salad API key in the portal.
| Model | Description |
|---|---|
qwen3.6-35b-a3b | Qwen 3.6 35B-A3B - best for agentic tasks, coding, and complex reasoning |
qwen3.6-27b | Qwen 3.6 27B - strong balance of capability and speed |
qwen3.5-9b | Qwen 3.5 9B - fastest response times, suited for lighter tasks |
Step 2: Install OpenCode
Install OpenCode using the official install script:Step 3: Configure OpenCode to Use Your SaladCloud Endpoint
Create or edit the OpenCode configuration file at~/.config/opencode/opencode.json:
- Salad AI Gateway
- Self-Hosted on SaladCloud
apiKey is all that’s required.Step 4: Launch OpenCode and Test the Connection
Navigate to your project directory and start OpenCode:“Create a hello world Python script that prints ‘Hello from SaladCloud!’”If OpenCode successfully creates the file, your setup is complete.
Tips for Best Results
Use the Build Agent
OpenCode’s built-inbuild agent handles code generation and editing with all tools enabled. It uses whichever model is
set as the default in your config. You can also switch to the built-in plan agent (Tab key) for read-only analysis and
planning without the risk of unintended file modifications.
Context Window
The Qwen 3.6-35B-A3B recipe and AI Gateway support a 262,144 token context window. Thecontext value in the config
lets OpenCode track how much context is remaining and manage prompt sizes accordingly, so make sure it reflects your
actual deployment configuration.
Persist Your API Key
To avoid re-exportingSALAD_API_KEY in every terminal session, add it to your shell profile: