Skip to main content
POST
Create an agent

Authorizations

Authorization
string
header
required

Your AssemblyAI API key in the Authorization header. The raw key works directly; a Bearer prefix is also accepted.

Body

application/json
name
string
required

Display name for the agent.

Example:

"Support Assistant"

system_prompt
string
required

The agent's instructions. Write voice-first.

Example:

"You are a friendly support agent. Keep responses under two sentences."

voice
object
required
greeting
string | null

Spoken on connect; sent straight to TTS. Omit to listen first.

Example:

"Hi, how can I help?"

input
object

Audio input configuration. Defaults to PCM at 24 kHz if omitted.

output
object

Audio output configuration. Defaults to PCM at 24 kHz with the agent's voice.

tools
object[]

Tools the agent can call.

llm
object[]

Connect your own OpenAI-compatible LLM instead of AssemblyAI's managed model. Provide at most one config; omit to use the managed LLM. Multiple configs (fallbacks) are not yet supported.

Maximum array length: 1
pre_connect_requests
object[]

HTTPS lookups the platform runs, in order, before answering an inbound phone call. Each can send the call's facts (such as the caller's number) and values an earlier entry captured, and captures values from its JSON response for the greeting and the conversation. Telephony only; ignored on WebSocket sessions. See Pre-connect requests.

Maximum array length: 2

Response

Agent created.

A stored voice agent.

id
string
Example:

"7ad24396-b822-4dca-871a-be9cc4781cf9"

name
string
Example:

"Support Assistant"

system_prompt
string
greeting
string | null
voice
object
input
object

Audio input configuration. Defaults to PCM at 24 kHz if omitted.

output
object

Audio output configuration. Defaults to PCM at 24 kHz with the agent's voice.

tools
object[]
llm
object[]

Connected LLM, if any. The api_key is write-only and never returned.

created_at
string<date-time>
updated_at
string<date-time>
pre_connect_requests
object[]

The declared pre-connect requests. Header values are never returned.