Skip to content
Integration · Open-source AI terminal coding agent

Use g0i in opencode

Bun-based open-source coding agent (sst.dev/opencode). Uses the AI SDK with first-class OpenAI Responses support.

Why pair opencode with g0i

  • WebSocket Responses API just works — no client tweaks needed
  • Streams properly through CDN edge — no cold-start lag
  • GPT and other compatible models through one endpoint
  • Public status and model availability for troubleshooting
One-command setup

Set up opencode automatically

Paste one command, paste your API key, pick opencode — the script installs it if it's missing and writes the config for you. No files to edit; your old config is backed up.

Open a terminal and paste:

curl -fsSL https://g0i.ai/install.sh.txt | bash
  1. 1. Paste the command
  2. 2. Paste your key from API keys
  3. 3. Choose your tool and model

Re-run it any time to switch key or model. Prefer doing it by hand? The manual steps are below.

Manual setup

opencode picks up OPENAI_BASE_URL and OPENAI_API_KEY automatically. No config file edit needed for the basics.

Base URL
https://api.g0i.ai/v1
API key
sk-... (from g0i.ai/api-keys)
Default model
gpt-5.6-sol
export OPENAI_BASE_URL=https://api.g0i.ai/v1
export OPENAI_API_KEY=sk-...your-key...

# Run opencode in any project:
opencode

# Or use a different model:
opencode --model gpt-6.1-sol
Don't have a key yet? Sign up at g0i.ai/register — redeem a voucher or buy a plan to start.

Recommended models

Any of these can be used in opencode. Pick by task — see the full catalog at Models & Pricing.

GPT-5.6 Sol
Default — best Responses API output
gpt-5.6-sol
GPT-6.1 Sol
Newer tier, same price
gpt-6.1-sol
GPT-6 Luna
Fastest, cheapest
gpt-6-luna

Troubleshooting

opencode shows "API error: 401"
OPENAI_API_KEY needs to start with sk-. Generate one at g0i.ai/api-keys after redeeming a voucher or buying a plan.
Streaming feels choppy
opencode buffers internally — that's expected. Real chunks arrive as fast as upstream emits them.
Tool calls don't fire
opencode requires Responses API support. g0i's /v1/responses fully implements it — if you see issues, check you are using a GPT-5.6 / GPT-6 model.

Ready to ship in opencode?

Choose a subscription, add pay-as-you-go credits, or redeem a community voucher.