API errors
What each status code from the Shotz API means, and what to do about it.
When a request doesn’t work, the API answers with a status code and a JSON body saying why, in a sentence you can show or log:
{"error": "That needs 140 credits and there aren't enough left. Top up or change plan, then try again."}
The codes
400: the request isn’t right. The body is missing or isn’t JSON, a field is the wrong type or out of range (the message names the field), or the model doesn’t exist or doesn’t make thekindyou asked for. Fix the request; check model ids withGET /api/v1/models.401: the key is missing, wrong or revoked, or whoever made it isn’t an owner or editor of the workspace any more. Send it asAuthorization: Bearer sk_live_…, or make a new key in Settings → API.402: there aren’t enough credits for the generation, or it would take the key’s maker over their monthly credit limit. Nothing is spent. Buy more credits, or ask an owner to raise the limit.404: there’s no generation with that id in this key’s workspace, or theprojectIdisn’t in it.503: generating couldn’t start just then. Wait a moment and try again.
Takes that fail later
A generation can start (202) and a take fail afterwards, for example when a model refuses the prompt. That isn’t an error code: the take’s status is failed, its error says why, and its credits come back. See What happens when a take fails.
If something keeps failing, write to us with the generation’s id.
Still stuck?
Contact supportA real person in Melbourne will write back, usually within one business day.