OpenAI-compatible

Use a model with OpenCode through IteraCompute.

Bring open models to your terminal.

Connect in three steps

1. Create an API key

Create or sign in to your IteraCompute account, then create a key in the Console.

2. Configure the base URL

Add an IteraCompute custom provider using @ai-sdk/openai-compatible.

3. Select the model

Use the exact API Model ID for your chosen model. Check its context and capabilities before enabling agent or vision features.

Choose your model

Example configuration

Keep API keys in your server environment or tool credential store. Replace the example key field with your own key where applicable.

opencode.json
{
  "$schema": "https://opencode.ai/config.json",
  "model": "iteracompute/qwen/qwen3.8-27b",
  "provider": {
    "iteracompute": {
      "npm": "@ai-sdk/openai-compatible",
      "name": "IteraCompute",
      "options": {
        "baseURL": "https://api.iteracompute.com/v1",
        "apiKey": "{env:ITERACOMPUTE_API_KEY}"
      },
      "models": {
        "qwen/qwen3.8-27b": {
          "name": "Qwen3.8-27B"
        }
      }
    }
  }
}

Version and verification

Real workflow verified October 14, 2026 · OpenCode 1.19.0 · Node.js 25.2.1 · Windows · free Qwen only. Read files, repair slugify.mjs, run tests, independently rerun: 4 pass, 0 fail. The retained five-step run reports 30,911 tokens and a 25.256s agent event window.

Exact prompt, verified configuration, code diff, tests and full operation log →

Success criterion

Send a short prompt in OpenCode, then check a non-empty answer. For a coding test, inspect the file diff and run the project test command.

Record the installed version
opencode --version

Test the configured tool itself after the API check below. An HTTP 200 or a cURL result alone does not verify that tool.

Test the connection

cURL · Chat Completions
# Bash / zsh / WSL; set ITERACOMPUTE_API_KEY in your environment first.
curl --fail-with-body https://api.iteracompute.com/v1/chat/completions \
  -H "Authorization: Bearer $ITERACOMPUTE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model":"qwen/qwen3.8-27b","messages":[{"role":"user","content":"Reply with exactly: Hello!"}],"max_tokens":512}'

Check that choices[0].message.content contains visible text; HTTP 200 alone is insufficient. Reasoning may consume the output budget. For free Qwen, use the first free call example to disable thinking, then send a prompt inside your tool.

Selected model capabilities

These are API capabilities of the selected model. Feature availability in your workflow also depends on the tool and its settings; reasoning controls vary by model.

  • Chat CompletionsSupported
  • Tool callingSupported
  • ReasoningSupported
  • Image inputSupported
  • StreamingSupported

Troubleshooting

Provider or model not found

Load opencode.json from the project. The selected name is iteracompute/qwen/qwen3.8-27b; the models key is qwen/qwen3.8-27b inside the iteracompute provider.

Missing credentials

Set ITERACOMPUTE_API_KEY in the process that launches OpenCode. The {env:ITERACOMPUTE_API_KEY} field reads that environment variable; reopen the terminal after changing it.

Endpoint or model settings

Use @ai-sdk/openai-compatible and keep /v1 in baseURL. Configure context and output limits for your account tier before attaching a large project.

429 / Request limits

Check account-wide monthly usage and TPM. Honor Retry-After and avoid parallel retries. Free Qwen has no automatic paid overage; other models use their published prices.

401 / 403: check the key and model permission. Free Qwen requires no balance or card. For paid models, also check available balance.

OpenCode configuration reference →

Start building with OpenCode.

Connect your key, choose a model and send your first request.