Skip to content

Integrations · Terminal

Use OpenCode with a free AI API

OpenCode is an open-source AI coding agent for the terminal. Point it at ZeroLimitAI and every request goes to the best free model available at that moment — 100 calls a day for your first 7 days, then 50 a day with no end date, no card.

Get your free API key

Set it up

  1. Install OpenCode.
  2. Add the provider below to opencode.json in your project (or ~/.config/opencode/opencode.json for every project).
  3. Export your key as ZEROLIMITAI_API_KEY, run opencode and pick zerolimitai/auto with /models.
opencode.json
{
  "$schema": "https://opencode.ai/config.json",
  "provider": {
    "zerolimitai": {
      "npm": "@ai-sdk/openai-compatible",
      "name": "ZeroLimitAI",
      "options": {
        "baseURL": "https://www.zerolimitai.com/api/v1",
        "apiKey": "{env:ZEROLIMITAI_API_KEY}"
      },
      "models": {
        "auto": { "name": "ZeroOptimize auto" }
      }
    }
  }
}
Shell
export ZEROLIMITAI_API_KEY=zlai_your_key_here
opencode

Replace zlai_your_key_here with your key. Base URL: https://www.zerolimitai.com/api/v1. OpenCode's own documentation

Good to know

  • Keeping the key in an environment variable keeps it out of a config file you might commit.
  • Only free models answer, and never through a provider that may train on your prompts. Context is at least 32K tokens, depending on the model.
  • Need more than the free tier? Annual ($49/year) gives 2,000 calls a day and Lifetime ($99 once) 10,000. See plans.

If something goes wrong

401 invalid_key
The key is mistyped, revoked or missing the zlai_ prefix. Create a new one in your dashboard under Developer.
404 Not Found
The base URL must end in /api/v1 (https://www.zerolimitai.com/api/v1). Tools add /chat/completions themselves.
429 daily_limit
Your account used its calls for the day. The limit is per account, not per key, and resets at 00:00 UTC; the X-RateLimit-Remaining header shows what is left.
“Model not found”, or a model name you did not choose in the response
Any model ID is accepted: one we do not serve is routed by ZeroOptimize, and the response header X-ZeroOptimize-Substituted-From says what you asked for. Use “auto”.
Slow first word
Some free models think before answering. Keep streaming on so text appears as soon as it is written; a model that stays silent is replaced automatically.

Full reference: API docs · live status

Other tools

Configs checked against each tool's documentation on 2026-10-02.

Stop paying per token.

One endpoint. $0 inference.

Free API key in a minute — no card. Lifetime is $99.