# RetryTransport

> **Class** in `langsmith`

📖 [View in docs](https://reference.langchain.com/python/langsmith/sandbox/_transport/RetryTransport)

Sync httpx transport that retries on transient errors.

Retries on:
- 502/503/504 with exponential backoff
- 429 with Retry-After header support
- Connection errors with exponential backoff

After exhausting retries, the last response is returned (for status errors)
or SandboxConnectionError is raised (for connection errors).

## Signature

```python
RetryTransport(
    self,
    *,
    max_retries: int = 3,
    transport: httpx.BaseTransport | None = None,
)
```

## Extends

- `httpx.BaseTransport`

## Constructors

```python
__init__(
    self,
    *,
    max_retries: int = 3,
    transport: httpx.BaseTransport | None = None,
) -> None
```

| Name | Type |
|------|------|
| `max_retries` | `int` |
| `transport` | `httpx.BaseTransport \| None` |


## Methods

- [`handle_request()`](https://reference.langchain.com/python/langsmith/sandbox/_transport/RetryTransport/handle_request)
- [`close()`](https://reference.langchain.com/python/langsmith/sandbox/_transport/RetryTransport/close)

---

[View source on GitHub](https://github.com/langchain-ai/langsmith-sdk/blob/19dc497a3d89638e4cc35db72ea1c29cad35cbbf/python/langsmith/sandbox/_transport.py#L32)