From 68494ea3adc7adfbb5689a148e1829a943b4890d Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Sat, 13 Jun 2026 19:15:37 +0000 Subject: [PATCH] feat: Updated OpenAPI spec --- ...packageTtsPhoneNumbersClient.Purchase.g.cs | 21 ++++--- ...packageTtsPhoneNumbersClient.Purchase.g.cs | 58 ++++++++++++++++--- src/libs/Speechify/openapi.yaml | 2 +- 3 files changed, 62 insertions(+), 19 deletions(-) diff --git a/src/libs/Speechify/Generated/Speechify.ISubpackageTtsSubpackageTtsPhoneNumbersClient.Purchase.g.cs b/src/libs/Speechify/Generated/Speechify.ISubpackageTtsSubpackageTtsPhoneNumbersClient.Purchase.g.cs index 58aa582..f559b6a 100644 --- a/src/libs/Speechify/Generated/Speechify.ISubpackageTtsSubpackageTtsPhoneNumbersClient.Purchase.g.cs +++ b/src/libs/Speechify/Generated/Speechify.ISubpackageTtsSubpackageTtsPhoneNumbersClient.Purchase.g.cs @@ -7,9 +7,10 @@ public partial interface ISubpackageTtsSubpackageTtsPhoneNumbersClient /// /// Purchase Phone Number
/// Purchase a phone number on Speechify's master Twilio account.
- /// The number is billed to Speechify until released; each
- /// workspace is capped at a small number of purchased numbers
- /// (see 422 response) independent of the overall 100-number cap.
+ /// The number is billed to Speechify until released. A plan that
+ /// includes no purchased numbers (e.g. Free) returns 402; a plan
+ /// that has used its full included quota returns 422. This is
+ /// independent of the overall 100-number cap.
/// `e164` must come from a recent `SearchAvailablePhoneNumbers`
/// response — carriers reject buys against numbers that are no
/// longer in inventory. The returned phone number is wired for
@@ -29,9 +30,10 @@ public partial interface ISubpackageTtsSubpackageTtsPhoneNumbersClient /// /// Purchase Phone Number
/// Purchase a phone number on Speechify's master Twilio account.
- /// The number is billed to Speechify until released; each
- /// workspace is capped at a small number of purchased numbers
- /// (see 422 response) independent of the overall 100-number cap.
+ /// The number is billed to Speechify until released. A plan that
+ /// includes no purchased numbers (e.g. Free) returns 402; a plan
+ /// that has used its full included quota returns 422. This is
+ /// independent of the overall 100-number cap.
/// `e164` must come from a recent `SearchAvailablePhoneNumbers`
/// response — carriers reject buys against numbers that are no
/// longer in inventory. The returned phone number is wired for
@@ -51,9 +53,10 @@ public partial interface ISubpackageTtsSubpackageTtsPhoneNumbersClient /// /// Purchase Phone Number
/// Purchase a phone number on Speechify's master Twilio account.
- /// The number is billed to Speechify until released; each
- /// workspace is capped at a small number of purchased numbers
- /// (see 422 response) independent of the overall 100-number cap.
+ /// The number is billed to Speechify until released. A plan that
+ /// includes no purchased numbers (e.g. Free) returns 402; a plan
+ /// that has used its full included quota returns 422. This is
+ /// independent of the overall 100-number cap.
/// `e164` must come from a recent `SearchAvailablePhoneNumbers`
/// response — carriers reject buys against numbers that are no
/// longer in inventory. The returned phone number is wired for
diff --git a/src/libs/Speechify/Generated/Speechify.SubpackageTtsSubpackageTtsPhoneNumbersClient.Purchase.g.cs b/src/libs/Speechify/Generated/Speechify.SubpackageTtsSubpackageTtsPhoneNumbersClient.Purchase.g.cs index 962ef2f..d5c3dcc 100644 --- a/src/libs/Speechify/Generated/Speechify.SubpackageTtsSubpackageTtsPhoneNumbersClient.Purchase.g.cs +++ b/src/libs/Speechify/Generated/Speechify.SubpackageTtsSubpackageTtsPhoneNumbersClient.Purchase.g.cs @@ -44,9 +44,10 @@ partial void ProcessPurchaseResponseContent( /// /// Purchase Phone Number
/// Purchase a phone number on Speechify's master Twilio account.
- /// The number is billed to Speechify until released; each
- /// workspace is capped at a small number of purchased numbers
- /// (see 422 response) independent of the overall 100-number cap.
+ /// The number is billed to Speechify until released. A plan that
+ /// includes no purchased numbers (e.g. Free) returns 402; a plan
+ /// that has used its full included quota returns 422. This is
+ /// independent of the overall 100-number cap.
/// `e164` must come from a recent `SearchAvailablePhoneNumbers`
/// response — carriers reject buys against numbers that are no
/// longer in inventory. The returned phone number is wired for
@@ -76,9 +77,10 @@ partial void ProcessPurchaseResponseContent( /// /// Purchase Phone Number
/// Purchase a phone number on Speechify's master Twilio account.
- /// The number is billed to Speechify until released; each
- /// workspace is capped at a small number of purchased numbers
- /// (see 422 response) independent of the overall 100-number cap.
+ /// The number is billed to Speechify until released. A plan that
+ /// includes no purchased numbers (e.g. Free) returns 402; a plan
+ /// that has used its full included quota returns 422. This is
+ /// independent of the overall 100-number cap.
/// `e164` must come from a recent `SearchAvailablePhoneNumbers`
/// response — carriers reject buys against numbers that are no
/// longer in inventory. The returned phone number is wired for
@@ -429,6 +431,43 @@ partial void ProcessPurchaseResponseContent( h => h.Key, h => h.Value)); } + // The workspace has insufficient credits, or the request needs a plan tier the workspace is not on (e.g. voice cloning). Distinct from `Forbidden` so SDK consumers can drive upgrade UX. + if ((int)__response.StatusCode == 402) + { + string? __content_402 = null; + global::System.Exception? __exception_402 = null; + global::Speechify.TtsError? __value_402 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_402 = global::Speechify.TtsError.FromJson(__content_402, JsonSerializerContext); + } + else + { + __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_402 = global::Speechify.TtsError.FromJson(__content_402, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_402 = __ex; + } + + + throw global::Speechify.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_402 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_402, + responseBody: __content_402, + responseObject: __value_402, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } // The request was well-formed but semantically rejected - typically a referential integrity violation (e.g. flow node references an audio asset in another workspace) or a state machine refusal. if ((int)__response.StatusCode == 422) { @@ -602,9 +641,10 @@ partial void ProcessPurchaseResponseContent( /// /// Purchase Phone Number
/// Purchase a phone number on Speechify's master Twilio account.
- /// The number is billed to Speechify until released; each
- /// workspace is capped at a small number of purchased numbers
- /// (see 422 response) independent of the overall 100-number cap.
+ /// The number is billed to Speechify until released. A plan that
+ /// includes no purchased numbers (e.g. Free) returns 402; a plan
+ /// that has used its full included quota returns 422. This is
+ /// independent of the overall 100-number cap.
/// `e164` must come from a recent `SearchAvailablePhoneNumbers`
/// response — carriers reject buys against numbers that are no
/// longer in inventory. The returned phone number is wired for
diff --git a/src/libs/Speechify/openapi.yaml b/src/libs/Speechify/openapi.yaml index c04528e..4fe8e95 100644 --- a/src/libs/Speechify/openapi.yaml +++ b/src/libs/Speechify/openapi.yaml @@ -1 +1 @@ -{"openapi":"3.1.0","info":{"title":"API Reference","version":"1.0.0"},"paths":{"/v1/audio/speech":{"post":{"operationId":"speech","summary":"Create Speech","description":"Synthesize speech audio from text or SSML. Returns the complete audio\nfile plus billing and speech-mark metadata in a single response. For\nlow-latency playback or long-form text, use POST /v1/audio/stream.","tags":["subpackage_tts.subpackage_tts/audio"],"parameters":[{"name":"Authorization","in":"header","description":"Enter your API key with the `Bearer` prefix, e.g. 'Bearer sk_...'.","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Synthesized speech audio for the requested input.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/tts:GetSpeechResponse"}}}},"400":{"description":"The request was malformed or failed validation. The response\nbody is the standard `Error` envelope; for validation\nfailures `error.fields` enumerates the offending fields as\na `path -> message` map (code = `validation_failed`).\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/tts:Error"}}}},"401":{"description":"Authentication is missing or invalid. The request did not\ncarry a recognised credential (Firebase ID token, API key, or\nworker JWT).\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/tts:Error"}}}},"402":{"description":"The workspace has insufficient credits, or the request needs a\nplan tier the workspace is not on (e.g. voice cloning). Distinct\nfrom `Forbidden` so SDK consumers can drive upgrade UX.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/tts:Error"}}}},"403":{"description":"The credential authenticated, but is not authorised for this\nresource - typically a workspace-role gate (owner / admin\nrequired) or a cross-tenant access attempt.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/tts:Error"}}}},"500":{"description":"An unexpected server-side error occurred. Safe to retry with\nexponential backoff for idempotent requests.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/tts:Error"}}}}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/tts:GetSpeechRequest"}}}}}},"/v1/audio/stream":{"post":{"operationId":"stream","summary":"Stream Speech","description":"Synthesize speech and stream the audio back as it is generated, for\nlow-latency playback. The Accept header selects the audio container.\nFor short text where receiving the whole file at once is fine, use\nPOST /v1/audio/speech.","tags":["subpackage_tts.subpackage_tts/audio"],"parameters":[{"name":"Authorization","in":"header","description":"Enter your API key with the `Bearer` prefix, e.g. 'Bearer sk_...'.","required":true,"schema":{"type":"string"}},{"name":"Accept","in":"header","required":true,"schema":{"$ref":"#/components/schemas/tts:V1AudioStreamPostParametersAccept"}}],"responses":{"200":{"description":"Chunked audio stream for the requested input.","content":{"application/octet-stream":{"schema":{"type":"string","format":"binary"}}}},"400":{"description":"The request was malformed or failed validation. The response\nbody is the standard `Error` envelope; for validation\nfailures `error.fields` enumerates the offending fields as\na `path -> message` map (code = `validation_failed`).\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/tts:Error"}}}},"401":{"description":"Authentication is missing or invalid. The request did not\ncarry a recognised credential (Firebase ID token, API key, or\nworker JWT).\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/tts:Error"}}}},"402":{"description":"The workspace has insufficient credits, or the request needs a\nplan tier the workspace is not on (e.g. voice cloning). Distinct\nfrom `Forbidden` so SDK consumers can drive upgrade UX.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/tts:Error"}}}},"403":{"description":"The credential authenticated, but is not authorised for this\nresource - typically a workspace-role gate (owner / admin\nrequired) or a cross-tenant access attempt.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/tts:Error"}}}},"500":{"description":"An unexpected server-side error occurred. Safe to retry with\nexponential backoff for idempotent requests.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/tts:Error"}}}}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/tts:GetStreamRequest"}}}}}},"/v1/voices":{"get":{"operationId":"list","summary":"List Voices","description":"Gets the list of voices available for the user","tags":["subpackage_tts.subpackage_tts/voices"],"parameters":[{"name":"Authorization","in":"header","description":"Enter your API key with the `Bearer` prefix, e.g. 'Bearer sk_...'.","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"A list of voices","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/tts:GetVoice"}}}}},"401":{"description":"Authentication is missing or invalid. The request did not\ncarry a recognised credential (Firebase ID token, API key, or\nworker JWT).\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/tts:Error"}}}},"404":{"description":"The referenced resource does not exist or is not visible to\nthe caller's workspace.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/tts:Error"}}}},"500":{"description":"An unexpected server-side error occurred. Safe to retry with\nexponential backoff for idempotent requests.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/tts:Error"}}}}}},"post":{"operationId":"create","summary":"Create Voice","description":"Create a personal (cloned) voice for the user","tags":["subpackage_tts.subpackage_tts/voices"],"parameters":[{"name":"Authorization","in":"header","description":"Enter your API key with the `Bearer` prefix, e.g. 'Bearer sk_...'.","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"A created voice","content":{"application/json":{"schema":{"$ref":"#/components/schemas/tts:CreatedVoice"}}}},"400":{"description":"The request was malformed or failed validation. The response\nbody is the standard `Error` envelope; for validation\nfailures `error.fields` enumerates the offending fields as\na `path -> message` map (code = `validation_failed`).\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/tts:Error"}}}},"401":{"description":"Authentication is missing or invalid. The request did not\ncarry a recognised credential (Firebase ID token, API key, or\nworker JWT).\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/tts:Error"}}}},"402":{"description":"The workspace has insufficient credits, or the request needs a\nplan tier the workspace is not on (e.g. voice cloning). Distinct\nfrom `Forbidden` so SDK consumers can drive upgrade UX.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/tts:Error"}}}},"500":{"description":"An unexpected server-side error occurred. Safe to retry with\nexponential backoff for idempotent requests.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/tts:Error"}}}}},"requestBody":{"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"name":{"type":"string","description":"Name of the personal voice"},"locale":{"type":"string","default":"en-US","description":"Native language (locale) of the personal voice (e.g. en-US, es-ES, etc.)"},"gender":{"$ref":"#/components/schemas/tts:V1VoicesPostRequestBodyContentMultipartFormDataSchemaGender","description":"Gender marker for the personal voice\nmale GenderMale\nfemale GenderFemale\nnotSpecified GenderNotSpecified"},"sample":{"type":"string","format":"binary","description":"Audio sample file"},"avatar":{"type":"string","format":"binary","description":"Avatar image file"},"consent":{"type":"string","description":"A **string** representing the user consent information in JSON format\nThis should include the fullName and email of the consenting individual.\nFor example, `{\"fullName\": \"John Doe\", \"email\": \"john@example.com\"}`"}},"required":["name","gender","sample","consent"]}}}}}},"/v1/voices/{id}":{"delete":{"operationId":"delete","summary":"Delete Voice","description":"Delete a personal (cloned) voice","tags":["subpackage_tts.subpackage_tts/voices"],"parameters":[{"name":"id","in":"path","description":"The ID of the voice to delete","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","description":"Enter your API key with the `Bearer` prefix, e.g. 'Bearer sk_...'.","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"Voice deleted successfully","content":{"application/json":{"schema":{"type":"object","properties":{}}}}},"400":{"description":"The request was malformed or failed validation. The response\nbody is the standard `Error` envelope; for validation\nfailures `error.fields` enumerates the offending fields as\na `path -> message` map (code = `validation_failed`).\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/tts:Error"}}}},"401":{"description":"Authentication is missing or invalid. The request did not\ncarry a recognised credential (Firebase ID token, API key, or\nworker JWT).\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/tts:Error"}}}},"404":{"description":"The referenced resource does not exist or is not visible to\nthe caller's workspace.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/tts:Error"}}}},"500":{"description":"An unexpected server-side error occurred. Safe to retry with\nexponential backoff for idempotent requests.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/tts:Error"}}}}}}},"/v1/voices/{id}/sample":{"get":{"operationId":"download-sample","summary":"Download Voice Sample","description":"Download a personal (cloned) voice sample","tags":["subpackage_tts.subpackage_tts/voices"],"parameters":[{"name":"id","in":"path","description":"The ID of the voice to download sample for","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","description":"Enter your API key with the `Bearer` prefix, e.g. 'Bearer sk_...'.","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Voice sample audio file","content":{"application/octet-stream":{"schema":{"type":"string","format":"binary"}}}},"400":{"description":"The request was malformed or failed validation. The response\nbody is the standard `Error` envelope; for validation\nfailures `error.fields` enumerates the offending fields as\na `path -> message` map (code = `validation_failed`).\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/tts:Error"}}}},"401":{"description":"Authentication is missing or invalid. The request did not\ncarry a recognised credential (Firebase ID token, API key, or\nworker JWT).\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/tts:Error"}}}},"404":{"description":"The referenced resource does not exist or is not visible to\nthe caller's workspace.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/tts:Error"}}}},"500":{"description":"An unexpected server-side error occurred. Safe to retry with\nexponential backoff for idempotent requests.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/tts:Error"}}}}}}},"/v1/agents":{"post":{"operationId":"create","summary":"Create Agent","description":"Create a voice agent.","tags":["subpackage_tts.subpackage_tts/agents"],"parameters":[{"name":"Authorization","in":"header","description":"Enter your API key with the `Bearer` prefix, e.g. 'Bearer sk_...'.","required":true,"schema":{"type":"string"}}],"responses":{"201":{"description":"The created agent.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/tts:Agent"}}}},"400":{"description":"The request was malformed or failed validation. The response\nbody is the standard `Error` envelope; for validation\nfailures `error.fields` enumerates the offending fields as\na `path -> message` map (code = `validation_failed`).\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/tts:Error"}}}},"401":{"description":"Authentication is missing or invalid. The request did not\ncarry a recognised credential (Firebase ID token, API key, or\nworker JWT).\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/tts:Error"}}}}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/tts:CreateAgentRequest"}}}}},"get":{"operationId":"list","summary":"List Agents","description":"List voice agents owned by the caller.","tags":["subpackage_tts.subpackage_tts/agents"],"parameters":[{"name":"Authorization","in":"header","description":"Enter your API key with the `Bearer` prefix, e.g. 'Bearer sk_...'.","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"A list of voice agents.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/tts:ListAgentsResponse"}}}},"401":{"description":"Authentication is missing or invalid. The request did not\ncarry a recognised credential (Firebase ID token, API key, or\nworker JWT).\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/tts:Error"}}}}}}},"/v1/agents/{id}":{"get":{"operationId":"get","summary":"Get Agent","description":"Retrieve a voice agent by ID.","tags":["subpackage_tts.subpackage_tts/agents"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","description":"Enter your API key with the `Bearer` prefix, e.g. 'Bearer sk_...'.","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"The requested agent.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/tts:Agent"}}}},"401":{"description":"Authentication is missing or invalid. The request did not\ncarry a recognised credential (Firebase ID token, API key, or\nworker JWT).\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/tts:Error"}}}},"404":{"description":"The referenced resource does not exist or is not visible to\nthe caller's workspace.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/tts:Error"}}}}}},"patch":{"operationId":"update","summary":"Update Agent","description":"Update a voice agent. Only fields present on the request body are changed.","tags":["subpackage_tts.subpackage_tts/agents"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","description":"Enter your API key with the `Bearer` prefix, e.g. 'Bearer sk_...'.","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"The updated agent.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/tts:Agent"}}}},"400":{"description":"The request was malformed or failed validation. The response\nbody is the standard `Error` envelope; for validation\nfailures `error.fields` enumerates the offending fields as\na `path -> message` map (code = `validation_failed`).\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/tts:Error"}}}},"401":{"description":"Authentication is missing or invalid. The request did not\ncarry a recognised credential (Firebase ID token, API key, or\nworker JWT).\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/tts:Error"}}}},"404":{"description":"The referenced resource does not exist or is not visible to\nthe caller's workspace.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/tts:Error"}}}}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/tts:UpdateAgentRequest"}}}}},"delete":{"operationId":"delete","summary":"Delete Agent","description":"Delete a voice agent. Conversations and attached tools remain. Tests whose only agent is this one are deleted with it; tests also attached to other agents survive, minus the attachment.","tags":["subpackage_tts.subpackage_tts/agents"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","description":"Enter your API key with the `Bearer` prefix, e.g. 'Bearer sk_...'.","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"Agent deleted.","content":{"application/json":{"schema":{"type":"object","properties":{}}}}},"401":{"description":"Authentication is missing or invalid. The request did not\ncarry a recognised credential (Firebase ID token, API key, or\nworker JWT).\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/tts:Error"}}}},"404":{"description":"The referenced resource does not exist or is not visible to\nthe caller's workspace.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/tts:Error"}}}}}}},"/v1/agents/{id}/conversations":{"post":{"operationId":"create-conversation","summary":"Create Conversation","description":"Start a new voice conversation with the agent. Returns a realtime\nvoice session + short-lived client token so the caller can\nconnect the audio pipeline directly. The agent is dispatched\nserver-side; no additional client action required.\n\nPass `dynamic_variables` to supply per-session values that override\nthe agent's stored variable defaults for this one conversation.\nKeys in the `system__` namespace are rejected at this boundary.\n","tags":["subpackage_tts.subpackage_tts/agents"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","description":"Enter your API key with the `Bearer` prefix, e.g. 'Bearer sk_...'.","required":true,"schema":{"type":"string"}}],"responses":{"201":{"description":"The created conversation with its realtime session token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/tts:CreateConversationResponse"}}}},"400":{"description":"The request was malformed or failed validation. The response\nbody is the standard `Error` envelope; for validation\nfailures `error.fields` enumerates the offending fields as\na `path -> message` map (code = `validation_failed`).\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/tts:Error"}}}},"401":{"description":"Authentication is missing or invalid. The request did not\ncarry a recognised credential (Firebase ID token, API key, or\nworker JWT).\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/tts:Error"}}}},"404":{"description":"The referenced resource does not exist or is not visible to\nthe caller's workspace.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/tts:Error"}}}}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/tts:CreateConversationRequest"}}}}}},"/v1/agents/{id}/sessions":{"post":{"operationId":"create-session","summary":"Create Session","description":"Mint a realtime voice session for the given agent. Widget-friendly\ncounterpart to `createConversation` \u2014 same response shape, dual\nauthentication:\n\n* **Authenticated (Bearer)**: works for any agent the caller\n owns. Typical server-to-server flow where the embedding\n site's backend mints a token and hands it to the browser so\n the API key never reaches the client.\n* **Unauthenticated**: works only when `agent.is_public = true`\n AND the request's `Origin` header matches `agent.allowed_origins`\n (or that list is empty). When `agent.hostname_allowlist` is\n non-empty, the `Origin` hostname must additionally be a\n member of that list. Used directly by the\n `` web component.\n\nResponds with the same `CreateConversationResponse` as\n`createConversation`.\n","tags":["subpackage_tts.subpackage_tts/agents"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"The created session with its realtime token + URL.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/tts:CreateConversationResponse"}}}},"401":{"description":"Authentication is missing or invalid. The request did not\ncarry a recognised credential (Firebase ID token, API key, or\nworker JWT).\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/tts:Error"}}}},"403":{"description":"The credential authenticated, but is not authorised for this\nresource - typically a workspace-role gate (owner / admin\nrequired) or a cross-tenant access attempt.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/tts:Error"}}}},"404":{"description":"The referenced resource does not exist or is not visible to\nthe caller's workspace.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/tts:Error"}}}}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/tts:CreateSessionRequest"}}}}}},"/v1/agents/voices":{"get":{"operationId":"list-agent-voices","summary":"List Agent Voices","description":"List the curated voice catalogue available for voice agents.\nMatches the `ai-api-agents` VMS scope one-for-one, so the same\nslug set is accepted by POST/PATCH /v1/agents. Personal\n(cloned) voices are NOT included \u2014 they stay on\n`GET /v1/voices`. The JSON layout intentionally mirrors the\nTTS `/v1/voices` shape so the console feeds both endpoints\ninto the same voice-picker component.\n","tags":["subpackage_tts.subpackage_tts/agents"],"parameters":[{"name":"Authorization","in":"header","description":"Enter your API key with the `Bearer` prefix, e.g. 'Bearer sk_...'.","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"The curated agent voice catalogue.","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/tts:AgentVoice"}}}}},"401":{"description":"Authentication is missing or invalid. The request did not\ncarry a recognised credential (Firebase ID token, API key, or\nworker JWT).\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/tts:Error"}}}}}}},"/v1/agents/{id}/builtins":{"post":{"operationId":"create-builtin","summary":"Create Agent Builtin","description":"Create a new builtin instance on this agent. `builtin` must\nresolve to one of the names returned by\n`GET /v1/agents/tools/system-builtins`; unknown values are rejected.\n`name` is the LLM-facing identifier the model uses to call the\ntool; it must match the tool-name regex and be unique within\nthe agent's builtin set.\n","tags":["subpackage_tts.subpackage_tts/agents"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","description":"Enter your API key with the `Bearer` prefix, e.g. 'Bearer sk_...'.","required":true,"schema":{"type":"string"}}],"responses":{"201":{"description":"The created builtin instance.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/tts:AgentBuiltin"}}}},"400":{"description":"The request was malformed or failed validation. The response\nbody is the standard `Error` envelope; for validation\nfailures `error.fields` enumerates the offending fields as\na `path -> message` map (code = `validation_failed`).\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/tts:Error"}}}},"401":{"description":"Authentication is missing or invalid. The request did not\ncarry a recognised credential (Firebase ID token, API key, or\nworker JWT).\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/tts:Error"}}}},"404":{"description":"The referenced resource does not exist or is not visible to\nthe caller's workspace.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/tts:Error"}}}}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/tts:CreateAgentBuiltinRequest"}}}}},"get":{"operationId":"list-builtins","summary":"List Agent Builtins","description":"List every builtin instance configured on this agent. Each row\nis one instance of a worker-resident capability (`end_call`,\n`play_audio`, etc.) bound to this specific agent with its own\nLLM-facing name, description, and per-call config. Same builtin\nmay appear N times on one agent \u2014 typically two `play_audio`\nrows bound to different audio assets.\n","tags":["subpackage_tts.subpackage_tts/agents"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","description":"Enter your API key with the `Bearer` prefix, e.g. 'Bearer sk_...'.","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"The agent's builtin instances.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/tts:ListAgentBuiltinsResponse"}}}},"401":{"description":"Authentication is missing or invalid. The request did not\ncarry a recognised credential (Firebase ID token, API key, or\nworker JWT).\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/tts:Error"}}}},"404":{"description":"The referenced resource does not exist or is not visible to\nthe caller's workspace.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/tts:Error"}}}}}}},"/v1/agents/{id}/builtins/{builtinId}":{"get":{"operationId":"get-builtin","summary":"Get Agent Builtin","description":"Fetch one builtin instance by ID.","tags":["subpackage_tts.subpackage_tts/agents"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"builtinId","in":"path","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","description":"Enter your API key with the `Bearer` prefix, e.g. 'Bearer sk_...'.","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"The builtin instance.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/tts:AgentBuiltin"}}}},"401":{"description":"Authentication is missing or invalid. The request did not\ncarry a recognised credential (Firebase ID token, API key, or\nworker JWT).\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/tts:Error"}}}},"404":{"description":"The referenced resource does not exist or is not visible to\nthe caller's workspace.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/tts:Error"}}}}}},"patch":{"operationId":"update-builtin","summary":"Update Agent Builtin","description":"Update a builtin instance. All fields optional; omitting a\nfield leaves it unchanged. The underlying `builtin` (which\ncapability the instance maps to) is intentionally NOT\npatchable \u2014 change of identity would surprise the worker, so\nthe customer should delete and recreate instead.\n","tags":["subpackage_tts.subpackage_tts/agents"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"builtinId","in":"path","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","description":"Enter your API key with the `Bearer` prefix, e.g. 'Bearer sk_...'.","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"The updated builtin instance.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/tts:AgentBuiltin"}}}},"400":{"description":"The request was malformed or failed validation. The response\nbody is the standard `Error` envelope; for validation\nfailures `error.fields` enumerates the offending fields as\na `path -> message` map (code = `validation_failed`).\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/tts:Error"}}}},"401":{"description":"Authentication is missing or invalid. The request did not\ncarry a recognised credential (Firebase ID token, API key, or\nworker JWT).\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/tts:Error"}}}},"404":{"description":"The referenced resource does not exist or is not visible to\nthe caller's workspace.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/tts:Error"}}}}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/tts:UpdateAgentBuiltinRequest"}}}}},"delete":{"operationId":"delete-builtin","summary":"Delete Agent Builtin","description":"Delete a builtin instance from this agent. Idempotent on\nalready-deleted ids (404). Does NOT detach references from\nflow nodes that name the instance; the worker logs and skips\non missing-row at session start (fail-soft).\n","tags":["subpackage_tts.subpackage_tts/agents"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"builtinId","in":"path","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","description":"Enter your API key with the `Bearer` prefix, e.g. 'Bearer sk_...'.","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"Builtin instance deleted.","content":{"application/json":{"schema":{"type":"object","properties":{}}}}},"401":{"description":"Authentication is missing or invalid. The request did not\ncarry a recognised credential (Firebase ID token, API key, or\nworker JWT).\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/tts:Error"}}}},"404":{"description":"The referenced resource does not exist or is not visible to\nthe caller's workspace.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/tts:Error"}}}}}}},"/v1/agents/{id}/variables":{"get":{"operationId":"get-dynamic-variables","summary":"Get Dynamic Variables","description":"Retrieve the agent's customer-scope dynamic variables and the read-only\ncatalogue of reserved `system__*` keys. The system variables list is\nprovided so editor UIs can render the reference list without maintaining\na client-side copy of the catalogue.\n","tags":["subpackage_tts.subpackage_tts/agents"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","description":"Enter your API key with the `Bearer` prefix, e.g. 'Bearer sk_...'.","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"The agent's variable catalogue.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/tts:ListDynamicVariablesResponse"}}}},"401":{"description":"Authentication is missing or invalid. The request did not\ncarry a recognised credential (Firebase ID token, API key, or\nworker JWT).\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/tts:Error"}}}},"404":{"description":"The referenced resource does not exist or is not visible to\nthe caller's workspace.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/tts:Error"}}}}}},"patch":{"operationId":"update-dynamic-variables","summary":"Update Dynamic Variables","description":"Replace the agent's customer-scope dynamic variable definitions.\nThe supplied list overwrites the stored list wholesale (same\nsemantics as `updateEvaluationConfig`). Pass an empty array to\nclear all variables. Up to 20 variables per agent. Keys must\nmatch `[a-zA-Z0-9_]+` and must not start with the reserved\n`system__` prefix.\n","tags":["subpackage_tts.subpackage_tts/agents"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","description":"Enter your API key with the `Bearer` prefix, e.g. 'Bearer sk_...'.","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"The updated variable catalogue.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/tts:ListDynamicVariablesResponse"}}}},"400":{"description":"The request was malformed or failed validation. The response\nbody is the standard `Error` envelope; for validation\nfailures `error.fields` enumerates the offending fields as\na `path -> message` map (code = `validation_failed`).\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/tts:Error"}}}},"401":{"description":"Authentication is missing or invalid. The request did not\ncarry a recognised credential (Firebase ID token, API key, or\nworker JWT).\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/tts:Error"}}}},"404":{"description":"The referenced resource does not exist or is not visible to\nthe caller's workspace.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/tts:Error"}}}}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/tts:UpdateDynamicVariablesRequest"}}}}}},"/v1/agents/{id}/evaluation-config":{"get":{"operationId":"get-evaluation-config","summary":"Get Evaluation Config","description":"Retrieve the agent's post-call evaluation criteria + data-collection config.","tags":["subpackage_tts.subpackage_tts/agents"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","description":"Enter your API key with the `Bearer` prefix, e.g. 'Bearer sk_...'.","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"The evaluation config for the agent.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/tts:EvaluationConfig"}}}},"401":{"description":"Authentication is missing or invalid. The request did not\ncarry a recognised credential (Firebase ID token, API key, or\nworker JWT).\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/tts:Error"}}}}}},"patch":{"operationId":"update-evaluation-config","summary":"Update Evaluation Config","description":"Replace the agent's evaluation criteria + data-collection fields.","tags":["subpackage_tts.subpackage_tts/agents"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","description":"Enter your API key with the `Bearer` prefix, e.g. 'Bearer sk_...'.","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"The updated evaluation config.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/tts:EvaluationConfig"}}}},"400":{"description":"The request was malformed or failed validation. The response\nbody is the standard `Error` envelope; for validation\nfailures `error.fields` enumerates the offending fields as\na `path -> message` map (code = `validation_failed`).\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/tts:Error"}}}},"401":{"description":"Authentication is missing or invalid. The request did not\ncarry a recognised credential (Firebase ID token, API key, or\nworker JWT).\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/tts:Error"}}}}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/tts:UpdateEvaluationConfigRequest"}}}}}},"/v1/agents/{id}/knowledge-bases":{"get":{"operationId":"list-agent-knowledge-bases","summary":"List Agent Knowledge Bases","description":"List knowledge bases attached to an agent. Bare list \u2014 the\nattachment count is bounded by configuration, not by data\nscale, so this endpoint does not paginate.\n","tags":["subpackage_tts.subpackage_tts/agents"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","description":"Enter your API key with the `Bearer` prefix, e.g. 'Bearer sk_...'.","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"The knowledge bases attached to the agent.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/tts:AttachedKnowledgeBasesResponse"}}}},"401":{"description":"Authentication is missing or invalid. The request did not\ncarry a recognised credential (Firebase ID token, API key, or\nworker JWT).\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/tts:Error"}}}},"404":{"description":"The referenced resource does not exist or is not visible to\nthe caller's workspace.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/tts:Error"}}}}}}},"/v1/agents/{id}/knowledge-bases/{kbId}":{"post":{"operationId":"attach-knowledge-base","summary":"Attach Agent Knowledge Base","description":"Attach a knowledge base to an agent. The `search_knowledge` tool\nis auto-registered on the next conversation and can only query the\nattached knowledge bases.","tags":["subpackage_tts.subpackage_tts/agents"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"kbId","in":"path","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","description":"Enter your API key with the `Bearer` prefix, e.g. 'Bearer sk_...'.","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"Knowledge base attached.","content":{"application/json":{"schema":{"type":"object","properties":{}}}}},"401":{"description":"Authentication is missing or invalid. The request did not\ncarry a recognised credential (Firebase ID token, API key, or\nworker JWT).\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/tts:Error"}}}},"404":{"description":"The referenced resource does not exist or is not visible to\nthe caller's workspace.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/tts:Error"}}}}}},"delete":{"operationId":"detach-knowledge-base","summary":"Detach Agent Knowledge Base","description":"Detach a knowledge base from an agent.","tags":["subpackage_tts.subpackage_tts/agents"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"kbId","in":"path","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","description":"Enter your API key with the `Bearer` prefix, e.g. 'Bearer sk_...'.","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"Knowledge base detached.","content":{"application/json":{"schema":{"type":"object","properties":{}}}}},"401":{"description":"Authentication is missing or invalid. The request did not\ncarry a recognised credential (Firebase ID token, API key, or\nworker JWT).\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/tts:Error"}}}},"404":{"description":"The referenced resource does not exist or is not visible to\nthe caller's workspace.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/tts:Error"}}}}}}},"/v1/agents/{id}/memories":{"get":{"operationId":"list-memories","summary":"List Agent Memories","description":"List per-caller memories extracted for an agent. Memories are\nwritten post-call by the built-in extractor when `memory_enabled`\nis true on the agent; the list is sorted newest-first.","tags":["subpackage_tts.subpackage_tts/agents"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"limit","in":"query","description":"Maximum rows to return. Defaults to 100, capped at 200.","required":false,"schema":{"type":"integer","default":100}},{"name":"offset","in":"query","description":"Number of rows to skip. Combine with `limit` to page through older memories.","required":false,"schema":{"type":"integer","default":0}},{"name":"Authorization","in":"header","description":"Enter your API key with the `Bearer` prefix, e.g. 'Bearer sk_...'.","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Memories for the agent.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/tts:ListMemoriesResponse"}}}},"401":{"description":"Authentication is missing or invalid. The request did not\ncarry a recognised credential (Firebase ID token, API key, or\nworker JWT).\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/tts:Error"}}}},"404":{"description":"The referenced resource does not exist or is not visible to\nthe caller's workspace.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/tts:Error"}}}}}}},"/v1/agents/{id}/memories/delete":{"post":{"operationId":"delete-memories-by-caller","summary":"Delete Memories by Caller","description":"Delete every memory ever extracted for a specific caller on\nthis agent. Privacy / GDPR surface. Returns the count of rows\nsoft-deleted; rows become permanently unreachable immediately\nand are hard-deleted by the retention job after the tenant's\nconfigured retention window.","tags":["subpackage_tts.subpackage_tts/agents"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","description":"Enter your API key with the `Bearer` prefix, e.g. 'Bearer sk_...'.","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Deletion summary.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/tts:DeleteMemoriesByCallerResponse"}}}},"400":{"description":"The request was malformed or failed validation. The response\nbody is the standard `Error` envelope; for validation\nfailures `error.fields` enumerates the offending fields as\na `path -> message` map (code = `validation_failed`).\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/tts:Error"}}}},"401":{"description":"Authentication is missing or invalid. The request did not\ncarry a recognised credential (Firebase ID token, API key, or\nworker JWT).\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/tts:Error"}}}}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/tts:DeleteMemoriesByCallerRequest"}}}}}},"/v1/agents/{id}/tests":{"get":{"operationId":"list-tests","summary":"List Agent Tests","description":"List all tests configured for the agent. Each entry includes the\nmost recent run so the console can render pass/fail badges without\nan extra round-trip.","tags":["subpackage_tts.subpackage_tts/agents"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","description":"Enter your API key with the `Bearer` prefix, e.g. 'Bearer sk_...'.","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Tests for the agent with last-run summaries.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/tts:ListAgentTestsResponse"}}}},"401":{"description":"Authentication is missing or invalid. The request did not\ncarry a recognised credential (Firebase ID token, API key, or\nworker JWT).\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/tts:Error"}}}},"404":{"description":"The referenced resource does not exist or is not visible to\nthe caller's workspace.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/tts:Error"}}}}}},"post":{"operationId":"create-test","summary":"Create Agent Test","description":"Create a new test for the agent.","tags":["subpackage_tts.subpackage_tts/agents"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","description":"Enter your API key with the `Bearer` prefix, e.g. 'Bearer sk_...'.","required":true,"schema":{"type":"string"}}],"responses":{"201":{"description":"The created test.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/tts:AgentTest"}}}},"400":{"description":"The request was malformed or failed validation. The response\nbody is the standard `Error` envelope; for validation\nfailures `error.fields` enumerates the offending fields as\na `path -> message` map (code = `validation_failed`).\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/tts:Error"}}}},"401":{"description":"Authentication is missing or invalid. The request did not\ncarry a recognised credential (Firebase ID token, API key, or\nworker JWT).\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/tts:Error"}}}},"404":{"description":"The referenced resource does not exist or is not visible to\nthe caller's workspace.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/tts:Error"}}}}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/tts:CreateAgentTestRequest"}}}}}},"/v1/agents/{id}/tests/runs":{"post":{"operationId":"run-all-tests","summary":"Run All Agent Tests","description":"Enqueue runs for every test on the agent concurrently. Up to 50\ntests are dispatched in one call. Each returned run starts in\n`queued` status; poll `GET /v1/agents/tests/runs/{id}` for the terminal\nresult.\n\nAn optional request body (AIS-3443) runs the whole suite against\na proposed config: a `config_override` (prompt / model / tools)\napplied to every test without editing the tests, and/or a\n`flow_version_id` to target a specific flow version instead of\nthe agent's active flow. Omit the body to run against the\nagent's live config and active flow.","tags":["subpackage_tts.subpackage_tts/agents"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","description":"Enter your API key with the `Bearer` prefix, e.g. 'Bearer sk_...'.","required":true,"schema":{"type":"string"}}],"responses":{"202":{"description":"Queued runs for all tests on the agent.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/tts:RunAgentTestsResponse"}}}},"400":{"description":"The request was malformed or failed validation. The response\nbody is the standard `Error` envelope; for validation\nfailures `error.fields` enumerates the offending fields as\na `path -> message` map (code = `validation_failed`).\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/tts:Error"}}}},"401":{"description":"Authentication is missing or invalid. The request did not\ncarry a recognised credential (Firebase ID token, API key, or\nworker JWT).\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/tts:Error"}}}},"404":{"description":"The referenced resource does not exist or is not visible to\nthe caller's workspace.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/tts:Error"}}}}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/tts:RunAllTestsRequest"}}}}}},"/v1/agents/{id}/tools":{"get":{"operationId":"list-tools","summary":"List Agent Tools","description":"List tools currently attached to the agent. Bare list \u2014 an\nagent's tool attachment count is bounded by configuration, so\nthis endpoint does not paginate.\n","tags":["subpackage_tts.subpackage_tts/agents"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","description":"Enter your API key with the `Bearer` prefix, e.g. 'Bearer sk_...'.","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Attached tools for the agent.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/tts:AttachedToolsResponse"}}}},"401":{"description":"Authentication is missing or invalid. The request did not\ncarry a recognised credential (Firebase ID token, API key, or\nworker JWT).\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/tts:Error"}}}}}}},"/v1/agents/{id}/tools/{toolId}":{"post":{"operationId":"attach-tool","summary":"Attach Tool","description":"Attach an existing tool to the agent so the LLM can call it.","tags":["subpackage_tts.subpackage_tts/agents"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"toolId","in":"path","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","description":"Enter your API key with the `Bearer` prefix, e.g. 'Bearer sk_...'.","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"Tool attached.","content":{"application/json":{"schema":{"type":"object","properties":{}}}}},"401":{"description":"Authentication is missing or invalid. The request did not\ncarry a recognised credential (Firebase ID token, API key, or\nworker JWT).\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/tts:Error"}}}},"404":{"description":"The referenced resource does not exist or is not visible to\nthe caller's workspace.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/tts:Error"}}}}}},"delete":{"operationId":"detach-tool","summary":"Detach Tool","description":"Detach a tool from the agent.","tags":["subpackage_tts.subpackage_tts/agents"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"toolId","in":"path","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","description":"Enter your API key with the `Bearer` prefix, e.g. 'Bearer sk_...'.","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"Tool detached.","content":{"application/json":{"schema":{"type":"object","properties":{}}}}},"401":{"description":"Authentication is missing or invalid. The request did not\ncarry a recognised credential (Firebase ID token, API key, or\nworker JWT).\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/tts:Error"}}}},"404":{"description":"The referenced resource does not exist or is not visible to\nthe caller's workspace.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/tts:Error"}}}}}}},"/v1/agents/{id}/widget-config":{"get":{"operationId":"get-widget-config","summary":"Get Agent Widget Config","description":"Return the embed-widget appearance config for an agent. Works\nunauthenticated for public agents; the body is cosmetic only.\n","tags":["subpackage_tts.subpackage_tts/agents"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","description":"Enter your API key with the `Bearer` prefix, e.g. 'Bearer sk_...'.","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"The agent's widget configuration.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/tts:WidgetConfig"}}}},"404":{"description":"The referenced resource does not exist or is not visible to\nthe caller's workspace.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/tts:Error"}}}},"500":{"description":"An unexpected server-side error occurred. Safe to retry with\nexponential backoff for idempotent requests.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/tts:Error"}}}}}}},"/v1/agents/conversations":{"get":{"operationId":"list","summary":"List Conversations","description":"List conversations owned by the caller, ordered by most recent.\nCursor-paginated: omit `cursor` to fetch the first page; pass the\nprevious response's `next_cursor` back to fetch the next page.\nWalk pages while `has_more` is true.","tags":["subpackage_tts.subpackage_tts/conversations"],"parameters":[{"name":"cursor","in":"query","description":"Opaque pagination cursor from a previous response.","required":false,"schema":{"type":"string"}},{"name":"limit","in":"query","description":"Max conversations per page (default 50, max 200).","required":false,"schema":{"type":"integer"}},{"name":"agent_id","in":"query","description":"Filter to conversations for this agent.","required":false,"schema":{"type":"string"}},{"name":"status","in":"query","description":"Filter by conversation status.","required":false,"schema":{"$ref":"#/components/schemas/tts:ConversationStatus"}},{"name":"transport","in":"query","description":"Filter by transport.","required":false,"schema":{"$ref":"#/components/schemas/tts:ConversationTransport"}},{"name":"caller_identity","in":"query","description":"Filter by caller identity.","required":false,"schema":{"type":"string"}},{"name":"search","in":"query","description":"Free-text search across conversation content.","required":false,"schema":{"type":"string"}},{"name":"started_after","in":"query","description":"Only conversations started at or after this RFC 3339 timestamp.","required":false,"schema":{"type":"string","format":"date-time"}},{"name":"started_before","in":"query","description":"Only conversations started at or before this RFC 3339 timestamp.","required":false,"schema":{"type":"string","format":"date-time"}},{"name":"duration_min_ms","in":"query","description":"Minimum conversation duration in milliseconds.","required":false,"schema":{"type":"integer"}},{"name":"duration_max_ms","in":"query","description":"Maximum conversation duration in milliseconds.","required":false,"schema":{"type":"integer"}},{"name":"Authorization","in":"header","description":"Enter your API key with the `Bearer` prefix, e.g. 'Bearer sk_...'.","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"A list of conversations.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/tts:ListConversationsResponse"}}}},"401":{"description":"Authentication is missing or invalid. The request did not\ncarry a recognised credential (Firebase ID token, API key, or\nworker JWT).\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/tts:Error"}}}}}}},"/v1/agents/conversations/{id}":{"get":{"operationId":"get","summary":"Get Conversation","description":"Retrieve a conversation by ID.","tags":["subpackage_tts.subpackage_tts/conversations"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","description":"Enter your API key with the `Bearer` prefix, e.g. 'Bearer sk_...'.","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"The requested conversation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/tts:Conversation"}}}},"401":{"description":"Authentication is missing or invalid. The request did not\ncarry a recognised credential (Firebase ID token, API key, or\nworker JWT).\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/tts:Error"}}}},"404":{"description":"The referenced resource does not exist or is not visible to\nthe caller's workspace.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/tts:Error"}}}}}}},"/v1/agents/conversations/{id}/messages":{"get":{"operationId":"list-messages","summary":"List Messages","description":"Retrieve the transcript for a conversation in started_at order\n(oldest first). Cursor-paginated: omit `cursor` to fetch the\nfirst page. Default page size is 50 and max is 200. Walk pages\nwhile `has_more` is true.","tags":["subpackage_tts.subpackage_tts/conversations"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"cursor","in":"query","description":"Opaque pagination cursor from a previous response.","required":false,"schema":{"type":"string"}},{"name":"limit","in":"query","description":"Max messages per page (default 50, max 200).","required":false,"schema":{"type":"integer"}},{"name":"Authorization","in":"header","description":"Enter your API key with the `Bearer` prefix, e.g. 'Bearer sk_...'.","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"The messages for the conversation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/tts:ListMessagesResponse"}}}},"400":{"description":"The request was malformed or failed validation. The response\nbody is the standard `Error` envelope; for validation\nfailures `error.fields` enumerates the offending fields as\na `path -> message` map (code = `validation_failed`).\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/tts:Error"}}}},"401":{"description":"Authentication is missing or invalid. The request did not\ncarry a recognised credential (Firebase ID token, API key, or\nworker JWT).\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/tts:Error"}}}},"404":{"description":"The referenced resource does not exist or is not visible to\nthe caller's workspace.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/tts:Error"}}}}}}},"/v1/agents/conversations/{id}/evaluations":{"get":{"operationId":"list-evaluations","summary":"List Evaluations","description":"Retrieve post-call evaluation results for a conversation.","tags":["subpackage_tts.subpackage_tts/conversations"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","description":"Enter your API key with the `Bearer` prefix, e.g. 'Bearer sk_...'.","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"The evaluations for the conversation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/tts:ListEvaluationsResponse"}}}},"401":{"description":"Authentication is missing or invalid. The request did not\ncarry a recognised credential (Firebase ID token, API key, or\nworker JWT).\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/tts:Error"}}}},"404":{"description":"The referenced resource does not exist or is not visible to\nthe caller's workspace.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/tts:Error"}}}}}}},"/v1/agents/conversations/{id}/memories":{"get":{"operationId":"list-memories","summary":"List Conversation Memories","description":"List memories extracted from a specific conversation.","tags":["subpackage_tts.subpackage_tts/conversations"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","description":"Enter your API key with the `Bearer` prefix, e.g. 'Bearer sk_...'.","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Memories written during this conversation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/tts:ListMemoriesResponse"}}}},"401":{"description":"Authentication is missing or invalid. The request did not\ncarry a recognised credential (Firebase ID token, API key, or\nworker JWT).\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/tts:Error"}}}},"404":{"description":"The referenced resource does not exist or is not visible to\nthe caller's workspace.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/tts:Error"}}}}}}},"/v1/agents/conversations/stats":{"get":{"operationId":"stats","summary":"Conversation stats","description":"Aggregated counts and averages over the caller's conversations, scoped by the same filters as the list endpoint.","tags":["subpackage_tts.subpackage_tts/conversations"],"parameters":[{"name":"agent_id","in":"query","description":"Filter to conversations for this agent.","required":false,"schema":{"type":"string"}},{"name":"status","in":"query","description":"Filter by conversation status.","required":false,"schema":{"$ref":"#/components/schemas/tts:ConversationStatus"}},{"name":"transport","in":"query","description":"Filter by transport.","required":false,"schema":{"$ref":"#/components/schemas/tts:ConversationTransport"}},{"name":"caller_identity","in":"query","description":"Filter by caller identity.","required":false,"schema":{"type":"string"}},{"name":"search","in":"query","description":"Free-text search across conversation content.","required":false,"schema":{"type":"string"}},{"name":"started_after","in":"query","description":"Only conversations started at or after this RFC 3339 timestamp.","required":false,"schema":{"type":"string","format":"date-time"}},{"name":"started_before","in":"query","description":"Only conversations started at or before this RFC 3339 timestamp.","required":false,"schema":{"type":"string","format":"date-time"}},{"name":"duration_min_ms","in":"query","description":"Minimum conversation duration in milliseconds.","required":false,"schema":{"type":"integer"}},{"name":"duration_max_ms","in":"query","description":"Maximum conversation duration in milliseconds.","required":false,"schema":{"type":"integer"}},{"name":"Authorization","in":"header","description":"Enter your API key with the `Bearer` prefix, e.g. 'Bearer sk_...'.","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Stats for the matched conversations.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/tts:ConversationStats"}}}},"401":{"description":"Authentication is missing or invalid. The request did not\ncarry a recognised credential (Firebase ID token, API key, or\nworker JWT).\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/tts:Error"}}}}}}},"/v1/agents/conversations/recent-callees":{"get":{"operationId":"recent-callees","summary":"List recent callees","description":"Distinct phone numbers the caller's workspace has dialled on\noutbound calls, ordered by most recent. Feeds the batch-calls\ncomposer's \"Suggested from history\" surface. Cursor-paginated:\nomit `cursor` to fetch the first page. Default page size is 50\nand max is 200. Walk pages while `has_more` is true.\n","tags":["subpackage_tts.subpackage_tts/conversations"],"parameters":[{"name":"cursor","in":"query","description":"Opaque pagination cursor from a previous response.","required":false,"schema":{"type":"string"}},{"name":"limit","in":"query","description":"Max number of distinct phone numbers per page. Defaults to 50; clamped to 200.","required":false,"schema":{"type":"integer"}},{"name":"Authorization","in":"header","description":"Enter your API key with the `Bearer` prefix, e.g. 'Bearer sk_...'.","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Recent callees for the caller's workspace.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/tts:ListRecentCalleesResponse"}}}},"400":{"description":"The request was malformed or failed validation. The response\nbody is the standard `Error` envelope; for validation\nfailures `error.fields` enumerates the offending fields as\na `path -> message` map (code = `validation_failed`).\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/tts:Error"}}}},"401":{"description":"Authentication is missing or invalid. The request did not\ncarry a recognised credential (Firebase ID token, API key, or\nworker JWT).\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/tts:Error"}}}}}}},"/v1/agents/conversations/{id}/recording":{"get":{"operationId":"stream-recording","summary":"Stream Recording","description":"Proxy the GCS-stored audio recording for a conversation through\nthe Cloud Run service identity. Returns OGG/Opus bytes (LiveKit\nroom-composite egress default). The response is streamed so a\nlong recording does not buffer in memory; `