Skip to main content
POST
Speak text

Authorizations

Authorization
string
header
required

Identify accepts a workspace API key (sk_…). Loom accepts either a short-lived session token (direct) or a workspace API key (relay).

Headers

Idempotency-Key
string

Makes this POST safe to retry. The first call does the work and its response is stored; a retry with the same key returns that stored response with Idempotency-Replayed: true, without charging again. Same key with a different body is rejected. Keys expire after 24 hours.

Maximum string length: 255
Patchwork-Subject
string

Relay only. Opaque subject id, chosen by you and never resolved by Patchwork. Partitions threads and memory within your workspace. Direct tokens carry sub instead — do not send this header on a session token. Required on every subject-scoped resource: threads, messages, runs, outcomes, confirmations and realtime. Omitting it is subject_required, never a wider result. The value is used exactly as given — never trimmed or normalised — so a stray space creates a second partition and is refused as invalid_subject.

Patchwork-Connection
string

Connection id or name the agent may call. Required in relay when the agent has unpinned customer tools. Direct tokens may carry conn instead.

Body

application/json
text
string
required

What to say.

format
enum<string>
default:markdown

What the text is. Anything else is voice_invalid_format.

Available options:
markdown,
plain
voice_id
string

A voice from /v1/voice/voices. The platform default applies when omitted.

language
string

Optional language hint.

Response

Audio bytes. Content-Type is whatever the provider produced.

The response is of type file.