Keys and errors
How to sign in from code, what each status means, and how to retry safely.
Two ways to sign in
| API key | Signed-in session | |
|---|---|---|
| Get it | Settings → API keys | Signing in on the web, tara login, or MCP's sign-in |
| Can call | Models API, sandboxes | Everything, including app actions |
| Pays with | Added credit only | Your whole balance |
| Lasts | Until you revoke it | A short time; clients renew it |
An API key is shown once, when you make it. Keep it out of code you share and out of the browser. Revoke one in Settings → API keys and it stops working at once. One key in the list, made by TaraSpace for its own chat, is locked and cannot be revoked.
The error body
{"error": {"message": "Insufficient credit", "type": "tara_error", "code": 402}}message is a sentence meant for people. code repeats the HTTP status.
Status codes
| Status | Meaning | What to do |
|---|---|---|
400 | The request is not right | Read the message and fix the input |
401 | Not signed in, or the key is wrong | Check the key or sign in again |
402 | Not enough credit | Add credit; API keys need added credit |
403 | Not allowed this way, such as an API key on an app action | Sign in instead |
404 | Does not exist, or is not yours to see | Check the id; TaraSpace never says which |
428 | The action needs the person's yes | Ask, then retry with tara-confirm: yes |
429 | Busy | Wait a moment, then retry with the same idempotency key |
Retrying safely
Send an idempotency-key (up to 100 characters) with any action that changes something. If the network fails and you
send the same request with the same key again, the work is done once. Use a new key for new work.