relay.fast
OpenCode setup

A practical OpenCode configuration path

OpenCode and similar clients normally need a provider, base URL, API key, and model. Keep those values explicit and test the complete request path before enabling tools.

Start with relay.fast Read the API docs

Minimal setup

  1. Create a relay.fast API key.
  2. Choose an OpenAI-compatible provider in OpenCode.
  3. Set https://relay.fast/v1 as the base URL.
  4. Choose a model from /v1/models and send a short test request.

Keep costs predictable

Set context and output limits where the client supports them, inspect token usage, and avoid unbounded agent loops. Compare the resulting workload against the live pricing catalog rather than a single prompt.

One-command setup

The script configures OpenCode for relay.fast. It adds a relay.fast provider with every chat model your key can use and keeps the key in an environment variable. It asks for the API key inside the script, so the key never appears in the command or shell history. Every downloaded file is checked against a published SHA-256 checksum, and running it again can restore the previous settings.

Windows (PowerShell):

powershell -NoProfile -ExecutionPolicy Bypass -Command "irm https://relay.fast/downloads/setup/install-opencode-en.ps1 | iex"

macOS and Linux:

curl -fsSL https://relay.fast/downloads/setup/install-opencode-en.sh | bash

You can read the script before running it by opening the same URL in a browser.

Current prices of models for coding agents

Prices checked from the live catalog. "From" is the lowest price among the relay.fast sources that currently serve the model. The price you pay depends on the source your request uses and can change on any day. The pricing page always shows current values.

ModelModel IDOfficial input / output per 1M tokensrelay.fast from, input / outputCache read fromContext
Claude Sonnet 5.5claude-sonnet-5-5$2 / $10$0.238 / $1.19 (−88%)$0.02381M
Claude Opus 5.5claude-opus-5-5$4 / $20$0.111 / $0.556 (−97%)$0.005561M
GPT-6.1 Sol
requests above 272K input tokens cost more
gpt-6.1-sol$2 / $10$0.03 / $0.15 (−98%)$0.00151.05M
GLM-5.3glm-5.3$1.4 / $4.4$0.035 / $0.11 (−97%)$0.00651M
Kimi K3kimi-k3$3 / $15$0.15 / $0.75 (−95%)$0.0151.05M
DeepSeek V4.1 Flash
price depends on the time of day; the peak-hours price is shown
deepseek-v4.1-flash$0.3 / $1.2$0.03 / $0.12 (−90%)$0.00061M

Frequently asked questions

Can I use a Claude model in OpenCode?

Use the Anthropic-compatible provider mode if your OpenCode version supports it and the model is enabled for your account.

Why does OpenCode return an auth error?

Check the base URL, key scope, endpoint family, and whether a proxy or shell environment is replacing the value.

Is OpenCode affiliated with relay.fast?

No. It is a separate client. This page documents a compatible connection pattern.