Errors
Supado API errors use HTTP status codes plus a JSON response body where available. Your application should preserve the status code and response body in server-side logs.
Response
Section titled “Response”| Status | Meaning | First check |
|---|---|---|
400 | Invalid request | JSON shape, endpoint, unsupported parameter, or malformed messages. |
401 | Unauthorized | Missing, expired, deleted, or incorrect API key. |
403 | Forbidden | Account, key, or model does not have permission for the request. |
404 | Not found | Wrong endpoint path or unavailable model name. |
429 | Rate limited or quota constrained | Account quota, balance, concurrency, or upstream rate limit. |
500 | Gateway error | Retry with backoff and collect request details. |
502 | Upstream error | Upstream provider returned an invalid or failed response. |
503 | Temporarily unavailable | Retry later or use a different model if your app supports fallback. |
Example
Section titled “Example”Handle errors without dropping useful diagnostics:
async function callSupado(payload: unknown) { const response = await fetch("https://supado.com/v1/chat/completions", { method: "POST", headers: { Authorization: `Bearer ${process.env.SUPADO_API_KEY}`, "Content-Type": "application/json", }, body: JSON.stringify(payload), });
const body = await response.text();
if (!response.ok) { throw new Error(`Supado request failed: ${response.status} ${body}`); }
return JSON.parse(body);}Do not include API keys, full prompts, or customer data in error messages sent to client browsers.
Troubleshooting
Section titled “Troubleshooting”- For
401, verify the environment variable is set in the running process. - For
400, send the smallest valid request and add optional fields back one at a time. - For
404, compare the endpoint path with the API reference and confirm the model name in the console. - For
429, inspect whether the application is retrying too aggressively. - For
5xx, retry with exponential backoff and capture the request time, endpoint, model, and request id if available.
For a complete support checklist, see Troubleshooting.