# AsyncBinaryAPIResponse

> **Class** in `langsmith`

📖 [View in docs](https://reference.langchain.com/python/langsmith/_openapi_client/_response/AsyncBinaryAPIResponse)

Subclass of APIResponse providing helpers for dealing with binary data.

Note: If you want to stream the response data instead of eagerly reading it
all at once then you should use `.with_streaming_response` when making
the API request, e.g. `.with_streaming_response.get_binary_response()`

## Signature

```python
AsyncBinaryAPIResponse(
    self,
    *,
    raw: httpx.Response,
    cast_to: type[R],
    client: BaseClient[Any, Any],
    stream: bool,
    stream_cls: type[Stream[Any]] | type[AsyncStream[Any]] | None,
    options: FinalRequestOptions,
    retries_taken: int = 0,
)
```

## Extends

- `AsyncAPIResponse[bytes]`

## Methods

- [`write_to_file()`](https://reference.langchain.com/python/langsmith/_openapi_client/_response/AsyncBinaryAPIResponse/write_to_file)

---

[View source on GitHub](https://github.com/langchain-ai/langsmith-sdk/blob/d6cd6082f09e7826a2d6afe444ae6119e61b82a6/python/langsmith/_openapi_client/_response.py#L502)