@talqing/sdk is the server-side client for the /v1 API. It is generated from the OpenAPI document, so it carries every operation, every request shape and every response shape under the API’s own names.
Node 20 or newer. The package ships an ESM build and a CommonJS build, so import and require both work. livekit-client and @livekit/components-react install with it — they are what the browser entrypoint is built on, and you never add them yourself.
This client holds a personal access token, which is a workspace credential with your full role and no scope. Keep it on your server. To let a browser join a call, mint a room token with POST /v1/calls/token and send the browser only that — see web calls.

Creating a client

Three properties come with the client:

Why baseUrl has no default

A bundler inlines NEXT_PUBLIC_* at build time. A localhost fallback would therefore ship a production bundle pointing at a server that is not there, and the failure would surface as a connection error three layers down. Refusing to start says what is wrong at the line that is wrong. In the dashboard’s own case that reads:

The call shape

Operations are reached by resource, exactly as the API names them. Path and query parameters go in one flat object. A request body is keyed by its schema name.
The body key — assignPhoneNumberRequest, createAgentRequest, outboundCallRequest — is the generator’s one ergonomic cost: it has no body option, so the body arrives as a named argument like everything else. It is uniform, so it is the same shape at every write call site, and your editor autocompletes the key. Every method returns the response body directly and throws on anything that is not a 2xx. There is no { data, error } tuple to unwrap and no ! to add.

Errors

instanceof works even when a dependency graph pulls in both the ESM and the CommonJS copy of this package. Class identity would not survive that — an error thrown by one copy would fall straight through a catch written against the other, silently, because the error just keeps propagating. The class brands itself with a key from the global symbol registry and matches on the brand instead, so the check above cannot fall through. A failure that never reached the API — DNS, an abort, an offline machine — has no envelope to parse, so the transport’s own error is rethrown unchanged.

Pagination

paginate<T>(page, { limit }) is an async generator over Page<T>. It requests limit rows at a time — 200 by default — and stops when has_more is false. Filters go in the closure, alongside the query it hands you. Full detail on pagination.

Streams

The six event-stream endpoints return an object with a stream property, which is an async iterable of typed frames. Narrow on event.
talqing.knowledge.events, talqing.copilot.agents.stream, copilot.tools.stream, copilot.knowledge.stream and copilot.tasks.stream work the same way. The second argument also takes sseMaxRetryAttempts, sseDefaultRetryDelay, sseMaxRetryDelay, onSseError and onSseEvent. See streaming for every frame these emit.

Types

Every request and response shape is exported under the API’s own name:
Page<T> is the shape every list endpoint returns. OpenAPI has no generics, so the document spells each instantiation out by hand — PageAgentResponse, PageCallSummaryResponse — but TypeScript is structural, so those satisfy Page<AgentResponse> and generic helpers work over them. Three more exports fill gaps the document leaves:
  • JsonObject, JsonValue, JsonPrimitive — for the free-form fields: userdata, vars, a tool’s json_schema, tool arguments. JsonObject is an object of unknown, which is exactly what the API promises, so a value read off a response drops into it without a cast. JsonValue is the recursive form for a payload you build: it refuses a Date or a class instance that would not survive JSON.stringify.
  • The vocabulary aliases — CallOutcome, ReasoningEffort, CallType, CallBatchStatus, CallBatchRecipientStatus, EmailBatchStatus, EmailRecipientStatus, NumberReadiness, TaskErrorType, PublishStore, ObservabilityGranularity, ObservabilityChannel, OnError, OperationRequest, ConversationItemType, DeliveryStatus, ConversationItemRole, ConversationItemDirection, ConversationItemVisibility, CopilotItem, PriceLine, TelephonyAccountStatus, TelephonyProvider, ObservabilityLatencyMetric, ObservabilityCloseReasonBucket, CatalogEntry, CatalogPricing. These name the literal unions the document spells inline, by reading them off the field that carries them — so they cannot drift from the contract.
  • API_VERSION — the API version the generated half was built against.

The resource namespaces

Every method under them is in the Endpoints section of the API reference, where each operation’s id is its path here: telephony.phoneNumbers.assign is POST /v1/telephony/phone-numbers/{number_id}/assign.

Worked examples

Create and publish an agent

PATCH /v1/agents/{agent_id} takes the complete config, not a patch — read the agent, change what you need, send the whole object back. Publishing runs full validation and refuses with the errors if it fails; warnings come back on the response and do not block.

Place an outbound call

This places a live, billable call to a real person. It returns when the call is placed, not when it is answered, and there is no idempotency key — a retried request dials again. See outbound calls.

Page through calls

Read the credit balance

The balance belongs to whichever region this client’s baseUrl points at. Credits do not move between regions, so label it with the region before you show it to anyone. See pricing and credits.

Talk to a text agent and watch the reply

client_message_id is your own UUID and is the one deduplication key in this API: re-sending with the same one is ignored rather than delivered twice, so a retry is safe.

Browser SDK

The React layer that joins a voice or video call.

Errors

Every status code and what to retry.