Skip to main content
The SDK raises typed exceptions for API errors. In Python, all errors extend ApiError. In TypeScript, all errors extend SkyvernError. Both include the HTTP status code, response body, and headers.

Error types

Import errors from the package:
The specific Python error classes live in skyvern.client.errors. The base ApiError class lives in skyvern.client.core.
TypeScript: SkyvernError and SkyvernTimeoutError are top-level exports. The HTTP-specific errors (BadRequestError, etc.) extend SkyvernError and are accessed via the SkyvernApi namespace.

Catching errors

Error properties

Every error has these attributes:

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:
When an HTTP request times out in TypeScript, a SkyvernTimeoutError is thrown.

Completion timeout

Controls how long wait_for_completion / waitForCompletion polls before giving up. This is separate from the HTTP timeout:
The completion timeout raises Python’s built-in TimeoutError (via asyncio.timeout), not ApiError. In TypeScript, it throws a standard Error with a timeout message.

Retries

Configure automatic retries for transient failures. Set it in the constructor or per-request:
Retries apply to the HTTP request level (network errors, 5xx responses). They do not retry the entire task if it fails at the AI level - use get_run / getRun to check the status and re-run if needed.

Abort requests (TypeScript only)

Cancel in-flight requests using AbortSignal:

Run failure vs API errors

There are two distinct failure modes: API error - The HTTP request itself failed. The SDK raises an exception.
Run failure - The API call succeeded, but the task/agent failed during execution. No exception is raised. Check the status field:

Run statuses