Before you set up a coding tool: the key, the credits and the base address

Coding with AIChoosing a Tool & Fixing Errors·· 9 views· 4 min read

Before you open Claude Code, Codex, Cursor or another tool, have three things ready: an API key with the right permissions, AI credits or a Coding Plan, and the base address of the format the tool uses. With that sorted, all that is left is setting up each tool.

1. The API key

Create the key in the API Center. To code, it needs ai:write, to chat with the models, and ai:read, to see the model list and the balance. Kilo Code, for example, reads the model list on its own. A key made for SMS or domains, without these permissions, gets 403 insufficient_scope.

Field What to choose
Mode sandbox_ to check the setup without spending, prod_ to work.
Validity 30, 90 or 365 days, or no expiry. The default is 90 days. When the key expires, the tool starts getting 401 unauthorized.
IP list Optional. If you fill it in, the key only works from those addresses. In Cursor, requests come from Cursor's servers, so a key tied to your computer's IP does not work there.

To confirm, the page asks for your password and a 6-digit code sent by email. The key is shown only once: we keep only a cryptographic hash and the last 4 characters, so we cannot recover it. Use one key per tool: if one is exposed, the others keep working. All the fields are explained in creating an API key.

2. AI credits or a Coding Plan

All in One AI must be active on your account. If it is not yet, see how to activate All in One AI. After that, what the tools use is paid in one of two ways, with the same key:

Way How it works
AI credits Each request pays for its tokens at the model price. You buy them in the Buy credits tab, and they are separate from the account credit.
Coding Plan A monthly subscription with points to spend every week on the coding models. You subscribe in the Plan tab of All in One AI, where you also see the price.

We reserve credits for the maximum output the tool asks for in each answer. That is why the examples ask for 16,000 tokens: it is enough for coding and needs a smaller balance than a higher value. If the balance does not cover the reservation, the answer is 402 insufficient_credits and nothing is charged.

3. The base address

Each tool speaks one format, and the address changes with it:

Format Base address Tools
Anthropic (Messages) https://api.interweb.co.mz Claude Code
OpenAI (Responses) https://api.interweb.co.mz/v1 Codex CLI
OpenAI (Chat Completions) https://api.interweb.co.mz/v1 Cursor, Cline, OpenCode, Kilo Code and Aider

Claude Code adds /v1/messages by itself, so its address has no /v1. The others only add /chat/completions or /responses, so their address ends in /v1. An extra or missing /v1 gives 404 not_found.

4. Check before you work

This request shows the mode, the permissions, the IPs and the validity of the key. It changes nothing and spends no credits. The examples read the key from the INTERWEB_API_KEY variable: see how to keep the key in an environment variable.

On Linux and macOS:

curl "https://api.interweb.co.mz/v1/token" -H "Authorization: Bearer $INTERWEB_API_KEY"

In Windows PowerShell:

curl.exe "https://api.interweb.co.mz/v1/token" -H "Authorization: Bearer $env:INTERWEB_API_KEY"

Check that permissions has ai:read and ai:write, that allowed_ips does not block your tool and that expires_at is still far off. Then set up the tool with the sandbox_ key: the answer should always be "Resposta de teste (sandbox).". If it is, switch to the prod_ key and start working.

Never write the key in a file that goes into the repository. If a key ends up in Git, revoke it and see what to do, in the right order.
With this ready, pick the tool in which coding tool to use.

Want to code with All in One AI models? Visit the Coding with AI page.

See Coding with AI

SEE ALSO

Keeping your API key in an environment variable

Which coding tool to use

Testing in the Sandbox at no cost

Errors when setting up a tool

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

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