# AsyncClient

> **Class** in `langsmith`

📖 [View in docs](https://reference.langchain.com/python/langsmith/async_client/AsyncClient)

Async Client for interacting with the LangSmith API.

## Signature

```python
AsyncClient(
    self,
    api_url: Optional[str] = None,
    api_key: Optional[str] = None,
    timeout_ms: Optional[Union[int, tuple[Optional[int], Optional[int], Optional[int], Optional[int]]]] = None,
    retry_config: Optional[Mapping[str, Any]] = None,
    web_url: Optional[str] = None,
    headers: Optional[dict[str, str]] = None,
    disable_prompt_cache: bool = False,
    cache: Optional[Union[bool, AsyncPromptCache]] = None,
)
```

## Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `api_url` | `Optional[str]` | No | URL for the LangSmith API. (default: `None`) |
| `api_key` | `Optional[str]` | No | API key for the LangSmith API. (default: `None`) |
| `timeout_ms` | `Optional[Union[int, tuple[Optional[int], Optional[int], Optional[int], Optional[int]]]]` | No | Timeout for requests in milliseconds. (default: `None`) |
| `retry_config` | `Optional[Mapping[str, Any]]` | No | Retry configuration. (default: `None`) |
| `web_url` | `Optional[str]` | No | URL for the LangSmith web app. (default: `None`) |
| `headers` | `Optional[dict[str, str]]` | No | Additional HTTP headers to include in all requests.  These headers will be merged with the default headers (Content-Type, x-api-key, etc.). Custom headers will not override the default required headers. (default: `None`) |
| `disable_prompt_cache` | `bool` | No | Disable prompt caching for this client. (default: `False`) |
| `cache` | `Optional[Union[bool, AsyncPromptCache]]` | No | **[Deprecated]** Control prompt caching behavior.  This parameter is deprecated. Use `configure_global_async_prompt_cache()` to configure caching, or `disable_prompt_cache=True` to disable it.  - `True`: Enable caching with the global singleton - `False`: Disable caching (equivalent to `disable_prompt_cache=True`) - `AsyncCache(...)`/`AsyncPromptCache(...)`: Use a custom cache instance (default: `None`) |

## Constructors

```python
__init__(
    self,
    api_url: Optional[str] = None,
    api_key: Optional[str] = None,
    timeout_ms: Optional[Union[int, tuple[Optional[int], Optional[int], Optional[int], Optional[int]]]] = None,
    retry_config: Optional[Mapping[str, Any]] = None,
    web_url: Optional[str] = None,
    headers: Optional[dict[str, str]] = None,
    disable_prompt_cache: bool = False,
    cache: Optional[Union[bool, AsyncPromptCache]] = None,
)
```

| Name | Type |
|------|------|
| `api_url` | `Optional[str]` |
| `api_key` | `Optional[str]` |
| `timeout_ms` | `Optional[Union[int, tuple[Optional[int], Optional[int], Optional[int], Optional[int]]]]` |
| `retry_config` | `Optional[Mapping[str, Any]]` |
| `web_url` | `Optional[str]` |
| `headers` | `Optional[dict[str, str]]` |
| `disable_prompt_cache` | `bool` |
| `cache` | `Optional[Union[bool, AsyncPromptCache]]` |


## Properties

- `headers`
- `api_key`

## Methods

- [`aclose()`](https://reference.langchain.com/python/langsmith/async_client/AsyncClient/aclose)
- [`create_run()`](https://reference.langchain.com/python/langsmith/async_client/AsyncClient/create_run)
- [`update_run()`](https://reference.langchain.com/python/langsmith/async_client/AsyncClient/update_run)
- [`read_run()`](https://reference.langchain.com/python/langsmith/async_client/AsyncClient/read_run)
- [`list_runs()`](https://reference.langchain.com/python/langsmith/async_client/AsyncClient/list_runs)
- [`share_run()`](https://reference.langchain.com/python/langsmith/async_client/AsyncClient/share_run)
- [`run_is_shared()`](https://reference.langchain.com/python/langsmith/async_client/AsyncClient/run_is_shared)
- [`read_run_shared_link()`](https://reference.langchain.com/python/langsmith/async_client/AsyncClient/read_run_shared_link)
- [`create_project()`](https://reference.langchain.com/python/langsmith/async_client/AsyncClient/create_project)
- [`read_project()`](https://reference.langchain.com/python/langsmith/async_client/AsyncClient/read_project)
- [`delete_project()`](https://reference.langchain.com/python/langsmith/async_client/AsyncClient/delete_project)
- [`create_dataset()`](https://reference.langchain.com/python/langsmith/async_client/AsyncClient/create_dataset)
- [`read_dataset()`](https://reference.langchain.com/python/langsmith/async_client/AsyncClient/read_dataset)
- [`delete_dataset()`](https://reference.langchain.com/python/langsmith/async_client/AsyncClient/delete_dataset)
- [`list_datasets()`](https://reference.langchain.com/python/langsmith/async_client/AsyncClient/list_datasets)
- [`create_example()`](https://reference.langchain.com/python/langsmith/async_client/AsyncClient/create_example)
- [`read_example()`](https://reference.langchain.com/python/langsmith/async_client/AsyncClient/read_example)
- [`list_examples()`](https://reference.langchain.com/python/langsmith/async_client/AsyncClient/list_examples)
- [`create_feedback()`](https://reference.langchain.com/python/langsmith/async_client/AsyncClient/create_feedback)
- [`create_feedback_from_token()`](https://reference.langchain.com/python/langsmith/async_client/AsyncClient/create_feedback_from_token)
- [`create_presigned_feedback_token()`](https://reference.langchain.com/python/langsmith/async_client/AsyncClient/create_presigned_feedback_token)
- [`read_feedback()`](https://reference.langchain.com/python/langsmith/async_client/AsyncClient/read_feedback)
- [`list_feedback()`](https://reference.langchain.com/python/langsmith/async_client/AsyncClient/list_feedback)
- [`delete_feedback()`](https://reference.langchain.com/python/langsmith/async_client/AsyncClient/delete_feedback)
- [`list_annotation_queues()`](https://reference.langchain.com/python/langsmith/async_client/AsyncClient/list_annotation_queues)
- [`create_annotation_queue()`](https://reference.langchain.com/python/langsmith/async_client/AsyncClient/create_annotation_queue)
- [`read_annotation_queue()`](https://reference.langchain.com/python/langsmith/async_client/AsyncClient/read_annotation_queue)
- [`update_annotation_queue()`](https://reference.langchain.com/python/langsmith/async_client/AsyncClient/update_annotation_queue)
- [`delete_annotation_queue()`](https://reference.langchain.com/python/langsmith/async_client/AsyncClient/delete_annotation_queue)
- [`add_runs_to_annotation_queue()`](https://reference.langchain.com/python/langsmith/async_client/AsyncClient/add_runs_to_annotation_queue)
- [`delete_run_from_annotation_queue()`](https://reference.langchain.com/python/langsmith/async_client/AsyncClient/delete_run_from_annotation_queue)
- [`get_run_from_annotation_queue()`](https://reference.langchain.com/python/langsmith/async_client/AsyncClient/get_run_from_annotation_queue)
- [`create_feedback_config()`](https://reference.langchain.com/python/langsmith/async_client/AsyncClient/create_feedback_config)
- [`list_feedback_configs()`](https://reference.langchain.com/python/langsmith/async_client/AsyncClient/list_feedback_configs)
- [`update_feedback_config()`](https://reference.langchain.com/python/langsmith/async_client/AsyncClient/update_feedback_config)
- [`delete_feedback_config()`](https://reference.langchain.com/python/langsmith/async_client/AsyncClient/delete_feedback_config)
- [`like_prompt()`](https://reference.langchain.com/python/langsmith/async_client/AsyncClient/like_prompt)
- [`unlike_prompt()`](https://reference.langchain.com/python/langsmith/async_client/AsyncClient/unlike_prompt)
- [`list_prompts()`](https://reference.langchain.com/python/langsmith/async_client/AsyncClient/list_prompts)
- [`get_prompt()`](https://reference.langchain.com/python/langsmith/async_client/AsyncClient/get_prompt)
- [`create_prompt()`](https://reference.langchain.com/python/langsmith/async_client/AsyncClient/create_prompt)
- [`create_commit()`](https://reference.langchain.com/python/langsmith/async_client/AsyncClient/create_commit)
- [`update_prompt()`](https://reference.langchain.com/python/langsmith/async_client/AsyncClient/update_prompt)
- [`delete_prompt()`](https://reference.langchain.com/python/langsmith/async_client/AsyncClient/delete_prompt)
- [`pull_prompt_commit()`](https://reference.langchain.com/python/langsmith/async_client/AsyncClient/pull_prompt_commit)
- [`list_prompt_commits()`](https://reference.langchain.com/python/langsmith/async_client/AsyncClient/list_prompt_commits)
- [`pull_prompt()`](https://reference.langchain.com/python/langsmith/async_client/AsyncClient/pull_prompt)
- [`push_prompt()`](https://reference.langchain.com/python/langsmith/async_client/AsyncClient/push_prompt)

---

[View source on GitHub](https://github.com/langchain-ai/langsmith-sdk/blob/ce9e9e8973442b33e98ec3ce1b9c2dd3f58a43a7/python/langsmith/async_client.py#L31)