ApiError and include the HTTP status code, response headers, and body.
Error types
| Exception | Status Code | When it’s raised |
|---|---|---|
BadRequestError | 400 | Invalid request parameters. |
ForbiddenError | 403 | Invalid or missing API key. |
NotFoundError | 404 | Resource (run, workflow, session) not found. |
ConflictError | 409 | Resource conflict (e.g., duplicate creation). |
UnprocessableEntityError | 422 | Request validation failed. |
ApiError | Any | Base class for all API errors. Catch this as a fallback. |
skyvern.client.errors. The base ApiError class lives in skyvern.client.core:
Catching errors
Error properties
Every error has these attributes:| Property | Type | Description |
|---|---|---|
status_code | int | None | HTTP status code. |
body | Any | Response body (usually a dict with error details). |
headers | dict[str, str] | None | Response headers. |
Timeouts
Two different timeouts apply:HTTP request timeout
Controls how long the SDK waits for the HTTP response from the Skyvern API. Set it in the constructor or per-request:Completion timeout
Controls how longwait_for_completion polls before giving up. This is separate from the HTTP timeout:
TimeoutError (via asyncio.timeout), not ApiError.
Retries
Configure automatic retries for transient failures usingRequestOptions:
get_run to check the status and re-run if needed.
Run failure vs API errors
There are two distinct failure modes: API error — The HTTP request itself failed. The SDK raises an exception.status field:
Run statuses
| Status | Description |
|---|---|
created | Run initialized, not yet queued. |
queued | Waiting for an available browser. |
running | AI is executing. |
completed | Finished successfully. |
failed | Encountered an error during execution. |
terminated | Manually stopped. |
timed_out | Exceeded step limit (max_steps). |
canceled | Canceled before starting. |

