The Whisul API uses standard HTTP status codes to indicate the outcome of every request. Handling errors correctly — especially for asynchronous jobs — ensures your integration stays resilient when things don’t go as expected. This page covers every status code the API returns, explains what each one means, and shows you how to respond.Documentation Index
Fetch the complete documentation index at: https://docs.whisul.com/llms.txt
Use this file to discover all available pages before exploring further.
HTTP status code reference
POST /generate
| Status code | Meaning | What to do |
|---|---|---|
202 | Request accepted. Job is queued. | Store the job_id and begin polling. |
400 | Invalid input. The request body was malformed or the prompt field was missing or empty. | Fix the request body before retrying. Log the response for debugging. |
401 | Unauthorized. Your API key was missing, invalid, or expired. | Check that you’re sending Authorization: Bearer YOUR_API_KEY and that the key is valid. |
429 | Rate limit exceeded. You’ve sent too many requests in a short period. | Back off and retry after a delay. See rate limit guidance below. |
GET /jobs/
| Status code | Meaning | What to do |
|---|---|---|
200 | Request successful. Check the status field in the response body — it may be "running" or "completed". | Continue polling if "running". Process the result if "completed". |
404 | Job not found. The job_id does not exist or has expired. | Verify you’re using the correct job_id from the POST /generate response. |
500 | Server error. An unexpected error occurred on Whisul’s side. | Retry after a short delay. If the error persists, contact support. |
Handling errors programmatically
400 — Invalid input
A400 response means the API rejected your request before any job was created. Check that:
- The request body is valid JSON.
- The
promptfield is present and non-empty. - The
Content-Type: application/jsonheader is set.
400 response body example
401 — Unauthorized
Every request to the Whisul API must include your API key in theAuthorization header.
Correct header format
401, confirm that:
- You’re not sending the key as a query parameter or in the request body.
- The API key has not been revoked. Regenerate it in your dashboard if needed.
429 — Rate limit exceeded
When you receive a429, wait before retrying. A simple backoff strategy:
- On first
429: wait 5 seconds, then retry. - On second
429: wait 10 seconds, then retry. - On each subsequent
429: double the wait time, up to a maximum of 60 seconds.
GET /jobs/{job_id} more frequently than once every 5–10 seconds, which helps prevent hitting rate limits during job monitoring.
404 — Job not found
A404 from GET /jobs/{job_id} means the server has no record of that job. The most common causes are:
- A typo in the
job_id. - Using a
job_idfrom a different environment or account. - The job has expired from the system after an extended period.
job_id or poll_url returned directly from POST /generate.
500 — Server error
A500 indicates an unexpected failure on Whisul’s infrastructure. These are typically transient. Retry the same request after 10–30 seconds. If 500 errors persist across multiple retries, check the Whisul status page or contact support.
Handling failed jobs
A job with"status": "failed" is distinct from an HTTP error response. The HTTP status code will be 200 (the request itself succeeded), but the job inside could not complete.
Failed job response
"status": "failed":
- Read the
errorfield for a description of what went wrong. - Retry by submitting a new
POST /generaterequest — you cannot resume a failed job. - Consider adjusting your prompt if the failure may be related to the input.