Skip to content

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.

StatusMeaningFirst check
400Invalid requestJSON shape, endpoint, unsupported parameter, or malformed messages.
401UnauthorizedMissing, expired, deleted, or incorrect API key.
403ForbiddenAccount, key, or model does not have permission for the request.
404Not foundWrong endpoint path or unavailable model name.
429Rate limited or quota constrainedAccount quota, balance, concurrency, or upstream rate limit.
500Gateway errorRetry with backoff and collect request details.
502Upstream errorUpstream provider returned an invalid or failed response.
503Temporarily unavailableRetry later or use a different model if your app supports fallback.

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.

  • 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.