{"openapi":"3.1.0","info":{"title":"FishAudio OpenAPI","version":"1"},"paths":{"/wallet/{user_id}/package":{"get":{"summary":"Get User Package","security":[{"BearerAuth":[]}],"parameters":[{"in":"path","name":"user_id","description":"User ID or 'self'","required":false,"schema":{"default":"self","title":"User Id","type":"string"},"deprecated":false}],"responses":{"200":{"description":"Request fulfilled, document follows","headers":{},"content":{"application/json":{"schema":{"properties":{"subscription_source":{"anyOf":[{"const":"contract","type":"string"},{"type":"null"}],"default":null,"title":"Subscription Source"},"user_id":{"title":"User Id","type":"string"},"type":{"title":"Type","type":"string"},"total":{"title":"Total","type":"integer"},"balance":{"title":"Balance","type":"integer"},"created_at":{"format":"date-time","title":"Created At","type":"string"},"updated_at":{"format":"date-time","title":"Updated At","type":"string"},"finished_at":{"format":"date-time","title":"Finished At","type":"string"},"anchor_day":{"anyOf":[{"type":"integer"},{"type":"null"}],"default":null,"description":"UTC day of month used for credit refreshes; clamp to the month's last day. Missing/null falls back to updated_at's UTC day.","title":"Anchor Day"},"stripe_subscription_id":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Stripe Subscription Id"},"stripe_price_id":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Stripe Price Id"},"billing_period":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Billing Period"},"current_period_end":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}],"default":null,"title":"Current Period End"},"cancel_at_period_end":{"anyOf":[{"type":"boolean"},{"type":"null"}],"default":null,"title":"Cancel At Period End"},"cancel_at":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}],"default":null,"title":"Cancel At"},"scheduled_change":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"default":null,"title":"Scheduled Change"},"last_synced_at":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}],"default":null,"title":"Last Synced At"},"subscription_currency":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Subscription Currency"},"subscription_status":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Subscription Status"},"extra_balance":{"anyOf":[{"type":"integer"},{"type":"null"}],"default":0,"title":"Extra Balance"},"has_used_trial":{"default":false,"title":"Has Used Trial","type":"boolean"}},"required":["user_id","type","total","balance","created_at","updated_at","finished_at"],"type":"object"}}}},"401":{"description":"No permission -- see authorization schemes","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}},"503":{"description":"The server cannot process the request due to a high load","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}}},"tags":["Wallet"]}},"/wallet/{user_id}/api-credit":{"get":{"summary":"Get API Credit","security":[{"BearerAuth":[]}],"parameters":[{"in":"query","name":"check_free_credit","description":"","required":false,"schema":{"default":false,"title":"Check Free Credit","type":"boolean"},"deprecated":false},{"in":"query","name":"team_id","description":"","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Team Id"},"deprecated":false},{"in":"path","name":"user_id","description":"User ID or 'self'","required":false,"schema":{"default":"self","title":"User Id","type":"string"},"deprecated":false}],"responses":{"200":{"description":"Request fulfilled, document follows","headers":{},"content":{"application/json":{"schema":{"properties":{"has_billing_history":{"default":false,"title":"Has Billing History","type":"boolean"},"balance_status":{"default":"normal","enum":["normal","low","empty","zero"],"title":"Balance Status","type":"string"},"package_credit":{"default":"0","title":"Package Credit","type":"string"},"reserved_credit":{"default":"0","title":"Reserved Credit","type":"string"},"available_credit":{"default":"0","title":"Available Credit","type":"string"},"has_credit":{"default":false,"title":"Has Credit","type":"boolean"},"_id":{"title":"Id","type":"string"},"user_id":{"title":"User Id","type":"string"},"credit":{"title":"Credit","type":"string"},"cumulative_top_up":{"title":"Cumulative Top Up","type":"string"},"created_at":{"format":"date-time","title":"Created At","type":"string"},"updated_at":{"format":"date-time","title":"Updated At","type":"string"},"has_phone_sha256":{"title":"Has Phone Sha256","type":"boolean"},"has_free_credit":{"anyOf":[{"type":"boolean"},{"type":"null"}],"default":null,"title":"Has Free Credit"}},"required":["_id","user_id","credit","cumulative_top_up","created_at","updated_at","has_phone_sha256"],"type":"object"}}}},"401":{"description":"No permission -- see authorization schemes","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}},"503":{"description":"The server cannot process the request due to a high load","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}}},"tags":["Wallet"]}},"/apikey/revoke":{"post":{"summary":"Revoke publicly exposed API keys","description":"Anyone holding an API key's plaintext can permanently revoke it here.\nNo authentication is required; Authorization headers are ignored.\nValid requests always return the same empty 202, whether or not any\nkey matched. The creator and shared team's owner receive a security\nnotice. Invalid bodies return 422; each IP is limited to 60 requests\nper hour (429). Source and URL are logged for attribution only.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RevokeCredentials"}}}},"responses":{"202":{"description":"Request accepted, processing continues off-line","headers":{}},"422":{"description":"","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}},"429":{"description":"The user has sent too many requests in a given amount of time (\"rate limiting\")","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}}},"tags":["OpenAPI"]}},"/v1/agent/sessions":{"get":{"summary":"List Agent Sessions","description":"List your team's sessions, newest first. Filter by agent, status,\nconversation status, end reason, rejection reason, caller number, SIP\nCall-ID, end user ID, call_sid, or creation time. Paginate with `cursor`\n(recommended; follow `next_cursor` while `has_more` is true) or with\n`page` for offset pagination with a `total` count. The two are mutually\nexclusive.","security":[{"BearerAuth":[]}],"parameters":[{"in":"query","name":"agent_id","description":"","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Agent Id"},"deprecated":false},{"in":"query","name":"status","description":"Comma-separated status filter (pending/active/completed/failed/unknown). Default: every status.","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Status"},"deprecated":false},{"in":"query","name":"end_reason","description":"Comma-separated end reason filter (user_hangup/agent_hangup/escalated/conversation_timeout/heartbeat_timeout/agent_join_timeout/internal_error/llm_endpoint_failure/room_join_timeout/cancelled/dial_failed/call_rejected).","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"End Reason"},"deprecated":false},{"in":"query","name":"rejection_reason","description":"Comma-separated rejection reason filter for call_rejected sessions (missing_dynamic_variables/agent_not_published/number_unassigned/number_not_active/out_of_credit/concurrency_limit_exceeded).","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Rejection Reason"},"deprecated":false},{"in":"query","name":"conversation_status","description":"Comma-separated filter on how the conversation went (active/resolved/escalated/missed/error); a session matches when it is any of the listed ones. Combines with the other filters: a session must match all of them. Each row reports its own `conversation_status`.","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Conversation Status"},"deprecated":false},{"in":"query","name":"direction","description":"Filter by call direction (inbound/outbound). Sessions predating the field count as inbound.","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Direction"},"deprecated":false},{"in":"query","name":"caller_number","description":"Exact-match caller E.164 (phone sessions only).","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Caller Number"},"deprecated":false},{"in":"query","name":"sip_call_id","description":"Exact-match SIP Call-ID of the call's INVITE, for looking up the session behind a carrier CDR entry (phone sessions only).","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Sip Call Id"},"deprecated":false},{"in":"query","name":"end_user_id","description":"Exact-match end_user_id set at session creation.","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"End User Id"},"deprecated":false},{"in":"query","name":"call_sid","description":"Exact-match carrier call id (Twilio's CallSid on inbound calls through a Twilio number), the call_sid the conversation_init request carries, for finding the session behind that request.","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Call Sid"},"deprecated":false},{"in":"query","name":"created_after","description":"","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Created After"},"deprecated":false},{"in":"query","name":"created_before","description":"","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Created Before"},"deprecated":false},{"in":"query","name":"cursor","description":"","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Cursor"},"deprecated":false},{"in":"query","name":"page","description":"1-based page number (offset pagination). Returns total; mutually exclusive with cursor, which deep scans must use.","required":false,"schema":{"anyOf":[{"minimum":1,"type":"integer"},{"type":"null"}],"default":null,"title":"Page"},"deprecated":false},{"in":"query","name":"include_total","description":"Also count the filtered set on the cursor path.","required":false,"schema":{"default":false,"title":"Include Total","type":"boolean"},"deprecated":false},{"in":"query","name":"page_size","description":"","required":false,"schema":{"default":30,"maximum":100,"minimum":1,"title":"Page Size","type":"integer"},"deprecated":false}],"responses":{"200":{"description":"Request fulfilled, document follows","headers":{},"content":{"application/json":{"schema":{"properties":{"sessions":{"items":{"$ref":"#/components/schemas/AgentSessionSummary"},"title":"Sessions","type":"array"},"has_more":{"title":"Has More","type":"boolean"},"next_cursor":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Next Cursor"},"total":{"anyOf":[{"type":"integer"},{"type":"null"}],"default":null,"title":"Total"}},"required":["sessions","has_more"],"type":"object"}}}},"400":{"description":"Bad request syntax or unsupported method","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}},"401":{"description":"No permission -- see authorization schemes","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}},"503":{"description":"The server cannot process the request due to a high load","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}}},"tags":["Agent Sessions"]},"post":{"summary":"Create Agent Session","description":"Start a conversation session with an agent and receive a join token for the\nsession transport (currently LiveKit WebRTC). Authenticate with an API key to\nstart sessions with any agent in your team; without credentials only agents\npublished as public are reachable, and when the agent restricts origins the\nrequest `Origin` must match its allowed origins.\n\nThis call only issues the join token. The conversation starts when a client\n(the web SDK or the widget) joins with it, so create a session when a user\nstarts a call, one per call. A session that no client joins before\n`expires_at` ends as `failed`.\n\n`language` (and `overrides.language`) accepts `en`, `ja`, `zh`, `ko`, `es`,\n`fr`, `de`, `pt`, `it`, `nl`; anything else is 422. Omit it to use the agent's configured\nspeaking language.\n\n`overrides.asr.model` picks the speech recognition model for this session,\nnested like the agent config's `asr` section and with the same values as\n`asr.model`. It needs an API key.\n\n`overrides.llm.fallback` replaces the agent's `llm.fallback` for this\nsession, with the same shape and rules; each `custom` model needs its\n`api_key`. It needs an API key and `llm.fallback` in the agent's\n`overrides_allowed`.\n\nWhen every concurrent line of your team is in use the answer is 429 with\n`code: concurrency_limit_exceeded`, a `retry_after` in seconds and a\n`Retry-After` header. The limit of a pay as you go team grows with its\ntotal top-ups, and burst admits sessions above it.","security":[{"BearerAuth":[]}],"parameters":[{"in":"header","name":"origin","description":"","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Origin"},"deprecated":false}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentSessionCreatePayload"}}}},"responses":{"201":{"description":"Document created, URL follows","headers":{},"content":{"application/json":{"schema":{"description":"Wire twin of @fishaudio/agent-protocol `SessionToken` (session.ts); keep in sync.","properties":{"session_id":{"title":"Session Id","type":"string"},"expires_at":{"title":"Expires At","type":"string"},"max_duration_seconds":{"title":"Max Duration Seconds","type":"integer"},"transport":{"const":"livekit","title":"Transport","type":"string"},"livekit_url":{"title":"Livekit Url","type":"string"},"token":{"title":"Token","type":"string"}},"required":["session_id","expires_at","max_duration_seconds","transport","livekit_url","token"],"type":"object"}}}},"400":{"description":"Bad request syntax or unsupported method","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}},"401":{"description":"No permission -- see authorization schemes","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}},"402":{"description":"No payment -- see charging schemes","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}},"403":{"description":"Request forbidden -- authorization will not help","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}},"404":{"description":"Nothing matches the given URI","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}},"409":{"description":"Request conflict","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}},"429":{"description":"The user has sent too many requests in a given amount of time (\"rate limiting\")","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}},"502":{"description":"Invalid responses from another server/proxy","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}},"503":{"description":"The server cannot process the request due to a high load","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}}},"tags":["Agent Sessions"],"x-codeSamples":[{"lang":"bash","label":"Create Session","source":"curl --request POST \\\n  --url https://api.fish.audio/v1/agent/sessions \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{\n    \"agent_id\": \"<agent-id>\"\n  }'"}]}},"/v1/agent/sessions/{session_id}":{"get":{"summary":"Get Agent Session","description":"Fetch one session's full detail: status, timing, and the conversation\ntimeline (transcript turns interleaved with tool calls, in order). Add\n`include=turns` for each turn's latency; it is not returned by default.","security":[{"BearerAuth":[]}],"parameters":[{"in":"path","name":"session_id","description":"","required":true,"schema":{"title":"Session Id","type":"string"},"deprecated":false},{"in":"query","name":"include","description":"Comma-separated extra sections to return. Allowed values: `turns` (per-turn latency; without it `turns` is null). Any other value answers 400.","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Include"},"deprecated":false}],"responses":{"200":{"description":"Request fulfilled, document follows","headers":{},"content":{"application/json":{"schema":{"properties":{"session_id":{"title":"Session Id","type":"string"},"agent_id":{"title":"Agent Id","type":"string"},"agent_name":{"title":"Agent Name","type":"string"},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Name"},"end_user_id":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"End User Id"},"status":{"enum":["pending","active","completed","failed","unknown"],"title":"Status","type":"string"},"end_reason":{"anyOf":[{"enum":["user_hangup","agent_hangup","escalated","conversation_timeout","heartbeat_timeout","agent_join_timeout","internal_error","llm_endpoint_failure","room_join_timeout","cancelled","dial_failed","call_rejected"],"type":"string"},{"type":"null"}],"default":null,"title":"End Reason"},"conversation_status":{"description":"How the conversation went, derived from `status` and `end_reason`. Current values: `active` is still going; `resolved` ended normally, which does not mean the caller's problem was solved; `escalated` was transferred to a person; `missed` is a call nobody connected to; `error` is a conversation the platform ended because something failed. New values may be added, so treat an unknown value as a status you do not recognise rather than an error. Filter the list with `conversation_status`, which accepts only the values above.","title":"Conversation Status","type":"string"},"rejection_reason":{"anyOf":[{"enum":["missing_dynamic_variables","agent_not_published","number_unassigned","number_not_active","out_of_credit","concurrency_limit_exceeded"],"type":"string"},{"type":"null"}],"default":null,"description":"Why an inbound phone call was refused before entering a session (when end_reason is call_rejected). Null on all other sessions.","title":"Rejection Reason"},"rejection_detail":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"description":"Human-readable detail for rejection_reason when extra context is available, such as missing dynamic variable names or phone number status. Null when no extra context applies. Intended for display, wording is not guaranteed to stay stable.","title":"Rejection Detail"},"source":{"enum":["api_key","dashboard","public","phone","whatsapp"],"title":"Source","type":"string"},"direction":{"default":"inbound","enum":["inbound","outbound"],"title":"Direction","type":"string"},"dial_status":{"anyOf":[{"enum":["answered","busy","no_answer","failed"],"type":"string"},{"type":"null"}],"default":null,"title":"Dial Status"},"dial_sip_status":{"anyOf":[{"type":"integer"},{"type":"null"}],"default":null,"description":"busy, no_answer and failed: the final SIP response code the carrier or your SIP trunk gave to the outbound dial. Null on an answered call and when it gave none.","title":"Dial Sip Status"},"dial_sip_reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"description":"The reason text the carrier or your SIP trunk sent with dial_sip_status, verbatim, for example `Busy here`. Null when it sent none.","title":"Dial Sip Reason"},"answered_by":{"anyOf":[{"enum":["human","voicemail","unknown"],"type":"string"},{"type":"null"}],"default":null,"title":"Answered By"},"caller_number":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Caller Number"},"caller_id_withheld":{"anyOf":[{"type":"boolean"},{"type":"null"}],"default":null,"title":"Caller Id Withheld"},"dialed_number":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Dialed Number"},"sip_call_id":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Sip Call Id"},"call_sid":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Call Sid"},"timezone":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Timezone"},"created_at":{"title":"Created At","type":"string"},"started_at":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Started At"},"ended_at":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Ended At"},"duration_seconds":{"anyOf":[{"type":"integer"},{"type":"null"}],"default":null,"title":"Duration Seconds"},"participant_identity":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Participant Identity"},"agent_participant_identity":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Agent Participant Identity"},"agent_joined_at":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Agent Joined At"},"metadata":{"additionalProperties":{"$ref":"#/components/schemas/JsonValue"},"title":"Metadata","type":"object"},"content_purged_at":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Content Purged At"},"keypad_menu":{"anyOf":[{"$ref":"#/components/schemas/AgentSessionKeypadMenu"},{"type":"null"}],"default":null},"unattributed_llm_usage":{"items":{"$ref":"#/components/schemas/LLMMessageUsage"},"title":"Unattributed Llm Usage","type":"array"},"items":{"items":{"discriminator":{"mapping":{"message":"#/components/schemas/AgentSessionMessageItem","tool_call":"#/components/schemas/AgentSessionToolCallItem","tool_result":"#/components/schemas/AgentSessionToolResultItem","transfer":"#/components/schemas/AgentSessionTransferItem"},"propertyName":"type"},"oneOf":[{"$ref":"#/components/schemas/AgentSessionMessageItem"},{"$ref":"#/components/schemas/AgentSessionToolCallItem"},{"$ref":"#/components/schemas/AgentSessionTransferItem"},{"$ref":"#/components/schemas/AgentSessionToolResultItem"}]},"title":"Items","type":"array"},"analysis":{"anyOf":[{"$ref":"#/components/schemas/AgentSessionAnalysisResult"},{"type":"null"}],"default":null},"llm_endpoint_errors":{"items":{"$ref":"#/components/schemas/AgentSessionLlmEndpointError"},"title":"Llm Endpoint Errors","type":"array"},"llm_fallbacks":{"items":{"$ref":"#/components/schemas/AgentSessionLlmFallback"},"title":"Llm Fallbacks","type":"array"},"engine_fallbacks":{"items":{"$ref":"#/components/schemas/AgentSessionEngineFallback"},"title":"Engine Fallbacks","type":"array"},"turns":{"anyOf":[{"items":{"$ref":"#/components/schemas/AgentSessionTurn"},"type":"array"},{"type":"null"}],"default":null,"description":"Per-turn latency, ascending by `turn_id`. Only returned when `include=turns` is set; null otherwise. A turn's messages and tool calls are in `items` with the same `turn_id`.","title":"Turns"}},"required":["session_id","agent_id","agent_name","status","conversation_status","source","created_at"],"type":"object"}}}},"400":{"description":"Bad request syntax or unsupported method","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}},"401":{"description":"No permission -- see authorization schemes","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}},"404":{"description":"Nothing matches the given URI","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}},"502":{"description":"Invalid responses from another server/proxy","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}},"503":{"description":"The server cannot process the request due to a high load","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}}},"tags":["Agent Sessions"]}},"/v1/agent/sessions/{session_id}/recording":{"get":{"summary":"Get Agent Session Recording","description":"Return time-limited download URLs for the session's audio recording, one\nper speaker track (agent and user are recorded separately).","security":[{"BearerAuth":[]}],"parameters":[{"in":"path","name":"session_id","description":"","required":true,"schema":{"title":"Session Id","type":"string"},"deprecated":false}],"responses":{"200":{"description":"Request fulfilled, document follows","headers":{},"content":{"application/json":{"schema":{"properties":{"session_id":{"title":"Session Id","type":"string"},"status":{"enum":["processing","complete","failed"],"title":"Status","type":"string"},"tracks":{"items":{"$ref":"#/components/schemas/AgentSessionRecordingTrackEntity"},"title":"Tracks","type":"array"},"transfers":{"items":{"$ref":"#/components/schemas/AgentSessionTransferRecordingEntity"},"title":"Transfers","type":"array"},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Error"},"error_code":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Error Code"},"error_message":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Error Message"}},"required":["session_id","status","tracks"],"type":"object"}}}},"401":{"description":"No permission -- see authorization schemes","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}},"404":{"description":"Nothing matches the given URI","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}},"410":{"description":"URI no longer exists and has been permanently removed","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}},"502":{"description":"Invalid responses from another server/proxy","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}},"503":{"description":"The server cannot process the request due to a high load","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}}},"tags":["Agent Sessions"]}},"/v1/agent/sessions/{session_id}/end":{"post":{"summary":"End Agent Session","description":"Hang up a live session: the agent disconnects and the call terminates. The\nsession record, transcript, and recording are retained and stay readable.","security":[{"BearerAuth":[]}],"parameters":[{"in":"path","name":"session_id","description":"","required":true,"schema":{"title":"Session Id","type":"string"},"deprecated":false}],"responses":{"204":{"description":"Request fulfilled, nothing follows","headers":{}},"401":{"description":"No permission -- see authorization schemes","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}},"404":{"description":"Nothing matches the given URI","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}},"502":{"description":"Invalid responses from another server/proxy","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}},"503":{"description":"The server cannot process the request due to a high load","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}}},"tags":["Agent Sessions"],"x-codeSamples":[{"lang":"bash","label":"End Session","source":"curl --request POST \\\n  --url https://api.fish.audio/v1/agent/sessions/<session-id>/end \\\n  --header 'Authorization: Bearer <token>'"}]}},"/v1/agent/agents":{"get":{"summary":"List Agents","description":"List your team's agents, newest first. Paginate with `cursor` (follow\n`next_cursor` while `has_more` is true) or with `page` for offset\npagination with a `total` count — the two are mutually exclusive.","security":[{"BearerAuth":[]}],"parameters":[{"in":"query","name":"search","description":"Case-insensitive match on name and description.","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Search"},"deprecated":false},{"in":"query","name":"include_archived","description":"","required":false,"schema":{"default":false,"title":"Include Archived","type":"boolean"},"deprecated":false},{"in":"query","name":"publication_state","description":"`live` = has a published version; `draft` = never published.","required":false,"schema":{"default":"all","enum":["all","live","draft"],"title":"Publication State","type":"string"},"deprecated":false},{"in":"query","name":"cursor","description":"","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Cursor"},"deprecated":false},{"in":"query","name":"page","description":"1-based page number (offset pagination). Returns total; mutually exclusive with cursor.","required":false,"schema":{"anyOf":[{"minimum":1,"type":"integer"},{"type":"null"}],"default":null,"title":"Page"},"deprecated":false},{"in":"query","name":"include_total","description":"Also count the filtered set on the cursor path.","required":false,"schema":{"default":false,"title":"Include Total","type":"boolean"},"deprecated":false},{"in":"query","name":"page_size","description":"","required":false,"schema":{"default":30,"maximum":100,"minimum":1,"title":"Page Size","type":"integer"},"deprecated":false}],"responses":{"200":{"description":"Request fulfilled, document follows","headers":{},"content":{"application/json":{"schema":{"properties":{"agents":{"items":{"$ref":"#/components/schemas/PublicAgentEntity"},"title":"Agents","type":"array"},"has_more":{"title":"Has More","type":"boolean"},"next_cursor":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Next Cursor"},"total":{"anyOf":[{"type":"integer"},{"type":"null"}],"default":null,"title":"Total"}},"required":["agents","has_more"],"type":"object"}}}},"400":{"description":"Bad request syntax or unsupported method","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}},"401":{"description":"No permission -- see authorization schemes","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}},"503":{"description":"The server cannot process the request due to a high load","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}}},"tags":["Agents"]},"post":{"summary":"Create Agent","description":"Create an agent, optionally with its full initial configuration inline —\none call provisions a ready-to-publish agent. The agent starts as a draft:\npublish it before creating sessions with it.","security":[{"BearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublicAgentCreatePayload"}}}},"responses":{"201":{"description":"Document created, URL follows","headers":{},"content":{"application/json":{"schema":{"properties":{"agent_id":{"title":"Agent Id","type":"string"},"workspace_id":{"title":"Workspace Id","type":"string"},"name":{"title":"Name","type":"string"},"description":{"default":"","title":"Description","type":"string"},"status":{"enum":["active","archived"],"title":"Status","type":"string"},"publication_state":{"description":"`live` once at least one version is published; `draft` agents cannot take sessions yet.","enum":["live","draft"],"title":"Publication State","type":"string"},"public_enabled":{"default":false,"title":"Public Enabled","type":"boolean"},"allowed_origins":{"items":{"type":"string"},"title":"Allowed Origins","type":"array"},"restrict_origins":{"default":false,"description":"Whether public access is limited to `allowed_origins`. When false, any origin can start a public session.","title":"Restrict Origins","type":"boolean"},"overrides_allowed":{"items":{"enum":["first_message","system_prompt","voice_id","language","asr.model","llm.fallback"],"type":"string"},"title":"Overrides Allowed","type":"array"},"created_at":{"format":"date-time","title":"Created At","type":"string"},"updated_at":{"format":"date-time","title":"Updated At","type":"string"}},"required":["agent_id","workspace_id","name","status","publication_state","created_at","updated_at"],"type":"object"}}}},"401":{"description":"No permission -- see authorization schemes","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}},"403":{"description":"Request forbidden -- authorization will not help","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}},"422":{"description":"","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}},"503":{"description":"The server cannot process the request due to a high load","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}}},"tags":["Agents"],"x-codeSamples":[{"lang":"bash","label":"Create Agent","source":"curl --request POST \\\n  --url https://api.fish.audio/v1/agent/agents \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{\n    \"name\": \"Receptionist\",\n    \"description\": \"Handles inbound calls.\",\n    \"config\": {\n      \"prompt\": {\n        \"system_prompt\": \"You are the receptionist for Fish Dental.\"\n      },\n      \"voice\": {\n        \"voice_id\": \"<voice-model-id>\",\n        \"speaking_language\": \"en\"\n      }\n    }\n  }'"}]}},"/v1/agent/agents/{agent_id}":{"get":{"summary":"Get Agent","description":"Fetch one agent's profile fields. The draft configuration lives at\n`GET /v1/agent/agents/{agent_id}/config`.","security":[{"BearerAuth":[]}],"parameters":[{"in":"path","name":"agent_id","description":"","required":true,"schema":{"title":"Agent Id","type":"string"},"deprecated":false}],"responses":{"200":{"description":"Request fulfilled, document follows","headers":{},"content":{"application/json":{"schema":{"properties":{"agent_id":{"title":"Agent Id","type":"string"},"workspace_id":{"title":"Workspace Id","type":"string"},"name":{"title":"Name","type":"string"},"description":{"default":"","title":"Description","type":"string"},"status":{"enum":["active","archived"],"title":"Status","type":"string"},"publication_state":{"description":"`live` once at least one version is published; `draft` agents cannot take sessions yet.","enum":["live","draft"],"title":"Publication State","type":"string"},"public_enabled":{"default":false,"title":"Public Enabled","type":"boolean"},"allowed_origins":{"items":{"type":"string"},"title":"Allowed Origins","type":"array"},"restrict_origins":{"default":false,"description":"Whether public access is limited to `allowed_origins`. When false, any origin can start a public session.","title":"Restrict Origins","type":"boolean"},"overrides_allowed":{"items":{"enum":["first_message","system_prompt","voice_id","language","asr.model","llm.fallback"],"type":"string"},"title":"Overrides Allowed","type":"array"},"created_at":{"format":"date-time","title":"Created At","type":"string"},"updated_at":{"format":"date-time","title":"Updated At","type":"string"}},"required":["agent_id","workspace_id","name","status","publication_state","created_at","updated_at"],"type":"object"}}}},"401":{"description":"No permission -- see authorization schemes","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}},"404":{"description":"Nothing matches the given URI","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}},"503":{"description":"The server cannot process the request due to a high load","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}}},"tags":["Agents"]},"patch":{"summary":"Update Agent","description":"Update agent-level fields (name, description, status, public access and\nsession-override policy). Omitted fields keep their value. Conversation\nbehavior — voice, prompt, recording and the rest — is draft configuration:\nuse `PATCH /v1/agent/agents/{agent_id}/config`.","security":[{"BearerAuth":[]}],"parameters":[{"in":"path","name":"agent_id","description":"","required":true,"schema":{"title":"Agent Id","type":"string"},"deprecated":false}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublicAgentUpdatePayload"}}}},"responses":{"200":{"description":"Request fulfilled, document follows","headers":{},"content":{"application/json":{"schema":{"properties":{"agent_id":{"title":"Agent Id","type":"string"},"workspace_id":{"title":"Workspace Id","type":"string"},"name":{"title":"Name","type":"string"},"description":{"default":"","title":"Description","type":"string"},"status":{"enum":["active","archived"],"title":"Status","type":"string"},"publication_state":{"description":"`live` once at least one version is published; `draft` agents cannot take sessions yet.","enum":["live","draft"],"title":"Publication State","type":"string"},"public_enabled":{"default":false,"title":"Public Enabled","type":"boolean"},"allowed_origins":{"items":{"type":"string"},"title":"Allowed Origins","type":"array"},"restrict_origins":{"default":false,"description":"Whether public access is limited to `allowed_origins`. When false, any origin can start a public session.","title":"Restrict Origins","type":"boolean"},"overrides_allowed":{"items":{"enum":["first_message","system_prompt","voice_id","language","asr.model","llm.fallback"],"type":"string"},"title":"Overrides Allowed","type":"array"},"created_at":{"format":"date-time","title":"Created At","type":"string"},"updated_at":{"format":"date-time","title":"Updated At","type":"string"}},"required":["agent_id","workspace_id","name","status","publication_state","created_at","updated_at"],"type":"object"}}}},"401":{"description":"No permission -- see authorization schemes","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}},"404":{"description":"Nothing matches the given URI","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}},"422":{"description":"","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}},"503":{"description":"The server cannot process the request due to a high load","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}}},"tags":["Agents"]},"delete":{"summary":"Delete Agent","description":"Delete an agent together with its configuration and version history.\nExisting session records are retained.","security":[{"BearerAuth":[]}],"parameters":[{"in":"path","name":"agent_id","description":"","required":true,"schema":{"title":"Agent Id","type":"string"},"deprecated":false}],"responses":{"204":{"description":"Request fulfilled, nothing follows","headers":{}},"401":{"description":"No permission -- see authorization schemes","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}},"404":{"description":"Nothing matches the given URI","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}},"503":{"description":"The server cannot process the request due to a high load","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}}},"tags":["Agents"]}},"/v1/agent/agents/{agent_id}/widget":{"get":{"summary":"Get Widget Config","description":"Unauthenticated display configuration for the embeddable `<fish-agent>`\nwidget. Only agents published as public are reachable. When the agent\nrestricts origins, the request `Origin` must match its allowed origins,\nthe same gate as anonymous session creation. Attributes set on the embed tag override\nevery field returned here.","parameters":[{"in":"path","name":"agent_id","description":"","required":true,"schema":{"title":"Agent Id","type":"string"},"deprecated":false},{"in":"header","name":"origin","description":"","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Origin"},"deprecated":false}],"responses":{"200":{"description":"Request fulfilled, document follows","headers":{},"content":{"application/json":{"schema":{"description":"Display config for the embeddable `<fish-agent>` widget.\n\nServed without authentication for public agents; HTML attributes on the\nembed tag override every field. Grows alongside the Builder widget tab\n(greeting, policy switches, styles) — additions only, never renames.","properties":{"agent_name":{"title":"Agent Name","type":"string"}},"required":["agent_name"],"type":"object"}}}},"403":{"description":"Request forbidden -- authorization will not help","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}},"404":{"description":"Nothing matches the given URI","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}}},"tags":["Agents"]}},"/v1/agent/agents/{agent_id}/config":{"get":{"summary":"Get Draft Config","description":"Read the agent's current draft configuration — the state the next publish\nwill freeze. Sessions run the latest published version, not the draft; use\nthe versions endpoints to see what is live. Webhook signing secrets are\nwrite-only and reported as `has_secret`.","security":[{"BearerAuth":[]}],"parameters":[{"in":"path","name":"agent_id","description":"","required":true,"schema":{"title":"Agent Id","type":"string"},"deprecated":false}],"responses":{"200":{"description":"Request fulfilled, document follows","headers":{},"content":{"application/json":{"schema":{"properties":{"agent_id":{"title":"Agent Id","type":"string"},"config_hash":{"description":"Opaque content hash of this configuration as stored. On a draft it is the config_hash the next publish gives the version, so it equals the live version's config_hash when nothing is unpublished. Pass it to Publish Agent as expected_config_hash.","title":"Config Hash","type":"string"},"prompt":{"$ref":"#/components/schemas/AgentPromptConfigView"},"voice":{"$ref":"#/components/schemas/PublicAgentVoiceConfig"},"asr":{"$ref":"#/components/schemas/PublicAgentAsrConfig"},"conversation":{"$ref":"#/components/schemas/AgentConversationConfig"},"tools":{"$ref":"#/components/schemas/PublicAgentToolsConfig"},"webhooks":{"$ref":"#/components/schemas/PublicAgentWebhooksConfig"},"knowledge_base":{"$ref":"#/components/schemas/PublicAgentKnowledgeBaseConfig"},"analysis":{"$ref":"#/components/schemas/AgentAnalysisConfig"},"guardrails":{"$ref":"#/components/schemas/AgentGuardrailsConfig"},"context":{"$ref":"#/components/schemas/AgentContextConfig"},"llm":{"$ref":"#/components/schemas/AgentLLMConfigRedacted"},"variables":{"$ref":"#/components/schemas/AgentVariablesConfig"},"updated_at":{"format":"date-time","title":"Updated At","type":"string"}},"required":["agent_id","config_hash","prompt","voice","asr","conversation","tools","webhooks","knowledge_base","analysis","guardrails","context","llm","updated_at"],"type":"object"}}}},"401":{"description":"No permission -- see authorization schemes","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}},"404":{"description":"Nothing matches the given URI","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}},"503":{"description":"The server cannot process the request due to a high load","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}}},"tags":["Agents"]},"patch":{"summary":"Update Draft Config","description":"Patch the draft configuration section by section; omitted sections keep\ntheir value. Changes only affect live sessions after the next publish.\n`prompt.system_prompt` is limited to 64000 tokens, 32000 when `llm.model`\nis `google/gemma-4-26b-a4b-it` (422 beyond); keeping it under 2000 tokens\nis recommended for latency and cost.\n`voice.voice_id` accepts any public voice model id.\n`voice.speaking_language` accepts any of the 52 supported ISO 639-1 codes\n(the same set the console offers, see the Voice & language docs); anything else is 422. `voice.expressive` (default `true`) enables richer\nexpressive delivery (emotion steering, laughter and sounds, pauses); off\nkeeps the standard delivery. The `asr` section configures speech\nrecognition. `asr.model` picks the model when `voice.engine` is `fish_tts`:\n`fish_audio:transcribe-stream-2` or `fish_audio:transcribe-stream-1` (Fish\nrealtime recognition, which also decides end of turn and whether the caller\nis interrupting), or `deepgram:nova-3`. Under `live3`, speech recognition\nis managed automatically by the platform. Its former id\n`fish_audio:transcribe-1-pro-realtime` is still accepted and reads back as\n`fish_audio:transcribe-stream-1`.\n`asr.multilingual` (default `false`) lets recognition follow callers who\nswitch language mid-call, off tells the recognizer to expect\n`voice.speaking_language` (models other than `deepgram:nova-3` may still\ntranscribe clear speech in another language). `asr.strict_language`\n(default `false`) enforces `voice.speaking_language` whatever\n`asr.multilingual` says: speech recognized as another language reaches the\nagent as `[unintelligible speech]`. Language is detected per utterance, so\na short or heavily accented phrase in the speaking language can\noccasionally be detected as another language and replaced too. Only\nenable it when you explicitly need to stop the agent from understanding\nother languages.\n`asr.keyterms` is a recognition\nvocabulary of up to 50 plain terms (brand names, product terms, personal\nnames), each at most 100 characters with no commas or semicolons. `[]`\nclears it and 20-50 focused terms work best.\n`voice.background_sound` sets a looping ambience the worker mixes under\nthe agent's voice: `preset` is `off` (default) or one of `office`,\n`call_center`, `restaurant`, `cafe`, `city_street`, `phone_line`, `phone_line_digital`,\n`custom`. `volume` (0-1, default 0.15) is the\nambience's gain relative to the voice. `custom_asset_id` names a clip\nuploaded through `POST /v1/agent/background-sounds`; required with\n`preset: \"custom\"`, refused otherwise (422). Replaces the whole object;\nan explicit null resets it to off. `tool_ids` and\n`knowledge_source_ids` replace their attachment lists wholesale and every\nid must resolve, else 422. `llm.custom` points the agent at your own\nOpenAI-compatible endpoint; mutually exclusive with `llm.model`, cleared\nwith an explicit null. `llm.fallback` sets what the agent tries after its\nmodel fails: `platform` (default), `manual` (`models` in order, 1 to 3)\nor `off`. In `manual`, each model and `primary` (the agent's own model)\ntake optional `ttft_timeout_ms` (500-30000, default 5000 ms, i.e. 5\nseconds, when not set) and `total_timeout_ms` (1000-120000, at least\n`ttft_timeout_ms` when both are set, no limit when not set), and the\nfirst model can set\n`parallel.kick_in_ms` (300-10000, default 1500) to run alongside the\nagent's own model.\n\nThe response is the draft as stored, which can differ from the request:\n- Every field comes back. Omitted fields keep their value or default.\n- `asr.keyterms` and `voice.pronunciation_dictionary_ids` are trimmed\n  and de-duplicated in order. `tool_ids` is de-duplicated in order.\n- A tool that was archived drops out of `tool_ids` at the next tools\n  write.\n- `conversation.interruption_ignore_phrases` collapses inner spaces and\n  drops case-insensitive duplicates.\n- `conversation.timezone`, transfer phone numbers and transfer text\n  fields are trimmed.\n- `conversation.eagerness` and `conversation.response_wait_ms` move\n  together. The wait wins when both are sent, and the tier is derived\n  from it.\n- `conversation.response_max_wait_ms: 0` reads back as `null`\n  (automatic).\n- `conversation.backchannel` keeps the fields you omit.\n  `strength: null` goes back to the speech engine's own setting.\n- `conversation.reengage` keeps the fields you omit, and\n  `conversation.reengage.schedule` reads back as\n  `conversation.reengage.steps`.\n- `conversation` also returns `reengage_enabled`, copied from\n  `reengage.enabled`. It is deprecated.\n- `knowledge_base.enabled` becomes `true` when you attach sources and\n  omit it.\n- `llm.custom.base_url` drops a trailing `/` and `/chat/completions`.\n  `llm.custom.model` is trimmed. Setting `llm.custom` resets `llm.model`\n  to the platform default.\n- Secrets read back as `has_secret`, and `llm.custom.api_key` as `null`.\n- `voice.voice_id` reads back as the name while the agent speaks one of\n  the `live3` voices. Switching `voice.engine` to `fish_tts` returns it\n  to the agent's Voice Library voice, and switching back to `live3`\n  restores the name. A new agent, and one still on the default voice\n  when it switches to `live3`, starts on `clara`.\n- `voice.live3_voice` is deprecated and mirrors that name capitalized\n  (`Clara`), `null` when `voice.voice_id` is a Voice Library voice.\n- `voice` also returns `keyterms`, `multilingual_asr` and `asr_model`\n  copied from `asr`. They are deprecated.\n- `config_hash` and `updated_at` are set by the server.\n\nCompare against this response, or against `config_hash`, rather than the\nrequest body. Publishing never rewrites these values.","security":[{"BearerAuth":[]}],"parameters":[{"in":"path","name":"agent_id","description":"","required":true,"schema":{"title":"Agent Id","type":"string"},"deprecated":false}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublicAgentConfigPatchPayload"}}}},"responses":{"200":{"description":"Request fulfilled, document follows","headers":{},"content":{"application/json":{"schema":{"properties":{"agent_id":{"title":"Agent Id","type":"string"},"config_hash":{"description":"Opaque content hash of this configuration as stored. On a draft it is the config_hash the next publish gives the version, so it equals the live version's config_hash when nothing is unpublished. Pass it to Publish Agent as expected_config_hash.","title":"Config Hash","type":"string"},"prompt":{"$ref":"#/components/schemas/AgentPromptConfigView"},"voice":{"$ref":"#/components/schemas/PublicAgentVoiceConfig"},"asr":{"$ref":"#/components/schemas/PublicAgentAsrConfig"},"conversation":{"$ref":"#/components/schemas/AgentConversationConfig"},"tools":{"$ref":"#/components/schemas/PublicAgentToolsConfig"},"webhooks":{"$ref":"#/components/schemas/PublicAgentWebhooksConfig"},"knowledge_base":{"$ref":"#/components/schemas/PublicAgentKnowledgeBaseConfig"},"analysis":{"$ref":"#/components/schemas/AgentAnalysisConfig"},"guardrails":{"$ref":"#/components/schemas/AgentGuardrailsConfig"},"context":{"$ref":"#/components/schemas/AgentContextConfig"},"llm":{"$ref":"#/components/schemas/AgentLLMConfigRedacted"},"variables":{"$ref":"#/components/schemas/AgentVariablesConfig"},"updated_at":{"format":"date-time","title":"Updated At","type":"string"}},"required":["agent_id","config_hash","prompt","voice","asr","conversation","tools","webhooks","knowledge_base","analysis","guardrails","context","llm","updated_at"],"type":"object"}}}},"401":{"description":"No permission -- see authorization schemes","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}},"403":{"description":"Request forbidden -- authorization will not help","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}},"404":{"description":"Nothing matches the given URI","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}},"409":{"description":"Request conflict","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}},"422":{"description":"","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}},"503":{"description":"The server cannot process the request due to a high load","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}}},"tags":["Agents"],"x-codeSamples":[{"lang":"bash","label":"Update Draft Config","source":"curl --request PATCH \\\n  --url https://api.fish.audio/v1/agent/agents/<agent-id>/config \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{\n    \"prompt\": {\n      \"system_prompt\": \"You are the receptionist for Fish Dental.\"\n    },\n    \"webhooks\": {\n      \"post_call\": [\n        {\n          \"url\": \"https://example.com/hooks/fish\",\n          \"secret\": \"<signing-secret>\"\n        }\n      ]\n    }\n  }'"}]}},"/v1/agent/agents/{agent_id}/publish":{"post":{"summary":"Publish Agent","description":"Freeze the current draft into an immutable version and make it the live\nconfiguration for new sessions. Each new version gets the next\nversion_number. If the draft already matches the live version, no version\nis created and the live version comes back with `created: false`.\n\nThe response describes what was published:\n- `version_number` and `config_hash` identify the version.\n- `config` is the configuration exactly as published. Check your\n  read-back against it, not against the request you sent.\n- `created` tells whether this call made a new version.\n\nPublishing copies the draft as it is stored. It does not change any field.\nWrites do normalize some values, see Update Draft Config.\n\nThe body is optional:\n- `expected_config_hash` publishes only while the draft still has that\n  config_hash. Take it from Get Draft Config or Update Draft Config. On a\n  mismatch the call returns 409 with `reason: \"draft_changed\"` and the\n  draft's current `config_hash`. Nothing is written.\n- `config` applies draft changes first, in the same shape as Update Draft\n  Config. The changes and the publish are one atomic step. If either fails,\n  the draft stays as it was.\n- With both, `expected_config_hash` is checked against the draft before\n  `config` is applied.\n- `version_title` and `version_description` label a new version.","security":[{"BearerAuth":[]}],"parameters":[{"in":"path","name":"agent_id","description":"","required":true,"schema":{"title":"Agent Id","type":"string"},"deprecated":false}],"responses":{"200":{"description":"Request fulfilled, document follows","headers":{},"content":{"application/json":{"schema":{"properties":{"version_number":{"title":"Version Number","type":"integer"},"version_title":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Version Title"},"version_description":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Version Description"},"config_hash":{"title":"Config Hash","type":"string"},"published_at":{"format":"date-time","title":"Published At","type":"string"},"config":{"$ref":"#/components/schemas/PublicAgentConfigEntity","description":"The immutable configuration snapshot this version pinned at publish time."},"created":{"description":"Whether this call created a new version. False when the draft already matched the live version, which is returned unchanged.","title":"Created","type":"boolean"}},"required":["version_number","config_hash","published_at","config","created"],"type":"object"}}}},"401":{"description":"No permission -- see authorization schemes","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}},"404":{"description":"Nothing matches the given URI","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}},"409":{"description":"Request conflict","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}},"422":{"description":"","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}},"503":{"description":"The server cannot process the request due to a high load","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}}},"tags":["Agents"],"x-codeSamples":[{"lang":"bash","label":"Publish","source":"curl --request POST \\\n  --url https://api.fish.audio/v1/agent/agents/<agent-id>/publish \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{\n    \"version_title\": \"Tighter greeting\"\n  }'"}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"version_title":{"type":"string","maxLength":120,"description":"Optional label shown in the version history."},"version_description":{"type":"string","maxLength":2000,"description":"Optional longer note for audit and rollback context."},"expected_config_hash":{"type":"string","maxLength":128,"description":"Publish only while the draft has this config_hash. Otherwise 409 with reason `draft_changed` and nothing is written."},"config":{"allOf":[{"$ref":"#/components/schemas/PublicAgentConfigPatchPayload"}],"description":"Draft changes to apply before publishing, same shape as Update Draft Config. The write and the publish succeed or fail together."}}}}}}}},"/v1/agent/agents/{agent_id}/versions":{"get":{"summary":"List Agent Versions","description":"The publish history, newest first. The highest version_number is what live\nsessions run. Compare a version's config_hash with the draft's to detect\nunpublished changes. A version published before a change in how the hash\nis computed keeps the hash it froze with; a publish that finds the draft\nunchanged realigns the live version's hash instead of creating an\nidentical version. Superseded versions keep their frozen hash.","security":[{"BearerAuth":[]}],"parameters":[{"in":"path","name":"agent_id","description":"","required":true,"schema":{"title":"Agent Id","type":"string"},"deprecated":false},{"in":"query","name":"cursor","description":"","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Cursor"},"deprecated":false},{"in":"query","name":"page","description":"1-based page number; mutually exclusive with cursor.","required":false,"schema":{"anyOf":[{"minimum":1,"type":"integer"},{"type":"null"}],"default":null,"title":"Page"},"deprecated":false},{"in":"query","name":"include_total","description":"","required":false,"schema":{"default":false,"title":"Include Total","type":"boolean"},"deprecated":false},{"in":"query","name":"page_size","description":"","required":false,"schema":{"default":30,"maximum":100,"minimum":1,"title":"Page Size","type":"integer"},"deprecated":false}],"responses":{"200":{"description":"Request fulfilled, document follows","headers":{},"content":{"application/json":{"schema":{"properties":{"versions":{"items":{"$ref":"#/components/schemas/PublicAgentVersionSummary"},"title":"Versions","type":"array"},"has_more":{"title":"Has More","type":"boolean"},"next_cursor":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Next Cursor"},"total":{"anyOf":[{"type":"integer"},{"type":"null"}],"default":null,"title":"Total"}},"required":["versions","has_more"],"type":"object"}}}},"400":{"description":"Bad request syntax or unsupported method","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}},"401":{"description":"No permission -- see authorization schemes","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}},"404":{"description":"Nothing matches the given URI","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}},"503":{"description":"The server cannot process the request due to a high load","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}}},"tags":["Agents"]}},"/v1/agent/agents/{agent_id}/versions/{version_number}":{"get":{"summary":"Get Agent Version","description":"One published version with its full frozen configuration snapshot —\nincluding the current live version. Secrets inside the snapshot are\nredacted the same way as the draft config. The snapshot equals the draft\nit froze, except `config.updated_at`, which is the publish time.","security":[{"BearerAuth":[]}],"parameters":[{"in":"path","name":"agent_id","description":"","required":true,"schema":{"title":"Agent Id","type":"string"},"deprecated":false},{"in":"path","name":"version_number","description":"","required":true,"schema":{"title":"Version Number","type":"integer"},"deprecated":false}],"responses":{"200":{"description":"Request fulfilled, document follows","headers":{},"content":{"application/json":{"schema":{"properties":{"version_number":{"title":"Version Number","type":"integer"},"version_title":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Version Title"},"version_description":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Version Description"},"config_hash":{"title":"Config Hash","type":"string"},"published_at":{"format":"date-time","title":"Published At","type":"string"},"config":{"$ref":"#/components/schemas/PublicAgentConfigEntity","description":"The immutable configuration snapshot this version pinned at publish time."}},"required":["version_number","config_hash","published_at","config"],"type":"object"}}}},"401":{"description":"No permission -- see authorization schemes","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}},"404":{"description":"Nothing matches the given URI","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}},"503":{"description":"The server cannot process the request due to a high load","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}}},"tags":["Agents"]}},"/v1/agent/agents/{agent_id}/tests/{test_id}":{"put":{"summary":"Attach Test","description":"Attach a test to an agent so the agent's test runs include it. Attaching\nan attached test does nothing. The agent and the test must be in the same\nworkspace.","security":[{"BearerAuth":[]}],"parameters":[{"in":"path","name":"agent_id","description":"","required":true,"schema":{"title":"Agent Id","type":"string"},"deprecated":false},{"in":"path","name":"test_id","description":"","required":true,"schema":{"title":"Test Id","type":"string"},"deprecated":false}],"responses":{"204":{"description":"Request fulfilled, nothing follows","headers":{}},"400":{"description":"Bad request syntax or unsupported method","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}},"401":{"description":"No permission -- see authorization schemes","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}},"404":{"description":"Nothing matches the given URI","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}},"503":{"description":"The server cannot process the request due to a high load","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}}},"tags":["Agent Tests"]},"delete":{"summary":"Detach Test","description":"Detach a test from an agent. The test itself stays in your library.\nDetaching a test that is not attached does nothing.","security":[{"BearerAuth":[]}],"parameters":[{"in":"path","name":"agent_id","description":"","required":true,"schema":{"title":"Agent Id","type":"string"},"deprecated":false},{"in":"path","name":"test_id","description":"","required":true,"schema":{"title":"Test Id","type":"string"},"deprecated":false}],"responses":{"204":{"description":"Request fulfilled, nothing follows","headers":{}},"400":{"description":"Bad request syntax or unsupported method","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}},"401":{"description":"No permission -- see authorization schemes","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}},"404":{"description":"Nothing matches the given URI","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}},"503":{"description":"The server cannot process the request due to a high load","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}}},"tags":["Agent Tests"]}},"/v1/agent/agents/{agent_id}/tests/run":{"post":{"summary":"Run Tests","description":"Start a batch that runs the agent's attached tests against its current\ndraft, one run per test and repeat. Say which tests with one of `all`,\n`test_ids` and `folder_id`. `all` set to `true` runs every attached test,\n`test_ids` runs the listed tests, and `folder_id` runs the attached tests\nof one test folder. A request that names none of the three still runs\nevery attached test. That form is deprecated, send `all` set to `true`\ninstead. Which tests run is settled when the batch starts. A simulation\ntest repeats\n`simulation.repeat_count` times, and a `repeat_count` in the body repeats\nevery selected test that many times instead. A batch starts at most 1000\nruns. Runs are queued and finish in the background, simulations take\nminutes. Poll\n`GET /v1/agent/agents/{agent_id}/test-batches/{batch_id}?include_runs=false`\nuntil `completed` is true, then gate on the batch's counts. To require\nevery run to pass, compare `passed` with `run_count`, or require `failed`,\n`errors` and `cancelled` all to be 0. A gate on `pass_rate`, which leaves\nout runs without a verdict, should also require `cancelled` to be 0. Stop\na batch with\n`POST /v1/agent/agents/{agent_id}/test-batches/{batch_id}/cancel`.\nA `name` in the body names the batch in the run history, and\n`PATCH /v1/agent/agents/{agent_id}/test-batches/{batch_id}` changes it\nlater.\n\nEach run that ends `passed` or `failed` is billed a platform fee per\nagent reply plus the LLM tokens it used. A `next_reply` or `tool` run is\none reply, with the tokens of the agent and, on `next_reply`, of the\njudge. A simulation run bills every agent reply, with the tokens of the\nagent, the simulated user and the judge. `error` and `cancelled` runs are\nnot billed. A batch returns 402 when the team has no available Agent\ncredit and does not have an active, unsuspended contract or an Agent\noverdraft exemption. A `folder_id` that is not a folder, or that holds no\ntest attached to the agent, is a 400.","security":[{"BearerAuth":[]}],"parameters":[{"in":"path","name":"agent_id","description":"","required":true,"schema":{"title":"Agent Id","type":"string"},"deprecated":false}],"responses":{"202":{"description":"Request accepted, processing continues off-line","headers":{},"content":{"application/json":{"schema":{"properties":{"batch_id":{"title":"Batch Id","type":"string"},"agent_id":{"title":"Agent Id","type":"string"},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"description":"The name of the batch, null when it has none.","title":"Name"},"status":{"description":"running until every run has finished.","enum":["running","completed"],"title":"Status","type":"string"},"completed":{"title":"Completed","type":"boolean"},"run_count":{"description":"Every run of the batch, one per test and repeat. It is `queued` + `running` + `passed` + `failed` + `errors` + `cancelled`.","title":"Run Count","type":"integer"},"queued":{"description":"Runs that have not started.","title":"Queued","type":"integer"},"running":{"description":"Runs in progress.","title":"Running","type":"integer"},"passed":{"title":"Passed","type":"integer"},"failed":{"title":"Failed","type":"integer"},"errors":{"description":"Runs in status `error`, which finished without a verdict.","title":"Errors","type":"integer"},"cancelled":{"description":"Runs in status `cancelled`. They are not counted in `errors`.","title":"Cancelled","type":"integer"},"pass_rate":{"anyOf":[{"type":"number"},{"type":"null"}],"default":null,"description":"passed / (passed + failed), null until a run passed or failed. Runs without a verdict (`error`, `cancelled`) never judged the agent and are left out.","title":"Pass Rate"},"cancelled_at":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}],"default":null,"description":"When the batch was first cancelled, null if it never was.","title":"Cancelled At"},"trigger_source":{"description":"Where the batch was started: the console or the API.","enum":["console","api"],"title":"Trigger Source","type":"string"},"created_at":{"description":"When the first run was created.","format":"date-time","title":"Created At","type":"string"},"finished_at":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}],"default":null,"description":"When the last run finished, null until the batch completed.","title":"Finished At"},"runs":{"description":"The runs of the batch. The list is empty where the runs are left out, with `include_runs=false` and in the answers to a cancel and to an update.","items":{"$ref":"#/components/schemas/PublicAgentTestRun"},"title":"Runs","type":"array"}},"required":["batch_id","agent_id","status","completed","run_count","queued","running","passed","failed","errors","cancelled","trigger_source","created_at","runs"],"type":"object"}}}},"400":{"description":"Bad request syntax or unsupported method","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}},"401":{"description":"No permission -- see authorization schemes","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}},"402":{"description":"No payment -- see charging schemes","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}},"403":{"description":"Request forbidden -- authorization will not help","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}},"404":{"description":"Nothing matches the given URI","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}},"422":{"description":"","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}},"503":{"description":"The server cannot process the request due to a high load","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}}},"tags":["Agent Tests"],"x-codeSamples":[{"lang":"bash","label":"Run Tests","source":"curl --request POST \\\n  --url https://api.fish.audio/v1/agent/agents/<agent-id>/tests/run \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{\"all\": true}'"}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"all":{"type":"boolean","enum":[true],"description":"Set to `true` to run every test attached to the agent. `false` is not accepted. Cannot be combined with `test_ids` or `folder_id`."},"test_ids":{"type":"array","items":{"type":"string"},"minItems":1,"description":"Run only these tests, which must be attached to the agent. Cannot be combined with `all` or `folder_id`."},"folder_id":{"type":"string","description":"Run only the tests of this test folder that are attached to the agent. Cannot be combined with `all` or `test_ids`."},"repeat_count":{"type":"integer","minimum":1,"maximum":20,"description":"Run every selected test this many times in this batch, in place of each test's own repeat count."},"name":{"anyOf":[{"type":"string","minLength":1,"maxLength":120},{"type":"null"}],"description":"A name for the batch, shown in the run history. 1 to 120 characters after leading and trailing whitespace is removed. Left out or null, the batch has no name. It does not select tests and goes with any of `all`, `test_ids` and `folder_id`."}}}}}}}},"/v1/agent/agents/{agent_id}/test-tools":{"get":{"summary":"List Test Tools","description":"The tools a test can reference for this agent, exactly what a\nconversation on its draft offers. Use these ids in a test's tool mocks,\nassertions and `referenced_tool`, including integration tools such as\n`google_calendar:create_event` and the system tools the agent has turned\non, such as `_end_call`. A system tool can be checked but never mocked.","security":[{"BearerAuth":[]}],"parameters":[{"in":"path","name":"agent_id","description":"","required":true,"schema":{"title":"Agent Id","type":"string"},"deprecated":false}],"responses":{"200":{"description":"Request fulfilled, document follows","headers":{},"content":{"application/json":{"schema":{"properties":{"tools":{"items":{"$ref":"#/components/schemas/PublicAgentTestTool"},"title":"Tools","type":"array"}},"required":["tools"],"type":"object"}}}},"401":{"description":"No permission -- see authorization schemes","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}},"404":{"description":"Nothing matches the given URI","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}},"503":{"description":"The server cannot process the request due to a high load","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}}},"tags":["Agent Tests"]}},"/v1/agent/agents/{agent_id}/test-batches":{"get":{"summary":"List Test Batches","description":"The agent's test batches, newest first, with their counts by run status.\nBatches are ordered by their newest run. Two batches whose runs were\ncreated at the same time can come in either order of their `created_at`,\nwhich is the time of a batch's first run. Paginate with `cursor`,\nfollowing `next_cursor` while `has_more` is true.","security":[{"BearerAuth":[]}],"parameters":[{"in":"path","name":"agent_id","description":"","required":true,"schema":{"title":"Agent Id","type":"string"},"deprecated":false},{"in":"query","name":"cursor","description":"","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Cursor"},"deprecated":false},{"in":"query","name":"page_size","description":"","required":false,"schema":{"default":30,"maximum":100,"minimum":1,"title":"Page Size","type":"integer"},"deprecated":false}],"responses":{"200":{"description":"Request fulfilled, document follows","headers":{},"content":{"application/json":{"schema":{"properties":{"batches":{"items":{"$ref":"#/components/schemas/PublicAgentTestBatchSummary"},"title":"Batches","type":"array"},"has_more":{"title":"Has More","type":"boolean"},"next_cursor":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Next Cursor"}},"required":["batches","has_more"],"type":"object"}}}},"400":{"description":"Bad request syntax or unsupported method","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}},"401":{"description":"No permission -- see authorization schemes","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}},"404":{"description":"Nothing matches the given URI","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}},"503":{"description":"The server cannot process the request due to a high load","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}}},"tags":["Agent Tests"]}},"/v1/agent/agents/{agent_id}/test-batches/{batch_id}":{"get":{"summary":"Get Test Batch","description":"One batch with its counts by run status and, unless `include_runs=false`,\nits runs in full. `status` is `running` until every run has finished, then\n`completed`. `run_count - queued - running` runs have finished so far.\nOnce it is completed, list the runs that did not pass with\n`GET /v1/agent/test-runs?batch_id=<batch_id>` and `status=failed`,\n`status=error` or `status=cancelled`.","security":[{"BearerAuth":[]}],"parameters":[{"in":"path","name":"agent_id","description":"","required":true,"schema":{"title":"Agent Id","type":"string"},"deprecated":false},{"in":"path","name":"batch_id","description":"","required":true,"schema":{"title":"Batch Id","type":"string"},"deprecated":false},{"in":"query","name":"include_runs","description":"false leaves the runs out. `runs` is then an empty list and the answer is the counts alone, which is all a poll needs.","required":false,"schema":{"default":true,"title":"Include Runs","type":"boolean"},"deprecated":false}],"responses":{"200":{"description":"Request fulfilled, document follows","headers":{},"content":{"application/json":{"schema":{"properties":{"batch_id":{"title":"Batch Id","type":"string"},"agent_id":{"title":"Agent Id","type":"string"},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"description":"The name of the batch, null when it has none.","title":"Name"},"status":{"description":"running until every run has finished.","enum":["running","completed"],"title":"Status","type":"string"},"completed":{"title":"Completed","type":"boolean"},"run_count":{"description":"Every run of the batch, one per test and repeat. It is `queued` + `running` + `passed` + `failed` + `errors` + `cancelled`.","title":"Run Count","type":"integer"},"queued":{"description":"Runs that have not started.","title":"Queued","type":"integer"},"running":{"description":"Runs in progress.","title":"Running","type":"integer"},"passed":{"title":"Passed","type":"integer"},"failed":{"title":"Failed","type":"integer"},"errors":{"description":"Runs in status `error`, which finished without a verdict.","title":"Errors","type":"integer"},"cancelled":{"description":"Runs in status `cancelled`. They are not counted in `errors`.","title":"Cancelled","type":"integer"},"pass_rate":{"anyOf":[{"type":"number"},{"type":"null"}],"default":null,"description":"passed / (passed + failed), null until a run passed or failed. Runs without a verdict (`error`, `cancelled`) never judged the agent and are left out.","title":"Pass Rate"},"cancelled_at":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}],"default":null,"description":"When the batch was first cancelled, null if it never was.","title":"Cancelled At"},"trigger_source":{"description":"Where the batch was started: the console or the API.","enum":["console","api"],"title":"Trigger Source","type":"string"},"created_at":{"description":"When the first run was created.","format":"date-time","title":"Created At","type":"string"},"finished_at":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}],"default":null,"description":"When the last run finished, null until the batch completed.","title":"Finished At"},"runs":{"description":"The runs of the batch. The list is empty where the runs are left out, with `include_runs=false` and in the answers to a cancel and to an update.","items":{"$ref":"#/components/schemas/PublicAgentTestRun"},"title":"Runs","type":"array"}},"required":["batch_id","agent_id","status","completed","run_count","queued","running","passed","failed","errors","cancelled","trigger_source","created_at","runs"],"type":"object"}}}},"401":{"description":"No permission -- see authorization schemes","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}},"404":{"description":"Nothing matches the given URI","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}},"503":{"description":"The server cannot process the request due to a high load","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}}},"tags":["Agent Tests"],"x-codeSamples":[{"lang":"bash","label":"Poll Test Batch","source":"curl --request GET \\\n  --url 'https://api.fish.audio/v1/agent/agents/<agent-id>/test-batches/<batch-id>?include_runs=false' \\\n  --header 'Authorization: Bearer <token>'"}]},"patch":{"summary":"Update Test Batch","description":"Name a batch, rename it, or remove its name with `name` set to null. The\nname is what the run history shows for the batch. Two batches can have the\nsame name. A batch can be renamed while it runs and after it has\ncompleted, and a rename changes no run, no count and no charge. The answer\nis the batch with its current counts and an empty `runs`.","security":[{"BearerAuth":[]}],"parameters":[{"in":"path","name":"agent_id","description":"","required":true,"schema":{"title":"Agent Id","type":"string"},"deprecated":false},{"in":"path","name":"batch_id","description":"","required":true,"schema":{"title":"Batch Id","type":"string"},"deprecated":false}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublicAgentTestBatchUpdatePayload"}}}},"responses":{"200":{"description":"Request fulfilled, document follows","headers":{},"content":{"application/json":{"schema":{"properties":{"batch_id":{"title":"Batch Id","type":"string"},"agent_id":{"title":"Agent Id","type":"string"},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"description":"The name of the batch, null when it has none.","title":"Name"},"status":{"description":"running until every run has finished.","enum":["running","completed"],"title":"Status","type":"string"},"completed":{"title":"Completed","type":"boolean"},"run_count":{"description":"Every run of the batch, one per test and repeat. It is `queued` + `running` + `passed` + `failed` + `errors` + `cancelled`.","title":"Run Count","type":"integer"},"queued":{"description":"Runs that have not started.","title":"Queued","type":"integer"},"running":{"description":"Runs in progress.","title":"Running","type":"integer"},"passed":{"title":"Passed","type":"integer"},"failed":{"title":"Failed","type":"integer"},"errors":{"description":"Runs in status `error`, which finished without a verdict.","title":"Errors","type":"integer"},"cancelled":{"description":"Runs in status `cancelled`. They are not counted in `errors`.","title":"Cancelled","type":"integer"},"pass_rate":{"anyOf":[{"type":"number"},{"type":"null"}],"default":null,"description":"passed / (passed + failed), null until a run passed or failed. Runs without a verdict (`error`, `cancelled`) never judged the agent and are left out.","title":"Pass Rate"},"cancelled_at":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}],"default":null,"description":"When the batch was first cancelled, null if it never was.","title":"Cancelled At"},"trigger_source":{"description":"Where the batch was started: the console or the API.","enum":["console","api"],"title":"Trigger Source","type":"string"},"created_at":{"description":"When the first run was created.","format":"date-time","title":"Created At","type":"string"},"finished_at":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}],"default":null,"description":"When the last run finished, null until the batch completed.","title":"Finished At"},"runs":{"description":"The runs of the batch. The list is empty where the runs are left out, with `include_runs=false` and in the answers to a cancel and to an update.","items":{"$ref":"#/components/schemas/PublicAgentTestRun"},"title":"Runs","type":"array"}},"required":["batch_id","agent_id","status","completed","run_count","queued","running","passed","failed","errors","cancelled","trigger_source","created_at","runs"],"type":"object"}}}},"401":{"description":"No permission -- see authorization schemes","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}},"404":{"description":"Nothing matches the given URI","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}},"422":{"description":"","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}},"503":{"description":"The server cannot process the request due to a high load","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}}},"tags":["Agent Tests"]}},"/v1/agent/agents/{agent_id}/test-batches/{batch_id}/cancel":{"post":{"summary":"Cancel Test Batch","description":"Cancel the runs of a batch that have not started. Send no body. Runs in\nstatus `queued` end as `cancelled`, with the time of the cancel as their\n`finished_at`, and are not billed. Runs in progress are not interrupted.\nThey finish with their result and are billed, and the batch turns\n`completed` once they have. The answer is the batch with its counts after\nthe cancel and an empty `runs`. Cancelling a batch that has completed, or\nthat has no queued run left, changes nothing and answers 200.\n\nCancelled runs are counted in the batch's `cancelled`, not in `errors`,\nso a gate on a batch's counts has to look at `cancelled` as well. A\nbatch that was cancelled before anything failed has `failed` and\n`errors` both 0.","security":[{"BearerAuth":[]}],"parameters":[{"in":"path","name":"agent_id","description":"","required":true,"schema":{"title":"Agent Id","type":"string"},"deprecated":false},{"in":"path","name":"batch_id","description":"","required":true,"schema":{"title":"Batch Id","type":"string"},"deprecated":false}],"responses":{"200":{"description":"Request fulfilled, document follows","headers":{},"content":{"application/json":{"schema":{"properties":{"batch_id":{"title":"Batch Id","type":"string"},"agent_id":{"title":"Agent Id","type":"string"},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"description":"The name of the batch, null when it has none.","title":"Name"},"status":{"description":"running until every run has finished.","enum":["running","completed"],"title":"Status","type":"string"},"completed":{"title":"Completed","type":"boolean"},"run_count":{"description":"Every run of the batch, one per test and repeat. It is `queued` + `running` + `passed` + `failed` + `errors` + `cancelled`.","title":"Run Count","type":"integer"},"queued":{"description":"Runs that have not started.","title":"Queued","type":"integer"},"running":{"description":"Runs in progress.","title":"Running","type":"integer"},"passed":{"title":"Passed","type":"integer"},"failed":{"title":"Failed","type":"integer"},"errors":{"description":"Runs in status `error`, which finished without a verdict.","title":"Errors","type":"integer"},"cancelled":{"description":"Runs in status `cancelled`. They are not counted in `errors`.","title":"Cancelled","type":"integer"},"pass_rate":{"anyOf":[{"type":"number"},{"type":"null"}],"default":null,"description":"passed / (passed + failed), null until a run passed or failed. Runs without a verdict (`error`, `cancelled`) never judged the agent and are left out.","title":"Pass Rate"},"cancelled_at":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}],"default":null,"description":"When the batch was first cancelled, null if it never was.","title":"Cancelled At"},"trigger_source":{"description":"Where the batch was started: the console or the API.","enum":["console","api"],"title":"Trigger Source","type":"string"},"created_at":{"description":"When the first run was created.","format":"date-time","title":"Created At","type":"string"},"finished_at":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}],"default":null,"description":"When the last run finished, null until the batch completed.","title":"Finished At"},"runs":{"description":"The runs of the batch. The list is empty where the runs are left out, with `include_runs=false` and in the answers to a cancel and to an update.","items":{"$ref":"#/components/schemas/PublicAgentTestRun"},"title":"Runs","type":"array"}},"required":["batch_id","agent_id","status","completed","run_count","queued","running","passed","failed","errors","cancelled","trigger_source","created_at","runs"],"type":"object"}}}},"401":{"description":"No permission -- see authorization schemes","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}},"404":{"description":"Nothing matches the given URI","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}},"503":{"description":"The server cannot process the request due to a high load","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}}},"tags":["Agent Tests"]}},"/v1/agent/available-phone-numbers":{"get":{"summary":"Search Available Phone Numbers","description":"Search the purchasable number inventory. Buy an entry with\n`POST /v1/agent/phone-numbers`; availability is not a reservation, so a listed\nnumber can still be claimed by someone else first.","security":[{"BearerAuth":[]}],"parameters":[{"in":"query","name":"country_code","description":"ISO 3166-1 alpha-2 country code; `US` or `CA`.","required":false,"schema":{"default":"US","title":"Country Code","type":"string"},"deprecated":false},{"in":"query","name":"area_code","description":"Restrict to one area code, e.g. 415.","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Area Code"},"deprecated":false},{"in":"query","name":"number_type","description":"The managed inventory is US/CA local numbers only; `toll_free` currently returns 400.","required":false,"schema":{"default":"local","enum":["local","toll_free"],"title":"Number Type","type":"string"},"deprecated":false},{"in":"query","name":"provider","description":"Inventory to search. Only the managed `twilio` inventory (call-transfer support) is available; the parameter is kept so importing your own numbers can extend it later.","required":false,"schema":{"anyOf":[{"const":"twilio","type":"string"},{"type":"null"}],"default":null,"title":"Provider"},"deprecated":false}],"responses":{"200":{"description":"Request fulfilled, document follows","headers":{},"content":{"application/json":{"schema":{"properties":{"available_phone_numbers":{"description":"Inventory entries forwarded from the provider (number, region, pricing).","items":{"additionalProperties":true,"type":"object"},"title":"Available Phone Numbers","type":"array"}},"required":["available_phone_numbers"],"type":"object"}}}},"400":{"description":"Bad request syntax or unsupported method","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}},"401":{"description":"No permission -- see authorization schemes","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}},"502":{"description":"Invalid responses from another server/proxy","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}},"503":{"description":"The server cannot process the request due to a high load","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}}},"tags":["Phone Numbers"]}},"/v1/agent/knowledge-sources":{"get":{"summary":"List Knowledge Sources","description":"List your team's knowledge sources, newest first. Paginate with `cursor`\n(follow `next_cursor` while `has_more` is true) or with `page` for offset\npagination with a `total` count — the two are mutually exclusive. Filter\nby folder with `folder_id=<id>`; with `folder_id=root` or no `folder_id`\nyou get every source, and the ones outside any folder have a null\n`folder_id`.","security":[{"BearerAuth":[]}],"parameters":[{"in":"query","name":"search","description":"Case-insensitive match on name and file name.","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Search"},"deprecated":false},{"in":"query","name":"folder_id","description":"Only sources in this knowledge folder. Omit it, or pass `root` (an empty value counts as omitted), to list every source across all workspaces, in a folder or not; sources outside any folder have a null `folder_id`. An unknown or deleted folder id gives an empty list. Combines with `search`.","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Folder Id"},"deprecated":false},{"in":"query","name":"cursor","description":"","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Cursor"},"deprecated":false},{"in":"query","name":"page","description":"1-based page number; mutually exclusive with cursor.","required":false,"schema":{"anyOf":[{"minimum":1,"type":"integer"},{"type":"null"}],"default":null,"title":"Page"},"deprecated":false},{"in":"query","name":"include_total","description":"","required":false,"schema":{"default":false,"title":"Include Total","type":"boolean"},"deprecated":false},{"in":"query","name":"page_size","description":"","required":false,"schema":{"default":30,"maximum":100,"minimum":1,"title":"Page Size","type":"integer"},"deprecated":false}],"responses":{"200":{"description":"Request fulfilled, document follows","headers":{},"content":{"application/json":{"schema":{"properties":{"knowledge_sources":{"items":{"$ref":"#/components/schemas/PublicKnowledgeSourceSummary"},"title":"Knowledge Sources","type":"array"},"has_more":{"title":"Has More","type":"boolean"},"next_cursor":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Next Cursor"},"total":{"anyOf":[{"type":"integer"},{"type":"null"}],"default":null,"title":"Total"}},"required":["knowledge_sources","has_more"],"type":"object"}}}},"400":{"description":"Bad request syntax or unsupported method","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}},"401":{"description":"No permission -- see authorization schemes","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}},"503":{"description":"The server cannot process the request due to a high load","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}}},"tags":["Knowledge Sources"]},"post":{"summary":"Create Knowledge Source","description":"Upload a plain-text or Markdown file (UTF-8, up to 1 MB) as a knowledge\nsource. Send `multipart/form-data` with the file in `source`; `name`\ndefaults to the file name. Send `folder_id` to put it in a knowledge\nfolder (otherwise it is created outside any folder; `folder_id=root` says\nso explicitly). Attach it to agents via the agent config's\n`knowledge_base.knowledge_source_ids`.","security":[{"BearerAuth":[]}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"properties":{"source":{"format":"binary","title":"Source","type":"string"},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Name"},"description":{"default":"","title":"Description","type":"string"},"folder_id":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"description":"Put the source in this knowledge folder, which must be in the workspace the source is created in (your default workspace). Omit it, or send `root` (or an empty value), to create it outside any folder. 404 if the folder does not exist there.","title":"Folder Id"}},"required":["source"],"type":"object"}}}},"responses":{"201":{"description":"Document created, URL follows","headers":{},"content":{"application/json":{"schema":{"properties":{"knowledge_source_id":{"title":"Knowledge Source Id","type":"string"},"workspace_id":{"title":"Workspace Id","type":"string"},"name":{"title":"Name","type":"string"},"description":{"default":"","title":"Description","type":"string"},"folder_id":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"description":"The knowledge folder this source is in; null at the root. Folders are managed with `/v1/agent/knowledge-folders`.","title":"Folder Id"},"file_name":{"title":"File Name","type":"string"},"size_bytes":{"title":"Size Bytes","type":"integer"},"chunk_count":{"title":"Chunk Count","type":"integer"},"revision_number":{"description":"Increments every time the content is replaced. Drafts always use the newest revision; published versions pin the revision current at publish time.","title":"Revision Number","type":"integer"},"created_at":{"format":"date-time","title":"Created At","type":"string"},"updated_at":{"format":"date-time","title":"Updated At","type":"string"},"content":{"description":"The full current text content.","title":"Content","type":"string"}},"required":["knowledge_source_id","workspace_id","name","file_name","size_bytes","chunk_count","revision_number","created_at","updated_at","content"],"type":"object"}}}},"400":{"description":"Bad request syntax or unsupported method","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}},"401":{"description":"No permission -- see authorization schemes","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}},"403":{"description":"Request forbidden -- authorization will not help","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}},"404":{"description":"Nothing matches the given URI","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}},"422":{"description":"","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}},"503":{"description":"The server cannot process the request due to a high load","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}}},"tags":["Knowledge Sources"]}},"/v1/agent/knowledge-sources/{source_id}":{"get":{"summary":"Get Knowledge Source","description":"Fetch one knowledge source including its full text content and current\nrevision number.","security":[{"BearerAuth":[]}],"parameters":[{"in":"path","name":"source_id","description":"","required":true,"schema":{"title":"Source Id","type":"string"},"deprecated":false}],"responses":{"200":{"description":"Request fulfilled, document follows","headers":{},"content":{"application/json":{"schema":{"properties":{"knowledge_source_id":{"title":"Knowledge Source Id","type":"string"},"workspace_id":{"title":"Workspace Id","type":"string"},"name":{"title":"Name","type":"string"},"description":{"default":"","title":"Description","type":"string"},"folder_id":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"description":"The knowledge folder this source is in; null at the root. Folders are managed with `/v1/agent/knowledge-folders`.","title":"Folder Id"},"file_name":{"title":"File Name","type":"string"},"size_bytes":{"title":"Size Bytes","type":"integer"},"chunk_count":{"title":"Chunk Count","type":"integer"},"revision_number":{"description":"Increments every time the content is replaced. Drafts always use the newest revision; published versions pin the revision current at publish time.","title":"Revision Number","type":"integer"},"created_at":{"format":"date-time","title":"Created At","type":"string"},"updated_at":{"format":"date-time","title":"Updated At","type":"string"},"content":{"description":"The full current text content.","title":"Content","type":"string"}},"required":["knowledge_source_id","workspace_id","name","file_name","size_bytes","chunk_count","revision_number","created_at","updated_at","content"],"type":"object"}}}},"401":{"description":"No permission -- see authorization schemes","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}},"404":{"description":"Nothing matches the given URI","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}},"503":{"description":"The server cannot process the request due to a high load","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}}},"tags":["Knowledge Sources"]},"patch":{"summary":"Update Knowledge Source","description":"Rename the source and/or replace its content by uploading a new file in\n`source` (multipart). Replacing content increments `revision_number` while\nthe id stays stable, and every attached agent's draft picks it up\nimmediately; published versions pin the revision they were published with,\nso republish each affected agent to put the new content live — that\ntwo-step (sync content, republish) is the nightly content-sync recipe.\nSend `folder_id` to move the source into a knowledge folder, or\n`folder_id=root` to take it out of its folder; a move alone does not create\na revision.","security":[{"BearerAuth":[]}],"parameters":[{"in":"path","name":"source_id","description":"","required":true,"schema":{"title":"Source Id","type":"string"},"deprecated":false}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"properties":{"source":{"anyOf":[{"format":"binary","type":"string"},{"type":"null"}],"default":null,"title":"Source"},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Name"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Description"},"folder_id":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"description":"Move the source into this knowledge folder, which must be in the source's own workspace. `root` (or an empty value) takes it out of its folder; omit to leave it where it is. Moving never creates a new revision. 404 if the folder does not exist there.","title":"Folder Id"}},"type":"object"}}}},"responses":{"200":{"description":"Request fulfilled, document follows","headers":{},"content":{"application/json":{"schema":{"properties":{"knowledge_source_id":{"title":"Knowledge Source Id","type":"string"},"workspace_id":{"title":"Workspace Id","type":"string"},"name":{"title":"Name","type":"string"},"description":{"default":"","title":"Description","type":"string"},"folder_id":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"description":"The knowledge folder this source is in; null at the root. Folders are managed with `/v1/agent/knowledge-folders`.","title":"Folder Id"},"file_name":{"title":"File Name","type":"string"},"size_bytes":{"title":"Size Bytes","type":"integer"},"chunk_count":{"title":"Chunk Count","type":"integer"},"revision_number":{"description":"Increments every time the content is replaced. Drafts always use the newest revision; published versions pin the revision current at publish time.","title":"Revision Number","type":"integer"},"created_at":{"format":"date-time","title":"Created At","type":"string"},"updated_at":{"format":"date-time","title":"Updated At","type":"string"},"content":{"description":"The full current text content.","title":"Content","type":"string"}},"required":["knowledge_source_id","workspace_id","name","file_name","size_bytes","chunk_count","revision_number","created_at","updated_at","content"],"type":"object"}}}},"400":{"description":"Bad request syntax or unsupported method","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}},"401":{"description":"No permission -- see authorization schemes","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}},"404":{"description":"Nothing matches the given URI","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}},"422":{"description":"","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}},"503":{"description":"The server cannot process the request due to a high load","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}}},"tags":["Knowledge Sources"]},"delete":{"summary":"Delete Knowledge Source","description":"Delete a knowledge source. Returns 409 while any agent still references it\n— in its draft or in its currently published version (sessions resolve\nsources at call time, so deleting a published reference would change a\nrunning agent). Check `GET /v1/agent/knowledge-sources/{source_id}/agents`,\ndetach via the agent config, and republish if needed before deleting.","security":[{"BearerAuth":[]}],"parameters":[{"in":"path","name":"source_id","description":"","required":true,"schema":{"title":"Source Id","type":"string"},"deprecated":false}],"responses":{"204":{"description":"Request fulfilled, nothing follows","headers":{}},"401":{"description":"No permission -- see authorization schemes","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}},"404":{"description":"Nothing matches the given URI","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}},"409":{"description":"Request conflict","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}},"503":{"description":"The server cannot process the request due to a high load","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}}},"tags":["Knowledge Sources"]}},"/v1/agent/knowledge-sources/{source_id}/agents":{"get":{"summary":"List Agents Using Knowledge Source","description":"Every agent that references this source in its draft or currently\npublished configuration — the pre-flight check before a delete.","security":[{"BearerAuth":[]}],"parameters":[{"in":"path","name":"source_id","description":"","required":true,"schema":{"title":"Source Id","type":"string"},"deprecated":false}],"responses":{"200":{"description":"Request fulfilled, document follows","headers":{},"content":{"application/json":{"schema":{"properties":{"agents":{"description":"Agents that reference this resource in their configuration.","items":{"$ref":"#/components/schemas/PublicDependentAgent"},"title":"Agents","type":"array"},"total":{"title":"Total","type":"integer"}},"required":["agents","total"],"type":"object"}}}},"401":{"description":"No permission -- see authorization schemes","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}},"404":{"description":"Nothing matches the given URI","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}},"503":{"description":"The server cannot process the request due to a high load","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}}},"tags":["Knowledge Sources"]}},"/v1/agent/knowledge-folders":{"get":{"summary":"List Knowledge Folders","description":"List your team's knowledge folders across all workspaces, newest first.\nFolder names are unique per workspace, so two workspaces can each have a\n\"Support\" folder: tell them apart by `workspace_id`. Paginate with\n`cursor` (follow `next_cursor` while `has_more` is true) or with `page`\nfor offset pagination with a `total` count — the two are mutually\nexclusive. To list the sources in a folder, call\n`GET /v1/agent/knowledge-sources?folder_id=<folder_id>`; pass\n`include_total=true` there for a count.","security":[{"BearerAuth":[]}],"parameters":[{"in":"query","name":"cursor","description":"","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Cursor"},"deprecated":false},{"in":"query","name":"page","description":"1-based page number; mutually exclusive with cursor.","required":false,"schema":{"anyOf":[{"minimum":1,"type":"integer"},{"type":"null"}],"default":null,"title":"Page"},"deprecated":false},{"in":"query","name":"include_total","description":"","required":false,"schema":{"default":false,"title":"Include Total","type":"boolean"},"deprecated":false},{"in":"query","name":"page_size","description":"","required":false,"schema":{"default":30,"maximum":100,"minimum":1,"title":"Page Size","type":"integer"},"deprecated":false}],"responses":{"200":{"description":"Request fulfilled, document follows","headers":{},"content":{"application/json":{"schema":{"properties":{"folders":{"items":{"$ref":"#/components/schemas/PublicKnowledgeFolder"},"title":"Folders","type":"array"},"has_more":{"title":"Has More","type":"boolean"},"next_cursor":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Next Cursor"},"total":{"anyOf":[{"type":"integer"},{"type":"null"}],"default":null,"title":"Total"}},"required":["folders","has_more"],"type":"object"}}}},"400":{"description":"Bad request syntax or unsupported method","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}},"401":{"description":"No permission -- see authorization schemes","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}},"503":{"description":"The server cannot process the request due to a high load","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}}},"tags":["Knowledge Folders"]},"post":{"summary":"Create Knowledge Folder","description":"Create a folder in the API key owner's default workspace. Returns 409 if\nthat workspace already has a folder with the same name (compared exactly,\ncase-sensitive). Put knowledge sources in it by passing `folder_id` when\nyou create or update them.","security":[{"BearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublicKnowledgeFolderPayload"}}}},"responses":{"201":{"description":"Document created, URL follows","headers":{},"content":{"application/json":{"schema":{"properties":{"folder_id":{"title":"Folder Id","type":"string"},"workspace_id":{"title":"Workspace Id","type":"string"},"name":{"title":"Name","type":"string"},"created_at":{"format":"date-time","title":"Created At","type":"string"},"updated_at":{"format":"date-time","title":"Updated At","type":"string"}},"required":["folder_id","workspace_id","name","created_at","updated_at"],"type":"object"}}}},"401":{"description":"No permission -- see authorization schemes","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}},"403":{"description":"Request forbidden -- authorization will not help","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}},"409":{"description":"Request conflict","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}},"422":{"description":"","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}},"503":{"description":"The server cannot process the request due to a high load","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}}},"tags":["Knowledge Folders"]}},"/v1/agent/knowledge-folders/{folder_id}":{"patch":{"summary":"Rename Knowledge Folder","description":"Rename a folder. The name must be free within the folder's own workspace\n(409 otherwise); renaming a folder to its current name succeeds.","security":[{"BearerAuth":[]}],"parameters":[{"in":"path","name":"folder_id","description":"","required":true,"schema":{"title":"Folder Id","type":"string"},"deprecated":false}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublicKnowledgeFolderPayload"}}}},"responses":{"200":{"description":"Request fulfilled, document follows","headers":{},"content":{"application/json":{"schema":{"properties":{"folder_id":{"title":"Folder Id","type":"string"},"workspace_id":{"title":"Workspace Id","type":"string"},"name":{"title":"Name","type":"string"},"created_at":{"format":"date-time","title":"Created At","type":"string"},"updated_at":{"format":"date-time","title":"Updated At","type":"string"}},"required":["folder_id","workspace_id","name","created_at","updated_at"],"type":"object"}}}},"401":{"description":"No permission -- see authorization schemes","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}},"404":{"description":"Nothing matches the given URI","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}},"409":{"description":"Request conflict","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}},"422":{"description":"","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}},"503":{"description":"The server cannot process the request due to a high load","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}}},"tags":["Knowledge Folders"]},"delete":{"summary":"Delete Knowledge Folder","description":"Delete a folder, empty or not. The knowledge sources inside it are not\ndeleted: they are taken out of the folder (`folder_id` becomes null).","security":[{"BearerAuth":[]}],"parameters":[{"in":"path","name":"folder_id","description":"","required":true,"schema":{"title":"Folder Id","type":"string"},"deprecated":false}],"responses":{"204":{"description":"Request fulfilled, nothing follows","headers":{}},"401":{"description":"No permission -- see authorization schemes","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}},"404":{"description":"Nothing matches the given URI","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}},"503":{"description":"The server cannot process the request due to a high load","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}}},"tags":["Knowledge Folders"]}},"/v1/agent/tools":{"get":{"summary":"List Tools","description":"List your team's tools, newest first. Filter with `agent_id` to see one\nagent's attached tools. Paginate with `cursor` (follow `next_cursor` while\n`has_more` is true) or with `page` for offset pagination with a `total`\ncount — the two are mutually exclusive.","security":[{"BearerAuth":[]}],"parameters":[{"in":"query","name":"search","description":"Case-insensitive match on name.","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Search"},"deprecated":false},{"in":"query","name":"agent_id","description":"Only tools attached to this agent's draft config.","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Agent Id"},"deprecated":false},{"in":"query","name":"cursor","description":"","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Cursor"},"deprecated":false},{"in":"query","name":"page","description":"1-based page number; mutually exclusive with cursor.","required":false,"schema":{"anyOf":[{"minimum":1,"type":"integer"},{"type":"null"}],"default":null,"title":"Page"},"deprecated":false},{"in":"query","name":"include_total","description":"","required":false,"schema":{"default":false,"title":"Include Total","type":"boolean"},"deprecated":false},{"in":"query","name":"page_size","description":"","required":false,"schema":{"default":30,"maximum":100,"minimum":1,"title":"Page Size","type":"integer"},"deprecated":false}],"responses":{"200":{"description":"Request fulfilled, document follows","headers":{},"content":{"application/json":{"schema":{"properties":{"tools":{"items":{"$ref":"#/components/schemas/PublicAgentToolSummary"},"title":"Tools","type":"array"},"has_more":{"title":"Has More","type":"boolean"},"next_cursor":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Next Cursor"},"total":{"anyOf":[{"type":"integer"},{"type":"null"}],"default":null,"title":"Total"}},"required":["tools","has_more"],"type":"object"}}}},"400":{"description":"Bad request syntax or unsupported method","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}},"401":{"description":"No permission -- see authorization schemes","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}},"404":{"description":"Nothing matches the given URI","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}},"503":{"description":"The server cannot process the request due to a high load","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}}},"tags":["Agent Tools"]},"post":{"summary":"Create Tool","description":"Create a workspace tool. `tool_type: webhook` calls your HTTP endpoint\nduring conversations; `tool_type: client` is executed by your own frontend\nthrough the SDK (no URL). Describe the call with `parameters` (a JSON\nSchema object, checked at call time under `parameter_mode: strict`) or\nthe older `arguments` list (every argument a required string, unchecked).\nAttach it to agents via the agent config's `tools.tool_ids`. Credential\nheaders (authorization_bearer / authorization_basic, and custom headers\nwhose name looks like a credential, such as `X-Api-Key` or\n`X-Webhook-Token`) are write-only and\nread back as `has_secret`.\n\nOnly what `body_template`, `url` and `headers` reference is sent to the\nendpoint. A non-GET tool with no `body_template` sends no body, so its\nparameters are lost unless the URL or headers use them; the response then\nlists them under `warnings` (as do Get Tool and Update Tool). The tool is\nstill saved.","security":[{"BearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublicAgentToolCreatePayload"}}}},"responses":{"201":{"description":"Document created, URL follows","headers":{},"content":{"application/json":{"schema":{"properties":{"tool_id":{"title":"Tool Id","type":"string"},"workspace_id":{"title":"Workspace Id","type":"string"},"name":{"title":"Name","type":"string"},"description":{"default":"","title":"Description","type":"string"},"tool_type":{"enum":["webhook","client"],"title":"Tool Type","type":"string"},"method":{"enum":["GET","POST","PUT","PATCH","DELETE"],"title":"Method","type":"string"},"url":{"title":"Url","type":"string"},"used_by":{"default":0,"description":"How many agents reference this tool in their draft configuration.","title":"Used By","type":"integer"},"created_at":{"format":"date-time","title":"Created At","type":"string"},"updated_at":{"format":"date-time","title":"Updated At","type":"string"},"arguments":{"description":"Older shape of `parameters`: each entry becomes a required string parameter. Mutually exclusive with `parameters` in one request. Reads return both, `arguments` being the string parameters of the schema.","items":{"$ref":"#/components/schemas/AgentWebhookArgumentPayload"},"title":"Arguments","type":"array"},"parameters":{"additionalProperties":{"$ref":"#/components/schemas/JsonValue"},"description":"Call parameters as a JSON Schema object (draft 2020-12): `type: object` (filled in when omitted), `properties`, `required`. Standard meaning throughout: `required` means the key must be present, `type: [\"string\", \"null\"]` allows null, `minLength: 1` makes a string non-empty, `enum` and `pattern` constrain the value, `default` fills a key the model left out. Mutually exclusive with `arguments` in one request. A tool created with `parameters` starts in `parameter_mode: strict`.","title":"Parameters","type":"object"},"parameter_mode":{"default":"legacy","description":"Whether the agent runtime checks each call's arguments against `parameters` before running the tool. `legacy` (the default for tools created with `arguments`, and every tool from before this field existed): no check, the model's arguments run as sent. `strict` (the default for tools created with `parameters`): a call that does not satisfy the schema is refused and the model is told to ask the caller for the missing information, and the LLM provider's constrained decoding is turned on where the model supports it (OpenAI models and a custom OpenAI-compatible endpoint receive the tool with `strict: true`, Gemini on the platform's native channel runs validated function calling). Changing `parameters` never changes the mode, and the mode can be changed on its own.","enum":["legacy","strict"],"title":"Parameter Mode","type":"string"},"content_type":{"title":"Content Type","type":"string"},"body_template":{"default":"","title":"Body Template","type":"string"},"headers":{"items":{"$ref":"#/components/schemas/PublicToolHeader"},"title":"Headers","type":"array"},"timeout_seconds":{"title":"Timeout Seconds","type":"integer"},"error_handling":{"enum":["passthrough","hide"],"title":"Error Handling","type":"string"},"mock_responses":{"items":{"$ref":"#/components/schemas/AgentWebhookMockResponsePayload"},"title":"Mock Responses","type":"array"},"expects_response":{"default":true,"title":"Expects Response","type":"boolean"},"execution_mode":{"default":"blocking","enum":["blocking","fire_and_forget","background"],"title":"Execution Mode","type":"string"},"pre_tool_speech":{"$ref":"#/components/schemas/AgentToolPreToolSpeech","description":"What the caller hears as this tool starts, when the agent's own reply has not said anything yet. `auto` (the default for a new tool): the platform decides for each call whether a line is worth saying, and the model writes the line when one is said. `static`: the agent says `message` as written (required, one language). `off`: nothing (what a tool created before this field reads as). Applies to blocking webhook tools and to client tools with `expects_response: true`. It is stored but not used for other tools."},"signing":{"$ref":"#/components/schemas/AgentWebhookToolSigningStatus","description":"Request signing state. Secrets are write-only: rotate returns the new one once."},"warnings":{"description":"Problems with a saved tool that do not stop it from being saved. Empty when there are none.","items":{"$ref":"#/components/schemas/PublicAgentToolWarning"},"title":"Warnings","type":"array"}},"required":["tool_id","workspace_id","name","tool_type","method","url","created_at","updated_at","parameters","content_type","timeout_seconds","error_handling"],"type":"object"}}}},"401":{"description":"No permission -- see authorization schemes","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}},"422":{"description":"","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}},"503":{"description":"The server cannot process the request due to a high load","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}}},"tags":["Agent Tools"],"x-codeSamples":[{"lang":"bash","label":"Create Webhook Tool","source":"curl --request POST \\\n  --url https://api.fish.audio/v1/agent/tools \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{\n    \"name\": \"Book appointment\",\n    \"description\": \"Creates an appointment in the scheduling system.\",\n    \"method\": \"POST\",\n    \"url\": \"https://api.example.com/appointments\",\n    \"arguments\": [\n      {\"name\": \"date\", \"description\": \"Appointment date, YYYY-MM-DD\"}\n    ],\n    \"body_template\": \"{\\\"date\\\": \\\"{{date}}\\\"}\",\n    \"headers\": [\n      {\"name\": \"Authorization\", \"value\": \"Bearer <api-token>\", \"kind\": \"authorization_bearer\"}\n    ]\n  }'"}]}},"/v1/agent/tools/{tool_id}":{"get":{"summary":"Get Tool","description":"Fetch one tool's full definition. Credential header values are never\nreturned — each credential header (including a custom header whose name\nlooks like a credential) reports `has_secret` instead.","security":[{"BearerAuth":[]}],"parameters":[{"in":"path","name":"tool_id","description":"","required":true,"schema":{"title":"Tool Id","type":"string"},"deprecated":false}],"responses":{"200":{"description":"Request fulfilled, document follows","headers":{},"content":{"application/json":{"schema":{"properties":{"tool_id":{"title":"Tool Id","type":"string"},"workspace_id":{"title":"Workspace Id","type":"string"},"name":{"title":"Name","type":"string"},"description":{"default":"","title":"Description","type":"string"},"tool_type":{"enum":["webhook","client"],"title":"Tool Type","type":"string"},"method":{"enum":["GET","POST","PUT","PATCH","DELETE"],"title":"Method","type":"string"},"url":{"title":"Url","type":"string"},"used_by":{"default":0,"description":"How many agents reference this tool in their draft configuration.","title":"Used By","type":"integer"},"created_at":{"format":"date-time","title":"Created At","type":"string"},"updated_at":{"format":"date-time","title":"Updated At","type":"string"},"arguments":{"description":"Older shape of `parameters`: each entry becomes a required string parameter. Mutually exclusive with `parameters` in one request. Reads return both, `arguments` being the string parameters of the schema.","items":{"$ref":"#/components/schemas/AgentWebhookArgumentPayload"},"title":"Arguments","type":"array"},"parameters":{"additionalProperties":{"$ref":"#/components/schemas/JsonValue"},"description":"Call parameters as a JSON Schema object (draft 2020-12): `type: object` (filled in when omitted), `properties`, `required`. Standard meaning throughout: `required` means the key must be present, `type: [\"string\", \"null\"]` allows null, `minLength: 1` makes a string non-empty, `enum` and `pattern` constrain the value, `default` fills a key the model left out. Mutually exclusive with `arguments` in one request. A tool created with `parameters` starts in `parameter_mode: strict`.","title":"Parameters","type":"object"},"parameter_mode":{"default":"legacy","description":"Whether the agent runtime checks each call's arguments against `parameters` before running the tool. `legacy` (the default for tools created with `arguments`, and every tool from before this field existed): no check, the model's arguments run as sent. `strict` (the default for tools created with `parameters`): a call that does not satisfy the schema is refused and the model is told to ask the caller for the missing information, and the LLM provider's constrained decoding is turned on where the model supports it (OpenAI models and a custom OpenAI-compatible endpoint receive the tool with `strict: true`, Gemini on the platform's native channel runs validated function calling). Changing `parameters` never changes the mode, and the mode can be changed on its own.","enum":["legacy","strict"],"title":"Parameter Mode","type":"string"},"content_type":{"title":"Content Type","type":"string"},"body_template":{"default":"","title":"Body Template","type":"string"},"headers":{"items":{"$ref":"#/components/schemas/PublicToolHeader"},"title":"Headers","type":"array"},"timeout_seconds":{"title":"Timeout Seconds","type":"integer"},"error_handling":{"enum":["passthrough","hide"],"title":"Error Handling","type":"string"},"mock_responses":{"items":{"$ref":"#/components/schemas/AgentWebhookMockResponsePayload"},"title":"Mock Responses","type":"array"},"expects_response":{"default":true,"title":"Expects Response","type":"boolean"},"execution_mode":{"default":"blocking","enum":["blocking","fire_and_forget","background"],"title":"Execution Mode","type":"string"},"pre_tool_speech":{"$ref":"#/components/schemas/AgentToolPreToolSpeech","description":"What the caller hears as this tool starts, when the agent's own reply has not said anything yet. `auto` (the default for a new tool): the platform decides for each call whether a line is worth saying, and the model writes the line when one is said. `static`: the agent says `message` as written (required, one language). `off`: nothing (what a tool created before this field reads as). Applies to blocking webhook tools and to client tools with `expects_response: true`. It is stored but not used for other tools."},"signing":{"$ref":"#/components/schemas/AgentWebhookToolSigningStatus","description":"Request signing state. Secrets are write-only: rotate returns the new one once."},"warnings":{"description":"Problems with a saved tool that do not stop it from being saved. Empty when there are none.","items":{"$ref":"#/components/schemas/PublicAgentToolWarning"},"title":"Warnings","type":"array"}},"required":["tool_id","workspace_id","name","tool_type","method","url","created_at","updated_at","parameters","content_type","timeout_seconds","error_handling"],"type":"object"}}}},"401":{"description":"No permission -- see authorization schemes","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}},"404":{"description":"Nothing matches the given URI","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}},"503":{"description":"The server cannot process the request due to a high load","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}}},"tags":["Agent Tools"]},"patch":{"summary":"Update Tool","description":"Patch tool fields; omitted fields keep their value (null is rejected —\nsend an empty string to clear a text field). `headers` replaces the header\nlist wholesale — include credential values again whenever you send it,\nsince reads never return them. Attached agents' drafts pick up the change\nimmediately; published versions stay frozen until re-published, except\nfor credential values: a new authorization_bearer / authorization_basic\nvalue reaches published versions at their next session, as long as the\nheader keeps its name and kind. Calls already in progress keep the value\nthey started with.","security":[{"BearerAuth":[]}],"parameters":[{"in":"path","name":"tool_id","description":"","required":true,"schema":{"title":"Tool Id","type":"string"},"deprecated":false}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublicAgentToolUpdatePayload"}}}},"responses":{"200":{"description":"Request fulfilled, document follows","headers":{},"content":{"application/json":{"schema":{"properties":{"tool_id":{"title":"Tool Id","type":"string"},"workspace_id":{"title":"Workspace Id","type":"string"},"name":{"title":"Name","type":"string"},"description":{"default":"","title":"Description","type":"string"},"tool_type":{"enum":["webhook","client"],"title":"Tool Type","type":"string"},"method":{"enum":["GET","POST","PUT","PATCH","DELETE"],"title":"Method","type":"string"},"url":{"title":"Url","type":"string"},"used_by":{"default":0,"description":"How many agents reference this tool in their draft configuration.","title":"Used By","type":"integer"},"created_at":{"format":"date-time","title":"Created At","type":"string"},"updated_at":{"format":"date-time","title":"Updated At","type":"string"},"arguments":{"description":"Older shape of `parameters`: each entry becomes a required string parameter. Mutually exclusive with `parameters` in one request. Reads return both, `arguments` being the string parameters of the schema.","items":{"$ref":"#/components/schemas/AgentWebhookArgumentPayload"},"title":"Arguments","type":"array"},"parameters":{"additionalProperties":{"$ref":"#/components/schemas/JsonValue"},"description":"Call parameters as a JSON Schema object (draft 2020-12): `type: object` (filled in when omitted), `properties`, `required`. Standard meaning throughout: `required` means the key must be present, `type: [\"string\", \"null\"]` allows null, `minLength: 1` makes a string non-empty, `enum` and `pattern` constrain the value, `default` fills a key the model left out. Mutually exclusive with `arguments` in one request. A tool created with `parameters` starts in `parameter_mode: strict`.","title":"Parameters","type":"object"},"parameter_mode":{"default":"legacy","description":"Whether the agent runtime checks each call's arguments against `parameters` before running the tool. `legacy` (the default for tools created with `arguments`, and every tool from before this field existed): no check, the model's arguments run as sent. `strict` (the default for tools created with `parameters`): a call that does not satisfy the schema is refused and the model is told to ask the caller for the missing information, and the LLM provider's constrained decoding is turned on where the model supports it (OpenAI models and a custom OpenAI-compatible endpoint receive the tool with `strict: true`, Gemini on the platform's native channel runs validated function calling). Changing `parameters` never changes the mode, and the mode can be changed on its own.","enum":["legacy","strict"],"title":"Parameter Mode","type":"string"},"content_type":{"title":"Content Type","type":"string"},"body_template":{"default":"","title":"Body Template","type":"string"},"headers":{"items":{"$ref":"#/components/schemas/PublicToolHeader"},"title":"Headers","type":"array"},"timeout_seconds":{"title":"Timeout Seconds","type":"integer"},"error_handling":{"enum":["passthrough","hide"],"title":"Error Handling","type":"string"},"mock_responses":{"items":{"$ref":"#/components/schemas/AgentWebhookMockResponsePayload"},"title":"Mock Responses","type":"array"},"expects_response":{"default":true,"title":"Expects Response","type":"boolean"},"execution_mode":{"default":"blocking","enum":["blocking","fire_and_forget","background"],"title":"Execution Mode","type":"string"},"pre_tool_speech":{"$ref":"#/components/schemas/AgentToolPreToolSpeech","description":"What the caller hears as this tool starts, when the agent's own reply has not said anything yet. `auto` (the default for a new tool): the platform decides for each call whether a line is worth saying, and the model writes the line when one is said. `static`: the agent says `message` as written (required, one language). `off`: nothing (what a tool created before this field reads as). Applies to blocking webhook tools and to client tools with `expects_response: true`. It is stored but not used for other tools."},"signing":{"$ref":"#/components/schemas/AgentWebhookToolSigningStatus","description":"Request signing state. Secrets are write-only: rotate returns the new one once."},"warnings":{"description":"Problems with a saved tool that do not stop it from being saved. Empty when there are none.","items":{"$ref":"#/components/schemas/PublicAgentToolWarning"},"title":"Warnings","type":"array"}},"required":["tool_id","workspace_id","name","tool_type","method","url","created_at","updated_at","parameters","content_type","timeout_seconds","error_handling"],"type":"object"}}}},"400":{"description":"Bad request syntax or unsupported method","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}},"401":{"description":"No permission -- see authorization schemes","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}},"404":{"description":"Nothing matches the given URI","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}},"422":{"description":"","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}},"503":{"description":"The server cannot process the request due to a high load","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}}},"tags":["Agent Tools"]},"delete":{"summary":"Delete Tool","description":"Delete a tool. Returns 409 while any agent's draft configuration still\nreferences it — check `GET /v1/agent/tools/{tool_id}/agents` and detach it\nvia the agent config first, so a delete can never silently change agent\nbehavior.","security":[{"BearerAuth":[]}],"parameters":[{"in":"path","name":"tool_id","description":"","required":true,"schema":{"title":"Tool Id","type":"string"},"deprecated":false}],"responses":{"204":{"description":"Request fulfilled, nothing follows","headers":{}},"401":{"description":"No permission -- see authorization schemes","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}},"404":{"description":"Nothing matches the given URI","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}},"409":{"description":"Request conflict","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}},"503":{"description":"The server cannot process the request due to a high load","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}}},"tags":["Agent Tools"]}},"/v1/agent/tools/{tool_id}/signing-secret":{"delete":{"summary":"Disable Tool Signing","description":"Stop signing this tool's requests and delete its secrets.","security":[{"BearerAuth":[]}],"parameters":[{"in":"path","name":"tool_id","description":"","required":true,"schema":{"title":"Tool Id","type":"string"},"deprecated":false}],"responses":{"200":{"description":"Request fulfilled, document follows","headers":{},"content":{"application/json":{"schema":{"description":"Request signing state of a webhook tool. Secret values never appear in\nreads: the rotate call returns the new secret once.","properties":{"enabled":{"default":false,"description":"Whether requests carry `X-Fish-Webhook-Signature` (HMAC-SHA256 over `{t}.{body}`, the post-call webhook scheme).","title":"Enabled","type":"boolean"},"secret_created_at":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}],"default":null,"title":"Secret Created At"},"previous_secret_expires_at":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}],"default":null,"description":"Set while the rotated-out secret still signs as a second `v1`; null once it expired or was revoked.","title":"Previous Secret Expires At"}},"type":"object"}}}},"400":{"description":"Bad request syntax or unsupported method","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}},"401":{"description":"No permission -- see authorization schemes","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}},"404":{"description":"Nothing matches the given URI","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}},"503":{"description":"The server cannot process the request due to a high load","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}}},"tags":["Agent Tools"]}},"/v1/agent/tools/{tool_id}/signing-secret/rotate":{"post":{"summary":"Rotate Tool Signing Secret","description":"Turn on request signing for a webhook tool, or replace its secret. The\nresponse returns the new secret once. The replaced secret keeps signing\nnext to the new one for `previous_secret_expires_in_seconds` (default 24\nhours), so you can deploy the new secret without dropping a request.\nReturns 409 while a previous secret is still active: revoke it first.\nThe change reaches every agent using the tool at its next session,\npublished versions included.\n\nSigned requests carry `X-Fish-Webhook-Signature: t=<unix>,v1=<hex>`, the\nsame header and scheme as post-call webhooks. Each `v1` is the hex\nHMAC-SHA256 of `{t}.{body}` with one secret, where `body` is the exact\nrequest body (empty for GET). Check every `v1` entry: during a rotation\nwindow there are two, the new secret's first. Reject a request whose `t`\nis more than 5 minutes off your clock.","security":[{"BearerAuth":[]}],"parameters":[{"in":"path","name":"tool_id","description":"","required":true,"schema":{"title":"Tool Id","type":"string"},"deprecated":false}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentWebhookToolSigningSecretRotatePayload"}}}},"responses":{"200":{"description":"Request fulfilled, document follows","headers":{},"content":{"application/json":{"schema":{"properties":{"secret":{"description":"The new signing secret. Store it now: it is never returned again.","title":"Secret","type":"string"},"signing":{"$ref":"#/components/schemas/AgentWebhookToolSigningStatus"}},"required":["secret","signing"],"type":"object"}}}},"400":{"description":"Bad request syntax or unsupported method","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}},"401":{"description":"No permission -- see authorization schemes","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}},"404":{"description":"Nothing matches the given URI","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}},"409":{"description":"Request conflict","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}},"503":{"description":"The server cannot process the request due to a high load","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}}},"tags":["Agent Tools"]}},"/v1/agent/tools/{tool_id}/signing-secret/previous":{"delete":{"summary":"Revoke Previous Tool Signing Secret","description":"End a rotation window now. Only the current secret signs from the next\nsession on.","security":[{"BearerAuth":[]}],"parameters":[{"in":"path","name":"tool_id","description":"","required":true,"schema":{"title":"Tool Id","type":"string"},"deprecated":false}],"responses":{"200":{"description":"Request fulfilled, document follows","headers":{},"content":{"application/json":{"schema":{"description":"Request signing state of a webhook tool. Secret values never appear in\nreads: the rotate call returns the new secret once.","properties":{"enabled":{"default":false,"description":"Whether requests carry `X-Fish-Webhook-Signature` (HMAC-SHA256 over `{t}.{body}`, the post-call webhook scheme).","title":"Enabled","type":"boolean"},"secret_created_at":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}],"default":null,"title":"Secret Created At"},"previous_secret_expires_at":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}],"default":null,"description":"Set while the rotated-out secret still signs as a second `v1`; null once it expired or was revoked.","title":"Previous Secret Expires At"}},"type":"object"}}}},"400":{"description":"Bad request syntax or unsupported method","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}},"401":{"description":"No permission -- see authorization schemes","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}},"404":{"description":"Nothing matches the given URI","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}},"503":{"description":"The server cannot process the request due to a high load","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}}},"tags":["Agent Tools"]}},"/v1/agent/tools/{tool_id}/agents":{"get":{"summary":"List Agents Using Tool","description":"Every agent whose draft configuration references this tool — the\npre-flight check before a delete. Published versions keep executing their\nfrozen tool snapshot, so only draft references block deletion.","security":[{"BearerAuth":[]}],"parameters":[{"in":"path","name":"tool_id","description":"","required":true,"schema":{"title":"Tool Id","type":"string"},"deprecated":false}],"responses":{"200":{"description":"Request fulfilled, document follows","headers":{},"content":{"application/json":{"schema":{"properties":{"agents":{"description":"Agents that reference this resource in their configuration.","items":{"$ref":"#/components/schemas/PublicDependentAgent"},"title":"Agents","type":"array"},"total":{"title":"Total","type":"integer"}},"required":["agents","total"],"type":"object"}}}},"401":{"description":"No permission -- see authorization schemes","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}},"404":{"description":"Nothing matches the given URI","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}},"503":{"description":"The server cannot process the request due to a high load","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}}},"tags":["Agent Tools"]}},"/v1/agent/tests":{"get":{"summary":"List Tests","description":"List your team's tests, newest first. Filter with `agent_id` to see the\ntests attached to one agent, and with `folder_id` to see the tests in one\ntest folder. Tests outside any folder have a null `folder_id`. Paginate\nwith `cursor` (follow `next_cursor` while `has_more` is true) or with\n`page` for offset pagination with a `total` count. The two are mutually\nexclusive.","security":[{"BearerAuth":[]}],"parameters":[{"in":"query","name":"search","description":"Case-insensitive match on name.","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Search"},"deprecated":false},{"in":"query","name":"agent_id","description":"Only tests attached to this agent.","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Agent Id"},"deprecated":false},{"in":"query","name":"folder_id","description":"Only tests in this test folder. `root` or an empty value does not filter. An id that is not a folder lists nothing.","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Folder Id"},"deprecated":false},{"in":"query","name":"test_type","description":"","required":false,"schema":{"anyOf":[{"enum":["next_reply","tool","simulation"],"type":"string"},{"type":"null"}],"default":null,"title":"Test Type"},"deprecated":false},{"in":"query","name":"cursor","description":"","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Cursor"},"deprecated":false},{"in":"query","name":"page","description":"1-based page number, mutually exclusive with cursor.","required":false,"schema":{"anyOf":[{"minimum":1,"type":"integer"},{"type":"null"}],"default":null,"title":"Page"},"deprecated":false},{"in":"query","name":"include_total","description":"","required":false,"schema":{"default":false,"title":"Include Total","type":"boolean"},"deprecated":false},{"in":"query","name":"page_size","description":"","required":false,"schema":{"default":30,"maximum":100,"minimum":1,"title":"Page Size","type":"integer"},"deprecated":false}],"responses":{"200":{"description":"Request fulfilled, document follows","headers":{},"content":{"application/json":{"schema":{"properties":{"tests":{"items":{"$ref":"#/components/schemas/PublicAgentTestSummary"},"title":"Tests","type":"array"},"has_more":{"title":"Has More","type":"boolean"},"next_cursor":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Next Cursor"},"total":{"anyOf":[{"type":"integer"},{"type":"null"}],"default":null,"title":"Total"}},"required":["tests","has_more"],"type":"object"}}}},"400":{"description":"Bad request syntax or unsupported method","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}},"401":{"description":"No permission -- see authorization schemes","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}},"404":{"description":"Nothing matches the given URI","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}},"503":{"description":"The server cannot process the request due to a high load","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}}},"tags":["Agent Tests"]},"post":{"summary":"Create Test","description":"Create a test: `next_reply` judges the agent's next reply against an\nexpectation, `tool` checks the tool the agent calls next, and `simulation`\nlets a simulated user hold a whole conversation that is scored against\nsuccess conditions. Pass `agent_ids` to attach the test right away.\n`channel` sets the channel a `next_reply` or `tool` test plays.\n\nThe body of `GET /v1/agent/tests/{test_id}` posts back as is, so tests can\nbe exported and imported. Tool references use your workspace's tool ids\n(list them with `GET /v1/agent/agents/{agent_id}/test-tools`), so an export\nimports cleanly within the same team and needs its tool ids remapped\nelsewhere. System tools go by their tool name, the same in every team.\n`folder_id` puts the test in a test folder of the workspace it is created\nin. An id that is no folder there, as in an export from another team, is\nignored and the test is created outside any folder.","security":[{"BearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublicAgentTestCreatePayload"}}}},"responses":{"201":{"description":"Document created, URL follows","headers":{},"content":{"application/json":{"schema":{"properties":{"test_id":{"title":"Test Id","type":"string"},"workspace_id":{"title":"Workspace Id","type":"string"},"name":{"title":"Name","type":"string"},"test_type":{"enum":["next_reply","tool","simulation"],"title":"Test Type","type":"string"},"folder_id":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"description":"The test folder the test is in (`/v1/agent/test-folders`), null outside any folder.","title":"Folder Id"},"agent_ids":{"description":"Agents this test is attached to.","items":{"type":"string"},"title":"Agent Ids","type":"array"},"created_at":{"format":"date-time","title":"Created At","type":"string"},"updated_at":{"format":"date-time","title":"Updated At","type":"string"},"conversation":{"items":{"$ref":"#/components/schemas/PublicAgentTestMessage"},"title":"Conversation","type":"array"},"expectation":{"default":"","title":"Expectation","type":"string"},"success_examples":{"items":{"type":"string"},"title":"Success Examples","type":"array"},"failure_examples":{"items":{"type":"string"},"title":"Failure Examples","type":"array"},"referenced_tool":{"anyOf":[{"$ref":"#/components/schemas/AgentTestReferencedTool"},{"type":"null"}],"default":null},"tool_parameters":{"items":{"$ref":"#/components/schemas/AgentTestToolParameter"},"title":"Tool Parameters","type":"array"},"verify_absence":{"default":false,"title":"Verify Absence","type":"boolean"},"simulation":{"anyOf":[{"$ref":"#/components/schemas/AgentTestSimulationConfig"},{"type":"null"}],"default":null},"channel":{"anyOf":[{"enum":["web_voice","phone_inbound","phone_outbound"],"type":"string"},{"type":"null"}],"default":null,"description":"The channel a Single Turn or Tool test plays. null is web_voice. A Simulation test has its own in simulation.channel.","title":"Channel"},"dynamic_variables":{"additionalProperties":{"anyOf":[{"type":"string"},{"type":"integer"},{"type":"number"},{"type":"boolean"}]},"title":"Dynamic Variables","type":"object"},"judge":{"anyOf":[{"$ref":"#/components/schemas/AgentTestJudge"},{"type":"null"}],"default":null,"description":"The judge of a `next_reply` or `simulation` test. Null follows the workspace's Tests settings (`GET /v1/agent/test-settings`). A `tool` test has no judge, it is null there."}},"required":["test_id","workspace_id","name","test_type","created_at","updated_at"],"type":"object"}}}},"400":{"description":"Bad request syntax or unsupported method","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}},"401":{"description":"No permission -- see authorization schemes","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}},"422":{"description":"","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}},"503":{"description":"The server cannot process the request due to a high load","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}}},"tags":["Agent Tests"],"x-codeSamples":[{"lang":"bash","label":"Create Simulation Test","source":"curl --request POST \\\n  --url https://api.fish.audio/v1/agent/tests \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{\n    \"name\": \"Reschedules an appointment\",\n    \"test_type\": \"simulation\",\n    \"agent_ids\": [\"<agent-id>\"],\n    \"simulation\": {\n      \"scenario\": \"You are Jane. Move your Tuesday cleaning to Thursday afternoon.\",\n      \"max_turns\": 10,\n      \"success_conditions\": [\n        {\"name\": \"rescheduled\", \"description\": \"The agent confirms the new Thursday slot.\"}\n      ],\n      \"tool_mocks\": {\n        \"strategy\": \"all\",\n        \"tools\": [\n          {\n            \"tool\": {\"id\": \"<tool-id>\", \"name\": \"Book appointment\", \"type\": \"webhook\"},\n            \"result\": {\"status\": \"confirmed\"}\n          }\n        ]\n      }\n    }\n  }'"}]}},"/v1/agent/tests/{test_id}":{"get":{"summary":"Get Test","description":"Fetch one test's full definition. The body is also the export format: post\nit to `POST /v1/agent/tests` to create a copy.","security":[{"BearerAuth":[]}],"parameters":[{"in":"path","name":"test_id","description":"","required":true,"schema":{"title":"Test Id","type":"string"},"deprecated":false}],"responses":{"200":{"description":"Request fulfilled, document follows","headers":{},"content":{"application/json":{"schema":{"properties":{"test_id":{"title":"Test Id","type":"string"},"workspace_id":{"title":"Workspace Id","type":"string"},"name":{"title":"Name","type":"string"},"test_type":{"enum":["next_reply","tool","simulation"],"title":"Test Type","type":"string"},"folder_id":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"description":"The test folder the test is in (`/v1/agent/test-folders`), null outside any folder.","title":"Folder Id"},"agent_ids":{"description":"Agents this test is attached to.","items":{"type":"string"},"title":"Agent Ids","type":"array"},"created_at":{"format":"date-time","title":"Created At","type":"string"},"updated_at":{"format":"date-time","title":"Updated At","type":"string"},"conversation":{"items":{"$ref":"#/components/schemas/PublicAgentTestMessage"},"title":"Conversation","type":"array"},"expectation":{"default":"","title":"Expectation","type":"string"},"success_examples":{"items":{"type":"string"},"title":"Success Examples","type":"array"},"failure_examples":{"items":{"type":"string"},"title":"Failure Examples","type":"array"},"referenced_tool":{"anyOf":[{"$ref":"#/components/schemas/AgentTestReferencedTool"},{"type":"null"}],"default":null},"tool_parameters":{"items":{"$ref":"#/components/schemas/AgentTestToolParameter"},"title":"Tool Parameters","type":"array"},"verify_absence":{"default":false,"title":"Verify Absence","type":"boolean"},"simulation":{"anyOf":[{"$ref":"#/components/schemas/AgentTestSimulationConfig"},{"type":"null"}],"default":null},"channel":{"anyOf":[{"enum":["web_voice","phone_inbound","phone_outbound"],"type":"string"},{"type":"null"}],"default":null,"description":"The channel a Single Turn or Tool test plays. null is web_voice. A Simulation test has its own in simulation.channel.","title":"Channel"},"dynamic_variables":{"additionalProperties":{"anyOf":[{"type":"string"},{"type":"integer"},{"type":"number"},{"type":"boolean"}]},"title":"Dynamic Variables","type":"object"},"judge":{"anyOf":[{"$ref":"#/components/schemas/AgentTestJudge"},{"type":"null"}],"default":null,"description":"The judge of a `next_reply` or `simulation` test. Null follows the workspace's Tests settings (`GET /v1/agent/test-settings`). A `tool` test has no judge, it is null there."}},"required":["test_id","workspace_id","name","test_type","created_at","updated_at"],"type":"object"}}}},"401":{"description":"No permission -- see authorization schemes","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}},"404":{"description":"Nothing matches the given URI","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}},"503":{"description":"The server cannot process the request due to a high load","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}}},"tags":["Agent Tests"]},"patch":{"summary":"Update Test","description":"Patch test fields. Omitted fields keep their value and null is rejected,\nexcept `referenced_tool: null`, which turns a `tool` test into a check that\nthe agent calls no tool at all, and `folder_id: null`, which takes the\ntest out of its folder. A request that only sends `folder_id` moves the\ntest and leaves its `updated_at`. Attach and detach agents with\n`PUT` and `DELETE /v1/agent/agents/{agent_id}/tests/{test_id}`.","security":[{"BearerAuth":[]}],"parameters":[{"in":"path","name":"test_id","description":"","required":true,"schema":{"title":"Test Id","type":"string"},"deprecated":false}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublicAgentTestUpdatePayload"}}}},"responses":{"200":{"description":"Request fulfilled, document follows","headers":{},"content":{"application/json":{"schema":{"properties":{"test_id":{"title":"Test Id","type":"string"},"workspace_id":{"title":"Workspace Id","type":"string"},"name":{"title":"Name","type":"string"},"test_type":{"enum":["next_reply","tool","simulation"],"title":"Test Type","type":"string"},"folder_id":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"description":"The test folder the test is in (`/v1/agent/test-folders`), null outside any folder.","title":"Folder Id"},"agent_ids":{"description":"Agents this test is attached to.","items":{"type":"string"},"title":"Agent Ids","type":"array"},"created_at":{"format":"date-time","title":"Created At","type":"string"},"updated_at":{"format":"date-time","title":"Updated At","type":"string"},"conversation":{"items":{"$ref":"#/components/schemas/PublicAgentTestMessage"},"title":"Conversation","type":"array"},"expectation":{"default":"","title":"Expectation","type":"string"},"success_examples":{"items":{"type":"string"},"title":"Success Examples","type":"array"},"failure_examples":{"items":{"type":"string"},"title":"Failure Examples","type":"array"},"referenced_tool":{"anyOf":[{"$ref":"#/components/schemas/AgentTestReferencedTool"},{"type":"null"}],"default":null},"tool_parameters":{"items":{"$ref":"#/components/schemas/AgentTestToolParameter"},"title":"Tool Parameters","type":"array"},"verify_absence":{"default":false,"title":"Verify Absence","type":"boolean"},"simulation":{"anyOf":[{"$ref":"#/components/schemas/AgentTestSimulationConfig"},{"type":"null"}],"default":null},"channel":{"anyOf":[{"enum":["web_voice","phone_inbound","phone_outbound"],"type":"string"},{"type":"null"}],"default":null,"description":"The channel a Single Turn or Tool test plays. null is web_voice. A Simulation test has its own in simulation.channel.","title":"Channel"},"dynamic_variables":{"additionalProperties":{"anyOf":[{"type":"string"},{"type":"integer"},{"type":"number"},{"type":"boolean"}]},"title":"Dynamic Variables","type":"object"},"judge":{"anyOf":[{"$ref":"#/components/schemas/AgentTestJudge"},{"type":"null"}],"default":null,"description":"The judge of a `next_reply` or `simulation` test. Null follows the workspace's Tests settings (`GET /v1/agent/test-settings`). A `tool` test has no judge, it is null there."}},"required":["test_id","workspace_id","name","test_type","created_at","updated_at"],"type":"object"}}}},"401":{"description":"No permission -- see authorization schemes","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}},"404":{"description":"Nothing matches the given URI","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}},"422":{"description":"","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}},"503":{"description":"The server cannot process the request due to a high load","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}}},"tags":["Agent Tests"]},"delete":{"summary":"Delete Test","description":"Delete a test and detach it from every agent. Its past runs stay readable.","security":[{"BearerAuth":[]}],"parameters":[{"in":"path","name":"test_id","description":"","required":true,"schema":{"title":"Test Id","type":"string"},"deprecated":false}],"responses":{"204":{"description":"Request fulfilled, nothing follows","headers":{}},"401":{"description":"No permission -- see authorization schemes","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}},"404":{"description":"Nothing matches the given URI","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}},"503":{"description":"The server cannot process the request due to a high load","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}}},"tags":["Agent Tests"]}},"/v1/agent/test-runs":{"get":{"summary":"List Test Runs","description":"Your team's test runs, newest first, filtered by agent, test, batch,\nstatus or test type. `status` takes one value, so `status=error` lists\nthe runs that ended in an error and leaves out the `cancelled` ones. Items\nleave out the conversation and the judge's output. Fetch one run with `GET /v1/agent/test-runs/{run_id}` for those.\nPaginate with `cursor` (follow `next_cursor` while `has_more` is true) or\nwith `page` for offset pagination with a `total` count. The two are\nmutually exclusive.","security":[{"BearerAuth":[]}],"parameters":[{"in":"query","name":"agent_id","description":"","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Agent Id"},"deprecated":false},{"in":"query","name":"test_id","description":"","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Test Id"},"deprecated":false},{"in":"query","name":"batch_id","description":"","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Batch Id"},"deprecated":false},{"in":"query","name":"status","description":"","required":false,"schema":{"anyOf":[{"enum":["queued","running","passed","failed","error","cancelled"],"type":"string"},{"type":"null"}],"default":null,"title":"Status"},"deprecated":false},{"in":"query","name":"test_type","description":"","required":false,"schema":{"anyOf":[{"enum":["next_reply","tool","simulation"],"type":"string"},{"type":"null"}],"default":null,"title":"Test Type"},"deprecated":false},{"in":"query","name":"cursor","description":"","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Cursor"},"deprecated":false},{"in":"query","name":"page","description":"1-based page number, mutually exclusive with cursor.","required":false,"schema":{"anyOf":[{"minimum":1,"type":"integer"},{"type":"null"}],"default":null,"title":"Page"},"deprecated":false},{"in":"query","name":"include_total","description":"","required":false,"schema":{"default":false,"title":"Include Total","type":"boolean"},"deprecated":false},{"in":"query","name":"page_size","description":"","required":false,"schema":{"default":30,"maximum":100,"minimum":1,"title":"Page Size","type":"integer"},"deprecated":false}],"responses":{"200":{"description":"Request fulfilled, document follows","headers":{},"content":{"application/json":{"schema":{"properties":{"runs":{"items":{"$ref":"#/components/schemas/PublicAgentTestRunSummary"},"title":"Runs","type":"array"},"has_more":{"title":"Has More","type":"boolean"},"next_cursor":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Next Cursor"},"total":{"anyOf":[{"type":"integer"},{"type":"null"}],"default":null,"title":"Total"}},"required":["runs","has_more"],"type":"object"}}}},"400":{"description":"Bad request syntax or unsupported method","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}},"401":{"description":"No permission -- see authorization schemes","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}},"404":{"description":"Nothing matches the given URI","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}},"503":{"description":"The server cannot process the request due to a high load","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}}},"tags":["Agent Tests"]}},"/v1/agent/test-runs/{run_id}":{"get":{"summary":"Get Test Run","description":"Fetch one test run. Runs start `queued` and end `passed`, `failed`,\n`error` or `cancelled`. A simulation run takes minutes, so poll until it\nfinishes. A `cancelled` run never started because its batch was cancelled\nfirst. It has no `started_at`, its `finished_at` is the time of the\ncancel, and it is not billed.","security":[{"BearerAuth":[]}],"parameters":[{"in":"path","name":"run_id","description":"","required":true,"schema":{"title":"Run Id","type":"string"},"deprecated":false}],"responses":{"200":{"description":"Request fulfilled, document follows","headers":{},"content":{"application/json":{"schema":{"properties":{"run_id":{"title":"Run Id","type":"string"},"test_id":{"title":"Test Id","type":"string"},"agent_id":{"title":"Agent Id","type":"string"},"batch_id":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Batch Id"},"test_type":{"enum":["next_reply","tool","simulation"],"title":"Test Type","type":"string"},"repeat_index":{"default":0,"description":"Which repeat of the test in its batch this run is.","title":"Repeat Index","type":"integer"},"status":{"enum":["queued","running","passed","failed","error","cancelled"],"title":"Status","type":"string"},"needs_review":{"default":false,"description":"The judge could not decide, or a tool call had no mock answer.","title":"Needs Review","type":"boolean"},"error":{"default":"","title":"Error","type":"string"},"judge":{"anyOf":[{"$ref":"#/components/schemas/AgentTestJudge"},{"type":"null"}],"default":null,"description":"The model that judged the run and the reasoning level it judged at. Null on a `tool` test, which has no judge, on a run that ended before its judge was asked, and on `next_reply` runs from before the field existed. Simulation runs from before the judge could be chosen have a null level."},"usage":{"$ref":"#/components/schemas/PublicAgentTestRunUsage"},"created_at":{"format":"date-time","title":"Created At","type":"string"},"started_at":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}],"default":null,"title":"Started At"},"finished_at":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}],"default":null,"title":"Finished At"},"agent_reply":{"default":"","description":"The reply a scripted test judged.","title":"Agent Reply","type":"string"},"judge_reasoning":{"default":"","title":"Judge Reasoning","type":"string"},"config_hash":{"default":"","description":"The agent draft's config hash the run tested.","title":"Config Hash","type":"string"},"latency_ms":{"default":0,"title":"Latency Ms","type":"integer"},"simulation_result":{"anyOf":[{"$ref":"#/components/schemas/AgentTestSimulationResult"},{"type":"null"}],"default":null},"channel":{"anyOf":[{"enum":["web_voice","phone_inbound","phone_outbound"],"type":"string"},{"type":"null"}],"default":null,"description":"The channel the run played.","title":"Channel"},"turns_used":{"default":0,"title":"Turns Used","type":"integer"},"ended_by":{"anyOf":[{"enum":["agent","user","transfer","max_turns","timeout","error"],"type":"string"},{"type":"null"}],"default":null,"title":"Ended By"},"mock_gaps":{"items":{"$ref":"#/components/schemas/AgentTestMockGap"},"title":"Mock Gaps","type":"array"}},"required":["run_id","test_id","agent_id","test_type","status","created_at"],"type":"object"}}}},"401":{"description":"No permission -- see authorization schemes","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}},"404":{"description":"Nothing matches the given URI","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}},"503":{"description":"The server cannot process the request due to a high load","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}}},"tags":["Agent Tests"]}},"/v1/agent/test-settings":{"get":{"summary":"Get Test Settings","description":"Get the Tests settings of a workspace, the defaults every test in it\nuses unless the test sets its own. `judge` judges the Single Turn and\nSimulation tests without a `judge` of their own.","security":[{"BearerAuth":[]}],"parameters":[{"in":"query","name":"workspace_id","description":"The workspace whose settings to use. Required when your team has more than one workspace.","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Workspace Id"},"deprecated":false}],"responses":{"200":{"description":"Request fulfilled, document follows","headers":{},"content":{"application/json":{"schema":{"description":"The Tests settings of a workspace, shared by every test in it.","properties":{"workspace_id":{"description":"The workspace these settings belong to.","title":"Workspace Id","type":"string"},"judge":{"$ref":"#/components/schemas/AgentTestJudge","description":"The judge of a Single Turn or Simulation test that names no `judge` of its own, with the reasoning level it judges at. Always the judge such a test is judged by."},"judge_is_default":{"description":"True while the workspace has not set `judge` and reads the platform default.","title":"Judge Is Default","type":"boolean"}},"required":["workspace_id","judge","judge_is_default"],"type":"object"}}}},"400":{"description":"Bad request syntax or unsupported method","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}},"401":{"description":"No permission -- see authorization schemes","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}},"404":{"description":"Nothing matches the given URI","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}},"503":{"description":"The server cannot process the request due to a high load","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}}},"tags":["Agent Tests"]},"patch":{"summary":"Update Test Settings","description":"Change the Tests settings of a workspace. Only the fields you send\nchange. A test run picks its judge when it starts, so runs already\nstarted keep the judge they started with.","security":[{"BearerAuth":[]}],"parameters":[{"in":"query","name":"workspace_id","description":"The workspace whose settings to use. Required when your team has more than one workspace.","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Workspace Id"},"deprecated":false}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentTestSettingsPatch"}}}},"responses":{"200":{"description":"Request fulfilled, document follows","headers":{},"content":{"application/json":{"schema":{"description":"The Tests settings of a workspace, shared by every test in it.","properties":{"workspace_id":{"description":"The workspace these settings belong to.","title":"Workspace Id","type":"string"},"judge":{"$ref":"#/components/schemas/AgentTestJudge","description":"The judge of a Single Turn or Simulation test that names no `judge` of its own, with the reasoning level it judges at. Always the judge such a test is judged by."},"judge_is_default":{"description":"True while the workspace has not set `judge` and reads the platform default.","title":"Judge Is Default","type":"boolean"}},"required":["workspace_id","judge","judge_is_default"],"type":"object"}}}},"400":{"description":"Bad request syntax or unsupported method","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}},"401":{"description":"No permission -- see authorization schemes","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}},"404":{"description":"Nothing matches the given URI","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}},"422":{"description":"","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}},"503":{"description":"The server cannot process the request due to a high load","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}}},"tags":["Agent Tests"]}},"/v1/agent/test-folders":{"get":{"summary":"List Test Folders","description":"List your team's test folders across all workspaces, newest first. A\nfolder holds tests, one level deep, and is shared by every agent of its\nworkspace. Folder names are unique per workspace, so two workspaces can\neach have a \"Billing\" folder. Tell them apart by `workspace_id`. Paginate\nwith `cursor` (follow `next_cursor` while `has_more` is true) or with\n`page` for offset pagination with a `total` count. The two are mutually\nexclusive. To list the tests in a folder, call\n`GET /v1/agent/tests?folder_id=<folder_id>`, and pass `include_total=true`\nthere for a count.","security":[{"BearerAuth":[]}],"parameters":[{"in":"query","name":"cursor","description":"","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Cursor"},"deprecated":false},{"in":"query","name":"page","description":"1-based page number; mutually exclusive with cursor.","required":false,"schema":{"anyOf":[{"minimum":1,"type":"integer"},{"type":"null"}],"default":null,"title":"Page"},"deprecated":false},{"in":"query","name":"include_total","description":"","required":false,"schema":{"default":false,"title":"Include Total","type":"boolean"},"deprecated":false},{"in":"query","name":"page_size","description":"","required":false,"schema":{"default":30,"maximum":100,"minimum":1,"title":"Page Size","type":"integer"},"deprecated":false}],"responses":{"200":{"description":"Request fulfilled, document follows","headers":{},"content":{"application/json":{"schema":{"properties":{"folders":{"items":{"$ref":"#/components/schemas/PublicTestFolder"},"title":"Folders","type":"array"},"has_more":{"title":"Has More","type":"boolean"},"next_cursor":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Next Cursor"},"total":{"anyOf":[{"type":"integer"},{"type":"null"}],"default":null,"title":"Total"}},"required":["folders","has_more"],"type":"object"}}}},"400":{"description":"Bad request syntax or unsupported method","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}},"401":{"description":"No permission -- see authorization schemes","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}},"503":{"description":"The server cannot process the request due to a high load","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}}},"tags":["Agent Tests"]},"post":{"summary":"Create Test Folder","description":"Create a folder in the API key owner's default workspace. Returns 409 if\nthat workspace already has a folder with the same name (compared exactly,\ncase-sensitive). Put tests in it by passing `folder_id` when you create\nor update them. A test is in one folder at most.","security":[{"BearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublicTestFolderPayload"}}}},"responses":{"201":{"description":"Document created, URL follows","headers":{},"content":{"application/json":{"schema":{"properties":{"folder_id":{"title":"Folder Id","type":"string"},"workspace_id":{"title":"Workspace Id","type":"string"},"name":{"title":"Name","type":"string"},"created_at":{"format":"date-time","title":"Created At","type":"string"},"updated_at":{"format":"date-time","title":"Updated At","type":"string"}},"required":["folder_id","workspace_id","name","created_at","updated_at"],"type":"object"}}}},"401":{"description":"No permission -- see authorization schemes","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}},"403":{"description":"Request forbidden -- authorization will not help","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}},"409":{"description":"Request conflict","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}},"422":{"description":"","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}},"503":{"description":"The server cannot process the request due to a high load","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}}},"tags":["Agent Tests"]}},"/v1/agent/test-folders/{folder_id}":{"patch":{"summary":"Rename Test Folder","description":"Rename a folder. The name must be free within the folder's own workspace\n(409 otherwise). Renaming a folder to its current name succeeds.","security":[{"BearerAuth":[]}],"parameters":[{"in":"path","name":"folder_id","description":"","required":true,"schema":{"title":"Folder Id","type":"string"},"deprecated":false}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublicTestFolderPayload"}}}},"responses":{"200":{"description":"Request fulfilled, document follows","headers":{},"content":{"application/json":{"schema":{"properties":{"folder_id":{"title":"Folder Id","type":"string"},"workspace_id":{"title":"Workspace Id","type":"string"},"name":{"title":"Name","type":"string"},"created_at":{"format":"date-time","title":"Created At","type":"string"},"updated_at":{"format":"date-time","title":"Updated At","type":"string"}},"required":["folder_id","workspace_id","name","created_at","updated_at"],"type":"object"}}}},"401":{"description":"No permission -- see authorization schemes","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}},"404":{"description":"Nothing matches the given URI","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}},"409":{"description":"Request conflict","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}},"422":{"description":"","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}},"503":{"description":"The server cannot process the request due to a high load","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}}},"tags":["Agent Tests"]},"delete":{"summary":"Delete Test Folder","description":"Delete a folder, empty or not. The tests inside it are not deleted. They\nare taken out of the folder (`folder_id` becomes null) and stay attached\nto their agents.","security":[{"BearerAuth":[]}],"parameters":[{"in":"path","name":"folder_id","description":"","required":true,"schema":{"title":"Folder Id","type":"string"},"deprecated":false}],"responses":{"204":{"description":"Request fulfilled, nothing follows","headers":{}},"401":{"description":"No permission -- see authorization schemes","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}},"404":{"description":"Nothing matches the given URI","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}},"503":{"description":"The server cannot process the request due to a high load","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}}},"tags":["Agent Tests"]}},"/v1/agent/phone-numbers":{"get":{"summary":"List Phone Numbers","description":"List your team's phone numbers, newest first. Released numbers are gone\nfor good and never appear. Look an id up by E.164 with `phone_number`, or\nfilter with `agent_id` to see one agent's numbers. Paginate with `cursor`\n(follow `next_cursor` while `has_more` is true) or with `page` for offset\npagination with a `total` count — the two are mutually exclusive.","security":[{"BearerAuth":[]}],"parameters":[{"in":"query","name":"phone_number","description":"Exact E.164 match, e.g. +14155550123.","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Phone Number"},"deprecated":false},{"in":"query","name":"agent_id","description":"Only numbers bound to this agent.","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Agent Id"},"deprecated":false},{"in":"query","name":"cursor","description":"","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Cursor"},"deprecated":false},{"in":"query","name":"page","description":"1-based page number; mutually exclusive with cursor.","required":false,"schema":{"anyOf":[{"minimum":1,"type":"integer"},{"type":"null"}],"default":null,"title":"Page"},"deprecated":false},{"in":"query","name":"include_total","description":"","required":false,"schema":{"default":false,"title":"Include Total","type":"boolean"},"deprecated":false},{"in":"query","name":"page_size","description":"","required":false,"schema":{"default":30,"maximum":100,"minimum":1,"title":"Page Size","type":"integer"},"deprecated":false}],"responses":{"200":{"description":"Request fulfilled, document follows","headers":{},"content":{"application/json":{"schema":{"properties":{"phone_numbers":{"items":{"$ref":"#/components/schemas/PublicPhoneNumberEntity"},"title":"Phone Numbers","type":"array"},"has_more":{"title":"Has More","type":"boolean"},"next_cursor":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Next Cursor"},"total":{"anyOf":[{"type":"integer"},{"type":"null"}],"default":null,"title":"Total"}},"required":["phone_numbers","has_more"],"type":"object"}}}},"400":{"description":"Bad request syntax or unsupported method","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}},"401":{"description":"No permission -- see authorization schemes","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}},"404":{"description":"Nothing matches the given URI","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}},"503":{"description":"The server cannot process the request due to a high load","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}}},"tags":["Phone Numbers"]},"post":{"summary":"Purchase or Import Phone Number","description":"`provider` discriminates two variants. `twilio` buys a number from the\nmanaged inventory: it lands in your default workspace, any `agent_id` you\nbind must live there too, and billing is the monthly price charged in\ndaily slices; the first day is charged before anything is bought (402\ncosts you nothing) and the daily run advances it from there. `sip`\nimports a number you already own at your carrier: point your trunk's\norigination at our SIP host, provide inbound authentication (digest\nand/or source CIDRs) and optionally a termination host so the number can\nplace calls; nothing is rented and there is no monthly fee. Either way,\n409 means the number is already on the platform, and 502 means the\nprovider or trunk provisioning refused. Nothing is charged and no number\nis added, so pick another number or correct the trunk settings and try\nagain. If the provider did not answer, the number can stay in `error`\nwith `status_reason` `provisioning_failed`, and releasing it cleans up.\n403 with\n`reason: phone_number_limit_reached` means your team already holds as\nmany numbers as it may. An account that has never added credit holds one.","security":[{"BearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/PublicPhoneNumberPurchasePayload"},{"$ref":"#/components/schemas/PublicSipNumberImportPayload"}]}}}},"responses":{"201":{"description":"Document created, URL follows","headers":{},"content":{"application/json":{"schema":{"properties":{"phone_number_id":{"title":"Phone Number Id","type":"string"},"workspace_id":{"title":"Workspace Id","type":"string"},"phone_number":{"description":"E.164, e.g. +14155550123.","title":"Phone Number","type":"string"},"provider":{"enum":["livekit","twilio","sip","whatsapp"],"title":"Provider","type":"string"},"label":{"default":"","title":"Label","type":"string"},"agent_id":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Inbound calls route to this agent; unbound numbers ring busy.","title":"Agent Id"},"transfer_caller_id":{"anyOf":[{"enum":["agent_number","original_caller"],"type":"string"},{"type":"null"}],"default":null,"description":"Managed `twilio` numbers: the caller ID a transfer target sees, on cold and warm transfers alike. `agent_number` shows this number, `original_caller` shows the caller's own number (a warm transfer falls back to this number when the caller withholds theirs). `null` for imported `sip` numbers, whose carrier decides.","title":"Transfer Caller Id"},"cold_transfer_use_original_caller":{"anyOf":[{"type":"boolean"},{"type":"null"}],"default":null,"deprecated":true,"description":"Deprecated, read `transfer_caller_id`. True when it is `original_caller`.","title":"Cold Transfer Use Original Caller"},"cold_transfer_use_original_caller_effective":{"anyOf":[{"type":"boolean"},{"type":"null"}],"default":null,"deprecated":true,"description":"Deprecated, read `caller_id_sync_status`. Whether the carrier has confirmed the original caller policy for cold transfers, `null` while unknown.","title":"Cold Transfer Use Original Caller Effective"},"caller_id_sync_status":{"default":"carrier_managed","description":"`synced` once the carrier confirmed the policy, `pending` while it is being applied, `error` when the last attempt failed (send `retry_caller_id_sync`), `carrier_managed` for imported `sip` numbers.","enum":["synced","pending","error","carrier_managed"],"title":"Caller Id Sync Status","type":"string"},"caller_id_sync_error":{"default":"","description":"Why the last synchronization failed; empty otherwise.","title":"Caller Id Sync Error","type":"string"},"status":{"enum":["provisioning","active","error","released"],"title":"Status","type":"string"},"status_reason":{"anyOf":[{"enum":["out_of_credit","provisioning_failed"],"type":"string"},{"type":"null"}],"default":null,"description":"Why the number is in `error`, `null` in every other status. `out_of_credit` means the API credit balance could not pay the number's daily fee, so the number is suspended and refuses calls. Top up API credit and it resumes by itself. A number left unpaid for 30 days is released. `provisioning_failed` means buying or importing the number did not finish and it cannot take calls. Release it, then buy or import the number again. More values may be added, so treat an unknown one as a generic error.","title":"Status Reason"},"status_detail":{"default":"","description":"What failed when status is `error`; empty otherwise.","title":"Status Detail","type":"string"},"supports_outbound":{"default":false,"description":"Whether the number can place calls (outbound and warm-transfer consult legs): managed `twilio` always, imported `sip` only when a termination was configured.","title":"Supports Outbound","type":"boolean"},"termination_uri":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"description":"Imported `sip` numbers: the customer trunk's termination host.","title":"Termination Uri"},"inbound_auth_username":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"description":"Imported `sip` numbers: the inbound digest username. Passwords are never echoed.","title":"Inbound Auth Username"},"inbound_allowed_addresses":{"description":"Imported `sip` numbers: allowed source IPs/CIDRs.","items":{"type":"string"},"title":"Inbound Allowed Addresses","type":"array"},"termination_transport":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"description":"Imported `sip` numbers: termination transport.","title":"Termination Transport"},"termination_auth_username":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"description":"Imported `sip` numbers: the termination digest username. Passwords are never echoed.","title":"Termination Auth Username"},"termination_headers":{"additionalProperties":{"type":"string"},"description":"Imported `sip` numbers: custom SIP headers added to every outbound INVITE through the termination.","title":"Termination Headers","type":"object"},"created_at":{"format":"date-time","title":"Created At","type":"string"},"updated_at":{"format":"date-time","title":"Updated At","type":"string"}},"required":["phone_number_id","workspace_id","phone_number","provider","agent_id","status","created_at","updated_at"],"type":"object"}}}},"401":{"description":"No permission -- see authorization schemes","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}},"402":{"description":"No payment -- see charging schemes","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}},"403":{"description":"Request forbidden -- authorization will not help","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}},"404":{"description":"Nothing matches the given URI","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}},"409":{"description":"Request conflict","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}},"422":{"description":"","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}},"502":{"description":"Invalid responses from another server/proxy","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}},"503":{"description":"The server cannot process the request due to a high load","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}}},"tags":["Phone Numbers"]}},"/v1/agent/phone-numbers/{phone_number_id}":{"get":{"summary":"Get Phone Number","description":"Fetch one phone number, including its current agent binding and\nprovisioning status.","security":[{"BearerAuth":[]}],"parameters":[{"in":"path","name":"phone_number_id","description":"","required":true,"schema":{"title":"Phone Number Id","type":"string"},"deprecated":false}],"responses":{"200":{"description":"Request fulfilled, document follows","headers":{},"content":{"application/json":{"schema":{"properties":{"phone_number_id":{"title":"Phone Number Id","type":"string"},"workspace_id":{"title":"Workspace Id","type":"string"},"phone_number":{"description":"E.164, e.g. +14155550123.","title":"Phone Number","type":"string"},"provider":{"enum":["livekit","twilio","sip","whatsapp"],"title":"Provider","type":"string"},"label":{"default":"","title":"Label","type":"string"},"agent_id":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Inbound calls route to this agent; unbound numbers ring busy.","title":"Agent Id"},"transfer_caller_id":{"anyOf":[{"enum":["agent_number","original_caller"],"type":"string"},{"type":"null"}],"default":null,"description":"Managed `twilio` numbers: the caller ID a transfer target sees, on cold and warm transfers alike. `agent_number` shows this number, `original_caller` shows the caller's own number (a warm transfer falls back to this number when the caller withholds theirs). `null` for imported `sip` numbers, whose carrier decides.","title":"Transfer Caller Id"},"cold_transfer_use_original_caller":{"anyOf":[{"type":"boolean"},{"type":"null"}],"default":null,"deprecated":true,"description":"Deprecated, read `transfer_caller_id`. True when it is `original_caller`.","title":"Cold Transfer Use Original Caller"},"cold_transfer_use_original_caller_effective":{"anyOf":[{"type":"boolean"},{"type":"null"}],"default":null,"deprecated":true,"description":"Deprecated, read `caller_id_sync_status`. Whether the carrier has confirmed the original caller policy for cold transfers, `null` while unknown.","title":"Cold Transfer Use Original Caller Effective"},"caller_id_sync_status":{"default":"carrier_managed","description":"`synced` once the carrier confirmed the policy, `pending` while it is being applied, `error` when the last attempt failed (send `retry_caller_id_sync`), `carrier_managed` for imported `sip` numbers.","enum":["synced","pending","error","carrier_managed"],"title":"Caller Id Sync Status","type":"string"},"caller_id_sync_error":{"default":"","description":"Why the last synchronization failed; empty otherwise.","title":"Caller Id Sync Error","type":"string"},"status":{"enum":["provisioning","active","error","released"],"title":"Status","type":"string"},"status_reason":{"anyOf":[{"enum":["out_of_credit","provisioning_failed"],"type":"string"},{"type":"null"}],"default":null,"description":"Why the number is in `error`, `null` in every other status. `out_of_credit` means the API credit balance could not pay the number's daily fee, so the number is suspended and refuses calls. Top up API credit and it resumes by itself. A number left unpaid for 30 days is released. `provisioning_failed` means buying or importing the number did not finish and it cannot take calls. Release it, then buy or import the number again. More values may be added, so treat an unknown one as a generic error.","title":"Status Reason"},"status_detail":{"default":"","description":"What failed when status is `error`; empty otherwise.","title":"Status Detail","type":"string"},"supports_outbound":{"default":false,"description":"Whether the number can place calls (outbound and warm-transfer consult legs): managed `twilio` always, imported `sip` only when a termination was configured.","title":"Supports Outbound","type":"boolean"},"termination_uri":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"description":"Imported `sip` numbers: the customer trunk's termination host.","title":"Termination Uri"},"inbound_auth_username":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"description":"Imported `sip` numbers: the inbound digest username. Passwords are never echoed.","title":"Inbound Auth Username"},"inbound_allowed_addresses":{"description":"Imported `sip` numbers: allowed source IPs/CIDRs.","items":{"type":"string"},"title":"Inbound Allowed Addresses","type":"array"},"termination_transport":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"description":"Imported `sip` numbers: termination transport.","title":"Termination Transport"},"termination_auth_username":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"description":"Imported `sip` numbers: the termination digest username. Passwords are never echoed.","title":"Termination Auth Username"},"termination_headers":{"additionalProperties":{"type":"string"},"description":"Imported `sip` numbers: custom SIP headers added to every outbound INVITE through the termination.","title":"Termination Headers","type":"object"},"created_at":{"format":"date-time","title":"Created At","type":"string"},"updated_at":{"format":"date-time","title":"Updated At","type":"string"}},"required":["phone_number_id","workspace_id","phone_number","provider","agent_id","status","created_at","updated_at"],"type":"object"}}}},"401":{"description":"No permission -- see authorization schemes","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}},"404":{"description":"Nothing matches the given URI","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}},"503":{"description":"The server cannot process the request due to a high load","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}}},"tags":["Phone Numbers"]},"patch":{"summary":"Update Phone Number","description":"Change the label and/or repoint the number at another agent — the\ndeployment-pipeline move (rebind from the staging agent to the production\none). Send `agent_id: null` to unbind; unbound numbers ring busy. The\nagent must live in the number's workspace. Rebinding is a routing-table\nupdate resolved on the next inbound call; nothing about the number itself\nis reprovisioned.\n\nManaged `twilio` numbers also accept `transfer_caller_id`, which picks\nthe number a transfer target sees (cold and warm alike), and\n`retry_caller_id_sync` to re-apply it after a failed synchronization. Read\n`caller_id_sync_status` on the response. Imported `sip` numbers return 409\nfor either field because their carrier owns the setting.\n\nEvery field here is a number setting, not agent config: changes apply\nfrom the next call without publishing, and publishing or rolling back the\nagent never changes them. Cold-transfer caller ID applies once\n`caller_id_sync_status` is `synced`.","security":[{"BearerAuth":[]}],"parameters":[{"in":"path","name":"phone_number_id","description":"","required":true,"schema":{"title":"Phone Number Id","type":"string"},"deprecated":false}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublicPhoneNumberUpdatePayload"}}}},"responses":{"200":{"description":"Request fulfilled, document follows","headers":{},"content":{"application/json":{"schema":{"properties":{"phone_number_id":{"title":"Phone Number Id","type":"string"},"workspace_id":{"title":"Workspace Id","type":"string"},"phone_number":{"description":"E.164, e.g. +14155550123.","title":"Phone Number","type":"string"},"provider":{"enum":["livekit","twilio","sip","whatsapp"],"title":"Provider","type":"string"},"label":{"default":"","title":"Label","type":"string"},"agent_id":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Inbound calls route to this agent; unbound numbers ring busy.","title":"Agent Id"},"transfer_caller_id":{"anyOf":[{"enum":["agent_number","original_caller"],"type":"string"},{"type":"null"}],"default":null,"description":"Managed `twilio` numbers: the caller ID a transfer target sees, on cold and warm transfers alike. `agent_number` shows this number, `original_caller` shows the caller's own number (a warm transfer falls back to this number when the caller withholds theirs). `null` for imported `sip` numbers, whose carrier decides.","title":"Transfer Caller Id"},"cold_transfer_use_original_caller":{"anyOf":[{"type":"boolean"},{"type":"null"}],"default":null,"deprecated":true,"description":"Deprecated, read `transfer_caller_id`. True when it is `original_caller`.","title":"Cold Transfer Use Original Caller"},"cold_transfer_use_original_caller_effective":{"anyOf":[{"type":"boolean"},{"type":"null"}],"default":null,"deprecated":true,"description":"Deprecated, read `caller_id_sync_status`. Whether the carrier has confirmed the original caller policy for cold transfers, `null` while unknown.","title":"Cold Transfer Use Original Caller Effective"},"caller_id_sync_status":{"default":"carrier_managed","description":"`synced` once the carrier confirmed the policy, `pending` while it is being applied, `error` when the last attempt failed (send `retry_caller_id_sync`), `carrier_managed` for imported `sip` numbers.","enum":["synced","pending","error","carrier_managed"],"title":"Caller Id Sync Status","type":"string"},"caller_id_sync_error":{"default":"","description":"Why the last synchronization failed; empty otherwise.","title":"Caller Id Sync Error","type":"string"},"status":{"enum":["provisioning","active","error","released"],"title":"Status","type":"string"},"status_reason":{"anyOf":[{"enum":["out_of_credit","provisioning_failed"],"type":"string"},{"type":"null"}],"default":null,"description":"Why the number is in `error`, `null` in every other status. `out_of_credit` means the API credit balance could not pay the number's daily fee, so the number is suspended and refuses calls. Top up API credit and it resumes by itself. A number left unpaid for 30 days is released. `provisioning_failed` means buying or importing the number did not finish and it cannot take calls. Release it, then buy or import the number again. More values may be added, so treat an unknown one as a generic error.","title":"Status Reason"},"status_detail":{"default":"","description":"What failed when status is `error`; empty otherwise.","title":"Status Detail","type":"string"},"supports_outbound":{"default":false,"description":"Whether the number can place calls (outbound and warm-transfer consult legs): managed `twilio` always, imported `sip` only when a termination was configured.","title":"Supports Outbound","type":"boolean"},"termination_uri":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"description":"Imported `sip` numbers: the customer trunk's termination host.","title":"Termination Uri"},"inbound_auth_username":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"description":"Imported `sip` numbers: the inbound digest username. Passwords are never echoed.","title":"Inbound Auth Username"},"inbound_allowed_addresses":{"description":"Imported `sip` numbers: allowed source IPs/CIDRs.","items":{"type":"string"},"title":"Inbound Allowed Addresses","type":"array"},"termination_transport":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"description":"Imported `sip` numbers: termination transport.","title":"Termination Transport"},"termination_auth_username":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"description":"Imported `sip` numbers: the termination digest username. Passwords are never echoed.","title":"Termination Auth Username"},"termination_headers":{"additionalProperties":{"type":"string"},"description":"Imported `sip` numbers: custom SIP headers added to every outbound INVITE through the termination.","title":"Termination Headers","type":"object"},"created_at":{"format":"date-time","title":"Created At","type":"string"},"updated_at":{"format":"date-time","title":"Updated At","type":"string"}},"required":["phone_number_id","workspace_id","phone_number","provider","agent_id","status","created_at","updated_at"],"type":"object"}}}},"401":{"description":"No permission -- see authorization schemes","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}},"404":{"description":"Nothing matches the given URI","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}},"409":{"description":"Request conflict","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}},"422":{"description":"","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}},"503":{"description":"The server cannot process the request due to a high load","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}}},"tags":["Phone Numbers"]},"delete":{"summary":"Release Phone Number","description":"Release a number back to the provider's inventory and stop its daily\nbilling. This is irreversible: anyone — including other platforms — can\nbuy the number afterwards, so callers who saved it may reach a stranger.\nThe number disappears from this API immediately. 409 while a SIP config\nupdate of an imported number is still running, retry shortly.","security":[{"BearerAuth":[]}],"parameters":[{"in":"path","name":"phone_number_id","description":"","required":true,"schema":{"title":"Phone Number Id","type":"string"},"deprecated":false}],"responses":{"204":{"description":"Request fulfilled, nothing follows","headers":{}},"401":{"description":"No permission -- see authorization schemes","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}},"404":{"description":"Nothing matches the given URI","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}},"409":{"description":"Request conflict","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}},"503":{"description":"The server cannot process the request due to a high load","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}}},"tags":["Phone Numbers"]}},"/v1/agent/phone-numbers/{phone_number_id}/sip-config":{"put":{"summary":"Update SIP Number Config","description":"Replace the trunk configuration of an imported `sip` number in place:\nrotate digest credentials, change the allowed source addresses, or add,\nupdate and remove the termination host and its custom SIP headers. Send\nthe complete desired configuration; an empty password beside a set\nusername keeps the stored one. Trunk ids are stable across updates, so calls in flight are not\naffected. 409 for numbers that are not `sip` imports or not active.","security":[{"BearerAuth":[]}],"parameters":[{"in":"path","name":"phone_number_id","description":"","required":true,"schema":{"title":"Phone Number Id","type":"string"},"deprecated":false}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublicSipNumberConfigPayload"}}}},"responses":{"200":{"description":"Request fulfilled, document follows","headers":{},"content":{"application/json":{"schema":{"properties":{"phone_number_id":{"title":"Phone Number Id","type":"string"},"workspace_id":{"title":"Workspace Id","type":"string"},"phone_number":{"description":"E.164, e.g. +14155550123.","title":"Phone Number","type":"string"},"provider":{"enum":["livekit","twilio","sip","whatsapp"],"title":"Provider","type":"string"},"label":{"default":"","title":"Label","type":"string"},"agent_id":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Inbound calls route to this agent; unbound numbers ring busy.","title":"Agent Id"},"transfer_caller_id":{"anyOf":[{"enum":["agent_number","original_caller"],"type":"string"},{"type":"null"}],"default":null,"description":"Managed `twilio` numbers: the caller ID a transfer target sees, on cold and warm transfers alike. `agent_number` shows this number, `original_caller` shows the caller's own number (a warm transfer falls back to this number when the caller withholds theirs). `null` for imported `sip` numbers, whose carrier decides.","title":"Transfer Caller Id"},"cold_transfer_use_original_caller":{"anyOf":[{"type":"boolean"},{"type":"null"}],"default":null,"deprecated":true,"description":"Deprecated, read `transfer_caller_id`. True when it is `original_caller`.","title":"Cold Transfer Use Original Caller"},"cold_transfer_use_original_caller_effective":{"anyOf":[{"type":"boolean"},{"type":"null"}],"default":null,"deprecated":true,"description":"Deprecated, read `caller_id_sync_status`. Whether the carrier has confirmed the original caller policy for cold transfers, `null` while unknown.","title":"Cold Transfer Use Original Caller Effective"},"caller_id_sync_status":{"default":"carrier_managed","description":"`synced` once the carrier confirmed the policy, `pending` while it is being applied, `error` when the last attempt failed (send `retry_caller_id_sync`), `carrier_managed` for imported `sip` numbers.","enum":["synced","pending","error","carrier_managed"],"title":"Caller Id Sync Status","type":"string"},"caller_id_sync_error":{"default":"","description":"Why the last synchronization failed; empty otherwise.","title":"Caller Id Sync Error","type":"string"},"status":{"enum":["provisioning","active","error","released"],"title":"Status","type":"string"},"status_reason":{"anyOf":[{"enum":["out_of_credit","provisioning_failed"],"type":"string"},{"type":"null"}],"default":null,"description":"Why the number is in `error`, `null` in every other status. `out_of_credit` means the API credit balance could not pay the number's daily fee, so the number is suspended and refuses calls. Top up API credit and it resumes by itself. A number left unpaid for 30 days is released. `provisioning_failed` means buying or importing the number did not finish and it cannot take calls. Release it, then buy or import the number again. More values may be added, so treat an unknown one as a generic error.","title":"Status Reason"},"status_detail":{"default":"","description":"What failed when status is `error`; empty otherwise.","title":"Status Detail","type":"string"},"supports_outbound":{"default":false,"description":"Whether the number can place calls (outbound and warm-transfer consult legs): managed `twilio` always, imported `sip` only when a termination was configured.","title":"Supports Outbound","type":"boolean"},"termination_uri":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"description":"Imported `sip` numbers: the customer trunk's termination host.","title":"Termination Uri"},"inbound_auth_username":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"description":"Imported `sip` numbers: the inbound digest username. Passwords are never echoed.","title":"Inbound Auth Username"},"inbound_allowed_addresses":{"description":"Imported `sip` numbers: allowed source IPs/CIDRs.","items":{"type":"string"},"title":"Inbound Allowed Addresses","type":"array"},"termination_transport":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"description":"Imported `sip` numbers: termination transport.","title":"Termination Transport"},"termination_auth_username":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"description":"Imported `sip` numbers: the termination digest username. Passwords are never echoed.","title":"Termination Auth Username"},"termination_headers":{"additionalProperties":{"type":"string"},"description":"Imported `sip` numbers: custom SIP headers added to every outbound INVITE through the termination.","title":"Termination Headers","type":"object"},"created_at":{"format":"date-time","title":"Created At","type":"string"},"updated_at":{"format":"date-time","title":"Updated At","type":"string"}},"required":["phone_number_id","workspace_id","phone_number","provider","agent_id","status","created_at","updated_at"],"type":"object"}}}},"401":{"description":"No permission -- see authorization schemes","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}},"404":{"description":"Nothing matches the given URI","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}},"409":{"description":"Request conflict","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}},"422":{"description":"","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}},"502":{"description":"Invalid responses from another server/proxy","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}},"503":{"description":"The server cannot process the request due to a high load","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}}},"tags":["Phone Numbers"]}},"/v1/agent/phone-calls":{"post":{"summary":"Create Phone Call","description":"Place an outbound call from one of your phone numbers. Platform numbers\ndial US, Canada or Japan destinations, and a domestic trunk 0 after +81\n(e.g. +81080...) is accepted and normalized to E.164 (+8180...).\nImported SIP numbers dial through their own termination and may attach\ncustom INVITE headers with `sip_headers`. Returns immediately with the\nsession queued for dialing. Subscribe to the `phone_call.dial_finished`\nwebhook or poll `GET /v1/agent/sessions/{session_id}` for the dial\noutcome and the leg's `sip_call_id`. Ringing is never billed: metering\nstarts when the callee answers.\n\nErrors carry a machine-readable `reason` (e.g. `destination_not_allowed`,\n`insufficient_credit`, `concurrency_limit_exceeded`).","security":[{"BearerAuth":[]}],"parameters":[{"in":"header","name":"idempotency-key","description":"Retry-safe replay key: the same key with the same body returns the call already placed instead of dialing again (24h window).","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Idempotency-Key"},"deprecated":false}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PhoneCallCreatePayload"}}}},"responses":{"201":{"description":"Document created, URL follows","headers":{},"content":{"application/json":{"schema":{"properties":{"session_id":{"title":"Session Id","type":"string"},"status":{"const":"queued","default":"queued","title":"Status","type":"string"}},"required":["session_id"],"type":"object"}}}},"401":{"description":"No permission -- see authorization schemes","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}},"402":{"description":"No payment -- see charging schemes","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}},"403":{"description":"Request forbidden -- authorization will not help","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}},"404":{"description":"Nothing matches the given URI","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}},"409":{"description":"Request conflict","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}},"422":{"description":"","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}},"429":{"description":"The user has sent too many requests in a given amount of time (\"rate limiting\")","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}},"502":{"description":"Invalid responses from another server/proxy","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}},"503":{"description":"The server cannot process the request due to a high load","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}}},"tags":["Phone Calls"],"x-codeSamples":[{"lang":"bash","label":"Create Phone Call","source":"curl --request POST \\\n  --url https://api.fish.audio/v1/agent/phone-calls \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --header 'Idempotency-Key: <unique-key>' \\\n  --data '{\n    \"agent_id\": \"<agent-id>\",\n    \"phone_number_id\": \"<phone-number-id>\",\n    \"to_number\": \"+14155550123\"\n  }'"}]}},"/v1/agent/background-sounds":{"get":{"summary":"List Background Sounds","description":"List your team's uploaded background-ambience clips, newest first.\nSelect one with `voice.background_sound.custom_asset_id` (preset\n`custom`) on an agent's config.","security":[{"BearerAuth":[]}],"responses":{"200":{"description":"Request fulfilled, document follows","headers":{},"content":{"application/json":{"schema":{"properties":{"background_sounds":{"items":{"$ref":"#/components/schemas/AgentBackgroundSoundEntity"},"title":"Background Sounds","type":"array"},"total":{"title":"Total","type":"integer"}},"required":["background_sounds","total"],"type":"object"}}}},"401":{"description":"No permission -- see authorization schemes","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}},"503":{"description":"The server cannot process the request due to a high load","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}}},"tags":["Agent Background Sounds"]},"post":{"summary":"Create Background Sound","description":"Upload an mp3/wav/ogg/m4a clip, up to 10 MB and 300 seconds. Send\n`multipart/form-data` with the file in `file`. The returned id is what\n`voice.background_sound.custom_asset_id` names.","security":[{"BearerAuth":[]}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"properties":{"file":{"format":"binary","title":"File","type":"string"}},"required":["file"],"type":"object"}}}},"responses":{"201":{"description":"Document created, URL follows","headers":{},"content":{"application/json":{"schema":{"properties":{"_id":{"title":"Id","type":"string"},"name":{"title":"Name","type":"string"},"duration_seconds":{"title":"Duration Seconds","type":"number"},"size_bytes":{"title":"Size Bytes","type":"integer"},"created_at":{"format":"date-time","title":"Created At","type":"string"}},"required":["_id","name","duration_seconds","size_bytes","created_at"],"type":"object"}}}},"400":{"description":"Bad request syntax or unsupported method","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}},"401":{"description":"No permission -- see authorization schemes","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}},"422":{"description":"","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}},"503":{"description":"The server cannot process the request due to a high load","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}}},"tags":["Agent Background Sounds"]}},"/v1/agent/background-sounds/{asset_id}":{"delete":{"summary":"Delete Background Sound","description":"Soft-deletes the clip. An agent still naming it in\n`voice.background_sound.custom_asset_id` falls back to silence for that\nambience at its next session rather than failing the call.","security":[{"BearerAuth":[]}],"parameters":[{"in":"path","name":"asset_id","description":"","required":true,"schema":{"title":"Asset Id","type":"string"},"deprecated":false}],"responses":{"204":{"description":"Request fulfilled, nothing follows","headers":{}},"401":{"description":"No permission -- see authorization schemes","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}},"404":{"description":"Nothing matches the given URI","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}},"503":{"description":"The server cannot process the request due to a high load","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}}},"tags":["Agent Background Sounds"]}},"/v1/agent/llm-models":{"get":{"summary":"List LLM Models","description":"List the LLMs your team can set as `llm.model` on an agent's config, each\nwith its token rates and a reference latency. The rates are set by the LLM\nproviders and change when a provider changes its pricing. The response\ncarries the rates in force now.","security":[{"BearerAuth":[]}],"responses":{"200":{"description":"Request fulfilled, document follows","headers":{},"content":{"application/json":{"schema":{"properties":{"llm_models":{"items":{"$ref":"#/components/schemas/PublicLLMModel"},"title":"Llm Models","type":"array"}},"required":["llm_models"],"type":"object"}}}},"401":{"description":"No permission -- see authorization schemes","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}},"503":{"description":"The server cannot process the request due to a high load","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}}},"tags":["Agent LLM Models"]}},"/v1/asr":{"post":{"summary":"Speech to Text","security":[{"BearerAuth":[]}],"parameters":[{"in":"header","name":"model","description":"Specify which speech-to-text model to use.","required":false,"schema":{"default":"transcribe-1","enum":["transcribe-1","transcribe-1-pro","transcribe-2-pro"],"title":"Model","type":"string"},"deprecated":false}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"properties":{"audio":{"description":"Audio file to be converted to text","format":"binary","title":"Audio","type":"string"},"language":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"description":"Optional hint. The language is auto-detected regardless; the detected language is returned as `language_code`.","title":"Language"},"ignore_timestamps":{"default":true,"description":"Whether to return precise timestamps in the text, this will increase the latency in audio shorter than 30 seconds","title":"Ignore Timestamps","type":"boolean"}},"required":["audio"],"type":"object"}},"application/msgpack":{"schema":{"properties":{"audio":{"description":"Audio file to be converted to text","format":"binary","title":"Audio","type":"string"},"language":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"description":"Optional hint. The language is auto-detected regardless; the detected language is returned as `language_code`.","title":"Language"},"ignore_timestamps":{"default":true,"description":"Whether to return precise timestamps in the text, this will increase the latency in audio shorter than 30 seconds","title":"Ignore Timestamps","type":"boolean"}},"required":["audio"],"type":"object"}}}},"responses":{"200":{"description":"Request fulfilled, document follows","headers":{},"content":{"application/json":{"schema":{"properties":{"text":{"title":"Text","type":"string"},"duration":{"description":"Duration of the audio in seconds","title":"Duration","type":"number"},"segments":{"items":{"$ref":"#/components/schemas/ASRSegment"},"title":"Segments","type":"array"},"language_code":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"description":"Detected language as an ISO 639-1 code (e.g. `en`, `ja`). Omitted if no language is detected.","title":"Language Code"},"language":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"description":"Detected language name (e.g. `English`). For display only; use `language_code` in code.","title":"Language"}},"required":["text","duration","segments"],"type":"object"}}}},"401":{"description":"No permission -- see authorization schemes","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}},"402":{"description":"No payment -- see charging schemes","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}},"503":{"description":"The server cannot process the request due to a high load","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}}},"tags":["OpenAPI v1"]}},"/v1/audio/infill":{"post":{"summary":"Audio Infill","description":"Regenerate part of a recording with drama-3 and get the whole take back.\nUse it to apply a script change to existing audio without re-recording it:\nsend the take, the full revised `transcript` and the range to replace.\ndrama-3 regenerates that range in the speaker's voice, taken from the audio\naround it, and returns the take with the new span in place.\n\nA request takes one of two shapes. Mixing them is a 400.\n\n## Edit a take\n\nSend `audio` with where the span to replace starts and ends. Frames\n`[prefix_frames, suffix_frames)` are regenerated; the audio before and after\nthem is kept.\n\n- Give each position in frames (`prefix_frames`, `suffix_frames`) or in\n  seconds (`prefix_seconds`, `suffix_seconds`). Each side takes one of the\n  two; both for the same side is a 400, and so is a side left out.\n- Positions are absolute, counted from the start of the take, at 44100 /\n  2048 (about 21.53) frames per second. Seconds are rounded to the nearest\n  frame: `frames = round(seconds × 44100 / 2048)`.\n- `prefix_frames` equal to `suffix_frames` inserts new speech at that point.\n- Some original audio has to stay: `prefix_frames` 0 together with\n  `suffix_frames` at the end of the take is a 400. For the best results keep\n  at least 0.75 s on each side and replace at least 0.2 s.\n\n## Join two clips\n\nSend `prefix_audio` and, optionally, `suffix_audio`. drama-3 generates the\nspeech between them; with `prefix_audio` alone it continues the clip. No\npositions are needed. `suffix_audio` without `prefix_audio` is a 400.\n\n## Length of the new span\n\nThe model decides how long the regenerated span is, up to 1024 frames\n(about 47 s). There is no way to request an exact length yet, so the span\ncan come out shorter or longer than the speech it replaces.\n\n## Response\n\nThe whole take as one audio file in `format`. The kept parts are\nre-synthesized together with the new span rather than copied byte for byte.\n\nSend `Accept: text/event-stream` to receive server-sent events instead:\n`start` (with `middle_start_seconds`), then `audio.delta` events whose\nbase64 `audio` fields concatenate into the same file, then `done` (with\n`output_frames`, `middle_end_seconds` and `total_seconds`), then `[DONE]`.","security":[{"BearerAuth":[]}],"parameters":[{"in":"header","name":"model","description":"The model that regenerates the span. Only `drama-3` serves this endpoint.","required":true,"schema":{"const":"drama-3","title":"Model","type":"string"},"deprecated":false}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"properties":{"transcript":{"description":"The full text of the result: the kept audio before the change, the new span and the kept audio after it, with the edit already applied. Sent to the model as written, without text normalization.","title":"Transcript","type":"string"},"audio":{"anyOf":[{"format":"binary","type":"string"},{"type":"null"}],"default":null,"description":"Edit a take: the whole recording to edit. Requires the start of the span (`prefix_frames` or `prefix_seconds`) and its end (`suffix_frames` or `suffix_seconds`). Do not combine with `prefix_audio` / `suffix_audio`.","title":"Audio"},"prefix_frames":{"anyOf":[{"minimum":0,"type":"integer"},{"type":"null"}],"default":null,"description":"Edit a take: the frame where the regenerated span starts. Everything before it is kept. A whole number of frames at 44100 / 2048 (about 21.53) frames per second; 0 keeps nothing before the span. Give this or `prefix_seconds`, not both.","title":"Prefix Frames"},"prefix_seconds":{"anyOf":[{"minimum":0,"type":"number"},{"type":"null"}],"default":null,"description":"Edit a take: `prefix_frames` given in seconds from the start of the take, rounded to the nearest frame. Give this or `prefix_frames`, not both.","title":"Prefix Seconds"},"suffix_frames":{"anyOf":[{"minimum":0,"type":"integer"},{"type":"null"}],"default":null,"description":"Edit a take: the frame where the regenerated span ends and the kept audio resumes. Equal to `prefix_frames` inserts new speech at that point; the take's length keeps nothing after the span. Give this or `suffix_seconds`, not both.","title":"Suffix Frames"},"suffix_seconds":{"anyOf":[{"minimum":0,"type":"number"},{"type":"null"}],"default":null,"description":"Edit a take: `suffix_frames` given in seconds from the start of the take, rounded to the nearest frame. Give this or `suffix_frames`, not both.","title":"Suffix Seconds"},"prefix_audio":{"anyOf":[{"format":"binary","type":"string"},{"type":"null"}],"default":null,"description":"Join two clips: the clip before the generated speech. Alone, the model continues it.","title":"Prefix Audio"},"suffix_audio":{"anyOf":[{"format":"binary","type":"string"},{"type":"null"}],"default":null,"description":"Join two clips: the clip after the generated speech. Requires `prefix_audio`.","title":"Suffix Audio"},"format":{"default":"mp3","description":"Output audio format.","enum":["wav","pcm","mp3","opus"],"title":"Format","type":"string"},"sample_rate":{"anyOf":[{"type":"integer"},{"type":"null"}],"default":null,"description":"Audio sample rate in Hz. When null, uses the format's default (44100 Hz for most formats, 48000 Hz for opus).","title":"Sample Rate"},"mp3_bitrate":{"default":128,"description":"MP3 bitrate in kbps. Only applies when format is mp3.","enum":[64,128,192],"title":"Mp3 Bitrate","type":"integer"},"opus_bitrate":{"default":-1000,"description":"Opus bitrate in bps. -1000 for automatic. Only applies when format is opus.","enum":[-1000,24000,32000,48000,64000],"title":"Opus Bitrate","type":"integer"}},"required":["transcript"],"type":"object"}},"application/msgpack":{"schema":{"properties":{"transcript":{"description":"The full text of the result: the kept audio before the change, the new span and the kept audio after it, with the edit already applied. Sent to the model as written, without text normalization.","title":"Transcript","type":"string"},"audio":{"anyOf":[{"format":"binary","type":"string"},{"type":"null"}],"default":null,"description":"Edit a take: the whole recording to edit. Requires the start of the span (`prefix_frames` or `prefix_seconds`) and its end (`suffix_frames` or `suffix_seconds`). Do not combine with `prefix_audio` / `suffix_audio`.","title":"Audio"},"prefix_frames":{"anyOf":[{"minimum":0,"type":"integer"},{"type":"null"}],"default":null,"description":"Edit a take: the frame where the regenerated span starts. Everything before it is kept. A whole number of frames at 44100 / 2048 (about 21.53) frames per second; 0 keeps nothing before the span. Give this or `prefix_seconds`, not both.","title":"Prefix Frames"},"prefix_seconds":{"anyOf":[{"minimum":0,"type":"number"},{"type":"null"}],"default":null,"description":"Edit a take: `prefix_frames` given in seconds from the start of the take, rounded to the nearest frame. Give this or `prefix_frames`, not both.","title":"Prefix Seconds"},"suffix_frames":{"anyOf":[{"minimum":0,"type":"integer"},{"type":"null"}],"default":null,"description":"Edit a take: the frame where the regenerated span ends and the kept audio resumes. Equal to `prefix_frames` inserts new speech at that point; the take's length keeps nothing after the span. Give this or `suffix_seconds`, not both.","title":"Suffix Frames"},"suffix_seconds":{"anyOf":[{"minimum":0,"type":"number"},{"type":"null"}],"default":null,"description":"Edit a take: `suffix_frames` given in seconds from the start of the take, rounded to the nearest frame. Give this or `suffix_frames`, not both.","title":"Suffix Seconds"},"prefix_audio":{"anyOf":[{"format":"binary","type":"string"},{"type":"null"}],"default":null,"description":"Join two clips: the clip before the generated speech. Alone, the model continues it.","title":"Prefix Audio"},"suffix_audio":{"anyOf":[{"format":"binary","type":"string"},{"type":"null"}],"default":null,"description":"Join two clips: the clip after the generated speech. Requires `prefix_audio`.","title":"Suffix Audio"},"format":{"default":"mp3","description":"Output audio format.","enum":["wav","pcm","mp3","opus"],"title":"Format","type":"string"},"sample_rate":{"anyOf":[{"type":"integer"},{"type":"null"}],"default":null,"description":"Audio sample rate in Hz. When null, uses the format's default (44100 Hz for most formats, 48000 Hz for opus).","title":"Sample Rate"},"mp3_bitrate":{"default":128,"description":"MP3 bitrate in kbps. Only applies when format is mp3.","enum":[64,128,192],"title":"Mp3 Bitrate","type":"integer"},"opus_bitrate":{"default":-1000,"description":"Opus bitrate in bps. -1000 for automatic. Only applies when format is opus.","enum":[-1000,24000,32000,48000,64000],"title":"Opus Bitrate","type":"integer"}},"required":["transcript"],"type":"object"}}}},"responses":{"200":{"description":"Request fulfilled, document follows","headers":{"Transfer-Encoding":{"schema":{"type":"string"},"description":"chunked"}}},"400":{"description":"Bad request syntax or unsupported method","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}},"401":{"description":"No permission -- see authorization schemes","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}},"402":{"description":"No payment -- see charging schemes","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}},"503":{"description":"The server cannot process the request due to a high load","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}}},"tags":["OpenAPI v1"],"x-codeSamples":[{"lang":"bash","label":"Edit a Take","source":"curl --request POST \\\n  --url https://api.fish.audio/v1/audio/infill \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'model: drama-3' \\\n  --form 'audio=@take.wav' \\\n  --form-string 'transcript=Next, load the wafer into chamber B and run the standard CVD recipe.' \\\n  --form 'prefix_frames=45' \\\n  --form 'suffix_frames=62' \\\n  --form 'format=mp3' \\\n  --output edited.mp3"},{"lang":"bash","label":"Edit a Take (Seconds)","source":"curl --request POST \\\n  --url https://api.fish.audio/v1/audio/infill \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'model: drama-3' \\\n  --form 'audio=@take.wav' \\\n  --form-string 'transcript=Next, load the wafer into chamber B and run the standard CVD recipe.' \\\n  --form 'prefix_seconds=2.1' \\\n  --form 'suffix_seconds=2.9' \\\n  --form 'format=mp3' \\\n  --output edited.mp3"},{"lang":"bash","label":"Join Two Clips","source":"curl --request POST \\\n  --url https://api.fish.audio/v1/audio/infill \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'model: drama-3' \\\n  --form 'prefix_audio=@first.wav' \\\n  --form 'suffix_audio=@second.wav' \\\n  --form-string 'transcript=Close the chamber door. Wait for the pressure to stabilize. Then start the recipe.' \\\n  --form 'format=mp3' \\\n  --output joined.mp3"}]}},"/v1/pronunciation-dictionaries":{"get":{"security":[{"BearerAuth":[]}],"parameters":[{"in":"query","name":"cursor","description":"Opaque cursor from a previous `next_cursor`.","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Cursor"},"deprecated":false},{"in":"query","name":"page","description":"1-based page number; mutually exclusive with cursor.","required":false,"schema":{"anyOf":[{"minimum":1,"type":"integer"},{"type":"null"}],"default":null,"title":"Page"},"deprecated":false},{"in":"query","name":"include_total","description":"Also count the filtered set on the cursor path.","required":false,"schema":{"default":false,"title":"Include Total","type":"boolean"},"deprecated":false},{"in":"query","name":"page_size","description":"Rows per page (1-100, default 30).","required":false,"schema":{"default":30,"maximum":100,"minimum":1,"title":"Page Size","type":"integer"},"deprecated":false}],"responses":{"200":{"description":"Request fulfilled, document follows","headers":{},"content":{"application/json":{"schema":{"description":"One page of pronunciation dictionaries.","properties":{"dictionaries":{"description":"Dictionaries in this page, newest updated first.","items":{"$ref":"#/components/schemas/PronunciationDictionaryV1Entity"},"title":"Dictionaries","type":"array"},"has_more":{"description":"Whether another page exists after this one.","title":"Has More","type":"boolean"},"next_cursor":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"description":"Opaque cursor for the next page; pass it as `cursor`. Null when there is no next page.","title":"Next Cursor"},"total":{"anyOf":[{"type":"integer"},{"type":"null"}],"default":null,"description":"Rows matching the filters across all pages. Always set in page mode; set on the cursor path only with `include_total=true`.","examples":[3],"title":"Total"}},"required":["dictionaries","has_more"],"type":"object"}}}},"400":{"description":"Bad request syntax or unsupported method","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}},"403":{"description":"Request forbidden -- authorization will not help","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}},"422":{"description":"","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}},"401":{"description":"No permission -- see authorization schemes","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}},"503":{"description":"The server cannot process the request due to a high load","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}}},"tags":["Pronunciation Dictionaries"],"summary":"List pronunciation dictionaries","description":"List the caller team's dictionaries, newest updated first. Archived dictionaries are excluded. Paginate with `cursor` (follow `next_cursor` while `has_more` is true) or with `page` for offset pagination with a `total` count — the two are mutually exclusive."},"post":{"security":[{"BearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PronunciationDictionaryCreatePayload"}}}},"responses":{"201":{"description":"Document created, URL follows","headers":{},"content":{"application/json":{"schema":{"description":"A pronunciation dictionary owned by the caller's team.","properties":{"id":{"description":"Stable dictionary identifier.","examples":["9b2f5c0d4e6a4f4c8a1d3e5f7a9b0c2d"],"title":"Id","type":"string"},"name":{"description":"Display name for the dictionary.","examples":["Product names"],"title":"Name","type":"string"},"description":{"description":"Free-form description shown in the web app.","examples":["Brand and product pronunciations for support scripts."],"title":"Description","type":"string"},"latest_version_id":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"description":"Identifier of the latest published version, or null when the dictionary has never been published.","examples":["1c3e5a7b9d0f4a2c8e6b4d1f3a5c7e9b"],"title":"Latest Version Id"},"item_count":{"default":0,"description":"Number of rules in the latest published version.","examples":[12],"title":"Item Count","type":"integer"},"preview_voice_id":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"description":"Voice model last used by the dictionary's preview player, or null when it was never previewed.","examples":["b1a2c3d4e5f60718293a4b5c6d7e8f90"],"title":"Preview Voice Id"},"preview_model":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"description":"TTS model last used by the dictionary's preview player, or null when it was never previewed.","examples":["s2-pro"],"title":"Preview Model"},"created_at":{"description":"Creation time (UTC).","examples":["2026-11-05T03:21:09Z"],"format":"date-time","title":"Created At","type":"string"},"updated_at":{"description":"Last content or metadata update time (UTC).","examples":["2026-11-05T04:02:44Z"],"format":"date-time","title":"Updated At","type":"string"}},"required":["id","name","description","created_at","updated_at"],"type":"object"}}}},"403":{"description":"Request forbidden -- authorization will not help","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}},"422":{"description":"","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}},"401":{"description":"No permission -- see authorization schemes","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}},"503":{"description":"The server cannot process the request due to a high load","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}}},"tags":["Pronunciation Dictionaries"],"summary":"Create a pronunciation dictionary","description":"Create an empty dictionary for the team the credential belongs to (the API key's team, or the personal team for a session without x-team-id). Publish rules with POST /versions."}},"/v1/pronunciation-dictionaries/{dictionary_id}":{"get":{"security":[{"BearerAuth":[]}],"parameters":[{"in":"path","name":"dictionary_id","description":"","required":true,"schema":{"title":"Dictionary Id","type":"string"},"deprecated":false}],"responses":{"200":{"description":"Request fulfilled, document follows","headers":{},"content":{"application/json":{"schema":{"description":"A pronunciation dictionary owned by the caller's team.","properties":{"id":{"description":"Stable dictionary identifier.","examples":["9b2f5c0d4e6a4f4c8a1d3e5f7a9b0c2d"],"title":"Id","type":"string"},"name":{"description":"Display name for the dictionary.","examples":["Product names"],"title":"Name","type":"string"},"description":{"description":"Free-form description shown in the web app.","examples":["Brand and product pronunciations for support scripts."],"title":"Description","type":"string"},"latest_version_id":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"description":"Identifier of the latest published version, or null when the dictionary has never been published.","examples":["1c3e5a7b9d0f4a2c8e6b4d1f3a5c7e9b"],"title":"Latest Version Id"},"item_count":{"default":0,"description":"Number of rules in the latest published version.","examples":[12],"title":"Item Count","type":"integer"},"preview_voice_id":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"description":"Voice model last used by the dictionary's preview player, or null when it was never previewed.","examples":["b1a2c3d4e5f60718293a4b5c6d7e8f90"],"title":"Preview Voice Id"},"preview_model":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"description":"TTS model last used by the dictionary's preview player, or null when it was never previewed.","examples":["s2-pro"],"title":"Preview Model"},"created_at":{"description":"Creation time (UTC).","examples":["2026-11-05T03:21:09Z"],"format":"date-time","title":"Created At","type":"string"},"updated_at":{"description":"Last content or metadata update time (UTC).","examples":["2026-11-05T04:02:44Z"],"format":"date-time","title":"Updated At","type":"string"}},"required":["id","name","description","created_at","updated_at"],"type":"object"}}}},"403":{"description":"Request forbidden -- authorization will not help","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}},"404":{"description":"Nothing matches the given URI","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}},"401":{"description":"No permission -- see authorization schemes","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}},"503":{"description":"The server cannot process the request due to a high load","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}}},"tags":["Pronunciation Dictionaries"],"summary":"Get a pronunciation dictionary","description":"Get one dictionary owned by the caller's team."},"patch":{"security":[{"BearerAuth":[]}],"parameters":[{"in":"path","name":"dictionary_id","description":"","required":true,"schema":{"title":"Dictionary Id","type":"string"},"deprecated":false}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PronunciationDictionaryUpdatePayload"}}}},"responses":{"200":{"description":"Request fulfilled, document follows","headers":{},"content":{"application/json":{"schema":{"description":"A pronunciation dictionary owned by the caller's team.","properties":{"id":{"description":"Stable dictionary identifier.","examples":["9b2f5c0d4e6a4f4c8a1d3e5f7a9b0c2d"],"title":"Id","type":"string"},"name":{"description":"Display name for the dictionary.","examples":["Product names"],"title":"Name","type":"string"},"description":{"description":"Free-form description shown in the web app.","examples":["Brand and product pronunciations for support scripts."],"title":"Description","type":"string"},"latest_version_id":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"description":"Identifier of the latest published version, or null when the dictionary has never been published.","examples":["1c3e5a7b9d0f4a2c8e6b4d1f3a5c7e9b"],"title":"Latest Version Id"},"item_count":{"default":0,"description":"Number of rules in the latest published version.","examples":[12],"title":"Item Count","type":"integer"},"preview_voice_id":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"description":"Voice model last used by the dictionary's preview player, or null when it was never previewed.","examples":["b1a2c3d4e5f60718293a4b5c6d7e8f90"],"title":"Preview Voice Id"},"preview_model":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"description":"TTS model last used by the dictionary's preview player, or null when it was never previewed.","examples":["s2-pro"],"title":"Preview Model"},"created_at":{"description":"Creation time (UTC).","examples":["2026-11-05T03:21:09Z"],"format":"date-time","title":"Created At","type":"string"},"updated_at":{"description":"Last content or metadata update time (UTC).","examples":["2026-11-05T04:02:44Z"],"format":"date-time","title":"Updated At","type":"string"}},"required":["id","name","description","created_at","updated_at"],"type":"object"}}}},"403":{"description":"Request forbidden -- authorization will not help","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}},"404":{"description":"Nothing matches the given URI","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}},"409":{"description":"Request conflict","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}},"422":{"description":"","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}},"401":{"description":"No permission -- see authorization schemes","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}},"503":{"description":"The server cannot process the request due to a high load","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}}},"tags":["Pronunciation Dictionaries"],"summary":"Update a pronunciation dictionary","description":"Change the dictionary's name or description. Rules live in published versions and are not editable in place."},"delete":{"security":[{"BearerAuth":[]}],"parameters":[{"in":"path","name":"dictionary_id","description":"","required":true,"schema":{"title":"Dictionary Id","type":"string"},"deprecated":false}],"responses":{"204":{"description":"Request fulfilled, nothing follows","headers":{}},"403":{"description":"Request forbidden -- authorization will not help","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}},"404":{"description":"Nothing matches the given URI","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}},"401":{"description":"No permission -- see authorization schemes","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}},"503":{"description":"The server cannot process the request due to a high load","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}}},"tags":["Pronunciation Dictionaries"],"summary":"Delete (archive) a pronunciation dictionary","description":"Soft-archive the dictionary: it disappears from list/get and can no longer be modified, while its versions remain stored. Idempotent."}},"/v1/pronunciation-dictionaries/{dictionary_id}/versions":{"get":{"security":[{"BearerAuth":[]}],"parameters":[{"in":"path","name":"dictionary_id","description":"","required":true,"schema":{"title":"Dictionary Id","type":"string"},"deprecated":false},{"in":"query","name":"cursor","description":"Opaque cursor from a previous `next_cursor`.","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Cursor"},"deprecated":false},{"in":"query","name":"page","description":"1-based page number; mutually exclusive with cursor.","required":false,"schema":{"anyOf":[{"minimum":1,"type":"integer"},{"type":"null"}],"default":null,"title":"Page"},"deprecated":false},{"in":"query","name":"include_total","description":"Also count the filtered set on the cursor path.","required":false,"schema":{"default":false,"title":"Include Total","type":"boolean"},"deprecated":false},{"in":"query","name":"page_size","description":"Rows per page (1-100, default 30).","required":false,"schema":{"default":30,"maximum":100,"minimum":1,"title":"Page Size","type":"integer"},"deprecated":false}],"responses":{"200":{"description":"Request fulfilled, document follows","headers":{},"content":{"application/json":{"schema":{"description":"One page of pronunciation-dictionary versions.","properties":{"versions":{"description":"Versions in this page, newest published first.","items":{"$ref":"#/components/schemas/PronunciationDictionaryV1VersionEntity"},"title":"Versions","type":"array"},"has_more":{"description":"Whether another page exists after this one.","title":"Has More","type":"boolean"},"next_cursor":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"description":"Opaque cursor for the next page; pass it as `cursor`. Null when there is no next page.","title":"Next Cursor"},"total":{"anyOf":[{"type":"integer"},{"type":"null"}],"default":null,"description":"Rows matching the filters across all pages. Always set in page mode; set on the cursor path only with `include_total=true`.","examples":[2],"title":"Total"}},"required":["versions","has_more"],"type":"object"}}}},"400":{"description":"Bad request syntax or unsupported method","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}},"403":{"description":"Request forbidden -- authorization will not help","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}},"404":{"description":"Nothing matches the given URI","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}},"422":{"description":"","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}},"401":{"description":"No permission -- see authorization schemes","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}},"503":{"description":"The server cannot process the request due to a high load","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}}},"tags":["Pronunciation Dictionaries"],"summary":"List versions","description":"List the dictionary's published versions, newest first. Archived versions are excluded. Paginate with `cursor` (follow `next_cursor` while `has_more` is true) or with `page` for offset pagination with a `total` count — the two are mutually exclusive."},"post":{"security":[{"BearerAuth":[]}],"parameters":[{"in":"path","name":"dictionary_id","description":"","required":true,"schema":{"title":"Dictionary Id","type":"string"},"deprecated":false}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PronunciationDictionaryVersionCreatePayload"}}}},"responses":{"201":{"description":"Document created, URL follows","headers":{},"content":{"application/json":{"schema":{"description":"A version with its full ordered rule list.","properties":{"id":{"description":"Stable version identifier.","examples":["1c3e5a7b9d0f4a2c8e6b4d1f3a5c7e9b"],"title":"Id","type":"string"},"dictionary_id":{"description":"Dictionary this version belongs to.","examples":["9b2f5c0d4e6a4f4c8a1d3e5f7a9b0c2d"],"title":"Dictionary Id","type":"string"},"description":{"description":"Version note entered when publishing.","examples":["Add the new product names"],"title":"Description","type":"string"},"version_number":{"anyOf":[{"type":"integer"},{"type":"null"}],"default":null,"description":"Monotonic version number within the dictionary. Null only for versions published before version numbers existed.","examples":[3],"title":"Version Number"},"added_count":{"default":0,"description":"Rules added relative to the previous version.","examples":[2],"title":"Added Count","type":"integer"},"removed_count":{"default":0,"description":"Rules removed relative to the previous version.","examples":[0],"title":"Removed Count","type":"integer"},"changed_count":{"default":0,"description":"Rules whose key, value, type or case sensitivity changed.","examples":[1],"title":"Changed Count","type":"integer"},"item_count":{"default":0,"description":"Total number of rules in this version.","examples":[12],"title":"Item Count","type":"integer"},"created_at":{"description":"Publish time (UTC).","examples":["2026-11-05T04:02:44Z"],"format":"date-time","title":"Created At","type":"string"},"items":{"description":"Rules in application order.","items":{"$ref":"#/components/schemas/PronunciationDictionaryV1Item"},"title":"Items","type":"array"}},"required":["id","dictionary_id","description","created_at","items"],"type":"object"}}}},"403":{"description":"Request forbidden -- authorization will not help","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}},"404":{"description":"Nothing matches the given URI","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}},"409":{"description":"Request conflict","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}},"422":{"description":"","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}},"401":{"description":"No permission -- see authorization schemes","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}},"503":{"description":"The server cannot process the request due to a high load","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}}},"tags":["Pronunciation Dictionaries"],"summary":"Publish a version","description":"Publish an immutable snapshot of rules. Send the version you believe is current as `expected_latest_version_id`; a stale value returns 409. Keys are unique within a version (duplicates return 422). Alias rules never shorten billing."}},"/v1/pronunciation-dictionaries/{dictionary_id}/versions/{version_id}":{"get":{"security":[{"BearerAuth":[]}],"parameters":[{"in":"path","name":"dictionary_id","description":"","required":true,"schema":{"title":"Dictionary Id","type":"string"},"deprecated":false},{"in":"path","name":"version_id","description":"","required":true,"schema":{"title":"Version Id","type":"string"},"deprecated":false}],"responses":{"200":{"description":"Request fulfilled, document follows","headers":{},"content":{"application/json":{"schema":{"description":"A version with its full ordered rule list.","properties":{"id":{"description":"Stable version identifier.","examples":["1c3e5a7b9d0f4a2c8e6b4d1f3a5c7e9b"],"title":"Id","type":"string"},"dictionary_id":{"description":"Dictionary this version belongs to.","examples":["9b2f5c0d4e6a4f4c8a1d3e5f7a9b0c2d"],"title":"Dictionary Id","type":"string"},"description":{"description":"Version note entered when publishing.","examples":["Add the new product names"],"title":"Description","type":"string"},"version_number":{"anyOf":[{"type":"integer"},{"type":"null"}],"default":null,"description":"Monotonic version number within the dictionary. Null only for versions published before version numbers existed.","examples":[3],"title":"Version Number"},"added_count":{"default":0,"description":"Rules added relative to the previous version.","examples":[2],"title":"Added Count","type":"integer"},"removed_count":{"default":0,"description":"Rules removed relative to the previous version.","examples":[0],"title":"Removed Count","type":"integer"},"changed_count":{"default":0,"description":"Rules whose key, value, type or case sensitivity changed.","examples":[1],"title":"Changed Count","type":"integer"},"item_count":{"default":0,"description":"Total number of rules in this version.","examples":[12],"title":"Item Count","type":"integer"},"created_at":{"description":"Publish time (UTC).","examples":["2026-11-05T04:02:44Z"],"format":"date-time","title":"Created At","type":"string"},"items":{"description":"Rules in application order.","items":{"$ref":"#/components/schemas/PronunciationDictionaryV1Item"},"title":"Items","type":"array"}},"required":["id","dictionary_id","description","created_at","items"],"type":"object"}}}},"403":{"description":"Request forbidden -- authorization will not help","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}},"404":{"description":"Nothing matches the given URI","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}},"401":{"description":"No permission -- see authorization schemes","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}},"503":{"description":"The server cannot process the request due to a high load","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}}},"tags":["Pronunciation Dictionaries"],"summary":"Get a version","description":"Get a published version with its ordered rules. Requires auth and is scoped to the caller's team."},"delete":{"security":[{"BearerAuth":[]}],"parameters":[{"in":"path","name":"dictionary_id","description":"","required":true,"schema":{"title":"Dictionary Id","type":"string"},"deprecated":false},{"in":"path","name":"version_id","description":"","required":true,"schema":{"title":"Version Id","type":"string"},"deprecated":false}],"responses":{"204":{"description":"Request fulfilled, nothing follows","headers":{}},"403":{"description":"Request forbidden -- authorization will not help","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}},"404":{"description":"Nothing matches the given URI","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}},"409":{"description":"Request conflict","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}},"401":{"description":"No permission -- see authorization schemes","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}},"503":{"description":"The server cannot process the request due to a high load","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}}},"tags":["Pronunciation Dictionaries"],"summary":"Delete (archive) a version","description":"Soft-archive a historical version. The latest version cannot be deleted (409), and deleting an already archived version also returns 409."}},"/v1/pronunciation-dictionaries/{dictionary_id}/versions/{version_id}/compare":{"get":{"security":[{"BearerAuth":[]}],"parameters":[{"in":"path","name":"dictionary_id","description":"","required":true,"schema":{"title":"Dictionary Id","type":"string"},"deprecated":false},{"in":"path","name":"version_id","description":"","required":true,"schema":{"title":"Version Id","type":"string"},"deprecated":false},{"in":"query","name":"base_version_id","description":"Version to compare the target version against.","required":true,"schema":{"examples":["9b8c7d6e5f4a3b2c1d0e9f8a7b6c5d4e"],"title":"Base Version Id","type":"string"},"deprecated":false}],"responses":{"200":{"description":"Request fulfilled, document follows","headers":{},"content":{"application/json":{"schema":{"description":"Row-level diff between two versions of one dictionary.","properties":{"version_id":{"description":"Target (viewed) version.","examples":["1c3e5a7b9d0f4a2c8e6b4d1f3a5c7e9b"],"title":"Version Id","type":"string"},"base_version_id":{"description":"Base version the target is compared against.","examples":["1c3e5a7b9d0f4a2c8e6b4d1f3a5c7e9b"],"title":"Base Version Id","type":"string"},"added":{"description":"Number of added rows.","examples":[1],"title":"Added","type":"integer"},"removed":{"description":"Number of removed rows.","examples":[0],"title":"Removed","type":"integer"},"changed":{"description":"Number of changed rows.","examples":[2],"title":"Changed","type":"integer"},"rows":{"description":"Per-rule diff rows in target order, with removed rows last.","items":{"$ref":"#/components/schemas/PronunciationDictionaryV1CompareRow"},"title":"Rows","type":"array"}},"required":["version_id","base_version_id","added","removed","changed","rows"],"type":"object"}}}},"403":{"description":"Request forbidden -- authorization will not help","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}},"404":{"description":"Nothing matches the given URI","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}},"422":{"description":"","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}},"401":{"description":"No permission -- see authorization schemes","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}},"503":{"description":"The server cannot process the request due to a high load","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}}},"tags":["Pronunciation Dictionaries"],"summary":"Compare two versions","description":"Return a row-level diff between the target version and `base_version_id`: added, removed, changed, moved and unchanged rules."}},"/v1/tts":{"post":{"summary":"Text to Speech","security":[{"BearerAuth":[]}],"parameters":[{"in":"header","name":"model","description":"Specify which TTS model to use. Use `s2.1-pro-free` for the free developer tier. If omitted or set to an unrecognized value, the request falls back to `s2.1-pro`.","required":false,"schema":{"default":"s2.1-pro","enum":["s1","s2-pro","s2.1-pro","s2.1-pro-free","drama-3","s3-pro"],"title":"Model","type":"string"},"deprecated":false}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TTSRequest"}},"application/msgpack":{"schema":{"$ref":"#/components/schemas/TTSRequest"}}}},"responses":{"200":{"description":"Request fulfilled, document follows","headers":{"Transfer-Encoding":{"schema":{"type":"string"},"description":"chunked"}}},"401":{"description":"No permission -- see authorization schemes","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}},"402":{"description":"No payment -- see charging schemes","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}},"503":{"description":"The server cannot process the request due to a high load","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}}},"tags":["OpenAPI v1"],"x-codeSamples":[{"lang":"bash","label":"Single Speaker","source":"curl --request POST \\\n  --url https://api.fish.audio/v1/tts \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --header 'model: s2.1-pro-free' \\\n  --data '{\n    \"text\": \"Hello! Welcome to Fish Audio.\",\n    \"reference_id\": \"model-id\",\n    \"temperature\": 0.7,\n    \"top_p\": 0.7,\n    \"prosody\": {\n      \"speed\": 1,\n      \"volume\": 0,\n      \"normalize_loudness\": true\n    },\n    \"chunk_length\": 300,\n    \"normalize\": true,\n    \"format\": \"mp3\",\n    \"sample_rate\": 44100,\n    \"mp3_bitrate\": 128,\n    \"latency\": \"normal\",\n    \"max_new_tokens\": 1024,\n    \"repetition_penalty\": 1.2,\n    \"min_chunk_length\": 50,\n    \"condition_on_previous_chunks\": true,\n    \"early_stop_threshold\": 1\n  }'"},{"lang":"bash","label":"Multi Speaker (S2 family only)","source":"curl --request POST \\\n  --url https://api.fish.audio/v1/tts \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --header 'model: s2.1-pro-free' \\\n  --data '{\n    \"text\": \"<|speaker:0|>Hello!<|speaker:1|>Hi there!\",\n    \"reference_id\": [\"speaker-a-id\", \"speaker-b-id\"],\n    \"temperature\": 0.7,\n    \"top_p\": 0.7,\n    \"prosody\": {\n      \"speed\": 1,\n      \"volume\": 0,\n      \"normalize_loudness\": true\n    },\n    \"chunk_length\": 300,\n    \"normalize\": true,\n    \"format\": \"mp3\",\n    \"sample_rate\": 44100,\n    \"mp3_bitrate\": 128,\n    \"latency\": \"normal\",\n    \"max_new_tokens\": 1024,\n    \"repetition_penalty\": 1.2,\n    \"min_chunk_length\": 50,\n    \"condition_on_previous_chunks\": true,\n    \"early_stop_threshold\": 1\n  }'"}]}},"/v1/tts/stream/with-timestamp":{"post":{"summary":"Text to Speech Stream with Timestamps","security":[{"BearerAuth":[]}],"parameters":[{"in":"header","name":"model","description":"Specify which TTS model to use. Use `s2.1-pro-free` for the free developer tier. If omitted or set to an unrecognized value, the request falls back to `s2.1-pro`.","required":false,"schema":{"default":"s2.1-pro","enum":["s1","s2-pro","s2.1-pro","s2.1-pro-free","drama-3","s3-pro"],"title":"Model","type":"string"},"deprecated":false}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TTSStreamWithTimestampRequest"}},"application/msgpack":{"schema":{"$ref":"#/components/schemas/TTSStreamWithTimestampRequest"}}}},"responses":{"200":{"description":"Server-Sent Events stream. Each `message` event contains a JSON payload with one base64 audio chunk. Concatenate every `audio_base64` chunk in arrival order to reconstruct the complete audio. `alignment` is the latest cumulative timestamp snapshot for `chunk_seq`; clients should replace the previous snapshot for that chunk instead of appending segments. `chunk_audio_offset_sec` can be added to segment times to derive absolute timestamps in the full audio.","headers":{"Transfer-Encoding":{"schema":{"type":"string"},"description":"chunked"}},"content":{"text/event-stream":{"schema":{"description":"One Server-Sent Events message payload for streaming TTS with timestamps. Each event contains one audio chunk. Concatenate all `audio_base64` chunks in arrival order to reconstruct the complete audio. `alignment` is the latest cumulative timestamp snapshot for the reported `chunk_seq`; clients should replace the previous snapshot for that chunk instead of appending segments.","examples":[{"alignment":{"audio_duration":16.24,"segments":[{"end":0.16,"start":0.0,"text":"I"},{"end":0.48,"start":0.16,"text":"can't"},{"end":0.8,"start":0.48,"text":"believe"},{"end":1.12,"start":0.8,"text":"its"},{"end":1.44,"start":1.2,"text":"been"},{"end":1.76,"start":1.44,"text":"this"},{"end":2.48,"start":1.76,"text":"long"},{"end":2.64,"start":2.56,"text":"It"},{"end":3.04,"start":2.72,"text":"feels"},{"end":3.28,"start":3.12,"text":"like"},{"end":4.0,"start":3.36,"text":"forever"},{"end":4.32,"start":4.0,"text":"since"},{"end":4.48,"start":4.32,"text":"we"},{"end":4.96,"start":4.48,"text":"last"},{"end":5.28,"start":4.96,"text":"really"},{"end":5.84,"start":5.28,"text":"talked"},{"end":6.24,"start":6.0,"text":"Ive"},{"end":6.64,"start":6.24,"text":"missed"},{"end":6.96,"start":6.64,"text":"hearing"},{"end":7.2,"start":6.96,"text":"your"},{"end":7.76,"start":7.2,"text":"voice"},{"end":7.92,"start":7.76,"text":"your"},{"end":8.48,"start":7.92,"text":"stories"},{"end":8.72,"start":8.48,"text":"even"},{"end":8.8,"start":8.72,"text":"the"},{"end":9.2,"start":8.8,"text":"little"},{"end":9.52,"start":9.2,"text":"things"},{"end":9.68,"start":9.52,"text":"you"},{"end":10.0,"start":9.68,"text":"used"},{"end":10.08,"start":10.0,"text":"to"},{"end":10.64,"start":10.08,"text":"say"},{"end":10.96,"start":10.64,"text":"How"},{"end":11.12,"start":10.96,"text":"have"},{"end":11.36,"start":11.12,"text":"you"},{"end":11.92,"start":11.36,"text":"been"},{"end":12.24,"start":12.0,"text":"Ive"},{"end":12.48,"start":12.24,"text":"thought"},{"end":12.8,"start":12.48,"text":"about"},{"end":13.2,"start":12.8,"text":"calling"},{"end":13.36,"start":13.2,"text":"you"},{"end":13.68,"start":13.36,"text":"so"},{"end":13.92,"start":13.68,"text":"many"},{"end":14.56,"start":13.92,"text":"times"},{"end":14.72,"start":14.56,"text":"but"},{"end":14.88,"start":14.72,"text":"I"},{"end":15.2,"start":14.88,"text":"never"},{"end":15.36,"start":15.2,"text":"knew"},{"end":15.6,"start":15.36,"text":"where"},{"end":15.6,"start":15.6,"text":"to"},{"end":16.24,"start":15.68,"text":"start"}]},"audio_base64":"SUQzBAAAAAAA...","chunk_audio_offset_sec":0.0,"chunk_seq":0,"content":"I can’t believe it’s been this long. It feels like forever since we last really talked. I’ve missed hearing your voice, your stories, even the little things you used to say. How have you been? I’ve thought about calling you so many times, but I never knew where to start."},{"alignment":{"audio_duration":16.24,"segments":[{"end":0.16,"start":0.0,"text":"I"},{"end":0.48,"start":0.16,"text":"can't"},{"end":0.8,"start":0.48,"text":"believe"},{"end":1.12,"start":0.8,"text":"its"},{"end":1.44,"start":1.2,"text":"been"},{"end":1.76,"start":1.44,"text":"this"},{"end":2.48,"start":1.76,"text":"long"},{"end":2.64,"start":2.56,"text":"It"},{"end":3.04,"start":2.72,"text":"feels"},{"end":3.28,"start":3.12,"text":"like"},{"end":4.0,"start":3.36,"text":"forever"},{"end":4.32,"start":4.0,"text":"since"},{"end":4.48,"start":4.32,"text":"we"},{"end":4.96,"start":4.48,"text":"last"},{"end":5.28,"start":4.96,"text":"really"},{"end":5.84,"start":5.28,"text":"talked"},{"end":6.24,"start":6.0,"text":"Ive"},{"end":6.64,"start":6.24,"text":"missed"},{"end":6.96,"start":6.64,"text":"hearing"},{"end":7.2,"start":6.96,"text":"your"},{"end":7.76,"start":7.2,"text":"voice"},{"end":7.92,"start":7.76,"text":"your"},{"end":8.48,"start":7.92,"text":"stories"},{"end":8.72,"start":8.48,"text":"even"},{"end":8.8,"start":8.72,"text":"the"},{"end":9.2,"start":8.8,"text":"little"},{"end":9.52,"start":9.2,"text":"things"},{"end":9.68,"start":9.52,"text":"you"},{"end":10.0,"start":9.68,"text":"used"},{"end":10.08,"start":10.0,"text":"to"},{"end":10.64,"start":10.08,"text":"say"},{"end":10.96,"start":10.64,"text":"How"},{"end":11.12,"start":10.96,"text":"have"},{"end":11.36,"start":11.12,"text":"you"},{"end":11.92,"start":11.36,"text":"been"},{"end":12.24,"start":12.0,"text":"Ive"},{"end":12.48,"start":12.24,"text":"thought"},{"end":12.8,"start":12.48,"text":"about"},{"end":13.2,"start":12.8,"text":"calling"},{"end":13.36,"start":13.2,"text":"you"},{"end":13.68,"start":13.36,"text":"so"},{"end":13.92,"start":13.68,"text":"many"},{"end":14.56,"start":13.92,"text":"times"},{"end":14.72,"start":14.56,"text":"but"},{"end":14.88,"start":14.72,"text":"I"},{"end":15.2,"start":14.88,"text":"never"},{"end":15.36,"start":15.2,"text":"knew"},{"end":15.6,"start":15.36,"text":"where"},{"end":15.6,"start":15.6,"text":"to"},{"end":16.24,"start":15.68,"text":"start"}]},"audio_base64":"//uSxOAAF...","chunk_audio_offset_sec":0.0,"chunk_seq":0,"content":"I can’t believe it’s been this long. It feels like forever since we last really talked. I’ve missed hearing your voice, your stories, even the little things you used to say. How have you been? I’ve thought about calling you so many times, but I never knew where to start."},{"alignment":{"audio_duration":10.48,"segments":[{"end":0.8,"start":0.4,"text":"Seeing"},{"end":0.96,"start":0.8,"text":"you"},{"end":1.44,"start":0.96,"text":"again"},{"end":1.68,"start":1.44,"text":"now"},{"end":2.08,"start":1.68,"text":"makes"},{"end":2.24,"start":2.08,"text":"me"},{"end":2.8,"start":2.24,"text":"realize"},{"end":3.12,"start":2.8,"text":"just"},{"end":3.28,"start":3.12,"text":"how"},{"end":3.6,"start":3.28,"text":"much"},{"end":3.76,"start":3.6,"text":"Ive"},{"end":4.24,"start":3.84,"text":"missed"},{"end":4.56,"start":4.24,"text":"you"},{"end":4.8,"start":4.64,"text":"We"},{"end":5.04,"start":4.8,"text":"have"},{"end":5.36,"start":5.04,"text":"so"},{"end":5.76,"start":5.36,"text":"much"},{"end":5.76,"start":5.76,"text":"to"},{"end":6.16,"start":5.76,"text":"catch"},{"end":6.4,"start":6.16,"text":"up"},{"end":6.72,"start":6.4,"text":"on"},{"end":6.96,"start":6.8,"text":"and"},{"end":7.04,"start":6.96,"text":"I"},{"end":7.36,"start":7.04,"text":"dont"},{"end":7.6,"start":7.36,"text":"even"},{"end":7.84,"start":7.6,"text":"know"},{"end":8.08,"start":7.84,"text":"which"},{"end":8.4,"start":8.08,"text":"part"},{"end":8.48,"start":8.4,"text":"of"},{"end":8.72,"start":8.56,"text":"my"},{"end":8.96,"start":8.72,"text":"life"},{"end":9.12,"start":9.12,"text":"to"},{"end":9.44,"start":9.12,"text":"tell"},{"end":9.6,"start":9.44,"text":"you"},{"end":10.0,"start":9.6,"text":"about"},{"end":10.48,"start":10.08,"text":"first"}]},"audio_base64":"//uSxImAl...","chunk_audio_offset_sec":16.24,"chunk_seq":1,"content":"Seeing you again now makes me realize just how much I’ve missed you. We have so much to catch up on, and I don’t even know which part of my life to tell you about first."}],"properties":{"audio_base64":{"description":"Base64 encoded audio chunk. Concatenate every chunk in event order to reconstruct the full audio.","title":"Audio Base64","type":"string"},"content":{"description":"Text content described by this event's latest alignment snapshot. Long input may be split into multiple content chunks in one stream.","title":"Content","type":"string"},"alignment":{"anyOf":[{"$ref":"#/components/schemas/TTSTimestampAlignment"},{"type":"null"}],"description":"Latest cumulative timestamp snapshot for `chunk_seq`. When present, replace the previous alignment for the same `chunk_seq`; do not append segments. Null means no alignment snapshot has been produced yet or alignment is unavailable."},"chunk_seq":{"description":"Sequence number of the text chunk described by `alignment`. Clients should bucket alignment snapshots by this value.","minimum":0,"title":"Chunk Seq","type":"integer"},"chunk_audio_offset_sec":{"description":"Absolute start time of this text chunk within the full audio, in seconds.","minimum":0.0,"title":"Chunk Audio Offset Sec","type":"number"}},"required":["audio_base64","content","alignment","chunk_seq","chunk_audio_offset_sec"],"title":"TTSTimestampStreamEvent","type":"object"},"examples":{"first_event":{"summary":"First text chunk event with alignment","value":"data: {\"audio_base64\": \"SUQzBAAAAAAA...\", \"content\": \"I can’t believe it’s been this long. It feels like forever since we last really talked. I’ve missed hearing your voice, your stories, even the little things you used to say. How have you been? I’ve thought about calling you so many times, but I never knew where to start.\", \"alignment\": {\"segments\": [{\"text\": \"I\", \"start\": 0.0, \"end\": 0.16}, {\"text\": \"can't\", \"start\": 0.16, \"end\": 0.48}, {\"text\": \"believe\", \"start\": 0.48, \"end\": 0.8}, {\"text\": \"its\", \"start\": 0.8, \"end\": 1.12}, {\"text\": \"been\", \"start\": 1.2, \"end\": 1.44}, {\"text\": \"this\", \"start\": 1.44, \"end\": 1.76}, {\"text\": \"long\", \"start\": 1.76, \"end\": 2.48}, {\"text\": \"It\", \"start\": 2.56, \"end\": 2.64}, {\"text\": \"feels\", \"start\": 2.72, \"end\": 3.04}, {\"text\": \"like\", \"start\": 3.12, \"end\": 3.28}, {\"text\": \"forever\", \"start\": 3.36, \"end\": 4.0}, {\"text\": \"since\", \"start\": 4.0, \"end\": 4.32}, {\"text\": \"we\", \"start\": 4.32, \"end\": 4.48}, {\"text\": \"last\", \"start\": 4.48, \"end\": 4.96}, {\"text\": \"really\", \"start\": 4.96, \"end\": 5.28}, {\"text\": \"talked\", \"start\": 5.28, \"end\": 5.84}, {\"text\": \"Ive\", \"start\": 6.0, \"end\": 6.24}, {\"text\": \"missed\", \"start\": 6.24, \"end\": 6.64}, {\"text\": \"hearing\", \"start\": 6.64, \"end\": 6.96}, {\"text\": \"your\", \"start\": 6.96, \"end\": 7.2}, {\"text\": \"voice\", \"start\": 7.2, \"end\": 7.76}, {\"text\": \"your\", \"start\": 7.76, \"end\": 7.92}, {\"text\": \"stories\", \"start\": 7.92, \"end\": 8.48}, {\"text\": \"even\", \"start\": 8.48, \"end\": 8.72}, {\"text\": \"the\", \"start\": 8.72, \"end\": 8.8}, {\"text\": \"little\", \"start\": 8.8, \"end\": 9.2}, {\"text\": \"things\", \"start\": 9.2, \"end\": 9.52}, {\"text\": \"you\", \"start\": 9.52, \"end\": 9.68}, {\"text\": \"used\", \"start\": 9.68, \"end\": 10.0}, {\"text\": \"to\", \"start\": 10.0, \"end\": 10.08}, {\"text\": \"say\", \"start\": 10.08, \"end\": 10.64}, {\"text\": \"How\", \"start\": 10.64, \"end\": 10.96}, {\"text\": \"have\", \"start\": 10.96, \"end\": 11.12}, {\"text\": \"you\", \"start\": 11.12, \"end\": 11.36}, {\"text\": \"been\", \"start\": 11.36, \"end\": 11.92}, {\"text\": \"Ive\", \"start\": 12.0, \"end\": 12.24}, {\"text\": \"thought\", \"start\": 12.24, \"end\": 12.48}, {\"text\": \"about\", \"start\": 12.48, \"end\": 12.8}, {\"text\": \"calling\", \"start\": 12.8, \"end\": 13.2}, {\"text\": \"you\", \"start\": 13.2, \"end\": 13.36}, {\"text\": \"so\", \"start\": 13.36, \"end\": 13.68}, {\"text\": \"many\", \"start\": 13.68, \"end\": 13.92}, {\"text\": \"times\", \"start\": 13.92, \"end\": 14.56}, {\"text\": \"but\", \"start\": 14.56, \"end\": 14.72}, {\"text\": \"I\", \"start\": 14.72, \"end\": 14.88}, {\"text\": \"never\", \"start\": 14.88, \"end\": 15.2}, {\"text\": \"knew\", \"start\": 15.2, \"end\": 15.36}, {\"text\": \"where\", \"start\": 15.36, \"end\": 15.6}, {\"text\": \"to\", \"start\": 15.6, \"end\": 15.6}, {\"text\": \"start\", \"start\": 15.68, \"end\": 16.24}], \"audio_duration\": 16.24}, \"chunk_seq\": 0, \"chunk_audio_offset_sec\": 0.0}\n\n"},"following_event":{"summary":"Following audio event with latest alignment snapshot","value":"data: {\"audio_base64\": \"//uSxOAAF...\", \"content\": \"I can’t believe it’s been this long. It feels like forever since we last really talked. I’ve missed hearing your voice, your stories, even the little things you used to say. How have you been? I’ve thought about calling you so many times, but I never knew where to start.\", \"alignment\": {\"segments\": [{\"text\": \"I\", \"start\": 0.0, \"end\": 0.16}, {\"text\": \"can't\", \"start\": 0.16, \"end\": 0.48}, {\"text\": \"believe\", \"start\": 0.48, \"end\": 0.8}, {\"text\": \"its\", \"start\": 0.8, \"end\": 1.12}, {\"text\": \"been\", \"start\": 1.2, \"end\": 1.44}, {\"text\": \"this\", \"start\": 1.44, \"end\": 1.76}, {\"text\": \"long\", \"start\": 1.76, \"end\": 2.48}, {\"text\": \"It\", \"start\": 2.56, \"end\": 2.64}, {\"text\": \"feels\", \"start\": 2.72, \"end\": 3.04}, {\"text\": \"like\", \"start\": 3.12, \"end\": 3.28}, {\"text\": \"forever\", \"start\": 3.36, \"end\": 4.0}, {\"text\": \"since\", \"start\": 4.0, \"end\": 4.32}, {\"text\": \"we\", \"start\": 4.32, \"end\": 4.48}, {\"text\": \"last\", \"start\": 4.48, \"end\": 4.96}, {\"text\": \"really\", \"start\": 4.96, \"end\": 5.28}, {\"text\": \"talked\", \"start\": 5.28, \"end\": 5.84}, {\"text\": \"Ive\", \"start\": 6.0, \"end\": 6.24}, {\"text\": \"missed\", \"start\": 6.24, \"end\": 6.64}, {\"text\": \"hearing\", \"start\": 6.64, \"end\": 6.96}, {\"text\": \"your\", \"start\": 6.96, \"end\": 7.2}, {\"text\": \"voice\", \"start\": 7.2, \"end\": 7.76}, {\"text\": \"your\", \"start\": 7.76, \"end\": 7.92}, {\"text\": \"stories\", \"start\": 7.92, \"end\": 8.48}, {\"text\": \"even\", \"start\": 8.48, \"end\": 8.72}, {\"text\": \"the\", \"start\": 8.72, \"end\": 8.8}, {\"text\": \"little\", \"start\": 8.8, \"end\": 9.2}, {\"text\": \"things\", \"start\": 9.2, \"end\": 9.52}, {\"text\": \"you\", \"start\": 9.52, \"end\": 9.68}, {\"text\": \"used\", \"start\": 9.68, \"end\": 10.0}, {\"text\": \"to\", \"start\": 10.0, \"end\": 10.08}, {\"text\": \"say\", \"start\": 10.08, \"end\": 10.64}, {\"text\": \"How\", \"start\": 10.64, \"end\": 10.96}, {\"text\": \"have\", \"start\": 10.96, \"end\": 11.12}, {\"text\": \"you\", \"start\": 11.12, \"end\": 11.36}, {\"text\": \"been\", \"start\": 11.36, \"end\": 11.92}, {\"text\": \"Ive\", \"start\": 12.0, \"end\": 12.24}, {\"text\": \"thought\", \"start\": 12.24, \"end\": 12.48}, {\"text\": \"about\", \"start\": 12.48, \"end\": 12.8}, {\"text\": \"calling\", \"start\": 12.8, \"end\": 13.2}, {\"text\": \"you\", \"start\": 13.2, \"end\": 13.36}, {\"text\": \"so\", \"start\": 13.36, \"end\": 13.68}, {\"text\": \"many\", \"start\": 13.68, \"end\": 13.92}, {\"text\": \"times\", \"start\": 13.92, \"end\": 14.56}, {\"text\": \"but\", \"start\": 14.56, \"end\": 14.72}, {\"text\": \"I\", \"start\": 14.72, \"end\": 14.88}, {\"text\": \"never\", \"start\": 14.88, \"end\": 15.2}, {\"text\": \"knew\", \"start\": 15.2, \"end\": 15.36}, {\"text\": \"where\", \"start\": 15.36, \"end\": 15.6}, {\"text\": \"to\", \"start\": 15.6, \"end\": 15.6}, {\"text\": \"start\", \"start\": 15.68, \"end\": 16.24}], \"audio_duration\": 16.24}, \"chunk_seq\": 0, \"chunk_audio_offset_sec\": 0.0}\n\n"},"later_text_chunk_event":{"summary":"Later text chunk event with another alignment","value":"data: {\"audio_base64\": \"//uSxImAl...\", \"content\": \"Seeing you again now makes me realize just how much I’ve missed you. We have so much to catch up on, and I don’t even know which part of my life to tell you about first.\", \"alignment\": {\"segments\": [{\"text\": \"Seeing\", \"start\": 0.4, \"end\": 0.8}, {\"text\": \"you\", \"start\": 0.8, \"end\": 0.96}, {\"text\": \"again\", \"start\": 0.96, \"end\": 1.44}, {\"text\": \"now\", \"start\": 1.44, \"end\": 1.68}, {\"text\": \"makes\", \"start\": 1.68, \"end\": 2.08}, {\"text\": \"me\", \"start\": 2.08, \"end\": 2.24}, {\"text\": \"realize\", \"start\": 2.24, \"end\": 2.8}, {\"text\": \"just\", \"start\": 2.8, \"end\": 3.12}, {\"text\": \"how\", \"start\": 3.12, \"end\": 3.28}, {\"text\": \"much\", \"start\": 3.28, \"end\": 3.6}, {\"text\": \"Ive\", \"start\": 3.6, \"end\": 3.76}, {\"text\": \"missed\", \"start\": 3.84, \"end\": 4.24}, {\"text\": \"you\", \"start\": 4.24, \"end\": 4.56}, {\"text\": \"We\", \"start\": 4.64, \"end\": 4.8}, {\"text\": \"have\", \"start\": 4.8, \"end\": 5.04}, {\"text\": \"so\", \"start\": 5.04, \"end\": 5.36}, {\"text\": \"much\", \"start\": 5.36, \"end\": 5.76}, {\"text\": \"to\", \"start\": 5.76, \"end\": 5.76}, {\"text\": \"catch\", \"start\": 5.76, \"end\": 6.16}, {\"text\": \"up\", \"start\": 6.16, \"end\": 6.4}, {\"text\": \"on\", \"start\": 6.4, \"end\": 6.72}, {\"text\": \"and\", \"start\": 6.8, \"end\": 6.96}, {\"text\": \"I\", \"start\": 6.96, \"end\": 7.04}, {\"text\": \"dont\", \"start\": 7.04, \"end\": 7.36}, {\"text\": \"even\", \"start\": 7.36, \"end\": 7.6}, {\"text\": \"know\", \"start\": 7.6, \"end\": 7.84}, {\"text\": \"which\", \"start\": 7.84, \"end\": 8.08}, {\"text\": \"part\", \"start\": 8.08, \"end\": 8.4}, {\"text\": \"of\", \"start\": 8.4, \"end\": 8.48}, {\"text\": \"my\", \"start\": 8.56, \"end\": 8.72}, {\"text\": \"life\", \"start\": 8.72, \"end\": 8.96}, {\"text\": \"to\", \"start\": 9.12, \"end\": 9.12}, {\"text\": \"tell\", \"start\": 9.12, \"end\": 9.44}, {\"text\": \"you\", \"start\": 9.44, \"end\": 9.6}, {\"text\": \"about\", \"start\": 9.6, \"end\": 10.0}, {\"text\": \"first\", \"start\": 10.08, \"end\": 10.48}], \"audio_duration\": 10.48}, \"chunk_seq\": 1, \"chunk_audio_offset_sec\": 16.24}\n\n"}}}}},"401":{"description":"No permission -- see authorization schemes","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}},"402":{"description":"No payment -- see charging schemes","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}},"503":{"description":"The server cannot process the request due to a high load","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}}},"tags":["OpenAPI v1"],"x-codeSamples":[{"lang":"bash","label":"Stream With Timestamps","source":"curl --no-buffer --request POST \\\n  --url https://api.fish.audio/v1/tts/stream/with-timestamp \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --header 'model: s2.1-pro-free' \\\n  --data '{\n    \"text\": \"[happy] I can’t believe it’s been this long. It feels like forever since we last really talked. I’ve missed hearing your voice, your stories, even the little things you used to say. How have you been? I’ve thought about calling you so many times, but I never knew where to start. Seeing you again now makes me realize just how much I’ve missed you. We have so much to catch up on, and I don’t even know which part of my life to tell you about first.\",\n    \"format\": \"opus\",\n    \"normalize\": true,\n    \"temperature\": 0.9,\n    \"chunk_length\": 100,\n    \"top_p\": 0.9,\n    \"latency\": \"balanced\",\n    \"sample_rate\": 48000,\n    \"reference_id\": \"fbe02f8306fc4d3d915e9871722a39d5\"\n  }'"}]}},"/v1/tts/live/with-timestamp":{"get":{"summary":"Text to Speech Live with Timestamps (WebSocket)","description":"Streaming text-to-speech over a WebSocket that returns word-level timestamps\nalongside the audio. Connect to `wss://api.fish.audio/v1/tts/live/with-timestamp`;\nthis is a WebSocket upgrade, not a plain HTTP request.\n\nUse it when you need to feed text in as it is produced — an LLM token stream,\na live caption feed — and want word timings for lip-sync, subtitles or\nhighlighting. For a one-shot request use `POST /v1/tts/stream/with-timestamp`\ninstead.\n\n## Handshake\n\nSend the same headers as any other API call:\n\n- `Authorization: Bearer <your-api-key>`\n- `model: <model>` — optional, defaults to `s2.1-pro`.\n\n## Framing\n\nEvery frame in both directions is a MessagePack-encoded **binary** frame\nholding a map with an `event` key. Text frames are ignored by the server and\nshould be ignored by your client.\n\n## Client to server\n\nThe inbound protocol is identical to `/v1/tts/live`:\n\n- `start` — opens the session. Send it once per session, before any other\n  event. Carries a `request` object with the same fields as the\n  `POST /v1/tts` body; leave `text` empty and stream the words with `text`\n  events. After a `finish` you may send another `start` to run a new session\n  on the same socket.\n- `text` — appends a text fragment to the session buffer.\n- `flush` — forces buffered text through generation without waiting for the\n  chunk to fill. The session stays open.\n- `stop` — ends the session. The server drains the buffer and answers with a\n  final `finish` event.\n\n## Server to client\n\n- `audio` — one audio chunk. Beyond the `audio` bytes it carries `content`,\n  `alignment`, `chunk_seq` and `chunk_audio_offset_sec`; these last three are\n  what this endpoint adds over `/v1/tts/live`. Concatenate every `audio`\n  payload in arrival order to reconstruct the full audio. Note that `audio`\n  here is raw MessagePack `bin`, not the base64 string used by the SSE\n  endpoint.\n- `finish` — terminal event, with `reason` of `stop` or `error`.\n- `error` — a request-level failure such as an invalid `start` request or a\n  concurrency refusal; the socket closes afterwards.\n\n## Reading the alignment\n\n`alignment` is a **cumulative snapshot** for its `chunk_seq`, not a delta:\nwhen it is non-null, replace the alignment you stored for that chunk rather\nthan appending to it. A `null` alignment means nothing new has been committed\nfor the chunk yet, which is normal early on.\n\nSegment times inside `alignment` are relative to the start of their chunk.\n`chunk_audio_offset_sec` is the chunk's own start time within the full audio,\nso the absolute time of a word is `chunk_audio_offset_sec + segment.start`.\nBoth `chunk_seq` and `chunk_audio_offset_sec` are monotonically\nnon-decreasing. A frame may be labelled with the previous chunk's\n`chunk_seq` while carrying the next chunk's audio bytes, so never use\n`chunk_seq` to attribute audio bytes — only alignment.","security":[{"BearerAuth":[]}],"parameters":[{"in":"header","name":"model","description":"Specify which TTS model to use. Use `s2.1-pro-free` for the free developer tier. If omitted or set to an unrecognized value, the request falls back to `s2.1-pro`.","required":false,"schema":{"default":"s2.1-pro","enum":["s1","s2-pro","s2.1-pro","s2.1-pro-free","drama-3","s3-pro"],"title":"Model","type":"string"},"deprecated":false}],"responses":{"200":{"description":"WebSocket handshake accepted (the server answers `101 Switching Protocols` on the wire). Every frame the server then sends is a MessagePack-encoded binary frame holding one of the events below. `audio` events carry the audio chunk together with `alignment`, `chunk_seq` and `chunk_audio_offset_sec`; `alignment` is the cumulative snapshot for its `chunk_seq` and replaces the previous one rather than extending it. Segment times are relative to the chunk, so absolute time is `chunk_audio_offset_sec + segment.start`. The stream ends with a `finish` event.","content":{"application/msgpack":{"schema":{"discriminator":{"mapping":{"audio":"#/components/schemas/TTSLiveWithTimestampAudioEvent","error":"#/components/schemas/TTSLiveErrorEvent","finish":"#/components/schemas/TTSLiveFinishEvent"},"propertyName":"event"},"oneOf":[{"$ref":"#/components/schemas/TTSLiveWithTimestampAudioEvent"},{"$ref":"#/components/schemas/TTSLiveFinishEvent"},{"$ref":"#/components/schemas/TTSLiveErrorEvent"}]}}}},"401":{"description":"No permission -- see authorization schemes","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}},"402":{"description":"No payment -- see charging schemes","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}},"503":{"description":"The server cannot process the request due to a high load","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}}},"tags":["OpenAPI v1"],"x-codeSamples":[{"lang":"python","label":"Live WebSocket With Timestamps","source":"import asyncio\n\nimport ormsgpack\nimport websockets\n\nTEXT = \"Hello there. This is a live synthesis, streamed word by word.\"\n\n\nasync def send_text(socket) -> None:\n    # `request` takes the same fields as POST /v1/tts. Leave `text` empty and\n    # stream the words in as they become available.\n    await socket.send(\n        ormsgpack.packb(\n            {\n                \"event\": \"start\",\n                \"request\": {\n                    \"text\": \"\",\n                    \"format\": \"opus\",\n                    \"latency\": \"balanced\",\n                    \"chunk_length\": 100,\n                    \"reference_id\": \"fbe02f8306fc4d3d915e9871722a39d5\",\n                },\n            }\n        )\n    )\n    for word in TEXT.split(\" \"):\n        await socket.send(ormsgpack.packb({\"event\": \"text\", \"text\": word + \" \"}))\n    await socket.send(ormsgpack.packb({\"event\": \"stop\"}))\n\n\nasync def main() -> None:\n    async with websockets.connect(\n        \"wss://api.fish.audio/v1/tts/live/with-timestamp\",\n        additional_headers={\n            \"Authorization\": \"Bearer <token>\",\n            \"model\": \"s2.1-pro-free\",\n        },\n        max_size=None,\n    ) as socket:\n        # Send and receive concurrently. Sending everything before reading can\n        # stall on flow control once the audio outpaces your receive buffer.\n        sender = asyncio.create_task(send_text(socket))\n\n        audio = bytearray()\n        alignments: dict[int, dict] = {}\n        offsets: dict[int, float] = {}\n\n        try:\n            async for frame in socket:\n                if isinstance(frame, str):\n                    continue\n                message = ormsgpack.unpackb(frame)\n                if message[\"event\"] == \"audio\":\n                    audio += message[\"audio\"]\n                    offsets[message[\"chunk_seq\"]] = message[\"chunk_audio_offset_sec\"]\n                    if message[\"alignment\"] is not None:\n                        # Cumulative snapshot: replace the chunk, never append.\n                        alignments[message[\"chunk_seq\"]] = message[\"alignment\"]\n                elif message[\"event\"] == \"finish\":\n                    if message[\"reason\"] == \"error\":\n                        raise RuntimeError(message.get(\"message\", \"synthesis failed\"))\n                    break\n                elif message[\"event\"] == \"error\":\n                    raise RuntimeError(message[\"error\"])\n        finally:\n            sender.cancel()\n\n        with open(\"output.opus\", \"wb\") as f:\n            f.write(audio)\n\n        # Segment times are chunk-relative; fold in the offset to get absolute.\n        for chunk_seq in sorted(alignments):\n            offset = offsets[chunk_seq]\n            for segment in alignments[chunk_seq][\"segments\"]:\n                start = offset + segment[\"start\"]\n                end = offset + segment[\"end\"]\n                print(f\"{start:6.2f}s -> {end:6.2f}s  {segment['text']}\")\n\n\nasyncio.run(main())"}],"x-fish-websocket":{"url":"wss://api.fish.audio/v1/tts/live/with-timestamp","encoding":"application/msgpack","clientEvents":{"description":"Frames the client sends, MessagePack encoded. Identical to the `/v1/tts/live` inbound protocol: `start` once, then any number of `text` events, optional `flush` events, and a final `stop`.","schema":{"discriminator":{"mapping":{"flush":"#/components/schemas/TTSLiveFlushEvent","start":"#/components/schemas/TTSLiveStartEvent","stop":"#/components/schemas/TTSLiveStopEvent","text":"#/components/schemas/TTSLiveTextEvent"},"propertyName":"event"},"oneOf":[{"$ref":"#/components/schemas/TTSLiveStartEvent"},{"$ref":"#/components/schemas/TTSLiveTextEvent"},{"$ref":"#/components/schemas/TTSLiveFlushEvent"},{"$ref":"#/components/schemas/TTSLiveStopEvent"}]}}}}},"/v1/voice-design":{"post":{"summary":"Voice Design","security":[{"BearerAuth":[]}],"parameters":[{"in":"header","name":"model","description":"Specify which voice-design model to use.","required":true,"schema":{"const":"voice-design-1","default":"voice-design-1","title":"Model","type":"string"},"deprecated":false}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/VoiceDesignRequest"}}}},"responses":{"200":{"description":"Request fulfilled, document follows","headers":{},"content":{"application/json":{"schema":{"properties":{"candidates":{"description":"Generated voice candidates.","items":{"$ref":"#/components/schemas/VoiceDesignCandidate"},"title":"Candidates","type":"array"}},"required":["candidates"],"type":"object"}}}},"401":{"description":"No permission -- see authorization schemes","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}},"402":{"description":"No payment -- see charging schemes","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}},"503":{"description":"The server cannot process the request due to a high load","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}}},"tags":["OpenAPI v1"],"x-codeSamples":[{"lang":"bash","label":"Voice Design","source":"curl --request POST \\\n  --url https://api.fish.audio/v1/voice-design \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --header 'model: voice-design-1' \\\n  --data '{\n    \"instruction\": \"Warm, confident studio narrator with a natural tone\",\n    \"reference_text\": \"Welcome to Fish Audio.\",\n    \"language\": \"en\",\n    \"n\": 2,\n    \"speed\": 1,\n    \"num_step\": 32,\n    \"guidance_scale\": 2,\n    \"instruct_guidance_scale\": 0,\n    \"seed\": 42\n  }'"}]}},"/model":{"get":{"summary":"List Models","security":[{"BearerAuth":[]}],"parameters":[{"in":"query","name":"page_size","description":"Page size","required":false,"schema":{"default":10,"maximum":100,"minimum":1,"title":"Page Size","type":"integer"},"deprecated":false},{"in":"query","name":"page_number","description":"Page number","required":false,"schema":{"default":1,"minimum":1,"title":"Page Number","type":"integer"},"deprecated":false},{"in":"query","name":"title","description":"Search term. Matches the voice title, description and tags; with self, the title only.","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Title"},"deprecated":false},{"in":"query","name":"tag","description":"Tag to filter models","required":false,"schema":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"string"},{"type":"null"}],"default":null,"title":"Tag"},"deprecated":false},{"in":"query","name":"self","description":"If True, return models owned by the active workspace","required":false,"schema":{"default":false,"title":"Self","type":"boolean"},"deprecated":false},{"in":"query","name":"author_id","description":"Author ID to filter public models; ignored if self is True","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Author Id"},"deprecated":false},{"in":"query","name":"language","description":"Language to filter models","required":false,"schema":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"string"},{"type":"null"}],"default":null,"title":"Language"},"deprecated":false},{"in":"query","name":"title_language","description":"Title language to filter models","required":false,"schema":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"string"},{"type":"null"}],"default":null,"title":"Title Language"},"deprecated":false},{"in":"query","name":"visibility","description":"Visibility to filter workspace models; ignored unless self is True","required":false,"schema":{"anyOf":[{"enum":["public","unlist","private"],"type":"string"},{"type":"null"}],"default":null,"title":"Visibility"},"deprecated":false},{"in":"query","name":"licensed","description":"If True, only voices licensed by Fish Audio (rights secured from the voice owner) are returned; ignored if self is True","required":false,"schema":{"default":false,"title":"Licensed","type":"boolean"},"deprecated":false},{"in":"query","name":"sort_by","description":"","required":false,"schema":{"default":"score","enum":["score","task_count","created_at"],"title":"Sort By","type":"string"},"deprecated":false}],"responses":{"200":{"description":"Request fulfilled, document follows","headers":{},"content":{"application/json":{"schema":{"properties":{"max_offset":{"anyOf":[{"type":"integer"},{"type":"null"}],"default":null,"title":"Max Offset"},"accessible_upper_bound":{"anyOf":[{"type":"integer"},{"type":"null"}],"default":null,"title":"Accessible Upper Bound"},"window_limited":{"default":false,"title":"Window Limited","type":"boolean"},"total_is_exact":{"default":true,"title":"Total Is Exact","type":"boolean"},"total":{"title":"Total","type":"integer"},"items":{"items":{"$ref":"#/components/schemas/ModelEntity"},"title":"Items","type":"array"},"has_more":{"anyOf":[{"type":"boolean"},{"type":"null"}],"default":null,"title":"Has More"}},"required":["total","items"],"type":"object"}}}}},"tags":["Model"]},"post":{"summary":"Create Model for Users via API","security":[{"BearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"visibility":{"default":"private","description":"Model visibility. Public requests are downgraded to private; use the web publish flow to publish publicly. Unlist allows anyone with the link to access, while private is visible only to the creator.","enum":["public","unlist","private"],"title":"Visibility","type":"string"},"type":{"const":"tts","description":"Model type, tts is for text to speech","title":"Type","type":"string"},"title":{"description":"Model title or name","title":"Title","type":"string"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"description":"Model description","title":"Description"},"cover_image":{"anyOf":[{"format":"binary","type":"string"},{"type":"null"}],"default":null,"description":"Model cover image, this is required if the model is public","title":"Cover Image"},"train_mode":{"const":"fast","description":"Model train mode, for TTS model, fast means model instantly available after creation","title":"Train Mode","type":"string"},"voices":{"anyOf":[{"items":{"format":"binary","type":"string"},"maxItems":20,"minItems":1,"type":"array"},{"format":"binary","type":"string"}],"description":"Upload voices files that will be used to tune the model","title":"Voices"},"texts":{"anyOf":[{"items":{"type":"string"},"maxItems":20,"type":"array"},{"type":"string"},{"type":"null"}],"default":null,"description":"Texts corresponding to the voices, if unspecified, ASR will be performed on the voices","title":"Texts"},"voice_design_signatures":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"string"},{"type":"null"}],"default":null,"description":"Signatures from /v1/voice-design candidates, one per voice in the same order. When every uploaded voice verifies, the model is stamped source=voice_design; an invalid signature rejects the request.","title":"Voice Design Signatures"},"tags":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"string"},{"type":"null"}],"description":"Model tags","title":"Tags"},"enhance_audio_quality":{"default":true,"description":"Enhance audio quality","title":"Enhance Audio Quality","type":"boolean"},"generate_sample":{"default":false,"description":"Generate default text","title":"Generate Sample","type":"boolean"}},"required":["type","title","train_mode","voices"],"type":"object"}},"application/x-www-form-urlencoded":{"schema":{"properties":{"visibility":{"default":"private","description":"Model visibility. Public requests are downgraded to private; use the web publish flow to publish publicly. Unlist allows anyone with the link to access, while private is visible only to the creator.","enum":["public","unlist","private"],"title":"Visibility","type":"string"},"type":{"const":"tts","description":"Model type, tts is for text to speech","title":"Type","type":"string"},"title":{"description":"Model title or name","title":"Title","type":"string"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"description":"Model description","title":"Description"},"cover_image":{"anyOf":[{"format":"binary","type":"string"},{"type":"null"}],"default":null,"description":"Model cover image, this is required if the model is public","title":"Cover Image"},"train_mode":{"const":"fast","description":"Model train mode, for TTS model, fast means model instantly available after creation","title":"Train Mode","type":"string"},"voices":{"anyOf":[{"items":{"format":"binary","type":"string"},"maxItems":20,"minItems":1,"type":"array"},{"format":"binary","type":"string"}],"description":"Upload voices files that will be used to tune the model","title":"Voices"},"texts":{"anyOf":[{"items":{"type":"string"},"maxItems":20,"type":"array"},{"type":"string"},{"type":"null"}],"default":null,"description":"Texts corresponding to the voices, if unspecified, ASR will be performed on the voices","title":"Texts"},"voice_design_signatures":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"string"},{"type":"null"}],"default":null,"description":"Signatures from /v1/voice-design candidates, one per voice in the same order. When every uploaded voice verifies, the model is stamped source=voice_design; an invalid signature rejects the request.","title":"Voice Design Signatures"},"tags":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"string"},{"type":"null"}],"description":"Model tags","title":"Tags"},"enhance_audio_quality":{"default":true,"description":"Enhance audio quality","title":"Enhance Audio Quality","type":"boolean"},"generate_sample":{"default":false,"description":"Generate default text","title":"Generate Sample","type":"boolean"}},"required":["type","title","train_mode","voices"],"type":"object"}},"multipart/form-data":{"schema":{"properties":{"visibility":{"default":"private","description":"Model visibility. Public requests are downgraded to private; use the web publish flow to publish publicly. Unlist allows anyone with the link to access, while private is visible only to the creator.","enum":["public","unlist","private"],"title":"Visibility","type":"string"},"type":{"const":"tts","description":"Model type, tts is for text to speech","title":"Type","type":"string"},"title":{"description":"Model title or name","title":"Title","type":"string"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"description":"Model description","title":"Description"},"cover_image":{"anyOf":[{"format":"binary","type":"string"},{"type":"null"}],"default":null,"description":"Model cover image, this is required if the model is public","title":"Cover Image"},"train_mode":{"const":"fast","description":"Model train mode, for TTS model, fast means model instantly available after creation","title":"Train Mode","type":"string"},"voices":{"anyOf":[{"items":{"format":"binary","type":"string"},"maxItems":20,"minItems":1,"type":"array"},{"format":"binary","type":"string"}],"description":"Upload voices files that will be used to tune the model","title":"Voices"},"texts":{"anyOf":[{"items":{"type":"string"},"maxItems":20,"type":"array"},{"type":"string"},{"type":"null"}],"default":null,"description":"Texts corresponding to the voices, if unspecified, ASR will be performed on the voices","title":"Texts"},"voice_design_signatures":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"string"},{"type":"null"}],"default":null,"description":"Signatures from /v1/voice-design candidates, one per voice in the same order. When every uploaded voice verifies, the model is stamped source=voice_design; an invalid signature rejects the request.","title":"Voice Design Signatures"},"tags":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"string"},{"type":"null"}],"description":"Model tags","title":"Tags"},"enhance_audio_quality":{"default":true,"description":"Enhance audio quality","title":"Enhance Audio Quality","type":"boolean"},"generate_sample":{"default":false,"description":"Generate default text","title":"Generate Sample","type":"boolean"}},"required":["type","title","train_mode","voices"],"type":"object"}},"application/msgpack":{"schema":{"properties":{"visibility":{"default":"private","description":"Model visibility. Public requests are downgraded to private; use the web publish flow to publish publicly. Unlist allows anyone with the link to access, while private is visible only to the creator.","enum":["public","unlist","private"],"title":"Visibility","type":"string"},"type":{"const":"tts","description":"Model type, tts is for text to speech","title":"Type","type":"string"},"title":{"description":"Model title or name","title":"Title","type":"string"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"description":"Model description","title":"Description"},"cover_image":{"anyOf":[{"format":"binary","type":"string"},{"type":"null"}],"default":null,"description":"Model cover image, this is required if the model is public","title":"Cover Image"},"train_mode":{"const":"fast","description":"Model train mode, for TTS model, fast means model instantly available after creation","title":"Train Mode","type":"string"},"voices":{"anyOf":[{"items":{"format":"binary","type":"string"},"maxItems":20,"minItems":1,"type":"array"},{"format":"binary","type":"string"}],"description":"Upload voices files that will be used to tune the model","title":"Voices"},"texts":{"anyOf":[{"items":{"type":"string"},"maxItems":20,"type":"array"},{"type":"string"},{"type":"null"}],"default":null,"description":"Texts corresponding to the voices, if unspecified, ASR will be performed on the voices","title":"Texts"},"voice_design_signatures":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"string"},{"type":"null"}],"default":null,"description":"Signatures from /v1/voice-design candidates, one per voice in the same order. When every uploaded voice verifies, the model is stamped source=voice_design; an invalid signature rejects the request.","title":"Voice Design Signatures"},"tags":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"string"},{"type":"null"}],"description":"Model tags","title":"Tags"},"enhance_audio_quality":{"default":true,"description":"Enhance audio quality","title":"Enhance Audio Quality","type":"boolean"},"generate_sample":{"default":false,"description":"Generate default text","title":"Generate Sample","type":"boolean"}},"required":["type","title","train_mode","voices"],"type":"object"}}}},"responses":{"201":{"description":"Document created, URL follows","headers":{},"content":{"application/json":{"schema":{"properties":{"_id":{"title":"Id","type":"string"},"type":{"enum":["svc","tts"],"title":"Type","type":"string"},"title":{"title":"Title","type":"string"},"description":{"default":"","title":"Description","type":"string"},"cover_image":{"default":"","title":"Cover Image","type":"string"},"train_mode":{"default":"full","enum":["fast","full"],"title":"Train Mode","type":"string"},"state":{"enum":["created","training","trained","failed"],"title":"State","type":"string"},"tags":{"items":{"type":"string"},"title":"Tags","type":"array"},"samples":{"default":[],"items":{"$ref":"#/components/schemas/SampleEntity"},"title":"Samples","type":"array"},"created_at":{"format":"date-time","title":"Created At","type":"string"},"updated_at":{"format":"date-time","title":"Updated At","type":"string"},"languages":{"default":[],"items":{"type":"string"},"title":"Languages","type":"array"},"visibility":{"enum":["public","unlist","private"],"title":"Visibility","type":"string"},"lock_visibility":{"default":false,"title":"Lock Visibility","type":"boolean"},"dmca_taken_down":{"anyOf":[{"type":"boolean"},{"type":"null"}],"default":false,"title":"Dmca Taken Down"},"takedown_category":{"anyOf":[{"enum":["dmca","policy"],"type":"string"},{"type":"null"}],"default":null,"title":"Takedown Category"},"default_text":{"default":"","title":"Default Text","type":"string"},"source":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Source"},"licensed":{"default":false,"title":"Licensed","type":"boolean"},"pvc_release_state":{"anyOf":[{"enum":["released","retiring"],"type":"string"},{"type":"null"}],"default":null,"title":"Pvc Release State"},"pvc_notice_period_months":{"anyOf":[{"type":"integer"},{"type":"null"}],"default":null,"title":"Pvc Notice Period Months"},"pvc_released_at":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}],"default":null,"title":"Pvc Released At"},"pvc_retire_requested_at":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}],"default":null,"title":"Pvc Retire Requested At"},"pvc_retire_effective_at":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}],"default":null,"title":"Pvc Retire Effective At"},"quality":{"anyOf":[{"$ref":"#/components/schemas/ModelQualityEntity"},{"type":"null"}],"default":null},"like_count":{"title":"Like Count","type":"integer"},"mark_count":{"title":"Mark Count","type":"integer"},"shared_count":{"title":"Shared Count","type":"integer"},"task_count":{"title":"Task Count","type":"integer"},"unliked":{"default":false,"title":"Unliked","type":"boolean"},"liked":{"default":false,"title":"Liked","type":"boolean"},"marked":{"default":false,"title":"Marked","type":"boolean"},"author":{"$ref":"#/components/schemas/AuthorEntity"}},"required":["_id","type","title","state","tags","created_at","updated_at","visibility","like_count","mark_count","shared_count","task_count","author"],"type":"object"}}}},"401":{"description":"No permission -- see authorization schemes","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}},"503":{"description":"The server cannot process the request due to a high load","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}}},"tags":["Model"]}},"/model/{id}":{"get":{"summary":"Get Model","security":[{"BearerAuth":[]}],"parameters":[{"in":"path","name":"id","description":"","required":true,"schema":{"title":"Id","type":"string"},"deprecated":false}],"responses":{"200":{"description":"Request fulfilled, document follows","headers":{},"content":{"application/json":{"schema":{"properties":{"_id":{"title":"Id","type":"string"},"type":{"enum":["svc","tts"],"title":"Type","type":"string"},"title":{"title":"Title","type":"string"},"description":{"default":"","title":"Description","type":"string"},"cover_image":{"default":"","title":"Cover Image","type":"string"},"train_mode":{"default":"full","enum":["fast","full"],"title":"Train Mode","type":"string"},"state":{"enum":["created","training","trained","failed"],"title":"State","type":"string"},"tags":{"items":{"type":"string"},"title":"Tags","type":"array"},"samples":{"default":[],"items":{"$ref":"#/components/schemas/SampleEntity"},"title":"Samples","type":"array"},"created_at":{"format":"date-time","title":"Created At","type":"string"},"updated_at":{"format":"date-time","title":"Updated At","type":"string"},"languages":{"default":[],"items":{"type":"string"},"title":"Languages","type":"array"},"visibility":{"enum":["public","unlist","private"],"title":"Visibility","type":"string"},"lock_visibility":{"default":false,"title":"Lock Visibility","type":"boolean"},"dmca_taken_down":{"anyOf":[{"type":"boolean"},{"type":"null"}],"default":false,"title":"Dmca Taken Down"},"takedown_category":{"anyOf":[{"enum":["dmca","policy"],"type":"string"},{"type":"null"}],"default":null,"title":"Takedown Category"},"default_text":{"default":"","title":"Default Text","type":"string"},"source":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Source"},"licensed":{"default":false,"title":"Licensed","type":"boolean"},"pvc_release_state":{"anyOf":[{"enum":["released","retiring"],"type":"string"},{"type":"null"}],"default":null,"title":"Pvc Release State"},"pvc_notice_period_months":{"anyOf":[{"type":"integer"},{"type":"null"}],"default":null,"title":"Pvc Notice Period Months"},"pvc_released_at":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}],"default":null,"title":"Pvc Released At"},"pvc_retire_requested_at":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}],"default":null,"title":"Pvc Retire Requested At"},"pvc_retire_effective_at":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}],"default":null,"title":"Pvc Retire Effective At"},"quality":{"anyOf":[{"$ref":"#/components/schemas/ModelQualityEntity"},{"type":"null"}],"default":null},"like_count":{"title":"Like Count","type":"integer"},"mark_count":{"title":"Mark Count","type":"integer"},"shared_count":{"title":"Shared Count","type":"integer"},"task_count":{"title":"Task Count","type":"integer"},"unliked":{"default":false,"title":"Unliked","type":"boolean"},"liked":{"default":false,"title":"Liked","type":"boolean"},"marked":{"default":false,"title":"Marked","type":"boolean"},"author":{"$ref":"#/components/schemas/AuthorEntity"}},"required":["_id","type","title","state","tags","created_at","updated_at","visibility","like_count","mark_count","shared_count","task_count","author"],"type":"object"}}}},"403":{"description":"Request forbidden -- authorization will not help","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}},"404":{"description":"Nothing matches the given URI","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}}},"tags":["Model"]},"patch":{"summary":"Update Model","security":[{"BearerAuth":[]}],"parameters":[{"in":"path","name":"id","description":"","required":true,"schema":{"title":"Id","type":"string"},"deprecated":false}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"title":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Title"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Description"},"cover_image":{"anyOf":[{"format":"binary","type":"string"},{"type":"null"}],"default":null,"title":"Cover Image"},"visibility":{"anyOf":[{"enum":["public","unlist","private"],"type":"string"},{"type":"null"}],"default":null,"title":"Visibility"},"tags":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"string"}],"title":"Tags"}},"type":"object"}},"application/x-www-form-urlencoded":{"schema":{"properties":{"title":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Title"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Description"},"cover_image":{"anyOf":[{"format":"binary","type":"string"},{"type":"null"}],"default":null,"title":"Cover Image"},"visibility":{"anyOf":[{"enum":["public","unlist","private"],"type":"string"},{"type":"null"}],"default":null,"title":"Visibility"},"tags":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"string"}],"title":"Tags"}},"type":"object"}},"multipart/form-data":{"schema":{"properties":{"title":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Title"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Description"},"cover_image":{"anyOf":[{"format":"binary","type":"string"},{"type":"null"}],"default":null,"title":"Cover Image"},"visibility":{"anyOf":[{"enum":["public","unlist","private"],"type":"string"},{"type":"null"}],"default":null,"title":"Visibility"},"tags":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"string"}],"title":"Tags"}},"type":"object"}},"application/msgpack":{"schema":{"properties":{"title":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Title"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Description"},"cover_image":{"anyOf":[{"format":"binary","type":"string"},{"type":"null"}],"default":null,"title":"Cover Image"},"visibility":{"anyOf":[{"enum":["public","unlist","private"],"type":"string"},{"type":"null"}],"default":null,"title":"Visibility"},"tags":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"string"}],"title":"Tags"}},"type":"object"}}}},"responses":{"200":{"description":"Request fulfilled, document follows","headers":{}},"401":{"description":"No permission -- see authorization schemes","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}},"503":{"description":"The server cannot process the request due to a high load","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}}},"tags":["Model"]},"delete":{"summary":"Delete Model","security":[{"BearerAuth":[]}],"parameters":[{"in":"path","name":"id","description":"","required":true,"schema":{"title":"Id","type":"string"},"deprecated":false}],"responses":{"200":{"description":"Request fulfilled, document follows","headers":{}},"401":{"description":"No permission -- see authorization schemes","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}},"503":{"description":"The server cannot process the request due to a high load","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer"},"message":{"title":"Message","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["status","message"],"type":"object"}}}}},"tags":["Model"]}}},"tags":[],"components":{"securitySchemes":{"BearerAuth":{"type":"http","scheme":"bearer"}},"schemas":{"RevokeCredentials":{"properties":{"credentials":{"items":{"maxLength":256,"type":"string"},"maxItems":1000,"minItems":1,"title":"Credentials","type":"array"},"source":{"anyOf":[{"maxLength":64,"type":"string"},{"type":"null"}],"default":null,"title":"Source"},"url":{"anyOf":[{"maxLength":2048,"type":"string"},{"type":"null"}],"default":null,"title":"Url"}},"required":["credentials"],"title":"RevokeCredentials","type":"object"},"AgentSessionKeypadMenu":{"description":"How the keypad menu of an inbound phone call ended. `outcome` is\n`selected` when the caller chose an option, `no_input` or `no_match`\nwhen no attempt got a valid choice (the last one had no input, or input\nmatching no option), and `skipped` when the menu could not run (a resumed\nconversation or no SIP caller). `value` is what the menu variable\nreceived: the chosen option's value, or the fallback value when the\ncaller never made a valid choice.","properties":{"outcome":{"enum":["selected","no_input","no_match","skipped"],"title":"Outcome","type":"string"},"variable":{"title":"Variable","type":"string"},"value":{"title":"Value","type":"string"},"key":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Key"},"input":{"anyOf":[{"enum":["dtmf","speech"],"type":"string"},{"type":"null"}],"default":null,"title":"Input"},"attempts":{"default":0,"title":"Attempts","type":"integer"},"completed_at":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}],"default":null,"title":"Completed At"}},"required":["outcome","variable","value"],"title":"AgentSessionKeypadMenu","type":"object"},"AgentSessionSummary":{"description":"One list row: lifecycle facts only — the conversation timeline lives on\nthe detail endpoint (Retell-style thin list).","properties":{"session_id":{"title":"Session Id","type":"string"},"agent_id":{"title":"Agent Id","type":"string"},"agent_name":{"title":"Agent Name","type":"string"},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Name"},"end_user_id":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"End User Id"},"status":{"enum":["pending","active","completed","failed","unknown"],"title":"Status","type":"string"},"end_reason":{"anyOf":[{"enum":["user_hangup","agent_hangup","escalated","conversation_timeout","heartbeat_timeout","agent_join_timeout","internal_error","llm_endpoint_failure","room_join_timeout","cancelled","dial_failed","call_rejected"],"type":"string"},{"type":"null"}],"default":null,"title":"End Reason"},"conversation_status":{"description":"How the conversation went, derived from `status` and `end_reason`. Current values: `active` is still going; `resolved` ended normally, which does not mean the caller's problem was solved; `escalated` was transferred to a person; `missed` is a call nobody connected to; `error` is a conversation the platform ended because something failed. New values may be added, so treat an unknown value as a status you do not recognise rather than an error. Filter the list with `conversation_status`, which accepts only the values above.","title":"Conversation Status","type":"string"},"rejection_reason":{"anyOf":[{"enum":["missing_dynamic_variables","agent_not_published","number_unassigned","number_not_active","out_of_credit","concurrency_limit_exceeded"],"type":"string"},{"type":"null"}],"default":null,"description":"Why an inbound phone call was refused before entering a session (when end_reason is call_rejected). Null on all other sessions.","title":"Rejection Reason"},"rejection_detail":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"description":"Human-readable detail for rejection_reason when extra context is available, such as missing dynamic variable names or phone number status. Null when no extra context applies. Intended for display, wording is not guaranteed to stay stable.","title":"Rejection Detail"},"source":{"enum":["api_key","dashboard","public","phone","whatsapp"],"title":"Source","type":"string"},"direction":{"default":"inbound","enum":["inbound","outbound"],"title":"Direction","type":"string"},"dial_status":{"anyOf":[{"enum":["answered","busy","no_answer","failed"],"type":"string"},{"type":"null"}],"default":null,"title":"Dial Status"},"dial_sip_status":{"anyOf":[{"type":"integer"},{"type":"null"}],"default":null,"description":"busy, no_answer and failed: the final SIP response code the carrier or your SIP trunk gave to the outbound dial. Null on an answered call and when it gave none.","title":"Dial Sip Status"},"dial_sip_reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"description":"The reason text the carrier or your SIP trunk sent with dial_sip_status, verbatim, for example `Busy here`. Null when it sent none.","title":"Dial Sip Reason"},"answered_by":{"anyOf":[{"enum":["human","voicemail","unknown"],"type":"string"},{"type":"null"}],"default":null,"title":"Answered By"},"caller_number":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Caller Number"},"caller_id_withheld":{"anyOf":[{"type":"boolean"},{"type":"null"}],"default":null,"title":"Caller Id Withheld"},"dialed_number":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Dialed Number"},"sip_call_id":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Sip Call Id"},"call_sid":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Call Sid"},"timezone":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Timezone"},"created_at":{"title":"Created At","type":"string"},"started_at":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Started At"},"ended_at":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Ended At"},"duration_seconds":{"anyOf":[{"type":"integer"},{"type":"null"}],"default":null,"title":"Duration Seconds"},"participant_identity":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Participant Identity"},"agent_participant_identity":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Agent Participant Identity"},"agent_joined_at":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Agent Joined At"},"metadata":{"additionalProperties":{"$ref":"#/components/schemas/JsonValue"},"title":"Metadata","type":"object"},"content_purged_at":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Content Purged At"},"keypad_menu":{"anyOf":[{"$ref":"#/components/schemas/AgentSessionKeypadMenu"},{"type":"null"}],"default":null}},"required":["session_id","agent_id","agent_name","status","conversation_status","source","created_at"],"title":"AgentSessionSummary","type":"object"},"JsonValue":{},"AgentLLMCustomPayload":{"additionalProperties":false,"description":"Write model: full base_url policy + caps; stored values come only from here.","properties":{"base_url":{"maxLength":2000,"minLength":1,"title":"Base Url","type":"string"},"model":{"maxLength":256,"minLength":1,"title":"Model","type":"string"},"api_key":{"anyOf":[{"maxLength":4096,"minLength":1,"type":"string"},{"type":"null"}],"default":null,"description":"Sent to your endpoint as the Authorization bearer token; write-only, reads return null. Required when introducing `custom`; omit to keep the stored key when updating.","title":"Api Key"},"headers":{"anyOf":[{"additionalProperties":{"type":"string"},"type":"object"},{"type":"null"}],"default":null,"description":"Extra headers sent on every request to your endpoint, such as `x-vercel-protection-bypass`. Reads return the stored map. Omit to keep the stored headers, `{}` clears them.","title":"Headers"}},"required":["base_url","model"],"title":"AgentLLMCustomPayload","type":"object"},"AgentLLMFallbackModelPayload":{"additionalProperties":false,"description":"One fallback, write model: `model` or `custom`, under the same rules as\nllm.model / llm.custom.","properties":{"model":{"anyOf":[{"enum":["google/gemini-3.5-flash-lite","google/gemini-3.6-flash","google/gemini-3.8-flash","google/gemini-3.6-flash-priority","google/gemini-3.8-flash-priority","google/gemini-3.5-flash-lite-priority","google/gemini-4-hydrogen","google/gemini-4-neon","google/gemini-4-hydrogen-priority","google/gemini-4-neon-priority","google/gemini-2.5-flash","google/gemma-4-26b-a4b-it","anthropic/claude-haiku-4.5","anthropic/claude-sonnet-4.6","anthropic/claude-sonnet-5.5","anthropic/claude-opus-5.5","anthropic/claude-fable-5.1","anthropic/claude-fable-5.2","openai/gpt-5.6-luna","openai/gpt-6-luna","openai/gpt-5","openai/gpt-6.1-sol","openai/gpt-6.1-terra","openai/gpt-6-astra","openai/gpt-6.2-sol","openai/gpt-4o","openai/gpt-4.1","openai/gpt-5.6-luna-fast","openai/gpt-6-luna-fast","openai/gpt-6.1-terra-fast","openai/gpt-6.1-sol-fast","openai/gpt-6-astra-fast","openai/gpt-6.2-sol-fast","openai/gpt-4o-fast","openai/gpt-4.1-fast"],"type":"string"},{"type":"null"}],"default":null,"title":"Model"},"custom":{"anyOf":[{"$ref":"#/components/schemas/AgentLLMCustomPayload"},{"type":"null"}],"default":null,"description":"A customer endpoint, with the same rules as `llm.custom`. Omit `api_key` to keep the stored key of the fallback with the same `base_url` and `model`."},"ttft_timeout_ms":{"anyOf":[{"maximum":30000,"minimum":500,"type":"integer"},{"type":"null"}],"default":null,"description":"Milliseconds the model gets to start its reply (first text or tool call). Past it, the reply moves to the next fallback model. Not set: defaults to 5000 ms (5 seconds).","title":"Ttft Timeout Ms"},"total_timeout_ms":{"anyOf":[{"maximum":120000,"minimum":1000,"type":"integer"},{"type":"null"}],"default":null,"description":"Milliseconds the model gets to finish its reply. Past it, a reply nothing of which was spoken yet moves to the next fallback model; one already being spoken fails like any failed reply. At least `ttft_timeout_ms` when both are set. Not set: no limit.","title":"Total Timeout Ms"},"parallel":{"anyOf":[{"$ref":"#/components/schemas/AgentLLMParallelPayload"},{"type":"null"}],"default":null,"description":"First entry only: request this model together with the agent's own model. Both requests bill their tokens."}},"title":"AgentLLMFallbackModelPayload","type":"object"},"AgentLLMFallbackPayload":{"additionalProperties":false,"description":"Replaces the whole fallback: `mode` and `models` travel together.","properties":{"mode":{"enum":["platform","manual","off"],"title":"Mode","type":"string"},"models":{"anyOf":[{"items":{"$ref":"#/components/schemas/AgentLLMFallbackModelPayload"},"type":"array"},{"type":"null"}],"default":null,"description":"Fallback models in order, 1 to 3. Only with mode `manual`.","title":"Models"},"primary":{"anyOf":[{"$ref":"#/components/schemas/AgentLLMTimeoutsPayload"},{"type":"null"}],"default":null,"description":"The agent's own model's timeouts. Only with mode `manual`."}},"required":["mode"],"title":"AgentLLMFallbackPayload","type":"object"},"AgentLLMParallelPayload":{"additionalProperties":false,"properties":{"kick_in_ms":{"default":1500,"description":"The agent's own model keeps the reply if its first token comes within this many milliseconds; past it, this fallback's reply is used. The other request is cancelled.","maximum":10000,"minimum":300,"title":"Kick In Ms","type":"integer"}},"title":"AgentLLMParallelPayload","type":"object"},"AgentLLMTimeoutsPayload":{"additionalProperties":false,"description":"The agent's own model's timeouts, write model. Unset ttft_timeout_ms =\n5000 ms (5 seconds); unset total_timeout_ms = no limit. The two are compared\nonly when both are set.","properties":{"ttft_timeout_ms":{"anyOf":[{"maximum":30000,"minimum":500,"type":"integer"},{"type":"null"}],"default":null,"description":"Milliseconds the model gets to start its reply (first text or tool call). Past it, the reply moves to the next fallback model. Not set: defaults to 5000 ms (5 seconds).","title":"Ttft Timeout Ms"},"total_timeout_ms":{"anyOf":[{"maximum":120000,"minimum":1000,"type":"integer"},{"type":"null"}],"default":null,"description":"Milliseconds the model gets to finish its reply. Past it, a reply nothing of which was spoken yet moves to the next fallback model; one already being spoken fails like any failed reply. At least `ttft_timeout_ms` when both are set. Not set: no limit.","title":"Total Timeout Ms"}},"title":"AgentLLMTimeoutsPayload","type":"object"},"AgentSessionAsrOverridesPayload":{"additionalProperties":false,"description":"Per-session subset of the agent config's asr section, same field names.","properties":{"model":{"anyOf":[{"enum":["deepgram:nova-3","elevenlabs:scribe_v2_realtime","elevenlabs:scribe_v2_medical","fish_audio:transcribe-stream-1","fish_audio:transcribe-stream-2","fish_audio:transcribe-stream-1-dev"],"type":"string"},{"type":"null"}],"default":null,"description":"Speech recognition model for this session, same values as the agent's `asr.model`.","title":"Model"}},"title":"AgentSessionAsrOverridesPayload","type":"object"},"AgentSessionContextPayload":{"additionalProperties":false,"description":"Per-session overrides of the agent's context switches (the config's\n`context` section). A switch left out follows the agent.","properties":{"current_time":{"anyOf":[{"type":"boolean"},{"type":"null"}],"default":null,"description":"Whether the agent knows the current date and time in this session. Omit it to follow the agent's `context.current_time`. `false` withholds both from this session, `true` injects them even when the agent has them off.","title":"Current Time"}},"title":"AgentSessionContextPayload","type":"object"},"AgentSessionCreatePayload":{"additionalProperties":false,"properties":{"agent_id":{"title":"Agent Id","type":"string"},"name":{"anyOf":[{"maxLength":128,"type":"string"},{"type":"null"}],"default":null,"title":"Name"},"timezone":{"anyOf":[{"maxLength":64,"type":"string"},{"type":"null"}],"default":null,"description":"IANA timezone (like `Asia/Tokyo`) for the agent's sense of local date and time in this session. Overrides the agent's configured timezone, which defaults to UTC. Invalid names are rejected with 422.","title":"Timezone"},"client_timezone":{"anyOf":[{"maxLength":64,"type":"string"},{"type":"null"}],"default":null,"description":"The end user's device timezone as an IANA name (like `Asia/Tokyo`), used as a fallback hint: it applies only when neither `timezone` nor the agent's configured timezone is set, and invalid values are ignored rather than rejected. The Web SDK fills it automatically from the browser for public agents. When your backend creates the session, forward the value from your client.","title":"Client Timezone"},"context":{"anyOf":[{"$ref":"#/components/schemas/AgentSessionContextPayload"},{"type":"null"}],"default":null,"description":"Per-session overrides of the agent's context switches (`context.current_time` in the agent config). A switch you leave out follows the agent."},"overrides":{"anyOf":[{"$ref":"#/components/schemas/AgentSessionOverridesPayload"},{"type":"null"}],"default":null},"dynamic_variables":{"anyOf":[{"additionalProperties":{"anyOf":[{"type":"string"},{"type":"integer"},{"type":"number"},{"type":"boolean"}]},"maxProperties":500,"type":"object"},{"type":"null"}],"default":null,"title":"Dynamic Variables"},"end_user_id":{"anyOf":[{"maxLength":256,"type":"string"},{"type":"null"}],"default":null,"description":"Your identifier for the end user, stored verbatim. Returned on session reads and webhooks, and filterable with `GET /v1/agent/sessions?end_user_id=`.","title":"End User Id"},"metadata":{"anyOf":[{"additionalProperties":{"$ref":"#/components/schemas/JsonValue"},"type":"object"},{"type":"null"}],"default":null,"title":"Metadata"},"llm_extra_body":{"anyOf":[{"additionalProperties":{"$ref":"#/components/schemas/JsonValue"},"type":"object"},{"type":"null"}],"default":null,"title":"Llm Extra Body"},"tool_events":{"default":true,"title":"Tool Events","type":"boolean"},"record_audio":{"anyOf":[{"type":"boolean"},{"type":"null"}],"default":null,"title":"Record Audio"}},"required":["agent_id"],"title":"AgentSessionCreatePayload","type":"object"},"AgentSessionLlmOverridesPayload":{"additionalProperties":false,"description":"Per-session subset of the agent config's llm section, same field names.","properties":{"fallback":{"anyOf":[{"$ref":"#/components/schemas/AgentLLMFallbackPayload"},{"type":"null"}],"default":null,"description":"Replaces the agent's `llm.fallback` for this session, same shape and rules. Each `custom` entry needs its `api_key`."}},"title":"AgentSessionLlmOverridesPayload","type":"object"},"AgentSessionOverridesPayload":{"additionalProperties":false,"description":"Wire twin of @fishaudio/agent-protocol `SessionOverrides` (session.ts).\n\nEvery field must be allow-listed in Agent.overrides_allowed; unauthorized\nfields fail session creation loudly rather than being silently dropped.","properties":{"first_message":{"anyOf":[{"maxLength":10000,"type":"string"},{"type":"null"}],"default":null,"title":"First Message"},"first_message_prompt":{"anyOf":[{"maxLength":10000,"type":"string"},{"type":"null"}],"default":null,"title":"First Message Prompt"},"first_message_start":{"anyOf":[{"enum":["agent_first","wait_for_caller"],"type":"string"},{"type":"null"}],"default":null,"description":"When the opener plays in this session instead of the agent's `prompt.first_message_start`: `agent_first` or `wait_for_caller`. Rides the same `first_message` override switch. `wait_for_caller` is rejected with 422 when the agent's opener is off and the session brings no `first_message` or `first_message_prompt`.","title":"First Message Start"},"first_message_max_wait_ms":{"anyOf":[{"maximum":5000,"minimum":1000,"type":"integer"},{"type":"null"}],"default":null,"description":"Milliseconds (1000-5000) a `wait_for_caller` session waits before it speaks anyway, instead of the agent's `prompt.first_message_max_wait_ms`.","title":"First Message Max Wait Ms"},"first_message_interruptible":{"anyOf":[{"type":"boolean"},{"type":"null"}],"default":null,"description":"Whether the caller can cut the opener off in this session, instead of the agent's `prompt.first_message_interruptible`. `false` protects it: it always plays to the end and what the caller says meanwhile is dropped. Omit it or send `null` to keep the agent's value.","title":"First Message Interruptible"},"system_prompt":{"anyOf":[{"maxLength":500000,"type":"string"},{"type":"null"}],"default":null,"description":"Limited to 64000 tokens (o200k_base), 32000 when `llm.model` is `google/gemma-4-26b-a4b-it` (the agent's), same budget as the configured prompt it replaces.","title":"System Prompt"},"voice_id":{"anyOf":[{"maxLength":256,"type":"string"},{"type":"null"}],"default":null,"description":"The voice this session speaks instead of the agent's: a Voice Library voice or one of your clones by id, or one of the live3 speech model's own voices by its lowercase name (clara, nora, ...). A name on a session that runs on Fish TTS speaks the Voice Library counterpart of that voice.","title":"Voice Id"},"language":{"anyOf":[{"enum":["en","ja","zh","ko","es","fr","de","pt","it","nl","ar","hi","id","tr","ru","bg","sr","hr","cs","sk","pl","uk","ro","hu","el","sv","da","no","fi","et","lv","lt","ca","he","fa","ur","kk","ka","hy","bn","ta","te","kn","mr","gu","pa","ne","th","vi","ms","tl","af"],"type":"string"},{"type":"null"}],"default":null,"title":"Language"},"asr":{"anyOf":[{"$ref":"#/components/schemas/AgentSessionAsrOverridesPayload"},{"type":"null"}],"default":null},"llm":{"anyOf":[{"$ref":"#/components/schemas/AgentSessionLlmOverridesPayload"},{"type":"null"}],"default":null}},"title":"AgentSessionOverridesPayload","type":"object"},"AgentSessionAnalysisCriterionResult":{"properties":{"name":{"title":"Name","type":"string"},"result":{"enum":["success","failure","unknown"],"title":"Result","type":"string"},"rationale":{"default":"","title":"Rationale","type":"string"}},"required":["name","result"],"title":"AgentSessionAnalysisCriterionResult","type":"object"},"AgentSessionAnalysisDataValue":{"properties":{"name":{"title":"Name","type":"string"},"type":{"enum":["boolean","text","number","enum"],"title":"Type","type":"string"},"value":{"anyOf":[{"type":"boolean"},{"type":"number"},{"type":"string"},{"type":"null"}],"default":null,"title":"Value"},"rationale":{"default":"","title":"Rationale","type":"string"}},"required":["name","type"],"title":"AgentSessionAnalysisDataValue","type":"object"},"AgentSessionAnalysisResult":{"description":"The post-call analysis of the session.","properties":{"status":{"enum":["queued","running","completed","skipped","error"],"title":"Status","type":"string"},"summary":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Summary"},"data":{"items":{"$ref":"#/components/schemas/AgentSessionAnalysisDataValue"},"title":"Data","type":"array"},"criteria_results":{"items":{"$ref":"#/components/schemas/AgentSessionAnalysisCriterionResult"},"title":"Criteria Results","type":"array"},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"description":"error: why the analysis failed. Null for every other status.","title":"Error"},"transcript_incomplete":{"default":false,"description":"True when the transcript still looked cut short after the analysis waited for it, so the summary, data and criteria may rest on an incomplete conversation. Can be true for completed and skipped.","title":"Transcript Incomplete","type":"boolean"},"finished_at":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"description":"When the analysis finished, as an RFC 3339 timestamp in UTC, for example `2026-07-20T06:05:07.250000Z`. Null while it has not finished.","title":"Finished At"}},"required":["status"],"title":"AgentSessionAnalysisResult","type":"object"},"AgentSessionEngineFallback":{"description":"One time the session did not speak with the speech engine or the voice\nits agent is set up with. `from` is what it was set up with, `to` is what\nspoke instead.\n\n- unsupported_language: the speech engine does not speak the session's\n  language (live3 speaks English only), so the whole session was spoken\n  by the agent's text-to-speech model. `detail` is the session's language.\n- invalid_config: the speech engine refused the agent's voice settings,\n  so the whole session was spoken by the agent's text-to-speech model.\n  `message` is what the engine said.\n- engine_unavailable: the speech engine was not available, when the\n  session started or from `occurred_at` during it. Replies from\n  `occurred_at` on were spoken by the agent's text-to-speech model, which\n  is the whole session when the engine could not take it.\n- voice_unusable: the speech engine could not use the agent's voice, so\n  the session stayed on the engine and spoke in the voice `to` names.\n  When the cause is the voice itself, `detail` names it (for example\n  no_transcript, too_long, text_mismatch, no_clip or not_found) and\n  `message` is what the engine said.","properties":{"occurred_at":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Occurred At"},"from":{"$ref":"#/components/schemas/AgentSessionEngineRef"},"to":{"$ref":"#/components/schemas/AgentSessionEngineRef"},"reason":{"enum":["unsupported_language","invalid_config","engine_unavailable","voice_unusable"],"title":"Reason","type":"string"},"detail":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Detail"},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Message"}},"required":["from","to","reason"],"title":"AgentSessionEngineFallback","type":"object"},"AgentSessionEngineRef":{"description":"What a session speaks with, in the terms of the agent's `voice`\nsettings.","properties":{"engine":{"enum":["fish_tts","live3"],"title":"Engine","type":"string"},"tts_model":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Tts Model"},"voice_id":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Voice Id"}},"required":["engine"],"title":"AgentSessionEngineRef","type":"object"},"AgentSessionLatencySummary":{"description":"First-response latency of one turn, in whole milliseconds; null when\nit could not be measured.","properties":{"eou_ms":{"anyOf":[{"type":"integer"},{"type":"null"}],"default":null,"description":"Delay of the end-of-utterance decision.","title":"Eou Ms"},"llm_ms":{"anyOf":[{"type":"integer"},{"type":"null"}],"default":null,"description":"LLM time to first token.","title":"Llm Ms"},"tts_ms":{"anyOf":[{"type":"integer"},{"type":"null"}],"default":null,"description":"Speech synthesis time to first audio byte.","title":"Tts Ms"},"voice_to_voice_ms":{"anyOf":[{"type":"integer"},{"type":"null"}],"default":null,"description":"From the caller finishing speaking to the first agent audio.","title":"Voice To Voice Ms"}},"title":"AgentSessionLatencySummary","type":"object"},"AgentSessionLlmCustomRef":{"properties":{"base_url":{"title":"Base Url","type":"string"},"model":{"title":"Model","type":"string"}},"required":["base_url","model"],"title":"AgentSessionLlmCustomRef","type":"object"},"AgentSessionLlmEndpointError":{"description":"One failed reply from the customer's own LLM endpoint, after the\nplatform's single retry within the request, or one reply the model's\nprovider refused (a platform model's included).\n\n- http_error: the endpoint answered with a non-2xx status.\n- timeout: no response within the request timeout.\n- connection_error: the request got no answer. `reason` is dns_failed,\n  connection_refused, connection_reset, tls_failed, address_not_allowed\n  (an address the platform does not call) or unknown.\n- invalid_response: a 2xx response that was not a usable reply. `reason`\n  is not_event_stream (a streamed request answered with something else),\n  stream_incomplete (the stream ended without a finish_reason, usage or\n  output), empty_reply (no text and no tool call), refused (the model's\n  provider finished the reply as a refusal, a content filter or a policy\n  block: `response_body` is what it said) or unknown.","properties":{"occurred_at":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Occurred At"},"turn_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"default":null,"title":"Turn Id"},"type":{"enum":["http_error","timeout","connection_error","invalid_response"],"title":"Type","type":"string"},"reason":{"anyOf":[{"enum":["dns_failed","connection_refused","connection_reset","tls_failed","address_not_allowed","not_event_stream","stream_incomplete","empty_reply","refused","unknown"],"type":"string"},{"type":"null"}],"default":null,"title":"Reason"},"status_code":{"anyOf":[{"type":"integer"},{"type":"null"}],"default":null,"title":"Status Code"},"response_body":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Response Body"},"duration_ms":{"anyOf":[{"type":"integer"},{"type":"null"}],"default":null,"title":"Duration Ms"},"consecutive_failures":{"title":"Consecutive Failures","type":"integer"}},"required":["type","consecutive_failures"],"title":"AgentSessionLlmEndpointError","type":"object"},"AgentSessionLlmFallback":{"description":"One move of a reply to another model.\n\n- error: the model failed the request.\n- timeout: no reply within the platform's own time limit (outside manual;\n  in manual every model has a first-token limit, 5 seconds when not set).\n- ttft_timeout: no first token within the model's `ttft_timeout_ms`.\n- total_timeout: the reply, nothing of it spoken yet, not finished within\n  the model's `total_timeout_ms`.\n- empty: the model's response stream broke off with no output and no end\n  signal (a provider failure). A reply the model finished with nothing in\n  it is the agent staying silent, not a fallback.\n- refused: the model's provider finished the reply as a refusal with no\n  output (a content filter or a policy block), and the next model was\n  asked instead.\n- kick_in: running in parallel, the first fallback's reply was used\n  because the agent's own model had no first token within `kick_in_ms`.","properties":{"occurred_at":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Occurred At"},"turn_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"default":null,"title":"Turn Id"},"from":{"$ref":"#/components/schemas/AgentSessionLlmModelRef"},"to":{"$ref":"#/components/schemas/AgentSessionLlmModelRef"},"reason":{"enum":["error","timeout","ttft_timeout","total_timeout","empty","refused","kick_in"],"title":"Reason","type":"string"}},"required":["from","to","reason"],"title":"AgentSessionLlmFallback","type":"object"},"AgentSessionLlmModelRef":{"description":"A model as the agent config names it: a platform model id in `model`,\nor a customer endpoint in `custom` (never its key).","properties":{"model":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Model"},"custom":{"anyOf":[{"$ref":"#/components/schemas/AgentSessionLlmCustomRef"},{"type":"null"}],"default":null}},"title":"AgentSessionLlmModelRef","type":"object"},"AgentSessionMessageItem":{"description":"One transcript message; system messages never surface here.","properties":{"id":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Id"},"runtime_message_id":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Runtime Message Id"},"message_generation_id":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Message Generation Id"},"llm_usage":{"anyOf":[{"$ref":"#/components/schemas/LLMMessageUsage"},{"type":"null"}],"default":null},"type":{"const":"message","default":"message","title":"Type","type":"string"},"role":{"enum":["user","assistant"],"title":"Role","type":"string"},"content":{"title":"Content","type":"string"},"input_medium":{"anyOf":[{"const":"dtmf","type":"string"},{"type":"null"}],"default":null,"title":"Input Medium"},"fallback_reason":{"anyOf":[{"const":"llm_error","type":"string"},{"type":"null"}],"default":null,"title":"Fallback Reason"},"answered_by_model":{"anyOf":[{"$ref":"#/components/schemas/AgentSessionLlmModelRef"},{"type":"null"}],"default":null},"turn_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"default":null,"title":"Turn Id"},"created_at":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"description":"When the message was written to the session record, which is the order of the items. It is not when the message was said. An agent message is written once the agent has finished saying it, and a user message about a second after the user stopped speaking, once the platform has decided that their turn is over. `started_at` and `ended_at` are when the message was said.","title":"Created At"},"started_at":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"description":"When the message started to be said. Agent messages: the moment the platform began to play its first audio (for a reply sent as text, the moment its first text was sent). User messages: the first sound the platform heard in the user's turn. That can be several seconds before the words of the message, for example when the user said a short \"okay\" first, or \"hello\" as they picked up, which is not part of the message's text. Do not use it to measure how long the user spoke. On a session whose `voice.engine` is `live3`, an agent message starts where the user began to hear the agent answer after they stopped speaking: a short word of the voice's own (\"Okay,\") counts, even with a pause before the message's text, so it can be up to 2 seconds before that text. Null on a user message that was typed or entered on the keypad, on a line the agent did not say through its voice or its reply stream, on the messages of a `live3` session that the fallback voice said or that were sent as text, and on sessions recorded before the field existed.","title":"Started At"},"ended_at":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"description":"When the message stopped being said. Agent messages: the end of its audio, which includes the short silence the voice leaves at the end (about half a second, up to a second after a very long reply), or the moment its sound stopped when the message was interrupted. On a session whose `voice.engine` is `live3` it is the end of the agent's last sound, which fades out, so 0.1 to 0.5 seconds of it can be too faint to hear. User messages: the user's last sound before the platform decided that their turn was over. How long a user waited for the agent is the agent message's `started_at` minus the `ended_at` of the user message before it. Null in the same cases as `started_at`, and either of the two can be null on its own.","title":"Ended At"},"interrupted":{"anyOf":[{"type":"boolean"},{"type":"null"}],"default":null,"description":"True when this assistant reply was cut off before it finished; `content` is then roughly the part that was spoken and may run a few words past the point where playback stopped. Null on complete replies, on user messages and on messages from before the field existed (it is never false).","title":"Interrupted"},"interrupted_by":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"description":"What cut the reply off, set together with `interrupted`: `user_speech` (the caller talked over it), `user_message` (the user typed a message), `keypad` (a key press), `client` (your client sent an interrupt), `session_end` (the session ended mid-reply, for example the caller hung up). New values may be added, so treat unknown values as an unspecified cause. Null when `interrupted` is null, and on older cut-off replies that did not record a cause.","title":"Interrupted By"}},"required":["role","content"],"title":"AgentSessionMessageItem","type":"object"},"AgentSessionToolCallItem":{"description":"Tool invocation, mirroring the realtime `tool.started` event; `call_id`\nmatches the SDK event's callId, so live UIs and history line up.","properties":{"type":{"const":"tool_call","default":"tool_call","title":"Type","type":"string"},"call_id":{"title":"Call Id","type":"string"},"tool_name":{"title":"Tool Name","type":"string"},"tool_source":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Tool Source"},"input":{"title":"Input","type":"string"},"transfer_id":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"description":"Set when the agent made this tool call on a warm transfer's consult call, the call to the transfer destination while the caller is on hold. It is the `call_id` of that transfer item. Null for a tool call made in the conversation with the caller.","title":"Transfer Id"},"turn_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"default":null,"title":"Turn Id"},"created_at":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Created At"}},"required":["call_id","tool_name","input"],"title":"AgentSessionToolCallItem","type":"object"},"AgentSessionToolErrorDetail":{"description":"A failed tool call's structured reason, beside the `error` string.\nOnly `_transfer_call` fills it so far: `status_code` is then why the\ntransfer did not connect (not_placed, busy, no_answer, declined, voicemail,\nivr, hung_up, merge_failed or caller_hangup, the last when the caller hung\nup during the transfer). The gateway's keys, forwarded as they are.","properties":{"status_code":{"title":"Status Code","type":"string"},"sip_status":{"anyOf":[{"type":"integer"},{"type":"null"}],"default":null,"title":"Sip Status"},"status_message":{"title":"Status Message","type":"string"}},"required":["status_code","status_message"],"title":"AgentSessionToolErrorDetail","type":"object"},"AgentSessionToolResultItem":{"description":"Tool outcome (`tool.completed`/`tool.failed` twin). A call that never\nresolved (session died mid-flight) has no result item.","properties":{"type":{"const":"tool_result","default":"tool_result","title":"Type","type":"string"},"call_id":{"title":"Call Id","type":"string"},"tool_name":{"title":"Tool Name","type":"string"},"tool_source":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Tool Source"},"status":{"enum":["completed","failed"],"title":"Status","type":"string"},"output":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Output"},"output_truncated":{"default":false,"title":"Output Truncated","type":"boolean"},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Error"},"error_detail":{"anyOf":[{"$ref":"#/components/schemas/AgentSessionToolErrorDetail"},{"type":"null"}],"default":null},"rejected_by":{"anyOf":[{"const":"parameter_validation","type":"string"},{"type":"null"}],"default":null,"title":"Rejected By"},"transfer_id":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"description":"Set when the agent made this tool call on a warm transfer's consult call, the call to the transfer destination while the caller is on hold. It is the `call_id` of that transfer item. Null for a tool call made in the conversation with the caller.","title":"Transfer Id"},"latency_ms":{"anyOf":[{"type":"integer"},{"type":"null"}],"default":null,"title":"Latency Ms"},"turn_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"default":null,"title":"Turn Id"},"created_at":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Created At"}},"required":["call_id","tool_name","status"],"title":"AgentSessionToolResultItem","type":"object"},"AgentSessionTransferItem":{"description":"One transfer attempt. `call_id` matches its `_transfer_call` tool_call\nitem. A warm transfer's consult call (the caller on hold meanwhile) is in\n`messages`, never in the caller's message items. `merged` and `referred`\nsucceeded, and `outcome` is null while the attempt runs.","properties":{"type":{"const":"transfer","default":"transfer","title":"Type","type":"string"},"call_id":{"title":"Call Id","type":"string"},"destination":{"title":"Destination","type":"string"},"destination_type":{"enum":["phone","sip"],"title":"Destination Type","type":"string"},"target":{"title":"Target","type":"string"},"mode":{"enum":["cold","warm"],"title":"Mode","type":"string"},"warm_connect":{"anyOf":[{"enum":["confirm","briefing","direct"],"type":"string"},{"type":"null"}],"default":null,"title":"Warm Connect"},"outcome":{"anyOf":[{"enum":["merged","referred","dial_failed","declined","voicemail","ivr","consult_closed","consult_timeout","merge_failed","refer_failed","caller_hangup","cancelled","unavailable"],"type":"string"},{"type":"null"}],"default":null,"title":"Outcome"},"sip_status":{"anyOf":[{"type":"integer"},{"type":"null"}],"default":null,"description":"dial_failed and refer_failed: the final SIP response code the carrier gave. Null when it gave none.","title":"Sip Status"},"sip_reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"description":"dial_failed and refer_failed: the reason text the carrier or SIP server sent with sip_status, verbatim, for example `Proxy Authentication Required`. Null when it sent none.","title":"Sip Reason"},"dial_status":{"anyOf":[{"enum":["busy","no_answer","failed"],"type":"string"},{"type":"null"}],"default":null,"description":"dial_failed and refer_failed: why the transfer target could not be reached, classified from sip_status the same way as an outbound call's dial_status.","title":"Dial Status"},"decline_reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"description":"declined: the agent's summary of why the transfer target declined. Null when none was given. What they actually said is in messages.","title":"Decline Reason"},"consult_end_reason":{"anyOf":[{"enum":["transfer_target_hangup","connection_lost"],"type":"string"},{"type":"null"}],"default":null,"description":"consult_closed: how the consult call ended before the caller was connected. Null when it cannot be told.","title":"Consult End Reason"},"hold_started_at":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Hold Started At"},"hold_ended_at":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Hold Ended At"},"dial_started_at":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Dial Started At"},"answered_at":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Answered At"},"ended_at":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Ended At"},"transferred_call_ended_at":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"description":"merged and referred: when the call between the caller and the transfer target ended. Null while it is still on. A cold transfer waits for the carrier's call record (up to about an hour) and stays null on imported SIP numbers.","title":"Transferred Call Ended At"},"transferred_call_duration_seconds":{"anyOf":[{"type":"integer"},{"type":"null"}],"default":null,"description":"merged and referred: how long the caller talked with the transfer target. Warm: from ended_at to transferred_call_ended_at. Cold: the carrier's call record, 0 when the target never really answered.","title":"Transferred Call Duration Seconds"},"transferred_call_end_reason":{"anyOf":[{"enum":["caller_hangup","transfer_target_hangup","conversation_timeout","connection_lost"],"type":"string"},{"type":"null"}],"default":null,"description":"merged: how the call between the caller and the transfer target ended. caller_hangup: the caller hung up (on an outbound call, the person the agent called). transfer_target_hangup: the transfer target hung up. conversation_timeout: the call reached the agent's maximum call duration, counted from the start of the call. connection_lost: a line dropped, nobody hung up. Null when it cannot be told, and always null on a cold transfer.","title":"Transferred Call End Reason"},"messages":{"items":{"$ref":"#/components/schemas/AgentSessionTransferMessage"},"title":"Messages","type":"array"},"created_at":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Created At"}},"required":["call_id","destination","destination_type","target","mode"],"title":"AgentSessionTransferItem","type":"object"},"AgentSessionTransferMessage":{"description":"One line of a warm transfer's private consult call: `assistant` is the\nagent briefing, `transfer_target` the person it dialed.","properties":{"role":{"enum":["assistant","transfer_target"],"title":"Role","type":"string"},"content":{"title":"Content","type":"string"},"created_at":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"description":"When the line was written to the session record. An `assistant` line is written once the agent has finished saying it, so this is after the end of its speech: `started_at` is when the agent started to speak.","title":"Created At"},"started_at":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"description":"`assistant` lines: when the agent started to say it on the consult call, the moment the platform began to play its first audio. Measure the wait between the transfer's `answered_at` and the agent's briefing to this time, not to `created_at`. Null on `transfer_target` lines and on sessions recorded before the field existed.","title":"Started At"},"ended_at":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"description":"`assistant` lines: when the agent stopped saying it, the end of its audio, which includes the short silence the voice leaves at the end (about half a second), or the moment its sound stopped when it was interrupted. Null in the same cases as `started_at`.","title":"Ended At"}},"required":["role","content"],"title":"AgentSessionTransferMessage","type":"object"},"AgentSessionTurn":{"description":"What the platform measured for one conversation turn. The turn's\nmessages are in `items`, matched by `turn_id`.","properties":{"turn_id":{"title":"Turn Id","type":"integer"},"latency_summary":{"$ref":"#/components/schemas/AgentSessionLatencySummary"}},"required":["turn_id"],"title":"AgentSessionTurn","type":"object"},"LLMMessageTokenCost":{"properties":{"model":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Model"},"rate_version":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Rate Version"},"category":{"enum":["input","cache_read","cache_write_5m","cache_write_1h","output"],"title":"Category","type":"string"},"tokens":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Tokens"},"rate_per_million":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Rate Per Million"},"cost_usd":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Cost Usd"},"occurred_at":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}],"default":null,"title":"Occurred At"}},"required":["model","rate_version","category","tokens","rate_per_million","cost_usd"],"title":"LLMMessageTokenCost","type":"object"},"LLMMessageUsage":{"properties":{"message_generation_id":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Message Generation Id"},"turn_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"default":null,"title":"Turn Id"},"status":{"enum":["complete","pending","unavailable"],"title":"Status","type":"string"},"billing_mode":{"enum":["tokens","included","legacy"],"title":"Billing Mode","type":"string"},"call_count":{"default":0,"title":"Call Count","type":"integer"},"unbilled_call_count":{"default":0,"title":"Unbilled Call Count","type":"integer"},"usage_complete":{"default":false,"title":"Usage Complete","type":"boolean"},"call_ids":{"items":{"type":"string"},"title":"Call Ids","type":"array"},"cost_usd":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Cost Usd"},"billable_cost_usd":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Billable Cost Usd"},"known_cost_usd":{"default":"0","title":"Known Cost Usd","type":"string"},"tokens":{"items":{"$ref":"#/components/schemas/LLMMessageTokenCost"},"title":"Tokens","type":"array"}},"required":["status","billing_mode"],"title":"LLMMessageUsage","type":"object"},"AgentSessionRecordingTrackEntity":{"properties":{"role":{"enum":["agent","user","human"],"title":"Role","type":"string"},"status":{"enum":["requested","active","complete","failed"],"title":"Status","type":"string"},"url":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Url"},"expires_at":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}],"default":null,"title":"Expires At"},"duration_ms":{"anyOf":[{"type":"integer"},{"type":"null"}],"default":null,"title":"Duration Ms"},"started_at":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}],"default":null,"title":"Started At"},"ended_at":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}],"default":null,"title":"Ended At"},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Error"},"error_code":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Error Code"}},"required":["role","status"],"title":"AgentSessionRecordingTrackEntity","type":"object"},"AgentSessionTransferRecordingEntity":{"description":"A warm transfer's consult call, recorded apart from the caller, who\nwas on hold meanwhile. `transfer_id` is the transfer item's `call_id`.","properties":{"transfer_id":{"title":"Transfer Id","type":"string"},"status":{"enum":["processing","complete","failed"],"title":"Status","type":"string"},"tracks":{"items":{"$ref":"#/components/schemas/AgentSessionRecordingTrackEntity"},"title":"Tracks","type":"array"}},"required":["transfer_id","status","tracks"],"title":"AgentSessionTransferRecordingEntity","type":"object"},"PublicAgentEntity":{"properties":{"agent_id":{"title":"Agent Id","type":"string"},"workspace_id":{"title":"Workspace Id","type":"string"},"name":{"title":"Name","type":"string"},"description":{"default":"","title":"Description","type":"string"},"status":{"enum":["active","archived"],"title":"Status","type":"string"},"publication_state":{"description":"`live` once at least one version is published; `draft` agents cannot take sessions yet.","enum":["live","draft"],"title":"Publication State","type":"string"},"public_enabled":{"default":false,"title":"Public Enabled","type":"boolean"},"allowed_origins":{"items":{"type":"string"},"title":"Allowed Origins","type":"array"},"restrict_origins":{"default":false,"description":"Whether public access is limited to `allowed_origins`. When false, any origin can start a public session.","title":"Restrict Origins","type":"boolean"},"overrides_allowed":{"items":{"enum":["first_message","system_prompt","voice_id","language","asr.model","llm.fallback"],"type":"string"},"title":"Overrides Allowed","type":"array"},"created_at":{"format":"date-time","title":"Created At","type":"string"},"updated_at":{"format":"date-time","title":"Updated At","type":"string"}},"required":["agent_id","workspace_id","name","status","publication_state","created_at","updated_at"],"title":"PublicAgentEntity","type":"object"},"AgentBackchannelPatch":{"additionalProperties":false,"properties":{"enabled":{"anyOf":[{"type":"boolean"},{"type":"null"}],"default":null,"description":"Whether the agent backchannels. Default true. false turns them off: the agent may still add one now and then, and the first sound after the caller stops can come a little later.","title":"Enabled"},"strength":{"anyOf":[{"maximum":10,"minimum":1,"type":"integer"},{"type":"null"}],"default":null,"description":"How readily the agent backchannels, a whole number from 1 (rarely) to 10 (at nearly every pause). null (default): the speech engine's own setting, 6 on live3. Send null to go back to it. Not used while enabled is false.","title":"Strength"}},"title":"AgentBackchannelPatch","type":"object"},"AgentBackgroundSoundPayload":{"additionalProperties":false,"description":"Write shape: replaces voice.background_sound as a whole (AgentVoicePatch\nnull resets to the default). Strict, unlike the read model: a bad pairing\n422s instead of silently falling back.","properties":{"preset":{"default":"off","enum":["off","office","call_center","restaurant","cafe","city_street","phone_line","phone_line_digital","custom"],"title":"Preset","type":"string"},"volume":{"default":0.15,"maximum":1,"minimum":0,"title":"Volume","type":"number"},"custom_asset_id":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Custom Asset Id"}},"title":"AgentBackgroundSoundPayload","type":"object"},"AgentEchoGuardPatch":{"additionalProperties":false,"properties":{"web_voice":{"anyOf":[{"type":"boolean"},{"type":"null"}],"default":null,"description":"Voice calls in a browser or app (web widget, SDK, test calls). Null uses the default (on).","title":"Web Voice"},"phone_inbound":{"anyOf":[{"type":"boolean"},{"type":"null"}],"default":null,"description":"Inbound phone calls. Null uses the default (on).","title":"Phone Inbound"},"phone_outbound":{"anyOf":[{"type":"boolean"},{"type":"null"}],"default":null,"description":"Outbound phone calls. Null uses the default (off).","title":"Phone Outbound"}},"title":"AgentEchoGuardPatch","type":"object"},"AgentKeypadInputPatch":{"additionalProperties":false,"properties":{"enabled":{"default":false,"title":"Enabled","type":"boolean"},"terminator":{"default":"#","enum":["#","*","none"],"title":"Terminator","type":"string"},"inter_digit_timeout_seconds":{"default":2,"maximum":10,"minimum":1,"title":"Inter Digit Timeout Seconds","type":"integer"}},"title":"AgentKeypadInputPatch","type":"object"},"AgentKeypadMenuOptionPatch":{"additionalProperties":false,"properties":{"key":{"title":"Key","type":"string"},"value":{"title":"Value","type":"string"}},"required":["key","value"],"title":"AgentKeypadMenuOptionPatch","type":"object"},"AgentKeypadMenuPatch":{"additionalProperties":false,"properties":{"enabled":{"default":false,"title":"Enabled","type":"boolean"},"prompt":{"default":"","title":"Prompt","type":"string"},"options":{"default":[],"items":{"$ref":"#/components/schemas/AgentKeypadMenuOptionPatch"},"maxItems":12,"title":"Options","type":"array"},"accept_speech":{"default":true,"title":"Accept Speech","type":"boolean"},"variable":{"default":"menu_choice","title":"Variable","type":"string"},"no_input_timeout_seconds":{"default":5,"maximum":15,"minimum":2,"title":"No Input Timeout Seconds","type":"integer"},"max_attempts":{"default":2,"maximum":3,"minimum":1,"title":"Max Attempts","type":"integer"},"retry_message":{"default":"","title":"Retry Message","type":"string"},"fallback_value":{"default":"","title":"Fallback Value","type":"string"}},"title":"AgentKeypadMenuPatch","type":"object"},"AgentOutboundPatch":{"additionalProperties":false,"properties":{"amd_enabled":{"default":true,"title":"Amd Enabled","type":"boolean"},"voicemail":{"anyOf":[{"$ref":"#/components/schemas/AgentOutboundVoicemailPatch"},{"type":"null"}],"default":null}},"title":"AgentOutboundPatch","type":"object"},"AgentOutboundVoicemailPatch":{"additionalProperties":false,"properties":{"action":{"default":"hangup","enum":["hangup","leave_message","leave_prompt_message"],"title":"Action","type":"string"},"message":{"default":"","maxLength":10000,"title":"Message","type":"string"}},"title":"AgentOutboundVoicemailPatch","type":"object"},"AgentReengagePatch":{"additionalProperties":false,"properties":{"enabled":{"anyOf":[{"type":"boolean"},{"type":"null"}],"default":null,"description":"Whether the agent follows up when the caller stays silent (default false). `steps` sets when and what it says. Turning this off keeps the steps.","title":"Enabled"},"steps":{"anyOf":[{"items":{"$ref":"#/components/schemas/AgentReengageStepPatch"},"maxItems":10,"minItems":1,"type":"array"},{"type":"null"}],"default":null,"description":"The follow-ups the agent makes while the caller stays silent, in order, 1 to 10 steps. Used only while `enabled` is true. A new agent starts with two steps, after 8 and 10 seconds. When the caller speaks, the sequence starts over from the first step. Agents created before these settings existed keep their earlier behavior until changed: follow-ups after 5 and 10 seconds, then a hangup 10 seconds later. Replaces the whole list. Cannot be sent together with `schedule`.","title":"Steps"},"exhausted_action":{"anyOf":[{"enum":["wait","hangup"],"type":"string"},{"type":"null"}],"default":null,"description":"What happens when the last follow-up goes unanswered. `wait` (what a new agent starts with): the agent stays quiet until hangup_after_seconds ends the call. `hangup`: the agent hangs up after `exhausted_after_seconds` more seconds of silence. hangup_farewell_mode applies to either hangup. Agents created before this setting existed are on `hangup` until changed.","title":"Exhausted Action"},"exhausted_after_seconds":{"anyOf":[{"maximum":600,"minimum":3,"type":"integer"},{"type":"null"}],"default":null,"description":"Seconds of silence after the last follow-up before the agent hangs up, 3 to 600 seconds (default 10). Used only when `exhausted_action` is `hangup`.","title":"Exhausted After Seconds"},"schedule":{"anyOf":[{"$ref":"#/components/schemas/AgentReengageSchedulePatch"},{"type":"null"}],"default":null,"description":"Shorthand for evenly spaced follow-ups, accepted on writes only and never returned. It replaces `steps` with `count` steps (the first after `first_seconds`, each later one after `interval_seconds`) and sets `exhausted_after_seconds` to `interval_seconds` unless the same request sets it. `exhausted_action` stays as it is. Cannot be sent together with `steps`."}},"title":"AgentReengagePatch","type":"object"},"AgentReengageSchedulePatch":{"additionalProperties":false,"description":"Evenly spaced follow-ups, expanded into reengage.steps on write.","properties":{"first_seconds":{"description":"Seconds of silence, counted from the end of what the agent last said, before the first follow-up, 3 to 600 seconds.","maximum":600,"minimum":3,"title":"First Seconds","type":"integer"},"interval_seconds":{"description":"Seconds of silence after one follow-up before the next, 3 to 600 seconds.","maximum":600,"minimum":3,"title":"Interval Seconds","type":"integer"},"count":{"description":"How many follow-ups, 1 to 10.","maximum":10,"minimum":1,"title":"Count","type":"integer"},"messages":{"anyOf":[{"items":{"type":"string"},"maxItems":10,"type":"array"},{"type":"null"}],"default":null,"description":"Texts the agent says word for word, one per follow-up in order, at most `count` items, each with the limits of a step's message. With fewer items than `count` the last one repeats. Omit it and the agent words every follow-up itself.","title":"Messages"}},"required":["first_seconds","interval_seconds","count"],"title":"AgentReengageSchedulePatch","type":"object"},"AgentReengageStepPatch":{"additionalProperties":false,"properties":{"after_seconds":{"description":"Seconds of silence, counted from the end of what the agent last said, before this follow-up, 3 to 600 seconds.","maximum":600,"minimum":3,"title":"After Seconds","type":"integer"},"message":{"default":"","description":"Text the agent says word for word as this follow-up, at most 500 characters. `{{variable}}` placeholders are filled in for each session. \"\" (default) lets the agent word the follow-up itself.","title":"Message","type":"string"}},"required":["after_seconds"],"title":"AgentReengageStepPatch","type":"object"},"AgentTransferDestinationPatch":{"additionalProperties":false,"properties":{"type":{"default":"phone","enum":["phone","sip"],"title":"Type","type":"string"},"label":{"default":"","title":"Label","type":"string"},"phone_number":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"description":"Destination in E.164, for type `phone`. Calls through a number bought on the platform can only be transferred to the supported countries. A number in another country is dialed by your own carrier, so it needs an imported SIP number: any imported number for a cold transfer, one with termination configured for a warm transfer. Without such a number in the team the write is rejected. On a call through any other number the destination is left out, and the agent cannot transfer to it.","title":"Phone Number"},"sip_uri":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"description":"Destination for type `sip`: the SIP address to transfer the call to, written `sip:user@host[:port][;transport=udp|tcp|tls]`, for example `sip:support@pbx.example.com`. The host must be a public domain name or IP address, and a `sips:` URI uses TLS. The URI holds only the address, in at most 512 characters: a password, headers or any other parameter is rejected, so use `auth_username` and `auth_password` for credentials and `headers` for SIP headers. Dynamic variables are not supported in the URI.","title":"Sip Uri"},"headers":{"additionalProperties":{"type":"string"},"description":"SIP destinations only: custom SIP headers sent with the transferred call, as an object of header names and values, up to 20. A name starts with `X-` followed by letters, digits and hyphens, at most 64 characters in all, or is `User-to-User`. Names are not case-sensitive and `X-Fish-` names are reserved for headers the platform adds itself. A value is 1 to 1024 printable ASCII characters (128 for `User-to-User`) and can contain dynamic variables such as `{{customer_id}}`, filled in when the session starts. When a value cannot be filled in for a call, for example because a variable has no value and no default, the destination is left out of that call. A warm transfer sends the headers on the call the agent places to the destination. A cold transfer hands them to the caller's carrier, which decides whether to pass them on.","title":"Headers","type":"object"},"description":{"default":"","title":"Description","type":"string"},"mode":{"default":"cold","enum":["cold","warm"],"title":"Mode","type":"string"},"warm_connect":{"default":"confirm","enum":["confirm","briefing","direct"],"title":"Warm Connect","type":"string"},"warm_briefing_instructions":{"default":"","title":"Warm Briefing Instructions","type":"string"},"warm_briefing_speed":{"anyOf":[{"maximum":2.0,"minimum":0.5,"type":"number"},{"type":"null"}],"default":null,"title":"Warm Briefing Speed"},"warm_ring_timeout_seconds":{"default":30,"title":"Warm Ring Timeout Seconds","type":"integer"},"warm_confirm_timeout_seconds":{"default":60,"title":"Warm Confirm Timeout Seconds","type":"integer"},"warm_human_detection":{"default":false,"description":"Applies to warm transfers whose warm_connect is `confirm` or `briefing`, and is ignored for cold transfers and `direct`. When true, once the destination answers, the agent stays silent until the other side speaks, then classifies the pickup. A person is briefed as usual. Voicemail or an IVR (phone menu) ends the transfer as failed. A hold queue or silence keeps the agent waiting until `warm_confirm_timeout_seconds` ends the attempt as unreachable. A failed transfer follows `on_failure`. Leave it off for destinations whose people are only reachable through a phone menu, because the menu stops the transfer.","title":"Warm Human Detection","type":"boolean"},"warm_press_keys":{"$ref":"#/components/schemas/AgentTransferPressKeysPatch","description":"Beta. Key presses on the call in which the agent reaches this destination, for a number that an automated phone menu answers before a person does. Applies to warm transfers whose warm_connect is `confirm` or `briefing`, and is ignored for cold transfers and `direct`. It has no effect while warm_human_detection is true, because that setting ends the transfer when a phone menu answers. The time spent in the menu counts toward `warm_confirm_timeout_seconds`, so such a destination usually needs a longer one. Absent means off. The list of destinations is replaced as a whole, so a destination sent without the field has it off."},"warm_consult_uses_agent_settings":{"default":true,"description":"Compatibility option for warm transfers whose warm_connect is `confirm` or `briefing`, ignored for cold transfers and `direct`. Absent or true (recommended): on the call in which the agent briefs the destination, the agent uses the same turn-taking (response timing: `eagerness`, `response_wait_ms` and `response_max_wait_ms`), interruption (`interruption_sensitivity` and `interruption_ignore_phrases`) and language (`voice.speaking_language`) settings as on the call with the caller. False: that call keeps the older fixed behavior. Destinations that existed before this setting were set to false so their behavior did not change. Either way the destination can always interrupt the agent on that call, whatever `interruptible` is set to. A destination sent without the field keeps the value of the existing destination it replaces (same label, else a renamed one with the same phone number or SIP URI) and is true when it is new. Send true to switch a destination to the agent's settings.","title":"Warm Consult Uses Agent Settings","type":"boolean"},"on_failure":{"$ref":"#/components/schemas/AgentTransferOnFailurePatch"},"announcement_mode":{"default":"generated","enum":["generated","fixed","off"],"title":"Announcement Mode","type":"string"},"announcement_message":{"default":"","title":"Announcement Message","type":"string"},"auth_username":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"description":"SIP destinations in `warm` mode only: the digest username the destination's SIP server asks for. The agent places the call to a warm destination itself and answers the server's 401 or 407 challenge with this username and the stored password. A response that carries it means a password is stored. A `cold` destination sent with it is rejected: a cold transfer hands the call to the caller's carrier, which dials the destination and never has the credentials. Send null or an empty string to remove the credentials. A destination sent without the field keeps the credentials of the existing destination it replaces (same label, else a renamed one with the same SIP URI) while it stays a warm SIP destination on the same host and port, and loses them otherwise.","title":"Auth Username"},"auth_password":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"description":"Write-only digest password that goes with `auth_username`. It is stored encrypted and no response ever returns it. Omit it, or send an empty string, to keep the password already stored for a destination with the same SIP host and port and the same `auth_username`. It is required when the destination is new or its host, port or username changed. Sending the password that is already stored changes nothing. A new password takes effect on calls once the agent is published.","title":"Auth Password"}},"title":"AgentTransferDestinationPatch","type":"object"},"AgentTransferOnFailurePatch":{"additionalProperties":false,"properties":{"action":{"default":"return_to_agent","enum":["return_to_agent","end_call"],"title":"Action","type":"string"},"message":{"default":"","title":"Message","type":"string"}},"title":"AgentTransferOnFailurePatch","type":"object"},"AgentTransferPressKeysPatch":{"additionalProperties":false,"properties":{"enabled":{"default":false,"description":"When true, on the call to this destination the agent can press phone keys to get through the menu (`_press_keys`), and stay silent while the menu or a hold message plays (`_skip_turn`), before it briefs the person who answers. It works the same whether the caller's own call is inbound or outbound, and does not depend on `tools.system_tools.press_keys`.","title":"Enabled","type":"boolean"},"instructions":{"default":"","description":"How to get through this number's phone menu, written for the agent, such as `Press 2 for billing, then enter extension 204.` Optional, at most 500 characters. `{{variable}}` placeholders are filled in for each session. Without it the agent picks keys from the destination's label and description and from what the caller asked for. Used only while enabled is true, and kept when it is false.","title":"Instructions","type":"string"}},"title":"AgentTransferPressKeysPatch","type":"object"},"AgentTurnDetectorPatch":{"additionalProperties":false,"properties":{"model":{"anyOf":[{"enum":["fish","legacy"],"type":"string"},{"type":"null"}],"default":null,"description":"The model that judges the end of the caller's turn. `fish` is Fish Audio's turn detection model. It waits for the end of the caller's thought, so a caller who pauses between two sentences or between groups of digits is less often answered in the middle. `legacy` is the earlier model. It answers sooner after a sentence that sounds complete. The default is `fish`. An account whose agents ran the earlier model before this setting existed has `legacy` as its default, so they behave as they did. An agent that never set the model reads the default, and a new agent is created with it.","title":"Model"}},"title":"AgentTurnDetectorPatch","type":"object"},"PublicAgentAnalysisCriterion":{"additionalProperties":false,"properties":{"name":{"pattern":"^[a-z][a-z0-9_]{0,63}$","title":"Name","type":"string"},"description":{"default":"","maxLength":500,"title":"Description","type":"string"}},"required":["name"],"title":"PublicAgentAnalysisCriterion","type":"object"},"PublicAgentAnalysisDataField":{"additionalProperties":false,"properties":{"name":{"pattern":"^[a-z][a-z0-9_]{0,63}$","title":"Name","type":"string"},"type":{"default":"text","enum":["boolean","text","number","enum"],"title":"Type","type":"string"},"description":{"default":"","maxLength":500,"title":"Description","type":"string"},"enum_options":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"default":null,"title":"Enum Options"}},"required":["name"],"title":"PublicAgentAnalysisDataField","type":"object"},"PublicAgentAnalysisPatch":{"additionalProperties":false,"properties":{"summary":{"anyOf":[{"$ref":"#/components/schemas/PublicAgentAnalysisSummaryPatch"},{"type":"null"}],"default":null},"data_fields":{"anyOf":[{"items":{"$ref":"#/components/schemas/PublicAgentAnalysisDataField"},"maxItems":20,"type":"array"},{"type":"null"}],"default":null,"title":"Data Fields"},"criteria":{"anyOf":[{"items":{"$ref":"#/components/schemas/PublicAgentAnalysisCriterion"},"maxItems":10,"type":"array"},{"type":"null"}],"default":null,"title":"Criteria"}},"title":"PublicAgentAnalysisPatch","type":"object"},"PublicAgentAnalysisSummaryPatch":{"additionalProperties":false,"properties":{"enabled":{"default":true,"title":"Enabled","type":"boolean"},"prompt":{"anyOf":[{"maxLength":1000,"type":"string"},{"type":"null"}],"default":null,"title":"Prompt"},"language":{"default":"en","enum":["en","ja","zh","ko","es","fr","de","pt","it","nl","ar","hi","id","tr","ru","bg","sr","hr","cs","sk","pl","uk","ro","hu","el","sv","da","no","fi","et","lv","lt","ca","he","fa","ur","kk","ka","hy","bn","ta","te","kn","mr","gu","pa","ne","th","vi","ms","tl","af"],"title":"Language","type":"string"}},"title":"PublicAgentAnalysisSummaryPatch","type":"object"},"PublicAgentAsrPatch":{"additionalProperties":false,"properties":{"model":{"anyOf":[{"enum":["deepgram:nova-3","elevenlabs:scribe_v2_realtime","elevenlabs:scribe_v2_medical","fish_audio:transcribe-stream-1","fish_audio:transcribe-stream-2","fish_audio:transcribe-stream-1-dev"],"type":"string"},{"type":"null"}],"default":null,"title":"Model"},"multilingual":{"anyOf":[{"type":"boolean"},{"type":"null"}],"default":null,"title":"Multilingual"},"strict_language":{"anyOf":[{"type":"boolean"},{"type":"null"}],"default":null,"description":"Enforces voice.speaking_language whatever multilingual says: speech recognized as another language reaches the agent as [unintelligible speech]. Language is detected per utterance, so a short or heavily accented phrase in the speaking language can occasionally be detected as another language and replaced too. With deepgram:nova-3, speech in another language is usually not transcribed at all. Only enable it when you explicitly need to stop the agent from understanding other languages.","title":"Strict Language"},"keyterms":{"anyOf":[{"items":{"type":"string"},"maxItems":50,"type":"array"},{"type":"null"}],"default":null,"title":"Keyterms"}},"title":"PublicAgentAsrPatch","type":"object"},"PublicAgentConfigPatchPayload":{"additionalProperties":false,"properties":{"prompt":{"anyOf":[{"$ref":"#/components/schemas/PublicAgentPromptPatch"},{"type":"null"}],"default":null},"voice":{"anyOf":[{"$ref":"#/components/schemas/PublicAgentVoicePatch"},{"type":"null"}],"default":null},"asr":{"anyOf":[{"$ref":"#/components/schemas/PublicAgentAsrPatch"},{"type":"null"}],"default":null},"conversation":{"anyOf":[{"$ref":"#/components/schemas/PublicAgentConversationPatch"},{"type":"null"}],"default":null},"tools":{"anyOf":[{"$ref":"#/components/schemas/PublicAgentToolsPatch"},{"type":"null"}],"default":null},"webhooks":{"anyOf":[{"$ref":"#/components/schemas/PublicAgentWebhooksPatch"},{"type":"null"}],"default":null},"knowledge_base":{"anyOf":[{"$ref":"#/components/schemas/PublicAgentKnowledgeBasePatch"},{"type":"null"}],"default":null},"analysis":{"anyOf":[{"$ref":"#/components/schemas/PublicAgentAnalysisPatch"},{"type":"null"}],"default":null},"guardrails":{"anyOf":[{"$ref":"#/components/schemas/PublicAgentGuardrailsPatch"},{"type":"null"}],"default":null},"context":{"anyOf":[{"$ref":"#/components/schemas/PublicAgentContextPatch"},{"type":"null"}],"default":null},"llm":{"anyOf":[{"$ref":"#/components/schemas/PublicAgentLLMPatch"},{"type":"null"}],"default":null},"variables":{"anyOf":[{"$ref":"#/components/schemas/PublicAgentVariablesPatch"},{"type":"null"}],"default":null,"description":"Default values for the {{placeholders}} in the configured text, used when the session supplies none (the map replaces as a whole), and on_missing for a placeholder with neither: keep leaves it as written (default), empty renders it as empty text, reject refuses the session."}},"title":"PublicAgentConfigPatchPayload","type":"object"},"PublicAgentContextPatch":{"additionalProperties":false,"properties":{"current_time":{"anyOf":[{"type":"boolean"},{"type":"null"}],"default":null,"title":"Current Time"}},"title":"PublicAgentContextPatch","type":"object"},"PublicAgentConversationPatch":{"additionalProperties":false,"properties":{"max_duration_seconds":{"anyOf":[{"maximum":3600,"minimum":60,"type":"integer"},{"type":"null"}],"default":null,"title":"Max Duration Seconds"},"response_wait_ms":{"anyOf":[{"maximum":2000,"minimum":300,"type":"integer"},{"type":"null"}],"default":null,"title":"Response Wait Ms"},"eagerness":{"anyOf":[{"enum":["relaxed","balanced","eager"],"type":"string"},{"type":"null"}],"default":null,"title":"Eagerness"},"response_max_wait_ms":{"anyOf":[{"maximum":4000,"minimum":0,"type":"integer"},{"type":"null"}],"default":null,"title":"Response Max Wait Ms"},"interruptible":{"anyOf":[{"type":"boolean"},{"type":"null"}],"default":null,"title":"Interruptible"},"interruption_sensitivity":{"anyOf":[{"enum":["low","balanced","high","immediate"],"type":"string"},{"type":"null"}],"default":null,"description":"How much caller speech counts as an interruption while the agent speaks. With `low` the agent stops only for a firm, worded interjection and talks through background noise and short acknowledgements. `balanced` (default) interrupts on normal speech. With `high` the agent stops on the caller's first word. With `immediate` the agent stops at the caller's first sound, so backchannels such as \"okay\" and \"yeah\" stop it too, and it picks up where it stopped when the caller was only backchanneling or did not take the turn. `immediate` is only available to teams it has been enabled for, other teams get a 403 when they set it.","title":"Interruption Sensitivity"},"interruption_ignore_phrases":{"anyOf":[{"items":{"type":"string"},"maxItems":50,"type":"array"},{"type":"null"}],"default":null,"title":"Interruption Ignore Phrases"},"backchannel":{"anyOf":[{"$ref":"#/components/schemas/AgentBackchannelPatch"},{"type":"null"}],"default":null,"description":"The agent's backchannels: a short \"mm-hmm\" or \"okay\" when the caller pauses. Applies to speech engines that backchannel, which is live3 today, and is ignored on the others. Fields you leave out keep their value."},"speculative_response":{"anyOf":[{"type":"boolean"},{"type":"null"}],"default":null,"title":"Speculative Response"},"reengage":{"anyOf":[{"$ref":"#/components/schemas/AgentReengagePatch"},{"type":"null"}],"default":null,"description":"Silence follow-ups: whether the agent speaks up while the caller stays silent, when, what it says, and what happens after the last follow-up. Fields you send replace the stored value, fields you leave out are kept."},"hangup_after_seconds":{"anyOf":[{"maximum":3600,"minimum":10,"type":"integer"},{"type":"null"}],"default":null,"title":"Hangup After Seconds"},"hangup_farewell_mode":{"anyOf":[{"enum":["generated","fixed","off"],"type":"string"},{"type":"null"}],"default":null,"description":"What the agent says before a silence hangup. `off` (default) hangs up without a word, `generated` says a short goodbye, `fixed` says hangup_farewell_message. A `fixed` mode with an empty message falls back to `generated`. If the caller speaks during the goodbye, the call goes on.","title":"Hangup Farewell Mode"},"hangup_farewell_message":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"description":"The goodbye said verbatim in the `fixed` hangup_farewell_mode, at most 500 characters. `{{variable}}` placeholders are filled in for each session. \"\" clears it.","title":"Hangup Farewell Message"},"record_audio":{"anyOf":[{"type":"boolean"},{"type":"null"}],"default":null,"title":"Record Audio"},"timezone":{"anyOf":[{"maxLength":64,"type":"string"},{"type":"null"}],"default":null,"title":"Timezone"},"transfer_destinations":{"anyOf":[{"items":{"$ref":"#/components/schemas/AgentTransferDestinationPatch"},"type":"array"},{"type":"null"}],"default":null,"title":"Transfer Destinations"},"transfer_refuse_questions":{"anyOf":[{"type":"boolean"},{"type":"null"}],"default":null,"title":"Transfer Refuse Questions"},"outbound":{"anyOf":[{"$ref":"#/components/schemas/AgentOutboundPatch"},{"type":"null"}],"default":null},"keypad_menu":{"anyOf":[{"$ref":"#/components/schemas/AgentKeypadMenuPatch"},{"type":"null"}],"default":null},"keypad_input":{"anyOf":[{"$ref":"#/components/schemas/AgentKeypadInputPatch"},{"type":"null"}],"default":null},"echo_guard":{"anyOf":[{"$ref":"#/components/schemas/AgentEchoGuardPatch"},{"type":"null"}],"default":null,"description":"Echo guard. For the first 3 seconds after the agent first starts talking in a call, the caller cannot interrupt it and anything the caller says while the agent is talking is not heard. This stops the agent's own voice, echoing back from a speakerphone or laptop, from cutting it off. Per channel: true on, false off, null uses the default (on for web_voice and phone_inbound, off for phone_outbound). Channels you send replace the stored value, null on a channel resets it to the default, channels you leave out are kept. null resets every channel."},"turn_detector":{"anyOf":[{"$ref":"#/components/schemas/AgentTurnDetectorPatch"},{"type":"null"}],"default":null,"description":"Turn detector: how the agent decides the caller has finished speaking, so it can answer. Applies to agents whose `voice.engine` is `fish_tts`. It has no effect when `asr.model` is a Fish realtime model (`fish_audio:transcribe-stream-1` or `fish_audio:transcribe-stream-2`), which detects the end of the turn itself. Fields you send replace the stored values, fields you leave out are kept. null on a field, or for the whole object, goes back to the default, which the response reports."}},"title":"PublicAgentConversationPatch","type":"object"},"PublicAgentCreatePayload":{"additionalProperties":false,"properties":{"name":{"maxLength":120,"minLength":1,"title":"Name","type":"string"},"description":{"default":"","maxLength":2000,"title":"Description","type":"string"},"config":{"anyOf":[{"$ref":"#/components/schemas/PublicAgentConfigPatchPayload"},{"type":"null"}],"default":null,"description":"Optional initial draft configuration, applied atop the platform defaults; one call provisions a fully configured agent."}},"required":["name"],"title":"PublicAgentCreatePayload","type":"object"},"PublicAgentGuardrailsPatch":{"additionalProperties":false,"properties":{"focus":{"anyOf":[{"type":"boolean"},{"type":"null"}],"default":null,"title":"Focus"},"manipulation":{"anyOf":[{"type":"boolean"},{"type":"null"}],"default":null,"title":"Manipulation"},"pre_tool_speech":{"anyOf":[{"type":"boolean"},{"type":"null"}],"default":null,"title":"Pre Tool Speech"}},"title":"PublicAgentGuardrailsPatch","type":"object"},"PublicAgentKnowledgeBasePatch":{"additionalProperties":false,"properties":{"enabled":{"anyOf":[{"type":"boolean"},{"type":"null"}],"default":null,"description":"Whether the agent retrieves from its attached sources. Defaults to true when omitted alongside a non-empty knowledge_source_ids; send false explicitly to attach sources without using them yet.","title":"Enabled"},"knowledge_source_ids":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"default":null,"description":"Replaces the attached knowledge sources wholesale. Every id must be an existing knowledge source visible to the agent, else 422.","title":"Knowledge Source Ids"}},"title":"PublicAgentKnowledgeBasePatch","type":"object"},"PublicAgentLLMCustomConfig":{"additionalProperties":false,"properties":{"base_url":{"maxLength":2000,"minLength":1,"title":"Base Url","type":"string"},"model":{"maxLength":256,"minLength":1,"title":"Model","type":"string"},"api_key":{"anyOf":[{"maxLength":4096,"minLength":1,"type":"string"},{"type":"null"}],"default":null,"description":"Sent to your endpoint as the Authorization bearer token; write-only, reads return null. Required when introducing `custom`; omit to keep the stored key when updating.","title":"Api Key"},"headers":{"anyOf":[{"additionalProperties":{"type":"string"},"type":"object"},{"type":"null"}],"default":null,"description":"Extra headers sent on every request to your endpoint, such as `x-vercel-protection-bypass`. Reads return the stored map. Omit to keep the stored headers, `{}` clears them.","title":"Headers"}},"required":["base_url","model"],"title":"PublicAgentLLMCustomConfig","type":"object"},"PublicAgentLLMFallback":{"additionalProperties":false,"properties":{"mode":{"enum":["platform","manual","off"],"title":"Mode","type":"string"},"models":{"anyOf":[{"items":{"$ref":"#/components/schemas/PublicAgentLLMFallbackModel"},"type":"array"},{"type":"null"}],"default":null,"description":"Fallback models in order, 1 to 3. Only with mode `manual`.","title":"Models"},"primary":{"anyOf":[{"$ref":"#/components/schemas/AgentLLMTimeoutsPayload"},{"type":"null"}],"default":null,"description":"The agent's own model's timeouts. Only with mode `manual`."}},"required":["mode"],"title":"PublicAgentLLMFallback","type":"object"},"PublicAgentLLMFallbackModel":{"additionalProperties":false,"properties":{"model":{"anyOf":[{"enum":["google/gemini-3.5-flash-lite","google/gemini-3.6-flash","google/gemini-3.8-flash","google/gemini-3.6-flash-priority","google/gemini-3.8-flash-priority","google/gemini-3.5-flash-lite-priority","google/gemini-4-hydrogen","google/gemini-4-neon","google/gemini-4-hydrogen-priority","google/gemini-4-neon-priority","google/gemini-2.5-flash","google/gemma-4-26b-a4b-it","anthropic/claude-haiku-4.5","anthropic/claude-sonnet-4.6","anthropic/claude-sonnet-5.5","anthropic/claude-opus-5.5","anthropic/claude-fable-5.1","anthropic/claude-fable-5.2","openai/gpt-5.6-luna","openai/gpt-6-luna","openai/gpt-5","openai/gpt-6.1-sol","openai/gpt-6.1-terra","openai/gpt-6-astra","openai/gpt-6.2-sol","openai/gpt-4o","openai/gpt-4.1","openai/gpt-5.6-luna-fast","openai/gpt-6-luna-fast","openai/gpt-6.1-terra-fast","openai/gpt-6.1-sol-fast","openai/gpt-6-astra-fast","openai/gpt-6.2-sol-fast","openai/gpt-4o-fast","openai/gpt-4.1-fast"],"type":"string"},{"type":"null"}],"default":null,"title":"Model"},"custom":{"anyOf":[{"$ref":"#/components/schemas/PublicAgentLLMCustomConfig"},{"type":"null"}],"default":null,"description":"A customer endpoint, with the same rules as `llm.custom`. Omit `api_key` to keep the stored key of the fallback with the same `base_url` and `model`."},"ttft_timeout_ms":{"anyOf":[{"maximum":30000,"minimum":500,"type":"integer"},{"type":"null"}],"default":null,"description":"Milliseconds the model gets to start its reply (first text or tool call). Past it, the reply moves to the next fallback model. Not set: defaults to 5000 ms (5 seconds).","title":"Ttft Timeout Ms"},"total_timeout_ms":{"anyOf":[{"maximum":120000,"minimum":1000,"type":"integer"},{"type":"null"}],"default":null,"description":"Milliseconds the model gets to finish its reply. Past it, a reply nothing of which was spoken yet moves to the next fallback model; one already being spoken fails like any failed reply. At least `ttft_timeout_ms` when both are set. Not set: no limit.","title":"Total Timeout Ms"},"parallel":{"anyOf":[{"$ref":"#/components/schemas/AgentLLMParallelPayload"},{"type":"null"}],"default":null,"description":"First entry only: request this model together with the agent's own model. Both requests bill their tokens."}},"title":"PublicAgentLLMFallbackModel","type":"object"},"PublicAgentLLMPatch":{"additionalProperties":false,"properties":{"model":{"anyOf":[{"enum":["google/gemini-3.5-flash-lite","google/gemini-3.6-flash","google/gemini-3.8-flash","google/gemini-3.6-flash-priority","google/gemini-3.8-flash-priority","google/gemini-3.5-flash-lite-priority","google/gemini-4-hydrogen","google/gemini-4-neon","google/gemini-4-hydrogen-priority","google/gemini-4-neon-priority","google/gemini-2.5-flash","google/gemma-4-26b-a4b-it","anthropic/claude-haiku-4.5","anthropic/claude-sonnet-4.6","anthropic/claude-sonnet-5.5","anthropic/claude-opus-5.5","anthropic/claude-fable-5.1","anthropic/claude-fable-5.2","openai/gpt-5.6-luna","openai/gpt-6-luna","openai/gpt-5","openai/gpt-6.1-sol","openai/gpt-6.1-terra","openai/gpt-6-astra","openai/gpt-6.2-sol","openai/gpt-4o","openai/gpt-4.1","openai/gpt-5.6-luna-fast","openai/gpt-6-luna-fast","openai/gpt-6.1-terra-fast","openai/gpt-6.1-sol-fast","openai/gpt-6-astra-fast","openai/gpt-6.2-sol-fast","openai/gpt-4o-fast","openai/gpt-4.1-fast"],"type":"string"},{"type":"null"}],"default":null,"title":"Model"},"custom":{"anyOf":[{"$ref":"#/components/schemas/PublicAgentLLMCustomConfig"},{"type":"null"}],"default":null,"description":"Your own OpenAI-compatible endpoint; mutually exclusive with `model`, explicit null reverts to the platform model."},"fallback":{"anyOf":[{"$ref":"#/components/schemas/PublicAgentLLMFallback"},{"type":"null"}],"default":null,"description":"What the agent tries after its model fails. `platform` (default): the platform's built-in fallback for platform models, none for `custom`. `manual`: `models` in order. `off`: no other model. Replaces the whole fallback; null means `platform`."}},"title":"PublicAgentLLMPatch","type":"object"},"PublicAgentPromptPatch":{"additionalProperties":false,"properties":{"system_prompt":{"anyOf":[{"maxLength":500000,"type":"string"},{"type":"null"}],"default":null,"description":"Limited to 64000 tokens (o200k_base), 32000 when `llm.model` is `google/gemma-4-26b-a4b-it`; keeping it under 2000 tokens is recommended for latency and cost.","title":"System Prompt"},"first_message_mode":{"anyOf":[{"enum":["off","fixed","prompt"],"type":"string"},{"type":"null"}],"default":null,"title":"First Message Mode"},"first_message":{"anyOf":[{"maxLength":10000,"type":"string"},{"type":"null"}],"default":null,"title":"First Message"},"first_message_prompt":{"anyOf":[{"maxLength":10000,"type":"string"},{"type":"null"}],"default":null,"title":"First Message Prompt"},"first_message_start":{"anyOf":[{"enum":["agent_first","wait_for_caller"],"type":"string"},{"type":"null"}],"default":null,"description":"When the opener plays. `agent_first` (default): the agent speaks as soon as the call connects. `wait_for_caller`: the agent waits for the caller to speak first and plays the opener anyway once `first_message_max_wait_ms` has passed. `wait_for_caller` needs a `fixed` or `prompt` opener: with `first_message_mode` `off` the write is rejected with 422, and the stored values stay as they were. With a `fixed` opener the agent speaks after the caller does, or when the wait runs out; with a `prompt` opener it answers what the caller said first.","title":"First Message Start"},"first_message_max_wait_ms":{"anyOf":[{"maximum":5000,"minimum":1000,"type":"integer"},{"type":"null"}],"default":null,"description":"Milliseconds (1000-5000, default 3000) a `wait_for_caller` agent waits before it speaks anyway. Stored but has no effect while `first_message_start` is `agent_first`.","title":"First Message Max Wait Ms"},"first_message_interruptible":{"anyOf":[{"type":"boolean"},{"type":"null"}],"default":null,"description":"Whether the caller can cut the opener off. `true`: interruptible. `false`: protected, the opener always plays to the end and what the caller says meanwhile is dropped, not answered afterwards. `null` or omitted (default): interruptible, the same as `true`. It does not follow `conversation.interruptible`. Reads always return `true` or `false`.","title":"First Message Interruptible"}},"title":"PublicAgentPromptPatch","type":"object"},"PublicAgentToolsPatch":{"additionalProperties":false,"properties":{"enabled":{"anyOf":[{"type":"boolean"},{"type":"null"}],"default":null,"title":"Enabled"},"tool_ids":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"default":null,"description":"Replaces the attached tool set wholesale. Every id must be an existing tool in the agent's workspace, else 422.","title":"Tool Ids"},"system_tools":{"anyOf":[{"$ref":"#/components/schemas/PublicSystemToolsPatch"},{"type":"null"}],"default":null}},"title":"PublicAgentToolsPatch","type":"object"},"PublicAgentVariablesPatch":{"additionalProperties":false,"properties":{"defaults":{"anyOf":[{"additionalProperties":{"anyOf":[{"type":"string"},{"type":"integer"},{"type":"number"},{"type":"boolean"}]},"type":"object"},{"type":"null"}],"default":null,"title":"Defaults"},"on_missing":{"anyOf":[{"enum":["keep","empty","reject"],"type":"string"},{"type":"null"}],"default":null,"title":"On Missing"}},"title":"PublicAgentVariablesPatch","type":"object"},"PublicAgentVoicePatch":{"additionalProperties":false,"properties":{"voice_id":{"anyOf":[{"maxLength":256,"type":"string"},{"type":"null"}],"default":null,"description":"The agent's voice: a Voice Library voice or one of your clones by id, or with engine live3 one of the speech model's own voices by its lowercase name (clara, nora, owen, marco, milo, jonah, harper, patricia, and for the DT situation maddie, ethan, tyler, brianna). A name is rejected while the engine is fish_tts. When a session of an agent on one of the names runs on Fish TTS (another language, or the speech model unavailable), it speaks a Voice Library counterpart of that voice.","title":"Voice Id"},"speaking_language":{"anyOf":[{"enum":["en","ja","zh","ko","es","fr","de","pt","it","nl","ar","hi","id","tr","ru","bg","sr","hr","cs","sk","pl","uk","ro","hu","el","sv","da","no","fi","et","lv","lt","ca","he","fa","ur","kk","ka","hy","bn","ta","te","kn","mr","gu","pa","ne","th","vi","ms","tl","af"],"type":"string"},{"type":"null"}],"default":null,"title":"Speaking Language"},"expressive":{"anyOf":[{"type":"boolean"},{"type":"null"}],"default":null,"title":"Expressive"},"speed":{"anyOf":[{"maximum":2.0,"minimum":0.5,"type":"number"},{"type":"null"}],"default":null,"title":"Speed"},"tts_model":{"anyOf":[{"enum":["s2.1-pro","drama-3"],"type":"string"},{"type":"null"}],"default":null,"title":"Tts Model"},"engine":{"anyOf":[{"enum":["fish_tts","live3"],"type":"string"},{"type":"null"}],"default":null,"description":"Speech engine. live3 (the default for new agents) puts the Fish full-duplex speech model on the call: it listens while it speaks and takes turns on its own. English only: sessions in another language run on fish_tts. fish_tts speaks the model's text through Fish TTS in the agent's voice, and is what agents from before the engine existed run. While the engine is live3, speech recognition is managed automatically by the platform, and switching to live3 turns asr.multilingual on unless the same patch sets it. An agent still on the default voice also starts on the speech model's voice Clara at the switch, unless it had one of the speech model's voices before or the same patch picks a voice. An agent with a voice of its own keeps speaking it.","title":"Engine"},"live3_prompt":{"anyOf":[{"maxLength":64,"type":"string"},{"type":"null"}],"default":null,"description":"live3 only. The situation the speech model speaks in: P2 (phone support), DT (drive-thru) or AIR (airline). Empty: the default. Ignored on fish_tts.","title":"Live3 Prompt"},"effect":{"anyOf":[{"enum":["none","phone","intercom"],"type":"string"},{"type":"null"}],"default":null,"description":"How the agent's voice sounds on web calls (the console test call, the widget, the SDK). none (default): the clean voice. phone: a handset line, the 300 to 3400 Hz band with the codec's grain. intercom: a small overdriven speaker, as at a drive-thru order post or a door intercom. Phone and WhatsApp calls already sound like a line and ignore it.","title":"Effect"},"pronunciation_dictionary_ids":{"anyOf":[{"items":{"type":"string"},"maxItems":3,"type":"array"},{"type":"null"}],"default":null,"title":"Pronunciation Dictionary Ids"},"background_sound":{"anyOf":[{"$ref":"#/components/schemas/AgentBackgroundSoundPayload"},{"type":"null"}],"default":null,"description":"A looping ambience the worker mixes under the agent's voice. volume is the ambience's gain relative to the agent's voice, 0–1 (default 0.15). custom_asset_id names an uploaded clip (POST /agent/background-sounds) and is required with preset \"custom\", refused otherwise. Replaces the whole object; null resets to off."}},"title":"PublicAgentVoicePatch","type":"object"},"PublicAgentWebhooksPatch":{"additionalProperties":false,"properties":{"conversation_init":{"anyOf":[{"$ref":"#/components/schemas/PublicConversationInitWebhookPayload"},{"type":"null"}],"default":null,"description":"Pre-call webhook for inbound phone calls: called while the call is being set up; the response's dynamic_variables render into the published prompt before the agent speaks. An explicit null removes it. Takes effect after the next publish."},"post_call":{"anyOf":[{"items":{"$ref":"#/components/schemas/PublicPostCallWebhookPayload"},"maxItems":5,"type":"array"},{"type":"null"}],"default":null,"description":"Up to 5 endpoints, each receiving every post-call event. Replaces the configured list wholesale; a single object is still accepted and is stored as a one-element list, and null (or an empty list) clears every endpoint. URLs must be unique.","title":"Post Call"}},"title":"PublicAgentWebhooksPatch","type":"object"},"PublicConversationInitWebhookPayload":{"additionalProperties":false,"properties":{"url":{"maxLength":4000,"minLength":1,"title":"Url","type":"string"},"secret":{"anyOf":[{"maxLength":256,"type":"string"},{"type":"null"}],"default":null,"description":"Optional HMAC-SHA256 signing secret (X-Fish-Webhook-Signature). Write-only: reads report `has_secret` instead of the value. Omit it (or send null) to keep the secret already stored for the same url; send an empty string to remove it.","title":"Secret"},"keep_previous_secret_for_seconds":{"anyOf":[{"maximum":604800,"minimum":0,"type":"integer"},{"type":"null"}],"default":null,"description":"Secret rotation. When `secret` replaces the stored secret, the replaced one keeps signing as a second `v1` for this many seconds (at most 7 days), so your endpoint can switch without dropping a delivery. Omit it to switch at once. With the secret kept, 0 ends an open rotation window and any other value is ignored. Takes effect after the next publish.","title":"Keep Previous Secret For Seconds"},"timeout_seconds":{"default":5.0,"description":"How long the platform waits for the endpoint before connecting the call without variables.","maximum":8.0,"minimum":1.0,"title":"Timeout Seconds","type":"number"}},"required":["url"],"title":"PublicConversationInitWebhookPayload","type":"object"},"PublicPostCallWebhookPayload":{"additionalProperties":false,"properties":{"url":{"maxLength":4000,"minLength":1,"title":"Url","type":"string"},"secret":{"anyOf":[{"maxLength":256,"type":"string"},{"type":"null"}],"default":null,"description":"Optional HMAC-SHA256 signing secret (X-Fish-Webhook-Signature). Write-only: reads report `has_secret` instead of the value. Omit it (or send null) to keep the secret already stored for the same url; send an empty string to remove it.","title":"Secret"},"keep_previous_secret_for_seconds":{"anyOf":[{"maximum":604800,"minimum":0,"type":"integer"},{"type":"null"}],"default":null,"description":"Secret rotation. When `secret` replaces the stored secret, the replaced one keeps signing as a second `v1` for this many seconds (at most 7 days), so your endpoint can switch without dropping a delivery. Omit it to switch at once. With the secret kept, 0 ends an open rotation window and any other value is ignored. Takes effect after the next publish.","title":"Keep Previous Secret For Seconds"}},"required":["url"],"title":"PublicPostCallWebhookPayload","type":"object"},"PublicPressKeysPatch":{"additionalProperties":false,"properties":{"enabled":{"anyOf":[{"type":"boolean"},{"type":"null"}],"default":null,"description":"When true, the agent gets two tools on outbound phone calls. `_press_keys` presses phone keys to get through an automated phone menu, and `_skip_turn` stays silent for a turn while a menu or a hold message plays. An agent test on the `phone_outbound` channel has them as well. Inbound calls and web and API sessions ignore it.","title":"Enabled"}},"title":"PublicPressKeysPatch","type":"object"},"PublicSystemToolsPatch":{"additionalProperties":false,"properties":{"hang_up_call":{"anyOf":[{"type":"boolean"},{"type":"null"}],"default":null,"title":"Hang Up Call"},"hang_up_call_farewell_mode":{"anyOf":[{"enum":["generated","fixed","off"],"type":"string"},{"type":"null"}],"default":null,"title":"Hang Up Call Farewell Mode"},"hang_up_call_farewell_message":{"anyOf":[{"maxLength":1000,"type":"string"},{"type":"null"}],"default":null,"title":"Hang Up Call Farewell Message"},"hang_up_call_refuse_questions":{"anyOf":[{"type":"boolean"},{"type":"null"}],"default":null,"title":"Hang Up Call Refuse Questions"},"press_keys":{"anyOf":[{"$ref":"#/components/schemas/PublicPressKeysPatch"},{"type":"null"}],"default":null,"description":"Beta. Key presses on outbound phone calls, for calls that reach an automated phone menu before a person. The fields sent are written, the others stay as they are."}},"title":"PublicSystemToolsPatch","type":"object"},"PublicAgentUpdatePayload":{"additionalProperties":false,"properties":{"name":{"anyOf":[{"maxLength":120,"minLength":1,"type":"string"},{"type":"null"}],"default":null,"title":"Name"},"description":{"anyOf":[{"maxLength":2000,"type":"string"},{"type":"null"}],"default":null,"title":"Description"},"status":{"anyOf":[{"enum":["active","archived"],"type":"string"},{"type":"null"}],"default":null,"title":"Status"},"public_enabled":{"anyOf":[{"type":"boolean"},{"type":"null"}],"default":null,"description":"Allow keyless session creation from the browser SDK. Any origin can start a session unless restrict_origins is true.","title":"Public Enabled"},"allowed_origins":{"anyOf":[{"items":{"type":"string"},"maxItems":20,"type":"array"},{"type":"null"}],"default":null,"description":"Origins that may start public sessions while restrict_origins is true. Setting this without restrict_origins on an agent that never chose it turns the restriction on.","title":"Allowed Origins"},"restrict_origins":{"anyOf":[{"type":"boolean"},{"type":"null"}],"default":null,"description":"Limit public access to allowed_origins. With an empty list, every public request is rejected.","title":"Restrict Origins"},"overrides_allowed":{"anyOf":[{"items":{"enum":["first_message","system_prompt","voice_id","language","asr.model","llm.fallback"],"type":"string"},"maxItems":8,"type":"array"},{"type":"null"}],"default":null,"description":"Which session-creation overrides callers may use. An empty list rejects all overrides.","title":"Overrides Allowed"}},"title":"PublicAgentUpdatePayload","type":"object"},"AgentAnalysisConfig":{"properties":{"summary":{"$ref":"#/components/schemas/AgentAnalysisSummaryConfig"},"data_fields":{"items":{"$ref":"#/components/schemas/AgentAnalysisDataField"},"maxItems":20,"title":"Data Fields","type":"array"},"criteria":{"items":{"$ref":"#/components/schemas/AgentAnalysisCriterion"},"maxItems":10,"title":"Criteria","type":"array"}},"title":"AgentAnalysisConfig","type":"object"},"AgentAnalysisCriterion":{"properties":{"name":{"pattern":"^[a-z][a-z0-9_]{0,63}$","title":"Name","type":"string"},"description":{"default":"","maxLength":500,"title":"Description","type":"string"}},"required":["name"],"title":"AgentAnalysisCriterion","type":"object"},"AgentAnalysisDataField":{"properties":{"name":{"pattern":"^[a-z][a-z0-9_]{0,63}$","title":"Name","type":"string"},"type":{"default":"text","enum":["boolean","text","number","enum"],"title":"Type","type":"string"},"description":{"default":"","maxLength":500,"title":"Description","type":"string"},"enum_options":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"default":null,"title":"Enum Options"}},"required":["name"],"title":"AgentAnalysisDataField","type":"object"},"AgentAnalysisSummaryConfig":{"properties":{"enabled":{"default":true,"title":"Enabled","type":"boolean"},"prompt":{"anyOf":[{"maxLength":1000,"type":"string"},{"type":"null"}],"default":null,"title":"Prompt"},"language":{"default":"en","enum":["en","ja","zh","ko","es","fr","de","pt","it","nl","ar","hi","id","tr","ru","bg","sr","hr","cs","sk","pl","uk","ro","hu","el","sv","da","no","fi","et","lv","lt","ca","he","fa","ur","kk","ka","hy","bn","ta","te","kn","mr","gu","pa","ne","th","vi","ms","tl","af"],"title":"Language","type":"string"}},"title":"AgentAnalysisSummaryConfig","type":"object"},"AgentBackchannelConfig":{"description":"The agent's own backchannels, on a speech engine that makes them. Named\nfor what the agent does, not for the engine, so the next engine that\nbackchannels reads the same object.","properties":{"enabled":{"default":true,"description":"Whether the agent backchannels. Default true. false turns them off: the agent may still add one now and then, and the first sound after the caller stops can come a little later.","title":"Enabled","type":"boolean"},"strength":{"anyOf":[{"maximum":10,"minimum":1,"type":"integer"},{"type":"null"}],"default":null,"description":"How readily the agent backchannels, a whole number from 1 (rarely) to 10 (at nearly every pause). null (default): the speech engine's own setting, 6 on live3. Send null to go back to it. Not used while enabled is false.","title":"Strength"}},"title":"AgentBackchannelConfig","type":"object"},"AgentBackgroundSoundConfig":{"description":"Stored/read shape. Lenient like the rest of voice: a broken shape (a\npairing a later write could never produce) reads as off rather than\nraising, so a row never fails to load. An asset later soft-deleted is not\na broken shape — the session build drops it and logs a warning, this\nconfig keeps naming it.","properties":{"preset":{"default":"off","enum":["off","office","call_center","restaurant","cafe","city_street","phone_line","phone_line_digital","custom"],"title":"Preset","type":"string"},"volume":{"default":0.15,"maximum":1,"minimum":0,"title":"Volume","type":"number"},"custom_asset_id":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Custom Asset Id"}},"title":"AgentBackgroundSoundConfig","type":"object"},"AgentContextConfig":{"description":"Facts the platform tells the agent on its own, one switch per fact.\nThe same mechanism as a guardrail with the opposite sign: a guardrail is\na prompt addition that constrains, a context switch is one that informs.","properties":{"current_time":{"default":true,"title":"Current Time","type":"boolean"}},"title":"AgentContextConfig","type":"object"},"AgentConversationConfig":{"properties":{"max_duration_seconds":{"default":1800,"title":"Max Duration Seconds","type":"integer"},"response_wait_ms":{"default":550,"title":"Response Wait Ms","type":"integer"},"eagerness":{"default":"balanced","enum":["relaxed","balanced","eager"],"title":"Eagerness","type":"string"},"response_max_wait_ms":{"anyOf":[{"type":"integer"},{"type":"null"}],"default":null,"title":"Response Max Wait Ms"},"interruptible":{"default":true,"title":"Interruptible","type":"boolean"},"interruption_sensitivity":{"default":"balanced","description":"How much caller speech counts as an interruption while the agent speaks. With `low` the agent stops only for a firm, worded interjection and talks through background noise and short acknowledgements. `balanced` (default) interrupts on normal speech. With `high` the agent stops on the caller's first word. With `immediate` the agent stops at the caller's first sound, so backchannels such as \"okay\" and \"yeah\" stop it too, and it picks up where it stopped when the caller was only backchanneling or did not take the turn. `immediate` is only available to teams it has been enabled for, other teams get a 403 when they set it.","enum":["low","balanced","high","immediate"],"title":"Interruption Sensitivity","type":"string"},"interruption_ignore_phrases":{"default":[],"items":{"type":"string"},"title":"Interruption Ignore Phrases","type":"array"},"backchannel":{"$ref":"#/components/schemas/AgentBackchannelConfig","description":"The agent's backchannels: a short \"mm-hmm\" or \"okay\" when the caller pauses. Applies to speech engines that backchannel, which is live3 today, and is ignored on the others."},"speculative_response":{"default":true,"title":"Speculative Response","type":"boolean"},"reengage":{"$ref":"#/components/schemas/AgentReengageConfig","description":"Silence follow-ups: whether the agent speaks up while the caller stays silent, when, what it says, and what happens after the last follow-up."},"hangup_after_seconds":{"default":60,"title":"Hangup After Seconds","type":"integer"},"hangup_farewell_mode":{"default":"off","description":"What the agent says before a silence hangup. `off` (default) hangs up without a word, `generated` says a short goodbye, `fixed` says hangup_farewell_message. A `fixed` mode with an empty message falls back to `generated`. If the caller speaks during the goodbye, the call goes on.","enum":["generated","fixed","off"],"title":"Hangup Farewell Mode","type":"string"},"hangup_farewell_message":{"default":"","description":"The goodbye said verbatim in the `fixed` hangup_farewell_mode, at most 500 characters. `{{variable}}` placeholders are filled in for each session. \"\" clears it.","title":"Hangup Farewell Message","type":"string"},"record_audio":{"default":true,"title":"Record Audio","type":"boolean"},"timezone":{"default":"","title":"Timezone","type":"string"},"transfer_destinations":{"default":[],"items":{"$ref":"#/components/schemas/AgentTransferDestination"},"title":"Transfer Destinations","type":"array"},"transfer_refuse_questions":{"default":true,"title":"Transfer Refuse Questions","type":"boolean"},"outbound":{"anyOf":[{"$ref":"#/components/schemas/AgentOutboundConfig"},{"type":"null"}],"default":null},"keypad_menu":{"$ref":"#/components/schemas/AgentKeypadMenu"},"keypad_input":{"$ref":"#/components/schemas/AgentKeypadInput"},"echo_guard":{"anyOf":[{"$ref":"#/components/schemas/AgentEchoGuard"},{"type":"null"}],"default":null,"description":"Echo guard. For the first 3 seconds after the agent first starts talking in a call, the caller cannot interrupt it and anything the caller says while the agent is talking is not heard. This stops the agent's own voice, echoing back from a speakerphone or laptop, from cutting it off. Per channel: true on, false off, null uses the default (on for web_voice and phone_inbound, off for phone_outbound)."},"turn_detector":{"anyOf":[{"$ref":"#/components/schemas/AgentTurnDetector"},{"type":"null"}],"default":null,"description":"Turn detector: how the agent decides the caller has finished speaking, so it can answer. Applies to agents whose `voice.engine` is `fish_tts`. It has no effect when `asr.model` is a Fish realtime model (`fish_audio:transcribe-stream-1` or `fish_audio:transcribe-stream-2`), which detects the end of the turn itself."}},"title":"AgentConversationConfig","type":"object"},"AgentEchoGuard":{"description":"Echo guard per call channel: true on, false off, null uses the default.","properties":{"web_voice":{"anyOf":[{"type":"boolean"},{"type":"null"}],"default":null,"description":"Voice calls in a browser or app (web widget, SDK, test calls). Null uses the default (on).","title":"Web Voice"},"phone_inbound":{"anyOf":[{"type":"boolean"},{"type":"null"}],"default":null,"description":"Inbound phone calls. Null uses the default (on).","title":"Phone Inbound"},"phone_outbound":{"anyOf":[{"type":"boolean"},{"type":"null"}],"default":null,"description":"Outbound phone calls. Null uses the default (off).","title":"Phone Outbound"}},"title":"AgentEchoGuard","type":"object"},"AgentGuardrailsConfig":{"properties":{"focus":{"default":false,"title":"Focus","type":"boolean"},"manipulation":{"default":false,"title":"Manipulation","type":"boolean"},"pre_tool_speech":{"default":false,"title":"Pre Tool Speech","type":"boolean"}},"title":"AgentGuardrailsConfig","type":"object"},"AgentKeypadInput":{"description":"Keypad input for phone calls: digits the caller types during the\nconversation reach the agent as one user turn, ended by `terminator` or\nby a pause of `inter_digit_timeout_seconds` (`none`: the pause only).","properties":{"enabled":{"default":false,"title":"Enabled","type":"boolean"},"terminator":{"default":"#","enum":["#","*","none"],"title":"Terminator","type":"string"},"inter_digit_timeout_seconds":{"default":2,"title":"Inter Digit Timeout Seconds","type":"integer"}},"title":"AgentKeypadInput","type":"object"},"AgentKeypadMenu":{"description":"Keypad menu for inbound phone calls. Before the agent's first turn it\nspeaks `prompt` in the agent's voice, collects one key press (or, with\n`accept_speech`, the option's value said aloud) and stores the chosen\noption's `value` in the dynamic variable named by `variable`. The system\nprompt, first message, transfer texts, farewell and webhook tools can use\n`{{variable}}` to act on the choice. Outbound calls, web, API and test\nsessions skip the menu, and the variable renders from its default.","properties":{"enabled":{"default":false,"title":"Enabled","type":"boolean"},"prompt":{"default":"","title":"Prompt","type":"string"},"options":{"default":[],"items":{"$ref":"#/components/schemas/AgentKeypadMenuOption"},"title":"Options","type":"array"},"accept_speech":{"default":true,"title":"Accept Speech","type":"boolean"},"variable":{"default":"menu_choice","title":"Variable","type":"string"},"no_input_timeout_seconds":{"default":5,"title":"No Input Timeout Seconds","type":"integer"},"max_attempts":{"default":2,"title":"Max Attempts","type":"integer"},"retry_message":{"default":"","title":"Retry Message","type":"string"},"fallback_value":{"default":"","title":"Fallback Value","type":"string"}},"title":"AgentKeypadMenu","type":"object"},"AgentKeypadMenuOption":{"properties":{"key":{"default":"","title":"Key","type":"string"},"value":{"default":"","title":"Value","type":"string"}},"title":"AgentKeypadMenuOption","type":"object"},"AgentLLMConfigRedacted":{"properties":{"model":{"default":"openai/gpt-6.1-terra-fast","enum":["google/gemini-3.5-flash-lite","google/gemini-3.6-flash","google/gemini-3.8-flash","google/gemini-3.6-flash-priority","google/gemini-3.8-flash-priority","google/gemini-3.5-flash-lite-priority","google/gemini-4-hydrogen","google/gemini-4-neon","google/gemini-4-hydrogen-priority","google/gemini-4-neon-priority","google/gemini-2.5-flash","google/gemma-4-26b-a4b-it","anthropic/claude-haiku-4.5","anthropic/claude-sonnet-4.6","anthropic/claude-sonnet-5.5","anthropic/claude-opus-5.5","anthropic/claude-fable-5.1","anthropic/claude-fable-5.2","openai/gpt-5.6-luna","openai/gpt-6-luna","openai/gpt-5","openai/gpt-6.1-sol","openai/gpt-6.1-terra","openai/gpt-6-astra","openai/gpt-6.2-sol","openai/gpt-4o","openai/gpt-4.1","openai/gpt-5.6-luna-fast","openai/gpt-6-luna-fast","openai/gpt-6.1-terra-fast","openai/gpt-6.1-sol-fast","openai/gpt-6-astra-fast","openai/gpt-6.2-sol-fast","openai/gpt-4o-fast","openai/gpt-4.1-fast"],"title":"Model","type":"string"},"custom":{"anyOf":[{"$ref":"#/components/schemas/AgentLLMCustomConfigRedacted"},{"type":"null"}],"default":null},"fallback":{"$ref":"#/components/schemas/AgentLLMFallbackRedacted"}},"title":"AgentLLMConfigRedacted","type":"object"},"AgentLLMCustomConfigRedacted":{"description":"Read entity: the stored api_key never leaves the collection. The headers\nread back as stored, like the non-credential headers of a webhook tool.","properties":{"base_url":{"minLength":1,"title":"Base Url","type":"string"},"model":{"minLength":1,"title":"Model","type":"string"},"api_key":{"default":null,"title":"Api Key","type":"null"},"headers":{"anyOf":[{"additionalProperties":{"type":"string"},"type":"object"},{"type":"null"}],"default":null,"title":"Headers"}},"required":["base_url","model"],"title":"AgentLLMCustomConfigRedacted","type":"object"},"AgentLLMFallbackModelRedacted":{"properties":{"model":{"anyOf":[{"enum":["google/gemini-3.5-flash-lite","google/gemini-3.6-flash","google/gemini-3.8-flash","google/gemini-3.6-flash-priority","google/gemini-3.8-flash-priority","google/gemini-3.5-flash-lite-priority","google/gemini-4-hydrogen","google/gemini-4-neon","google/gemini-4-hydrogen-priority","google/gemini-4-neon-priority","google/gemini-2.5-flash","google/gemma-4-26b-a4b-it","anthropic/claude-haiku-4.5","anthropic/claude-sonnet-4.6","anthropic/claude-sonnet-5.5","anthropic/claude-opus-5.5","anthropic/claude-fable-5.1","anthropic/claude-fable-5.2","openai/gpt-5.6-luna","openai/gpt-6-luna","openai/gpt-5","openai/gpt-6.1-sol","openai/gpt-6.1-terra","openai/gpt-6-astra","openai/gpt-6.2-sol","openai/gpt-4o","openai/gpt-4.1","openai/gpt-5.6-luna-fast","openai/gpt-6-luna-fast","openai/gpt-6.1-terra-fast","openai/gpt-6.1-sol-fast","openai/gpt-6-astra-fast","openai/gpt-6.2-sol-fast","openai/gpt-4o-fast","openai/gpt-4.1-fast"],"type":"string"},{"type":"null"}],"default":null,"title":"Model"},"custom":{"anyOf":[{"$ref":"#/components/schemas/AgentLLMCustomConfigRedacted"},{"type":"null"}],"default":null},"ttft_timeout_ms":{"anyOf":[{"type":"integer"},{"type":"null"}],"default":null,"title":"Ttft Timeout Ms"},"total_timeout_ms":{"anyOf":[{"type":"integer"},{"type":"null"}],"default":null,"title":"Total Timeout Ms"},"parallel":{"anyOf":[{"$ref":"#/components/schemas/AgentLLMParallel"},{"type":"null"}],"default":null}},"title":"AgentLLMFallbackModelRedacted","type":"object"},"AgentLLMFallbackRedacted":{"properties":{"mode":{"default":"platform","enum":["platform","manual","off"],"title":"Mode","type":"string"},"models":{"anyOf":[{"items":{"$ref":"#/components/schemas/AgentLLMFallbackModelRedacted"},"type":"array"},{"type":"null"}],"default":null,"title":"Models"},"primary":{"anyOf":[{"$ref":"#/components/schemas/AgentLLMTimeouts"},{"type":"null"}],"default":null}},"title":"AgentLLMFallbackRedacted","type":"object"},"AgentLLMParallel":{"properties":{"kick_in_ms":{"default":1500,"title":"Kick In Ms","type":"integer"}},"title":"AgentLLMParallel","type":"object"},"AgentLLMTimeouts":{"description":"How long one model gets per reply (manual only), read model.","properties":{"ttft_timeout_ms":{"anyOf":[{"type":"integer"},{"type":"null"}],"default":null,"title":"Ttft Timeout Ms"},"total_timeout_ms":{"anyOf":[{"type":"integer"},{"type":"null"}],"default":null,"title":"Total Timeout Ms"}},"title":"AgentLLMTimeouts","type":"object"},"AgentOutboundConfig":{"description":"Deprecated (2026-09-07): kept for compatibility only. `amd_enabled` and\n`voicemail` no longer change call behavior; outbound calls greet as soon as\nthe callee answers, and `answered_by` is always `unknown`.","properties":{"amd_enabled":{"default":true,"title":"Amd Enabled","type":"boolean"},"voicemail":{"anyOf":[{"$ref":"#/components/schemas/AgentOutboundVoicemailConfig"},{"type":"null"}],"default":null}},"title":"AgentOutboundConfig","type":"object"},"AgentOutboundVoicemailConfig":{"description":"Deprecated (2026-09-07): answering-machine detection was removed from the\ncall runtime, so voicemail actions never fire. The node is still accepted\nand stored so existing configs and API callers keep working; the worker\nno longer receives it.","properties":{"action":{"default":"hangup","enum":["hangup","leave_message","leave_prompt_message"],"title":"Action","type":"string"},"message":{"default":"","title":"Message","type":"string"}},"title":"AgentOutboundVoicemailConfig","type":"object"},"AgentPressKeysConfig":{"properties":{"enabled":{"default":false,"description":"When true, the agent gets two tools on outbound phone calls. `_press_keys` presses phone keys to get through an automated phone menu, and `_skip_turn` stays silent for a turn while a menu or a hold message plays. An agent test on the `phone_outbound` channel has them as well. Inbound calls and web and API sessions ignore it.","title":"Enabled","type":"boolean"}},"title":"AgentPressKeysConfig","type":"object"},"AgentPromptConfigView":{"description":"The prompt section as a read returns it: the opener's interruption choice\nis always `true` or `false`. Nothing is stored for it (a stored `null` and\na row from before the field both read `true`), so a write and the config\nhash are untouched.","properties":{"system_prompt":{"default":"","title":"System Prompt","type":"string"},"first_message_mode":{"default":"prompt","enum":["off","fixed","prompt"],"title":"First Message Mode","type":"string"},"first_message":{"default":"Hi! Thanks for calling — how can I help you today?","title":"First Message","type":"string"},"first_message_prompt":{"default":"Greet the caller and ask what you can help with.","title":"First Message Prompt","type":"string"},"first_message_start":{"default":"agent_first","description":"When the opener plays. `agent_first` (default): the agent speaks as soon as the call connects. `wait_for_caller`: the agent waits for the caller to speak first and plays the opener anyway once `first_message_max_wait_ms` has passed. `wait_for_caller` needs a `fixed` or `prompt` opener: with `first_message_mode` `off` the write is rejected with 422, and the stored values stay as they were. With a `fixed` opener the agent speaks after the caller does, or when the wait runs out; with a `prompt` opener it answers what the caller said first.","enum":["agent_first","wait_for_caller"],"title":"First Message Start","type":"string"},"first_message_max_wait_ms":{"default":3000,"description":"Milliseconds (1000-5000, default 3000) a `wait_for_caller` agent waits before it speaks anyway. Stored but has no effect while `first_message_start` is `agent_first`.","maximum":5000,"minimum":1000,"title":"First Message Max Wait Ms","type":"integer"},"first_message_interruptible":{"default":true,"description":"Whether the caller can cut the opener off. `true`: interruptible. `false`: protected, the opener always plays to the end and what the caller says meanwhile is dropped, not answered afterwards. `null` or omitted (default): interruptible, the same as `true`. It does not follow `conversation.interruptible`. Reads always return `true` or `false`.","title":"First Message Interruptible","type":"boolean"}},"title":"AgentPromptConfigView","type":"object"},"AgentReengageConfig":{"description":"Silence follow-ups. The defaults are the legacy values, what the\nruntime did before the object existed, so a stored config without it\nkeeps that behavior. New agents are created with NEW_AGENT_REENGAGE. The\ndefault factories keep the legacy values out of the public schema.","properties":{"enabled":{"default":false,"description":"Whether the agent follows up when the caller stays silent (default false). `steps` sets when and what it says. Turning this off keeps the steps.","title":"Enabled","type":"boolean"},"steps":{"description":"The follow-ups the agent makes while the caller stays silent, in order, 1 to 10 steps. Used only while `enabled` is true. A new agent starts with two steps, after 8 and 10 seconds. When the caller speaks, the sequence starts over from the first step. Agents created before these settings existed keep their earlier behavior until changed: follow-ups after 5 and 10 seconds, then a hangup 10 seconds later.","items":{"$ref":"#/components/schemas/AgentReengageStep"},"title":"Steps","type":"array"},"exhausted_action":{"description":"What happens when the last follow-up goes unanswered. `wait` (what a new agent starts with): the agent stays quiet until hangup_after_seconds ends the call. `hangup`: the agent hangs up after `exhausted_after_seconds` more seconds of silence. hangup_farewell_mode applies to either hangup. Agents created before this setting existed are on `hangup` until changed.","enum":["wait","hangup"],"title":"Exhausted Action","type":"string"},"exhausted_after_seconds":{"default":10,"description":"Seconds of silence after the last follow-up before the agent hangs up, 3 to 600 seconds (default 10). Used only when `exhausted_action` is `hangup`.","title":"Exhausted After Seconds","type":"integer"}},"title":"AgentReengageConfig","type":"object"},"AgentReengageStep":{"description":"One follow-up while the caller stays silent.","properties":{"after_seconds":{"description":"Seconds of silence, counted from the end of what the agent last said, before this follow-up, 3 to 600 seconds.","title":"After Seconds","type":"integer"},"message":{"default":"","description":"Text the agent says word for word as this follow-up, at most 500 characters. `{{variable}}` placeholders are filled in for each session. \"\" (default) lets the agent word the follow-up itself.","title":"Message","type":"string"}},"required":["after_seconds"],"title":"AgentReengageStep","type":"object"},"AgentSystemToolsConfig":{"properties":{"hang_up_call":{"default":false,"title":"Hang Up Call","type":"boolean"},"hang_up_call_farewell_mode":{"default":"generated","enum":["generated","fixed","off"],"title":"Hang Up Call Farewell Mode","type":"string"},"hang_up_call_farewell_message":{"default":"","title":"Hang Up Call Farewell Message","type":"string"},"hang_up_call_refuse_questions":{"default":false,"title":"Hang Up Call Refuse Questions","type":"boolean"},"press_keys":{"$ref":"#/components/schemas/AgentPressKeysConfig","description":"Beta. Key presses on outbound phone calls, for calls that reach an automated phone menu before a person."}},"title":"AgentSystemToolsConfig","type":"object"},"AgentTransferDestination":{"properties":{"type":{"default":"phone","enum":["phone","sip"],"title":"Type","type":"string"},"label":{"default":"","title":"Label","type":"string"},"phone_number":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"description":"Destination in E.164, for type `phone`. Calls through a number bought on the platform can only be transferred to the supported countries. A number in another country is dialed by your own carrier, so it needs an imported SIP number: any imported number for a cold transfer, one with termination configured for a warm transfer. Without such a number in the team the write is rejected. On a call through any other number the destination is left out, and the agent cannot transfer to it.","title":"Phone Number"},"sip_uri":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"description":"Destination for type `sip`: the SIP address to transfer the call to, written `sip:user@host[:port][;transport=udp|tcp|tls]`, for example `sip:support@pbx.example.com`. The host must be a public domain name or IP address, and a `sips:` URI uses TLS. The URI holds only the address, in at most 512 characters: a password, headers or any other parameter is rejected, so use `auth_username` and `auth_password` for credentials and `headers` for SIP headers. Dynamic variables are not supported in the URI.","title":"Sip Uri"},"headers":{"additionalProperties":{"type":"string"},"description":"SIP destinations only: custom SIP headers sent with the transferred call, as an object of header names and values, up to 20. A name starts with `X-` followed by letters, digits and hyphens, at most 64 characters in all, or is `User-to-User`. Names are not case-sensitive and `X-Fish-` names are reserved for headers the platform adds itself. A value is 1 to 1024 printable ASCII characters (128 for `User-to-User`) and can contain dynamic variables such as `{{customer_id}}`, filled in when the session starts. When a value cannot be filled in for a call, for example because a variable has no value and no default, the destination is left out of that call. A warm transfer sends the headers on the call the agent places to the destination. A cold transfer hands them to the caller's carrier, which decides whether to pass them on.","title":"Headers","type":"object"},"description":{"default":"","title":"Description","type":"string"},"mode":{"default":"cold","enum":["cold","warm"],"title":"Mode","type":"string"},"warm_connect":{"default":"confirm","enum":["confirm","briefing","direct"],"title":"Warm Connect","type":"string"},"warm_briefing_instructions":{"default":"","title":"Warm Briefing Instructions","type":"string"},"warm_briefing_speed":{"anyOf":[{"maximum":2.0,"minimum":0.5,"type":"number"},{"type":"null"}],"default":null,"title":"Warm Briefing Speed"},"warm_ring_timeout_seconds":{"default":30,"title":"Warm Ring Timeout Seconds","type":"integer"},"warm_confirm_timeout_seconds":{"default":60,"title":"Warm Confirm Timeout Seconds","type":"integer"},"warm_human_detection":{"default":false,"description":"Applies to warm transfers whose warm_connect is `confirm` or `briefing`, and is ignored for cold transfers and `direct`. When true, once the destination answers, the agent stays silent until the other side speaks, then classifies the pickup. A person is briefed as usual. Voicemail or an IVR (phone menu) ends the transfer as failed. A hold queue or silence keeps the agent waiting until `warm_confirm_timeout_seconds` ends the attempt as unreachable. A failed transfer follows `on_failure`. Leave it off for destinations whose people are only reachable through a phone menu, because the menu stops the transfer.","title":"Warm Human Detection","type":"boolean"},"warm_press_keys":{"$ref":"#/components/schemas/AgentTransferPressKeys","description":"Beta. Key presses on the call in which the agent reaches this destination, for a number that an automated phone menu answers before a person does. Applies to warm transfers whose warm_connect is `confirm` or `briefing`, and is ignored for cold transfers and `direct`. It has no effect while warm_human_detection is true, because that setting ends the transfer when a phone menu answers. The time spent in the menu counts toward `warm_confirm_timeout_seconds`, so such a destination usually needs a longer one. Absent means off. The list of destinations is replaced as a whole, so a destination sent without the field has it off."},"warm_consult_uses_agent_settings":{"default":true,"description":"Compatibility option for warm transfers whose warm_connect is `confirm` or `briefing`, ignored for cold transfers and `direct`. Absent or true (recommended): on the call in which the agent briefs the destination, the agent uses the same turn-taking (response timing: `eagerness`, `response_wait_ms` and `response_max_wait_ms`), interruption (`interruption_sensitivity` and `interruption_ignore_phrases`) and language (`voice.speaking_language`) settings as on the call with the caller. False: that call keeps the older fixed behavior. Destinations that existed before this setting were set to false so their behavior did not change. Either way the destination can always interrupt the agent on that call, whatever `interruptible` is set to. A destination sent without the field keeps the value of the existing destination it replaces (same label, else a renamed one with the same phone number or SIP URI) and is true when it is new. Send true to switch a destination to the agent's settings.","title":"Warm Consult Uses Agent Settings","type":"boolean"},"on_failure":{"$ref":"#/components/schemas/AgentTransferOnFailure"},"announcement_mode":{"default":"generated","enum":["generated","fixed","off"],"title":"Announcement Mode","type":"string"},"announcement_message":{"default":"","title":"Announcement Message","type":"string"},"auth_username":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"description":"SIP destinations in `warm` mode only: the digest username the destination's SIP server asks for. The agent places the call to a warm destination itself and answers the server's 401 or 407 challenge with this username and the stored password. A response that carries it means a password is stored. A `cold` destination sent with it is rejected: a cold transfer hands the call to the caller's carrier, which dials the destination and never has the credentials. Send null or an empty string to remove the credentials. A destination sent without the field keeps the credentials of the existing destination it replaces (same label, else a renamed one with the same SIP URI) while it stays a warm SIP destination on the same host and port, and loses them otherwise.","title":"Auth Username"}},"title":"AgentTransferDestination","type":"object"},"AgentTransferOnFailure":{"properties":{"action":{"default":"return_to_agent","enum":["return_to_agent","end_call"],"title":"Action","type":"string"},"message":{"default":"","title":"Message","type":"string"}},"title":"AgentTransferOnFailure","type":"object"},"AgentTransferPressKeys":{"properties":{"enabled":{"default":false,"description":"When true, on the call to this destination the agent can press phone keys to get through the menu (`_press_keys`), and stay silent while the menu or a hold message plays (`_skip_turn`), before it briefs the person who answers. It works the same whether the caller's own call is inbound or outbound, and does not depend on `tools.system_tools.press_keys`.","title":"Enabled","type":"boolean"},"instructions":{"default":"","description":"How to get through this number's phone menu, written for the agent, such as `Press 2 for billing, then enter extension 204.` Optional, at most 500 characters. `{{variable}}` placeholders are filled in for each session. Without it the agent picks keys from the destination's label and description and from what the caller asked for. Used only while enabled is true, and kept when it is false.","title":"Instructions","type":"string"}},"title":"AgentTransferPressKeys","type":"object"},"AgentTurnDetector":{"properties":{"model":{"anyOf":[{"enum":["fish","legacy"],"type":"string"},{"type":"null"}],"default":null,"description":"The model that judges the end of the caller's turn. `fish` is Fish Audio's turn detection model. It waits for the end of the caller's thought, so a caller who pauses between two sentences or between groups of digits is less often answered in the middle. `legacy` is the earlier model. It answers sooner after a sentence that sounds complete. The default is `fish`. An account whose agents ran the earlier model before this setting existed has `legacy` as its default, so they behave as they did. An agent that never set the model reads the default, and a new agent is created with it.","title":"Model"}},"title":"AgentTurnDetector","type":"object"},"AgentVariablesConfig":{"description":"Defaults for `{{name}}` placeholders and what a placeholder without a value does.","properties":{"defaults":{"additionalProperties":{"anyOf":[{"type":"string"},{"type":"integer"},{"type":"number"},{"type":"boolean"}]},"title":"Defaults","type":"object"},"on_missing":{"default":"keep","enum":["keep","empty","reject"],"title":"On Missing","type":"string"}},"title":"AgentVariablesConfig","type":"object"},"PublicAgentAsrConfig":{"description":"The asr section as the public API reads it: without the console-only\nnoise cancellation and speaker label switches.","properties":{"model":{"default":"deepgram:nova-3","enum":["deepgram:nova-3","elevenlabs:scribe_v2_realtime","elevenlabs:scribe_v2_medical","fish_audio:transcribe-stream-1","fish_audio:transcribe-stream-2","fish_audio:transcribe-stream-1-dev"],"title":"Model","type":"string"},"multilingual":{"default":false,"title":"Multilingual","type":"boolean"},"strict_language":{"default":false,"description":"Enforces voice.speaking_language whatever multilingual says: speech recognized as another language reaches the agent as [unintelligible speech]. Language is detected per utterance, so a short or heavily accented phrase in the speaking language can occasionally be detected as another language and replaced too. With deepgram:nova-3, speech in another language is usually not transcribed at all. Only enable it when you explicitly need to stop the agent from understanding other languages.","title":"Strict Language","type":"boolean"},"keyterms":{"items":{"type":"string"},"maxItems":50,"title":"Keyterms","type":"array"}},"title":"PublicAgentAsrConfig","type":"object"},"PublicAgentKnowledgeBaseConfig":{"properties":{"enabled":{"default":false,"title":"Enabled","type":"boolean"},"knowledge_source_ids":{"items":{"type":"string"},"title":"Knowledge Source Ids","type":"array"}},"title":"PublicAgentKnowledgeBaseConfig","type":"object"},"PublicAgentToolsConfig":{"properties":{"enabled":{"default":true,"title":"Enabled","type":"boolean"},"tool_ids":{"items":{"type":"string"},"title":"Tool Ids","type":"array"},"system_tools":{"$ref":"#/components/schemas/AgentSystemToolsConfig"}},"title":"PublicAgentToolsConfig","type":"object"},"PublicAgentVoiceConfig":{"description":"The voice section as the public API reads it: without the console-only\nsentence buffering switch, live-3 playout and live-3 self-ASR model.","properties":{"voice_id":{"description":"The agent's voice: a Voice Library voice or one of your clones by id, or with engine live3 one of the speech model's own voices by its lowercase name (clara, nora, owen, marco, milo, jonah, harper, patricia, and for the DT situation maddie, ethan, tyler, brianna). A name is rejected while the engine is fish_tts. When a session of an agent on one of the names runs on Fish TTS (another language, or the speech model unavailable), it speaks a Voice Library counterpart of that voice.","title":"Voice Id","type":"string"},"speaking_language":{"default":"en","enum":["en","ja","zh","ko","es","fr","de","pt","it","nl","ar","hi","id","tr","ru","bg","sr","hr","cs","sk","pl","uk","ro","hu","el","sv","da","no","fi","et","lv","lt","ca","he","fa","ur","kk","ka","hy","bn","ta","te","kn","mr","gu","pa","ne","th","vi","ms","tl","af"],"title":"Speaking Language","type":"string"},"expressive":{"default":false,"title":"Expressive","type":"boolean"},"speed":{"default":1.0,"maximum":2.0,"minimum":0.5,"title":"Speed","type":"number"},"tts_model":{"default":"s2.1-pro","enum":["s2.1-pro","drama-3"],"title":"Tts Model","type":"string"},"engine":{"default":"fish_tts","description":"Speech engine. live3 (the default for new agents) puts the Fish full-duplex speech model on the call: it listens while it speaks and takes turns on its own. English only: sessions in another language run on fish_tts. fish_tts speaks the model's text through Fish TTS in the agent's voice, and is what agents from before the engine existed run. While the engine is live3, speech recognition is managed automatically by the platform, and switching to live3 turns asr.multilingual on unless the same patch sets it. An agent still on the default voice also starts on the speech model's voice Clara at the switch, unless it had one of the speech model's voices before or the same patch picks a voice. An agent with a voice of its own keeps speaking it.","enum":["fish_tts","live3"],"title":"Engine","type":"string"},"live3_prompt":{"anyOf":[{"pattern":"^[A-Za-z0-9_-]{1,64}$","type":"string"},{"type":"null"}],"default":null,"description":"live3 only. The situation the speech model speaks in: P2 (phone support), DT (drive-thru) or AIR (airline). Empty: the default. Ignored on fish_tts.","title":"Live3 Prompt"},"effect":{"default":"none","description":"How the agent's voice sounds on web calls (the console test call, the widget, the SDK). none (default): the clean voice. phone: a handset line, the 300 to 3400 Hz band with the codec's grain. intercom: a small overdriven speaker, as at a drive-thru order post or a door intercom. Phone and WhatsApp calls already sound like a line and ignore it.","enum":["none","phone","intercom"],"title":"Effect","type":"string"},"pronunciation_dictionary_ids":{"items":{"type":"string"},"title":"Pronunciation Dictionary Ids","type":"array"},"background_sound":{"$ref":"#/components/schemas/AgentBackgroundSoundConfig","description":"A looping ambience the worker mixes under the agent's voice. volume is the ambience's gain relative to the agent's voice, 0–1 (default 0.15). custom_asset_id names an uploaded clip (POST /agent/background-sounds) and is required with preset \"custom\", refused otherwise. Replaces the whole object; null resets to off."}},"required":["voice_id"],"title":"PublicAgentVoiceConfig","type":"object"},"PublicAgentWebhooksConfig":{"properties":{"conversation_init":{"anyOf":[{"$ref":"#/components/schemas/PublicConversationInitWebhook"},{"type":"null"}],"default":null},"post_call":{"items":{"$ref":"#/components/schemas/PublicPostCallWebhook"},"title":"Post Call","type":"array"}},"title":"PublicAgentWebhooksConfig","type":"object"},"PublicConversationInitWebhook":{"properties":{"url":{"title":"Url","type":"string"},"has_secret":{"default":false,"description":"Whether a signing secret is configured; the value itself is never returned.","title":"Has Secret","type":"boolean"},"previous_secret_expires_at":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}],"default":null,"description":"Set while a rotated-out secret still signs as a second `v1`; absent otherwise.","title":"Previous Secret Expires At"},"timeout_seconds":{"default":5.0,"title":"Timeout Seconds","type":"number"}},"required":["url"],"title":"PublicConversationInitWebhook","type":"object"},"PublicPostCallWebhook":{"properties":{"url":{"title":"Url","type":"string"},"has_secret":{"default":false,"description":"Whether a signing secret is configured; the value itself is never returned.","title":"Has Secret","type":"boolean"},"previous_secret_expires_at":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}],"default":null,"description":"Set while a rotated-out secret still signs as a second `v1`; absent otherwise.","title":"Previous Secret Expires At"}},"required":["url"],"title":"PublicPostCallWebhook","type":"object"},"PublicAgentConfigEntity":{"properties":{"agent_id":{"title":"Agent Id","type":"string"},"config_hash":{"description":"Opaque content hash of this configuration as stored. On a draft it is the config_hash the next publish gives the version, so it equals the live version's config_hash when nothing is unpublished. Pass it to Publish Agent as expected_config_hash.","title":"Config Hash","type":"string"},"prompt":{"$ref":"#/components/schemas/AgentPromptConfigView"},"voice":{"$ref":"#/components/schemas/PublicAgentVoiceConfig"},"asr":{"$ref":"#/components/schemas/PublicAgentAsrConfig"},"conversation":{"$ref":"#/components/schemas/AgentConversationConfig"},"tools":{"$ref":"#/components/schemas/PublicAgentToolsConfig"},"webhooks":{"$ref":"#/components/schemas/PublicAgentWebhooksConfig"},"knowledge_base":{"$ref":"#/components/schemas/PublicAgentKnowledgeBaseConfig"},"analysis":{"$ref":"#/components/schemas/AgentAnalysisConfig"},"guardrails":{"$ref":"#/components/schemas/AgentGuardrailsConfig"},"context":{"$ref":"#/components/schemas/AgentContextConfig"},"llm":{"$ref":"#/components/schemas/AgentLLMConfigRedacted"},"variables":{"$ref":"#/components/schemas/AgentVariablesConfig"},"updated_at":{"format":"date-time","title":"Updated At","type":"string"}},"required":["agent_id","config_hash","prompt","voice","asr","conversation","tools","webhooks","knowledge_base","analysis","guardrails","context","llm","updated_at"],"title":"PublicAgentConfigEntity","type":"object"},"PublicAgentVersionSummary":{"properties":{"version_number":{"title":"Version Number","type":"integer"},"version_title":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Version Title"},"version_description":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Version Description"},"config_hash":{"title":"Config Hash","type":"string"},"published_at":{"format":"date-time","title":"Published At","type":"string"}},"required":["version_number","config_hash","published_at"],"title":"PublicAgentVersionSummary","type":"object"},"AgentTestAssertionResult":{"properties":{"kind":{"enum":["tool_call","forbidden_tool","ended_by"],"title":"Kind","type":"string"},"target":{"title":"Target","type":"string"},"tool_id":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Tool Id"},"tool_type":{"anyOf":[{"enum":["webhook","client","integration","system"],"type":"string"},{"type":"null"}],"default":null,"title":"Tool Type"},"passed":{"title":"Passed","type":"boolean"},"detail":{"default":"","title":"Detail","type":"string"}},"required":["kind","target","passed"],"title":"AgentTestAssertionResult","type":"object"},"AgentTestConditionResult":{"properties":{"name":{"title":"Name","type":"string"},"result":{"enum":["success","failure","unknown"],"title":"Result","type":"string"},"rationale":{"default":"","title":"Rationale","type":"string"}},"required":["name","result"],"title":"AgentTestConditionResult","type":"object"},"AgentTestJudge":{"additionalProperties":false,"description":"The model that judges a `next_reply` or `simulation` test, and how much\nit reasons before its verdict.","properties":{"model":{"description":"One of the models `GET /v1/agent/llm-models` lists with `test_judge`.","maxLength":200,"minLength":1,"title":"Model","type":"string"},"reasoning_level":{"anyOf":[{"enum":["off","low","medium","high","very_high"],"type":"string"},{"type":"null"}],"default":null,"description":"One of the levels `test_judge.reasoning_levels` lists for the model. Null reasons at the model's default level.","title":"Reasoning Level"}},"required":["model"],"title":"AgentTestJudge","type":"object"},"AgentTestMockGap":{"description":"Calls of one tool the test prepared no answer for. A run with a\ngap never passes cleanly: it fails with needs_review.","properties":{"tool_name":{"title":"Tool Name","type":"string"},"tool_id":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Tool Id"},"tool_type":{"anyOf":[{"enum":["webhook","client","integration","system"],"type":"string"},{"type":"null"}],"default":null,"title":"Tool Type"},"source":{"enum":["missing","unmatched"],"title":"Source","type":"string"},"calls":{"default":0,"title":"Calls","type":"integer"}},"required":["tool_name","source"],"title":"AgentTestMockGap","type":"object"},"AgentTestSimulationResult":{"description":"The simulation run's result: what was said, what the agent called,\nthe deterministic assertions and the judge's per-condition verdicts.","properties":{"transcript":{"items":{"$ref":"#/components/schemas/AgentTestTranscriptMessage"},"title":"Transcript","type":"array"},"tool_calls":{"items":{"$ref":"#/components/schemas/AgentTestToolCallRecord"},"title":"Tool Calls","type":"array"},"assertions":{"items":{"$ref":"#/components/schemas/AgentTestAssertionResult"},"title":"Assertions","type":"array"},"conditions":{"items":{"$ref":"#/components/schemas/AgentTestConditionResult"},"title":"Conditions","type":"array"},"summary":{"default":"","title":"Summary","type":"string"},"passed":{"default":false,"title":"Passed","type":"boolean"},"llm_endpoint_errors":{"items":{"$ref":"#/components/schemas/AgentSessionLlmEndpointError"},"title":"Llm Endpoint Errors","type":"array"}},"title":"AgentTestSimulationResult","type":"object"},"AgentTestToolCallRecord":{"description":"One tool the agent invoked during the simulation, as the runtime ledger recorded it.","properties":{"id":{"default":"","title":"Id","type":"string"},"tool_name":{"default":"","title":"Tool Name","type":"string"},"tool_source":{"default":"","title":"Tool Source","type":"string"},"input":{"additionalProperties":{"$ref":"#/components/schemas/JsonValue"},"title":"Input","type":"object"},"status":{"default":"","title":"Status","type":"string"},"output":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Output"},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Error"},"mocked":{"default":false,"title":"Mocked","type":"boolean"},"mock_source":{"anyOf":[{"enum":["test","tool","missing","unmatched","real"],"type":"string"},{"type":"null"}],"default":null,"title":"Mock Source"},"node_id":{"default":"","title":"Node Id","type":"string"},"turn_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"default":null,"title":"Turn Id"},"created_at":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Created At"},"seq":{"anyOf":[{"type":"integer"},{"type":"null"}],"default":null,"title":"Seq"}},"title":"AgentTestToolCallRecord","type":"object"},"AgentTestTranscriptMessage":{"properties":{"role":{"enum":["user","agent"],"title":"Role","type":"string"},"text":{"default":"","title":"Text","type":"string"},"turn_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"default":null,"title":"Turn Id"},"node_id":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Node Id"},"created_at":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Created At"},"seq":{"anyOf":[{"type":"integer"},{"type":"null"}],"default":null,"title":"Seq"}},"required":["role"],"title":"AgentTestTranscriptMessage","type":"object"},"PublicAgentTestRun":{"properties":{"run_id":{"title":"Run Id","type":"string"},"test_id":{"title":"Test Id","type":"string"},"agent_id":{"title":"Agent Id","type":"string"},"batch_id":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Batch Id"},"test_type":{"enum":["next_reply","tool","simulation"],"title":"Test Type","type":"string"},"repeat_index":{"default":0,"description":"Which repeat of the test in its batch this run is.","title":"Repeat Index","type":"integer"},"status":{"enum":["queued","running","passed","failed","error","cancelled"],"title":"Status","type":"string"},"needs_review":{"default":false,"description":"The judge could not decide, or a tool call had no mock answer.","title":"Needs Review","type":"boolean"},"error":{"default":"","title":"Error","type":"string"},"judge":{"anyOf":[{"$ref":"#/components/schemas/AgentTestJudge"},{"type":"null"}],"default":null,"description":"The model that judged the run and the reasoning level it judged at. Null on a `tool` test, which has no judge, on a run that ended before its judge was asked, and on `next_reply` runs from before the field existed. Simulation runs from before the judge could be chosen have a null level."},"usage":{"$ref":"#/components/schemas/PublicAgentTestRunUsage"},"created_at":{"format":"date-time","title":"Created At","type":"string"},"started_at":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}],"default":null,"title":"Started At"},"finished_at":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}],"default":null,"title":"Finished At"},"agent_reply":{"default":"","description":"The reply a scripted test judged.","title":"Agent Reply","type":"string"},"judge_reasoning":{"default":"","title":"Judge Reasoning","type":"string"},"config_hash":{"default":"","description":"The agent draft's config hash the run tested.","title":"Config Hash","type":"string"},"latency_ms":{"default":0,"title":"Latency Ms","type":"integer"},"simulation_result":{"anyOf":[{"$ref":"#/components/schemas/AgentTestSimulationResult"},{"type":"null"}],"default":null},"channel":{"anyOf":[{"enum":["web_voice","phone_inbound","phone_outbound"],"type":"string"},{"type":"null"}],"default":null,"description":"The channel the run played.","title":"Channel"},"turns_used":{"default":0,"title":"Turns Used","type":"integer"},"ended_by":{"anyOf":[{"enum":["agent","user","transfer","max_turns","timeout","error"],"type":"string"},{"type":"null"}],"default":null,"title":"Ended By"},"mock_gaps":{"items":{"$ref":"#/components/schemas/AgentTestMockGap"},"title":"Mock Gaps","type":"array"}},"required":["run_id","test_id","agent_id","test_type","status","created_at"],"title":"PublicAgentTestRun","type":"object"},"PublicAgentTestRunLLMCharge":{"properties":{"participant":{"description":"Whose tokens: the agent, the simulated user, or the judge.","enum":["agent","simulated_user","judge"],"title":"Participant","type":"string"},"model":{"title":"Model","type":"string"},"amount_usd":{"description":"What these tokens charged, in USD.","title":"Amount Usd","type":"string"},"input":{"anyOf":[{"$ref":"#/components/schemas/PublicAgentTestRunTokenCharge"},{"type":"null"}],"default":null},"cache_read":{"anyOf":[{"$ref":"#/components/schemas/PublicAgentTestRunTokenCharge"},{"type":"null"}],"default":null},"cache_write_5m":{"anyOf":[{"$ref":"#/components/schemas/PublicAgentTestRunTokenCharge"},{"type":"null"}],"default":null},"cache_write_1h":{"anyOf":[{"$ref":"#/components/schemas/PublicAgentTestRunTokenCharge"},{"type":"null"}],"default":null},"output":{"anyOf":[{"$ref":"#/components/schemas/PublicAgentTestRunTokenCharge"},{"type":"null"}],"default":null}},"required":["participant","model","amount_usd"],"title":"PublicAgentTestRunLLMCharge","type":"object"},"PublicAgentTestRunPlatformFee":{"properties":{"rate_usd":{"description":"USD per agent reply.","title":"Rate Usd","type":"string"},"amount_usd":{"description":"`agent_replies` times `rate_usd`.","title":"Amount Usd","type":"string"}},"required":["rate_usd","amount_usd"],"title":"PublicAgentTestRunPlatformFee","type":"object"},"PublicAgentTestRunTokenCharge":{"properties":{"tokens":{"title":"Tokens","type":"integer"},"amount_usd":{"title":"Amount Usd","type":"string"}},"required":["tokens","amount_usd"],"title":"PublicAgentTestRunTokenCharge","type":"object"},"PublicAgentTestRunUsage":{"properties":{"agent_replies":{"default":0,"title":"Agent Replies","type":"integer"},"cost_usd":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"description":"What the run was charged in USD. `0` on a finished run that is not charged. Null until the run's charge is settled.","title":"Cost Usd"},"platform_fee":{"anyOf":[{"$ref":"#/components/schemas/PublicAgentTestRunPlatformFee"},{"type":"null"}],"default":null,"description":"The fee per agent reply. Null unless charged."},"llm":{"description":"LLM tokens, one entry per participant and model, by token category. With `platform_fee` they add up to `cost_usd`. Empty unless charged.","items":{"$ref":"#/components/schemas/PublicAgentTestRunLLMCharge"},"title":"Llm","type":"array"}},"title":"PublicAgentTestRunUsage","type":"object"},"PublicAgentTestTool":{"properties":{"id":{"description":"The id to reference in tests. Webhook and client tools use their tool id, integration tools use <provider_key>:<tool_name>, system tools use their tool name, such as _end_call.","title":"Id","type":"string"},"name":{"title":"Name","type":"string"},"type":{"enum":["webhook","client","integration","system"],"title":"Type","type":"string"},"description":{"default":"","title":"Description","type":"string"},"provider_key":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"description":"The integration provider, integration tools only.","title":"Provider Key"},"writes":{"default":false,"description":"An integration tool that changes data. It cannot run for real in a test.","title":"Writes","type":"boolean"},"has_own_mock":{"default":false,"description":"The tool answers from its own mock when a simulation mocks every tool and the test has no entry for it. Always true for a system tool, which never takes a mock.","title":"Has Own Mock","type":"boolean"},"expects_response":{"default":true,"description":"False for a client tool that does not wait for an answer, which cannot be mocked.","title":"Expects Response","type":"boolean"},"available_on_phone":{"default":true,"description":"False for client tools, which need a client and never run on phone calls.","title":"Available On Phone","type":"boolean"},"channels":{"description":"The channels the agent has the tool on. Client tools are on web_voice only, _transfer_call on the two phone channels, _press_keys and _skip_turn on phone_outbound.","items":{"enum":["web_voice","phone_inbound","phone_outbound"],"type":"string"},"title":"Channels","type":"array"}},"required":["id","name","type"],"title":"PublicAgentTestTool","type":"object"},"PublicAgentTestBatchSummary":{"properties":{"batch_id":{"title":"Batch Id","type":"string"},"agent_id":{"title":"Agent Id","type":"string"},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"description":"The name of the batch, null when it has none.","title":"Name"},"status":{"description":"running until every run has finished.","enum":["running","completed"],"title":"Status","type":"string"},"completed":{"title":"Completed","type":"boolean"},"run_count":{"description":"Every run of the batch, one per test and repeat. It is `queued` + `running` + `passed` + `failed` + `errors` + `cancelled`.","title":"Run Count","type":"integer"},"queued":{"description":"Runs that have not started.","title":"Queued","type":"integer"},"running":{"description":"Runs in progress.","title":"Running","type":"integer"},"passed":{"title":"Passed","type":"integer"},"failed":{"title":"Failed","type":"integer"},"errors":{"description":"Runs in status `error`, which finished without a verdict.","title":"Errors","type":"integer"},"cancelled":{"description":"Runs in status `cancelled`. They are not counted in `errors`.","title":"Cancelled","type":"integer"},"pass_rate":{"anyOf":[{"type":"number"},{"type":"null"}],"default":null,"description":"passed / (passed + failed), null until a run passed or failed. Runs without a verdict (`error`, `cancelled`) never judged the agent and are left out.","title":"Pass Rate"},"cancelled_at":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}],"default":null,"description":"When the batch was first cancelled, null if it never was.","title":"Cancelled At"},"trigger_source":{"description":"Where the batch was started: the console or the API.","enum":["console","api"],"title":"Trigger Source","type":"string"},"created_at":{"description":"When the first run was created.","format":"date-time","title":"Created At","type":"string"},"finished_at":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}],"default":null,"description":"When the last run finished, null until the batch completed.","title":"Finished At"}},"required":["batch_id","agent_id","status","completed","run_count","queued","running","passed","failed","errors","cancelled","trigger_source","created_at"],"title":"PublicAgentTestBatchSummary","type":"object"},"PublicAgentTestBatchUpdatePayload":{"additionalProperties":false,"properties":{"name":{"anyOf":[{"maxLength":120,"minLength":1,"type":"string"},{"type":"null"}],"description":"The new name. 1 to 120 characters after leading and trailing whitespace is removed, and a blank name is rejected. null removes the name.","title":"Name"}},"required":["name"],"title":"PublicAgentTestBatchUpdatePayload","type":"object"},"PublicKnowledgeSourceSummary":{"properties":{"knowledge_source_id":{"title":"Knowledge Source Id","type":"string"},"workspace_id":{"title":"Workspace Id","type":"string"},"name":{"title":"Name","type":"string"},"description":{"default":"","title":"Description","type":"string"},"folder_id":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"description":"The knowledge folder this source is in; null at the root. Folders are managed with `/v1/agent/knowledge-folders`.","title":"Folder Id"},"file_name":{"title":"File Name","type":"string"},"size_bytes":{"title":"Size Bytes","type":"integer"},"chunk_count":{"title":"Chunk Count","type":"integer"},"revision_number":{"description":"Increments every time the content is replaced. Drafts always use the newest revision; published versions pin the revision current at publish time.","title":"Revision Number","type":"integer"},"created_at":{"format":"date-time","title":"Created At","type":"string"},"updated_at":{"format":"date-time","title":"Updated At","type":"string"}},"required":["knowledge_source_id","workspace_id","name","file_name","size_bytes","chunk_count","revision_number","created_at","updated_at"],"title":"PublicKnowledgeSourceSummary","type":"object"},"PublicDependentAgent":{"properties":{"agent_id":{"title":"Agent Id","type":"string"},"name":{"title":"Name","type":"string"}},"required":["agent_id","name"],"title":"PublicDependentAgent","type":"object"},"PublicKnowledgeFolder":{"properties":{"folder_id":{"title":"Folder Id","type":"string"},"workspace_id":{"title":"Workspace Id","type":"string"},"name":{"title":"Name","type":"string"},"created_at":{"format":"date-time","title":"Created At","type":"string"},"updated_at":{"format":"date-time","title":"Updated At","type":"string"}},"required":["folder_id","workspace_id","name","created_at","updated_at"],"title":"PublicKnowledgeFolder","type":"object"},"PublicKnowledgeFolderPayload":{"additionalProperties":false,"properties":{"name":{"description":"1-120 characters after leading and trailing whitespace is removed (a blank name is rejected). Unique within the workspace, case-sensitive.","maxLength":120,"minLength":1,"title":"Name","type":"string"}},"required":["name"],"title":"PublicKnowledgeFolderPayload","type":"object"},"PublicAgentToolSummary":{"properties":{"tool_id":{"title":"Tool Id","type":"string"},"workspace_id":{"title":"Workspace Id","type":"string"},"name":{"title":"Name","type":"string"},"description":{"default":"","title":"Description","type":"string"},"tool_type":{"enum":["webhook","client"],"title":"Tool Type","type":"string"},"method":{"enum":["GET","POST","PUT","PATCH","DELETE"],"title":"Method","type":"string"},"url":{"title":"Url","type":"string"},"used_by":{"default":0,"description":"How many agents reference this tool in their draft configuration.","title":"Used By","type":"integer"},"created_at":{"format":"date-time","title":"Created At","type":"string"},"updated_at":{"format":"date-time","title":"Updated At","type":"string"}},"required":["tool_id","workspace_id","name","tool_type","method","url","created_at","updated_at"],"title":"PublicAgentToolSummary","type":"object"},"AgentToolPreToolSpeech":{"additionalProperties":false,"properties":{"mode":{"enum":["auto","off","static"],"title":"Mode","type":"string"},"message":{"default":"","description":"What to say. Required, and only used, when `mode` is `static`.","maxLength":500,"title":"Message","type":"string"}},"required":["mode"],"title":"AgentToolPreToolSpeech","type":"object"},"AgentWebhookArgumentPayload":{"properties":{"name":{"maxLength":64,"minLength":1,"title":"Name","type":"string"},"description":{"default":"","maxLength":500,"title":"Description","type":"string"}},"required":["name"],"title":"AgentWebhookArgumentPayload","type":"object"},"AgentWebhookHeaderPayload":{"properties":{"name":{"maxLength":128,"minLength":1,"title":"Name","type":"string"},"value":{"maxLength":4000,"title":"Value","type":"string"},"kind":{"default":"custom","enum":["custom","authorization_bearer","authorization_basic"],"title":"Kind","type":"string"}},"required":["name","value"],"title":"AgentWebhookHeaderPayload","type":"object"},"AgentWebhookMockResponsePayload":{"properties":{"name":{"default":"","maxLength":120,"title":"Name","type":"string"},"status_code":{"default":200,"maximum":599,"minimum":100,"title":"Status Code","type":"integer"},"content_type":{"default":"application/json","maxLength":128,"title":"Content Type","type":"string"},"body":{"default":"","maxLength":100000,"title":"Body","type":"string"}},"title":"AgentWebhookMockResponsePayload","type":"object"},"PublicAgentToolCreatePayload":{"additionalProperties":false,"description":"Console payload minus the folder concept (folders are console-only).","properties":{"name":{"maxLength":120,"minLength":1,"title":"Name","type":"string"},"description":{"default":"","maxLength":2000,"title":"Description","type":"string"},"tool_type":{"default":"webhook","enum":["webhook","client"],"title":"Tool Type","type":"string"},"arguments":{"description":"Older shape of `parameters`: each entry becomes a required string parameter. Mutually exclusive with `parameters` in one request. Reads return both, `arguments` being the string parameters of the schema.","items":{"$ref":"#/components/schemas/AgentWebhookArgumentPayload"},"title":"Arguments","type":"array"},"parameters":{"anyOf":[{"additionalProperties":{"$ref":"#/components/schemas/JsonValue"},"type":"object"},{"type":"null"}],"default":null,"description":"Call parameters as a JSON Schema object (draft 2020-12): `type: object` (filled in when omitted), `properties`, `required`. Standard meaning throughout: `required` means the key must be present, `type: [\"string\", \"null\"]` allows null, `minLength: 1` makes a string non-empty, `enum` and `pattern` constrain the value, `default` fills a key the model left out. Mutually exclusive with `arguments` in one request. A tool created with `parameters` starts in `parameter_mode: strict`.","title":"Parameters"},"parameter_mode":{"anyOf":[{"enum":["legacy","strict"],"type":"string"},{"type":"null"}],"default":null,"description":"Whether the agent runtime checks each call's arguments against `parameters` before running the tool. `legacy` (the default for tools created with `arguments`, and every tool from before this field existed): no check, the model's arguments run as sent. `strict` (the default for tools created with `parameters`): a call that does not satisfy the schema is refused and the model is told to ask the caller for the missing information, and the LLM provider's constrained decoding is turned on where the model supports it (OpenAI models and a custom OpenAI-compatible endpoint receive the tool with `strict: true`, Gemini on the platform's native channel runs validated function calling). Changing `parameters` never changes the mode, and the mode can be changed on its own.","title":"Parameter Mode"},"method":{"default":"POST","enum":["GET","POST","PUT","PATCH","DELETE"],"title":"Method","type":"string"},"url":{"default":"","maxLength":4000,"title":"Url","type":"string"},"content_type":{"default":"application/json","maxLength":128,"title":"Content Type","type":"string"},"body_template":{"default":"","description":"Request body sent for non-GET calls. `{{argument}}`, `{{system.*}}` and custom session variable placeholders are filled in at call time; a missing value becomes empty. When the body's content type is JSON (the default `application/json`, any `+json` type, or a `Content-Type` header saying so), a placeholder inside a JSON string, such as `{\"note\": \"{{note}}\"}`, is JSON-escaped, so quotes, backslashes and newlines in the value keep the body valid JSON. A placeholder outside a string, such as `{\"count\": {{count}}}`, is inserted as is. Other content types are filled in as is. The body is only this template: parameters are not added on their own. With an empty template a non-GET call sends no body, and a parameter that `url` and `headers` do not reference either never reaches the endpoint.","maxLength":100000,"title":"Body Template","type":"string"},"headers":{"items":{"$ref":"#/components/schemas/AgentWebhookHeaderPayload"},"title":"Headers","type":"array"},"timeout_seconds":{"default":30,"maximum":300,"minimum":1,"title":"Timeout Seconds","type":"integer"},"error_handling":{"default":"passthrough","enum":["passthrough","hide"],"title":"Error Handling","type":"string"},"mock_responses":{"items":{"$ref":"#/components/schemas/AgentWebhookMockResponsePayload"},"title":"Mock Responses","type":"array"},"expects_response":{"default":true,"title":"Expects Response","type":"boolean"},"execution_mode":{"default":"blocking","enum":["blocking","fire_and_forget","background"],"title":"Execution Mode","type":"string"},"pre_tool_speech":{"anyOf":[{"$ref":"#/components/schemas/AgentToolPreToolSpeech"},{"type":"null"}],"default":null,"description":"What the caller hears as this tool starts, when the agent's own reply has not said anything yet. `auto` (the default for a new tool): the platform decides for each call whether a line is worth saying, and the model writes the line when one is said. `static`: the agent says `message` as written (required, one language). `off`: nothing (what a tool created before this field reads as). Applies to blocking webhook tools and to client tools with `expects_response: true`. It is stored but not used for other tools."}},"required":["name"],"title":"PublicAgentToolCreatePayload","type":"object"},"AgentWebhookToolSigningStatus":{"description":"Request signing state of a webhook tool. Secret values never appear in\nreads: the rotate call returns the new secret once.","properties":{"enabled":{"default":false,"description":"Whether requests carry `X-Fish-Webhook-Signature` (HMAC-SHA256 over `{t}.{body}`, the post-call webhook scheme).","title":"Enabled","type":"boolean"},"secret_created_at":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}],"default":null,"title":"Secret Created At"},"previous_secret_expires_at":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}],"default":null,"description":"Set while the rotated-out secret still signs as a second `v1`; null once it expired or was revoked.","title":"Previous Secret Expires At"}},"title":"AgentWebhookToolSigningStatus","type":"object"},"PublicAgentToolWarning":{"properties":{"code":{"const":"parameters_not_sent","description":"`parameters_not_sent`: the tool sends a request body but has no `body_template`, and these parameters appear in neither `url` nor `headers`, so they never reach the endpoint.","title":"Code","type":"string"},"parameters":{"description":"Names of the parameters the endpoint will not receive.","items":{"type":"string"},"title":"Parameters","type":"array"},"message":{"title":"Message","type":"string"}},"required":["code","parameters","message"],"title":"PublicAgentToolWarning","type":"object"},"PublicToolHeader":{"properties":{"name":{"title":"Name","type":"string"},"kind":{"enum":["custom","authorization_bearer","authorization_basic"],"title":"Kind","type":"string"},"value":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"description":"Header value; null for write-only headers: the credential kinds (authorization_bearer / authorization_basic) and custom headers whose name looks like a credential (containing auth, token, secret, password, cookie, signature, credential, bearer, jwt, api-key or a standalone key).","title":"Value"},"has_secret":{"default":false,"description":"Whether a write-only header has a stored value; the value itself is never returned.","title":"Has Secret","type":"boolean"}},"required":["name","kind"],"title":"PublicToolHeader","type":"object"},"PublicAgentToolUpdatePayload":{"additionalProperties":false,"properties":{"name":{"anyOf":[{"maxLength":120,"minLength":1,"type":"string"},{"type":"null"}],"default":null,"title":"Name"},"description":{"anyOf":[{"maxLength":2000,"type":"string"},{"type":"null"}],"default":null,"title":"Description"},"arguments":{"anyOf":[{"items":{"$ref":"#/components/schemas/AgentWebhookArgumentPayload"},"type":"array"},{"type":"null"}],"default":null,"description":"Older shape of `parameters`: each entry becomes a required string parameter. Mutually exclusive with `parameters` in one request. Reads return both, `arguments` being the string parameters of the schema.","title":"Arguments"},"parameters":{"anyOf":[{"additionalProperties":{"$ref":"#/components/schemas/JsonValue"},"type":"object"},{"type":"null"}],"default":null,"description":"Call parameters as a JSON Schema object (draft 2020-12): `type: object` (filled in when omitted), `properties`, `required`. Standard meaning throughout: `required` means the key must be present, `type: [\"string\", \"null\"]` allows null, `minLength: 1` makes a string non-empty, `enum` and `pattern` constrain the value, `default` fills a key the model left out. Mutually exclusive with `arguments` in one request. A tool created with `parameters` starts in `parameter_mode: strict`.","title":"Parameters"},"parameter_mode":{"anyOf":[{"enum":["legacy","strict"],"type":"string"},{"type":"null"}],"default":null,"description":"Whether the agent runtime checks each call's arguments against `parameters` before running the tool. `legacy` (the default for tools created with `arguments`, and every tool from before this field existed): no check, the model's arguments run as sent. `strict` (the default for tools created with `parameters`): a call that does not satisfy the schema is refused and the model is told to ask the caller for the missing information, and the LLM provider's constrained decoding is turned on where the model supports it (OpenAI models and a custom OpenAI-compatible endpoint receive the tool with `strict: true`, Gemini on the platform's native channel runs validated function calling). Changing `parameters` never changes the mode, and the mode can be changed on its own.","title":"Parameter Mode"},"method":{"anyOf":[{"enum":["GET","POST","PUT","PATCH","DELETE"],"type":"string"},{"type":"null"}],"default":null,"title":"Method"},"url":{"anyOf":[{"maxLength":4000,"minLength":1,"type":"string"},{"type":"null"}],"default":null,"title":"Url"},"content_type":{"anyOf":[{"maxLength":128,"type":"string"},{"type":"null"}],"default":null,"title":"Content Type"},"body_template":{"anyOf":[{"maxLength":100000,"type":"string"},{"type":"null"}],"default":null,"description":"Request body sent for non-GET calls. `{{argument}}`, `{{system.*}}` and custom session variable placeholders are filled in at call time; a missing value becomes empty. When the body's content type is JSON (the default `application/json`, any `+json` type, or a `Content-Type` header saying so), a placeholder inside a JSON string, such as `{\"note\": \"{{note}}\"}`, is JSON-escaped, so quotes, backslashes and newlines in the value keep the body valid JSON. A placeholder outside a string, such as `{\"count\": {{count}}}`, is inserted as is. Other content types are filled in as is. The body is only this template: parameters are not added on their own. With an empty template a non-GET call sends no body, and a parameter that `url` and `headers` do not reference either never reaches the endpoint.","title":"Body Template"},"headers":{"anyOf":[{"items":{"$ref":"#/components/schemas/AgentWebhookHeaderPayload"},"type":"array"},{"type":"null"}],"default":null,"title":"Headers"},"timeout_seconds":{"anyOf":[{"maximum":300,"minimum":1,"type":"integer"},{"type":"null"}],"default":null,"title":"Timeout Seconds"},"error_handling":{"anyOf":[{"enum":["passthrough","hide"],"type":"string"},{"type":"null"}],"default":null,"title":"Error Handling"},"mock_responses":{"anyOf":[{"items":{"$ref":"#/components/schemas/AgentWebhookMockResponsePayload"},"type":"array"},{"type":"null"}],"default":null,"title":"Mock Responses"},"expects_response":{"anyOf":[{"type":"boolean"},{"type":"null"}],"default":null,"title":"Expects Response"},"execution_mode":{"anyOf":[{"enum":["blocking","fire_and_forget","background"],"type":"string"},{"type":"null"}],"default":null,"title":"Execution Mode"},"pre_tool_speech":{"anyOf":[{"$ref":"#/components/schemas/AgentToolPreToolSpeech"},{"type":"null"}],"default":null,"description":"What the caller hears as this tool starts, when the agent's own reply has not said anything yet. `auto` (the default for a new tool): the platform decides for each call whether a line is worth saying, and the model writes the line when one is said. `static`: the agent says `message` as written (required, one language). `off`: nothing (what a tool created before this field reads as). Applies to blocking webhook tools and to client tools with `expects_response: true`. It is stored but not used for other tools."}},"title":"PublicAgentToolUpdatePayload","type":"object"},"AgentWebhookToolSigningSecretRotatePayload":{"additionalProperties":false,"properties":{"secret":{"anyOf":[{"maxLength":256,"minLength":24,"type":"string"},{"type":"null"}],"default":null,"description":"The new signing secret. Omit it to have one generated (`whsec_` plus 256 random bits), which is the recommended way.","title":"Secret"},"previous_secret_expires_in_seconds":{"default":86400,"description":"How long the replaced secret keeps signing next to the new one, as a second `v1`. Default 24 hours, at most 7 days. 0 switches at once. Ignored when signing was off.","maximum":604800,"minimum":0,"title":"Previous Secret Expires In Seconds","type":"integer"}},"title":"AgentWebhookToolSigningSecretRotatePayload","type":"object"},"PublicAgentTestSummary":{"properties":{"test_id":{"title":"Test Id","type":"string"},"workspace_id":{"title":"Workspace Id","type":"string"},"name":{"title":"Name","type":"string"},"test_type":{"enum":["next_reply","tool","simulation"],"title":"Test Type","type":"string"},"folder_id":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"description":"The test folder the test is in (`/v1/agent/test-folders`), null outside any folder.","title":"Folder Id"},"agent_ids":{"description":"Agents this test is attached to.","items":{"type":"string"},"title":"Agent Ids","type":"array"},"created_at":{"format":"date-time","title":"Created At","type":"string"},"updated_at":{"format":"date-time","title":"Updated At","type":"string"}},"required":["test_id","workspace_id","name","test_type","created_at","updated_at"],"title":"PublicAgentTestSummary","type":"object"},"AgentTestMessagePayload":{"properties":{"role":{"enum":["agent","user"],"title":"Role","type":"string"},"text":{"maxLength":2000,"minLength":1,"title":"Text","type":"string"}},"required":["role","text"],"title":"AgentTestMessagePayload","type":"object"},"AgentTestParamMatcher":{"additionalProperties":false,"description":"How one tool argument is compared: exact string equality, a regular\nexpression searched in the value, or mere presence. Regexes are\nJavaScript without flags, mock conditions run in the runtime as written\nand assertions are translated to Python for scoring.","properties":{"type":{"default":"exact","enum":["exact","regex","any"],"title":"Type","type":"string"},"value":{"anyOf":[{"maxLength":1000,"type":"string"},{"type":"null"}],"default":null,"title":"Value"}},"title":"AgentTestParamMatcher","type":"object"},"AgentTestReferencedTool":{"additionalProperties":false,"description":"Tool the runner should (or should not) observe on the next turn. A\nwebhook or client tool is referenced by its library id, an integration\ntool by \"<provider_key>:<tool_name>\" (for example\n\"google_calendar:create_event\"), a system tool by its tool name (for\nexample \"_end_call\"). `name` may be left out for a system tool.","properties":{"id":{"maxLength":64,"minLength":1,"title":"Id","type":"string"},"name":{"maxLength":200,"minLength":1,"title":"Name","type":"string"},"type":{"default":"webhook","enum":["webhook","client","integration","system"],"title":"Type","type":"string"},"description":{"default":"","maxLength":2000,"title":"Description","type":"string"}},"required":["id","name"],"title":"AgentTestReferencedTool","type":"object"},"AgentTestSimulationAssertions":{"additionalProperties":false,"description":"Deterministic checks run before the judge, no LLM involved.","properties":{"tool_calls":{"items":{"$ref":"#/components/schemas/AgentTestToolCallAssertion"},"maxItems":100,"title":"Tool Calls","type":"array"},"forbidden_tools":{"items":{"$ref":"#/components/schemas/AgentTestReferencedTool"},"maxItems":100,"title":"Forbidden Tools","type":"array"},"ended_by":{"anyOf":[{"enum":["agent","user","transfer","any"],"type":"string"},{"type":"null"}],"default":null,"title":"Ended By"}},"title":"AgentTestSimulationAssertions","type":"object"},"AgentTestSimulationConfig":{"additionalProperties":false,"properties":{"scenario":{"maxLength":10000,"minLength":1,"title":"Scenario","type":"string"},"max_turns":{"default":10,"maximum":50,"minimum":1,"title":"Max Turns","type":"integer"},"success_conditions":{"items":{"$ref":"#/components/schemas/AgentTestSuccessCondition"},"maxItems":10,"minItems":1,"title":"Success Conditions","type":"array"},"assertions":{"$ref":"#/components/schemas/AgentTestSimulationAssertions"},"tool_mocks":{"$ref":"#/components/schemas/AgentTestToolMocks"},"simulated_user_model":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Simulated User Model"},"repeat_count":{"default":1,"maximum":20,"minimum":1,"title":"Repeat Count","type":"integer"},"channel":{"anyOf":[{"enum":["web_voice","phone_inbound","phone_outbound"],"type":"string"},{"type":"null"}],"default":null,"title":"Channel"},"context":{"$ref":"#/components/schemas/AgentTestSimulationContext"}},"required":["scenario","success_conditions"],"title":"AgentTestSimulationConfig","type":"object"},"AgentTestSimulationContext":{"additionalProperties":false,"description":"The run's platform context switches, the agent config's `context`\nsection for a test. Off so a date pinned in the prompt holds.","properties":{"current_time":{"default":false,"title":"Current Time","type":"boolean"}},"title":"AgentTestSimulationContext","type":"object"},"AgentTestSuccessCondition":{"additionalProperties":false,"description":"One natural-language criterion the judge scores on the whole conversation.","properties":{"name":{"maxLength":80,"minLength":1,"title":"Name","type":"string"},"description":{"maxLength":500,"minLength":1,"title":"Description","type":"string"}},"required":["name","description"],"title":"AgentTestSuccessCondition","type":"object"},"AgentTestToolCallAssertion":{"additionalProperties":false,"description":"The agent must have called this tool, optionally with matching\narguments, between min_calls and max_calls times (calls that match).","properties":{"tool":{"$ref":"#/components/schemas/AgentTestReferencedTool"},"params":{"additionalProperties":{"$ref":"#/components/schemas/AgentTestParamMatcher"},"title":"Params","type":"object"},"min_calls":{"default":1,"maximum":100,"minimum":0,"title":"Min Calls","type":"integer"},"max_calls":{"anyOf":[{"maximum":100,"minimum":0,"type":"integer"},{"type":"null"}],"default":null,"title":"Max Calls"}},"required":["tool"],"title":"AgentTestToolCallAssertion","type":"object"},"AgentTestToolMock":{"additionalProperties":false,"description":"A canned result for one library or integration tool, optionally gated\non the call arguments. A system tool takes no mock.","properties":{"tool":{"$ref":"#/components/schemas/AgentTestReferencedTool"},"result":{"$ref":"#/components/schemas/JsonValue","default":null},"status":{"anyOf":[{"maximum":599,"minimum":100,"type":"integer"},{"type":"null"}],"default":null,"title":"Status"},"when":{"anyOf":[{"additionalProperties":{"$ref":"#/components/schemas/AgentTestParamMatcher"},"type":"object"},{"type":"null"}],"default":null,"title":"When"},"error":{"default":false,"title":"Error","type":"boolean"}},"required":["tool"],"title":"AgentTestToolMock","type":"object"},"AgentTestToolMocks":{"additionalProperties":false,"description":"all: every tool answers from a mock, except real_tools, which run for\nreal. selected: only the listed tools do, the rest follow fallback.\nnone: every tool hits its real endpoint.","properties":{"strategy":{"default":"all","enum":["all","selected","none"],"title":"Strategy","type":"string"},"fallback":{"default":"error","enum":["error","real"],"title":"Fallback","type":"string"},"tools":{"items":{"$ref":"#/components/schemas/AgentTestToolMock"},"maxItems":50,"title":"Tools","type":"array"},"real_tools":{"items":{"$ref":"#/components/schemas/AgentTestReferencedTool"},"maxItems":50,"title":"Real Tools","type":"array"}},"title":"AgentTestToolMocks","type":"object"},"AgentTestToolParameter":{"additionalProperties":false,"properties":{"name":{"maxLength":100,"minLength":1,"title":"Name","type":"string"},"value":{"anyOf":[{"type":"string"},{"type":"integer"},{"type":"number"},{"type":"boolean"}],"title":"Value"},"type":{"anyOf":[{"enum":["string","number","boolean"],"type":"string"},{"type":"null"}],"default":null,"title":"Type"}},"required":["name","value"],"title":"AgentTestToolParameter","type":"object"},"PublicAgentTestCreatePayload":{"additionalProperties":false,"properties":{"name":{"maxLength":200,"minLength":1,"title":"Name","type":"string"},"test_type":{"default":"next_reply","enum":["next_reply","tool","simulation"],"title":"Test Type","type":"string"},"folder_id":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"description":"The test folder to put the test in (`/v1/agent/test-folders`). null, an empty value and `root` all mean outside any folder. An id that is not a folder of the workspace the test is created in is ignored, and the test is created outside any folder.","title":"Folder Id"},"conversation":{"items":{"$ref":"#/components/schemas/AgentTestMessagePayload"},"title":"Conversation","type":"array"},"expectation":{"default":"","maxLength":400,"title":"Expectation","type":"string"},"success_examples":{"items":{"type":"string"},"title":"Success Examples","type":"array"},"failure_examples":{"items":{"type":"string"},"title":"Failure Examples","type":"array"},"referenced_tool":{"anyOf":[{"$ref":"#/components/schemas/AgentTestReferencedTool"},{"type":"null"}],"default":null},"tool_parameters":{"items":{"$ref":"#/components/schemas/AgentTestToolParameter"},"title":"Tool Parameters","type":"array"},"verify_absence":{"default":false,"title":"Verify Absence","type":"boolean"},"simulation":{"anyOf":[{"$ref":"#/components/schemas/AgentTestSimulationConfig"},{"type":"null"}],"default":null},"channel":{"anyOf":[{"enum":["web_voice","phone_inbound","phone_outbound"],"type":"string"},{"type":"null"}],"default":null,"description":"The channel a `next_reply` or `tool` test plays, `web_voice` when left out. The agent speaks and has the tools as on that channel: client tools on `web_voice` only, `_transfer_call` on the two phone channels, `_press_keys` and `_skip_turn` on `phone_outbound`. A `tool` test cannot reference a tool its channel lacks. A `simulation` test has its own in `simulation.channel`.","title":"Channel"},"dynamic_variables":{"additionalProperties":{"anyOf":[{"type":"string"},{"type":"integer"},{"type":"number"},{"type":"boolean"}]},"title":"Dynamic Variables","type":"object"},"judge":{"anyOf":[{"$ref":"#/components/schemas/AgentTestJudge"},{"type":"null"}],"default":null,"description":"The judge of a `next_reply` or `simulation` test. Null follows the workspace's Tests settings (`GET /v1/agent/test-settings`). A `tool` test has no judge, it is null there."},"agent_ids":{"description":"Agents to attach the test to. They must all be in one workspace, and the test is created there. Without agents the test goes into the API key owner's default workspace.","items":{"type":"string"},"maxItems":100,"title":"Agent Ids","type":"array"}},"required":["name"],"title":"PublicAgentTestCreatePayload","type":"object"},"PublicAgentTestMessage":{"properties":{"role":{"enum":["agent","user"],"title":"Role","type":"string"},"text":{"title":"Text","type":"string"}},"required":["role","text"],"title":"PublicAgentTestMessage","type":"object"},"PublicAgentTestUpdatePayload":{"additionalProperties":false,"properties":{"name":{"anyOf":[{"maxLength":200,"minLength":1,"type":"string"},{"type":"null"}],"default":null,"title":"Name"},"test_type":{"anyOf":[{"enum":["next_reply","tool","simulation"],"type":"string"},{"type":"null"}],"default":null,"title":"Test Type"},"folder_id":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"description":"The test folder to put the test in (`/v1/agent/test-folders`). null, an empty value and `root` all mean outside any folder. Leave it out to keep the test where it is. A folder that does not exist is a 404.","title":"Folder Id"},"conversation":{"anyOf":[{"items":{"$ref":"#/components/schemas/AgentTestMessagePayload"},"type":"array"},{"type":"null"}],"default":null,"title":"Conversation"},"expectation":{"anyOf":[{"maxLength":400,"type":"string"},{"type":"null"}],"default":null,"title":"Expectation"},"success_examples":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"default":null,"title":"Success Examples"},"failure_examples":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"default":null,"title":"Failure Examples"},"referenced_tool":{"anyOf":[{"$ref":"#/components/schemas/AgentTestReferencedTool"},{"type":"null"}],"default":null},"tool_parameters":{"anyOf":[{"items":{"$ref":"#/components/schemas/AgentTestToolParameter"},"type":"array"},{"type":"null"}],"default":null,"title":"Tool Parameters"},"verify_absence":{"anyOf":[{"type":"boolean"},{"type":"null"}],"default":null,"title":"Verify Absence"},"simulation":{"anyOf":[{"$ref":"#/components/schemas/AgentTestSimulationConfig"},{"type":"null"}],"default":null},"channel":{"anyOf":[{"enum":["web_voice","phone_inbound","phone_outbound"],"type":"string"},{"type":"null"}],"default":null,"description":"The channel a `next_reply` or `tool` test plays. `null` puts it back on `web_voice`.","title":"Channel"},"dynamic_variables":{"anyOf":[{"additionalProperties":{"anyOf":[{"type":"string"},{"type":"integer"},{"type":"number"},{"type":"boolean"}]},"type":"object"},{"type":"null"}],"default":null,"title":"Dynamic Variables"},"judge":{"anyOf":[{"$ref":"#/components/schemas/AgentTestJudge"},{"type":"null"}],"default":null,"description":"The judge of a `next_reply` or `simulation` test. Null follows the workspace's Tests settings (`GET /v1/agent/test-settings`). A `tool` test has no judge, it is null there. Left out, the test keeps its judge."}},"title":"PublicAgentTestUpdatePayload","type":"object"},"PublicAgentTestRunSummary":{"properties":{"run_id":{"title":"Run Id","type":"string"},"test_id":{"title":"Test Id","type":"string"},"agent_id":{"title":"Agent Id","type":"string"},"batch_id":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Batch Id"},"test_type":{"enum":["next_reply","tool","simulation"],"title":"Test Type","type":"string"},"repeat_index":{"default":0,"description":"Which repeat of the test in its batch this run is.","title":"Repeat Index","type":"integer"},"status":{"enum":["queued","running","passed","failed","error","cancelled"],"title":"Status","type":"string"},"needs_review":{"default":false,"description":"The judge could not decide, or a tool call had no mock answer.","title":"Needs Review","type":"boolean"},"error":{"default":"","title":"Error","type":"string"},"judge":{"anyOf":[{"$ref":"#/components/schemas/AgentTestJudge"},{"type":"null"}],"default":null,"description":"The model that judged the run and the reasoning level it judged at. Null on a `tool` test, which has no judge, on a run that ended before its judge was asked, and on `next_reply` runs from before the field existed. Simulation runs from before the judge could be chosen have a null level."},"usage":{"$ref":"#/components/schemas/PublicAgentTestRunUsage"},"created_at":{"format":"date-time","title":"Created At","type":"string"},"started_at":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}],"default":null,"title":"Started At"},"finished_at":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}],"default":null,"title":"Finished At"}},"required":["run_id","test_id","agent_id","test_type","status","created_at"],"title":"PublicAgentTestRunSummary","type":"object"},"AgentTestSettingsPatch":{"additionalProperties":false,"description":"Only the fields sent change.","properties":{"judge":{"anyOf":[{"$ref":"#/components/schemas/AgentTestJudge"},{"type":"null"}],"default":null,"description":"Null goes back to the platform default. Left out, unchanged."}},"title":"AgentTestSettingsPatch","type":"object"},"PublicTestFolder":{"properties":{"folder_id":{"title":"Folder Id","type":"string"},"workspace_id":{"title":"Workspace Id","type":"string"},"name":{"title":"Name","type":"string"},"created_at":{"format":"date-time","title":"Created At","type":"string"},"updated_at":{"format":"date-time","title":"Updated At","type":"string"}},"required":["folder_id","workspace_id","name","created_at","updated_at"],"title":"PublicTestFolder","type":"object"},"PublicTestFolderPayload":{"additionalProperties":false,"properties":{"name":{"description":"1-120 characters after leading and trailing whitespace is removed (a blank name is rejected). Unique within the workspace, case-sensitive.","maxLength":120,"minLength":1,"title":"Name","type":"string"}},"required":["name"],"title":"PublicTestFolderPayload","type":"object"},"PublicPhoneNumberEntity":{"properties":{"phone_number_id":{"title":"Phone Number Id","type":"string"},"workspace_id":{"title":"Workspace Id","type":"string"},"phone_number":{"description":"E.164, e.g. +14155550123.","title":"Phone Number","type":"string"},"provider":{"enum":["livekit","twilio","sip","whatsapp"],"title":"Provider","type":"string"},"label":{"default":"","title":"Label","type":"string"},"agent_id":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Inbound calls route to this agent; unbound numbers ring busy.","title":"Agent Id"},"transfer_caller_id":{"anyOf":[{"enum":["agent_number","original_caller"],"type":"string"},{"type":"null"}],"default":null,"description":"Managed `twilio` numbers: the caller ID a transfer target sees, on cold and warm transfers alike. `agent_number` shows this number, `original_caller` shows the caller's own number (a warm transfer falls back to this number when the caller withholds theirs). `null` for imported `sip` numbers, whose carrier decides.","title":"Transfer Caller Id"},"caller_id_sync_status":{"default":"carrier_managed","description":"`synced` once the carrier confirmed the policy, `pending` while it is being applied, `error` when the last attempt failed (send `retry_caller_id_sync`), `carrier_managed` for imported `sip` numbers.","enum":["synced","pending","error","carrier_managed"],"title":"Caller Id Sync Status","type":"string"},"caller_id_sync_error":{"default":"","description":"Why the last synchronization failed; empty otherwise.","title":"Caller Id Sync Error","type":"string"},"status":{"enum":["provisioning","active","error","released"],"title":"Status","type":"string"},"status_reason":{"anyOf":[{"enum":["out_of_credit","provisioning_failed"],"type":"string"},{"type":"null"}],"default":null,"description":"Why the number is in `error`, `null` in every other status. `out_of_credit` means the API credit balance could not pay the number's daily fee, so the number is suspended and refuses calls. Top up API credit and it resumes by itself. A number left unpaid for 30 days is released. `provisioning_failed` means buying or importing the number did not finish and it cannot take calls. Release it, then buy or import the number again. More values may be added, so treat an unknown one as a generic error.","title":"Status Reason"},"status_detail":{"default":"","description":"What failed when status is `error`; empty otherwise.","title":"Status Detail","type":"string"},"supports_outbound":{"default":false,"description":"Whether the number can place calls (outbound and warm-transfer consult legs): managed `twilio` always, imported `sip` only when a termination was configured.","title":"Supports Outbound","type":"boolean"},"termination_uri":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"description":"Imported `sip` numbers: the customer trunk's termination host.","title":"Termination Uri"},"inbound_auth_username":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"description":"Imported `sip` numbers: the inbound digest username. Passwords are never echoed.","title":"Inbound Auth Username"},"inbound_allowed_addresses":{"description":"Imported `sip` numbers: allowed source IPs/CIDRs.","items":{"type":"string"},"title":"Inbound Allowed Addresses","type":"array"},"termination_transport":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"description":"Imported `sip` numbers: termination transport.","title":"Termination Transport"},"termination_auth_username":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"description":"Imported `sip` numbers: the termination digest username. Passwords are never echoed.","title":"Termination Auth Username"},"termination_headers":{"additionalProperties":{"type":"string"},"description":"Imported `sip` numbers: custom SIP headers added to every outbound INVITE through the termination.","title":"Termination Headers","type":"object"},"created_at":{"format":"date-time","title":"Created At","type":"string"},"updated_at":{"format":"date-time","title":"Updated At","type":"string"}},"required":["phone_number_id","workspace_id","phone_number","provider","agent_id","status","created_at","updated_at"],"title":"PublicPhoneNumberEntity","type":"object"},"PublicPhoneNumberPurchasePayload":{"additionalProperties":false,"properties":{"provider":{"const":"twilio","description":"`twilio` buys from the managed inventory (supports call transfer); `sip` imports a number you already own at your carrier; see the `sip` request variant.","title":"Provider","type":"string"},"phone_number":{"description":"E.164 number from `GET /v1/agent/available-phone-numbers`, e.g. +14155550123.","title":"Phone Number","type":"string"},"label":{"default":"","maxLength":120,"title":"Label","type":"string"},"agent_id":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"description":"Bind an agent to answer inbound calls right away.","title":"Agent Id"}},"required":["provider","phone_number"],"title":"PublicPhoneNumberPurchasePayload","type":"object"},"PublicSipNumberImportPayload":{"additionalProperties":false,"description":"The `sip` variant of POST /v1/agent/phone-numbers: import a number that\nstays at your carrier. Point your trunk's origination at our SIP host,\ngive inbound at least one authentication factor (digest and/or source\nCIDRs), and optionally a termination host + credentials (plus custom\n`X-` headers for every outbound INVITE) so the number can place calls.\nNothing is rented: carrier charges stay on your account, and\nimported numbers carry no telephony charges at all: no monthly fee, no\nphone surcharge, no transfer fees; you pay agent minutes only.","properties":{"inbound_auth_username":{"default":"","maxLength":128,"title":"Inbound Auth Username","type":"string"},"inbound_auth_password":{"default":"","maxLength":128,"title":"Inbound Auth Password","type":"string"},"inbound_allowed_addresses":{"items":{"type":"string"},"maxItems":32,"title":"Inbound Allowed Addresses","type":"array"},"termination_uri":{"default":"","title":"Termination Uri","type":"string"},"termination_transport":{"default":"auto","enum":["auto","udp","tcp","tls"],"title":"Termination Transport","type":"string"},"termination_auth_username":{"default":"","maxLength":128,"title":"Termination Auth Username","type":"string"},"termination_auth_password":{"default":"","maxLength":128,"title":"Termination Auth Password","type":"string"},"termination_headers":{"additionalProperties":{"type":"string"},"title":"Termination Headers","type":"object"},"phone_number":{"title":"Phone Number","type":"string"},"label":{"default":"","maxLength":120,"title":"Label","type":"string"},"agent_id":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Agent Id"},"provider":{"const":"sip","title":"Provider","type":"string"}},"required":["phone_number","provider"],"title":"PublicSipNumberImportPayload","type":"object"},"PublicPhoneNumberUpdatePayload":{"additionalProperties":false,"properties":{"label":{"anyOf":[{"maxLength":120,"type":"string"},{"type":"null"}],"default":null,"title":"Label"},"agent_id":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"description":"Agent that answers this number's inbound calls. Explicit null unbinds; omit the field to keep the current binding.","title":"Agent Id"},"transfer_caller_id":{"anyOf":[{"enum":["agent_number","original_caller"],"type":"string"},{"type":"null"}],"default":null,"description":"Managed `twilio` numbers only: the caller ID a transfer target sees, `agent_number` (this number) or `original_caller` (the caller's own number). Applies to cold and warm transfers. It is a number setting, not agent config: no publish is needed and agent rollbacks leave it alone. Warm transfers follow it from the next call, cold transfers once `caller_id_sync_status` is `synced`. The deprecated boolean `cold_transfer_use_original_caller` is still accepted in its place.","title":"Transfer Caller Id"},"retry_caller_id_sync":{"default":false,"description":"Re-apply the current caller ID policy after a failed synchronization.","title":"Retry Caller Id Sync","type":"boolean"}},"title":"PublicPhoneNumberUpdatePayload","type":"object"},"PublicSipNumberConfigPayload":{"additionalProperties":false,"description":"Full desired trunk config for PUT /v1/agent/phone-numbers/{id}/sip-config.\nSend the complete configuration; leaving a password empty beside a set\nusername keeps the stored one. `termination_headers` replaces the whole\nheader map (send `{}` to remove all custom headers).","properties":{"inbound_auth_username":{"default":"","maxLength":128,"title":"Inbound Auth Username","type":"string"},"inbound_auth_password":{"default":"","maxLength":128,"title":"Inbound Auth Password","type":"string"},"inbound_allowed_addresses":{"items":{"type":"string"},"maxItems":32,"title":"Inbound Allowed Addresses","type":"array"},"termination_uri":{"default":"","title":"Termination Uri","type":"string"},"termination_transport":{"default":"auto","enum":["auto","udp","tcp","tls"],"title":"Termination Transport","type":"string"},"termination_auth_username":{"default":"","maxLength":128,"title":"Termination Auth Username","type":"string"},"termination_auth_password":{"default":"","maxLength":128,"title":"Termination Auth Password","type":"string"},"termination_headers":{"additionalProperties":{"type":"string"},"title":"Termination Headers","type":"object"}},"title":"PublicSipNumberConfigPayload","type":"object"},"PhoneCallCreatePayload":{"additionalProperties":false,"description":"POST phone-calls body, shared by the public and console routes.\n\nto_number is deliberately not format-validated here: the contract orders\nthe E.164 check after the agent/published checks, so it runs in the\nservice with a machine-readable reason.","properties":{"agent_id":{"title":"Agent Id","type":"string"},"phone_number_id":{"description":"The team-owned number to dial from (twilio provider only).","title":"Phone Number Id","type":"string"},"to_number":{"description":"Destination in E.164, e.g. +14155550123.","title":"To Number","type":"string"},"dynamic_variables":{"anyOf":[{"additionalProperties":{"anyOf":[{"type":"string"},{"type":"integer"},{"type":"number"},{"type":"boolean"}]},"maxProperties":500,"type":"object"},{"type":"null"}],"default":null,"title":"Dynamic Variables"},"overrides":{"anyOf":[{"$ref":"#/components/schemas/AgentSessionOverridesPayload"},{"type":"null"}],"default":null},"metadata":{"anyOf":[{"additionalProperties":{"$ref":"#/components/schemas/JsonValue"},"type":"object"},{"type":"null"}],"default":null,"title":"Metadata"},"llm_extra_body":{"anyOf":[{"additionalProperties":{"$ref":"#/components/schemas/JsonValue"},"type":"object"},{"type":"null"}],"default":null,"title":"Llm Extra Body"},"sip_headers":{"anyOf":[{"additionalProperties":{"type":"string"},"type":"object"},{"type":"null"}],"default":null,"description":"Custom SIP headers for this call's INVITE, imported SIP numbers only. Same rules as the number's termination_headers, and merged over them.","title":"Sip Headers"}},"required":["agent_id","phone_number_id","to_number"],"title":"PhoneCallCreatePayload","type":"object"},"AgentBackgroundSoundEntity":{"properties":{"_id":{"title":"Id","type":"string"},"name":{"title":"Name","type":"string"},"duration_seconds":{"title":"Duration Seconds","type":"number"},"size_bytes":{"title":"Size Bytes","type":"integer"},"created_at":{"format":"date-time","title":"Created At","type":"string"}},"required":["_id","name","duration_seconds","size_bytes","created_at"],"title":"AgentBackgroundSoundEntity","type":"object"},"PublicLLMLongContextRates":{"properties":{"over_prompt_tokens":{"description":"A request whose prompt is larger than this many tokens bills at these rates. The prompt is its input, cache read and cache write tokens together.","title":"Over Prompt Tokens","type":"integer"},"usd_per_million_tokens":{"$ref":"#/components/schemas/PublicLLMTokenRates"}},"required":["over_prompt_tokens","usd_per_million_tokens"],"title":"PublicLLMLongContextRates","type":"object"},"PublicLLMModel":{"properties":{"id":{"description":"The model id, as set in `llm.model` on an agent's config.","enum":["google/gemini-3.5-flash-lite","google/gemini-3.6-flash","google/gemini-3.8-flash","google/gemini-3.6-flash-priority","google/gemini-3.8-flash-priority","google/gemini-3.5-flash-lite-priority","google/gemini-4-hydrogen","google/gemini-4-neon","google/gemini-4-hydrogen-priority","google/gemini-4-neon-priority","google/gemini-2.5-flash","google/gemma-4-26b-a4b-it","anthropic/claude-haiku-4.5","anthropic/claude-sonnet-4.6","anthropic/claude-sonnet-5.5","anthropic/claude-opus-5.5","anthropic/claude-fable-5.1","anthropic/claude-fable-5.2","openai/gpt-5.6-luna","openai/gpt-6-luna","openai/gpt-5","openai/gpt-6.1-sol","openai/gpt-6.1-terra","openai/gpt-6-astra","openai/gpt-6.2-sol","openai/gpt-4o","openai/gpt-4.1","openai/gpt-5.6-luna-fast","openai/gpt-6-luna-fast","openai/gpt-6.1-terra-fast","openai/gpt-6.1-sol-fast","openai/gpt-6-astra-fast","openai/gpt-6.2-sol-fast","openai/gpt-4o-fast","openai/gpt-4.1-fast"],"title":"Id","type":"string"},"included_in_conversation_rate":{"description":"Whether the conversation rate covers this model's tokens. When true, a conversation on the model has no LLM charge, and its rates apply where no conversation rate is charged, such as Simulation tests.","title":"Included In Conversation Rate","type":"boolean"},"usd_per_million_tokens":{"$ref":"#/components/schemas/PublicLLMTokenRates","description":"What the model's tokens cost in USD per one million tokens, by token category, as decimal strings."},"long_context":{"anyOf":[{"$ref":"#/components/schemas/PublicLLMLongContextRates"},{"type":"null"}],"description":"Rates that replace `usd_per_million_tokens` on a request with a long prompt. Null when the model has no such tier."},"reference_latency_ms":{"anyOf":[{"type":"integer"},{"type":"null"}],"description":"A reference time to the model's first token on a voice turn, in milliseconds. It is a measured median for comparing models, and the latency of a call varies with its prompt and the time of day. Null when the model has no measurement.","title":"Reference Latency Ms"},"max_system_prompt_tokens":{"description":"The longest `prompt.system_prompt` an agent on this model can save, in o200k_base tokens. A longer one is rejected with 422.","title":"Max System Prompt Tokens","type":"integer"},"test_judge":{"anyOf":[{"$ref":"#/components/schemas/PublicLLMTestJudge"},{"type":"null"}],"description":"How the model judges `next_reply` and `simulation` tests, as the `judge` of a test or of a workspace's Tests settings. Null when it cannot judge them."}},"required":["id","included_in_conversation_rate","usd_per_million_tokens","long_context","reference_latency_ms","max_system_prompt_tokens","test_judge"],"title":"PublicLLMModel","type":"object"},"PublicLLMTestJudge":{"properties":{"reasoning_levels":{"description":"The reasoning levels a judge of this model may name.","items":{"$ref":"#/components/schemas/PublicLLMTestJudgeLevel"},"title":"Reasoning Levels","type":"array"}},"required":["reasoning_levels"],"title":"PublicLLMTestJudge","type":"object"},"PublicLLMTestJudgeLevel":{"properties":{"level":{"enum":["off","low","medium","high","very_high"],"title":"Level","type":"string"},"default":{"type":"boolean","description":"The level the model judges at when a judge names none.","title":"Default"}},"required":["level","default"],"title":"PublicLLMTestJudgeLevel","type":"object"},"PublicLLMTokenRates":{"properties":{"input":{"description":"Input tokens neither read from nor written to the prompt cache.","title":"Input","type":"string"},"cache_read":{"description":"Input tokens read from the prompt cache.","title":"Cache Read","type":"string"},"cache_write_5m":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Input tokens written to the prompt cache. Null when the model has no cache write charge.","title":"Cache Write 5M"},"output":{"description":"Output tokens, reasoning tokens included.","title":"Output","type":"string"}},"required":["input","cache_read","cache_write_5m","output"],"title":"PublicLLMTokenRates","type":"object"},"ASRSegment":{"properties":{"text":{"title":"Text","type":"string"},"start":{"title":"Start","type":"number"},"end":{"title":"End","type":"number"}},"required":["text","start","end"],"title":"ASRSegment","type":"object"},"PronunciationDictionaryV1Entity":{"description":"A pronunciation dictionary owned by the caller's team.","properties":{"id":{"description":"Stable dictionary identifier.","examples":["9b2f5c0d4e6a4f4c8a1d3e5f7a9b0c2d"],"title":"Id","type":"string"},"name":{"description":"Display name for the dictionary.","examples":["Product names"],"title":"Name","type":"string"},"description":{"description":"Free-form description shown in the web app.","examples":["Brand and product pronunciations for support scripts."],"title":"Description","type":"string"},"latest_version_id":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"description":"Identifier of the latest published version, or null when the dictionary has never been published.","examples":["1c3e5a7b9d0f4a2c8e6b4d1f3a5c7e9b"],"title":"Latest Version Id"},"item_count":{"default":0,"description":"Number of rules in the latest published version.","examples":[12],"title":"Item Count","type":"integer"},"preview_voice_id":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"description":"Voice model last used by the dictionary's preview player, or null when it was never previewed.","examples":["b1a2c3d4e5f60718293a4b5c6d7e8f90"],"title":"Preview Voice Id"},"preview_model":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"description":"TTS model last used by the dictionary's preview player, or null when it was never previewed.","examples":["s2-pro"],"title":"Preview Model"},"created_at":{"description":"Creation time (UTC).","examples":["2026-11-05T03:21:09Z"],"format":"date-time","title":"Created At","type":"string"},"updated_at":{"description":"Last content or metadata update time (UTC).","examples":["2026-11-05T04:02:44Z"],"format":"date-time","title":"Updated At","type":"string"}},"required":["id","name","description","created_at","updated_at"],"title":"PronunciationDictionaryV1Entity","type":"object"},"PronunciationDictionaryCreatePayload":{"properties":{"name":{"description":"Display name for the dictionary (1-128 characters).","examples":["Product names"],"maxLength":128,"minLength":1,"title":"Name","type":"string"},"description":{"default":"","description":"Optional free-form description (up to 1024 characters).","examples":["Brand and product pronunciations for support scripts."],"maxLength":1024,"title":"Description","type":"string"}},"required":["name"],"title":"PronunciationDictionaryCreatePayload","type":"object"},"PronunciationDictionaryUpdatePayload":{"properties":{"name":{"anyOf":[{"maxLength":128,"minLength":1,"type":"string"},{"type":"null"}],"default":null,"description":"New display name; omitted or null leaves it unchanged.","examples":["Product names"],"title":"Name"},"description":{"anyOf":[{"maxLength":1024,"type":"string"},{"type":"null"}],"default":null,"description":"New description; omitted or null leaves it unchanged.","examples":["Brand and product pronunciations for support scripts."],"title":"Description"}},"title":"PronunciationDictionaryUpdatePayload","type":"object"},"PronunciationDictionaryV1VersionEntity":{"description":"A published, immutable snapshot of a dictionary.","properties":{"id":{"description":"Stable version identifier.","examples":["1c3e5a7b9d0f4a2c8e6b4d1f3a5c7e9b"],"title":"Id","type":"string"},"dictionary_id":{"description":"Dictionary this version belongs to.","examples":["9b2f5c0d4e6a4f4c8a1d3e5f7a9b0c2d"],"title":"Dictionary Id","type":"string"},"description":{"description":"Version note entered when publishing.","examples":["Add the new product names"],"title":"Description","type":"string"},"version_number":{"anyOf":[{"type":"integer"},{"type":"null"}],"default":null,"description":"Monotonic version number within the dictionary. Null only for versions published before version numbers existed.","examples":[3],"title":"Version Number"},"added_count":{"default":0,"description":"Rules added relative to the previous version.","examples":[2],"title":"Added Count","type":"integer"},"removed_count":{"default":0,"description":"Rules removed relative to the previous version.","examples":[0],"title":"Removed Count","type":"integer"},"changed_count":{"default":0,"description":"Rules whose key, value, type or case sensitivity changed.","examples":[1],"title":"Changed Count","type":"integer"},"item_count":{"default":0,"description":"Total number of rules in this version.","examples":[12],"title":"Item Count","type":"integer"},"created_at":{"description":"Publish time (UTC).","examples":["2026-11-05T04:02:44Z"],"format":"date-time","title":"Created At","type":"string"}},"required":["id","dictionary_id","description","created_at"],"title":"PronunciationDictionaryV1VersionEntity","type":"object"},"PronunciationDictionaryItemPayload":{"properties":{"key":{"description":"Substring to match in the request text (1-256 characters). Alias rules may not start or end with whitespace and may not contain control characters, `<`, `>`, `(`, `)`, `[` or `]`.","examples":["Fish Audio"],"maxLength":256,"minLength":1,"title":"Key","type":"string"},"value":{"description":"Replacement text (1-1024 characters). For phoneme rules this is the phonetic form without the `<|phoneme_start|>` / `<|phoneme_end|>` markers; for alias rules it is plain text. Neither may contain `<|` or `|>`.","examples":["fɪʃ ˈɔːdi.oʊ"],"maxLength":1024,"minLength":1,"title":"Value","type":"string"},"type":{"default":"phoneme","description":"Replacement mode: `phoneme` (default, and also the meaning of an omitted or null value) speaks the value as a phonetic form; `alias` substitutes the literal text. Other values return 422.","enum":["phoneme","alias"],"examples":["phoneme"],"title":"Type","type":"string"},"case_sensitive":{"default":false,"description":"When true, matching is case-sensitive; when false, ASCII case folding is applied.","examples":[false],"title":"Case Sensitive","type":"boolean"}},"required":["key","value"],"title":"PronunciationDictionaryItemPayload","type":"object"},"PronunciationDictionaryVersionCreatePayload":{"properties":{"expected_latest_version_id":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"description":"Optimistic-concurrency guard: the latest version ID the caller believes is current, or null for the first publish. A mismatch returns 409.","examples":["1c3e5a7b9d0f4a2c8e6b4d1f3a5c7e9b"],"title":"Expected Latest Version Id"},"description":{"default":"","description":"Optional version note (up to 1024 characters).","examples":["Add the new product names"],"maxLength":1024,"title":"Description","type":"string"},"items":{"description":"Complete ordered rule list for the new version (up to 5000 rules). Keys must be unique within the version; order is the engine's application order.","items":{"$ref":"#/components/schemas/PronunciationDictionaryItemPayload"},"maxItems":5000,"title":"Items","type":"array"}},"title":"PronunciationDictionaryVersionCreatePayload","type":"object"},"PronunciationDictionaryV1Item":{"description":"One key/value rule in a published version.","properties":{"key":{"description":"Substring to match in the request text. 1-256 characters. Alias rules may not start or end with whitespace and may not contain control characters, `<`, `>`, `(`, `)`, `[` or `]`.","examples":["Fish Audio"],"title":"Key","type":"string"},"value":{"description":"Replacement text. 1-1024 characters. For phoneme rules it is the phonetic form (without the `<|phoneme_start|>` / `<|phoneme_end|>` markers); for alias rules it is plain text. Neither type may contain `<|` or `|>`.","examples":["fɪʃ ˈɔːdi.oʊ"],"title":"Value","type":"string"},"type":{"default":"phoneme","description":"How the key is replaced: `phoneme` (default) speaks the value as a phonetic form; `alias` substitutes the literal text, which is then read like the rest of the request.","enum":["phoneme","alias"],"examples":["phoneme"],"title":"Type","type":"string"},"case_sensitive":{"default":false,"description":"When true, matching is case-sensitive; when false, ASCII case folding is applied.","examples":[false],"title":"Case Sensitive","type":"boolean"}},"required":["key","value"],"title":"PronunciationDictionaryV1Item","type":"object"},"PronunciationDictionaryV1CompareRow":{"description":"One rule row in a version comparison.","properties":{"key":{"description":"Key in the target version.","examples":["Fish"],"title":"Key","type":"string"},"value":{"description":"Value in the target version.","examples":["fɪʃ"],"title":"Value","type":"string"},"type":{"default":"phoneme","description":"Replacement type in the target version.","enum":["phoneme","alias"],"examples":["phoneme"],"title":"Type","type":"string"},"case_sensitive":{"description":"Case sensitivity in the target version.","examples":[false],"title":"Case Sensitive","type":"boolean"},"order":{"anyOf":[{"type":"integer"},{"type":"null"}],"default":null,"description":"Position in the target version; null for a removed row (the rule only exists in the base version).","examples":[0],"title":"Order"},"status":{"description":"Change relative to the base version: `added` only in target, `removed` only in base, `changed` with different content, `moved` with identical content but a different position, `unchanged`.","enum":["added","removed","changed","moved","unchanged"],"examples":["changed"],"title":"Status","type":"string"},"base_key":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"description":"Key in the base version; only for changed, moved or removed rows.","examples":["Fish"],"title":"Base Key"},"base_value":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"description":"Value in the base version; only for changed, moved or removed rows.","examples":["fɪʃ"],"title":"Base Value"},"base_type":{"anyOf":[{"enum":["phoneme","alias"],"type":"string"},{"type":"null"}],"default":null,"description":"Replacement type in the base version; only for changed, moved or removed rows.","examples":["phoneme"],"title":"Base Type"},"base_case_sensitive":{"anyOf":[{"type":"boolean"},{"type":"null"}],"default":null,"description":"Case sensitivity in the base version; only for changed, moved or removed rows.","examples":[false],"title":"Base Case Sensitive"},"base_order":{"anyOf":[{"type":"integer"},{"type":"null"}],"default":null,"description":"Position in the base version; only for changed, moved or removed rows.","examples":[0],"title":"Base Order"}},"required":["key","value","case_sensitive","status"],"title":"PronunciationDictionaryV1CompareRow","type":"object"},"PronunciationDictionaryInline":{"additionalProperties":false,"description":"Inline literal pronunciation dictionary. The server forwards the entries directly to the inference engine without contacting the platform.","properties":{"items":{"description":"Replacement entries for this dictionary. See the top-level `pronunciation_dictionary` field description for replacement semantics.","items":{"$ref":"#/components/schemas/PronunciationItem"},"maxItems":5000,"title":"Items","type":"array"}},"required":["items"],"title":"PronunciationDictionaryInline","type":"object"},"PronunciationDictionaryRef":{"additionalProperties":false,"description":"Reference to a server-managed pronunciation dictionary. The server resolves contents via the platform pronunciation-dictionaries API and forwards the full merged dictionary to the inference engine, which performs the substitution.","properties":{"id":{"description":"Dictionary identifier as registered on the platform.","pattern":"^[A-Za-z0-9_-]{1,128}$","title":"Id","type":"string"},"version":{"description":"Immutable version identifier for the dictionary. Version is required — there is no implicit `latest`.","pattern":"^[A-Za-z0-9_-]{1,128}$","title":"Version","type":"string"}},"required":["id","version"],"title":"PronunciationDictionaryRef","type":"object"},"PronunciationItem":{"additionalProperties":false,"description":"A single key/value entry in a pronunciation dictionary. The inference engine replaces every occurrence of `key` in the request text with `value` during synthesis. With the default `type: \"phoneme\"` the value is spoken as a phonetic form; with `type: \"alias\"` it is substituted as plain text.","properties":{"key":{"description":"Source substring to match. Pure substring match — no tokenization, no regex. Overlapping matches resolve leftmost-longest. For CJK text include enough context to disambiguate. For `type: \"alias\"` the key must not start or end with whitespace and must not contain control characters, `<`, `>`, `(`, `)`, `[` or `]`.","maxLength":256,"minLength":1,"title":"Key","type":"string"},"value":{"description":"Replacement for the key during synthesis. For `type: \"phoneme\"` this is a phonetic representation; dictionary authors should NOT include the `<|phoneme_start|>` / `<|phoneme_end|>` markers themselves, because the inference engine wraps the value with those markers internally so the body is treated as phonemes rather than orthographic text. For `type: \"alias\"` this is plain text substituted verbatim (then normalized with the rest of the request text) and must not contain `<|` or `|>`. Requests whose key or value contain either phoneme marker are rejected.","maxLength":1024,"minLength":1,"title":"Value","type":"string"},"type":{"default":"phoneme","description":"How `value` replaces `key`. `phoneme` (default) speaks the value as a phonetic form. `alias` substitutes the literal text, which then goes through the same text normalization as the rest of the request. Omitted or `null` means `phoneme`, so existing dictionaries and clients keep their behaviour. Any other value is rejected. Usage is billed on the text actually synthesized, with alias replacements counted: an alias that expands a key is billed for the longer text, one that shortens it is billed for the shorter text; phoneme rules never change billing.","enum":["phoneme","alias"],"title":"Type","type":"string"},"case_sensitive":{"default":false,"description":"When true the match is case-sensitive; when false ASCII case folding is applied.","title":"Case Sensitive","type":"boolean"}},"required":["key","value"],"title":"PronunciationItem","type":"object"},"ProsodyControl":{"description":"Controls for adjusting the prosody (rhythm and intonation) of generated speech.","properties":{"speed":{"default":1.0,"description":"Speaking rate multiplier. Valid range: 0.5 to 2.0. 1.0 = normal speed, 0.5 = half speed, 2.0 = double speed. Useful for adjusting pacing without regenerating audio.","title":"Speed","type":"number"},"volume":{"default":0.0,"description":"Volume adjustment in decibels (dB). 0 = no change, positive values = louder, negative values = quieter.","title":"Volume","type":"number"},"normalize_loudness":{"default":true,"description":"Normalize output loudness for more consistent perceived volume. Applies to the S2 family (`s2-pro`, `s2.1-pro`, `s2.1-pro-free`); on `s1` it is accepted but has no effect.","title":"Normalize Loudness","type":"boolean"}},"title":"ProsodyControl","type":"object"},"ReferenceAudio":{"description":"A voice sample with its transcript, used for zero-shot voice cloning. The model will attempt to match the voice characteristics from the audio sample.","properties":{"audio":{"description":"Raw audio bytes of the voice sample. Supported formats: WAV, MP3, FLAC. For best results, use 10-30 seconds of clear speech with minimal background noise.","format":"binary","title":"Audio","type":"string"},"text":{"description":"The exact transcript of what is spoken in the audio sample. Accuracy is important for voice cloning quality.","title":"Text","type":"string"}},"required":["audio","text"],"title":"ReferenceAudio","type":"object"},"TTSRequest":{"description":"Request body for text-to-speech synthesis. Supports single-speaker synthesis on all compatible TTS models. Multi-speaker dialogue synthesis is available with the S2 family (`s2-pro`, `s2.1-pro`, `s2.1-pro-free`) and `drama-3`, not `s1`.\n\n## Single Speaker\nProvide either `reference_id` (string) pointing to a voice model, or `references` (array of ReferenceAudio) for zero-shot cloning.\n\n## Multiple Speakers (Dialogue — S2 family and `drama-3`)\nFor multi-speaker synthesis, provide:\n- `reference_id`: array of voice model IDs, e.g., [\"speaker-0-id\", \"speaker-1-id\"]\n- `text`: use speaker tags `<|speaker:0|>`, `<|speaker:1|>`, etc. to indicate speaker changes, e.g., \"<|speaker:0|>Hello!<|speaker:1|>Hi there!\"\n\nAlternatively, for zero-shot multi-speaker:\n- `references`: 2D array where each inner array contains references for one speaker\n- `reference_id`: array of identifiers (can be arbitrary strings for zero-shot)\n\n## Example (Multi-Speaker with Model IDs)\n```json\n{\n  \"text\": \"<|speaker:0|>Good morning!<|speaker:1|>Good morning! How are you?<|speaker:0|>I'm great, thanks!\",\n  \"reference_id\": [\"model-id-alice\", \"model-id-bob\"]\n}\n```","properties":{"text":{"description":"Text to convert to speech.","title":"Text","type":"string"},"temperature":{"default":0.7,"description":"Controls expressiveness. Higher is more varied, lower is more consistent.","maximum":1.0,"minimum":0.0,"title":"Temperature","type":"number"},"top_p":{"default":0.7,"description":"Controls diversity via nucleus sampling.","maximum":1.0,"minimum":0.0,"title":"Top P","type":"number"},"references":{"anyOf":[{"description":"Single speaker: array of reference audio samples","items":{"$ref":"#/components/schemas/ReferenceAudio"},"type":"array"},{"description":"Multiple speakers: array of arrays, where each inner array contains reference samples for one speaker","items":{"items":{"$ref":"#/components/schemas/ReferenceAudio"},"type":"array"},"type":"array"},{"type":"null"}],"description":"Inline voice references for zero-shot cloning. Requires MessagePack (not JSON). For single speaker, provide an array of ReferenceAudio objects. For multiple speakers, provide an array of arrays where each inner array contains references for one speaker. **Multi-speaker is available with the S2 family (`s2-pro`, `s2.1-pro`, `s2.1-pro-free`) and `drama-3`, not `s1`.** The speaker index corresponds to the index in reference_id array. Example for multi-speaker: [[{audio, text}], [{audio, text}, {audio, text}]] for 2 speakers where speaker 1 has 2 reference samples.","title":"References"},"reference_id":{"anyOf":[{"description":"Single speaker: voice model ID string","type":"string"},{"description":"Multiple speakers: array of voice model IDs, one per speaker","items":{"type":"string"},"type":"array"},{"type":"null"}],"default":null,"description":"Voice model ID(s) from Fish Audio library or your custom models. For single-speaker synthesis, provide a string. For multi-speaker synthesis (dialogue), provide an array of model IDs. **Multi-speaker is available with the S2 family (`s2-pro`, `s2.1-pro`, `s2.1-pro-free`) and `drama-3`, not `s1`.** When using multiple speakers, use speaker tags in your text like `<|speaker:0|>` and `<|speaker:1|>` to indicate speaker changes. Example: `<|speaker:0|>Hello!<|speaker:1|>Hi there!<|speaker:0|>How are you?` with `reference_id: [\"speaker-a-id\", \"speaker-b-id\"]`.","title":"Reference Id"},"prosody":{"anyOf":[{"$ref":"#/components/schemas/ProsodyControl"},{"type":"null"}],"default":null,"description":"Speed and volume adjustments for the output."},"chunk_length":{"default":300,"description":"Text segment size for processing.","maximum":300,"minimum":100,"title":"Chunk Length","type":"integer"},"normalize":{"default":true,"description":"Rewrites numbers, dates, units and symbols as spoken words before synthesis, improving stability. Uses `language` when it is set and otherwise detects the language of each text chunk.","title":"Normalize","type":"boolean"},"language":{"anyOf":[{"maxLength":35,"pattern":"^[A-Za-z0-9_-]*$","type":"string"},{"type":"null"}],"default":null,"description":"BCP-47 language tag of the text, for example `en`, `es-MX` or `zh-CN`. Case-insensitive, and `_` is read as `-`. Used only by text normalization (how numbers, dates, units and symbols are spelled out before synthesis) and by word-timestamp alignment. It is not passed to the speech model and does not change the voice, accent or audio quality; a wrong tag only changes how those tokens are spelled out. Omit it, or send `auto` or an empty string, to detect the language per chunk. A tag without dedicated normalization rules skips normalization instead of failing. Without a region, Spanish follows Spain conventions; send `es-MX` for Mexican readings. When `normalize` is false it only affects word timestamps. For text that mixes languages, leave it unset.","examples":["en","es-MX","zh-CN"],"title":"Language"},"format":{"default":"mp3","description":"Output audio format.","enum":["wav","pcm","mp3","opus"],"title":"Format","type":"string"},"sample_rate":{"anyOf":[{"type":"integer"},{"type":"null"}],"default":null,"description":"Audio sample rate in Hz. When null, uses the format's default (44100 Hz for most formats, 48000 Hz for opus).","title":"Sample Rate"},"mp3_bitrate":{"default":128,"description":"MP3 bitrate in kbps. Only applies when format is mp3.","enum":[64,128,192],"title":"Mp3 Bitrate","type":"integer"},"opus_bitrate":{"default":-1000,"description":"Opus bitrate in bps. -1000 for automatic. Only applies when format is opus.","enum":[-1000,24000,32000,48000,64000],"title":"Opus Bitrate","type":"integer"},"latency":{"default":"balanced","description":"Latency-quality trade-off. normal: best quality, balanced: reduced latency, low: lowest latency.","enum":["low","normal","balanced"],"title":"Latency","type":"string"},"max_new_tokens":{"default":1024,"description":"Maximum audio tokens to generate per text chunk.","title":"Max New Tokens","type":"integer"},"repetition_penalty":{"default":1.2,"description":"Penalty for repeating audio patterns. Values above 1.0 reduce repetition.","title":"Repetition Penalty","type":"number"},"min_chunk_length":{"default":50,"description":"Minimum characters before splitting into a new chunk.","maximum":100,"minimum":0,"title":"Min Chunk Length","type":"integer"},"condition_on_previous_chunks":{"default":true,"description":"Use previous audio as context for voice consistency.","title":"Condition On Previous Chunks","type":"boolean"},"early_stop_threshold":{"default":1.0,"description":"Early stopping threshold for batch processing.","maximum":1.0,"minimum":0.0,"title":"Early Stop Threshold","type":"number"},"features":{"default":[],"description":"Optional request-scoped TTS feature flags forwarded verbatim to the inference backend. Use [\"quality-guard\"] to enable the quality guard for this synthesis request. Feature availability is determined by the inference backend.","items":{"type":"string"},"title":"Features","type":"array"},"pronunciation_dictionary":{"anyOf":[{"description":"Reference form: list of pointers to platform pronunciation dictionaries. Each entry identifies a dictionary by `id` and `version`; the server resolves the contents from the platform service before forwarding them to the inference engine.","items":{"$ref":"#/components/schemas/PronunciationDictionaryRef"},"maxItems":3,"type":"array"},{"description":"Inline form: list of literal pronunciation dictionaries. Each dictionary carries an `items` array of `{key, value, type?, case_sensitive?}` entries.","items":{"$ref":"#/components/schemas/PronunciationDictionaryInline"},"maxItems":3,"type":"array"},{"type":"null"}],"default":null,"description":"Optional list of up to 3 pronunciation dictionaries to apply during synthesis. Provide either references to platform-managed dictionaries OR inline literal dictionaries (the two forms are mutually exclusive in a single request). The server resolves and merges the dictionaries, then forwards the full merged dictionary to the inference engine, which performs the substitution. Each entry sets `type` to `phoneme` (default: the value is spoken as a phonetic form) or `alias` (plain text replacement). Usage is billed on the text actually synthesized, with alias replacements counted: an alias that expands a key is billed for the longer text, one that shortens it is billed for the shorter text; phoneme rules never change billing. Matching is plain substring matching, leftmost-longest, and case-insensitive unless an entry sets `case_sensitive`. Missing or unresolvable references are silently dropped — the request still succeeds. Use `application/json` or `application/msgpack` content-type; nested arrays are not representable in `multipart/form-data`.","title":"Pronunciation Dictionary"}},"required":["text"],"title":"TTSRequest","type":"object"},"TTSStreamWithTimestampRequest":{"description":"Request body for streaming text-to-speech synthesis with timestamp alignment. The request fields match the standard TTS endpoint, but the response is delivered as a Server-Sent Events stream. Each SSE payload includes an audio chunk and, when available, the latest cumulative alignment snapshot for a `chunk_seq`. Clients should concatenate `audio_base64` chunks in arrival order and replace the stored alignment for each `chunk_seq` whenever a newer snapshot is received.","properties":{"text":{"description":"Text to convert to speech.","title":"Text","type":"string"},"temperature":{"default":0.7,"description":"Controls expressiveness. Higher is more varied, lower is more consistent.","maximum":1.0,"minimum":0.0,"title":"Temperature","type":"number"},"top_p":{"default":0.7,"description":"Controls diversity via nucleus sampling.","maximum":1.0,"minimum":0.0,"title":"Top P","type":"number"},"references":{"anyOf":[{"description":"Single speaker: array of reference audio samples","items":{"$ref":"#/components/schemas/ReferenceAudio"},"type":"array"},{"description":"Multiple speakers: array of arrays, where each inner array contains reference samples for one speaker","items":{"items":{"$ref":"#/components/schemas/ReferenceAudio"},"type":"array"},"type":"array"},{"type":"null"}],"description":"Inline voice references for zero-shot cloning. Requires MessagePack (not JSON). For single speaker, provide an array of ReferenceAudio objects. For multiple speakers, provide an array of arrays where each inner array contains references for one speaker. **Multi-speaker is available with the S2 family (`s2-pro`, `s2.1-pro`, `s2.1-pro-free`) and `drama-3`, not `s1`.** The speaker index corresponds to the index in reference_id array. Example for multi-speaker: [[{audio, text}], [{audio, text}, {audio, text}]] for 2 speakers where speaker 1 has 2 reference samples.","title":"References"},"reference_id":{"anyOf":[{"description":"Single speaker: voice model ID string","type":"string"},{"description":"Multiple speakers: array of voice model IDs, one per speaker","items":{"type":"string"},"type":"array"},{"type":"null"}],"default":null,"description":"Voice model ID(s) from Fish Audio library or your custom models. For single-speaker synthesis, provide a string. For multi-speaker synthesis (dialogue), provide an array of model IDs. **Multi-speaker is available with the S2 family (`s2-pro`, `s2.1-pro`, `s2.1-pro-free`) and `drama-3`, not `s1`.** When using multiple speakers, use speaker tags in your text like `<|speaker:0|>` and `<|speaker:1|>` to indicate speaker changes. Example: `<|speaker:0|>Hello!<|speaker:1|>Hi there!<|speaker:0|>How are you?` with `reference_id: [\"speaker-a-id\", \"speaker-b-id\"]`.","title":"Reference Id"},"prosody":{"anyOf":[{"$ref":"#/components/schemas/ProsodyControl"},{"type":"null"}],"default":null,"description":"Speed and volume adjustments for the output."},"chunk_length":{"default":300,"description":"Text segment size for processing.","maximum":300,"minimum":100,"title":"Chunk Length","type":"integer"},"normalize":{"default":true,"description":"Rewrites numbers, dates, units and symbols as spoken words before synthesis, improving stability. Uses `language` when it is set and otherwise detects the language of each text chunk.","title":"Normalize","type":"boolean"},"language":{"anyOf":[{"maxLength":35,"pattern":"^[A-Za-z0-9_-]*$","type":"string"},{"type":"null"}],"default":null,"description":"BCP-47 language tag of the text, for example `en`, `es-MX` or `zh-CN`. Case-insensitive, and `_` is read as `-`. Used only by text normalization (how numbers, dates, units and symbols are spelled out before synthesis) and by word-timestamp alignment. It is not passed to the speech model and does not change the voice, accent or audio quality; a wrong tag only changes how those tokens are spelled out. Omit it, or send `auto` or an empty string, to detect the language per chunk. A tag without dedicated normalization rules skips normalization instead of failing. Without a region, Spanish follows Spain conventions; send `es-MX` for Mexican readings. When `normalize` is false it only affects word timestamps. For text that mixes languages, leave it unset.","examples":["en","es-MX","zh-CN"],"title":"Language"},"format":{"default":"mp3","description":"Output audio format.","enum":["wav","pcm","mp3","opus"],"title":"Format","type":"string"},"sample_rate":{"anyOf":[{"type":"integer"},{"type":"null"}],"default":null,"description":"Audio sample rate in Hz. When null, uses the format's default (44100 Hz for most formats, 48000 Hz for opus).","title":"Sample Rate"},"mp3_bitrate":{"default":128,"description":"MP3 bitrate in kbps. Only applies when format is mp3.","enum":[64,128,192],"title":"Mp3 Bitrate","type":"integer"},"opus_bitrate":{"default":-1000,"description":"Opus bitrate in bps. -1000 for automatic. Only applies when format is opus.","enum":[-1000,24000,32000,48000,64000],"title":"Opus Bitrate","type":"integer"},"latency":{"default":"balanced","description":"Latency-quality trade-off. normal: best quality, balanced: reduced latency, low: lowest latency.","enum":["low","normal","balanced"],"title":"Latency","type":"string"},"max_new_tokens":{"default":1024,"description":"Maximum audio tokens to generate per text chunk.","title":"Max New Tokens","type":"integer"},"repetition_penalty":{"default":1.2,"description":"Penalty for repeating audio patterns. Values above 1.0 reduce repetition.","title":"Repetition Penalty","type":"number"},"min_chunk_length":{"default":50,"description":"Minimum characters before splitting into a new chunk.","maximum":100,"minimum":0,"title":"Min Chunk Length","type":"integer"},"condition_on_previous_chunks":{"default":true,"description":"Use previous audio as context for voice consistency.","title":"Condition On Previous Chunks","type":"boolean"},"early_stop_threshold":{"default":1.0,"description":"Early stopping threshold for batch processing.","maximum":1.0,"minimum":0.0,"title":"Early Stop Threshold","type":"number"},"features":{"default":[],"description":"Optional request-scoped TTS feature flags forwarded verbatim to the inference backend. Use [\"quality-guard\"] to enable the quality guard for this synthesis request. Feature availability is determined by the inference backend.","items":{"type":"string"},"title":"Features","type":"array"},"pronunciation_dictionary":{"anyOf":[{"description":"Reference form: list of pointers to platform pronunciation dictionaries. Each entry identifies a dictionary by `id` and `version`; the server resolves the contents from the platform service before forwarding them to the inference engine.","items":{"$ref":"#/components/schemas/PronunciationDictionaryRef"},"maxItems":3,"type":"array"},{"description":"Inline form: list of literal pronunciation dictionaries. Each dictionary carries an `items` array of `{key, value, type?, case_sensitive?}` entries.","items":{"$ref":"#/components/schemas/PronunciationDictionaryInline"},"maxItems":3,"type":"array"},{"type":"null"}],"default":null,"description":"Optional list of up to 3 pronunciation dictionaries to apply during synthesis. Provide either references to platform-managed dictionaries OR inline literal dictionaries (the two forms are mutually exclusive in a single request). The server resolves and merges the dictionaries, then forwards the full merged dictionary to the inference engine, which performs the substitution. Each entry sets `type` to `phoneme` (default: the value is spoken as a phonetic form) or `alias` (plain text replacement). Usage is billed on the text actually synthesized, with alias replacements counted: an alias that expands a key is billed for the longer text, one that shortens it is billed for the shorter text; phoneme rules never change billing. Matching is plain substring matching, leftmost-longest, and case-insensitive unless an entry sets `case_sensitive`. Missing or unresolvable references are silently dropped — the request still succeeds. Use `application/json` or `application/msgpack` content-type; nested arrays are not representable in `multipart/form-data`.","title":"Pronunciation Dictionary"}},"required":["text"],"title":"TTSStreamWithTimestampRequest","type":"object"},"TTSTimestampAlignment":{"properties":{"segments":{"description":"Ordered text timing segments for the generated audio.","items":{"$ref":"#/components/schemas/TTSTimestampSegment"},"title":"Segments","type":"array"},"audio_duration":{"description":"Audio duration in seconds for this alignment's content chunk.","title":"Audio Duration","type":"number"}},"required":["segments","audio_duration"],"title":"TTSTimestampAlignment","type":"object"},"TTSTimestampSegment":{"properties":{"text":{"description":"Text segment covered by this timing entry.","title":"Text","type":"string"},"start":{"description":"Segment start time in seconds.","title":"Start","type":"number"},"end":{"description":"Segment end time in seconds.","title":"End","type":"number"}},"required":["text","start","end"],"title":"TTSTimestampSegment","type":"object"},"TTSLiveErrorEvent":{"description":"Request-level failure raised before or instead of synthesis — an invalid `start` request, a missing voice reference, or a concurrency refusal. The socket closes afterwards.","examples":[{"error":"Concurrency limit exceeded","event":"error","max_concurrency":8}],"properties":{"event":{"const":"error","title":"Event","type":"string"},"error":{"description":"Failure detail.","title":"Error","type":"string"},"max_concurrency":{"anyOf":[{"type":"integer"},{"type":"null"}],"default":null,"description":"Your account's concurrency ceiling. Present only when the socket was refused for exceeding it.","title":"Max Concurrency"}},"required":["event","error"],"title":"TTSLiveErrorEvent","type":"object"},"TTSLiveFinishEvent":{"description":"Terminal event for the session. `reason: \"stop\"` follows a clean `stop`; `reason: \"error\"` reports a server-side failure and carries `message`. No further events arrive for the session.","examples":[{"event":"finish","reason":"stop","time":5460.0}],"properties":{"event":{"const":"finish","title":"Event","type":"string"},"reason":{"description":"`stop` when the session ended cleanly, `error` when the server aborted it.","enum":["stop","error"],"title":"Reason","type":"string"},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"description":"Failure detail. Present only when `reason` is `error`.","title":"Message"},"time":{"anyOf":[{"type":"number"},{"type":"null"}],"default":null,"description":"Milliseconds since the server began the session.","title":"Time"}},"required":["event","reason"],"title":"TTSLiveFinishEvent","type":"object"},"TTSLiveWithTimestampAudioEvent":{"description":"One audio chunk plus the latest word-level alignment snapshot. Concatenate every `audio` payload in arrival order to reconstruct the complete audio. `alignment` is the cumulative snapshot for `chunk_seq`: replace the stored alignment for that chunk instead of appending to it. Segment times are relative to the chunk, so the absolute time of a word is `chunk_audio_offset_sec + segment.start`.","examples":[{"alignment":{"audio_duration":16.24,"segments":[{"end":0.16,"start":0.0,"text":"I"},{"end":0.48,"start":0.16,"text":"can't"},{"end":0.8,"start":0.48,"text":"believe"},{"end":1.12,"start":0.8,"text":"its"},{"end":1.44,"start":1.2,"text":"been"},{"end":1.76,"start":1.44,"text":"this"},{"end":2.48,"start":1.76,"text":"long"},{"end":2.64,"start":2.56,"text":"It"},{"end":3.04,"start":2.72,"text":"feels"},{"end":3.28,"start":3.12,"text":"like"},{"end":4.0,"start":3.36,"text":"forever"},{"end":4.32,"start":4.0,"text":"since"},{"end":4.48,"start":4.32,"text":"we"},{"end":4.96,"start":4.48,"text":"last"},{"end":5.28,"start":4.96,"text":"really"},{"end":5.84,"start":5.28,"text":"talked"},{"end":6.24,"start":6.0,"text":"Ive"},{"end":6.64,"start":6.24,"text":"missed"},{"end":6.96,"start":6.64,"text":"hearing"},{"end":7.2,"start":6.96,"text":"your"},{"end":7.76,"start":7.2,"text":"voice"},{"end":7.92,"start":7.76,"text":"your"},{"end":8.48,"start":7.92,"text":"stories"},{"end":8.72,"start":8.48,"text":"even"},{"end":8.8,"start":8.72,"text":"the"},{"end":9.2,"start":8.8,"text":"little"},{"end":9.52,"start":9.2,"text":"things"},{"end":9.68,"start":9.52,"text":"you"},{"end":10.0,"start":9.68,"text":"used"},{"end":10.08,"start":10.0,"text":"to"},{"end":10.64,"start":10.08,"text":"say"},{"end":10.96,"start":10.64,"text":"How"},{"end":11.12,"start":10.96,"text":"have"},{"end":11.36,"start":11.12,"text":"you"},{"end":11.92,"start":11.36,"text":"been"},{"end":12.24,"start":12.0,"text":"Ive"},{"end":12.48,"start":12.24,"text":"thought"},{"end":12.8,"start":12.48,"text":"about"},{"end":13.2,"start":12.8,"text":"calling"},{"end":13.36,"start":13.2,"text":"you"},{"end":13.68,"start":13.36,"text":"so"},{"end":13.92,"start":13.68,"text":"many"},{"end":14.56,"start":13.92,"text":"times"},{"end":14.72,"start":14.56,"text":"but"},{"end":14.88,"start":14.72,"text":"I"},{"end":15.2,"start":14.88,"text":"never"},{"end":15.36,"start":15.2,"text":"knew"},{"end":15.6,"start":15.36,"text":"where"},{"end":15.6,"start":15.6,"text":"to"},{"end":16.24,"start":15.68,"text":"start"}]},"audio":"<raw audio bytes>","chunk_audio_offset_sec":0.0,"chunk_seq":0,"content":"I can’t believe it’s been this long. It feels like forever since we last really talked. I’ve missed hearing your voice, your stories, even the little things you used to say. How have you been? I’ve thought about calling you so many times, but I never knew where to start.","event":"audio","time":812.5},{"alignment":{"audio_duration":10.48,"segments":[{"end":0.8,"start":0.4,"text":"Seeing"},{"end":0.96,"start":0.8,"text":"you"},{"end":1.44,"start":0.96,"text":"again"},{"end":1.68,"start":1.44,"text":"now"},{"end":2.08,"start":1.68,"text":"makes"},{"end":2.24,"start":2.08,"text":"me"},{"end":2.8,"start":2.24,"text":"realize"},{"end":3.12,"start":2.8,"text":"just"},{"end":3.28,"start":3.12,"text":"how"},{"end":3.6,"start":3.28,"text":"much"},{"end":3.76,"start":3.6,"text":"Ive"},{"end":4.24,"start":3.84,"text":"missed"},{"end":4.56,"start":4.24,"text":"you"},{"end":4.8,"start":4.64,"text":"We"},{"end":5.04,"start":4.8,"text":"have"},{"end":5.36,"start":5.04,"text":"so"},{"end":5.76,"start":5.36,"text":"much"},{"end":5.76,"start":5.76,"text":"to"},{"end":6.16,"start":5.76,"text":"catch"},{"end":6.4,"start":6.16,"text":"up"},{"end":6.72,"start":6.4,"text":"on"},{"end":6.96,"start":6.8,"text":"and"},{"end":7.04,"start":6.96,"text":"I"},{"end":7.36,"start":7.04,"text":"dont"},{"end":7.6,"start":7.36,"text":"even"},{"end":7.84,"start":7.6,"text":"know"},{"end":8.08,"start":7.84,"text":"which"},{"end":8.4,"start":8.08,"text":"part"},{"end":8.48,"start":8.4,"text":"of"},{"end":8.72,"start":8.56,"text":"my"},{"end":8.96,"start":8.72,"text":"life"},{"end":9.12,"start":9.12,"text":"to"},{"end":9.44,"start":9.12,"text":"tell"},{"end":9.6,"start":9.44,"text":"you"},{"end":10.0,"start":9.6,"text":"about"},{"end":10.48,"start":10.08,"text":"first"}]},"audio":"<raw audio bytes>","chunk_audio_offset_sec":16.24,"chunk_seq":1,"content":"Seeing you again now makes me realize just how much I’ve missed you. We have so much to catch up on, and I don’t even know which part of my life to tell you about first.","event":"audio","time":4210.0}],"properties":{"event":{"const":"audio","title":"Event","type":"string"},"audio":{"description":"Raw audio chunk, carried as a MessagePack `bin` value — not base64, unlike the SSE `/v1/tts/stream/with-timestamp` endpoint. Concatenate every chunk in arrival order to reconstruct the full audio. May be empty on a trailing frame whose only purpose is to deliver a final `alignment` correction.","format":"binary","title":"Audio","type":"string"},"content":{"description":"Text content of the chunk identified by `chunk_seq`.","title":"Content","type":"string"},"alignment":{"anyOf":[{"$ref":"#/components/schemas/TTSTimestampAlignment"},{"type":"null"}],"description":"Cumulative word-level alignment snapshot for `chunk_seq`, with segment times relative to the start of that chunk. Always present on the wire; `null` means the alignment for this chunk has not changed yet (normal early in a chunk, while the aligner is still committing words). When non-null, replace the snapshot you stored for `chunk_seq` — never append to it."},"chunk_seq":{"description":"Sequence number of the text chunk that `alignment` and `content` describe. Monotonically non-decreasing. Bucket alignment snapshots by this value. Note that a frame may be labelled with the previous chunk's `chunk_seq` while carrying the next chunk's audio bytes, so do not use it to attribute audio.","minimum":0,"title":"Chunk Seq","type":"integer"},"chunk_audio_offset_sec":{"description":"Start time of this text chunk within the full audio, in seconds — the sum of the audio durations of every earlier chunk. Add it to a segment's `start`/`end` to get absolute timestamps. Monotonically non-decreasing.","minimum":0.0,"title":"Chunk Audio Offset Sec","type":"number"},"time":{"anyOf":[{"type":"number"},{"type":"null"}],"default":null,"description":"Milliseconds since the server began the session.","title":"Time"}},"required":["event","audio","content","alignment","chunk_seq","chunk_audio_offset_sec"],"title":"TTSLiveWithTimestampAudioEvent","type":"object"},"TTSLiveFlushEvent":{"description":"Forces the buffered text through generation without waiting for the chunk to fill. A text-splitting control only: the session stays open and you may keep sending `text` events afterwards.","examples":[{"event":"flush"}],"properties":{"event":{"const":"flush","title":"Event","type":"string"}},"required":["event"],"title":"TTSLiveFlushEvent","type":"object"},"TTSLiveStartEvent":{"description":"Opens a synthesis session. Send this first, once per session. `request` carries the same fields as the `POST /v1/tts` body.","examples":[{"event":"start","request":{"chunk_length":100,"format":"opus","latency":"balanced","reference_id":"fbe02f8306fc4d3d915e9871722a39d5","text":""}}],"properties":{"event":{"const":"start","title":"Event","type":"string"},"request":{"$ref":"#/components/schemas/TTSRequest","description":"Synthesis parameters for this session, identical to the `POST /v1/tts` request body. `text` may be an empty string here; text sent later with `text` events is appended to it."}},"required":["event","request"],"title":"TTSLiveStartEvent","type":"object"},"TTSLiveStopEvent":{"description":"Ends the session. The server synthesizes whatever text is still buffered, emits any trailing `audio` events, then a `finish` event with `reason: \"stop\"`.","examples":[{"event":"stop"}],"properties":{"event":{"const":"stop","title":"Event","type":"string"}},"required":["event"],"title":"TTSLiveStopEvent","type":"object"},"TTSLiveTextEvent":{"description":"Appends a text fragment to the session buffer. Send as many as you like; the server splits the buffer into chunks and synthesizes them as they become long enough.","examples":[{"event":"text","text":"Hello there, "}],"properties":{"event":{"const":"text","title":"Event","type":"string"},"text":{"description":"Text fragment appended to the session buffer, verbatim.","title":"Text","type":"string"}},"required":["event","text"],"title":"TTSLiveTextEvent","type":"object"},"VoiceDesignRequest":{"additionalProperties":false,"description":"Request body for synchronous voice design generation. The endpoint returns generated voice candidates with base64-encoded audio.","examples":[{"guidance_scale":2.0,"instruct_guidance_scale":0.0,"instruction":"Warm, confident studio narrator with a natural tone","language":"en","n":2,"num_step":32,"reference_text":"Welcome to Fish Audio.","seed":42,"speed":1.0}],"properties":{"instruction":{"description":"Voice design prompt. Must contain 1 to 2000 characters.","maxLength":2000,"minLength":1,"title":"Instruction","type":"string"},"reference_text":{"anyOf":[{"maxLength":150,"type":"string"},{"type":"null"}],"default":null,"description":"Optional text used as reference content for the generated voice.","title":"Reference Text"},"language":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"description":"Optional BCP-47 language hint, such as `en`, `zh`, or `ja`.","title":"Language"},"n":{"default":2,"description":"Number of voice candidates to generate.","maximum":4,"minimum":1,"title":"N","type":"integer"},"speed":{"default":1.0,"description":"Speaking speed multiplier for candidate generation.","exclusiveMinimum":0.0,"maximum":3.0,"title":"Speed","type":"number"},"num_step":{"default":32,"description":"Number of diffusion steps used by the voice-design model.","maximum":128,"minimum":1,"title":"Num Step","type":"integer"},"guidance_scale":{"default":2.0,"description":"Classifier-free guidance scale. Higher values follow the prompt more strongly.","minimum":0.0,"title":"Guidance Scale","type":"number"},"instruct_guidance_scale":{"default":0.0,"description":"Instruction guidance scale for prompt conditioning.","minimum":0.0,"title":"Instruct Guidance Scale","type":"number"},"seed":{"anyOf":[{"type":"integer"},{"type":"null"}],"default":null,"description":"Optional deterministic seed for candidate generation.","title":"Seed"}},"required":["instruction"],"title":"VoiceDesignRequest","type":"object"},"VoiceDesignCandidate":{"properties":{"id":{"description":"Stable candidate identifier.","title":"Id","type":"string"},"index":{"description":"Candidate index in this response.","minimum":0,"title":"Index","type":"integer"},"audio_base64":{"description":"Base64 encoded generated audio.","title":"Audio Base64","type":"string"},"sample_rate":{"description":"Audio sample rate in Hz.","exclusiveMinimum":0,"title":"Sample Rate","type":"integer"},"duration_ms":{"description":"Audio duration in milliseconds.","minimum":0,"title":"Duration Ms","type":"integer"},"text":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"description":"Preview text associated with this generated voice, when available.","title":"Text"},"instruct":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"description":"Instruction text associated with this candidate, when available.","title":"Instruct"},"language":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"description":"Detected or requested candidate language, when available.","title":"Language"}},"required":["id","index","audio_base64","sample_rate","duration_ms"],"title":"VoiceDesignCandidate","type":"object"},"AuthorEntity":{"properties":{"_id":{"title":"Id","type":"string"},"nickname":{"title":"Nickname","type":"string"},"avatar":{"title":"Avatar","type":"string"}},"required":["_id","nickname","avatar"],"title":"AuthorEntity","type":"object"},"ModelAudioQualityEntity":{"properties":{"filename":{"title":"Filename","type":"string"},"duration_ms":{"title":"Duration Ms","type":"number"},"language":{"default":"unknown","title":"Language","type":"string"},"quality":{"additionalProperties":{"type":"number"},"title":"Quality","type":"object"},"quality_passed":{"default":false,"title":"Quality Passed","type":"boolean"},"quality_reason":{"default":"","title":"Quality Reason","type":"string"}},"required":["filename","duration_ms"],"title":"ModelAudioQualityEntity","type":"object"},"ModelEntity":{"properties":{"_id":{"title":"Id","type":"string"},"type":{"enum":["svc","tts"],"title":"Type","type":"string"},"title":{"title":"Title","type":"string"},"description":{"default":"","title":"Description","type":"string"},"cover_image":{"default":"","title":"Cover Image","type":"string"},"train_mode":{"default":"full","enum":["fast","full"],"title":"Train Mode","type":"string"},"state":{"enum":["created","training","trained","failed"],"title":"State","type":"string"},"tags":{"items":{"type":"string"},"title":"Tags","type":"array"},"samples":{"default":[],"items":{"$ref":"#/components/schemas/SampleEntity"},"title":"Samples","type":"array"},"created_at":{"format":"date-time","title":"Created At","type":"string"},"updated_at":{"format":"date-time","title":"Updated At","type":"string"},"languages":{"default":[],"items":{"type":"string"},"title":"Languages","type":"array"},"visibility":{"enum":["public","unlist","private"],"title":"Visibility","type":"string"},"lock_visibility":{"default":false,"title":"Lock Visibility","type":"boolean"},"dmca_taken_down":{"anyOf":[{"type":"boolean"},{"type":"null"}],"default":false,"title":"Dmca Taken Down"},"takedown_category":{"anyOf":[{"enum":["dmca","policy"],"type":"string"},{"type":"null"}],"default":null,"title":"Takedown Category"},"default_text":{"default":"","title":"Default Text","type":"string"},"source":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Source"},"licensed":{"default":false,"title":"Licensed","type":"boolean"},"pvc_release_state":{"anyOf":[{"enum":["released","retiring"],"type":"string"},{"type":"null"}],"default":null,"title":"Pvc Release State"},"pvc_notice_period_months":{"anyOf":[{"type":"integer"},{"type":"null"}],"default":null,"title":"Pvc Notice Period Months"},"pvc_released_at":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}],"default":null,"title":"Pvc Released At"},"pvc_retire_requested_at":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}],"default":null,"title":"Pvc Retire Requested At"},"pvc_retire_effective_at":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}],"default":null,"title":"Pvc Retire Effective At"},"quality":{"anyOf":[{"$ref":"#/components/schemas/ModelQualityEntity"},{"type":"null"}],"default":null},"like_count":{"title":"Like Count","type":"integer"},"mark_count":{"title":"Mark Count","type":"integer"},"shared_count":{"title":"Shared Count","type":"integer"},"task_count":{"title":"Task Count","type":"integer"},"unliked":{"default":false,"title":"Unliked","type":"boolean"},"liked":{"default":false,"title":"Liked","type":"boolean"},"marked":{"default":false,"title":"Marked","type":"boolean"},"author":{"$ref":"#/components/schemas/AuthorEntity"}},"required":["_id","type","title","state","tags","created_at","updated_at","visibility","like_count","mark_count","shared_count","task_count","author"],"title":"ModelEntity","type":"object"},"ModelQualityEntity":{"properties":{"audios":{"items":{"$ref":"#/components/schemas/ModelAudioQualityEntity"},"title":"Audios","type":"array"},"created_at":{"format":"date-time","title":"Created At","type":"string"},"updated_at":{"format":"date-time","title":"Updated At","type":"string"}},"required":["created_at","updated_at"],"title":"ModelQualityEntity","type":"object"},"SampleEntity":{"properties":{"title":{"title":"Title","type":"string"},"text":{"title":"Text","type":"string"},"task_id":{"title":"Task Id","type":"string"},"audio":{"title":"Audio","type":"string"}},"required":["title","text","task_id","audio"],"title":"SampleEntity","type":"object"}}},"servers":[{"description":"Fish Audio API","url":"https://api.fish.audio"}]}