Which API provider should you use with OpenCode?

Compare OpenCode Zen, Go, direct API accounts, OpenRouter and Ofox by billing, model access and setup before choosing where to buy coding API access.

Which API provider should you use with OpenCode?

Choose an OpenCode API provider by the models and billing arrangement you need. Zen offers a curated, usage-billed route; Go offers a subscription with defined allowances; direct provider accounts and gateways let you bring another API credential. There is no single cheapest choice for every coding workload.

This guide compares purchase and setup decisions, checked September 9, 2026. It is published by Ofox. It does not present an independent speed benchmark or claim that an Ofox account will fix upstream limits. If you already chose a provider, go straight to the OpenCode configuration guide.

Compare the purchase options

OptionBilling arrangementConsider it whenCheck before paying
OpenCode ZenUsage billing with account creditsYou want the OpenCode team’s curated model listExact model price, deposit/processing fees and auto-reload settings
OpenCode Go$10/month subscription with rolling allowancesIts included models fit your daily tasksModel-specific allowances, reset windows and over-limit behavior
Direct API providerThe provider’s own API billingYour existing account already covers the required modelAPI access, tool support and account limits; a chat subscription is not automatically API credit
OpenRouterAPI usage plus applicable credit-purchase feesYou need its model catalog or routing controlsCurrent price, routing settings and credit terms
OfoxUsage billing; check the selected model and account quoteYou want to evaluate Ofox’s models through a custom providerExact model ID, endpoint, current charge and coding-tool compatibility

The Zen documentation describes its optional provider, credit billing and connection steps. The Go documentation gives the subscription price and limits. Treat the models included in Go as a specific catalog, not a subscription to every model OpenCode can connect to. Consult OpenRouter pricing and Ofox pricing documentation for their current terms.

Match the plan to your coding work

For occasional tasks, compare actual usage costs before committing to a recurring subscription. For daily work, check whether a subscription’s included models and rolling limits cover your busy periods. A monthly allowance alone does not tell you whether a long session can continue.

For a project that depends on a specific model, choose model and protocol compatibility first. A model that answers a short prompt may still behave differently on tool calls, structured results or a long conversation. For a team, also inspect key permissions, spend controls and the provider’s data terms before using private repositories.

A useful cost measure is total billed cost per accepted coding task. Include repeated attempts and the tool conversations needed to reach a reviewed result. The lowest output-token rate can be a poor bargain if the task requires substantially more attempts; this is a measurement method, not a claim about any provider in the table.

Evaluate Ofox with one project first

Start with the Ofox model catalog and select a model whose documented protocol and tool capabilities fit OpenCode. Ofox publishes an OpenAI-compatible base URL of https://api.ofox.io/v1 in its SDK documentation. That URL does not mean every model uses the same runtime or request schema.

To try that connection, create an Ofox account, then open API Keys. Check billing and model access before sending a task. This is an account-creation path, not an offer of free inference.

For the regular OpenCode configuration documented at /docs/providers/:

  1. Run opencode --version and use the documentation for that installation.
  2. In OpenCode, run /connect, choose Other, and register your Ofox key under a provider ID such as ofox.
  3. Declare the same provider ID and the chosen model in opencode.json. Use the correct runtime for the actual protocol; do not paste an API key into the file.
  4. Select the model with /models, then evaluate a small coding task in a disposable project.

The configuration guide contains the JSON template and explains the regular and v2 field differences. Use that version-specific guide rather than combining older TOML examples with the current JSON schema. The official Providers documentation is the authority for OpenCode’s configuration format.

Decide after a small, comparable evaluation

Use the same repository snapshot, task instructions and acceptance tests for each option. Record model ID, provider, total charge, task completion time, tool-call failures and whether the reviewed result passed. Keep model quality and provider delivery separate: changing both at once cannot isolate the cause of a difference.

Evaluation resultNext action
Model cannot be selectedFix the provider/model declaration before buying more credit
Text works but tools failCheck runtime, protocol and model capabilities
Task completes within budgetRepeat with a representative harder task before increasing usage
Limit interrupts a sessionCompare reset windows and account limits, not just advertised monthly price
Existing setup already meets the needKeep it unless the new option demonstrates a concrete benefit

If your current account is on OpenRouter, use the Ofox migration checklist to inspect routing fields and model mappings before switching. No paid cross-provider coding benchmark was run for this comparison.

Frequently Asked Questions

Do I need an OpenCode Zen subscription to use OpenCode?
No. Zen is an optional provider with usage-based billing. OpenCode also supports other providers. Go is a separate subscription offering with usage limits.
Is OpenCode Go unlimited?
No. The official Go documentation lists rolling usage limits and model-dependent allowances. Check the included models and over-limit behavior before subscribing.
Can I connect Ofox to OpenCode?
Use the custom-provider flow for your installed OpenCode version with an Ofox key, a documented endpoint and a supported model. Validate tool calls as well as text output before moving a coding workflow.