OpenCode and the Coding Plan: points, credits and what is left

Coding with AIOpenCode·· 9 views· 3 min read

OpenCode works the same with AI credits or with a Coding Plan. The key and the file do not change. What changes is how each request is paid: with the plan, the plan's models spend points and the others spend credits.

How requests are paid

1 A request to a model in the plan spends points instead of credits: the input, output and cache tokens, each multiplied by that model's value. Stronger models spend more points per token.
2 A request to a model that is not in the plan is paid with credits, at the price in GET /v1/models.
3 The plan's models are listed in the Plan tab of All in One AI. The models recommended in our documentation, such as moonshotai/kimi-k2.7-code and zai-org/glm-5.2, are part of the plan.

When the points come back

The weekly points come back every Monday at 00:00 UTC and do not carry over to the next week. The monthly points count from the start of the subscription period and come back at each renewal. Whichever limit runs out first counts, the weekly or the monthly one. The points of each plan are in the article Coding Plan: which plan to choose.

When the points run out in the middle of your work

By default, OpenCode keeps working and requests are paid with the credits in your balance, at the normal price, until the points come back. You can turn this off in the Plan tab, in Use credits when the plan runs out.

When it is off, or without credits, the API answers 429 with plan_limit_reached until the reset. The error has details.limit (weekly or monthly), details.resets_at and the Retry-After header, with the seconds left.

Checking what is left

The Plan tab shows the points. Through the API, use the same key:

On Linux and macOS:

curl "https://api.interweb.ao/v1/ai/balance" -H "Authorization: Bearer $INTERWEB_API_KEY"

In Windows PowerShell:

curl.exe "https://api.interweb.ao/v1/ai/balance" -H "Authorization: Bearer $env:INTERWEB_API_KEY"

With a plan, the answer has subscription: weekly_remaining and monthly_remaining are the points left, weekly_resets_at and monthly_resets_at say when they come back, and fallback_to_credits says whether it carries on with credits when they run out. credits is your credit balance. In the terminal, aio balance shows the same: see the aio command.

Credits, even with the plan

Even with the plan, keep some credits. They pay for the models outside the plan and, with the option on, the requests after the points run out. For those requests, the maximum output in the file counts: we reserve credits for it, and 16,000 needs a smaller balance than 32,000. See context and output limits in OpenCode.

Want weekly points for OpenCode? Visit the Coding with AI page.

See Coding with AI

SEE ALSO

Coding Plan: which plan to choose, what it costs and how to subscribe

Context and output limits in OpenCode: limit.context and limit.output

Choosing the model in OpenCode: /models and the provider/model format

Kilo Code and the Coding Plan: points, credits and what is left

Coding with AI in All in One AI

RECOMMENDED PRODUCT

Web hosting with cPanel

Domain and SSL included, daily backups and the panel you already know. from $6.59/mo (3-year plan, with coupon)

See plans
Was this answer helpful? Your answer helps us improve this article.