Guides

Errors

How the API signals failures, and how to handle them.

QuickTane uses conventional HTTP status codes. 2xx means success, 4xx means a problem with your request, and 5xx means something went wrong on our side. Error responses are JSON with a human-readable message.

json
{ "message": "Invalid or revoked API key." }

Note the difference between request errors and execution results. A run whose code throws still returns 200 — the failure is in the run object (status: "failed", non-zero exit_code), not in the HTTP status.

Status codes

CodeMeaning
200Success.
202Accepted — the run or session was queued/launched.
401Missing, invalid, or revoked API key.
402Team credit exhausted — add a plan to continue.
403Account suspended, or the resource isn't yours.
404The run or session doesn't exist (or belongs to another team).
409Session isn't ready yet for exec/file calls.
422Validation failed — check the message and your parameters.
429Rate limit exceeded — back off and retry.
5xxServer error — safe to retry with backoff.

SDK errors

Both SDKs raise typed errors so you can branch on the failure. Every error carries the HTTP status_code and response body.

ErrorStatus
AuthenticationError401 / 403
NotFoundError404
ValidationError422
RateLimitError429
APIErroranything else
python
from quicktane import QuickTane, RateLimitError, QuickTaneError

qt = QuickTane()
try:
    run = qt.run_and_wait("print(1)", language="python")
except RateLimitError:
    ...  # back off and retry
except QuickTaneError as e:
    print(e.status_code, e.body)

Retrying

  • 429 and 5xx are safe to retry — use exponential backoff.
  • 4xx (except 429) won't succeed on retry — fix the request first.