| Name | Type | Description |
|---|---|---|
url | str | None | Default: NoneThe URL of the LangGraph API. |
api_key | str | None | Default: NOT_PROVIDEDAPI key for authentication. Can be:
|
headers | Mapping[str, str] | None | Default: None |
timeout | TimeoutTypes | None | Default: None |
Get a synchronous LangGraphClient instance.
Returns: SyncLangGraphClient: The top-level synchronous client for accessing AssistantsClient, ThreadsClient, RunsClient, and CronClient.
from langgraph_sdk import get_sync_client
# get top-level synchronous LangGraphClient
client = get_sync_client(url="http://localhost:8123")
# example usage: client.<model>.<method_name>()
assistant = client.assistants.get(assistant_id="some_uuid")from langgraph_sdk import get_sync_client
# Don't load API key from environment variables
client = get_sync_client(
url="http://localhost:8123",
api_key=None
)Optional custom headers
Optional timeout configuration for the HTTP client. Accepts an httpx.Timeout instance, a float (seconds), or a tuple of timeouts. Tuple format is (connect, read, write, pool) If not provided, defaults to connect=5s, read=300s, write=300s, and pool=5s.