# Set request timeouts

Canonical page: https://docs.ovok.com/python-sdk/guides/request-timeouts

**Complexity:** 1 of 5 · **Client:** Python · **Time:** about 5 minutes

Every request has a timeout. Set the default on the client, then pass [`RequestOptions`](/python-sdk/reference/http/request#requestoptions) to any method that calls the API when one call needs a different limit.

## Set the client's timeout [Server-side] [#set-the-clients-timeout-server-side]

`Ovok` applies its `timeout` to every request. It defaults to 30 seconds.

- [`timeout`](/python-sdk/reference/ovok#ovok): seconds each attempt may take, a positive number.

```python title="client.py"
from ovok_sdk import Ovok

ovok = Ovok("https://api.sandbox.ovok.com", "{{TENANT_CODE}}", timeout=10)
```

## Override the timeout for one call [Server-side] [#override-the-timeout-for-one-call-server-side]

Pass `options=RequestOptions(timeout=...)` to the method. Every namespace method that sends a request takes `options` as a keyword argument, and it changes that call only.

- [`timeout`](/python-sdk/reference/http/request#requestoptions): seconds each attempt may take; `None` keeps the client's.

```python title="quick_check.py"
from ovok_sdk import RequestOptions

health = ovok.health.check(options=RequestOptions(timeout=2))
print(health["ok"])
```

The timeout covers each attempt. Retries, the resend after a token refresh, and the later pages of a [`Page`](/python-sdk/guides/paging) keep it.

**Verify your integration:** the script prints `True`.

## Handle a timeout [Server-side] [#handle-a-timeout-server-side]

A request that gets no answer in time raises `OvokTimeoutError`, a subclass of `OvokConnectionError`. Safe requests are retried first, so the error reaches you after the retries.

```python title="timeout.py"
from ovok_sdk import OvokTimeoutError, RequestOptions

try:
    patients = ovok.slim.patients.list({"count": 20}, options=RequestOptions(timeout=5))
except OvokTimeoutError:
    patients = None
```

`ovok.measurements.save` takes `RequestOptions` inside its save options instead; see [Measurements](/python-sdk/namespaces/measurements#save-many-readings-at-once).

## Test your integration [#test-your-integration]

1. Call `ovok.health.check` with a two-second timeout and confirm it answers.
2. Build `RequestOptions(timeout=0)` and confirm it raises `OvokConfigError`.
3. Call a client whose `base_url` does not answer with a one-second timeout and confirm `OvokTimeoutError`.

| Scenario | How to trigger | Expected result |
| --- | --- | --- |
| Per-call timeout | Call `ovok.health.check(options=RequestOptions(timeout=2))` | The health result is returned. |
| Invalid timeout | Build `RequestOptions(timeout=0)` | `OvokConfigError` is raised. |
| No answer | Build the client with a `base_url` that does not answer and call it with `RequestOptions(timeout=1)` | `OvokTimeoutError` is raised after the retries. |

## See also [#see-also]

- [Handle errors](/python-sdk/guides/handle-errors)
- [Page through lists](/python-sdk/guides/paging)
- [Measurements](/python-sdk/namespaces/measurements)
- [`RequestOptions` reference](/python-sdk/reference/http/request#requestoptions)
