OpenCode is an open-source, model-agnostic AI coding assistant that runs as a CLI or from a terminal inside your IDE. This guide configures it to use Argonne's Argo Gateway API.
Note: OpenCode works best on Linux, macOS, and Windows + WSL. If you are on native Windows, consider using Claude Code instead.
- Connected to the Argonne network (on-site or VPN from an Argonne-managed computer)
- Your ANL domain username
curl -fsSL https://opencode.ai/install | bashOr via npm:
npm i -g opencode-aiCreate the configuration file:
mkdir -p ~/.config/opencode/Edit ~/.config/opencode/opencode.json with the following content. Replace ENTER-YOUR-ARGONNE-DOMAIN-USERNAME with your actual ANL domain username:
{
"$schema": "https://opencode.ai/config.json",
"provider": {
"argo": {
"npm": "@ai-sdk/openai-compatible",
"name": "Argo Gateway API",
"options": {
"baseURL": "https://apps.inside.anl.gov/argoapi/v1",
"headers": {
"Authorization": "Bearer ENTER-YOUR-ARGONNE-DOMAIN-USERNAME"
}
},
"models": {
"gpt54": {
"name": "GPT-5.4",
"modalities": {
"input": ["text", "image"],
"output": ["text"]
}
},
"claudesonnet46": {
"name": "Claude Sonnet 4.6",
"modalities": {
"input": ["text", "image"],
"output": ["text"]
}
},
"claudehaiku45": {
"name": "Claude Haiku 4.5",
"modalities": {
"input": ["text", "image"],
"output": ["text"]
}
}
}
}
}
}Important: OpenCode does not automatically pull available models from a custom provider. You must manually add models to your config file. See argo-usage.md for the full list of available model IDs.
Navigate to your project directory and run:
cd /path/to/project
opencodeYou can also run opencode from the terminal inside VS Code or JetBrains.
opencode upgradeLearn more about OpenCode usage at https://opencode.ai/.