API errors 401, 403, 429 and 404: what each one means
Part of the Kiree.net how-to series: short, with commands and checks you can repeat.
Clients and SDKs return an error code, but the cause is not always obvious. Below are the four most frequent cases and the order to check things in.
401 invalid_api_key
The key was not sent or was sent incorrectly. Check three things:
- The
Authorization: Bearer sk-...header — it must beBearer, notToken. - The key was not truncated when copied (sometimes the last characters are dropped).
- The key is active in the dashboard: a disabled key returns the same error.
403 insufficient quota
The key is valid, but the balance has no funds left. This is not a failure — top up the balance on the Top-up page and activate the code.
429 rate_limit_exceeded
Too many requests in a short time. A delayed retry helps: send the request again after 1–2 seconds, not immediately.
404 model_not_found
The model ID does not match the catalog. The error message usually carries a hint:
{"error":{"message":"model claude-opus-4.6 not found","type":"invalid_request_error"}}Match the ID against the Models & prices page and use the exact spelling, for example claude-opus-4-6 instead of the dotted variant.
How to test the connection separately from your code
The quickest way is a single curl request from the terminal. If curl works but the app does not, the problem is in the client — most often the base_url missing the trailing /v1.
Create a key in a minute; Base URL https://kiree.net/v1, pay only for actual usage, no subscription.