Checking OpenCode with a sandbox_ key before you work

Coding with AIOpenCode·· 1 view· 3 min read

A sandbox_ key lets you test the whole OpenCode setup without spending credits or points. The API answers in the right format, but does not call the model. If the test answer arrives, the address, the key and the model are right.

What the Sandbox does

With a sandbox_ key, chat always answers "Resposta de teste (sandbox).", with usage at zero. The model list, the prices and the balance are the real ones. Nothing is charged.

The steps

1 In the API Center, create a sandbox_ key with ai:read and ai:write.
2 Save it in the MOZOUT_API_KEY variable (setx on Windows, export on Linux and macOS) and open a new terminal.
3 Open OpenCode, type /models and choose a MozOut model.
4 Say "hello". The answer should be "Resposta de teste (sandbox).".
5 Set the variable to the prod_ key, close OpenCode and the terminal, and open them again.

What each result means

What you see What it means
"Resposta de teste (sandbox)." Everything is right. Switch to the prod_ key.
401 OpenCode did not send the key: the variable does not exist in that window, or the name in {env:...} is different.
404 model_not_found The model id in models is wrong or is missing the part before the slash.
404 not_found The /v1 is missing at the end of baseURL.
The MozOut models do not show in /models OpenCode did not read the file: the name, the folder or a hidden .txt on Windows.
Unrecognized key: "providers" See OpenCode rejects the file with "providers".

Why not work with the sandbox key

With the sandbox key, OpenCode always gets the same sentence and cannot write code. It is only for checking. Also, a sandbox_ key reads real data from your account: keep it as carefully as a prod_ key.

What the Sandbox answers in each case is in the article on testing in the Sandbox at no cost.

Want to check OpenCode without spending anything? Visit the Coding with AI page.

See Coding with AI

SEE ALSO

OpenCode with All in One AI: creating opencode.json from scratch, the key and the models

Testing All in One AI in the Sandbox at no cost: what each answer looks like

OpenCode rejects the file with Unrecognized key: "providers": how to fix it

Errors when setting up a tool with All in One AI: 401, model not found, no credits, /v1 and rejected config files

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.60/mo (3-year plan, with coupon)

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