From f20eed38e73a16d8c24bac76fbd2870276c13cda Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Tue, 15 Sep 2026 08:17:01 +0000 Subject: [PATCH] feat: Updated OpenAPI spec --- .../Speechify.HostedApisClient.Create.g.cs | 15 +- .../Speechify.IHostedApisClient.Create.g.cs | 15 +- .../Speechify.IRoutesClient.CreateRoute.g.cs | 88 +- .../Speechify.IRoutesClient.MountRoutes.g.cs | 189 ++++ .../Speechify.IRoutesClient.UpdateRoute.g.cs | 52 +- ...echify.JsonConverters.AgentToolConfig.g.cs | 1 + ...nverters.CreateAgentToolRequestConfig.g.cs | 1 + ...sonConverters.CreateToolRequestConfig.g.cs | 1 + ...verters.HostedApiMountOperationAction.g.cs | 53 ++ ...HostedApiMountOperationActionNullable.g.cs | 60 ++ ...s.HostedApiMountOperationChangesItems.g.cs | 53 ++ ...ApiMountOperationChangesItemsNullable.g.cs | 60 ++ ...JsonConverters.HostedApiMountToolKind.g.cs | 53 ++ ...erters.HostedApiMountToolKindNullable.g.cs | 60 ++ .../Speechify.JsonConverters.ToolConfig.g.cs | 1 + ...sonConverters.UpdateToolRequestConfig.g.cs | 1 + .../Speechify.JsonSerializerContext.g.cs | 80 +- .../Speechify.JsonSerializerContextTypes.g.cs | 228 +++-- ...fy.Models.CreateHostedAPIRouteRequest.g.cs | 104 ++- .../Generated/Speechify.Models.ErrorCode.g.cs | 6 + .../Generated/Speechify.Models.HostedAPI.g.cs | 15 + .../Speechify.Models.HostedAPIMount.Json.g.cs | 141 +++ .../Speechify.Models.HostedAPIMount.g.cs | 118 +++ ...y.Models.HostedAPIMountOperation.Json.g.cs | 141 +++ ...echify.Models.HostedAPIMountOperation.g.cs | 169 ++++ ...ify.Models.HostedAPIMountSummary.Json.g.cs | 141 +++ ...peechify.Models.HostedAPIMountSummary.g.cs | 85 ++ .../Speechify.Models.HostedAPIResolver.g.cs | 138 ++- ...els.HostedAPIResolverInputSchema.Json.g.cs | 141 +++ ...y.Models.HostedAPIResolverInputSchema.g.cs | 25 + ...ls.HostedAPIResolverInputSchema2.Json.g.cs | 141 +++ ....Models.HostedAPIResolverInputSchema2.g.cs | 19 + .../Speechify.Models.HostedAPIRoute.g.cs | 104 ++- ....Models.HostedApiMountOperationAction.g.cs | 69 ++ ...s.HostedApiMountOperationChangesItems.g.cs | 45 + ...eechify.Models.HostedApiMountToolKind.g.cs | 51 ++ ...hify.Models.HostedApiUsageRoutesItems.g.cs | 46 +- .../Speechify.Models.MCPToolConfig.g.cs | 51 +- ....Models.MCPToolConfigResponseMappings.g.cs | 9 +- ...dels.MountHostedAPIRoutesRequest.Json.g.cs | 141 +++ ...fy.Models.MountHostedAPIRoutesRequest.g.cs | 116 +++ ...fy.Models.UpdateHostedAPIRouteRequest.g.cs | 104 ++- ...peechify.Routes.JsonSerializerContext.g.cs | 58 ++ .../Speechify.RoutesClient.CreateRoute.g.cs | 88 +- .../Speechify.RoutesClient.MountRoutes.g.cs | 821 ++++++++++++++++++ .../Speechify.RoutesClient.UpdateRoute.g.cs | 52 +- src/libs/Speechify/openapi.yaml | 2 +- 47 files changed, 3805 insertions(+), 347 deletions(-) create mode 100644 src/libs/Speechify/Generated/Speechify.IRoutesClient.MountRoutes.g.cs create mode 100644 src/libs/Speechify/Generated/Speechify.JsonConverters.HostedApiMountOperationAction.g.cs create mode 100644 src/libs/Speechify/Generated/Speechify.JsonConverters.HostedApiMountOperationActionNullable.g.cs create mode 100644 src/libs/Speechify/Generated/Speechify.JsonConverters.HostedApiMountOperationChangesItems.g.cs create mode 100644 src/libs/Speechify/Generated/Speechify.JsonConverters.HostedApiMountOperationChangesItemsNullable.g.cs create mode 100644 src/libs/Speechify/Generated/Speechify.JsonConverters.HostedApiMountToolKind.g.cs create mode 100644 src/libs/Speechify/Generated/Speechify.JsonConverters.HostedApiMountToolKindNullable.g.cs create mode 100644 src/libs/Speechify/Generated/Speechify.Models.HostedAPIMount.Json.g.cs create mode 100644 src/libs/Speechify/Generated/Speechify.Models.HostedAPIMount.g.cs create mode 100644 src/libs/Speechify/Generated/Speechify.Models.HostedAPIMountOperation.Json.g.cs create mode 100644 src/libs/Speechify/Generated/Speechify.Models.HostedAPIMountOperation.g.cs create mode 100644 src/libs/Speechify/Generated/Speechify.Models.HostedAPIMountSummary.Json.g.cs create mode 100644 src/libs/Speechify/Generated/Speechify.Models.HostedAPIMountSummary.g.cs create mode 100644 src/libs/Speechify/Generated/Speechify.Models.HostedAPIResolverInputSchema.Json.g.cs create mode 100644 src/libs/Speechify/Generated/Speechify.Models.HostedAPIResolverInputSchema.g.cs create mode 100644 src/libs/Speechify/Generated/Speechify.Models.HostedAPIResolverInputSchema2.Json.g.cs create mode 100644 src/libs/Speechify/Generated/Speechify.Models.HostedAPIResolverInputSchema2.g.cs create mode 100644 src/libs/Speechify/Generated/Speechify.Models.HostedApiMountOperationAction.g.cs create mode 100644 src/libs/Speechify/Generated/Speechify.Models.HostedApiMountOperationChangesItems.g.cs create mode 100644 src/libs/Speechify/Generated/Speechify.Models.HostedApiMountToolKind.g.cs create mode 100644 src/libs/Speechify/Generated/Speechify.Models.MountHostedAPIRoutesRequest.Json.g.cs create mode 100644 src/libs/Speechify/Generated/Speechify.Models.MountHostedAPIRoutesRequest.g.cs create mode 100644 src/libs/Speechify/Generated/Speechify.RoutesClient.MountRoutes.g.cs diff --git a/src/libs/Speechify/Generated/Speechify.HostedApisClient.Create.g.cs b/src/libs/Speechify/Generated/Speechify.HostedApisClient.Create.g.cs index a4314fcd..1921f079 100644 --- a/src/libs/Speechify/Generated/Speechify.HostedApisClient.Create.g.cs +++ b/src/libs/Speechify/Generated/Speechify.HostedApisClient.Create.g.cs @@ -54,7 +54,10 @@ partial void ProcessCreateResponseContent( /// signs per user), `consumer_key` (a `ck_` key you mint) or `public`
/// (anyone, reads only). A workspace can refuse `public` as policy (403
/// `hosted_api_public_refused`). Reads, runs and writes are each bounded
- /// per UTC day (`daily_read_cap`, `daily_run_cap`, `daily_write_cap`).
+ /// per UTC day (`daily_read_cap`, `daily_run_cap`, `daily_write_cap`),
+ /// and an API holds only a share of a server's requests open at once, so
+ /// a slow upstream behind one API cannot take the capacity others need:
+ /// past it, a request answers 429 `hosted_api_busy` with `Retry-After`.
/// `mcp_enabled: true` also serves the API's routes as an MCP server at
/// `POST <base_url>/mcp`, so an MCP client (Claude Code, Cursor) attaches
/// to one address and gets them as tools, under the same audience, keys
@@ -100,7 +103,10 @@ partial void ProcessCreateResponseContent( /// signs per user), `consumer_key` (a `ck_` key you mint) or `public`
/// (anyone, reads only). A workspace can refuse `public` as policy (403
/// `hosted_api_public_refused`). Reads, runs and writes are each bounded
- /// per UTC day (`daily_read_cap`, `daily_run_cap`, `daily_write_cap`).
+ /// per UTC day (`daily_read_cap`, `daily_run_cap`, `daily_write_cap`),
+ /// and an API holds only a share of a server's requests open at once, so
+ /// a slow upstream behind one API cannot take the capacity others need:
+ /// past it, a request answers 429 `hosted_api_busy` with `Retry-After`.
/// `mcp_enabled: true` also serves the API's routes as an MCP server at
/// `POST <base_url>/mcp`, so an MCP client (Claude Code, Cursor) attaches
/// to one address and gets them as tools, under the same audience, keys
@@ -689,7 +695,10 @@ partial void ProcessCreateResponseContent( /// signs per user), `consumer_key` (a `ck_` key you mint) or `public`
/// (anyone, reads only). A workspace can refuse `public` as policy (403
/// `hosted_api_public_refused`). Reads, runs and writes are each bounded
- /// per UTC day (`daily_read_cap`, `daily_run_cap`, `daily_write_cap`).
+ /// per UTC day (`daily_read_cap`, `daily_run_cap`, `daily_write_cap`),
+ /// and an API holds only a share of a server's requests open at once, so
+ /// a slow upstream behind one API cannot take the capacity others need:
+ /// past it, a request answers 429 `hosted_api_busy` with `Retry-After`.
/// `mcp_enabled: true` also serves the API's routes as an MCP server at
/// `POST <base_url>/mcp`, so an MCP client (Claude Code, Cursor) attaches
/// to one address and gets them as tools, under the same audience, keys
diff --git a/src/libs/Speechify/Generated/Speechify.IHostedApisClient.Create.g.cs b/src/libs/Speechify/Generated/Speechify.IHostedApisClient.Create.g.cs index ae151262..e77ef0c6 100644 --- a/src/libs/Speechify/Generated/Speechify.IHostedApisClient.Create.g.cs +++ b/src/libs/Speechify/Generated/Speechify.IHostedApisClient.Create.g.cs @@ -13,7 +13,10 @@ public partial interface IHostedApisClient /// signs per user), `consumer_key` (a `ck_` key you mint) or `public`
/// (anyone, reads only). A workspace can refuse `public` as policy (403
/// `hosted_api_public_refused`). Reads, runs and writes are each bounded
- /// per UTC day (`daily_read_cap`, `daily_run_cap`, `daily_write_cap`).
+ /// per UTC day (`daily_read_cap`, `daily_run_cap`, `daily_write_cap`),
+ /// and an API holds only a share of a server's requests open at once, so
+ /// a slow upstream behind one API cannot take the capacity others need:
+ /// past it, a request answers 429 `hosted_api_busy` with `Retry-After`.
/// `mcp_enabled: true` also serves the API's routes as an MCP server at
/// `POST <base_url>/mcp`, so an MCP client (Claude Code, Cursor) attaches
/// to one address and gets them as tools, under the same audience, keys
@@ -47,7 +50,10 @@ public partial interface IHostedApisClient /// signs per user), `consumer_key` (a `ck_` key you mint) or `public`
/// (anyone, reads only). A workspace can refuse `public` as policy (403
/// `hosted_api_public_refused`). Reads, runs and writes are each bounded
- /// per UTC day (`daily_read_cap`, `daily_run_cap`, `daily_write_cap`).
+ /// per UTC day (`daily_read_cap`, `daily_run_cap`, `daily_write_cap`),
+ /// and an API holds only a share of a server's requests open at once, so
+ /// a slow upstream behind one API cannot take the capacity others need:
+ /// past it, a request answers 429 `hosted_api_busy` with `Retry-After`.
/// `mcp_enabled: true` also serves the API's routes as an MCP server at
/// `POST <base_url>/mcp`, so an MCP client (Claude Code, Cursor) attaches
/// to one address and gets them as tools, under the same audience, keys
@@ -81,7 +87,10 @@ public partial interface IHostedApisClient /// signs per user), `consumer_key` (a `ck_` key you mint) or `public`
/// (anyone, reads only). A workspace can refuse `public` as policy (403
/// `hosted_api_public_refused`). Reads, runs and writes are each bounded
- /// per UTC day (`daily_read_cap`, `daily_run_cap`, `daily_write_cap`).
+ /// per UTC day (`daily_read_cap`, `daily_run_cap`, `daily_write_cap`),
+ /// and an API holds only a share of a server's requests open at once, so
+ /// a slow upstream behind one API cannot take the capacity others need:
+ /// past it, a request answers 429 `hosted_api_busy` with `Retry-After`.
/// `mcp_enabled: true` also serves the API's routes as an MCP server at
/// `POST <base_url>/mcp`, so an MCP client (Claude Code, Cursor) attaches
/// to one address and gets them as tools, under the same audience, keys
diff --git a/src/libs/Speechify/Generated/Speechify.IRoutesClient.CreateRoute.g.cs b/src/libs/Speechify/Generated/Speechify.IRoutesClient.CreateRoute.g.cs index 619f3719..52e930fe 100644 --- a/src/libs/Speechify/Generated/Speechify.IRoutesClient.CreateRoute.g.cs +++ b/src/libs/Speechify/Generated/Speechify.IRoutesClient.CreateRoute.g.cs @@ -17,11 +17,13 @@ public partial interface IRoutesClient /// 202 with a handle to poll at `/_runs/{run_id}`; `file` serves one
/// published file, or a whole published tree when the path ends in `*`
/// (`/app/*` with `file_root` and `file_index`); `tool` calls one read
- /// operation of an `openapi` tool definition in the API's project whose
- /// `approval` is null or `auto` (POST only, never on a public API, counted
- /// against `daily_read_cap`): the
- /// consumer's JSON body is the operation's arguments and the vendor's
- /// answer, after the operation's `response` mapping, is the response.
+ /// operation of an `openapi` tool definition, or one tool of an `mcp`
+ /// tool definition's server, in the API's project whose `approval` is
+ /// null or `auto` (POST only, never on a public API, counted against
+ /// `daily_read_cap`): the consumer's JSON body is the arguments and the
+ /// connector's answer, after the tool's response mapping, is the
+ /// response. An `mcp` route pins the tool's input schema as
+ /// `resolver.input_schema` when it is written.
/// Where-clause values and
/// the document id may be `{{query.x}}`, `{{path.x}}` or `{{body.x}}`
/// templates bound from the consumer's request, or `{{user.x}}` claims of
@@ -75,11 +77,13 @@ public partial interface IRoutesClient /// 202 with a handle to poll at `/_runs/{run_id}`; `file` serves one
/// published file, or a whole published tree when the path ends in `*`
/// (`/app/*` with `file_root` and `file_index`); `tool` calls one read
- /// operation of an `openapi` tool definition in the API's project whose
- /// `approval` is null or `auto` (POST only, never on a public API, counted
- /// against `daily_read_cap`): the
- /// consumer's JSON body is the operation's arguments and the vendor's
- /// answer, after the operation's `response` mapping, is the response.
+ /// operation of an `openapi` tool definition, or one tool of an `mcp`
+ /// tool definition's server, in the API's project whose `approval` is
+ /// null or `auto` (POST only, never on a public API, counted against
+ /// `daily_read_cap`): the consumer's JSON body is the arguments and the
+ /// connector's answer, after the tool's response mapping, is the
+ /// response. An `mcp` route pins the tool's input schema as
+ /// `resolver.input_schema` when it is written.
/// Where-clause values and
/// the document id may be `{{query.x}}`, `{{path.x}}` or `{{body.x}}`
/// templates bound from the consumer's request, or `{{user.x}}` claims of
@@ -133,11 +137,13 @@ public partial interface IRoutesClient /// 202 with a handle to poll at `/_runs/{run_id}`; `file` serves one
/// published file, or a whole published tree when the path ends in `*`
/// (`/app/*` with `file_root` and `file_index`); `tool` calls one read
- /// operation of an `openapi` tool definition in the API's project whose
- /// `approval` is null or `auto` (POST only, never on a public API, counted
- /// against `daily_read_cap`): the
- /// consumer's JSON body is the operation's arguments and the vendor's
- /// answer, after the operation's `response` mapping, is the response.
+ /// operation of an `openapi` tool definition, or one tool of an `mcp`
+ /// tool definition's server, in the API's project whose `approval` is
+ /// null or `auto` (POST only, never on a public API, counted against
+ /// `daily_read_cap`): the consumer's JSON body is the arguments and the
+ /// connector's answer, after the tool's response mapping, is the
+ /// response. An `mcp` route pins the tool's input schema as
+ /// `resolver.input_schema` when it is written.
/// Where-clause values and
/// the document id may be `{{query.x}}`, `{{path.x}}` or `{{body.x}}`
/// templates bound from the consumer's request, or `{{user.x}}` claims of
@@ -202,27 +208,47 @@ public partial interface IRoutesClient /// `run` (trigger_id of a webhook trigger, wait_seconds),
/// `file` (file_path of one published file; or, on a route whose path
/// ends in `*`, file_root and file_index for a whole published tree),
- /// `tool` (tool_id of an `openapi` tool definition and the `operation`
- /// on it: the POST body is the operation's arguments, held to its
- /// argument schema, and the vendor's answer after the operation's
- /// `response` mapping is the response, or `{"text": ...}` when the vendor
- /// answered text. Only an operation whose effective class is `read`, on a
- /// tool whose `approval` is null or `auto`, may be served, and never on a
- /// public API; a route write that names anything else is refused with 400
- /// `validation_failed` on `resolver.tool_id`. Because a definition can
- /// change after its route is written, every call re-checks it: an
- /// operation no longer classified `read`, or a tool whose `approval` is no
- /// longer null or `auto`, answers 403 `route_tool_not_readable`; a tool
- /// deleted, moved to another project, no longer of kind `openapi` or
- /// without the operation answers 409 `route_tool_unavailable`, which no
+ /// `tool` (tool_id of an `openapi` or `mcp` tool definition and the
+ /// `operation` on it, an openapi operation's id or one of the MCP
+ /// server's tools by name: the POST body is the arguments, held to their
+ /// schema, and the connector's answer after the tool's response mapping
+ /// is the response. An openapi vendor's JSON comes back as it came, or
+ /// `{"text": ...}` when it answered text; an MCP tool answers its
+ /// structured content, its text when that text is JSON, `{"text": ...}`
+ /// for plain text, or `{"content": [...]}` with every block as the server
+ /// sent it when one is not text. For an `mcp` tool the route write lists
+ /// the server's tools and pins the chosen tool's input schema on the
+ /// route as `input_schema`, so the MCP face and every call use the pin
+ /// and an upstream change reaches no consumer until the route is written
+ /// again. An operation whose effective class is `read`, on a tool whose
+ /// `approval` is null or `auto`, may be served on any API but a public
+ /// one. An operation that is not a read is served only on a route with
+ /// `allow_write: true`, on an API whose `auth_mode` names a person
+ /// (`owner`, `workspace` or `user_token`), and still only with an
+ /// `approval` of null or `auto`: a write through a route acts for the
+ /// member or end user calling, who is sent to the connector as
+ /// `Speechify-User-Identity`, a service account is refused, every write
+ /// counts against `daily_write_cap` (429 `route_write_limit_reached`) and
+ /// claims the caller's `Idempotency-Key` so a retry replays the first
+ /// answer. A route write that breaks any of this is refused with 400
+ /// `validation_failed` on `resolver.tool_id`, `resolver.operation` or
+ /// `resolver.allow_write`, as is an MCP server that cannot be listed.
+ /// Because a definition can change after its route is written, every call
+ /// re-checks it: an operation no longer classified `read` on a route not
+ /// switched to writes, or a tool whose `approval` is no longer null or
+ /// `auto`, answers 403 `route_tool_not_readable`; a tool
+ /// deleted, moved to another project, or without the operation (an MCP
+ /// server that no longer lists the tool) answers 409
+ /// `route_tool_unavailable`, which no
/// retry clears until the route or the tool is fixed. Arguments that do
/// not fit the schema answer 400 `validation_failed`; the definition's
/// `max_requests_per_minute` and the vendor's own throttle both answer 429
/// `route_upstream_rate_limited` with `Retry-After`; a vendor error
/// answers 502 `route_upstream_error` with the vendor's status in
- /// `error.details.upstream_status`, and an unreachable vendor or a
- /// credential that no longer resolves answers 502 `route_upstream_error`
- /// without it). + /// `error.details.upstream_status`, an MCP tool that reports an error
+ /// answers it with the tool's own message in `error.details.tool_error`,
+ /// and an unreachable vendor or a credential that no longer resolves
+ /// answers 502 `route_upstream_error` without either). /// /// /// diff --git a/src/libs/Speechify/Generated/Speechify.IRoutesClient.MountRoutes.g.cs b/src/libs/Speechify/Generated/Speechify.IRoutesClient.MountRoutes.g.cs new file mode 100644 index 00000000..7eb50e19 --- /dev/null +++ b/src/libs/Speechify/Generated/Speechify.IRoutesClient.MountRoutes.g.cs @@ -0,0 +1,189 @@ +#nullable enable + +namespace Speechify +{ + public partial interface IRoutesClient + { + /// + /// Mount a Connector
+ /// Publish a connector's operations onto the API in one call: one `tool`
+ /// route per operation of an `openapi` tool definition, or per tool its
+ /// `mcp` server lists, named `<name_prefix>__<operation>` at
+ /// `<path_prefix>/<operation>`, so two connectors' tools stay apart on
+ /// the MCP face and inside its 64-character tool names.
+ /// Send `dry_run: true` first. The answer lists every operation with
+ /// its effective `action_class` and `approval`, whether a route can serve
+ /// it, and the `action` a mount takes: `create`, `update` (an MCP tool
+ /// whose input schema changed since its route was written; `changes`
+ /// names what), `unchanged`, `skip` (with the `reason`: not selected, not
+ /// a read, not auto-approved, a name or path already taken, or the route
+ /// cap) or `stale` (a route whose operation the connector no longer
+ /// offers, or can no longer serve; it is reported and never deleted,
+ /// since a consumer may still call it). The same call without `dry_run`
+ /// writes every create and update in one transaction and returns the
+ /// written `route` on each.
+ /// Mounting again is the refresh. Every route the API holds for the
+ /// connector is compared with what it offers now, whatever its name,
+ /// path or the selection, so an upstream change is seen as a diff before
+ /// anyone's client sees it. `operations` selects what to create; omit it
+ /// to create a route for every operation a route can serve. A route an
+ /// owner renamed or moved keeps its name and path on refresh.
+ /// The route write's rules apply to every operation: the connector must
+ /// be in the API's project (409 `cross_project_reference`), an MCP server
+ /// must be reachable with its credential to be listed (400
+ /// `validation_failed` on `tool_id` with the server's reason), and a
+ /// public API mounts nothing. An API holds at most 200 routes; a mount
+ /// that would pass the cap skips what does not fit. A route changed while
+ /// the mount was being planned answers 409 `api_route_conflict`; mount
+ /// again.
+ /// Dark launch: requires the `hosted_apis_access` entitlement (402 `hosted_apis_not_in_plan` otherwise). + ///
+ /// + /// + /// + /// Optional idempotency key. When omitted, the SDK generates one for this request. + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task MountRoutesAsync( + string apiId, + + global::Speechify.MountHostedAPIRoutesRequest request, + string? speechifyVersion = default, + string? idempotencyKey = default, + global::Speechify.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Mount a Connector
+ /// Publish a connector's operations onto the API in one call: one `tool`
+ /// route per operation of an `openapi` tool definition, or per tool its
+ /// `mcp` server lists, named `<name_prefix>__<operation>` at
+ /// `<path_prefix>/<operation>`, so two connectors' tools stay apart on
+ /// the MCP face and inside its 64-character tool names.
+ /// Send `dry_run: true` first. The answer lists every operation with
+ /// its effective `action_class` and `approval`, whether a route can serve
+ /// it, and the `action` a mount takes: `create`, `update` (an MCP tool
+ /// whose input schema changed since its route was written; `changes`
+ /// names what), `unchanged`, `skip` (with the `reason`: not selected, not
+ /// a read, not auto-approved, a name or path already taken, or the route
+ /// cap) or `stale` (a route whose operation the connector no longer
+ /// offers, or can no longer serve; it is reported and never deleted,
+ /// since a consumer may still call it). The same call without `dry_run`
+ /// writes every create and update in one transaction and returns the
+ /// written `route` on each.
+ /// Mounting again is the refresh. Every route the API holds for the
+ /// connector is compared with what it offers now, whatever its name,
+ /// path or the selection, so an upstream change is seen as a diff before
+ /// anyone's client sees it. `operations` selects what to create; omit it
+ /// to create a route for every operation a route can serve. A route an
+ /// owner renamed or moved keeps its name and path on refresh.
+ /// The route write's rules apply to every operation: the connector must
+ /// be in the API's project (409 `cross_project_reference`), an MCP server
+ /// must be reachable with its credential to be listed (400
+ /// `validation_failed` on `tool_id` with the server's reason), and a
+ /// public API mounts nothing. An API holds at most 200 routes; a mount
+ /// that would pass the cap skips what does not fit. A route changed while
+ /// the mount was being planned answers 409 `api_route_conflict`; mount
+ /// again.
+ /// Dark launch: requires the `hosted_apis_access` entitlement (402 `hosted_apis_not_in_plan` otherwise). + ///
+ /// + /// + /// + /// Optional idempotency key. When omitted, the SDK generates one for this request. + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> MountRoutesAsResponseAsync( + string apiId, + + global::Speechify.MountHostedAPIRoutesRequest request, + string? speechifyVersion = default, + string? idempotencyKey = default, + global::Speechify.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Mount a Connector
+ /// Publish a connector's operations onto the API in one call: one `tool`
+ /// route per operation of an `openapi` tool definition, or per tool its
+ /// `mcp` server lists, named `<name_prefix>__<operation>` at
+ /// `<path_prefix>/<operation>`, so two connectors' tools stay apart on
+ /// the MCP face and inside its 64-character tool names.
+ /// Send `dry_run: true` first. The answer lists every operation with
+ /// its effective `action_class` and `approval`, whether a route can serve
+ /// it, and the `action` a mount takes: `create`, `update` (an MCP tool
+ /// whose input schema changed since its route was written; `changes`
+ /// names what), `unchanged`, `skip` (with the `reason`: not selected, not
+ /// a read, not auto-approved, a name or path already taken, or the route
+ /// cap) or `stale` (a route whose operation the connector no longer
+ /// offers, or can no longer serve; it is reported and never deleted,
+ /// since a consumer may still call it). The same call without `dry_run`
+ /// writes every create and update in one transaction and returns the
+ /// written `route` on each.
+ /// Mounting again is the refresh. Every route the API holds for the
+ /// connector is compared with what it offers now, whatever its name,
+ /// path or the selection, so an upstream change is seen as a diff before
+ /// anyone's client sees it. `operations` selects what to create; omit it
+ /// to create a route for every operation a route can serve. A route an
+ /// owner renamed or moved keeps its name and path on refresh.
+ /// The route write's rules apply to every operation: the connector must
+ /// be in the API's project (409 `cross_project_reference`), an MCP server
+ /// must be reachable with its credential to be listed (400
+ /// `validation_failed` on `tool_id` with the server's reason), and a
+ /// public API mounts nothing. An API holds at most 200 routes; a mount
+ /// that would pass the cap skips what does not fit. A route changed while
+ /// the mount was being planned answers 409 `api_route_conflict`; mount
+ /// again.
+ /// Dark launch: requires the `hosted_apis_access` entitlement (402 `hosted_apis_not_in_plan` otherwise). + ///
+ /// + /// + /// + /// Optional idempotency key. When omitted, the SDK generates one for this request. + /// + /// + /// The `openapi` or `mcp` tool definition to mount, in the API's project. + /// + /// + /// The operations to create routes for: openapi operation ids or the
+ /// MCP server's tool names. Omit to create a route for every operation
+ /// a route can serve. Naming one the connector does not offer is 400
+ /// `validation_failed` on `operations[i]`. Existing routes are compared
+ /// whatever the selection. + /// + /// + /// Prefix of each created route's name, `<name_prefix>__<operation>`. Defaults to the tool's name with other characters as `_`. + /// + /// + /// Path each created route sits under, `<path_prefix>/<operation>`; lowercase segments of letters, digits, `.`, `_` or `-`, with no `{param}` or `*`, and not under `/mcp`, `/openapi.json` or `/_runs`. Defaults to `/<name_prefix>` in lowercase. + /// + /// + /// Answer what the mount would do and write nothing. + /// + /// + /// Create routes for operations that are not reads too, each with
+ /// `allow_write: true`. Only an API whose `auth_mode` names a person
+ /// takes them; the operation's `approval` must still be `auto`.
+ /// Without it a write is a `skip` that says so. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task MountRoutesAsync( + string apiId, + string toolId, + string? speechifyVersion = default, + string? idempotencyKey = default, + global::System.Collections.Generic.IList? operations = default, + string? namePrefix = default, + string? pathPrefix = default, + bool? dryRun = default, + bool? includeWrites = default, + global::Speechify.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/Speechify/Generated/Speechify.IRoutesClient.UpdateRoute.g.cs b/src/libs/Speechify/Generated/Speechify.IRoutesClient.UpdateRoute.g.cs index e0d3205d..5071e78a 100644 --- a/src/libs/Speechify/Generated/Speechify.IRoutesClient.UpdateRoute.g.cs +++ b/src/libs/Speechify/Generated/Speechify.IRoutesClient.UpdateRoute.g.cs @@ -86,27 +86,47 @@ public partial interface IRoutesClient /// `run` (trigger_id of a webhook trigger, wait_seconds),
/// `file` (file_path of one published file; or, on a route whose path
/// ends in `*`, file_root and file_index for a whole published tree),
- /// `tool` (tool_id of an `openapi` tool definition and the `operation`
- /// on it: the POST body is the operation's arguments, held to its
- /// argument schema, and the vendor's answer after the operation's
- /// `response` mapping is the response, or `{"text": ...}` when the vendor
- /// answered text. Only an operation whose effective class is `read`, on a
- /// tool whose `approval` is null or `auto`, may be served, and never on a
- /// public API; a route write that names anything else is refused with 400
- /// `validation_failed` on `resolver.tool_id`. Because a definition can
- /// change after its route is written, every call re-checks it: an
- /// operation no longer classified `read`, or a tool whose `approval` is no
- /// longer null or `auto`, answers 403 `route_tool_not_readable`; a tool
- /// deleted, moved to another project, no longer of kind `openapi` or
- /// without the operation answers 409 `route_tool_unavailable`, which no
+ /// `tool` (tool_id of an `openapi` or `mcp` tool definition and the
+ /// `operation` on it, an openapi operation's id or one of the MCP
+ /// server's tools by name: the POST body is the arguments, held to their
+ /// schema, and the connector's answer after the tool's response mapping
+ /// is the response. An openapi vendor's JSON comes back as it came, or
+ /// `{"text": ...}` when it answered text; an MCP tool answers its
+ /// structured content, its text when that text is JSON, `{"text": ...}`
+ /// for plain text, or `{"content": [...]}` with every block as the server
+ /// sent it when one is not text. For an `mcp` tool the route write lists
+ /// the server's tools and pins the chosen tool's input schema on the
+ /// route as `input_schema`, so the MCP face and every call use the pin
+ /// and an upstream change reaches no consumer until the route is written
+ /// again. An operation whose effective class is `read`, on a tool whose
+ /// `approval` is null or `auto`, may be served on any API but a public
+ /// one. An operation that is not a read is served only on a route with
+ /// `allow_write: true`, on an API whose `auth_mode` names a person
+ /// (`owner`, `workspace` or `user_token`), and still only with an
+ /// `approval` of null or `auto`: a write through a route acts for the
+ /// member or end user calling, who is sent to the connector as
+ /// `Speechify-User-Identity`, a service account is refused, every write
+ /// counts against `daily_write_cap` (429 `route_write_limit_reached`) and
+ /// claims the caller's `Idempotency-Key` so a retry replays the first
+ /// answer. A route write that breaks any of this is refused with 400
+ /// `validation_failed` on `resolver.tool_id`, `resolver.operation` or
+ /// `resolver.allow_write`, as is an MCP server that cannot be listed.
+ /// Because a definition can change after its route is written, every call
+ /// re-checks it: an operation no longer classified `read` on a route not
+ /// switched to writes, or a tool whose `approval` is no longer null or
+ /// `auto`, answers 403 `route_tool_not_readable`; a tool
+ /// deleted, moved to another project, or without the operation (an MCP
+ /// server that no longer lists the tool) answers 409
+ /// `route_tool_unavailable`, which no
/// retry clears until the route or the tool is fixed. Arguments that do
/// not fit the schema answer 400 `validation_failed`; the definition's
/// `max_requests_per_minute` and the vendor's own throttle both answer 429
/// `route_upstream_rate_limited` with `Retry-After`; a vendor error
/// answers 502 `route_upstream_error` with the vendor's status in
- /// `error.details.upstream_status`, and an unreachable vendor or a
- /// credential that no longer resolves answers 502 `route_upstream_error`
- /// without it). + /// `error.details.upstream_status`, an MCP tool that reports an error
+ /// answers it with the tool's own message in `error.details.tool_error`,
+ /// and an unreachable vendor or a credential that no longer resolves
+ /// answers 502 `route_upstream_error` without either). /// /// /// diff --git a/src/libs/Speechify/Generated/Speechify.JsonConverters.AgentToolConfig.g.cs b/src/libs/Speechify/Generated/Speechify.JsonConverters.AgentToolConfig.g.cs index fc79dfb9..434d3b08 100644 --- a/src/libs/Speechify/Generated/Speechify.JsonConverters.AgentToolConfig.g.cs +++ b/src/libs/Speechify/Generated/Speechify.JsonConverters.AgentToolConfig.g.cs @@ -67,6 +67,7 @@ public class AgentToolConfigJsonConverter : global::System.Text.Json.Serializati if (__jsonProps.Contains("long_running.filler_message")) __score3++; if (__jsonProps.Contains("long_running.on_duplicate")) __score3++; if (__jsonProps.Contains("long_running.wait_audio")) __score3++; + if (__jsonProps.Contains("max_requests_per_minute")) __score3++; if (__jsonProps.Contains("response_mappings")) __score3++; if (__jsonProps.Contains("timeout_ms")) __score3++; if (__jsonProps.Contains("transport")) __score3++; diff --git a/src/libs/Speechify/Generated/Speechify.JsonConverters.CreateAgentToolRequestConfig.g.cs b/src/libs/Speechify/Generated/Speechify.JsonConverters.CreateAgentToolRequestConfig.g.cs index 9aaa16fa..0e96228a 100644 --- a/src/libs/Speechify/Generated/Speechify.JsonConverters.CreateAgentToolRequestConfig.g.cs +++ b/src/libs/Speechify/Generated/Speechify.JsonConverters.CreateAgentToolRequestConfig.g.cs @@ -67,6 +67,7 @@ public class CreateAgentToolRequestConfigJsonConverter : global::System.Text.Jso if (__jsonProps.Contains("long_running.filler_message")) __score3++; if (__jsonProps.Contains("long_running.on_duplicate")) __score3++; if (__jsonProps.Contains("long_running.wait_audio")) __score3++; + if (__jsonProps.Contains("max_requests_per_minute")) __score3++; if (__jsonProps.Contains("response_mappings")) __score3++; if (__jsonProps.Contains("timeout_ms")) __score3++; if (__jsonProps.Contains("transport")) __score3++; diff --git a/src/libs/Speechify/Generated/Speechify.JsonConverters.CreateToolRequestConfig.g.cs b/src/libs/Speechify/Generated/Speechify.JsonConverters.CreateToolRequestConfig.g.cs index cda5f44c..ad7820d9 100644 --- a/src/libs/Speechify/Generated/Speechify.JsonConverters.CreateToolRequestConfig.g.cs +++ b/src/libs/Speechify/Generated/Speechify.JsonConverters.CreateToolRequestConfig.g.cs @@ -63,6 +63,7 @@ public class CreateToolRequestConfigJsonConverter : global::System.Text.Json.Ser if (__jsonProps.Contains("long_running.filler_message")) __score2++; if (__jsonProps.Contains("long_running.on_duplicate")) __score2++; if (__jsonProps.Contains("long_running.wait_audio")) __score2++; + if (__jsonProps.Contains("max_requests_per_minute")) __score2++; if (__jsonProps.Contains("response_mappings")) __score2++; if (__jsonProps.Contains("timeout_ms")) __score2++; if (__jsonProps.Contains("transport")) __score2++; diff --git a/src/libs/Speechify/Generated/Speechify.JsonConverters.HostedApiMountOperationAction.g.cs b/src/libs/Speechify/Generated/Speechify.JsonConverters.HostedApiMountOperationAction.g.cs new file mode 100644 index 00000000..3564a425 --- /dev/null +++ b/src/libs/Speechify/Generated/Speechify.JsonConverters.HostedApiMountOperationAction.g.cs @@ -0,0 +1,53 @@ +#nullable enable + +namespace Speechify.JsonConverters +{ + /// + public sealed class HostedApiMountOperationActionJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Speechify.HostedApiMountOperationAction Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Speechify.HostedApiMountOperationActionExtensions.ToEnum(stringValue) ?? default; + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Speechify.HostedApiMountOperationAction)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Speechify.HostedApiMountOperationAction); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Speechify.HostedApiMountOperationAction value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + writer.WriteStringValue(global::Speechify.HostedApiMountOperationActionExtensions.ToValueString(value)); + } + } +} diff --git a/src/libs/Speechify/Generated/Speechify.JsonConverters.HostedApiMountOperationActionNullable.g.cs b/src/libs/Speechify/Generated/Speechify.JsonConverters.HostedApiMountOperationActionNullable.g.cs new file mode 100644 index 00000000..a767cba1 --- /dev/null +++ b/src/libs/Speechify/Generated/Speechify.JsonConverters.HostedApiMountOperationActionNullable.g.cs @@ -0,0 +1,60 @@ +#nullable enable + +namespace Speechify.JsonConverters +{ + /// + public sealed class HostedApiMountOperationActionNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Speechify.HostedApiMountOperationAction? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Speechify.HostedApiMountOperationActionExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Speechify.HostedApiMountOperationAction)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Speechify.HostedApiMountOperationAction?); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Speechify.HostedApiMountOperationAction? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::Speechify.HostedApiMountOperationActionExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/libs/Speechify/Generated/Speechify.JsonConverters.HostedApiMountOperationChangesItems.g.cs b/src/libs/Speechify/Generated/Speechify.JsonConverters.HostedApiMountOperationChangesItems.g.cs new file mode 100644 index 00000000..38e59a69 --- /dev/null +++ b/src/libs/Speechify/Generated/Speechify.JsonConverters.HostedApiMountOperationChangesItems.g.cs @@ -0,0 +1,53 @@ +#nullable enable + +namespace Speechify.JsonConverters +{ + /// + public sealed class HostedApiMountOperationChangesItemsJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Speechify.HostedApiMountOperationChangesItems Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Speechify.HostedApiMountOperationChangesItemsExtensions.ToEnum(stringValue) ?? default; + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Speechify.HostedApiMountOperationChangesItems)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Speechify.HostedApiMountOperationChangesItems); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Speechify.HostedApiMountOperationChangesItems value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + writer.WriteStringValue(global::Speechify.HostedApiMountOperationChangesItemsExtensions.ToValueString(value)); + } + } +} diff --git a/src/libs/Speechify/Generated/Speechify.JsonConverters.HostedApiMountOperationChangesItemsNullable.g.cs b/src/libs/Speechify/Generated/Speechify.JsonConverters.HostedApiMountOperationChangesItemsNullable.g.cs new file mode 100644 index 00000000..be755049 --- /dev/null +++ b/src/libs/Speechify/Generated/Speechify.JsonConverters.HostedApiMountOperationChangesItemsNullable.g.cs @@ -0,0 +1,60 @@ +#nullable enable + +namespace Speechify.JsonConverters +{ + /// + public sealed class HostedApiMountOperationChangesItemsNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Speechify.HostedApiMountOperationChangesItems? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Speechify.HostedApiMountOperationChangesItemsExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Speechify.HostedApiMountOperationChangesItems)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Speechify.HostedApiMountOperationChangesItems?); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Speechify.HostedApiMountOperationChangesItems? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::Speechify.HostedApiMountOperationChangesItemsExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/libs/Speechify/Generated/Speechify.JsonConverters.HostedApiMountToolKind.g.cs b/src/libs/Speechify/Generated/Speechify.JsonConverters.HostedApiMountToolKind.g.cs new file mode 100644 index 00000000..b26b8962 --- /dev/null +++ b/src/libs/Speechify/Generated/Speechify.JsonConverters.HostedApiMountToolKind.g.cs @@ -0,0 +1,53 @@ +#nullable enable + +namespace Speechify.JsonConverters +{ + /// + public sealed class HostedApiMountToolKindJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Speechify.HostedApiMountToolKind Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Speechify.HostedApiMountToolKindExtensions.ToEnum(stringValue) ?? default; + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Speechify.HostedApiMountToolKind)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Speechify.HostedApiMountToolKind); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Speechify.HostedApiMountToolKind value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + writer.WriteStringValue(global::Speechify.HostedApiMountToolKindExtensions.ToValueString(value)); + } + } +} diff --git a/src/libs/Speechify/Generated/Speechify.JsonConverters.HostedApiMountToolKindNullable.g.cs b/src/libs/Speechify/Generated/Speechify.JsonConverters.HostedApiMountToolKindNullable.g.cs new file mode 100644 index 00000000..5e7a6161 --- /dev/null +++ b/src/libs/Speechify/Generated/Speechify.JsonConverters.HostedApiMountToolKindNullable.g.cs @@ -0,0 +1,60 @@ +#nullable enable + +namespace Speechify.JsonConverters +{ + /// + public sealed class HostedApiMountToolKindNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Speechify.HostedApiMountToolKind? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Speechify.HostedApiMountToolKindExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Speechify.HostedApiMountToolKind)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Speechify.HostedApiMountToolKind?); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Speechify.HostedApiMountToolKind? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::Speechify.HostedApiMountToolKindExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/libs/Speechify/Generated/Speechify.JsonConverters.ToolConfig.g.cs b/src/libs/Speechify/Generated/Speechify.JsonConverters.ToolConfig.g.cs index c84455b2..980076d3 100644 --- a/src/libs/Speechify/Generated/Speechify.JsonConverters.ToolConfig.g.cs +++ b/src/libs/Speechify/Generated/Speechify.JsonConverters.ToolConfig.g.cs @@ -63,6 +63,7 @@ public class ToolConfigJsonConverter : global::System.Text.Json.Serialization.Js if (__jsonProps.Contains("long_running.filler_message")) __score2++; if (__jsonProps.Contains("long_running.on_duplicate")) __score2++; if (__jsonProps.Contains("long_running.wait_audio")) __score2++; + if (__jsonProps.Contains("max_requests_per_minute")) __score2++; if (__jsonProps.Contains("response_mappings")) __score2++; if (__jsonProps.Contains("timeout_ms")) __score2++; if (__jsonProps.Contains("transport")) __score2++; diff --git a/src/libs/Speechify/Generated/Speechify.JsonConverters.UpdateToolRequestConfig.g.cs b/src/libs/Speechify/Generated/Speechify.JsonConverters.UpdateToolRequestConfig.g.cs index 4208ec3f..5df68503 100644 --- a/src/libs/Speechify/Generated/Speechify.JsonConverters.UpdateToolRequestConfig.g.cs +++ b/src/libs/Speechify/Generated/Speechify.JsonConverters.UpdateToolRequestConfig.g.cs @@ -63,6 +63,7 @@ public class UpdateToolRequestConfigJsonConverter : global::System.Text.Json.Ser if (__jsonProps.Contains("long_running.filler_message")) __score2++; if (__jsonProps.Contains("long_running.on_duplicate")) __score2++; if (__jsonProps.Contains("long_running.wait_audio")) __score2++; + if (__jsonProps.Contains("max_requests_per_minute")) __score2++; if (__jsonProps.Contains("response_mappings")) __score2++; if (__jsonProps.Contains("timeout_ms")) __score2++; if (__jsonProps.Contains("transport")) __score2++; diff --git a/src/libs/Speechify/Generated/Speechify.JsonSerializerContext.g.cs b/src/libs/Speechify/Generated/Speechify.JsonSerializerContext.g.cs index 0bea24e0..d8145b1d 100644 --- a/src/libs/Speechify/Generated/Speechify.JsonSerializerContext.g.cs +++ b/src/libs/Speechify/Generated/Speechify.JsonSerializerContext.g.cs @@ -739,6 +739,15 @@ internal sealed partial class SourceGenerationContextChunk0 : global::System.Tex [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Speechify.CreateHostedApiRouteRequestMethod), TypeInfoPropertyName = "CreateHostedApiRouteRequestMethod2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Speechify.CreateHostedAPIRouteRequest))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Speechify.MountHostedAPIRoutesRequest))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Speechify.HostedApiMountToolKind), TypeInfoPropertyName = "HostedApiMountToolKind2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Speechify.HostedApiMountOperationAction), TypeInfoPropertyName = "HostedApiMountOperationAction2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Speechify.HostedApiMountOperationChangesItems), TypeInfoPropertyName = "HostedApiMountOperationChangesItems2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Speechify.HostedAPIMountOperation))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Speechify.HostedAPIMountSummary))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Speechify.HostedAPIMount))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Speechify.UpdateHostedApiRouteRequestMethod), TypeInfoPropertyName = "UpdateHostedApiRouteRequestMethod2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Speechify.UpdateHostedAPIRouteRequest))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Speechify.HostedAPIKey))] @@ -984,6 +993,9 @@ internal sealed partial class SourceGenerationContextChunk0 : global::System.Tex [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Speechify.HostedApiResolverWhereItemsOp?), TypeInfoPropertyName = "NullableHostedApiResolverWhereItemsOp2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Speechify.HostedApiResolverOrderByDirection?), TypeInfoPropertyName = "NullableHostedApiResolverOrderByDirection2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Speechify.CreateHostedApiRouteRequestMethod?), TypeInfoPropertyName = "NullableCreateHostedApiRouteRequestMethod2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Speechify.HostedApiMountToolKind?), TypeInfoPropertyName = "NullableHostedApiMountToolKind2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Speechify.HostedApiMountOperationAction?), TypeInfoPropertyName = "NullableHostedApiMountOperationAction2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Speechify.HostedApiMountOperationChangesItems?), TypeInfoPropertyName = "NullableHostedApiMountOperationChangesItems2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Speechify.UpdateHostedApiRouteRequestMethod?), TypeInfoPropertyName = "NullableUpdateHostedApiRouteRequestMethod2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Speechify.ContactIdentifierKind?), TypeInfoPropertyName = "NullableContactIdentifierKind2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Speechify.ContactIdentifierAssertedBy?), TypeInfoPropertyName = "NullableContactIdentifierAssertedBy2")] @@ -1014,18 +1026,6 @@ internal sealed partial class SourceGenerationContextChunk0 : global::System.Tex [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] internal sealed partial class SourceGenerationContextChunk1 : global::System.Text.Json.Serialization.JsonSerializerContext { } @@ -1038,6 +1038,18 @@ internal sealed partial class SourceGenerationContextChunk1 : global::System.Tex Converters = new global::System.Type[] { })] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] @@ -1129,6 +1141,8 @@ internal sealed partial class SourceGenerationContextChunk1 : global::System.Tex [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] @@ -1798,6 +1812,18 @@ public override bool CanConvert(global::System.Type typeToConvert) || typeToConvert == typeof(global::Speechify.CreateHostedApiRouteRequestMethod?) + || typeToConvert == typeof(global::Speechify.HostedApiMountToolKind) + + || typeToConvert == typeof(global::Speechify.HostedApiMountToolKind?) + + || typeToConvert == typeof(global::Speechify.HostedApiMountOperationAction) + + || typeToConvert == typeof(global::Speechify.HostedApiMountOperationAction?) + + || typeToConvert == typeof(global::Speechify.HostedApiMountOperationChangesItems) + + || typeToConvert == typeof(global::Speechify.HostedApiMountOperationChangesItems?) + || typeToConvert == typeof(global::Speechify.UpdateHostedApiRouteRequestMethod) || typeToConvert == typeof(global::Speechify.UpdateHostedApiRouteRequestMethod?) @@ -3321,6 +3347,36 @@ public override bool CanConvert(global::System.Type typeToConvert) return new global::Speechify.JsonConverters.CreateHostedApiRouteRequestMethodNullableJsonConverter(); } + if (typeToConvert == typeof(global::Speechify.HostedApiMountToolKind)) + { + return new global::Speechify.JsonConverters.HostedApiMountToolKindJsonConverter(); + } + + if (typeToConvert == typeof(global::Speechify.HostedApiMountToolKind?)) + { + return new global::Speechify.JsonConverters.HostedApiMountToolKindNullableJsonConverter(); + } + + if (typeToConvert == typeof(global::Speechify.HostedApiMountOperationAction)) + { + return new global::Speechify.JsonConverters.HostedApiMountOperationActionJsonConverter(); + } + + if (typeToConvert == typeof(global::Speechify.HostedApiMountOperationAction?)) + { + return new global::Speechify.JsonConverters.HostedApiMountOperationActionNullableJsonConverter(); + } + + if (typeToConvert == typeof(global::Speechify.HostedApiMountOperationChangesItems)) + { + return new global::Speechify.JsonConverters.HostedApiMountOperationChangesItemsJsonConverter(); + } + + if (typeToConvert == typeof(global::Speechify.HostedApiMountOperationChangesItems?)) + { + return new global::Speechify.JsonConverters.HostedApiMountOperationChangesItemsNullableJsonConverter(); + } + if (typeToConvert == typeof(global::Speechify.UpdateHostedApiRouteRequestMethod)) { return new global::Speechify.JsonConverters.UpdateHostedApiRouteRequestMethodJsonConverter(); diff --git a/src/libs/Speechify/Generated/Speechify.JsonSerializerContextTypes.g.cs b/src/libs/Speechify/Generated/Speechify.JsonSerializerContextTypes.g.cs index 21edb256..916be4bd 100644 --- a/src/libs/Speechify/Generated/Speechify.JsonSerializerContextTypes.g.cs +++ b/src/libs/Speechify/Generated/Speechify.JsonSerializerContextTypes.g.cs @@ -2873,323 +2873,359 @@ public sealed partial class JsonSerializerContextTypes /// /// /// - public global::Speechify.UpdateHostedApiRouteRequestMethod? Type710 { get; set; } + public global::Speechify.MountHostedAPIRoutesRequest? Type710 { get; set; } /// /// /// - public global::Speechify.UpdateHostedAPIRouteRequest? Type711 { get; set; } + public global::Speechify.HostedApiMountToolKind? Type711 { get; set; } /// /// /// - public global::Speechify.HostedAPIKey? Type712 { get; set; } + public global::Speechify.HostedApiMountOperationAction? Type712 { get; set; } /// /// /// - public global::Speechify.ListHostedAPIKeysResponse? Type713 { get; set; } + public global::Speechify.HostedApiMountOperationChangesItems? Type713 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type714 { get; set; } + public global::Speechify.HostedAPIMountOperation? Type714 { get; set; } /// /// /// - public global::Speechify.CreateHostedAPIKeyRequest? Type715 { get; set; } + public global::System.Collections.Generic.IList? Type715 { get; set; } /// /// /// - public global::Speechify.HostedAPIUserTokenSecret? Type716 { get; set; } + public global::Speechify.HostedAPIMountSummary? Type716 { get; set; } /// /// /// - public global::Speechify.ContactIdentifierKind? Type717 { get; set; } + public global::Speechify.HostedAPIMount? Type717 { get; set; } /// /// /// - public global::Speechify.ContactIdentifierAssertedBy? Type718 { get; set; } + public global::System.Collections.Generic.IList? Type718 { get; set; } /// /// /// - public global::Speechify.ContactIdentifier? Type719 { get; set; } + public global::Speechify.UpdateHostedApiRouteRequestMethod? Type719 { get; set; } /// /// /// - public global::Speechify.Contact? Type720 { get; set; } + public global::Speechify.UpdateHostedAPIRouteRequest? Type720 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type721 { get; set; } + public global::Speechify.HostedAPIKey? Type721 { get; set; } /// /// /// - public global::Speechify.ListContactsResponse? Type722 { get; set; } + public global::Speechify.ListHostedAPIKeysResponse? Type722 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type723 { get; set; } + public global::System.Collections.Generic.IList? Type723 { get; set; } /// /// /// - public global::Speechify.UpdateContactRequest? Type724 { get; set; } + public global::Speechify.CreateHostedAPIKeyRequest? Type724 { get; set; } /// /// /// - public global::Speechify.DeleteContactResponse? Type725 { get; set; } + public global::Speechify.HostedAPIUserTokenSecret? Type725 { get; set; } /// /// /// - public global::Speechify.AttachContactIdentifierRequestKind? Type726 { get; set; } + public global::Speechify.ContactIdentifierKind? Type726 { get; set; } /// /// /// - public global::Speechify.AttachContactIdentifierRequest? Type727 { get; set; } + public global::Speechify.ContactIdentifierAssertedBy? Type727 { get; set; } /// /// /// - public global::Speechify.MergeContactsRequest? Type728 { get; set; } + public global::Speechify.ContactIdentifier? Type728 { get; set; } /// /// /// - public global::Speechify.MergeContactsResponseMerged? Type729 { get; set; } + public global::Speechify.Contact? Type729 { get; set; } /// /// /// - public global::Speechify.MergeContactsResponse? Type730 { get; set; } + public global::System.Collections.Generic.IList? Type730 { get; set; } /// /// /// - public global::Speechify.BillingEntitlementsMaxLlmModelClass? Type731 { get; set; } + public global::Speechify.ListContactsResponse? Type731 { get; set; } /// /// /// - public global::Speechify.BillingEntitlements? Type732 { get; set; } + public global::System.Collections.Generic.IList? Type732 { get; set; } /// /// /// - public global::Speechify.EntitlementsResponse? Type733 { get; set; } + public global::Speechify.UpdateContactRequest? Type733 { get; set; } /// /// /// - public global::System.Collections.Generic.Dictionary? Type734 { get; set; } + public global::Speechify.DeleteContactResponse? Type734 { get; set; } /// /// /// - public global::Speechify.ContactResolver? Type735 { get; set; } + public global::Speechify.AttachContactIdentifierRequestKind? Type735 { get; set; } /// /// /// - public global::Speechify.PutContactResolverRequest? Type736 { get; set; } + public global::Speechify.AttachContactIdentifierRequest? Type736 { get; set; } /// /// /// - public global::Speechify.WebhookEndpoint? Type737 { get; set; } + public global::Speechify.MergeContactsRequest? Type737 { get; set; } /// /// /// - public global::Speechify.ListWebhookEndpointsResponse? Type738 { get; set; } + public global::Speechify.MergeContactsResponseMerged? Type738 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type739 { get; set; } + public global::Speechify.MergeContactsResponse? Type739 { get; set; } /// /// /// - public global::Speechify.CreateWebhookEndpointRequest? Type740 { get; set; } + public global::Speechify.BillingEntitlementsMaxLlmModelClass? Type740 { get; set; } /// /// /// - public global::Speechify.UpdateWebhookEndpointRequest? Type741 { get; set; } + public global::Speechify.BillingEntitlements? Type741 { get; set; } /// /// /// - public global::Speechify.WebhookEndpointDelivery? Type742 { get; set; } + public global::Speechify.EntitlementsResponse? Type742 { get; set; } /// /// /// - public global::Speechify.ListWebhookEndpointDeliveriesResponse? Type743 { get; set; } + public global::System.Collections.Generic.Dictionary? Type743 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type744 { get; set; } + public global::Speechify.ContactResolver? Type744 { get; set; } /// /// /// - public global::Speechify.ProjectMonthlyBudgetStatus? Type745 { get; set; } + public global::Speechify.PutContactResolverRequest? Type745 { get; set; } /// /// /// - public global::Speechify.Project? Type746 { get; set; } + public global::Speechify.WebhookEndpoint? Type746 { get; set; } /// /// /// - public global::Speechify.ListProjectsResponse? Type747 { get; set; } + public global::Speechify.ListWebhookEndpointsResponse? Type747 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type748 { get; set; } + public global::System.Collections.Generic.IList? Type748 { get; set; } /// /// /// - public global::Speechify.CreateProjectRequest? Type749 { get; set; } + public global::Speechify.CreateWebhookEndpointRequest? Type749 { get; set; } /// /// /// - public global::Speechify.UpdateProjectRequest? Type750 { get; set; } + public global::Speechify.UpdateWebhookEndpointRequest? Type750 { get; set; } /// /// /// - public global::Speechify.DeleteProjectRequestMode? Type751 { get; set; } + public global::Speechify.WebhookEndpointDelivery? Type751 { get; set; } /// /// /// - public global::Speechify.DeleteProjectRequest? Type752 { get; set; } + public global::Speechify.ListWebhookEndpointDeliveriesResponse? Type752 { get; set; } /// /// /// - public global::Speechify.ProjectRestoredCounts? Type753 { get; set; } + public global::System.Collections.Generic.IList? Type753 { get; set; } /// /// /// - public global::Speechify.ProjectStillRevokedCounts? Type754 { get; set; } + public global::Speechify.ProjectMonthlyBudgetStatus? Type754 { get; set; } /// /// /// - public global::Speechify.ProjectRestore? Type755 { get; set; } + public global::Speechify.Project? Type755 { get; set; } /// /// /// - public global::Speechify.ProjectTeardownBlockerKind? Type756 { get; set; } + public global::Speechify.ListProjectsResponse? Type756 { get; set; } /// /// /// - public global::Speechify.ProjectTeardownBlockerBlocksItems? Type757 { get; set; } + public global::System.Collections.Generic.IList? Type757 { get; set; } /// /// /// - public global::Speechify.ProjectTeardownBlocker? Type758 { get; set; } + public global::Speechify.CreateProjectRequest? Type758 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type759 { get; set; } + public global::Speechify.UpdateProjectRequest? Type759 { get; set; } /// /// /// - public global::Speechify.ProjectTeardownGroup? Type760 { get; set; } + public global::Speechify.DeleteProjectRequestMode? Type760 { get; set; } /// /// /// - public global::Speechify.ProjectTeardown? Type761 { get; set; } + public global::Speechify.DeleteProjectRequest? Type761 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type762 { get; set; } + public global::Speechify.ProjectRestoredCounts? Type762 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type763 { get; set; } + public global::Speechify.ProjectStillRevokedCounts? Type763 { get; set; } /// /// /// - public global::Speechify.ProjectResourceCounts? Type764 { get; set; } + public global::Speechify.ProjectRestore? Type764 { get; set; } /// /// /// - public global::Speechify.ProjectStats? Type765 { get; set; } + public global::Speechify.ProjectTeardownBlockerKind? Type765 { get; set; } /// /// /// - public global::Speechify.PromoteProjectRequest? Type766 { get; set; } + public global::Speechify.ProjectTeardownBlockerBlocksItems? Type766 { get; set; } /// /// /// - public global::Speechify.PromoteCreated? Type767 { get; set; } + public global::Speechify.ProjectTeardownBlocker? Type767 { get; set; } /// /// /// - public global::Speechify.PromoteReused? Type768 { get; set; } + public global::System.Collections.Generic.IList? Type768 { get; set; } /// /// /// - public global::Speechify.PromoteAttentionKind? Type769 { get; set; } + public global::Speechify.ProjectTeardownGroup? Type769 { get; set; } /// /// /// - public global::Speechify.PromoteAttentionReason? Type770 { get; set; } + public global::Speechify.ProjectTeardown? Type770 { get; set; } /// /// /// - public global::Speechify.PromoteAttention? Type771 { get; set; } + public global::System.Collections.Generic.IList? Type771 { get; set; } /// /// /// - public global::Speechify.PromoteProjectResponse? Type772 { get; set; } + public global::System.Collections.Generic.IList? Type772 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type773 { get; set; } + public global::Speechify.ProjectResourceCounts? Type773 { get; set; } /// /// /// - public global::Speechify.ProjectAuditEventType? Type774 { get; set; } + public global::Speechify.ProjectStats? Type774 { get; set; } /// /// /// - public global::Speechify.ProjectAuditEvent? Type775 { get; set; } + public global::Speechify.PromoteProjectRequest? Type775 { get; set; } /// /// /// - public global::Speechify.ProjectAuditResponse? Type776 { get; set; } + public global::Speechify.PromoteCreated? Type776 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type777 { get; set; } + public global::Speechify.PromoteReused? Type777 { get; set; } /// /// /// - public global::Speechify.ProjectMember? Type778 { get; set; } + public global::Speechify.PromoteAttentionKind? Type778 { get; set; } /// /// /// - public global::Speechify.ProjectMembersResponse? Type779 { get; set; } + public global::Speechify.PromoteAttentionReason? Type779 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type780 { get; set; } + public global::Speechify.PromoteAttention? Type780 { get; set; } /// /// /// - public global::Speechify.GrantProjectMemberRequest? Type781 { get; set; } + public global::Speechify.PromoteProjectResponse? Type781 { get; set; } /// /// /// - public global::Speechify.CreateRequest? Type782 { get; set; } + public global::System.Collections.Generic.IList? Type782 { get; set; } /// /// /// - public global::Speechify.DetectRequest? Type783 { get; set; } + public global::Speechify.ProjectAuditEventType? Type783 { get; set; } /// /// /// - public global::Speechify.VerifyRequest? Type784 { get; set; } + public global::Speechify.ProjectAuditEvent? Type784 { get; set; } /// /// /// - public global::Speechify.UploadDocumentRequest? Type785 { get; set; } + public global::Speechify.ProjectAuditResponse? Type785 { get; set; } /// /// /// - public global::Speechify.UpdateDocumentRequest? Type786 { get; set; } + public global::System.Collections.Generic.IList? Type786 { get; set; } /// /// /// - public global::Speechify.RunTestRequest? Type787 { get; set; } + public global::Speechify.ProjectMember? Type787 { get; set; } /// /// /// - public global::Speechify.UploadRequest? Type788 { get; set; } + public global::Speechify.ProjectMembersResponse? Type788 { get; set; } /// /// /// - public global::Speechify.UploadRequest2? Type789 { get; set; } + public global::System.Collections.Generic.IList? Type789 { get; set; } + /// + /// + /// + public global::Speechify.GrantProjectMemberRequest? Type790 { get; set; } + /// + /// + /// + public global::Speechify.CreateRequest? Type791 { get; set; } + /// + /// + /// + public global::Speechify.DetectRequest? Type792 { get; set; } + /// + /// + /// + public global::Speechify.VerifyRequest? Type793 { get; set; } + /// + /// + /// + public global::Speechify.UploadDocumentRequest? Type794 { get; set; } + /// + /// + /// + public global::Speechify.UpdateDocumentRequest? Type795 { get; set; } + /// + /// + /// + public global::Speechify.RunTestRequest? Type796 { get; set; } + /// + /// + /// + public global::Speechify.UploadRequest? Type797 { get; set; } + /// + /// + /// + public global::Speechify.UploadRequest2? Type798 { get; set; } /// /// @@ -3682,50 +3718,58 @@ public sealed partial class JsonSerializerContextTypes /// /// /// - public global::System.Collections.Generic.List? ListType122 { get; set; } + public global::System.Collections.Generic.List? ListType122 { get; set; } + /// + /// + /// + public global::System.Collections.Generic.List? ListType123 { get; set; } + /// + /// + /// + public global::System.Collections.Generic.List? ListType124 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType123 { get; set; } + public global::System.Collections.Generic.List? ListType125 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType124 { get; set; } + public global::System.Collections.Generic.List? ListType126 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType125 { get; set; } + public global::System.Collections.Generic.List? ListType127 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType126 { get; set; } + public global::System.Collections.Generic.List? ListType128 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType127 { get; set; } + public global::System.Collections.Generic.List? ListType129 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType128 { get; set; } + public global::System.Collections.Generic.List? ListType130 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType129 { get; set; } + public global::System.Collections.Generic.List? ListType131 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType130 { get; set; } + public global::System.Collections.Generic.List? ListType132 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType131 { get; set; } + public global::System.Collections.Generic.List? ListType133 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType132 { get; set; } + public global::System.Collections.Generic.List? ListType134 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType133 { get; set; } + public global::System.Collections.Generic.List? ListType135 { get; set; } } } \ No newline at end of file diff --git a/src/libs/Speechify/Generated/Speechify.Models.CreateHostedAPIRouteRequest.g.cs b/src/libs/Speechify/Generated/Speechify.Models.CreateHostedAPIRouteRequest.g.cs index 6163e8e4..d6b8c157 100644 --- a/src/libs/Speechify/Generated/Speechify.Models.CreateHostedAPIRouteRequest.g.cs +++ b/src/libs/Speechify/Generated/Speechify.Models.CreateHostedAPIRouteRequest.g.cs @@ -61,27 +61,47 @@ public sealed partial class CreateHostedAPIRouteRequest /// `run` (trigger_id of a webhook trigger, wait_seconds),
/// `file` (file_path of one published file; or, on a route whose path
/// ends in `*`, file_root and file_index for a whole published tree),
- /// `tool` (tool_id of an `openapi` tool definition and the `operation`
- /// on it: the POST body is the operation's arguments, held to its
- /// argument schema, and the vendor's answer after the operation's
- /// `response` mapping is the response, or `{"text": ...}` when the vendor
- /// answered text. Only an operation whose effective class is `read`, on a
- /// tool whose `approval` is null or `auto`, may be served, and never on a
- /// public API; a route write that names anything else is refused with 400
- /// `validation_failed` on `resolver.tool_id`. Because a definition can
- /// change after its route is written, every call re-checks it: an
- /// operation no longer classified `read`, or a tool whose `approval` is no
- /// longer null or `auto`, answers 403 `route_tool_not_readable`; a tool
- /// deleted, moved to another project, no longer of kind `openapi` or
- /// without the operation answers 409 `route_tool_unavailable`, which no
+ /// `tool` (tool_id of an `openapi` or `mcp` tool definition and the
+ /// `operation` on it, an openapi operation's id or one of the MCP
+ /// server's tools by name: the POST body is the arguments, held to their
+ /// schema, and the connector's answer after the tool's response mapping
+ /// is the response. An openapi vendor's JSON comes back as it came, or
+ /// `{"text": ...}` when it answered text; an MCP tool answers its
+ /// structured content, its text when that text is JSON, `{"text": ...}`
+ /// for plain text, or `{"content": [...]}` with every block as the server
+ /// sent it when one is not text. For an `mcp` tool the route write lists
+ /// the server's tools and pins the chosen tool's input schema on the
+ /// route as `input_schema`, so the MCP face and every call use the pin
+ /// and an upstream change reaches no consumer until the route is written
+ /// again. An operation whose effective class is `read`, on a tool whose
+ /// `approval` is null or `auto`, may be served on any API but a public
+ /// one. An operation that is not a read is served only on a route with
+ /// `allow_write: true`, on an API whose `auth_mode` names a person
+ /// (`owner`, `workspace` or `user_token`), and still only with an
+ /// `approval` of null or `auto`: a write through a route acts for the
+ /// member or end user calling, who is sent to the connector as
+ /// `Speechify-User-Identity`, a service account is refused, every write
+ /// counts against `daily_write_cap` (429 `route_write_limit_reached`) and
+ /// claims the caller's `Idempotency-Key` so a retry replays the first
+ /// answer. A route write that breaks any of this is refused with 400
+ /// `validation_failed` on `resolver.tool_id`, `resolver.operation` or
+ /// `resolver.allow_write`, as is an MCP server that cannot be listed.
+ /// Because a definition can change after its route is written, every call
+ /// re-checks it: an operation no longer classified `read` on a route not
+ /// switched to writes, or a tool whose `approval` is no longer null or
+ /// `auto`, answers 403 `route_tool_not_readable`; a tool
+ /// deleted, moved to another project, or without the operation (an MCP
+ /// server that no longer lists the tool) answers 409
+ /// `route_tool_unavailable`, which no
/// retry clears until the route or the tool is fixed. Arguments that do
/// not fit the schema answer 400 `validation_failed`; the definition's
/// `max_requests_per_minute` and the vendor's own throttle both answer 429
/// `route_upstream_rate_limited` with `Retry-After`; a vendor error
/// answers 502 `route_upstream_error` with the vendor's status in
- /// `error.details.upstream_status`, and an unreachable vendor or a
- /// credential that no longer resolves answers 502 `route_upstream_error`
- /// without it). + /// `error.details.upstream_status`, an MCP tool that reports an error
+ /// answers it with the tool's own message in `error.details.tool_error`,
+ /// and an unreachable vendor or a credential that no longer resolves
+ /// answers 502 `route_upstream_error` without either). ///
[global::System.Text.Json.Serialization.JsonPropertyName("resolver")] [global::System.Text.Json.Serialization.JsonRequired] @@ -134,27 +154,47 @@ public sealed partial class CreateHostedAPIRouteRequest /// `run` (trigger_id of a webhook trigger, wait_seconds),
/// `file` (file_path of one published file; or, on a route whose path
/// ends in `*`, file_root and file_index for a whole published tree),
- /// `tool` (tool_id of an `openapi` tool definition and the `operation`
- /// on it: the POST body is the operation's arguments, held to its
- /// argument schema, and the vendor's answer after the operation's
- /// `response` mapping is the response, or `{"text": ...}` when the vendor
- /// answered text. Only an operation whose effective class is `read`, on a
- /// tool whose `approval` is null or `auto`, may be served, and never on a
- /// public API; a route write that names anything else is refused with 400
- /// `validation_failed` on `resolver.tool_id`. Because a definition can
- /// change after its route is written, every call re-checks it: an
- /// operation no longer classified `read`, or a tool whose `approval` is no
- /// longer null or `auto`, answers 403 `route_tool_not_readable`; a tool
- /// deleted, moved to another project, no longer of kind `openapi` or
- /// without the operation answers 409 `route_tool_unavailable`, which no
+ /// `tool` (tool_id of an `openapi` or `mcp` tool definition and the
+ /// `operation` on it, an openapi operation's id or one of the MCP
+ /// server's tools by name: the POST body is the arguments, held to their
+ /// schema, and the connector's answer after the tool's response mapping
+ /// is the response. An openapi vendor's JSON comes back as it came, or
+ /// `{"text": ...}` when it answered text; an MCP tool answers its
+ /// structured content, its text when that text is JSON, `{"text": ...}`
+ /// for plain text, or `{"content": [...]}` with every block as the server
+ /// sent it when one is not text. For an `mcp` tool the route write lists
+ /// the server's tools and pins the chosen tool's input schema on the
+ /// route as `input_schema`, so the MCP face and every call use the pin
+ /// and an upstream change reaches no consumer until the route is written
+ /// again. An operation whose effective class is `read`, on a tool whose
+ /// `approval` is null or `auto`, may be served on any API but a public
+ /// one. An operation that is not a read is served only on a route with
+ /// `allow_write: true`, on an API whose `auth_mode` names a person
+ /// (`owner`, `workspace` or `user_token`), and still only with an
+ /// `approval` of null or `auto`: a write through a route acts for the
+ /// member or end user calling, who is sent to the connector as
+ /// `Speechify-User-Identity`, a service account is refused, every write
+ /// counts against `daily_write_cap` (429 `route_write_limit_reached`) and
+ /// claims the caller's `Idempotency-Key` so a retry replays the first
+ /// answer. A route write that breaks any of this is refused with 400
+ /// `validation_failed` on `resolver.tool_id`, `resolver.operation` or
+ /// `resolver.allow_write`, as is an MCP server that cannot be listed.
+ /// Because a definition can change after its route is written, every call
+ /// re-checks it: an operation no longer classified `read` on a route not
+ /// switched to writes, or a tool whose `approval` is no longer null or
+ /// `auto`, answers 403 `route_tool_not_readable`; a tool
+ /// deleted, moved to another project, or without the operation (an MCP
+ /// server that no longer lists the tool) answers 409
+ /// `route_tool_unavailable`, which no
/// retry clears until the route or the tool is fixed. Arguments that do
/// not fit the schema answer 400 `validation_failed`; the definition's
/// `max_requests_per_minute` and the vendor's own throttle both answer 429
/// `route_upstream_rate_limited` with `Retry-After`; a vendor error
/// answers 502 `route_upstream_error` with the vendor's status in
- /// `error.details.upstream_status`, and an unreachable vendor or a
- /// credential that no longer resolves answers 502 `route_upstream_error`
- /// without it). + /// `error.details.upstream_status`, an MCP tool that reports an error
+ /// answers it with the tool's own message in `error.details.tool_error`,
+ /// and an unreachable vendor or a credential that no longer resolves
+ /// answers 502 `route_upstream_error` without either). /// /// /// The route's name, 1-128 letters, digits, spaces, `.`, `_` or `-`.
diff --git a/src/libs/Speechify/Generated/Speechify.Models.ErrorCode.g.cs b/src/libs/Speechify/Generated/Speechify.Models.ErrorCode.g.cs index 59a4ad6d..41485ee5 100644 --- a/src/libs/Speechify/Generated/Speechify.Models.ErrorCode.g.cs +++ b/src/libs/Speechify/Generated/Speechify.Models.ErrorCode.g.cs @@ -264,6 +264,10 @@ public enum ErrorCode /// /// /// + HostedApiBusy, + /// + /// + /// HostedApiNotFound, /// /// @@ -741,6 +745,7 @@ public static string ToValueString(this ErrorCode value) ErrorCode.FileStorageLimitReached => "file_storage_limit_reached", ErrorCode.Forbidden => "forbidden", ErrorCode.FundedBalanceRequired => "funded_balance_required", + ErrorCode.HostedApiBusy => "hosted_api_busy", ErrorCode.HostedApiNotFound => "hosted_api_not_found", ErrorCode.HostedApiPublicRefused => "hosted_api_public_refused", ErrorCode.HostedApiSlugTaken => "hosted_api_slug_taken", @@ -914,6 +919,7 @@ public static string ToValueString(this ErrorCode value) "file_storage_limit_reached" => ErrorCode.FileStorageLimitReached, "forbidden" => ErrorCode.Forbidden, "funded_balance_required" => ErrorCode.FundedBalanceRequired, + "hosted_api_busy" => ErrorCode.HostedApiBusy, "hosted_api_not_found" => ErrorCode.HostedApiNotFound, "hosted_api_public_refused" => ErrorCode.HostedApiPublicRefused, "hosted_api_slug_taken" => ErrorCode.HostedApiSlugTaken, diff --git a/src/libs/Speechify/Generated/Speechify.Models.HostedAPI.g.cs b/src/libs/Speechify/Generated/Speechify.Models.HostedAPI.g.cs index f37929c9..b949f7ba 100644 --- a/src/libs/Speechify/Generated/Speechify.Models.HostedAPI.g.cs +++ b/src/libs/Speechify/Generated/Speechify.Models.HostedAPI.g.cs @@ -137,6 +137,14 @@ public sealed partial class HostedAPI [global::System.Text.Json.Serialization.JsonPropertyName("mcp_enabled")] public bool? McpEnabled { get; set; } + /// + /// The address an MCP client attaches to, `<base_url>/mcp`, while
+ /// `mcp_enabled` is on; null while it is off. Read it here rather
+ /// than assembling it. + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("mcp_url")] + public string? McpUrl { get; set; } + /// /// /// @@ -252,6 +260,11 @@ public sealed partial class HostedAPI /// with 400 on either switch). Optional on the wire for the same
/// reason as `daily_read_cap`. /// + /// + /// The address an MCP client attaches to, `<base_url>/mcp`, while
+ /// `mcp_enabled` is on; null while it is off. Read it here rather
+ /// than assembling it. + /// /// /// /// The key set end-user tokens are verified against when set (an
@@ -281,6 +294,7 @@ public HostedAPI( int? dailyReadCap, int? dailyWriteCap, bool? mcpEnabled, + string? mcpUrl, string? projectId, string? userTokenJwksUrl, string? userTokenSecretHint) @@ -298,6 +312,7 @@ public HostedAPI( this.DailyReadCap = dailyReadCap; this.DailyWriteCap = dailyWriteCap; this.McpEnabled = mcpEnabled; + this.McpUrl = mcpUrl; this.ProjectId = projectId; this.UserTokenJwksUrl = userTokenJwksUrl; this.UserTokenSecretHint = userTokenSecretHint; diff --git a/src/libs/Speechify/Generated/Speechify.Models.HostedAPIMount.Json.g.cs b/src/libs/Speechify/Generated/Speechify.Models.HostedAPIMount.Json.g.cs new file mode 100644 index 00000000..29964085 --- /dev/null +++ b/src/libs/Speechify/Generated/Speechify.Models.HostedAPIMount.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Speechify +{ + public sealed partial class HostedAPIMount + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Speechify.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Speechify.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Speechify.HostedAPIMount? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Speechify.HostedAPIMount), + jsonSerializerContext) as global::Speechify.HostedAPIMount; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Speechify.HostedAPIMount? FromJson( + string json) + { + return FromJson( + json, + global::Speechify.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Speechify.HostedAPIMount? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Speechify.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Speechify.HostedAPIMount), + jsonSerializerContext).ConfigureAwait(false)) as global::Speechify.HostedAPIMount; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Speechify.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Speechify.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Speechify/Generated/Speechify.Models.HostedAPIMount.g.cs b/src/libs/Speechify/Generated/Speechify.Models.HostedAPIMount.g.cs new file mode 100644 index 00000000..0b1c9b6c --- /dev/null +++ b/src/libs/Speechify/Generated/Speechify.Models.HostedAPIMount.g.cs @@ -0,0 +1,118 @@ + +#nullable enable + +namespace Speechify +{ + /// + /// + /// + public sealed partial class HostedAPIMount + { + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("tool_id")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string ToolId { get; set; } + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("tool_name")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string ToolName { get; set; } + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("tool_kind")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Speechify.JsonConverters.HostedApiMountToolKindJsonConverter))] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::Speechify.HostedApiMountToolKind ToolKind { get; set; } + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("name_prefix")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string NamePrefix { get; set; } + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("path_prefix")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string PathPrefix { get; set; } + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("dry_run")] + [global::System.Text.Json.Serialization.JsonRequired] + public required bool DryRun { get; set; } + + /// + /// One entry per operation the connector offers, in its order, then one per stale route whose operation it no longer offers. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("operations")] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::System.Collections.Generic.IList Operations { get; set; } + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("summary")] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::Speechify.HostedAPIMountSummary Summary { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// + /// + /// + /// + /// + /// + /// One entry per operation the connector offers, in its order, then one per stale route whose operation it no longer offers. + /// + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public HostedAPIMount( + string toolId, + string toolName, + global::Speechify.HostedApiMountToolKind toolKind, + string namePrefix, + string pathPrefix, + bool dryRun, + global::System.Collections.Generic.IList operations, + global::Speechify.HostedAPIMountSummary summary) + { + this.ToolId = toolId ?? throw new global::System.ArgumentNullException(nameof(toolId)); + this.ToolName = toolName ?? throw new global::System.ArgumentNullException(nameof(toolName)); + this.ToolKind = toolKind; + this.NamePrefix = namePrefix ?? throw new global::System.ArgumentNullException(nameof(namePrefix)); + this.PathPrefix = pathPrefix ?? throw new global::System.ArgumentNullException(nameof(pathPrefix)); + this.DryRun = dryRun; + this.Operations = operations ?? throw new global::System.ArgumentNullException(nameof(operations)); + this.Summary = summary ?? throw new global::System.ArgumentNullException(nameof(summary)); + } + + /// + /// Initializes a new instance of the class. + /// + public HostedAPIMount() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Speechify/Generated/Speechify.Models.HostedAPIMountOperation.Json.g.cs b/src/libs/Speechify/Generated/Speechify.Models.HostedAPIMountOperation.Json.g.cs new file mode 100644 index 00000000..30fa8188 --- /dev/null +++ b/src/libs/Speechify/Generated/Speechify.Models.HostedAPIMountOperation.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Speechify +{ + public sealed partial class HostedAPIMountOperation + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Speechify.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Speechify.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Speechify.HostedAPIMountOperation? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Speechify.HostedAPIMountOperation), + jsonSerializerContext) as global::Speechify.HostedAPIMountOperation; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Speechify.HostedAPIMountOperation? FromJson( + string json) + { + return FromJson( + json, + global::Speechify.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Speechify.HostedAPIMountOperation? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Speechify.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Speechify.HostedAPIMountOperation), + jsonSerializerContext).ConfigureAwait(false)) as global::Speechify.HostedAPIMountOperation; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Speechify.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Speechify.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Speechify/Generated/Speechify.Models.HostedAPIMountOperation.g.cs b/src/libs/Speechify/Generated/Speechify.Models.HostedAPIMountOperation.g.cs new file mode 100644 index 00000000..47cd96bf --- /dev/null +++ b/src/libs/Speechify/Generated/Speechify.Models.HostedAPIMountOperation.g.cs @@ -0,0 +1,169 @@ + +#nullable enable + +namespace Speechify +{ + /// + /// + /// + public sealed partial class HostedAPIMountOperation + { + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("operation")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Operation { get; set; } + + /// + /// The operation's summary or description; the created route's description. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("description")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Description { get; set; } + + /// + /// The operation's effective action class, or empty for a stale route whose operation is gone. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("action_class")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string ActionClass { get; set; } + + /// + /// The operation's effective approval, or empty for a stale route whose operation is gone. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("approval")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Approval { get; set; } + + /// + /// Whether a route can serve it now (approval `auto`, and a read, or a write on a route with `allow_write` on an API that names a person). + /// + [global::System.Text.Json.Serialization.JsonPropertyName("servable")] + [global::System.Text.Json.Serialization.JsonRequired] + public required bool Servable { get; set; } + + /// + /// Whether the route serves a write: set on a create when the mount includes writes, and the existing route's own value otherwise. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("allow_write")] + [global::System.Text.Json.Serialization.JsonRequired] + public required bool AllowWrite { get; set; } + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("action")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Speechify.JsonConverters.HostedApiMountOperationActionJsonConverter))] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::Speechify.HostedApiMountOperationAction Action { get; set; } + + /// + /// Why a `skip` or a `stale` entry is one, and what fixes it. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("reason")] + public string? Reason { get; set; } + + /// + /// What an `update` rewrites. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("changes")] + public global::System.Collections.Generic.IList? Changes { get; set; } + + /// + /// The route's name, the MCP tool name the face lists. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("name")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Name { get; set; } + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("path")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Path { get; set; } + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("route")] + public global::Speechify.HostedAPIRoute? Route { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// + /// The operation's summary or description; the created route's description. + /// + /// + /// The operation's effective action class, or empty for a stale route whose operation is gone. + /// + /// + /// The operation's effective approval, or empty for a stale route whose operation is gone. + /// + /// + /// Whether a route can serve it now (approval `auto`, and a read, or a write on a route with `allow_write` on an API that names a person). + /// + /// + /// Whether the route serves a write: set on a create when the mount includes writes, and the existing route's own value otherwise. + /// + /// + /// + /// The route's name, the MCP tool name the face lists. + /// + /// + /// + /// Why a `skip` or a `stale` entry is one, and what fixes it. + /// + /// + /// What an `update` rewrites. + /// + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public HostedAPIMountOperation( + string operation, + string description, + string actionClass, + string approval, + bool servable, + bool allowWrite, + global::Speechify.HostedApiMountOperationAction action, + string name, + string path, + string? reason, + global::System.Collections.Generic.IList? changes, + global::Speechify.HostedAPIRoute? route) + { + this.Operation = operation ?? throw new global::System.ArgumentNullException(nameof(operation)); + this.Description = description ?? throw new global::System.ArgumentNullException(nameof(description)); + this.ActionClass = actionClass ?? throw new global::System.ArgumentNullException(nameof(actionClass)); + this.Approval = approval ?? throw new global::System.ArgumentNullException(nameof(approval)); + this.Servable = servable; + this.AllowWrite = allowWrite; + this.Action = action; + this.Reason = reason; + this.Changes = changes; + this.Name = name ?? throw new global::System.ArgumentNullException(nameof(name)); + this.Path = path ?? throw new global::System.ArgumentNullException(nameof(path)); + this.Route = route; + } + + /// + /// Initializes a new instance of the class. + /// + public HostedAPIMountOperation() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Speechify/Generated/Speechify.Models.HostedAPIMountSummary.Json.g.cs b/src/libs/Speechify/Generated/Speechify.Models.HostedAPIMountSummary.Json.g.cs new file mode 100644 index 00000000..050d6bdc --- /dev/null +++ b/src/libs/Speechify/Generated/Speechify.Models.HostedAPIMountSummary.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Speechify +{ + public sealed partial class HostedAPIMountSummary + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Speechify.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Speechify.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Speechify.HostedAPIMountSummary? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Speechify.HostedAPIMountSummary), + jsonSerializerContext) as global::Speechify.HostedAPIMountSummary; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Speechify.HostedAPIMountSummary? FromJson( + string json) + { + return FromJson( + json, + global::Speechify.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Speechify.HostedAPIMountSummary? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Speechify.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Speechify.HostedAPIMountSummary), + jsonSerializerContext).ConfigureAwait(false)) as global::Speechify.HostedAPIMountSummary; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Speechify.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Speechify.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Speechify/Generated/Speechify.Models.HostedAPIMountSummary.g.cs b/src/libs/Speechify/Generated/Speechify.Models.HostedAPIMountSummary.g.cs new file mode 100644 index 00000000..05fadac5 --- /dev/null +++ b/src/libs/Speechify/Generated/Speechify.Models.HostedAPIMountSummary.g.cs @@ -0,0 +1,85 @@ + +#nullable enable + +namespace Speechify +{ + /// + /// + /// + public sealed partial class HostedAPIMountSummary + { + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("create")] + [global::System.Text.Json.Serialization.JsonRequired] + public required int Create { get; set; } + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("update")] + [global::System.Text.Json.Serialization.JsonRequired] + public required int Update { get; set; } + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("unchanged")] + [global::System.Text.Json.Serialization.JsonRequired] + public required int Unchanged { get; set; } + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("skip")] + [global::System.Text.Json.Serialization.JsonRequired] + public required int Skip { get; set; } + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("stale")] + [global::System.Text.Json.Serialization.JsonRequired] + public required int Stale { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// + /// + /// + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public HostedAPIMountSummary( + int create, + int update, + int unchanged, + int skip, + int stale) + { + this.Create = create; + this.Update = update; + this.Unchanged = unchanged; + this.Skip = skip; + this.Stale = stale; + } + + /// + /// Initializes a new instance of the class. + /// + public HostedAPIMountSummary() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Speechify/Generated/Speechify.Models.HostedAPIResolver.g.cs b/src/libs/Speechify/Generated/Speechify.Models.HostedAPIResolver.g.cs index c8d8f488..0175b8e6 100644 --- a/src/libs/Speechify/Generated/Speechify.Models.HostedAPIResolver.g.cs +++ b/src/libs/Speechify/Generated/Speechify.Models.HostedAPIResolver.g.cs @@ -19,27 +19,47 @@ namespace Speechify /// `run` (trigger_id of a webhook trigger, wait_seconds),
/// `file` (file_path of one published file; or, on a route whose path
/// ends in `*`, file_root and file_index for a whole published tree),
- /// `tool` (tool_id of an `openapi` tool definition and the `operation`
- /// on it: the POST body is the operation's arguments, held to its
- /// argument schema, and the vendor's answer after the operation's
- /// `response` mapping is the response, or `{"text": ...}` when the vendor
- /// answered text. Only an operation whose effective class is `read`, on a
- /// tool whose `approval` is null or `auto`, may be served, and never on a
- /// public API; a route write that names anything else is refused with 400
- /// `validation_failed` on `resolver.tool_id`. Because a definition can
- /// change after its route is written, every call re-checks it: an
- /// operation no longer classified `read`, or a tool whose `approval` is no
- /// longer null or `auto`, answers 403 `route_tool_not_readable`; a tool
- /// deleted, moved to another project, no longer of kind `openapi` or
- /// without the operation answers 409 `route_tool_unavailable`, which no
+ /// `tool` (tool_id of an `openapi` or `mcp` tool definition and the
+ /// `operation` on it, an openapi operation's id or one of the MCP
+ /// server's tools by name: the POST body is the arguments, held to their
+ /// schema, and the connector's answer after the tool's response mapping
+ /// is the response. An openapi vendor's JSON comes back as it came, or
+ /// `{"text": ...}` when it answered text; an MCP tool answers its
+ /// structured content, its text when that text is JSON, `{"text": ...}`
+ /// for plain text, or `{"content": [...]}` with every block as the server
+ /// sent it when one is not text. For an `mcp` tool the route write lists
+ /// the server's tools and pins the chosen tool's input schema on the
+ /// route as `input_schema`, so the MCP face and every call use the pin
+ /// and an upstream change reaches no consumer until the route is written
+ /// again. An operation whose effective class is `read`, on a tool whose
+ /// `approval` is null or `auto`, may be served on any API but a public
+ /// one. An operation that is not a read is served only on a route with
+ /// `allow_write: true`, on an API whose `auth_mode` names a person
+ /// (`owner`, `workspace` or `user_token`), and still only with an
+ /// `approval` of null or `auto`: a write through a route acts for the
+ /// member or end user calling, who is sent to the connector as
+ /// `Speechify-User-Identity`, a service account is refused, every write
+ /// counts against `daily_write_cap` (429 `route_write_limit_reached`) and
+ /// claims the caller's `Idempotency-Key` so a retry replays the first
+ /// answer. A route write that breaks any of this is refused with 400
+ /// `validation_failed` on `resolver.tool_id`, `resolver.operation` or
+ /// `resolver.allow_write`, as is an MCP server that cannot be listed.
+ /// Because a definition can change after its route is written, every call
+ /// re-checks it: an operation no longer classified `read` on a route not
+ /// switched to writes, or a tool whose `approval` is no longer null or
+ /// `auto`, answers 403 `route_tool_not_readable`; a tool
+ /// deleted, moved to another project, or without the operation (an MCP
+ /// server that no longer lists the tool) answers 409
+ /// `route_tool_unavailable`, which no
/// retry clears until the route or the tool is fixed. Arguments that do
/// not fit the schema answer 400 `validation_failed`; the definition's
/// `max_requests_per_minute` and the vendor's own throttle both answer 429
/// `route_upstream_rate_limited` with `Retry-After`; a vendor error
/// answers 502 `route_upstream_error` with the vendor's status in
- /// `error.details.upstream_status`, and an unreachable vendor or a
- /// credential that no longer resolves answers 502 `route_upstream_error`
- /// without it). + /// `error.details.upstream_status`, an MCP tool that reports an error
+ /// answers it with the tool's own message in `error.details.tool_error`,
+ /// and an unreachable vendor or a credential that no longer resolves
+ /// answers 502 `route_upstream_error` without either). ///
public sealed partial class HostedAPIResolver { @@ -168,9 +188,9 @@ public sealed partial class HostedAPIResolver public int? WaitSeconds { get; set; } /// - /// For a `tool` route: the `openapi` tool definition whose operation
- /// the route calls, as `POST /v1/agents/tool-definitions` returned
- /// it. It must live in the API's project (409
+ /// For a `tool` route: the `openapi` or `mcp` tool definition whose
+ /// operation the route calls, as `POST /v1/agents/tool-definitions`
+ /// returned it. It must live in the API's project (409
/// `cross_project_reference` otherwise). The route refuses a definition
/// of another kind, an operation whose effective class is not `read`,
/// and a tool whose `approval` is set to anything but `auto`, since a
@@ -180,16 +200,43 @@ public sealed partial class HostedAPIResolver public string? ToolId { get; set; } /// - /// For a `tool` route: the operation to call, as the definition's
- /// `operations[].id` names it (the same value
+ /// For a `tool` route: the operation to call. On an `openapi` tool it
+ /// is the definition's `operations[].id` (the same value
/// `POST /v1/agents/tool-definitions/test-openapi-call` takes as
- /// `operation`). The route is a POST whose JSON body is the
- /// operation's arguments, validated against the argument schema the
- /// definition publishes. + /// `operation`); on an `mcp` tool it is the server's own tool name,
+ /// as `POST /v1/agents/tool-definitions/test-mcp-connection` lists
+ /// it. The route is a POST whose JSON body is the arguments, validated
+ /// against the definition's argument schema for an openapi operation
+ /// and against `input_schema` for an MCP tool. ///
[global::System.Text.Json.Serialization.JsonPropertyName("operation")] public string? Operation { get; set; } + /// + /// For a `tool` route: serve an operation that is not a read (refused
+ /// on an operation that is one). Only on
+ /// an API whose `auth_mode` is `owner`, `workspace` or `user_token`,
+ /// and only for an operation whose effective `approval` is `auto`;
+ /// the API cannot then be switched to `consumer_key` or `public`
+ /// while the route serves writes. A write acts for the person
+ /// calling, counts against `daily_write_cap`, and claims
+ /// `Idempotency-Key`. On the MCP face the tool is not read-only. + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("allow_write")] + public bool? AllowWrite { get; set; } + + /// + /// For a `tool` route on an `mcp` tool: the MCP tool's input schema
+ /// as the server listed it when the route was last written, pinned so
+ /// the MCP face lists it and every call is checked against it without
+ /// reaching the server. Set by the platform on every write that
+ /// carries a resolver; a value you send is replaced. Absent on an
+ /// openapi route, whose schema the definition holds. Write the route
+ /// again to pick up a schema the server changed. + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("input_schema")] + public object? InputSchema { get; set; } + /// /// Additional properties that are not explicitly defined in the schema /// @@ -264,21 +311,42 @@ public sealed partial class HostedAPIResolver /// How long a `run` route waits for the run before answering 202 (default 20; 0 answers 202 at once). /// /// - /// For a `tool` route: the `openapi` tool definition whose operation
- /// the route calls, as `POST /v1/agents/tool-definitions` returned
- /// it. It must live in the API's project (409
+ /// For a `tool` route: the `openapi` or `mcp` tool definition whose
+ /// operation the route calls, as `POST /v1/agents/tool-definitions`
+ /// returned it. It must live in the API's project (409
/// `cross_project_reference` otherwise). The route refuses a definition
/// of another kind, an operation whose effective class is not `read`,
/// and a tool whose `approval` is set to anything but `auto`, since a
/// route has nobody to approve a call: set it to null or `auto` first. /// /// - /// For a `tool` route: the operation to call, as the definition's
- /// `operations[].id` names it (the same value
+ /// For a `tool` route: the operation to call. On an `openapi` tool it
+ /// is the definition's `operations[].id` (the same value
/// `POST /v1/agents/tool-definitions/test-openapi-call` takes as
- /// `operation`). The route is a POST whose JSON body is the
- /// operation's arguments, validated against the argument schema the
- /// definition publishes. + /// `operation`); on an `mcp` tool it is the server's own tool name,
+ /// as `POST /v1/agents/tool-definitions/test-mcp-connection` lists
+ /// it. The route is a POST whose JSON body is the arguments, validated
+ /// against the definition's argument schema for an openapi operation
+ /// and against `input_schema` for an MCP tool. + /// + /// + /// For a `tool` route: serve an operation that is not a read (refused
+ /// on an operation that is one). Only on
+ /// an API whose `auth_mode` is `owner`, `workspace` or `user_token`,
+ /// and only for an operation whose effective `approval` is `auto`;
+ /// the API cannot then be switched to `consumer_key` or `public`
+ /// while the route serves writes. A write acts for the person
+ /// calling, counts against `daily_write_cap`, and claims
+ /// `Idempotency-Key`. On the MCP face the tool is not read-only. + /// + /// + /// For a `tool` route on an `mcp` tool: the MCP tool's input schema
+ /// as the server listed it when the route was last written, pinned so
+ /// the MCP face lists it and every call is checked against it without
+ /// reaching the server. Set by the platform on every write that
+ /// carries a resolver; a value you send is replaced. Absent on an
+ /// openapi route, whose schema the definition holds. Write the route
+ /// again to pick up a schema the server changed. /// #if NET7_0_OR_GREATER [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] @@ -300,7 +368,9 @@ public HostedAPIResolver( string? triggerId, int? waitSeconds, string? toolId, - string? operation) + string? operation, + bool? allowWrite, + object? inputSchema) { this.Type = type; this.StoreId = storeId; @@ -319,6 +389,8 @@ public HostedAPIResolver( this.WaitSeconds = waitSeconds; this.ToolId = toolId; this.Operation = operation; + this.AllowWrite = allowWrite; + this.InputSchema = inputSchema; } /// diff --git a/src/libs/Speechify/Generated/Speechify.Models.HostedAPIResolverInputSchema.Json.g.cs b/src/libs/Speechify/Generated/Speechify.Models.HostedAPIResolverInputSchema.Json.g.cs new file mode 100644 index 00000000..9b74fc27 --- /dev/null +++ b/src/libs/Speechify/Generated/Speechify.Models.HostedAPIResolverInputSchema.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Speechify +{ + public sealed partial class HostedAPIResolverInputSchema + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Speechify.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Speechify.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Speechify.HostedAPIResolverInputSchema? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Speechify.HostedAPIResolverInputSchema), + jsonSerializerContext) as global::Speechify.HostedAPIResolverInputSchema; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Speechify.HostedAPIResolverInputSchema? FromJson( + string json) + { + return FromJson( + json, + global::Speechify.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Speechify.HostedAPIResolverInputSchema? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Speechify.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Speechify.HostedAPIResolverInputSchema), + jsonSerializerContext).ConfigureAwait(false)) as global::Speechify.HostedAPIResolverInputSchema; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Speechify.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Speechify.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Speechify/Generated/Speechify.Models.HostedAPIResolverInputSchema.g.cs b/src/libs/Speechify/Generated/Speechify.Models.HostedAPIResolverInputSchema.g.cs new file mode 100644 index 00000000..a3b15474 --- /dev/null +++ b/src/libs/Speechify/Generated/Speechify.Models.HostedAPIResolverInputSchema.g.cs @@ -0,0 +1,25 @@ + +#nullable enable + +namespace Speechify +{ + /// + /// For a `tool` route on an `mcp` tool: the MCP tool's input schema
+ /// as the server listed it when the route was last written, pinned so
+ /// the MCP face lists it and every call is checked against it without
+ /// reaching the server. Set by the platform on every write that
+ /// carries a resolver; a value you send is replaced. Absent on an
+ /// openapi route, whose schema the definition holds. Write the route
+ /// again to pick up a schema the server changed. + ///
+ public sealed partial class HostedAPIResolverInputSchema + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Speechify/Generated/Speechify.Models.HostedAPIResolverInputSchema2.Json.g.cs b/src/libs/Speechify/Generated/Speechify.Models.HostedAPIResolverInputSchema2.Json.g.cs new file mode 100644 index 00000000..139e25bf --- /dev/null +++ b/src/libs/Speechify/Generated/Speechify.Models.HostedAPIResolverInputSchema2.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Speechify +{ + public sealed partial class HostedAPIResolverInputSchema2 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Speechify.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Speechify.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Speechify.HostedAPIResolverInputSchema2? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Speechify.HostedAPIResolverInputSchema2), + jsonSerializerContext) as global::Speechify.HostedAPIResolverInputSchema2; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Speechify.HostedAPIResolverInputSchema2? FromJson( + string json) + { + return FromJson( + json, + global::Speechify.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Speechify.HostedAPIResolverInputSchema2? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Speechify.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Speechify.HostedAPIResolverInputSchema2), + jsonSerializerContext).ConfigureAwait(false)) as global::Speechify.HostedAPIResolverInputSchema2; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Speechify.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Speechify.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Speechify/Generated/Speechify.Models.HostedAPIResolverInputSchema2.g.cs b/src/libs/Speechify/Generated/Speechify.Models.HostedAPIResolverInputSchema2.g.cs new file mode 100644 index 00000000..a27c7e17 --- /dev/null +++ b/src/libs/Speechify/Generated/Speechify.Models.HostedAPIResolverInputSchema2.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Speechify +{ + /// + /// Any type + /// + public sealed partial class HostedAPIResolverInputSchema2 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Speechify/Generated/Speechify.Models.HostedAPIRoute.g.cs b/src/libs/Speechify/Generated/Speechify.Models.HostedAPIRoute.g.cs index cd7db83c..a4d722d4 100644 --- a/src/libs/Speechify/Generated/Speechify.Models.HostedAPIRoute.g.cs +++ b/src/libs/Speechify/Generated/Speechify.Models.HostedAPIRoute.g.cs @@ -77,27 +77,47 @@ public sealed partial class HostedAPIRoute /// `run` (trigger_id of a webhook trigger, wait_seconds),
/// `file` (file_path of one published file; or, on a route whose path
/// ends in `*`, file_root and file_index for a whole published tree),
- /// `tool` (tool_id of an `openapi` tool definition and the `operation`
- /// on it: the POST body is the operation's arguments, held to its
- /// argument schema, and the vendor's answer after the operation's
- /// `response` mapping is the response, or `{"text": ...}` when the vendor
- /// answered text. Only an operation whose effective class is `read`, on a
- /// tool whose `approval` is null or `auto`, may be served, and never on a
- /// public API; a route write that names anything else is refused with 400
- /// `validation_failed` on `resolver.tool_id`. Because a definition can
- /// change after its route is written, every call re-checks it: an
- /// operation no longer classified `read`, or a tool whose `approval` is no
- /// longer null or `auto`, answers 403 `route_tool_not_readable`; a tool
- /// deleted, moved to another project, no longer of kind `openapi` or
- /// without the operation answers 409 `route_tool_unavailable`, which no
+ /// `tool` (tool_id of an `openapi` or `mcp` tool definition and the
+ /// `operation` on it, an openapi operation's id or one of the MCP
+ /// server's tools by name: the POST body is the arguments, held to their
+ /// schema, and the connector's answer after the tool's response mapping
+ /// is the response. An openapi vendor's JSON comes back as it came, or
+ /// `{"text": ...}` when it answered text; an MCP tool answers its
+ /// structured content, its text when that text is JSON, `{"text": ...}`
+ /// for plain text, or `{"content": [...]}` with every block as the server
+ /// sent it when one is not text. For an `mcp` tool the route write lists
+ /// the server's tools and pins the chosen tool's input schema on the
+ /// route as `input_schema`, so the MCP face and every call use the pin
+ /// and an upstream change reaches no consumer until the route is written
+ /// again. An operation whose effective class is `read`, on a tool whose
+ /// `approval` is null or `auto`, may be served on any API but a public
+ /// one. An operation that is not a read is served only on a route with
+ /// `allow_write: true`, on an API whose `auth_mode` names a person
+ /// (`owner`, `workspace` or `user_token`), and still only with an
+ /// `approval` of null or `auto`: a write through a route acts for the
+ /// member or end user calling, who is sent to the connector as
+ /// `Speechify-User-Identity`, a service account is refused, every write
+ /// counts against `daily_write_cap` (429 `route_write_limit_reached`) and
+ /// claims the caller's `Idempotency-Key` so a retry replays the first
+ /// answer. A route write that breaks any of this is refused with 400
+ /// `validation_failed` on `resolver.tool_id`, `resolver.operation` or
+ /// `resolver.allow_write`, as is an MCP server that cannot be listed.
+ /// Because a definition can change after its route is written, every call
+ /// re-checks it: an operation no longer classified `read` on a route not
+ /// switched to writes, or a tool whose `approval` is no longer null or
+ /// `auto`, answers 403 `route_tool_not_readable`; a tool
+ /// deleted, moved to another project, or without the operation (an MCP
+ /// server that no longer lists the tool) answers 409
+ /// `route_tool_unavailable`, which no
/// retry clears until the route or the tool is fixed. Arguments that do
/// not fit the schema answer 400 `validation_failed`; the definition's
/// `max_requests_per_minute` and the vendor's own throttle both answer 429
/// `route_upstream_rate_limited` with `Retry-After`; a vendor error
/// answers 502 `route_upstream_error` with the vendor's status in
- /// `error.details.upstream_status`, and an unreachable vendor or a
- /// credential that no longer resolves answers 502 `route_upstream_error`
- /// without it). + /// `error.details.upstream_status`, an MCP tool that reports an error
+ /// answers it with the tool's own message in `error.details.tool_error`,
+ /// and an unreachable vendor or a credential that no longer resolves
+ /// answers 502 `route_upstream_error` without either). ///
[global::System.Text.Json.Serialization.JsonPropertyName("resolver")] [global::System.Text.Json.Serialization.JsonRequired] @@ -189,27 +209,47 @@ public sealed partial class HostedAPIRoute /// `run` (trigger_id of a webhook trigger, wait_seconds),
/// `file` (file_path of one published file; or, on a route whose path
/// ends in `*`, file_root and file_index for a whole published tree),
- /// `tool` (tool_id of an `openapi` tool definition and the `operation`
- /// on it: the POST body is the operation's arguments, held to its
- /// argument schema, and the vendor's answer after the operation's
- /// `response` mapping is the response, or `{"text": ...}` when the vendor
- /// answered text. Only an operation whose effective class is `read`, on a
- /// tool whose `approval` is null or `auto`, may be served, and never on a
- /// public API; a route write that names anything else is refused with 400
- /// `validation_failed` on `resolver.tool_id`. Because a definition can
- /// change after its route is written, every call re-checks it: an
- /// operation no longer classified `read`, or a tool whose `approval` is no
- /// longer null or `auto`, answers 403 `route_tool_not_readable`; a tool
- /// deleted, moved to another project, no longer of kind `openapi` or
- /// without the operation answers 409 `route_tool_unavailable`, which no
+ /// `tool` (tool_id of an `openapi` or `mcp` tool definition and the
+ /// `operation` on it, an openapi operation's id or one of the MCP
+ /// server's tools by name: the POST body is the arguments, held to their
+ /// schema, and the connector's answer after the tool's response mapping
+ /// is the response. An openapi vendor's JSON comes back as it came, or
+ /// `{"text": ...}` when it answered text; an MCP tool answers its
+ /// structured content, its text when that text is JSON, `{"text": ...}`
+ /// for plain text, or `{"content": [...]}` with every block as the server
+ /// sent it when one is not text. For an `mcp` tool the route write lists
+ /// the server's tools and pins the chosen tool's input schema on the
+ /// route as `input_schema`, so the MCP face and every call use the pin
+ /// and an upstream change reaches no consumer until the route is written
+ /// again. An operation whose effective class is `read`, on a tool whose
+ /// `approval` is null or `auto`, may be served on any API but a public
+ /// one. An operation that is not a read is served only on a route with
+ /// `allow_write: true`, on an API whose `auth_mode` names a person
+ /// (`owner`, `workspace` or `user_token`), and still only with an
+ /// `approval` of null or `auto`: a write through a route acts for the
+ /// member or end user calling, who is sent to the connector as
+ /// `Speechify-User-Identity`, a service account is refused, every write
+ /// counts against `daily_write_cap` (429 `route_write_limit_reached`) and
+ /// claims the caller's `Idempotency-Key` so a retry replays the first
+ /// answer. A route write that breaks any of this is refused with 400
+ /// `validation_failed` on `resolver.tool_id`, `resolver.operation` or
+ /// `resolver.allow_write`, as is an MCP server that cannot be listed.
+ /// Because a definition can change after its route is written, every call
+ /// re-checks it: an operation no longer classified `read` on a route not
+ /// switched to writes, or a tool whose `approval` is no longer null or
+ /// `auto`, answers 403 `route_tool_not_readable`; a tool
+ /// deleted, moved to another project, or without the operation (an MCP
+ /// server that no longer lists the tool) answers 409
+ /// `route_tool_unavailable`, which no
/// retry clears until the route or the tool is fixed. Arguments that do
/// not fit the schema answer 400 `validation_failed`; the definition's
/// `max_requests_per_minute` and the vendor's own throttle both answer 429
/// `route_upstream_rate_limited` with `Retry-After`; a vendor error
/// answers 502 `route_upstream_error` with the vendor's status in
- /// `error.details.upstream_status`, and an unreachable vendor or a
- /// credential that no longer resolves answers 502 `route_upstream_error`
- /// without it). + /// `error.details.upstream_status`, an MCP tool that reports an error
+ /// answers it with the tool's own message in `error.details.tool_error`,
+ /// and an unreachable vendor or a credential that no longer resolves
+ /// answers 502 `route_upstream_error` without either). /// /// /// Cache-Control max-age on GET responses, and the shared response
diff --git a/src/libs/Speechify/Generated/Speechify.Models.HostedApiMountOperationAction.g.cs b/src/libs/Speechify/Generated/Speechify.Models.HostedApiMountOperationAction.g.cs new file mode 100644 index 00000000..81df97dd --- /dev/null +++ b/src/libs/Speechify/Generated/Speechify.Models.HostedApiMountOperationAction.g.cs @@ -0,0 +1,69 @@ + +#nullable enable + +namespace Speechify +{ + /// + /// + /// + public enum HostedApiMountOperationAction + { + /// + /// + /// + Create, + /// + /// + /// + Skip, + /// + /// + /// + Stale, + /// + /// + /// + Unchanged, + /// + /// + /// + Update, + } + + /// + /// Enum extensions to do fast conversions without the reflection. + /// + public static class HostedApiMountOperationActionExtensions + { + /// + /// Converts an enum to a string. + /// + public static string ToValueString(this HostedApiMountOperationAction value) + { + return value switch + { + HostedApiMountOperationAction.Create => "create", + HostedApiMountOperationAction.Skip => "skip", + HostedApiMountOperationAction.Stale => "stale", + HostedApiMountOperationAction.Unchanged => "unchanged", + HostedApiMountOperationAction.Update => "update", + _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), + }; + } + /// + /// Converts an string to a enum. + /// + public static HostedApiMountOperationAction? ToEnum(string value) + { + return value switch + { + "create" => HostedApiMountOperationAction.Create, + "skip" => HostedApiMountOperationAction.Skip, + "stale" => HostedApiMountOperationAction.Stale, + "unchanged" => HostedApiMountOperationAction.Unchanged, + "update" => HostedApiMountOperationAction.Update, + _ => null, + }; + } + } +} \ No newline at end of file diff --git a/src/libs/Speechify/Generated/Speechify.Models.HostedApiMountOperationChangesItems.g.cs b/src/libs/Speechify/Generated/Speechify.Models.HostedApiMountOperationChangesItems.g.cs new file mode 100644 index 00000000..9260281e --- /dev/null +++ b/src/libs/Speechify/Generated/Speechify.Models.HostedApiMountOperationChangesItems.g.cs @@ -0,0 +1,45 @@ + +#nullable enable + +namespace Speechify +{ + /// + /// + /// + public enum HostedApiMountOperationChangesItems + { + /// + /// + /// + InputSchema, + } + + /// + /// Enum extensions to do fast conversions without the reflection. + /// + public static class HostedApiMountOperationChangesItemsExtensions + { + /// + /// Converts an enum to a string. + /// + public static string ToValueString(this HostedApiMountOperationChangesItems value) + { + return value switch + { + HostedApiMountOperationChangesItems.InputSchema => "input_schema", + _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), + }; + } + /// + /// Converts an string to a enum. + /// + public static HostedApiMountOperationChangesItems? ToEnum(string value) + { + return value switch + { + "input_schema" => HostedApiMountOperationChangesItems.InputSchema, + _ => null, + }; + } + } +} \ No newline at end of file diff --git a/src/libs/Speechify/Generated/Speechify.Models.HostedApiMountToolKind.g.cs b/src/libs/Speechify/Generated/Speechify.Models.HostedApiMountToolKind.g.cs new file mode 100644 index 00000000..0f045fda --- /dev/null +++ b/src/libs/Speechify/Generated/Speechify.Models.HostedApiMountToolKind.g.cs @@ -0,0 +1,51 @@ + +#nullable enable + +namespace Speechify +{ + /// + /// + /// + public enum HostedApiMountToolKind + { + /// + /// + /// + Mcp, + /// + /// + /// + Openapi, + } + + /// + /// Enum extensions to do fast conversions without the reflection. + /// + public static class HostedApiMountToolKindExtensions + { + /// + /// Converts an enum to a string. + /// + public static string ToValueString(this HostedApiMountToolKind value) + { + return value switch + { + HostedApiMountToolKind.Mcp => "mcp", + HostedApiMountToolKind.Openapi => "openapi", + _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), + }; + } + /// + /// Converts an string to a enum. + /// + public static HostedApiMountToolKind? ToEnum(string value) + { + return value switch + { + "mcp" => HostedApiMountToolKind.Mcp, + "openapi" => HostedApiMountToolKind.Openapi, + _ => null, + }; + } + } +} \ No newline at end of file diff --git a/src/libs/Speechify/Generated/Speechify.Models.HostedApiUsageRoutesItems.g.cs b/src/libs/Speechify/Generated/Speechify.Models.HostedApiUsageRoutesItems.g.cs index e1e1ef69..17536199 100644 --- a/src/libs/Speechify/Generated/Speechify.Models.HostedApiUsageRoutesItems.g.cs +++ b/src/libs/Speechify/Generated/Speechify.Models.HostedApiUsageRoutesItems.g.cs @@ -29,6 +29,30 @@ public sealed partial class HostedApiUsageRoutesItems [global::System.Text.Json.Serialization.JsonRequired] public required long Writes { get; set; } + /// + /// For a `tool` route, the calls its connector was asked to answer today, whatever the outcome. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("tool_calls")] + public long? ToolCalls { get; set; } + + /// + /// For a `tool` route, today's calls the connector answered with an error or never answered (502 `route_upstream_error`). + /// + [global::System.Text.Json.Serialization.JsonPropertyName("upstream_errors")] + public long? UpstreamErrors { get; set; } + + /// + /// For a `tool` route, today's calls throttled by the tool's `max_requests_per_minute` or by the connector (429 `route_upstream_rate_limited`). + /// + [global::System.Text.Json.Serialization.JsonPropertyName("upstream_throttles")] + public long? UpstreamThrottles { get; set; } + + /// + /// For a `tool` route, the mean time today's calls took, in milliseconds, connector included; null before the first call. A slow or failing connector shows here rather than as a slow API. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("upstream_latency_ms_mean")] + public long? UpstreamLatencyMsMean { get; set; } + /// /// Additional properties that are not explicitly defined in the schema /// @@ -41,17 +65,37 @@ public sealed partial class HostedApiUsageRoutesItems /// /// /// + /// + /// For a `tool` route, the calls its connector was asked to answer today, whatever the outcome. + /// + /// + /// For a `tool` route, today's calls the connector answered with an error or never answered (502 `route_upstream_error`). + /// + /// + /// For a `tool` route, today's calls throttled by the tool's `max_requests_per_minute` or by the connector (429 `route_upstream_rate_limited`). + /// + /// + /// For a `tool` route, the mean time today's calls took, in milliseconds, connector included; null before the first call. A slow or failing connector shows here rather than as a slow API. + /// #if NET7_0_OR_GREATER [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] #endif public HostedApiUsageRoutesItems( string routeId, long reads, - long writes) + long writes, + long? toolCalls, + long? upstreamErrors, + long? upstreamThrottles, + long? upstreamLatencyMsMean) { this.RouteId = routeId ?? throw new global::System.ArgumentNullException(nameof(routeId)); this.Reads = reads; this.Writes = writes; + this.ToolCalls = toolCalls; + this.UpstreamErrors = upstreamErrors; + this.UpstreamThrottles = upstreamThrottles; + this.UpstreamLatencyMsMean = upstreamLatencyMsMean; } /// diff --git a/src/libs/Speechify/Generated/Speechify.Models.MCPToolConfig.g.cs b/src/libs/Speechify/Generated/Speechify.Models.MCPToolConfig.g.cs index b8dc9ad8..bd79521b 100644 --- a/src/libs/Speechify/Generated/Speechify.Models.MCPToolConfig.g.cs +++ b/src/libs/Speechify/Generated/Speechify.Models.MCPToolConfig.g.cs @@ -85,6 +85,23 @@ public sealed partial class MCPToolConfig [global::System.Text.Json.Serialization.JsonPropertyName("timeout_ms")] public int? TimeoutMs { get; set; } + /// + /// A ceiling on calls to this server per minute across the
+ /// workspace, so one agent cannot starve the people who share the
+ /// server's budget. Every call the platform makes to the server,
+ /// from a durable run or a hosted API `tool` route, draws from one
+ /// bucket per tool definition. A live voice or text session's MCP
+ /// calls are made by the worker's own client and are not counted.
+ /// A durable run past the ceiling gets a `rate_limited` observation
+ /// carrying `retry_after_seconds`, and a hosted route answers `429
+ /// route_upstream_rate_limited` with `Retry-After`; neither retries
+ /// in place.
+ /// Omitted means unbounded on our side, and your server's own `429`
+ /// still reaches the caller. + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("max_requests_per_minute")] + public int? MaxRequestsPerMinute { get; set; } + /// /// What a caller hears on a voice call while one of this
/// server's tools runs, and whether a second call to the same
@@ -128,10 +145,11 @@ public sealed partial class MCPToolConfig /// /// What each of the server's tools' JSON results passes through before
/// the agent reads it, keyed by the remote tool name: an item bound, a
- /// projection and derived string fields. Applies on durable runs only;
- /// a live session's MCP call is made by the worker's own client and
- /// never crosses the control plane, so a live agent sees the server's
- /// answer as it came. A tool you do not name here is passed through. + /// projection and derived string fields. Applies on durable runs and
+ /// on hosted API `tool` routes; a live session's MCP call is made by
+ /// the worker's own client and never crosses the control plane, so a
+ /// live agent sees the server's answer as it came. A tool you do not
+ /// name here is passed through. ///
[global::System.Text.Json.Serialization.JsonPropertyName("response_mappings")] public global::System.Collections.Generic.Dictionary? ResponseMappings { get; set; } @@ -168,6 +186,20 @@ public sealed partial class MCPToolConfig /// are not bounded by it; the worker keeps its transport's own
/// read timeout. /// + /// + /// A ceiling on calls to this server per minute across the
+ /// workspace, so one agent cannot starve the people who share the
+ /// server's budget. Every call the platform makes to the server,
+ /// from a durable run or a hosted API `tool` route, draws from one
+ /// bucket per tool definition. A live voice or text session's MCP
+ /// calls are made by the worker's own client and are not counted.
+ /// A durable run past the ceiling gets a `rate_limited` observation
+ /// carrying `retry_after_seconds`, and a hosted route answers `429
+ /// route_upstream_rate_limited` with `Retry-After`; neither retries
+ /// in place.
+ /// Omitted means unbounded on our side, and your server's own `429`
+ /// still reaches the caller. + /// /// /// What a caller hears on a voice call while one of this
/// server's tools runs, and whether a second call to the same
@@ -205,10 +237,11 @@ public sealed partial class MCPToolConfig /// /// What each of the server's tools' JSON results passes through before
/// the agent reads it, keyed by the remote tool name: an item bound, a
- /// projection and derived string fields. Applies on durable runs only;
- /// a live session's MCP call is made by the worker's own client and
- /// never crosses the control plane, so a live agent sees the server's
- /// answer as it came. A tool you do not name here is passed through. + /// projection and derived string fields. Applies on durable runs and
+ /// on hosted API `tool` routes; a live session's MCP call is made by
+ /// the worker's own client and never crosses the control plane, so a
+ /// live agent sees the server's answer as it came. A tool you do not
+ /// name here is passed through. /// #if NET7_0_OR_GREATER [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] @@ -218,6 +251,7 @@ public MCPToolConfig( global::Speechify.MCPAuth auth, global::Speechify.MCPTransport? transport, int? timeoutMs, + int? maxRequestsPerMinute, global::Speechify.LongRunningToolConfig? longRunning, global::System.Collections.Generic.Dictionary? actionClasses, global::System.Collections.Generic.Dictionary? responseMappings) @@ -226,6 +260,7 @@ public MCPToolConfig( this.Transport = transport; this.Auth = auth; this.TimeoutMs = timeoutMs; + this.MaxRequestsPerMinute = maxRequestsPerMinute; this.LongRunning = longRunning; this.ActionClasses = actionClasses; this.ResponseMappings = responseMappings; diff --git a/src/libs/Speechify/Generated/Speechify.Models.MCPToolConfigResponseMappings.g.cs b/src/libs/Speechify/Generated/Speechify.Models.MCPToolConfigResponseMappings.g.cs index 5b3f1c55..7fe9a81a 100644 --- a/src/libs/Speechify/Generated/Speechify.Models.MCPToolConfigResponseMappings.g.cs +++ b/src/libs/Speechify/Generated/Speechify.Models.MCPToolConfigResponseMappings.g.cs @@ -6,10 +6,11 @@ namespace Speechify /// /// What each of the server's tools' JSON results passes through before
/// the agent reads it, keyed by the remote tool name: an item bound, a
- /// projection and derived string fields. Applies on durable runs only;
- /// a live session's MCP call is made by the worker's own client and
- /// never crosses the control plane, so a live agent sees the server's
- /// answer as it came. A tool you do not name here is passed through. + /// projection and derived string fields. Applies on durable runs and
+ /// on hosted API `tool` routes; a live session's MCP call is made by
+ /// the worker's own client and never crosses the control plane, so a
+ /// live agent sees the server's answer as it came. A tool you do not
+ /// name here is passed through. ///
public sealed partial class MCPToolConfigResponseMappings { diff --git a/src/libs/Speechify/Generated/Speechify.Models.MountHostedAPIRoutesRequest.Json.g.cs b/src/libs/Speechify/Generated/Speechify.Models.MountHostedAPIRoutesRequest.Json.g.cs new file mode 100644 index 00000000..f740d5e6 --- /dev/null +++ b/src/libs/Speechify/Generated/Speechify.Models.MountHostedAPIRoutesRequest.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Speechify +{ + public sealed partial class MountHostedAPIRoutesRequest + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Speechify.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Speechify.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Speechify.MountHostedAPIRoutesRequest? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Speechify.MountHostedAPIRoutesRequest), + jsonSerializerContext) as global::Speechify.MountHostedAPIRoutesRequest; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Speechify.MountHostedAPIRoutesRequest? FromJson( + string json) + { + return FromJson( + json, + global::Speechify.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Speechify.MountHostedAPIRoutesRequest? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Speechify.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Speechify.MountHostedAPIRoutesRequest), + jsonSerializerContext).ConfigureAwait(false)) as global::Speechify.MountHostedAPIRoutesRequest; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Speechify.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Speechify.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Speechify/Generated/Speechify.Models.MountHostedAPIRoutesRequest.g.cs b/src/libs/Speechify/Generated/Speechify.Models.MountHostedAPIRoutesRequest.g.cs new file mode 100644 index 00000000..6f1c17ea --- /dev/null +++ b/src/libs/Speechify/Generated/Speechify.Models.MountHostedAPIRoutesRequest.g.cs @@ -0,0 +1,116 @@ + +#nullable enable + +namespace Speechify +{ + /// + /// + /// + public sealed partial class MountHostedAPIRoutesRequest + { + /// + /// The `openapi` or `mcp` tool definition to mount, in the API's project. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("tool_id")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string ToolId { get; set; } + + /// + /// The operations to create routes for: openapi operation ids or the
+ /// MCP server's tool names. Omit to create a route for every operation
+ /// a route can serve. Naming one the connector does not offer is 400
+ /// `validation_failed` on `operations[i]`. Existing routes are compared
+ /// whatever the selection. + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("operations")] + public global::System.Collections.Generic.IList? Operations { get; set; } + + /// + /// Prefix of each created route's name, `<name_prefix>__<operation>`. Defaults to the tool's name with other characters as `_`. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("name_prefix")] + public string? NamePrefix { get; set; } + + /// + /// Path each created route sits under, `<path_prefix>/<operation>`; lowercase segments of letters, digits, `.`, `_` or `-`, with no `{param}` or `*`, and not under `/mcp`, `/openapi.json` or `/_runs`. Defaults to `/<name_prefix>` in lowercase. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("path_prefix")] + public string? PathPrefix { get; set; } + + /// + /// Answer what the mount would do and write nothing. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("dry_run")] + public bool? DryRun { get; set; } + + /// + /// Create routes for operations that are not reads too, each with
+ /// `allow_write: true`. Only an API whose `auth_mode` names a person
+ /// takes them; the operation's `approval` must still be `auto`.
+ /// Without it a write is a `skip` that says so. + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("include_writes")] + public bool? IncludeWrites { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// The `openapi` or `mcp` tool definition to mount, in the API's project. + /// + /// + /// The operations to create routes for: openapi operation ids or the
+ /// MCP server's tool names. Omit to create a route for every operation
+ /// a route can serve. Naming one the connector does not offer is 400
+ /// `validation_failed` on `operations[i]`. Existing routes are compared
+ /// whatever the selection. + /// + /// + /// Prefix of each created route's name, `<name_prefix>__<operation>`. Defaults to the tool's name with other characters as `_`. + /// + /// + /// Path each created route sits under, `<path_prefix>/<operation>`; lowercase segments of letters, digits, `.`, `_` or `-`, with no `{param}` or `*`, and not under `/mcp`, `/openapi.json` or `/_runs`. Defaults to `/<name_prefix>` in lowercase. + /// + /// + /// Answer what the mount would do and write nothing. + /// + /// + /// Create routes for operations that are not reads too, each with
+ /// `allow_write: true`. Only an API whose `auth_mode` names a person
+ /// takes them; the operation's `approval` must still be `auto`.
+ /// Without it a write is a `skip` that says so. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public MountHostedAPIRoutesRequest( + string toolId, + global::System.Collections.Generic.IList? operations, + string? namePrefix, + string? pathPrefix, + bool? dryRun, + bool? includeWrites) + { + this.ToolId = toolId ?? throw new global::System.ArgumentNullException(nameof(toolId)); + this.Operations = operations; + this.NamePrefix = namePrefix; + this.PathPrefix = pathPrefix; + this.DryRun = dryRun; + this.IncludeWrites = includeWrites; + } + + /// + /// Initializes a new instance of the class. + /// + public MountHostedAPIRoutesRequest() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Speechify/Generated/Speechify.Models.UpdateHostedAPIRouteRequest.g.cs b/src/libs/Speechify/Generated/Speechify.Models.UpdateHostedAPIRouteRequest.g.cs index dda1c44c..5216b087 100644 --- a/src/libs/Speechify/Generated/Speechify.Models.UpdateHostedAPIRouteRequest.g.cs +++ b/src/libs/Speechify/Generated/Speechify.Models.UpdateHostedAPIRouteRequest.g.cs @@ -59,27 +59,47 @@ public sealed partial class UpdateHostedAPIRouteRequest /// `run` (trigger_id of a webhook trigger, wait_seconds),
/// `file` (file_path of one published file; or, on a route whose path
/// ends in `*`, file_root and file_index for a whole published tree),
- /// `tool` (tool_id of an `openapi` tool definition and the `operation`
- /// on it: the POST body is the operation's arguments, held to its
- /// argument schema, and the vendor's answer after the operation's
- /// `response` mapping is the response, or `{"text": ...}` when the vendor
- /// answered text. Only an operation whose effective class is `read`, on a
- /// tool whose `approval` is null or `auto`, may be served, and never on a
- /// public API; a route write that names anything else is refused with 400
- /// `validation_failed` on `resolver.tool_id`. Because a definition can
- /// change after its route is written, every call re-checks it: an
- /// operation no longer classified `read`, or a tool whose `approval` is no
- /// longer null or `auto`, answers 403 `route_tool_not_readable`; a tool
- /// deleted, moved to another project, no longer of kind `openapi` or
- /// without the operation answers 409 `route_tool_unavailable`, which no
+ /// `tool` (tool_id of an `openapi` or `mcp` tool definition and the
+ /// `operation` on it, an openapi operation's id or one of the MCP
+ /// server's tools by name: the POST body is the arguments, held to their
+ /// schema, and the connector's answer after the tool's response mapping
+ /// is the response. An openapi vendor's JSON comes back as it came, or
+ /// `{"text": ...}` when it answered text; an MCP tool answers its
+ /// structured content, its text when that text is JSON, `{"text": ...}`
+ /// for plain text, or `{"content": [...]}` with every block as the server
+ /// sent it when one is not text. For an `mcp` tool the route write lists
+ /// the server's tools and pins the chosen tool's input schema on the
+ /// route as `input_schema`, so the MCP face and every call use the pin
+ /// and an upstream change reaches no consumer until the route is written
+ /// again. An operation whose effective class is `read`, on a tool whose
+ /// `approval` is null or `auto`, may be served on any API but a public
+ /// one. An operation that is not a read is served only on a route with
+ /// `allow_write: true`, on an API whose `auth_mode` names a person
+ /// (`owner`, `workspace` or `user_token`), and still only with an
+ /// `approval` of null or `auto`: a write through a route acts for the
+ /// member or end user calling, who is sent to the connector as
+ /// `Speechify-User-Identity`, a service account is refused, every write
+ /// counts against `daily_write_cap` (429 `route_write_limit_reached`) and
+ /// claims the caller's `Idempotency-Key` so a retry replays the first
+ /// answer. A route write that breaks any of this is refused with 400
+ /// `validation_failed` on `resolver.tool_id`, `resolver.operation` or
+ /// `resolver.allow_write`, as is an MCP server that cannot be listed.
+ /// Because a definition can change after its route is written, every call
+ /// re-checks it: an operation no longer classified `read` on a route not
+ /// switched to writes, or a tool whose `approval` is no longer null or
+ /// `auto`, answers 403 `route_tool_not_readable`; a tool
+ /// deleted, moved to another project, or without the operation (an MCP
+ /// server that no longer lists the tool) answers 409
+ /// `route_tool_unavailable`, which no
/// retry clears until the route or the tool is fixed. Arguments that do
/// not fit the schema answer 400 `validation_failed`; the definition's
/// `max_requests_per_minute` and the vendor's own throttle both answer 429
/// `route_upstream_rate_limited` with `Retry-After`; a vendor error
/// answers 502 `route_upstream_error` with the vendor's status in
- /// `error.details.upstream_status`, and an unreachable vendor or a
- /// credential that no longer resolves answers 502 `route_upstream_error`
- /// without it). + /// `error.details.upstream_status`, an MCP tool that reports an error
+ /// answers it with the tool's own message in `error.details.tool_error`,
+ /// and an unreachable vendor or a credential that no longer resolves
+ /// answers 502 `route_upstream_error` without either). ///
[global::System.Text.Json.Serialization.JsonPropertyName("resolver")] public global::Speechify.HostedAPIResolver? Resolver { get; set; } @@ -145,27 +165,47 @@ public sealed partial class UpdateHostedAPIRouteRequest /// `run` (trigger_id of a webhook trigger, wait_seconds),
/// `file` (file_path of one published file; or, on a route whose path
/// ends in `*`, file_root and file_index for a whole published tree),
- /// `tool` (tool_id of an `openapi` tool definition and the `operation`
- /// on it: the POST body is the operation's arguments, held to its
- /// argument schema, and the vendor's answer after the operation's
- /// `response` mapping is the response, or `{"text": ...}` when the vendor
- /// answered text. Only an operation whose effective class is `read`, on a
- /// tool whose `approval` is null or `auto`, may be served, and never on a
- /// public API; a route write that names anything else is refused with 400
- /// `validation_failed` on `resolver.tool_id`. Because a definition can
- /// change after its route is written, every call re-checks it: an
- /// operation no longer classified `read`, or a tool whose `approval` is no
- /// longer null or `auto`, answers 403 `route_tool_not_readable`; a tool
- /// deleted, moved to another project, no longer of kind `openapi` or
- /// without the operation answers 409 `route_tool_unavailable`, which no
+ /// `tool` (tool_id of an `openapi` or `mcp` tool definition and the
+ /// `operation` on it, an openapi operation's id or one of the MCP
+ /// server's tools by name: the POST body is the arguments, held to their
+ /// schema, and the connector's answer after the tool's response mapping
+ /// is the response. An openapi vendor's JSON comes back as it came, or
+ /// `{"text": ...}` when it answered text; an MCP tool answers its
+ /// structured content, its text when that text is JSON, `{"text": ...}`
+ /// for plain text, or `{"content": [...]}` with every block as the server
+ /// sent it when one is not text. For an `mcp` tool the route write lists
+ /// the server's tools and pins the chosen tool's input schema on the
+ /// route as `input_schema`, so the MCP face and every call use the pin
+ /// and an upstream change reaches no consumer until the route is written
+ /// again. An operation whose effective class is `read`, on a tool whose
+ /// `approval` is null or `auto`, may be served on any API but a public
+ /// one. An operation that is not a read is served only on a route with
+ /// `allow_write: true`, on an API whose `auth_mode` names a person
+ /// (`owner`, `workspace` or `user_token`), and still only with an
+ /// `approval` of null or `auto`: a write through a route acts for the
+ /// member or end user calling, who is sent to the connector as
+ /// `Speechify-User-Identity`, a service account is refused, every write
+ /// counts against `daily_write_cap` (429 `route_write_limit_reached`) and
+ /// claims the caller's `Idempotency-Key` so a retry replays the first
+ /// answer. A route write that breaks any of this is refused with 400
+ /// `validation_failed` on `resolver.tool_id`, `resolver.operation` or
+ /// `resolver.allow_write`, as is an MCP server that cannot be listed.
+ /// Because a definition can change after its route is written, every call
+ /// re-checks it: an operation no longer classified `read` on a route not
+ /// switched to writes, or a tool whose `approval` is no longer null or
+ /// `auto`, answers 403 `route_tool_not_readable`; a tool
+ /// deleted, moved to another project, or without the operation (an MCP
+ /// server that no longer lists the tool) answers 409
+ /// `route_tool_unavailable`, which no
/// retry clears until the route or the tool is fixed. Arguments that do
/// not fit the schema answer 400 `validation_failed`; the definition's
/// `max_requests_per_minute` and the vendor's own throttle both answer 429
/// `route_upstream_rate_limited` with `Retry-After`; a vendor error
/// answers 502 `route_upstream_error` with the vendor's status in
- /// `error.details.upstream_status`, and an unreachable vendor or a
- /// credential that no longer resolves answers 502 `route_upstream_error`
- /// without it). + /// `error.details.upstream_status`, an MCP tool that reports an error
+ /// answers it with the tool's own message in `error.details.tool_error`,
+ /// and an unreachable vendor or a credential that no longer resolves
+ /// answers 502 `route_upstream_error` without either). /// /// /// diff --git a/src/libs/Speechify/Generated/Speechify.Routes.JsonSerializerContext.g.cs b/src/libs/Speechify/Generated/Speechify.Routes.JsonSerializerContext.g.cs index 236ace8e..874278fc 100644 --- a/src/libs/Speechify/Generated/Speechify.Routes.JsonSerializerContext.g.cs +++ b/src/libs/Speechify/Generated/Speechify.Routes.JsonSerializerContext.g.cs @@ -25,6 +25,7 @@ namespace Speechify [global::System.Text.Json.Serialization.JsonSerializable(typeof(object))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Speechify.Error))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(int))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.DateTime))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Speechify.StoreAggregateMetricOp), TypeInfoPropertyName = "StoreAggregateMetricOp2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Speechify.StoreAggregateMetric))] @@ -43,6 +44,15 @@ namespace Speechify [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Speechify.CreateHostedApiRouteRequestMethod), TypeInfoPropertyName = "CreateHostedApiRouteRequestMethod2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Speechify.CreateHostedAPIRouteRequest))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Speechify.MountHostedAPIRoutesRequest))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Speechify.HostedApiMountToolKind), TypeInfoPropertyName = "HostedApiMountToolKind2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Speechify.HostedApiMountOperationAction), TypeInfoPropertyName = "HostedApiMountOperationAction2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Speechify.HostedApiMountOperationChangesItems), TypeInfoPropertyName = "HostedApiMountOperationChangesItems2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Speechify.HostedAPIMountOperation))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Speechify.HostedAPIMountSummary))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Speechify.HostedAPIMount))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Speechify.UpdateHostedApiRouteRequestMethod), TypeInfoPropertyName = "UpdateHostedApiRouteRequestMethod2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Speechify.UpdateHostedAPIRouteRequest))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(bool?))] @@ -56,10 +66,16 @@ namespace Speechify [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Speechify.HostedApiResolverWhereItemsOp?), TypeInfoPropertyName = "NullableHostedApiResolverWhereItemsOp2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Speechify.HostedApiResolverOrderByDirection?), TypeInfoPropertyName = "NullableHostedApiResolverOrderByDirection2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Speechify.CreateHostedApiRouteRequestMethod?), TypeInfoPropertyName = "NullableCreateHostedApiRouteRequestMethod2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Speechify.HostedApiMountToolKind?), TypeInfoPropertyName = "NullableHostedApiMountToolKind2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Speechify.HostedApiMountOperationAction?), TypeInfoPropertyName = "NullableHostedApiMountOperationAction2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Speechify.HostedApiMountOperationChangesItems?), TypeInfoPropertyName = "NullableHostedApiMountOperationChangesItems2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Speechify.UpdateHostedApiRouteRequestMethod?), TypeInfoPropertyName = "NullableUpdateHostedApiRouteRequestMethod2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] internal sealed partial class RoutesSourceGenerationContextChunk0 : global::System.Text.Json.Serialization.JsonSerializerContext { } @@ -158,6 +174,18 @@ public override bool CanConvert(global::System.Type typeToConvert) || typeToConvert == typeof(global::Speechify.CreateHostedApiRouteRequestMethod?) + || typeToConvert == typeof(global::Speechify.HostedApiMountToolKind) + + || typeToConvert == typeof(global::Speechify.HostedApiMountToolKind?) + + || typeToConvert == typeof(global::Speechify.HostedApiMountOperationAction) + + || typeToConvert == typeof(global::Speechify.HostedApiMountOperationAction?) + + || typeToConvert == typeof(global::Speechify.HostedApiMountOperationChangesItems) + + || typeToConvert == typeof(global::Speechify.HostedApiMountOperationChangesItems?) + || typeToConvert == typeof(global::Speechify.UpdateHostedApiRouteRequestMethod) || typeToConvert == typeof(global::Speechify.UpdateHostedApiRouteRequestMethod?); @@ -247,6 +275,36 @@ public override bool CanConvert(global::System.Type typeToConvert) return new global::Speechify.JsonConverters.CreateHostedApiRouteRequestMethodNullableJsonConverter(); } + if (typeToConvert == typeof(global::Speechify.HostedApiMountToolKind)) + { + return new global::Speechify.JsonConverters.HostedApiMountToolKindJsonConverter(); + } + + if (typeToConvert == typeof(global::Speechify.HostedApiMountToolKind?)) + { + return new global::Speechify.JsonConverters.HostedApiMountToolKindNullableJsonConverter(); + } + + if (typeToConvert == typeof(global::Speechify.HostedApiMountOperationAction)) + { + return new global::Speechify.JsonConverters.HostedApiMountOperationActionJsonConverter(); + } + + if (typeToConvert == typeof(global::Speechify.HostedApiMountOperationAction?)) + { + return new global::Speechify.JsonConverters.HostedApiMountOperationActionNullableJsonConverter(); + } + + if (typeToConvert == typeof(global::Speechify.HostedApiMountOperationChangesItems)) + { + return new global::Speechify.JsonConverters.HostedApiMountOperationChangesItemsJsonConverter(); + } + + if (typeToConvert == typeof(global::Speechify.HostedApiMountOperationChangesItems?)) + { + return new global::Speechify.JsonConverters.HostedApiMountOperationChangesItemsNullableJsonConverter(); + } + if (typeToConvert == typeof(global::Speechify.UpdateHostedApiRouteRequestMethod)) { return new global::Speechify.JsonConverters.UpdateHostedApiRouteRequestMethodJsonConverter(); diff --git a/src/libs/Speechify/Generated/Speechify.RoutesClient.CreateRoute.g.cs b/src/libs/Speechify/Generated/Speechify.RoutesClient.CreateRoute.g.cs index 260a0a08..5a3dbbc1 100644 --- a/src/libs/Speechify/Generated/Speechify.RoutesClient.CreateRoute.g.cs +++ b/src/libs/Speechify/Generated/Speechify.RoutesClient.CreateRoute.g.cs @@ -60,11 +60,13 @@ partial void ProcessCreateRouteResponseContent( /// 202 with a handle to poll at `/_runs/{run_id}`; `file` serves one
/// published file, or a whole published tree when the path ends in `*`
/// (`/app/*` with `file_root` and `file_index`); `tool` calls one read
- /// operation of an `openapi` tool definition in the API's project whose
- /// `approval` is null or `auto` (POST only, never on a public API, counted
- /// against `daily_read_cap`): the
- /// consumer's JSON body is the operation's arguments and the vendor's
- /// answer, after the operation's `response` mapping, is the response.
+ /// operation of an `openapi` tool definition, or one tool of an `mcp`
+ /// tool definition's server, in the API's project whose `approval` is
+ /// null or `auto` (POST only, never on a public API, counted against
+ /// `daily_read_cap`): the consumer's JSON body is the arguments and the
+ /// connector's answer, after the tool's response mapping, is the
+ /// response. An `mcp` route pins the tool's input schema as
+ /// `resolver.input_schema` when it is written.
/// Where-clause values and
/// the document id may be `{{query.x}}`, `{{path.x}}` or `{{body.x}}`
/// templates bound from the consumer's request, or `{{user.x}}` claims of
@@ -131,11 +133,13 @@ partial void ProcessCreateRouteResponseContent( /// 202 with a handle to poll at `/_runs/{run_id}`; `file` serves one
/// published file, or a whole published tree when the path ends in `*`
/// (`/app/*` with `file_root` and `file_index`); `tool` calls one read
- /// operation of an `openapi` tool definition in the API's project whose
- /// `approval` is null or `auto` (POST only, never on a public API, counted
- /// against `daily_read_cap`): the
- /// consumer's JSON body is the operation's arguments and the vendor's
- /// answer, after the operation's `response` mapping, is the response.
+ /// operation of an `openapi` tool definition, or one tool of an `mcp`
+ /// tool definition's server, in the API's project whose `approval` is
+ /// null or `auto` (POST only, never on a public API, counted against
+ /// `daily_read_cap`): the consumer's JSON body is the arguments and the
+ /// connector's answer, after the tool's response mapping, is the
+ /// response. An `mcp` route pins the tool's input schema as
+ /// `resolver.input_schema` when it is written.
/// Where-clause values and
/// the document id may be `{{query.x}}`, `{{path.x}}` or `{{body.x}}`
/// templates bound from the consumer's request, or `{{user.x}}` claims of
@@ -746,11 +750,13 @@ partial void ProcessCreateRouteResponseContent( /// 202 with a handle to poll at `/_runs/{run_id}`; `file` serves one
/// published file, or a whole published tree when the path ends in `*`
/// (`/app/*` with `file_root` and `file_index`); `tool` calls one read
- /// operation of an `openapi` tool definition in the API's project whose
- /// `approval` is null or `auto` (POST only, never on a public API, counted
- /// against `daily_read_cap`): the
- /// consumer's JSON body is the operation's arguments and the vendor's
- /// answer, after the operation's `response` mapping, is the response.
+ /// operation of an `openapi` tool definition, or one tool of an `mcp`
+ /// tool definition's server, in the API's project whose `approval` is
+ /// null or `auto` (POST only, never on a public API, counted against
+ /// `daily_read_cap`): the consumer's JSON body is the arguments and the
+ /// connector's answer, after the tool's response mapping, is the
+ /// response. An `mcp` route pins the tool's input schema as
+ /// `resolver.input_schema` when it is written.
/// Where-clause values and
/// the document id may be `{{query.x}}`, `{{path.x}}` or `{{body.x}}`
/// templates bound from the consumer's request, or `{{user.x}}` claims of
@@ -815,27 +821,47 @@ partial void ProcessCreateRouteResponseContent( /// `run` (trigger_id of a webhook trigger, wait_seconds),
/// `file` (file_path of one published file; or, on a route whose path
/// ends in `*`, file_root and file_index for a whole published tree),
- /// `tool` (tool_id of an `openapi` tool definition and the `operation`
- /// on it: the POST body is the operation's arguments, held to its
- /// argument schema, and the vendor's answer after the operation's
- /// `response` mapping is the response, or `{"text": ...}` when the vendor
- /// answered text. Only an operation whose effective class is `read`, on a
- /// tool whose `approval` is null or `auto`, may be served, and never on a
- /// public API; a route write that names anything else is refused with 400
- /// `validation_failed` on `resolver.tool_id`. Because a definition can
- /// change after its route is written, every call re-checks it: an
- /// operation no longer classified `read`, or a tool whose `approval` is no
- /// longer null or `auto`, answers 403 `route_tool_not_readable`; a tool
- /// deleted, moved to another project, no longer of kind `openapi` or
- /// without the operation answers 409 `route_tool_unavailable`, which no
+ /// `tool` (tool_id of an `openapi` or `mcp` tool definition and the
+ /// `operation` on it, an openapi operation's id or one of the MCP
+ /// server's tools by name: the POST body is the arguments, held to their
+ /// schema, and the connector's answer after the tool's response mapping
+ /// is the response. An openapi vendor's JSON comes back as it came, or
+ /// `{"text": ...}` when it answered text; an MCP tool answers its
+ /// structured content, its text when that text is JSON, `{"text": ...}`
+ /// for plain text, or `{"content": [...]}` with every block as the server
+ /// sent it when one is not text. For an `mcp` tool the route write lists
+ /// the server's tools and pins the chosen tool's input schema on the
+ /// route as `input_schema`, so the MCP face and every call use the pin
+ /// and an upstream change reaches no consumer until the route is written
+ /// again. An operation whose effective class is `read`, on a tool whose
+ /// `approval` is null or `auto`, may be served on any API but a public
+ /// one. An operation that is not a read is served only on a route with
+ /// `allow_write: true`, on an API whose `auth_mode` names a person
+ /// (`owner`, `workspace` or `user_token`), and still only with an
+ /// `approval` of null or `auto`: a write through a route acts for the
+ /// member or end user calling, who is sent to the connector as
+ /// `Speechify-User-Identity`, a service account is refused, every write
+ /// counts against `daily_write_cap` (429 `route_write_limit_reached`) and
+ /// claims the caller's `Idempotency-Key` so a retry replays the first
+ /// answer. A route write that breaks any of this is refused with 400
+ /// `validation_failed` on `resolver.tool_id`, `resolver.operation` or
+ /// `resolver.allow_write`, as is an MCP server that cannot be listed.
+ /// Because a definition can change after its route is written, every call
+ /// re-checks it: an operation no longer classified `read` on a route not
+ /// switched to writes, or a tool whose `approval` is no longer null or
+ /// `auto`, answers 403 `route_tool_not_readable`; a tool
+ /// deleted, moved to another project, or without the operation (an MCP
+ /// server that no longer lists the tool) answers 409
+ /// `route_tool_unavailable`, which no
/// retry clears until the route or the tool is fixed. Arguments that do
/// not fit the schema answer 400 `validation_failed`; the definition's
/// `max_requests_per_minute` and the vendor's own throttle both answer 429
/// `route_upstream_rate_limited` with `Retry-After`; a vendor error
/// answers 502 `route_upstream_error` with the vendor's status in
- /// `error.details.upstream_status`, and an unreachable vendor or a
- /// credential that no longer resolves answers 502 `route_upstream_error`
- /// without it). + /// `error.details.upstream_status`, an MCP tool that reports an error
+ /// answers it with the tool's own message in `error.details.tool_error`,
+ /// and an unreachable vendor or a credential that no longer resolves
+ /// answers 502 `route_upstream_error` without either). /// /// /// diff --git a/src/libs/Speechify/Generated/Speechify.RoutesClient.MountRoutes.g.cs b/src/libs/Speechify/Generated/Speechify.RoutesClient.MountRoutes.g.cs new file mode 100644 index 00000000..0e9a284d --- /dev/null +++ b/src/libs/Speechify/Generated/Speechify.RoutesClient.MountRoutes.g.cs @@ -0,0 +1,821 @@ + +#nullable enable + +namespace Speechify +{ + public partial class RoutesClient + { + + + private static readonly global::Speechify.EndPointSecurityRequirement s_MountRoutesSecurityRequirement0 = + new global::Speechify.EndPointSecurityRequirement + { + Authorizations = new global::Speechify.EndPointAuthorizationRequirement[] + { new global::Speechify.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::Speechify.EndPointSecurityRequirement[] s_MountRoutesSecurityRequirements = + new global::Speechify.EndPointSecurityRequirement[] + { s_MountRoutesSecurityRequirement0, + }; + partial void PrepareMountRoutesArguments( + global::System.Net.Http.HttpClient httpClient, + ref string apiId, + ref string? speechifyVersion, + ref string? idempotencyKey, + global::Speechify.MountHostedAPIRoutesRequest request); + partial void PrepareMountRoutesRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string apiId, + string? speechifyVersion, + string? idempotencyKey, + global::Speechify.MountHostedAPIRoutesRequest request); + partial void ProcessMountRoutesResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessMountRoutesResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Mount a Connector
+ /// Publish a connector's operations onto the API in one call: one `tool`
+ /// route per operation of an `openapi` tool definition, or per tool its
+ /// `mcp` server lists, named `<name_prefix>__<operation>` at
+ /// `<path_prefix>/<operation>`, so two connectors' tools stay apart on
+ /// the MCP face and inside its 64-character tool names.
+ /// Send `dry_run: true` first. The answer lists every operation with
+ /// its effective `action_class` and `approval`, whether a route can serve
+ /// it, and the `action` a mount takes: `create`, `update` (an MCP tool
+ /// whose input schema changed since its route was written; `changes`
+ /// names what), `unchanged`, `skip` (with the `reason`: not selected, not
+ /// a read, not auto-approved, a name or path already taken, or the route
+ /// cap) or `stale` (a route whose operation the connector no longer
+ /// offers, or can no longer serve; it is reported and never deleted,
+ /// since a consumer may still call it). The same call without `dry_run`
+ /// writes every create and update in one transaction and returns the
+ /// written `route` on each.
+ /// Mounting again is the refresh. Every route the API holds for the
+ /// connector is compared with what it offers now, whatever its name,
+ /// path or the selection, so an upstream change is seen as a diff before
+ /// anyone's client sees it. `operations` selects what to create; omit it
+ /// to create a route for every operation a route can serve. A route an
+ /// owner renamed or moved keeps its name and path on refresh.
+ /// The route write's rules apply to every operation: the connector must
+ /// be in the API's project (409 `cross_project_reference`), an MCP server
+ /// must be reachable with its credential to be listed (400
+ /// `validation_failed` on `tool_id` with the server's reason), and a
+ /// public API mounts nothing. An API holds at most 200 routes; a mount
+ /// that would pass the cap skips what does not fit. A route changed while
+ /// the mount was being planned answers 409 `api_route_conflict`; mount
+ /// again.
+ /// Dark launch: requires the `hosted_apis_access` entitlement (402 `hosted_apis_not_in_plan` otherwise). + ///
+ /// + /// + /// + /// Optional idempotency key. When omitted, the SDK generates one for this request. + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task MountRoutesAsync( + string apiId, + + global::Speechify.MountHostedAPIRoutesRequest request, + string? speechifyVersion = default, + string? idempotencyKey = default, + global::Speechify.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await MountRoutesAsResponseAsync( + apiId: apiId, + + request: request, + speechifyVersion: speechifyVersion, + idempotencyKey: idempotencyKey, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Mount a Connector
+ /// Publish a connector's operations onto the API in one call: one `tool`
+ /// route per operation of an `openapi` tool definition, or per tool its
+ /// `mcp` server lists, named `<name_prefix>__<operation>` at
+ /// `<path_prefix>/<operation>`, so two connectors' tools stay apart on
+ /// the MCP face and inside its 64-character tool names.
+ /// Send `dry_run: true` first. The answer lists every operation with
+ /// its effective `action_class` and `approval`, whether a route can serve
+ /// it, and the `action` a mount takes: `create`, `update` (an MCP tool
+ /// whose input schema changed since its route was written; `changes`
+ /// names what), `unchanged`, `skip` (with the `reason`: not selected, not
+ /// a read, not auto-approved, a name or path already taken, or the route
+ /// cap) or `stale` (a route whose operation the connector no longer
+ /// offers, or can no longer serve; it is reported and never deleted,
+ /// since a consumer may still call it). The same call without `dry_run`
+ /// writes every create and update in one transaction and returns the
+ /// written `route` on each.
+ /// Mounting again is the refresh. Every route the API holds for the
+ /// connector is compared with what it offers now, whatever its name,
+ /// path or the selection, so an upstream change is seen as a diff before
+ /// anyone's client sees it. `operations` selects what to create; omit it
+ /// to create a route for every operation a route can serve. A route an
+ /// owner renamed or moved keeps its name and path on refresh.
+ /// The route write's rules apply to every operation: the connector must
+ /// be in the API's project (409 `cross_project_reference`), an MCP server
+ /// must be reachable with its credential to be listed (400
+ /// `validation_failed` on `tool_id` with the server's reason), and a
+ /// public API mounts nothing. An API holds at most 200 routes; a mount
+ /// that would pass the cap skips what does not fit. A route changed while
+ /// the mount was being planned answers 409 `api_route_conflict`; mount
+ /// again.
+ /// Dark launch: requires the `hosted_apis_access` entitlement (402 `hosted_apis_not_in_plan` otherwise). + ///
+ /// + /// + /// + /// Optional idempotency key. When omitted, the SDK generates one for this request. + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> MountRoutesAsResponseAsync( + string apiId, + + global::Speechify.MountHostedAPIRoutesRequest request, + string? speechifyVersion = default, + string? idempotencyKey = default, + global::Speechify.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + request = request ?? throw new global::System.ArgumentNullException(nameof(request)); + + PrepareArguments( + client: HttpClient); + PrepareMountRoutesArguments( + httpClient: HttpClient, + apiId: ref apiId, + speechifyVersion: ref speechifyVersion, + idempotencyKey: ref idempotencyKey, + request: request); + + + var __authorizations = global::Speechify.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_MountRoutesSecurityRequirements, + operationName: "MountRoutesAsync"); + + using var __timeoutCancellationTokenSource = global::Speechify.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::Speechify.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::Speechify.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::Speechify.PathBuilder( + path: $"/v1/apis/{apiId}/routes/mount", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::Speechify.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + + if (speechifyVersion != default) + { + __httpRequest.Headers.TryAddWithoutValidation("Speechify-Version", speechifyVersion.ToString()); + } + var __idempotencyKey = global::System.String.IsNullOrWhiteSpace(idempotencyKey) + ? CreateIdempotencyKey() + : idempotencyKey; + __httpRequest.Headers.TryAddWithoutValidation("Idempotency-Key", __idempotencyKey); + + var __httpRequestContentBody = request.ToJson(JsonSerializerContext); + var __httpRequestContent = new global::System.Net.Http.StringContent( + content: __httpRequestContentBody, + encoding: global::System.Text.Encoding.UTF8, + mediaType: "application/json"); + __httpRequest.Content = __httpRequestContent; + global::Speechify.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareMountRoutesRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + apiId: apiId!, + speechifyVersion: speechifyVersion, + idempotencyKey: idempotencyKey, + request: request); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::Speechify.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::Speechify.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "MountRoutes", + methodName: "MountRoutesAsync", + pathTemplate: "$\"/v1/apis/{apiId}/routes/mount\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::Speechify.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::Speechify.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Speechify.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "MountRoutes", + methodName: "MountRoutesAsync", + pathTemplate: "$\"/v1/apis/{apiId}/routes/mount\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::Speechify.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::Speechify.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::Speechify.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::Speechify.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Speechify.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "MountRoutes", + methodName: "MountRoutesAsync", + pathTemplate: "$\"/v1/apis/{apiId}/routes/mount\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::Speechify.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessMountRoutesResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::Speechify.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::Speechify.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "MountRoutes", + methodName: "MountRoutesAsync", + pathTemplate: "$\"/v1/apis/{apiId}/routes/mount\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::Speechify.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Speechify.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "MountRoutes", + methodName: "MountRoutesAsync", + pathTemplate: "$\"/v1/apis/{apiId}/routes/mount\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + // The request was malformed or failed validation. The response body is the standard `Error` envelope; for validation failures `error.fields` enumerates the offending fields as a `path -> message` map (code = `validation_failed`). + if ((int)__response.StatusCode == 400) + { + string? __content_400 = null; + global::System.Exception? __exception_400 = null; + global::Speechify.Error? __value_400 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_400 = global::Speechify.Error.FromJson(__content_400, JsonSerializerContext); + } + else + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_400 = global::Speechify.Error.FromJson(__content_400, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_400 = __ex; + } + + + throw global::Speechify.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_400, + responseBody: __content_400, + responseObject: __value_400, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Authentication is missing or invalid. The request did not carry a recognised credential (console session token, API key, or worker JWT). + if ((int)__response.StatusCode == 401) + { + string? __content_401 = null; + global::System.Exception? __exception_401 = null; + global::Speechify.Error? __value_401 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_401 = global::Speechify.Error.FromJson(__content_401, JsonSerializerContext); + } + else + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_401 = global::Speechify.Error.FromJson(__content_401, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_401 = __ex; + } + + + throw global::Speechify.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_401, + responseBody: __content_401, + responseObject: __value_401, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + 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.Error? __value_402 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_402 = global::Speechify.Error.FromJson(__content_402, JsonSerializerContext); + } + else + { + __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_402 = global::Speechify.Error.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 referenced resource does not exist or is not visible to the caller's workspace. + if ((int)__response.StatusCode == 404) + { + string? __content_404 = null; + global::System.Exception? __exception_404 = null; + global::Speechify.Error? __value_404 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_404 = global::Speechify.Error.FromJson(__content_404, JsonSerializerContext); + } + else + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_404 = global::Speechify.Error.FromJson(__content_404, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_404 = __ex; + } + + + throw global::Speechify.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_404, + responseBody: __content_404, + responseObject: __value_404, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // The request conflicts with the current resource state - e.g. duplicate, optimistic-concurrency mismatch, or last-owner guard. + if ((int)__response.StatusCode == 409) + { + string? __content_409 = null; + global::System.Exception? __exception_409 = null; + global::Speechify.Error? __value_409 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_409 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_409 = global::Speechify.Error.FromJson(__content_409, JsonSerializerContext); + } + else + { + __content_409 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_409 = global::Speechify.Error.FromJson(__content_409, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_409 = __ex; + } + + + throw global::Speechify.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_409 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_409, + responseBody: __content_409, + responseObject: __value_409, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessMountRoutesResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::Speechify.HostedAPIMount.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Speechify.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Speechify.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::Speechify.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + var __value = await global::Speechify.HostedAPIMount.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Speechify.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Speechify.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::Speechify.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + /// + /// Mount a Connector
+ /// Publish a connector's operations onto the API in one call: one `tool`
+ /// route per operation of an `openapi` tool definition, or per tool its
+ /// `mcp` server lists, named `<name_prefix>__<operation>` at
+ /// `<path_prefix>/<operation>`, so two connectors' tools stay apart on
+ /// the MCP face and inside its 64-character tool names.
+ /// Send `dry_run: true` first. The answer lists every operation with
+ /// its effective `action_class` and `approval`, whether a route can serve
+ /// it, and the `action` a mount takes: `create`, `update` (an MCP tool
+ /// whose input schema changed since its route was written; `changes`
+ /// names what), `unchanged`, `skip` (with the `reason`: not selected, not
+ /// a read, not auto-approved, a name or path already taken, or the route
+ /// cap) or `stale` (a route whose operation the connector no longer
+ /// offers, or can no longer serve; it is reported and never deleted,
+ /// since a consumer may still call it). The same call without `dry_run`
+ /// writes every create and update in one transaction and returns the
+ /// written `route` on each.
+ /// Mounting again is the refresh. Every route the API holds for the
+ /// connector is compared with what it offers now, whatever its name,
+ /// path or the selection, so an upstream change is seen as a diff before
+ /// anyone's client sees it. `operations` selects what to create; omit it
+ /// to create a route for every operation a route can serve. A route an
+ /// owner renamed or moved keeps its name and path on refresh.
+ /// The route write's rules apply to every operation: the connector must
+ /// be in the API's project (409 `cross_project_reference`), an MCP server
+ /// must be reachable with its credential to be listed (400
+ /// `validation_failed` on `tool_id` with the server's reason), and a
+ /// public API mounts nothing. An API holds at most 200 routes; a mount
+ /// that would pass the cap skips what does not fit. A route changed while
+ /// the mount was being planned answers 409 `api_route_conflict`; mount
+ /// again.
+ /// Dark launch: requires the `hosted_apis_access` entitlement (402 `hosted_apis_not_in_plan` otherwise). + ///
+ /// + /// + /// + /// Optional idempotency key. When omitted, the SDK generates one for this request. + /// + /// + /// The `openapi` or `mcp` tool definition to mount, in the API's project. + /// + /// + /// The operations to create routes for: openapi operation ids or the
+ /// MCP server's tool names. Omit to create a route for every operation
+ /// a route can serve. Naming one the connector does not offer is 400
+ /// `validation_failed` on `operations[i]`. Existing routes are compared
+ /// whatever the selection. + /// + /// + /// Prefix of each created route's name, `<name_prefix>__<operation>`. Defaults to the tool's name with other characters as `_`. + /// + /// + /// Path each created route sits under, `<path_prefix>/<operation>`; lowercase segments of letters, digits, `.`, `_` or `-`, with no `{param}` or `*`, and not under `/mcp`, `/openapi.json` or `/_runs`. Defaults to `/<name_prefix>` in lowercase. + /// + /// + /// Answer what the mount would do and write nothing. + /// + /// + /// Create routes for operations that are not reads too, each with
+ /// `allow_write: true`. Only an API whose `auth_mode` names a person
+ /// takes them; the operation's `approval` must still be `auto`.
+ /// Without it a write is a `skip` that says so. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task MountRoutesAsync( + string apiId, + string toolId, + string? speechifyVersion = default, + string? idempotencyKey = default, + global::System.Collections.Generic.IList? operations = default, + string? namePrefix = default, + string? pathPrefix = default, + bool? dryRun = default, + bool? includeWrites = default, + global::Speechify.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __request = new global::Speechify.MountHostedAPIRoutesRequest + { + ToolId = toolId, + Operations = operations, + NamePrefix = namePrefix, + PathPrefix = pathPrefix, + DryRun = dryRun, + IncludeWrites = includeWrites, + }; + + return await MountRoutesAsync( + apiId: apiId, + speechifyVersion: speechifyVersion, + idempotencyKey: idempotencyKey, + request: __request, + requestOptions: requestOptions, + cancellationToken: cancellationToken).ConfigureAwait(false); + } + } +} \ No newline at end of file diff --git a/src/libs/Speechify/Generated/Speechify.RoutesClient.UpdateRoute.g.cs b/src/libs/Speechify/Generated/Speechify.RoutesClient.UpdateRoute.g.cs index 4c9702c4..785f85d1 100644 --- a/src/libs/Speechify/Generated/Speechify.RoutesClient.UpdateRoute.g.cs +++ b/src/libs/Speechify/Generated/Speechify.RoutesClient.UpdateRoute.g.cs @@ -695,27 +695,47 @@ partial void ProcessUpdateRouteResponseContent( /// `run` (trigger_id of a webhook trigger, wait_seconds),
/// `file` (file_path of one published file; or, on a route whose path
/// ends in `*`, file_root and file_index for a whole published tree),
- /// `tool` (tool_id of an `openapi` tool definition and the `operation`
- /// on it: the POST body is the operation's arguments, held to its
- /// argument schema, and the vendor's answer after the operation's
- /// `response` mapping is the response, or `{"text": ...}` when the vendor
- /// answered text. Only an operation whose effective class is `read`, on a
- /// tool whose `approval` is null or `auto`, may be served, and never on a
- /// public API; a route write that names anything else is refused with 400
- /// `validation_failed` on `resolver.tool_id`. Because a definition can
- /// change after its route is written, every call re-checks it: an
- /// operation no longer classified `read`, or a tool whose `approval` is no
- /// longer null or `auto`, answers 403 `route_tool_not_readable`; a tool
- /// deleted, moved to another project, no longer of kind `openapi` or
- /// without the operation answers 409 `route_tool_unavailable`, which no
+ /// `tool` (tool_id of an `openapi` or `mcp` tool definition and the
+ /// `operation` on it, an openapi operation's id or one of the MCP
+ /// server's tools by name: the POST body is the arguments, held to their
+ /// schema, and the connector's answer after the tool's response mapping
+ /// is the response. An openapi vendor's JSON comes back as it came, or
+ /// `{"text": ...}` when it answered text; an MCP tool answers its
+ /// structured content, its text when that text is JSON, `{"text": ...}`
+ /// for plain text, or `{"content": [...]}` with every block as the server
+ /// sent it when one is not text. For an `mcp` tool the route write lists
+ /// the server's tools and pins the chosen tool's input schema on the
+ /// route as `input_schema`, so the MCP face and every call use the pin
+ /// and an upstream change reaches no consumer until the route is written
+ /// again. An operation whose effective class is `read`, on a tool whose
+ /// `approval` is null or `auto`, may be served on any API but a public
+ /// one. An operation that is not a read is served only on a route with
+ /// `allow_write: true`, on an API whose `auth_mode` names a person
+ /// (`owner`, `workspace` or `user_token`), and still only with an
+ /// `approval` of null or `auto`: a write through a route acts for the
+ /// member or end user calling, who is sent to the connector as
+ /// `Speechify-User-Identity`, a service account is refused, every write
+ /// counts against `daily_write_cap` (429 `route_write_limit_reached`) and
+ /// claims the caller's `Idempotency-Key` so a retry replays the first
+ /// answer. A route write that breaks any of this is refused with 400
+ /// `validation_failed` on `resolver.tool_id`, `resolver.operation` or
+ /// `resolver.allow_write`, as is an MCP server that cannot be listed.
+ /// Because a definition can change after its route is written, every call
+ /// re-checks it: an operation no longer classified `read` on a route not
+ /// switched to writes, or a tool whose `approval` is no longer null or
+ /// `auto`, answers 403 `route_tool_not_readable`; a tool
+ /// deleted, moved to another project, or without the operation (an MCP
+ /// server that no longer lists the tool) answers 409
+ /// `route_tool_unavailable`, which no
/// retry clears until the route or the tool is fixed. Arguments that do
/// not fit the schema answer 400 `validation_failed`; the definition's
/// `max_requests_per_minute` and the vendor's own throttle both answer 429
/// `route_upstream_rate_limited` with `Retry-After`; a vendor error
/// answers 502 `route_upstream_error` with the vendor's status in
- /// `error.details.upstream_status`, and an unreachable vendor or a
- /// credential that no longer resolves answers 502 `route_upstream_error`
- /// without it). + /// `error.details.upstream_status`, an MCP tool that reports an error
+ /// answers it with the tool's own message in `error.details.tool_error`,
+ /// and an unreachable vendor or a credential that no longer resolves
+ /// answers 502 `route_upstream_error` without either). /// /// /// diff --git a/src/libs/Speechify/openapi.yaml b/src/libs/Speechify/openapi.yaml index bb82993a..729caae5 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":"audio_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 JSON response.\nFor low-latency playback or long-form text, use POST /v1/audio/stream.\nSet `output_format` for explicit sample-rate/bitrate control (e.g.\n`pcm_16000` or `ulaw_8000` for telephony).","tags":["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":"Speechify-Version","in":"header","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Synthesized speech audio for the requested input.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/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/Error"}}}},"401":{"description":"Authentication is missing or invalid. The request did not\ncarry a recognised credential (console session token, API key,\nor worker JWT).\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/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/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/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/Error"}}}},"409":{"description":"The request conflicts with the current resource state - e.g.\nduplicate, optimistic-concurrency mismatch, or last-owner\nguard.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit or concurrency limit exceeded. `error.code` says which\nceiling, and they need different responses: `rate_limited` is the\nrequest-rate budget (slow down), `concurrency_limit_reached` is a\nworkspace-wide concurrency ceiling (fewer at once, or raise it), and\n`conversation_turn_in_progress` is contention over one named\nconversation (keep one message in flight on it). Every 429 carries\n`Retry-After` and the request-rate budget headers; the active-call cap\nalso carries `RateLimit-Remaining-Calls: 0`.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/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/Error"}}}},"502":{"description":"An upstream dependency (the TTS composer or voice-metadata\nservice) returned a 5xx. The raw upstream detail is not\nforwarded - the cause is in the server log; the response is a\nfixed `upstream_failure` envelope. Safe to retry.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"A downstream dependency is degraded or the endpoint is\nintentionally disabled (e.g. phone-number purchase before\nops setup).\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetSpeechRequest"}}}}}},"/v1/audio/stream":{"post":{"operationId":"audio_stream","summary":"Stream Speech","description":"Synthesize speech and stream the audio back as it is generated, for\nlow-latency playback. Set `output_format` in the body for explicit\ncodec/sample-rate/bitrate control (e.g. `pcm_16000` or `ulaw_8000` for\ntelephony), or fall back to the Accept header for the container; the\nresponse is raw audio bytes (HTTP chunked). For Base64-encoded audio\nwith speech-mark metadata in a single JSON response, use\nPOST /v1/audio/speech.","tags":["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":"Speechify-Version","in":"header","required":false,"schema":{"type":"string"}},{"name":"Accept","in":"header","description":"Selects the audio container/codec for the streamed response when\n`output_format` is not set in the request body. The response\nContent-Type echoes this value, except `audio/pcm` returns\n`audio/L16` with rate and channels parameters (raw 16-bit linear\nPCM, 24 kHz mono, little-endian). For explicit sample-rate/bitrate\ncontrol (e.g. `pcm_16000`, `ulaw_8000`), set `output_format` in the\nbody instead; it takes precedence over this header.","required":false,"schema":{"$ref":"#/components/schemas/V1AudioStreamPostParametersAccept"}}],"responses":{"200":{"description":"Streamed audio. When `output_format` is set it selects the\ncodec/sample rate; otherwise the Accept header does. The\nContent-Type reflects the selected format: it matches the Accept\nheader, except raw PCM returns `audio/L16` (with rate and channels\nparameters) and u-law returns `audio/basic`.","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/Error"}}}},"401":{"description":"Authentication is missing or invalid. The request did not\ncarry a recognised credential (console session token, API key,\nor worker JWT).\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/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/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/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/Error"}}}},"409":{"description":"The request conflicts with the current resource state - e.g.\nduplicate, optimistic-concurrency mismatch, or last-owner\nguard.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit or concurrency limit exceeded. `error.code` says which\nceiling, and they need different responses: `rate_limited` is the\nrequest-rate budget (slow down), `concurrency_limit_reached` is a\nworkspace-wide concurrency ceiling (fewer at once, or raise it), and\n`conversation_turn_in_progress` is contention over one named\nconversation (keep one message in flight on it). Every 429 carries\n`Retry-After` and the request-rate budget headers; the active-call cap\nalso carries `RateLimit-Remaining-Calls: 0`.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/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/Error"}}}},"502":{"description":"An upstream dependency (the TTS composer or voice-metadata\nservice) returned a 5xx. The raw upstream detail is not\nforwarded - the cause is in the server log; the response is a\nfixed `upstream_failure` envelope. Safe to retry.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"A downstream dependency is degraded or the endpoint is\nintentionally disabled (e.g. phone-number purchase before\nops setup).\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetStreamRequest"}}}}}},"/v1/audio/stream/with-timestamps":{"post":{"operationId":"audio_streamWithTimestamps","summary":"Stream Speech With Timestamps","description":"Synthesize speech and stream it back together with word-level speech\nmarks, for text highlighting, captions and audio-text synchronization\nwhile the audio is still arriving.\n\nThe response is a Server-Sent Events stream. Each `speech.chunk` event\ncarries a Base64-encoded run of audio, the speech marks that became\nfinal with it, or both - a chunk may carry only one of the two, and the\nlast chunk of a stream is often marks-only. A terminal `speech.done`\nevent ends the stream; there is no `[DONE]` sentinel. Ignore any event\ntype you do not recognize, so that new event types do not break your\nintegration.\n\nSpeech-mark times are absolute milliseconds from the start of the\nsynthesis, so concatenate the audio chunks into one stream and apply the\nmarks against that single timeline. Which chunk a mark arrives on is a\ndelivery detail and carries no meaning. Times stay correct for every\n`output_format`: changing the codec or sample rate does not change the\nduration.\n\nSpeech marks are produced by the streaming-native models. The default\n`simba-3.0` and `simba-3.2` both serve this route. The legacy\n`simba-english` and `simba-multilingual` models never could: on a\nworkspace pinned before API version `2026-09-21` they return 400\n`speech_marks_unsupported` here, and from that version on they return\n400 `model_retired` on every synthesis route. Both are switched off\nentirely on 2026-11-21.\nFor Base64-encoded audio and speech marks in one non-streamed JSON\nresponse, on any model, use POST /v1/audio/speech.","tags":["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":"Speechify-Version","in":"header","required":false,"schema":{"type":"string"}},{"name":"Accept","in":"header","description":"Selects the audio container/codec carried inside the events when\n`output_format` is not set in the request body. The selected media\ntype is echoed on the `Speechify-Audio-Content-Type` response\nheader, since the response's own Content-Type is `text/event-stream`.","required":false,"schema":{"$ref":"#/components/schemas/V1AudioStreamWithTimestampsPostParametersAccept"}}],"responses":{"200":{"description":"A Server-Sent Events stream of `speech.chunk` events followed by one\nterminal `speech.done` event. A failure after the stream has started\nis delivered as a `speech.error` event carrying the standard error\nenvelope, because the status code is already committed.\n\nThe transport is `text/event-stream`: each event is an\n`event:`/`data:` pair whose `data` is one JSON payload matching the\nschema below. The payload's `type` field mirrors the `event:` name,\nso the stream is also parseable from `data:` lines alone. Ignore\nevent types you do not recognize.","content":{"text/event-stream":{"schema":{"$ref":"#/components/schemas/SpeechStreamEvent"}}}},"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/Error"}}}},"401":{"description":"Authentication is missing or invalid. The request did not\ncarry a recognised credential (console session token, API key,\nor worker JWT).\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/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/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/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/Error"}}}},"409":{"description":"The request conflicts with the current resource state - e.g.\nduplicate, optimistic-concurrency mismatch, or last-owner\nguard.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit or concurrency limit exceeded. `error.code` says which\nceiling, and they need different responses: `rate_limited` is the\nrequest-rate budget (slow down), `concurrency_limit_reached` is a\nworkspace-wide concurrency ceiling (fewer at once, or raise it), and\n`conversation_turn_in_progress` is contention over one named\nconversation (keep one message in flight on it). Every 429 carries\n`Retry-After` and the request-rate budget headers; the active-call cap\nalso carries `RateLimit-Remaining-Calls: 0`.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/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/Error"}}}},"502":{"description":"An upstream dependency (the TTS composer or voice-metadata\nservice) returned a 5xx. The raw upstream detail is not\nforwarded - the cause is in the server log; the response is a\nfixed `upstream_failure` envelope. Safe to retry.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"A downstream dependency is degraded or the endpoint is\nintentionally disabled (e.g. phone-number purchase before\nops setup).\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetStreamRequest"}}}}}},"/v1/voices":{"get":{"operationId":"voices_list","summary":"List Voices","description":"Lists the voices available to the caller - the shared voice\ncatalog plus the cloned voices they can reach, whichever member or\nservice-account key created them. A clone filed under a project is\nlisted only for a caller who can reach that project; a clone no\nproject filed is shared with the whole workspace and is listed for\neveryone in it. By default\nthe full catalogue is returned in one response. Pagination is\nopt-in: pass `limit` (and then `cursor` from the previous\nresponse) to page through the list while `has_more` is true. Max\npage size is 200. Narrow the list with the `type` and `locale`\nfilters.\n\nA page can come back with fewer than `limit` voices, and a short\npage - an empty one included - is not the end of the list. Keep\nfollowing `next_cursor` while `has_more` is true.","tags":["voices"],"parameters":[{"name":"cursor","in":"query","description":"Opaque pagination cursor from a previous response.","required":false,"schema":{"type":"string"}},{"name":"limit","in":"query","description":"Max items per page (default 50, max 200).","required":false,"schema":{"type":"integer","minimum":1,"maximum":200,"default":50}},{"name":"type","in":"query","description":"Filter by voice type: `personal` (the workspace's cloned voices)\nor `shared` (the public catalogue). Omit to return both.","required":false,"schema":{"$ref":"#/components/schemas/V1VoicesGetParametersType"}},{"name":"locale","in":"query","description":"Filter to voices whose locale matches this BCP-47 language range,\nprefix-matched: `en` matches `en-US` and `en-GB`; `en-US` matches\nonly `en-US`. Case-insensitive. Omit to return all locales.","required":false,"schema":{"type":"string"}},{"name":"gender","in":"query","description":"Filter by voice gender. Omit to return all genders.","required":false,"schema":{"$ref":"#/components/schemas/V1VoicesGetParametersGender"}},{"name":"model","in":"query","description":"Filter to voices that support this model (as listed in each voice's\n`models[]`), e.g. `simba-3.2`. Omit to return voices for all models.","required":false,"schema":{"type":"string"}},{"name":"project_id","in":"query","description":"Filter cloned voices by workspace project: omit for every voice you\ncan reach, pass the literal `shared` for the clones no project\nfiled, or a `proj_...` id for the clones filed under that project.\nThe shared catalog carries no project and is returned either way.\n\nA clone is filed under a project when a project-pinned key created\nit. A clone with no project is shared with the whole workspace\nrather than sitting in a Default project, so the literal here is\n`shared`, never `default` - passing `default` is a 400. Returns 404\nproject_not_found for a malformed id and for any project outside\nyour reach: a project-pinned key reaches only its pinned project,\nand a member holding project grants reaches only the granted ones.\nThat 404 is the same in every case and does not reveal whether such\na project exists. `shared` is always inside your reach.\n","required":false,"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"}},{"name":"Speechify-Version","in":"header","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"The voice catalogue (or a page of it when `limit` is set).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListVoicesResponse"}}}},"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/Error"}}}},"401":{"description":"Authentication is missing or invalid. The request did not\ncarry a recognised credential (console session token, API key,\nor worker JWT).\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/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/Error"}}}},"429":{"description":"Rate limit or concurrency limit exceeded. `error.code` says which\nceiling, and they need different responses: `rate_limited` is the\nrequest-rate budget (slow down), `concurrency_limit_reached` is a\nworkspace-wide concurrency ceiling (fewer at once, or raise it), and\n`conversation_turn_in_progress` is contention over one named\nconversation (keep one message in flight on it). Every 429 carries\n`Retry-After` and the request-rate budget headers; the active-call cap\nalso carries `RateLimit-Remaining-Calls: 0`.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/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/Error"}}}}}},"post":{"operationId":"voices_create","summary":"Create Voice","description":"Create a cloned voice for the workspace from a 10-30 second audio sample, with verified consent from the speaker.\n\nCloning requires proof that the speaker agreed to it. Create a consent challenge with `POST /v1/voices/consent-challenges`, show the returned `phrase` to the speaker, record them reading it aloud, and send that recording here as `consent_recording` together with the challenge's `consent_challenge_id`. Speechify transcribes the recording, checks it against the phrase it issued, checks that its speaker is the speaker in your `sample`, and keeps it as the consent record for the voice. The person consenting therefore has to be the person being cloned. A challenge is single use and short-lived, so record and submit in one sitting.\n\nThe clone belongs to the workspace rather than the member who created it, and access follows the caller's workspace role and API-key scopes exactly as for any other voice: voices scopes to list it, audio scopes to synthesize with it, and the content-management permission plus a write scope on the key to delete it. Cloned voices are usable self-serve on `simba-3.0` (and, on a workspace pinned before API version `2026-09-21`, on the retired `simba-english` and `simba-multilingual` until they are switched off on 2026-11-21). `simba-3.2` also serves cloned voices.\n\nCallers pinned before `Speechify-Version: 2026-09-13` use the previous flow instead: no challenge, and a `consent` form field carrying the speaker's name and email as a JSON string. That flow is deprecated and will be removed after a sunset window announced in the changelog.","tags":["voices"],"parameters":[{"name":"Authorization","in":"header","description":"Enter your API key with the `Bearer` prefix, e.g. 'Bearer sk_...'.","required":true,"schema":{"type":"string"}},{"name":"Speechify-Version","in":"header","required":false,"schema":{"type":"string"}},{"name":"Idempotency-Key","in":"header","description":"A client-generated key (an opaque string, max 255 chars) that makes a\nside-effect POST safe to retry: the server runs the operation exactly\nonce and replays the first response (its status and body) for 24 hours.\nReusing a key with a different request body, or while the first request\nis still in flight, returns `409 idempotency_conflict`. A replayed\nresponse carries the `Idempotent-Replayed: true` header.\n","required":false,"schema":{"type":"string","maxLength":255}}],"responses":{"201":{"description":"A created voice","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetVoice"}}}},"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/Error"}}}},"401":{"description":"Authentication is missing or invalid. The request did not\ncarry a recognised credential (console session token, API key,\nor worker JWT).\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/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/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/Error"}}}},"409":{"description":"The request conflicts with the current resource state - e.g.\nduplicate, optimistic-concurrency mismatch, or last-owner\nguard.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Request body exceeded a per-endpoint size limit (e.g. the file\nupload cap, KB document upload cap, batch-call CSV cap).\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request was well-formed but semantically rejected -\ntypically a referential integrity violation (e.g. flow node\nreferences an audio asset in another workspace) or a state\nmachine refusal.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit or concurrency limit exceeded. `error.code` says which\nceiling, and they need different responses: `rate_limited` is the\nrequest-rate budget (slow down), `concurrency_limit_reached` is a\nworkspace-wide concurrency ceiling (fewer at once, or raise it), and\n`conversation_turn_in_progress` is contention over one named\nconversation (keep one message in flight on it). Every 429 carries\n`Retry-After` and the request-rate budget headers; the active-call cap\nalso carries `RateLimit-Remaining-Calls: 0`.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/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/Error"}}}},"502":{"description":"An upstream dependency (the TTS composer or voice-metadata\nservice) returned a 5xx. The raw upstream detail is not\nforwarded - the cause is in the server log; the response is a\nfixed `upstream_failure` envelope. Safe to retry.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"A downstream dependency is degraded or the endpoint is\nintentionally disabled (e.g. phone-number purchase before\nops setup).\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/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/V1VoicesPostRequestBodyContentMultipartFormDataSchemaGender","description":"Gender marker for the personal voice\nmale GenderMale\nfemale GenderFemale\nnot_specified GenderNotSpecified"},"sample":{"type":"string","format":"binary","description":"Audio sample of the voice to clone, 10-30 seconds of clean speech."},"avatar":{"type":"string","format":"binary","description":"Avatar image file"},"consent_challenge_id":{"type":"string","description":"The `id` of the consent challenge this create consumes, from\n`POST /v1/voices/consent-challenges`. Single use: once a\ncreate has consumed it, whether or not that create\nsucceeded, it cannot be used again."},"consent_recording":{"type":"string","format":"binary","description":"Recording of the speaker reading the challenge's `phrase`\naloud. This is the consent record for the voice, not a\nsecond voice sample: it must be the same person as in\n`sample`, and it is retained as evidence. 5-30 seconds, at\nmost 25 MB, in any common audio container."}},"required":["name","gender","sample","consent_challenge_id","consent_recording"]}}}}}},"/v1/voices/consent-challenges":{"post":{"operationId":"consentChallenges_create","summary":"Create Consent Challenge","description":"Start the consent check for a voice clone.\n\nReturns a `phrase` for the speaker to read aloud and an `id` that identifies this challenge. Show the phrase to the speaker exactly as returned, record them reading it, then send the recording and the `id` to `POST /v1/voices`, which verifies the recording against the phrase and against the voice sample being cloned, then keeps it as the consent record.\n\nA challenge is single use, is bound to the workspace that created it, and expires at `expires_at` - it is proof that a speaker was in front of a microphone just now, so create it when you are ready to record, not at the start of your flow. If it expires, create another one and record again.\n\nChallenge creation is rate limited per workspace at a few dozen per hour, far more tightly than the rest of the voice surface, because each one precedes a person recording themselves - mint it when your speaker is ready, not speculatively. Read the live ceiling off `RateLimit-*` rather than hard-coding it. **On a `429`, always honour `Retry-After` rather than a fixed backoff of your own**: the wait is measured in minutes and can run to most of an hour. `RateLimit-*` are omitted rather than reporting a bucket that is not the one refusing.","tags":["consentChallenges"],"parameters":[{"name":"Authorization","in":"header","description":"Enter your API key with the `Bearer` prefix, e.g. 'Bearer sk_...'.","required":true,"schema":{"type":"string"}},{"name":"Speechify-Version","in":"header","required":false,"schema":{"type":"string"}},{"name":"Idempotency-Key","in":"header","description":"A client-generated key (an opaque string, max 255 chars) that makes a\nside-effect POST safe to retry: the server runs the operation exactly\nonce and replays the first response (its status and body) for 24 hours.\nReusing a key with a different request body, or while the first request\nis still in flight, returns `409 idempotency_conflict`. A replayed\nresponse carries the `Idempotent-Replayed: true` header.\n","required":false,"schema":{"type":"string","maxLength":255}}],"responses":{"201":{"description":"The created consent challenge.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConsentChallenge"}}}},"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/Error"}}}},"401":{"description":"Authentication is missing or invalid. The request did not\ncarry a recognised credential (console session token, API key,\nor worker JWT).\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/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/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/Error"}}}},"409":{"description":"The request conflicts with the current resource state - e.g.\nduplicate, optimistic-concurrency mismatch, or last-owner\nguard.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit or concurrency limit exceeded. `error.code` says which\nceiling, and they need different responses: `rate_limited` is the\nrequest-rate budget (slow down), `concurrency_limit_reached` is a\nworkspace-wide concurrency ceiling (fewer at once, or raise it), and\n`conversation_turn_in_progress` is contention over one named\nconversation (keep one message in flight on it). Every 429 carries\n`Retry-After` and the request-rate budget headers; the active-call cap\nalso carries `RateLimit-Remaining-Calls: 0`.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/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/Error"}}}},"502":{"description":"An upstream dependency (the TTS composer or voice-metadata\nservice) returned a 5xx. The raw upstream detail is not\nforwarded - the cause is in the server log; the response is a\nfixed `upstream_failure` envelope. Safe to retry.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"A downstream dependency is degraded or the endpoint is\nintentionally disabled (e.g. phone-number purchase before\nops setup).\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateConsentChallengeRequest"}}}}}},"/v1/voices/{voice_id}":{"get":{"operationId":"voices_get","summary":"Get Voice","description":"Fetch a single voice by id - a shared catalogue voice or one of\nthe workspace's cloned voices. A cloned voice that belongs to\nanother workspace returns 404, identical to an unknown id, so\nvoice inventory is never enumerable across tenants.","tags":["voices"],"parameters":[{"name":"voice_id","in":"path","description":"The ID of the voice to fetch","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"}},{"name":"Speechify-Version","in":"header","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"The voice.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetVoice"}}}},"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/Error"}}}},"401":{"description":"Authentication is missing or invalid. The request did not\ncarry a recognised credential (console session token, API key,\nor worker JWT).\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/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/Error"}}}},"429":{"description":"Rate limit or concurrency limit exceeded. `error.code` says which\nceiling, and they need different responses: `rate_limited` is the\nrequest-rate budget (slow down), `concurrency_limit_reached` is a\nworkspace-wide concurrency ceiling (fewer at once, or raise it), and\n`conversation_turn_in_progress` is contention over one named\nconversation (keep one message in flight on it). Every 429 carries\n`Retry-After` and the request-rate budget headers; the active-call cap\nalso carries `RateLimit-Remaining-Calls: 0`.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/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/Error"}}}},"502":{"description":"An upstream dependency (the TTS composer or voice-metadata\nservice) returned a 5xx. The raw upstream detail is not\nforwarded - the cause is in the server log; the response is a\nfixed `upstream_failure` envelope. Safe to retry.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"A downstream dependency is degraded or the endpoint is\nintentionally disabled (e.g. phone-number purchase before\nops setup).\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"operationId":"voices_delete","summary":"Delete Voice","description":"Delete one of the workspace's cloned voices. Requires the\n`content.manage` permission (owner, admin, or member); a\nservice-account key is authorized by its scopes instead.","tags":["voices"],"parameters":[{"name":"voice_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"}},{"name":"Speechify-Version","in":"header","required":false,"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/Error"}}}},"401":{"description":"Authentication is missing or invalid. The request did not\ncarry a recognised credential (console session token, API key,\nor worker JWT).\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/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/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/Error"}}}},"429":{"description":"Rate limit or concurrency limit exceeded. `error.code` says which\nceiling, and they need different responses: `rate_limited` is the\nrequest-rate budget (slow down), `concurrency_limit_reached` is a\nworkspace-wide concurrency ceiling (fewer at once, or raise it), and\n`conversation_turn_in_progress` is contention over one named\nconversation (keep one message in flight on it). Every 429 carries\n`Retry-After` and the request-rate budget headers; the active-call cap\nalso carries `RateLimit-Remaining-Calls: 0`.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/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/Error"}}}},"502":{"description":"An upstream dependency (the TTS composer or voice-metadata\nservice) returned a 5xx. The raw upstream detail is not\nforwarded - the cause is in the server log; the response is a\nfixed `upstream_failure` envelope. Safe to retry.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"A downstream dependency is degraded or the endpoint is\nintentionally disabled (e.g. phone-number purchase before\nops setup).\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/voices/{voice_id}/sample":{"get":{"operationId":"voices_downloadSample","summary":"Download Voice Sample","description":"Download a personal (cloned) voice sample","tags":["voices"],"parameters":[{"name":"voice_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"}},{"name":"Speechify-Version","in":"header","required":false,"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/Error"}}}},"401":{"description":"Authentication is missing or invalid. The request did not\ncarry a recognised credential (console session token, API key,\nor worker JWT).\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/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/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/Error"}}}},"429":{"description":"Rate limit or concurrency limit exceeded. `error.code` says which\nceiling, and they need different responses: `rate_limited` is the\nrequest-rate budget (slow down), `concurrency_limit_reached` is a\nworkspace-wide concurrency ceiling (fewer at once, or raise it), and\n`conversation_turn_in_progress` is contention over one named\nconversation (keep one message in flight on it). Every 429 carries\n`Retry-After` and the request-rate budget headers; the active-call cap\nalso carries `RateLimit-Remaining-Calls: 0`.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/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/Error"}}}},"502":{"description":"An upstream dependency (the TTS composer or voice-metadata\nservice) returned a 5xx. The raw upstream detail is not\nforwarded - the cause is in the server log; the response is a\nfixed `upstream_failure` envelope. Safe to retry.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"A downstream dependency is degraded or the endpoint is\nintentionally disabled (e.g. phone-number purchase before\nops setup).\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/audio/models":{"get":{"operationId":"models_list","summary":"List Models","description":"List the text-to-speech models available for synthesis. Drive a model\npicker from this response, then pass a model `id` as the `model`\nparameter to POST /v1/audio/speech or /v1/audio/stream. The response\nmarks the default model (used when a request omits `model`), the\nroutes each model may be passed to, and which voices it accepts.\nMulti-speaker models arrive in a separate `dialogue_models` array\nbecause they are valid only on POST /v1/audio/dialogue. Returns\nthe full set in a single response: the model catalog is static\nplatform reference data, so it is intentionally not paginated.","tags":["models"],"parameters":[{"name":"Authorization","in":"header","description":"Enter your API key with the `Bearer` prefix, e.g. 'Bearer sk_...'.","required":true,"schema":{"type":"string"}},{"name":"Speechify-Version","in":"header","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"The available text-to-speech models.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ModelsResponse"}}}},"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/Error"}}}},"401":{"description":"Authentication is missing or invalid. The request did not\ncarry a recognised credential (console session token, API key,\nor worker JWT).\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/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/Error"}}}},"429":{"description":"Rate limit or concurrency limit exceeded. `error.code` says which\nceiling, and they need different responses: `rate_limited` is the\nrequest-rate budget (slow down), `concurrency_limit_reached` is a\nworkspace-wide concurrency ceiling (fewer at once, or raise it), and\n`conversation_turn_in_progress` is contention over one named\nconversation (keep one message in flight on it). Every 429 carries\n`Retry-After` and the request-rate budget headers; the active-call cap\nalso carries `RateLimit-Remaining-Calls: 0`.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/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/Error"}}}}}}},"/v1/audio/watermark/detect":{"post":{"operationId":"watermark_detect","summary":"Detect Watermark","description":"Check whether a clip carries the watermark Speechify seals into audio it\ngenerates. Upload the audio as `audio`; nothing about it is stored, and\nno voice is read or written.\n\nRead the answer carefully in one direction. A `watermarked: true` is\npositive evidence that the audio came from Speechify synthesis. A\n`watermarked: false` is NOT proof that it did not: only models\nredeployed since the watermark shipped mark their output, the detector\nneeds at least three seconds of clear speech to judge, and re-encoding\nor changing the speed of a clip degrades the mark. Treat a negative as\nthe absence of evidence rather than as evidence of absence.\n\nChecks are rate-limited well below the synthesis budget: this is a\nforensic question, not a data-plane call.","tags":["watermark"],"parameters":[{"name":"Authorization","in":"header","description":"Enter your API key with the `Bearer` prefix, e.g. 'Bearer sk_...'.","required":true,"schema":{"type":"string"}},{"name":"Speechify-Version","in":"header","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"The clip was checked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WatermarkDetectionResponse"}}}},"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/Error"}}}},"401":{"description":"Authentication is missing or invalid. The request did not\ncarry a recognised credential (console session token, API key,\nor worker JWT).\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/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/Error"}}}},"413":{"description":"Request body exceeded a per-endpoint size limit (e.g. the file\nupload cap, KB document upload cap, batch-call CSV cap).\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request was well-formed but semantically rejected -\ntypically a referential integrity violation (e.g. flow node\nreferences an audio asset in another workspace) or a state\nmachine refusal.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit or concurrency limit exceeded. `error.code` says which\nceiling, and they need different responses: `rate_limited` is the\nrequest-rate budget (slow down), `concurrency_limit_reached` is a\nworkspace-wide concurrency ceiling (fewer at once, or raise it), and\n`conversation_turn_in_progress` is contention over one named\nconversation (keep one message in flight on it). Every 429 carries\n`Retry-After` and the request-rate budget headers; the active-call cap\nalso carries `RateLimit-Remaining-Calls: 0`.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/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/Error"}}}},"502":{"description":"An upstream dependency (the TTS composer or voice-metadata\nservice) returned a 5xx. The raw upstream detail is not\nforwarded - the cause is in the server log; the response is a\nfixed `upstream_failure` envelope. Safe to retry.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"audio":{"type":"string","format":"binary","description":"The clip to check, at most 25MB. Give the detector at least\nthree seconds of clear speech; below that its confidence is\nnot worth acting on, and below half a second it always\nreports zero."}},"required":["audio"]}}}}}},"/v1/audio/watermark/verify":{"post":{"operationId":"watermark_verify","summary":"Verify Watermark","description":"The public AI detection tool. Ask whether a clip carries the watermark\nSpeechify seals into audio it generates, with no account, no API key and\nno credential of any kind.\n\n`verify` answers; `detect` measures. This route returns a bare yes or no,\nthe way verifying a signature does. Its sibling\n`POST /v1/audio/watermark/detect` takes an API key and returns the\ndetector's confidence alongside the verdict.\n\nThis is the programmatic half of the tool published at\n, and it exists so the tool can be invoked\nwithout visiting our website, as California's AI Transparency Act\n(BPC 22757.2) requires. Nothing about the clip is stored, and nothing\nidentifying about you is collected or retained.\n\nThe answer is a bare verdict. `watermarked: true` is positive evidence\nthat the audio came from Speechify synthesis. `watermarked: false` is\nNOT proof that it did not: only models redeployed since the watermark\nshipped mark their output, the detector needs at least three seconds of\nclear speech to judge, and re-encoding or changing the speed of a clip\ndegrades the mark. Treat a negative as the absence of evidence rather\nthan as evidence of absence.\n\nBecause the tool takes no credential, it is rate-limited per client\naddress and shares a platform-wide budget: expect a 429 under sustained\nautomated use, and retry after the interval the response advertises.\nUse `POST /v1/audio/watermark/detect` with an API key for the detector's\nconfidence score and a per-workspace allowance of its own.","tags":["watermark"],"parameters":[{"name":"Speechify-Version","in":"header","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"The clip was checked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WatermarkVerificationResponse"}}}},"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/Error"}}}},"413":{"description":"Request body exceeded a per-endpoint size limit (e.g. the file\nupload cap, KB document upload cap, batch-call CSV cap).\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request was well-formed but semantically rejected -\ntypically a referential integrity violation (e.g. flow node\nreferences an audio asset in another workspace) or a state\nmachine refusal.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit or concurrency limit exceeded. `error.code` says which\nceiling, and they need different responses: `rate_limited` is the\nrequest-rate budget (slow down), `concurrency_limit_reached` is a\nworkspace-wide concurrency ceiling (fewer at once, or raise it), and\n`conversation_turn_in_progress` is contention over one named\nconversation (keep one message in flight on it). Every 429 carries\n`Retry-After` and the request-rate budget headers; the active-call cap\nalso carries `RateLimit-Remaining-Calls: 0`.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/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/Error"}}}},"502":{"description":"An upstream dependency (the TTS composer or voice-metadata\nservice) returned a 5xx. The raw upstream detail is not\nforwarded - the cause is in the server log; the response is a\nfixed `upstream_failure` envelope. Safe to retry.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"audio":{"type":"string","format":"binary","description":"The clip to check, at most 25MB. Give the detector at least\nthree seconds of clear speech; below that its answer is not\nworth acting on."}},"required":["audio"]}}}}}},"/v1/agents":{"get":{"operationId":"agent_list","summary":"List Agents","description":"List voice agents owned by the caller. Cursor-paginated: omit\n`cursor` for the first page; walk pages while `has_more` is true\n(default page size 50, max 200).","tags":["agent"],"parameters":[{"name":"cursor","in":"query","description":"Opaque pagination cursor from a previous response.","required":false,"schema":{"type":"string"}},{"name":"limit","in":"query","description":"Max items per page (default 50, max 200).","required":false,"schema":{"type":"integer","minimum":1,"maximum":200,"default":50}},{"name":"project_id","in":"query","description":"Filter by workspace project: omit for every project you can reach,\npass the literal `default` for resources in the implicit Default\nproject only, or a `proj_...` id for that project's resources.\nReturns 404 project_not_found for a malformed id and for any filter\noutside your reach: a project-pinned API key or service-account key\nreaches only its pinned project, and a member holding project grants\nreaches only the granted projects, so neither can name `default`.\nThat 404 is the same in every case and does not reveal whether such\na project exists - outside your reach a project is answered as\nnonexistent, never as forbidden. Inside it, a well-formed id that\nmatches no project yields an empty page.\n","required":false,"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"}},{"name":"Speechify-Version","in":"header","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"A list of voice agents.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListAgentsResponse"}}}},"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/Error"}}}},"401":{"description":"Authentication is missing or invalid. The request did not\ncarry a recognised credential (console session token, API key,\nor worker JWT).\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/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/Error"}}}}}},"post":{"operationId":"agent_create","summary":"Create Agent","description":"Create a voice agent.\n\nThe agent lands in the project named by `project_id`, or in the\nimplicit Default project when none is given. Each project holds at\nmost a fixed number of live agents; a create past that answers\n`409 agent_limit_reached` naming the ceiling, and deleting an agent\nin that project - or creating this one in another - frees a slot.\n","tags":["agent"],"parameters":[{"name":"Authorization","in":"header","description":"Enter your API key with the `Bearer` prefix, e.g. 'Bearer sk_...'.","required":true,"schema":{"type":"string"}},{"name":"Speechify-Version","in":"header","required":false,"schema":{"type":"string"}}],"responses":{"201":{"description":"The created agent.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/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/Error"}}}},"401":{"description":"Authentication is missing or invalid. The request did not\ncarry a recognised credential (console session token, API key,\nor worker JWT).\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"The request conflicts with the current resource state - e.g.\nduplicate, optimistic-concurrency mismatch, or last-owner\nguard.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateAgentRequest"}}}}}},"/v1/agents/voices":{"get":{"operationId":"agent_listAgentVoices","summary":"List Agent Voices","description":"List the voice catalogue available for voice agents: the curated\nshared catalogue plus your workspace's own cloned voices, each\nmarked by `type` (`shared` or `personal`). The same slug set is\naccepted by POST/PATCH /v1/agents, so any voice listed here can be\nassigned to an agent. Cloned voices are workspace-owned only - a\npersonal voice scoped to an individual is not selectable on an\nagent, which is a workspace-shared resource. The JSON layout\nintentionally mirrors the TTS `/v1/voices` shape so a single voice\npicker can consume both endpoints.\n\nCursor-paginated: pass `cursor` + `limit` and walk pages while\n`has_more` is true. From API version `2026-08-07` an omitted `limit`\nreturns the first page (default 50, max 200); a caller pinned before\nthat date keeps the historical whole-catalogue response until it opts\nin. The shared catalogue is served first, then your cloned voices.\n","tags":["agent"],"parameters":[{"name":"cursor","in":"query","description":"Opaque pagination cursor from a previous response.","required":false,"schema":{"type":"string"}},{"name":"limit","in":"query","description":"Max items per page (default 50, max 200).","required":false,"schema":{"type":"integer","minimum":1,"maximum":200,"default":50}},{"name":"Authorization","in":"header","description":"Enter your API key with the `Bearer` prefix, e.g. 'Bearer sk_...'.","required":true,"schema":{"type":"string"}},{"name":"Speechify-Version","in":"header","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"The curated agent voice catalogue.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListAgentVoicesResponse"}}}},"401":{"description":"Authentication is missing or invalid. The request did not\ncarry a recognised credential (console session token, API key,\nor worker JWT).\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/agents/tts-models":{"get":{"operationId":"agent_listTTSModels","summary":"List Agent TTS Models","description":"List the Simba text-to-speech models a voice agent can be pinned to\nwith `tts.model`.\n\nThe response is the whole catalog and is the same for every\nworkspace - which model serves an agent is a routing decision, not\nan entitlement, so nothing here is plan-gated. Whether a *particular*\nagent may select an entry depends on two facts this response\npublishes rather than resolving for you, because both change without\nthis list changing:\n\n- `english_only` - the model has no multilingual deployment, so an\n agent that declares `additional_languages` (or whose `language` is\n not English) cannot select it.\n- `requires_voice_curation` - deprecated and always false. No model\n asks a voice for a registration: every training conditions on the\n voice's own prompt audio, so every model is selectable on every\n voice we speak ourselves, cloned voices included.\n\nDrive a model picker from this and the agent's languages and it can\nonly offer combinations POST/PATCH /v1/agents will accept.\nReturns the full set in one response: bounded by the platform's\ncurated model catalog, so it is intentionally not paginated.\n","tags":["agent"],"parameters":[{"name":"Authorization","in":"header","description":"Enter your API key with the `Bearer` prefix, e.g. 'Bearer sk_...'.","required":true,"schema":{"type":"string"}},{"name":"Speechify-Version","in":"header","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"The TTS models selectable for voice agents.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentTTSModelsResponse"}}}},"401":{"description":"Authentication is missing or invalid. The request did not\ncarry a recognised credential (console session token, API key,\nor worker JWT).\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/agents/{agent_id}":{"delete":{"operationId":"agent_delete","summary":"Delete Agent","description":"Delete an agent, and with it everything that belonged only to that\nagent.\n\n**Goes with the agent**, immediately unreadable through every\nendpoint: its runs and their step journals and approvals, its\nconversations and the transcripts, messages and recordings inside\nthem, what it learned about the people it spoke to, its triggers,\nshare links, channel bindings, team memberships and the batch\ncampaigns it dialled. A run that has not settled is asked to stop,\nincluding one parked waiting on a person or on a delegated child. These are removed for good 30 days\nlater; until then the delete can still be walked back by support.\n\n**Survives the agent**, because it belongs to the workspace rather\nthan to this agent: attached tools, knowledge bases, stores and\nskills (only the attachment is dropped), the agent's tests, phone\nnumbers, and the teams it belonged to.\n\n**Kept regardless**, because it is accounting rather than content:\nthe usage the workspace was billed for.\n\nRefused with `409 agent_in_use` while a live phone number still\nroutes to the agent, including the agent a webhook binding\nprovisioned for its number; `used_by` names the numbers. Unbind them\n(`DELETE /v1/agents/{agent_id}/phone-numbers/{phone_number_id}`,\nwhich also clears a webhook binding) and the delete proceeds.\n","tags":["agent"],"parameters":[{"name":"agent_id","in":"path","description":"Agent id (prefixed external id, `agent_...`).","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"}},{"name":"Speechify-Version","in":"header","required":false,"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 (console session token, API key,\nor worker JWT).\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/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/Error"}}}},"409":{"description":"A live phone number still routes to the agent. `used_by` names\nthem so the caller can unbind first.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentInUseError"}}}}}},"get":{"operationId":"agent_get","summary":"Get Agent","description":"Retrieve a voice agent by ID.","tags":["agent"],"parameters":[{"name":"agent_id","in":"path","description":"Agent id (prefixed external id, `agent_...`).","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"}},{"name":"Speechify-Version","in":"header","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"The requested agent.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Agent"}}}},"401":{"description":"Authentication is missing or invalid. The request did not\ncarry a recognised credential (console session token, API key,\nor worker JWT).\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/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/Error"}}}}}},"patch":{"operationId":"agent_update","summary":"Update Agent","description":"Update a voice agent. Only fields present on the request body are changed.","tags":["agent"],"parameters":[{"name":"agent_id","in":"path","description":"Agent id (prefixed external id, `agent_...`).","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"}},{"name":"Speechify-Version","in":"header","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"The updated agent.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/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/Error"}}}},"401":{"description":"Authentication is missing or invalid. The request did not\ncarry a recognised credential (console session token, API key,\nor worker JWT).\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/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/Error"}}}},"409":{"description":"The request conflicts with the current resource state - e.g.\nduplicate, optimistic-concurrency mismatch, or last-owner\nguard.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateAgentRequest"}}}}}},"/v1/agents/{agent_id}/widget-config":{"get":{"operationId":"agent_getWidgetConfig","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":["agent"],"parameters":[{"name":"agent_id","in":"path","description":"Prefixed agent id.","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"}},{"name":"Speechify-Version","in":"header","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"The agent's widget configuration.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WidgetConfig"}}}},"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/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/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/Error"}}}}}}},"/v1/agents/flow/schema":{"get":{"operationId":"flow_getSchema","summary":"Get Flow Graph Schema","description":"Return the JSON Schema describing the flow graph node taxonomy.\nUnauthenticated; flow editors fetch it to validate graphs client-side.\n","tags":["flow"],"parameters":[{"name":"Speechify-Version","in":"header","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"A JSON Schema document for the flow graph.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/agent_flow_getSchema_Response_200"}}}},"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/Error"}}}}}}},"/v1/agents/{agent_id}/flow":{"get":{"operationId":"flow_getFlow","summary":"Get Agent Flow","description":"Return the agent's flow graph: the current draft (if any), the\nactive published graph (if any), and the version history.\n","tags":["flow"],"parameters":[{"name":"agent_id","in":"path","description":"Prefixed agent id.","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"}},{"name":"Speechify-Version","in":"header","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"The draft graph, active graph, and version history.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetFlowResponse"}}}},"401":{"description":"Authentication is missing or invalid. The request did not\ncarry a recognised credential (console session token, API key,\nor worker JWT).\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/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/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/Error"}}}}}},"put":{"operationId":"flow_updateFlow","summary":"Update Agent Flow Draft","description":"Replace the agent's draft flow graph. The graph is validated\nbefore it is stored; publish it separately to make it active.\n","tags":["flow"],"parameters":[{"name":"agent_id","in":"path","description":"Prefixed agent id.","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"}},{"name":"Speechify-Version","in":"header","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"The stored draft graph.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FlowGraph"}}}},"400":{"description":"Flow validation failed (or the request body was undecodable). The\nstandard `Error` envelope plus an `issues` array locating each problem\nfor the editor. See the `FlowValidationError` schema.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FlowValidationError"}}}},"401":{"description":"Authentication is missing or invalid. The request did not\ncarry a recognised credential (console session token, API key,\nor worker JWT).\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/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/Error"}}}},"409":{"description":"The request conflicts with the current resource state - e.g.\nduplicate, optimistic-concurrency mismatch, or last-owner\nguard.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/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/Error"}}}}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PutFlowRequest"}}}}}},"/v1/agents/{agent_id}/flow/publish":{"post":{"operationId":"flow_publish","summary":"Publish Agent Flow","description":"Publish the agent's draft graph as a new active flow version.","tags":["flow"],"parameters":[{"name":"agent_id","in":"path","description":"Prefixed agent id.","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"}},{"name":"Speechify-Version","in":"header","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"The newly published flow version.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FlowVersion"}}}},"400":{"description":"Flow validation failed (or the request body was undecodable). The\nstandard `Error` envelope plus an `issues` array locating each problem\nfor the editor. See the `FlowValidationError` schema.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FlowValidationError"}}}},"401":{"description":"Authentication is missing or invalid. The request did not\ncarry a recognised credential (console session token, API key,\nor worker JWT).\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/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/Error"}}}},"409":{"description":"The request conflicts with the current resource state - e.g.\nduplicate, optimistic-concurrency mismatch, or last-owner\nguard.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The behavioral-eval publish gate refused the publish, on one of two\ncodes the caller can FIX (neither is waited out):\n\n- `agent_publish_gate_failed`: the agent's configured suite did not\n pass. `error.details` carries the verdict (per-case, per-criterion).\n- `agent_publish_gate_tool_unreachable`: the checks never ran because\n a tool the agent is attached to could not be reached. Nothing was\n judged, and no retry helps while the endpoint is down;\n `error.message` names the tool, the endpoint and the reason.\n\nThe one publish failure that IS waited out is the `503`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/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/Error"}}}},"503":{"description":"The publish checks could not run (`agent_publish_gate_unavailable`):\nthe eval worker, the judge or the probe corpus errored, so nothing\nabout the agent was judged. This is OURS, and the only publish failure\na caller waits out: not a verdict on the configuration, retry after\n`Retry-After`. `error.details` lists the cases that could not run. A\ncheck that could not run because of the agent's own configuration is\nthe `422 agent_publish_gate_tool_unreachable` instead.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublishFlowRequest"}}}}}},"/v1/agents/{agent_id}/flow/rollback":{"post":{"operationId":"flow_rollback","summary":"Roll Back Agent Flow","description":"Publish a prior flow version as the active graph.","tags":["flow"],"parameters":[{"name":"agent_id","in":"path","description":"Prefixed agent id.","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"}},{"name":"Speechify-Version","in":"header","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"The flow version that is now active.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FlowVersion"}}}},"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/Error"}}}},"401":{"description":"Authentication is missing or invalid. The request did not\ncarry a recognised credential (console session token, API key,\nor worker JWT).\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/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/Error"}}}},"422":{"description":"The behavioral-eval publish gate refused the rollback, on one of two\ncodes the caller can FIX (neither is waited out):\n\n- `agent_publish_gate_failed`: the target version did not pass the\n agent's configured suite. `error.details` carries the verdict.\n- `agent_publish_gate_tool_unreachable`: the checks never ran because\n a tool the agent is attached to could not be reached;\n `error.message` names the tool, the endpoint and the reason.\n\nThe one rollback failure that IS waited out is the `503`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/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/Error"}}}},"503":{"description":"The gate's checks could not run on the rollback target\n(`agent_publish_gate_unavailable`): the eval worker, the judge or\nthe probe corpus errored, so nothing about the version was judged.\nThis is OURS, and the only rollback failure a caller waits out: not a\nverdict on it, retry after `Retry-After`. `error.details` lists the\ncases that could not run. A check that could not run because of the\nagent's own configuration is the `422\nagent_publish_gate_tool_unreachable` instead.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RollbackFlowRequest"}}}}}},"/v1/agents/{agent_id}/flow/deactivate":{"post":{"operationId":"flow_deactivate","summary":"Deactivate Agent Flow","description":"Deactivate the agent's published flow so the agent runs the synthesized default flow.","tags":["flow"],"parameters":[{"name":"agent_id","in":"path","description":"Prefixed agent id.","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"}},{"name":"Speechify-Version","in":"header","required":false,"schema":{"type":"string"}}],"responses":{"204":{"description":"Flow deactivated.","content":{"application/json":{"schema":{"type":"object","properties":{}}}}},"401":{"description":"Authentication is missing or invalid. The request did not\ncarry a recognised credential (console session token, API key,\nor worker JWT).\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/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/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/Error"}}}}}}},"/v1/agents/{agent_id}/flow/draft":{"delete":{"operationId":"flow_discardDraft","summary":"Discard Agent Flow Draft","description":"Discard the agent's unpublished draft flow graph.","tags":["flow"],"parameters":[{"name":"agent_id","in":"path","description":"Prefixed agent id.","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"}},{"name":"Speechify-Version","in":"header","required":false,"schema":{"type":"string"}}],"responses":{"204":{"description":"Draft discarded.","content":{"application/json":{"schema":{"type":"object","properties":{}}}}},"401":{"description":"Authentication is missing or invalid. The request did not\ncarry a recognised credential (console session token, API key,\nor worker JWT).\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/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/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/Error"}}}}}}},"/v1/agents/{agent_id}/flow/versions":{"get":{"operationId":"flow_listVersions","summary":"List Agent Flow Versions","description":"List every published flow version for the agent, newest first.\nCursor-paginated: omit `cursor` for the first page; walk pages\nwhile `has_more` is true (default page size 50, max 200).","tags":["flow"],"parameters":[{"name":"agent_id","in":"path","description":"Prefixed agent id.","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 items per page (default 50, max 200).","required":false,"schema":{"type":"integer","minimum":1,"maximum":200,"default":50}},{"name":"Authorization","in":"header","description":"Enter your API key with the `Bearer` prefix, e.g. 'Bearer sk_...'.","required":true,"schema":{"type":"string"}},{"name":"Speechify-Version","in":"header","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"The agent's flow version history.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListFlowVersionsResponse"}}}},"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/Error"}}}},"401":{"description":"Authentication is missing or invalid. The request did not\ncarry a recognised credential (console session token, API key,\nor worker JWT).\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/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/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/Error"}}}}}}},"/v1/agents/{agent_id}/flow/versions/{version_id}":{"get":{"operationId":"flow_getVersion","summary":"Get Agent Flow Version","description":"Return the full flow graph for a specific published version.","tags":["flow"],"parameters":[{"name":"agent_id","in":"path","description":"Prefixed agent id.","required":true,"schema":{"type":"string"}},{"name":"version_id","in":"path","description":"Prefixed flow version id (`fver_...`).","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"}},{"name":"Speechify-Version","in":"header","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"The requested flow version's graph.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FlowGraph"}}}},"401":{"description":"Authentication is missing or invalid. The request did not\ncarry a recognised credential (console session token, API key,\nor worker JWT).\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/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/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/Error"}}}}}}},"/v1/agents/flow/templates":{"get":{"operationId":"flow_listTemplates","summary":"List Flow Templates","description":"List the reusable flow templates available to the workspace.\nCursor-paginated: omit `cursor` for the first page; walk pages\nwhile `has_more` is true (default page size 50, max 200).","tags":["flow"],"parameters":[{"name":"cursor","in":"query","description":"Opaque pagination cursor from a previous response.","required":false,"schema":{"type":"string"}},{"name":"limit","in":"query","description":"Max items per page (default 50, max 200).","required":false,"schema":{"type":"integer","minimum":1,"maximum":200,"default":50}},{"name":"Authorization","in":"header","description":"Enter your API key with the `Bearer` prefix, e.g. 'Bearer sk_...'.","required":true,"schema":{"type":"string"}},{"name":"Speechify-Version","in":"header","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"The available flow templates.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListFlowTemplatesResponse"}}}},"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/Error"}}}},"401":{"description":"Authentication is missing or invalid. The request did not\ncarry a recognised credential (console session token, API key,\nor worker JWT).\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/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/Error"}}}}}},"post":{"operationId":"flow_createTemplate","summary":"Create Flow Template","description":"Create a reusable flow template from a graph.","tags":["flow"],"parameters":[{"name":"Authorization","in":"header","description":"Enter your API key with the `Bearer` prefix, e.g. 'Bearer sk_...'.","required":true,"schema":{"type":"string"}},{"name":"Speechify-Version","in":"header","required":false,"schema":{"type":"string"}}],"responses":{"201":{"description":"The created flow template.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FlowTemplate"}}}},"400":{"description":"Flow validation failed (or the request body was undecodable). The\nstandard `Error` envelope plus an `issues` array locating each problem\nfor the editor. See the `FlowValidationError` schema.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FlowValidationError"}}}},"401":{"description":"Authentication is missing or invalid. The request did not\ncarry a recognised credential (console session token, API key,\nor worker JWT).\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"The request conflicts with the current resource state - e.g.\nduplicate, optimistic-concurrency mismatch, or last-owner\nguard.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/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/Error"}}}}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateFlowTemplateRequest"}}}}}},"/v1/agents/flow/templates/{flow_template_id}":{"get":{"operationId":"flow_getTemplate","summary":"Get Flow Template","description":"Retrieve a flow template by id.","tags":["flow"],"parameters":[{"name":"flow_template_id","in":"path","description":"Flow template id (prefixed external id, `tmpl_...`).","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"}},{"name":"Speechify-Version","in":"header","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"The requested flow template.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FlowTemplate"}}}},"401":{"description":"Authentication is missing or invalid. The request did not\ncarry a recognised credential (console session token, API key,\nor worker JWT).\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/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/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/Error"}}}}}},"put":{"operationId":"flow_updateTemplate","summary":"Update Flow Template","description":"Replace a flow template. The whole template is replaced, not patched field-by-field.","tags":["flow"],"parameters":[{"name":"flow_template_id","in":"path","description":"Flow template id (prefixed external id, `tmpl_...`).","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"}},{"name":"Speechify-Version","in":"header","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"The updated flow template.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FlowTemplate"}}}},"400":{"description":"Flow validation failed (or the request body was undecodable). The\nstandard `Error` envelope plus an `issues` array locating each problem\nfor the editor. See the `FlowValidationError` schema.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FlowValidationError"}}}},"401":{"description":"Authentication is missing or invalid. The request did not\ncarry a recognised credential (console session token, API key,\nor worker JWT).\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/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/Error"}}}},"409":{"description":"The request conflicts with the current resource state - e.g.\nduplicate, optimistic-concurrency mismatch, or last-owner\nguard.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/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/Error"}}}}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateFlowTemplateRequest"}}}}},"delete":{"operationId":"flow_deleteTemplate","summary":"Delete Flow Template","description":"Delete a flow template.","tags":["flow"],"parameters":[{"name":"flow_template_id","in":"path","description":"Flow template id (prefixed external id, `tmpl_...`).","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"}},{"name":"Speechify-Version","in":"header","required":false,"schema":{"type":"string"}}],"responses":{"204":{"description":"Template deleted.","content":{"application/json":{"schema":{"type":"object","properties":{}}}}},"401":{"description":"Authentication is missing or invalid. The request did not\ncarry a recognised credential (console session token, API key,\nor worker JWT).\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/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/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/Error"}}}}}}},"/v1/agents/flow/templates/{flow_template_id}/clone":{"post":{"operationId":"flow_cloneTemplate","summary":"Clone Flow Template","description":"Clone a flow template onto an agent as a new draft graph.","tags":["flow"],"parameters":[{"name":"flow_template_id","in":"path","description":"Flow template id (prefixed external id, `tmpl_...`).","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"}},{"name":"Speechify-Version","in":"header","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"The agent's new draft graph.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FlowGraph"}}}},"400":{"description":"Flow validation failed (or the request body was undecodable). The\nstandard `Error` envelope plus an `issues` array locating each problem\nfor the editor. See the `FlowValidationError` schema.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FlowValidationError"}}}},"401":{"description":"Authentication is missing or invalid. The request did not\ncarry a recognised credential (console session token, API key,\nor worker JWT).\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/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/Error"}}}},"409":{"description":"The request conflicts with the current resource state - e.g.\nduplicate, optimistic-concurrency mismatch, or last-owner\nguard.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/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/Error"}}}}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CloneFlowTemplateRequest"}}}}}},"/v1/agents/{agent_id}/evaluation-config":{"get":{"operationId":"agent_getEvaluationConfig","summary":"Get Evaluation Config","description":"Retrieve the agent's post-call evaluation criteria + data-collection config.","tags":["agent"],"parameters":[{"name":"agent_id","in":"path","description":"Agent id (prefixed external id, `agent_...`).","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"}},{"name":"Speechify-Version","in":"header","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"The evaluation config for the agent.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EvaluationConfig"}}}},"401":{"description":"Authentication is missing or invalid. The request did not\ncarry a recognised credential (console session token, API key,\nor worker JWT).\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"put":{"operationId":"agent_updateEvaluationConfig","summary":"Update Evaluation Config","description":"Replace the agent's evaluation criteria + data-collection fields.","tags":["agent"],"parameters":[{"name":"agent_id","in":"path","description":"Agent id (prefixed external id, `agent_...`).","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"}},{"name":"Speechify-Version","in":"header","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"The updated evaluation config.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/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/Error"}}}},"401":{"description":"Authentication is missing or invalid. The request did not\ncarry a recognised credential (console session token, API key,\nor worker JWT).\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateEvaluationConfigRequest"}}}}}},"/v1/agents/{agent_id}/variables":{"get":{"operationId":"agent_getDynamicVariables","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":["agent"],"parameters":[{"name":"agent_id","in":"path","description":"Agent id (prefixed external id, `agent_...`).","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"}},{"name":"Speechify-Version","in":"header","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"The agent's variable catalogue.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListDynamicVariablesResponse"}}}},"401":{"description":"Authentication is missing or invalid. The request did not\ncarry a recognised credential (console session token, API key,\nor worker JWT).\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/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/Error"}}}}}},"put":{"operationId":"agent_updateDynamicVariables","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":["agent"],"parameters":[{"name":"agent_id","in":"path","description":"Agent id (prefixed external id, `agent_...`).","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"}},{"name":"Speechify-Version","in":"header","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"The updated variable catalogue.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/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/Error"}}}},"401":{"description":"Authentication is missing or invalid. The request did not\ncarry a recognised credential (console session token, API key,\nor worker JWT).\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/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/Error"}}}}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateDynamicVariablesRequest"}}}}}},"/v1/agents/{agent_id}/conversations":{"post":{"operationId":"agent_createConversation","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\nPass `user_identity` as the stable caller key your application uses\nfor memory and caller correlation. It is kept separate from the\nopaque, per-session realtime participant identity.\n\n`overrides.voice_id` replaces the configured voice for the entire\nconversation, including every configured language the voice can\nserve. The request is rejected when the voice is unavailable or\ncannot cover the agent's configured language set; the rejection\nnames `overrides.voice_id` in the error envelope's `fields` map.\nThe override belongs to this conversation only: if the call is\ntransferred to another agent mid-conversation, that agent speaks\nwith its own configured voice.\n","tags":["agent"],"parameters":[{"name":"agent_id","in":"path","description":"Agent id (prefixed external id, `agent_...`).","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"}},{"name":"Speechify-Version","in":"header","required":false,"schema":{"type":"string"}},{"name":"Idempotency-Key","in":"header","description":"A client-generated key (an opaque string, max 255 chars) that makes a\nside-effect POST safe to retry: the server runs the operation exactly\nonce and replays the first response (its status and body) for 24 hours.\nReusing a key with a different request body, or while the first request\nis still in flight, returns `409 idempotency_conflict`. A replayed\nresponse carries the `Idempotent-Replayed: true` header.\n","required":false,"schema":{"type":"string","maxLength":255}}],"responses":{"201":{"description":"The created conversation with its realtime session token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/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/Error"}}}},"401":{"description":"Authentication is missing or invalid. The request did not\ncarry a recognised credential (console session token, API key,\nor worker JWT).\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/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/Error"}}}},"409":{"description":"The request conflicts with the current resource state - e.g.\nduplicate, optimistic-concurrency mismatch, or last-owner\nguard.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateConversationRequest"}}}}}},"/v1/agents/{agent_id}/sessions":{"post":{"operationId":"agent_createSession","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\n`Idempotency-Key` replay is scoped to the authenticated caller, so it\napplies to Bearer requests only: an unauthenticated mint has no scope\nto replay under, and retrying one mints a fresh session.\n","tags":["agent"],"parameters":[{"name":"agent_id","in":"path","description":"Agent id (prefixed external id, `agent_...`).","required":true,"schema":{"type":"string"}},{"name":"Speechify-Version","in":"header","required":false,"schema":{"type":"string"}},{"name":"Idempotency-Key","in":"header","description":"A client-generated key (an opaque string, max 255 chars) that makes a\nside-effect POST safe to retry: the server runs the operation exactly\nonce and replays the first response (its status and body) for 24 hours.\nReusing a key with a different request body, or while the first request\nis still in flight, returns `409 idempotency_conflict`. A replayed\nresponse carries the `Idempotent-Replayed: true` header.\n","required":false,"schema":{"type":"string","maxLength":255}}],"responses":{"201":{"description":"The created session with its realtime token + URL.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/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/Error"}}}},"401":{"description":"Authentication is missing or invalid. The request did not\ncarry a recognised credential (console session token, API key,\nor worker JWT).\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/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/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/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/Error"}}}},"409":{"description":"The request conflicts with the current resource state - e.g.\nduplicate, optimistic-concurrency mismatch, or last-owner\nguard.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit or concurrency limit exceeded. `error.code` says which\nceiling, and they need different responses: `rate_limited` is the\nrequest-rate budget (slow down), `concurrency_limit_reached` is a\nworkspace-wide concurrency ceiling (fewer at once, or raise it), and\n`conversation_turn_in_progress` is contention over one named\nconversation (keep one message in flight on it). Every 429 carries\n`Retry-After` and the request-rate budget headers; the active-call cap\nalso carries `RateLimit-Remaining-Calls: 0`.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateSessionRequest"}}}}}},"/v1/agents/conversations":{"get":{"operationId":"conversations_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.\n\n`project_id` matches the project the call was DISPATCHED under, which\nis frozen when the conversation starts. Moving an agent to another\nproject therefore leaves its past calls attributed where they ran, the\nsame way per-project usage reports them.","tags":["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 items per page (default 50, max 200).","required":false,"schema":{"type":"integer","minimum":1,"maximum":200,"default":50}},{"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/ConversationStatus"}},{"name":"transport","in":"query","description":"Filter by the runtime that carried the conversation. `phone`\nmatches calls in either direction.\n","required":false,"schema":{"$ref":"#/components/schemas/ConversationTransport"}},{"name":"channel","in":"query","description":"Filter by the front door the conversation arrived through.\nThis is the axis that separates two conversations sharing one\ntransport: `channel=slack` and `channel=text` both run the\n`text` transport. Combining it with `transport` narrows by\nboth.\n","required":false,"schema":{"$ref":"#/components/schemas/ConversationChannel"}},{"name":"live","in":"query","description":"Narrow to (`true`) or away from (`false`) the conversations that\nare a realtime session in progress: non-terminal AND holding a\nroom. A text or Slack thread holds no room, so it is open rather\nthan live however long it stays non-terminal - `status=active`\nalone matches it. This is the filter a live view asks for.\n","required":false,"schema":{"type":"boolean"}},{"name":"caller_identity","in":"query","description":"Filter by caller identity.","required":false,"schema":{"type":"string"}},{"name":"contact_id","in":"query","description":"Narrow to one person's conversations, whichever agent or channel\nreached them. Prefixed `contact_...` id.\n","required":false,"schema":{"type":"string"}},{"name":"q","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":"project_id","in":"query","description":"Filter by workspace project: omit for every project you can reach,\npass the literal `default` for resources in the implicit Default\nproject only, or a `proj_...` id for that project's resources.\nReturns 404 project_not_found for a malformed id and for any filter\noutside your reach: a project-pinned API key or service-account key\nreaches only its pinned project, and a member holding project grants\nreaches only the granted projects, so neither can name `default`.\nThat 404 is the same in every case and does not reveal whether such\na project exists - outside your reach a project is answered as\nnonexistent, never as forbidden. Inside it, a well-formed id that\nmatches no project yields an empty page.\n","required":false,"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"}},{"name":"Speechify-Version","in":"header","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"A list of conversations.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListConversationsResponse"}}}},"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/Error"}}}},"401":{"description":"Authentication is missing or invalid. The request did not\ncarry a recognised credential (console session token, API key,\nor worker JWT).\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/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/Error"}}}}}}},"/v1/agents/conversations/{conversation_id}":{"get":{"operationId":"conversations_get","summary":"Get Conversation","description":"Retrieve a conversation by ID.","tags":["conversations"],"parameters":[{"name":"conversation_id","in":"path","description":"Conversation id (prefixed external id, `conv_...`).","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"}},{"name":"Speechify-Version","in":"header","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"The requested conversation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Conversation"}}}},"401":{"description":"Authentication is missing or invalid. The request did not\ncarry a recognised credential (console session token, API key,\nor worker JWT).\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/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/Error"}}}}}}},"/v1/agents/conversations/recent-callees":{"get":{"operationId":"conversations_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":["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 items per page (default 50, max 200).","required":false,"schema":{"type":"integer","minimum":1,"maximum":200,"default":50}},{"name":"Authorization","in":"header","description":"Enter your API key with the `Bearer` prefix, e.g. 'Bearer sk_...'.","required":true,"schema":{"type":"string"}},{"name":"Speechify-Version","in":"header","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Recent callees for the caller's workspace.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/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/Error"}}}},"401":{"description":"Authentication is missing or invalid. The request did not\ncarry a recognised credential (console session token, API key,\nor worker JWT).\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/agents/conversations/stats":{"get":{"operationId":"conversations_stats","summary":"Conversation stats","description":"Aggregated counts and averages over the caller's conversations, scoped\nby the same filters as the list endpoint, `project_id` included.","tags":["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/ConversationStatus"}},{"name":"transport","in":"query","description":"Filter by the runtime that carried the conversation. `phone`\nmatches calls in either direction.\n","required":false,"schema":{"$ref":"#/components/schemas/ConversationTransport"}},{"name":"channel","in":"query","description":"Filter by the front door the conversation arrived through.\nThis is the axis that separates two conversations sharing one\ntransport: `channel=slack` and `channel=text` both run the\n`text` transport. Combining it with `transport` narrows by\nboth.\n","required":false,"schema":{"$ref":"#/components/schemas/ConversationChannel"}},{"name":"live","in":"query","description":"Narrow to (`true`) or away from (`false`) the conversations that\nare a realtime session in progress: non-terminal AND holding a\nroom. A text or Slack thread holds no room, so it is open rather\nthan live however long it stays non-terminal - `status=active`\nalone matches it. This is the filter a live view asks for.\n","required":false,"schema":{"type":"boolean"}},{"name":"caller_identity","in":"query","description":"Filter by caller identity.","required":false,"schema":{"type":"string"}},{"name":"contact_id","in":"query","description":"Narrow to one person's conversations, whichever agent or channel\nreached them. Prefixed `contact_...` id.\n","required":false,"schema":{"type":"string"}},{"name":"q","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":"project_id","in":"query","description":"Filter by workspace project: omit for every project you can reach,\npass the literal `default` for resources in the implicit Default\nproject only, or a `proj_...` id for that project's resources.\nReturns 404 project_not_found for a malformed id and for any filter\noutside your reach: a project-pinned API key or service-account key\nreaches only its pinned project, and a member holding project grants\nreaches only the granted projects, so neither can name `default`.\nThat 404 is the same in every case and does not reveal whether such\na project exists - outside your reach a project is answered as\nnonexistent, never as forbidden. Inside it, a well-formed id that\nmatches no project yields an empty page.\n","required":false,"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"}},{"name":"Speechify-Version","in":"header","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Stats for the matched conversations.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConversationStats"}}}},"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/Error"}}}},"401":{"description":"Authentication is missing or invalid. The request did not\ncarry a recognised credential (console session token, API key,\nor worker JWT).\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/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/Error"}}}}}}},"/v1/agents/conversations/{conversation_id}/messages":{"get":{"operationId":"conversations_listMessages","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":["conversations"],"parameters":[{"name":"conversation_id","in":"path","description":"Conversation id (prefixed external id, `conv_...`).","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 items per page (default 50, max 200).","required":false,"schema":{"type":"integer","minimum":1,"maximum":200,"default":50}},{"name":"Authorization","in":"header","description":"Enter your API key with the `Bearer` prefix, e.g. 'Bearer sk_...'.","required":true,"schema":{"type":"string"}},{"name":"Speechify-Version","in":"header","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"The messages for the conversation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/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/Error"}}}},"401":{"description":"Authentication is missing or invalid. The request did not\ncarry a recognised credential (console session token, API key,\nor worker JWT).\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/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/Error"}}}}}}},"/v1/agents/conversations/{conversation_id}/recording":{"get":{"operationId":"conversations_streamRecording","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; `