talqing is the Python client for the whole /v1 API, generated from the same OpenAPI document as the TypeScript SDK. Python 3.10+, httpx as the only runtime dependency, typed with a py.typed marker.

Creating a client

Talqing.from_env(**overrides) reads TALQING_API_KEY and TALQING_BASE_URL; anything passed wins. AsyncTalqing has the same shape with every operation a coroutine:
Use either as a context manager, or call talqing.close() (await talqing.close() on the async client) when done.
The default 30-second timeout is shorter than an agent task’s budget. talqing.task_runs.create waits for the run, whose timeout_seconds defaults to 300 and can be 600. A longer run raises httpx.ReadTimeout on your side while it continues, and is billed, on ours. Raise the timeout past the task’s budget, or pass background=True and collect the result later:

The call shape

Path parameters are positional; body fields and query parameters are keyword arguments. Responses are plain decoded dicts described by TypedDicts, so read fields with response["field"].

An argument you do not pass is not sent

Optional arguments default to the sentinel OMIT and are left out of the request. That lets a PATCH distinguish “clear this field” from “leave it alone”:
OMIT is exported from talqing for building arguments dynamically. The one renamed method is telephony.phone_numbers.import_().

Errors

Every non-2xx raises TalqingAPIError with str(error) (the message), .status_code, .errors (always a list), .detail and .response. A non-JSON error body, such as a proxy’s 502 page, still raises it with the raw text as the message; connection errors and timeouts raise httpx’s own exceptions. See errors.

Pagination

paginate(method, *, limit=200, **filters) takes the bound list method itself and yields items across pages. paginate_async is the async for form.

Streams

conversations.events and copilot.agents.stream / tools.stream / tasks.stream return a Stream (an AsyncStream on the async client): an iterator of decoded frames that is also a context manager. Opening one is not a coroutine on either client.
Use the context manager whenever you may exit early; it closes the connection. A stream that fails to open raises TalqingAPIError immediately. A finished stream cannot be reopened (RuntimeError). Frame shapes are in streaming.

Escape hatches

Every request and response shape is importable by its API name (from talqing import AgentConfig, AgentResponse, Page).

Next

SDK overview

Every resource namespace.

Streaming

Every frame the event streams emit.