OpenAI-compatible

Choose low-cost models for OpenCode

Start with paid Qwen3.8-Flash for your own task, compare token rates and switch models when needed. The retained free Auto code-repair run remains below as a separate example.

IteraCompute is a built-in provider in OpenCode: select it directly, enter your API key and choose the model selected below. The custom-provider example below uses the same model.

The free promotion ends at 00:00 Pacific Time on November 24, 2026. Users with positive net recharge completed before this cutoff retain their existing free tier. Afterward, shared free Auto is limited to these users and users with a currently effective plan. Later recharges do not grant or upgrade free benefits. Plan Auto tokens and monthly shared free benefits are separate allowances.

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

Eligible Free-tier accounts receive 30M tokens/month and 128K total context, with shared capacity and one outstanding request. No TPM cap. Retained recharge tiers and current subscription terms apply; plan Auto tokens are separate.

Shared capacity may queue; no SLA.

Paid usage: check the selected model’s token rates and available balance. For a model-restricted key, add its Model ID to the allowed-model list before calling it.

Evaluate a two-model workflow

GPT-6 Luna — Try routine edits and explanations here first. GPT-6.1 Sol — Escalate difficult debugging and multi-file tasks when the first attempt fails your acceptance checks.

Measure cost per successful task: total billed cost of all attempts, retries and escalations divided by tasks passing the same unchanged tests and review criteria. Keep inputs, context and output budgets comparable; include cache writes and reads, reasoning tokens and failed runs. Compare with using each model alone. This is an evaluation method, not a verified savings claim.

For MiniMax M3, use model ID minimax/minimax-m3 and its own context, output limits, paid prices and capabilities. Do not copy the free Auto settings. The retained OpenCode and Cline tests cover free Auto only; MiniMax M3 tool workflows have not been verified here. MiniMax M3 model details →

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-flash",
  "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-flash": {
          "name": "Qwen3.8-Flash"
        }
      }
    }
  }
}

Repair one function. Pass four tests.

Start from a disposable project with one passing test and three failing tests. Ask OpenCode to repair slugify.mjs while keeping the existing tests unchanged.

What you will produce

A repaired function and a code diff you can review.

Done when

All four tests pass with exit code 0, and slugify.test.mjs stays unchanged.

Copy this task to OpenCode
Fix slugify.mjs so all four existing tests pass. Lowercase ASCII letters, preserve digits, replace runs of other characters with one hyphen, and trim leading/trailing hyphens. Do not change slugify.test.mjs. Run node --test slugify.test.mjs and report the result.
Verify independently
node --test slugify.test.mjs

Version and verification

Tested version
OpenCode 1.19.0 · Node.js 25.2.1 · Windows
Result
Code edits and tests passed.

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-flash","messages":[{"role":"user","content":"Reply with exactly: Hello!"}],"max_tokens":512}'

Run the cURL example above with the selected model, then send a short prompt in OpenCode. Confirm that choices[0].message.content contains visible text; HTTP 200 alone is insufficient. Reasoning may consume the output budget, and model-specific settings differ.

Selected model capabilities

Capabilities describe the IteraCompute API. 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. Select the iteracompute provider and use the exact model and models values from the configuration above for your chosen model.

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. Before attaching a large project, check the context and output limits for the selected model and your account.

429 / Request limits

Check the rate limits and account usage for the selected model. Honor Retry-After and avoid parallel retries. Quota and recharge requirements are listed in the model details.

401 / 403: check the API key, permission for the selected model and its recharge requirements. Check the selected model details before retrying.

OpenCode configuration reference →

Start building with OpenCode.

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