From ec687e0238a1b34b2f44894ca0b28debd690f2e7 Mon Sep 17 00:00:00 2001 From: CLowbrow <647504+CLowbrow@users.noreply.github.com> Date: Thu, 21 May 2026 17:25:16 +0000 Subject: [PATCH] Update openai,anthropic,google provider types --- .../anthropic/RequestLocationCitation.ts | 30 +- .../src/generated/google/FunctionResponse.ts | 5 +- .../src/generated/openai/ActionType.ts | 3 + .../src/generated/openai/InputItem.ts | 5 + .../src/generated/openai/InputItemAction.ts | 3 + .../src/generated/openai/InputItemTool.ts | 14 +- .../src/generated/openai/InputItemType.ts | 4 +- .../src/providers/anthropic/generated.rs | 32 + .../lingua/src/providers/google/generated.rs | 203 +- .../lingua/src/providers/openai/generated.rs | 87 +- specs/anthropic/.stats.yml | 8 +- specs/anthropic/openapi.yml | 11540 +++++++++----- specs/google/discovery.json | 12732 ++++++++-------- specs/openai/openapi.yml | 2998 +++- 14 files changed, 17595 insertions(+), 10069 deletions(-) diff --git a/bindings/typescript/src/generated/anthropic/RequestLocationCitation.ts b/bindings/typescript/src/generated/anthropic/RequestLocationCitation.ts index 3190cfc7..66797518 100644 --- a/bindings/typescript/src/generated/anthropic/RequestLocationCitation.ts +++ b/bindings/typescript/src/generated/anthropic/RequestLocationCitation.ts @@ -1,4 +1,32 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. import type { CitationType } from "./CitationType"; -export type RequestLocationCitation = { cited_text: string, document_index: bigint | null, document_title: string | null, end_char_index: bigint | null, start_char_index: bigint | null, type: CitationType, end_page_number: bigint | null, start_page_number: bigint | null, end_block_index: bigint | null, start_block_index: bigint | null, encrypted_index: string | null, title: string | null, url: string | null, search_result_index: bigint | null, source: string | null, }; +export type RequestLocationCitation = { +/** + * The full text of the cited block range, concatenated. + * + * Always equals the contents of `content[start_block_index:end_block_index]` joined + * together. The text block is the minimal citable unit; this field is never a substring of + * a single block. Not counted toward output tokens, and not counted toward input tokens + * when sent back in subsequent turns. + */ +cited_text: string, document_index: bigint | null, document_title: string | null, end_char_index: bigint | null, start_char_index: bigint | null, type: CitationType, end_page_number: bigint | null, start_page_number: bigint | null, +/** + * Exclusive 0-based end index of the cited block range in the source's `content` array. + * + * Always greater than `start_block_index`; a single-block citation has `end_block_index = + * start_block_index + 1`. + */ +end_block_index: bigint | null, +/** + * 0-based index of the first cited block in the source's `content` array. + */ +start_block_index: bigint | null, encrypted_index: string | null, title: string | null, url: string | null, +/** + * 0-based index of the cited search result among all `search_result` content blocks in the + * request, in the order they appear across messages and tool results. + * + * Counted separately from `document_index`; server-side web search results are not included + * in this count. + */ +search_result_index: bigint | null, source: string | null, }; diff --git a/bindings/typescript/src/generated/google/FunctionResponse.ts b/bindings/typescript/src/generated/google/FunctionResponse.ts index f96c3d35..5e599f81 100644 --- a/bindings/typescript/src/generated/google/FunctionResponse.ts +++ b/bindings/typescript/src/generated/google/FunctionResponse.ts @@ -32,7 +32,10 @@ parts: Array | null, * Required. The function response in JSON object format. Callers can use any keys of their * choice that fit the function's syntax to return the function output, e.g. "output", * "result", etc. In particular, if the function call failed to execute, the response can - * have an "error" key to return error details to the model. + * have an "error" key to return error details to the model. Multimedia can be included by + * using a subobject containing a single "$ref" key whose value is the + * `inline_data.display_name` of a `FunctionResponsePart` holding the multimedia. See + * https://ai.google.dev/gemini-api/docs/function-calling#multimodal. */ response: unknown, /** diff --git a/bindings/typescript/src/generated/openai/ActionType.ts b/bindings/typescript/src/generated/openai/ActionType.ts index 209eee0b..5a97e9ae 100644 --- a/bindings/typescript/src/generated/openai/ActionType.ts +++ b/bindings/typescript/src/generated/openai/ActionType.ts @@ -25,6 +25,9 @@ * The action type. * * + * The action type. Always `open_page`. + * + * * The type of the local shell action. Always `exec`. */ export type ActionType = "click" | "double_click" | "drag" | "exec" | "find_in_page" | "keypress" | "move" | "open_page" | "screenshot" | "scroll" | "search" | "type" | "wait"; diff --git a/bindings/typescript/src/generated/openai/InputItem.ts b/bindings/typescript/src/generated/openai/InputItem.ts index f6b507e6..9f6dee93 100644 --- a/bindings/typescript/src/generated/openai/InputItem.ts +++ b/bindings/typescript/src/generated/openai/InputItem.ts @@ -113,6 +113,8 @@ import type { ToolSearchExecutionType } from "./ToolSearchExecutionType"; * A call to a custom tool created by the model. * * + * Compacts the current context. Must be the final input item. + * * An internal identifier for an item to reference. */ export type InputItem = { @@ -208,6 +210,9 @@ role: InputItemRole | null, * * * The type of the custom tool call. Always `custom_tool_call`. + * + * + * The type of the item. Always `compaction_trigger`. */ type: InputItemType | null, /** diff --git a/bindings/typescript/src/generated/openai/InputItemAction.ts b/bindings/typescript/src/generated/openai/InputItemAction.ts index dca9ec49..898f0226 100644 --- a/bindings/typescript/src/generated/openai/InputItemAction.ts +++ b/bindings/typescript/src/generated/openai/InputItemAction.ts @@ -82,6 +82,9 @@ keys: Array | null, * The action type. * * + * The action type. Always `open_page`. + * + * * The type of the local shell action. Always `exec`. */ type: ActionType | null, diff --git a/bindings/typescript/src/generated/openai/InputItemTool.ts b/bindings/typescript/src/generated/openai/InputItemTool.ts index bf324031..b36cb58e 100644 --- a/bindings/typescript/src/generated/openai/InputItemTool.ts +++ b/bindings/typescript/src/generated/openai/InputItemTool.ts @@ -16,7 +16,6 @@ import type { Quality } from "./Quality"; import type { RankingOptions } from "./RankingOptions"; import type { RequireApproval } from "./RequireApproval"; import type { SearchContentType } from "./SearchContentType"; -import type { Size } from "./Size"; import type { ToolFormat } from "./ToolFormat"; import type { ToolSearchExecutionType } from "./ToolSearchExecutionType"; import type { ToolType } from "./ToolType"; @@ -254,10 +253,17 @@ partial_images: bigint | null, */ quality: Quality | null, /** - * The size of the generated image. One of `1024x1024`, `1024x1536`, - * `1536x1024`, or `auto`. Default: `auto`. + * The size of the generated images. For `gpt-image-2` and `gpt-image-2-2026-04-21`, + * arbitrary resolutions are supported as `WIDTHxHEIGHT` strings, for example `1536x864`. + * Width and height must both be divisible by 16 and the requested aspect ratio must be + * between 1:3 and 3:1. Resolutions above `2560x1440` are experimental, and the maximum + * supported resolution is `3840x2160`. The requested size must also satisfy the model's + * current pixel and edge limits. The standard sizes `1024x1024`, `1536x1024`, and + * `1024x1536` are supported by the GPT image models; `auto` is supported for models that + * allow automatic sizing. For `dall-e-2`, use one of `256x256`, `512x512`, or `1024x1024`. + * For `dall-e-3`, use one of `1024x1024`, `1792x1024`, or `1024x1792`. */ -size: Size | null, +size: string | null, /** * The input format for the custom tool. Default is unconstrained text. */ diff --git a/bindings/typescript/src/generated/openai/InputItemType.ts b/bindings/typescript/src/generated/openai/InputItemType.ts index 0aa8d2ca..c94af0eb 100644 --- a/bindings/typescript/src/generated/openai/InputItemType.ts +++ b/bindings/typescript/src/generated/openai/InputItemType.ts @@ -72,6 +72,8 @@ * The type of the custom tool call. Always `custom_tool_call`. * * + * The type of the item. Always `compaction_trigger`. + * * The type of item to reference. Always `item_reference`. */ -export type InputItemType = "apply_patch_call" | "apply_patch_call_output" | "code_interpreter_call" | "compaction" | "computer_call" | "computer_call_output" | "custom_tool_call" | "custom_tool_call_output" | "file_search_call" | "function_call" | "function_call_output" | "image_generation_call" | "item_reference" | "local_shell_call" | "local_shell_call_output" | "mcp_approval_request" | "mcp_approval_response" | "mcp_call" | "mcp_list_tools" | "message" | "reasoning" | "shell_call" | "shell_call_output" | "tool_search_call" | "tool_search_output" | "web_search_call"; +export type InputItemType = "apply_patch_call" | "apply_patch_call_output" | "code_interpreter_call" | "compaction" | "compaction_trigger" | "computer_call" | "computer_call_output" | "custom_tool_call" | "custom_tool_call_output" | "file_search_call" | "function_call" | "function_call_output" | "image_generation_call" | "item_reference" | "local_shell_call" | "local_shell_call_output" | "mcp_approval_request" | "mcp_approval_response" | "mcp_call" | "mcp_list_tools" | "message" | "reasoning" | "shell_call" | "shell_call_output" | "tool_search_call" | "tool_search_output" | "web_search_call"; diff --git a/crates/lingua/src/providers/anthropic/generated.rs b/crates/lingua/src/providers/anthropic/generated.rs index fa51e13b..0b8db7c4 100644 --- a/crates/lingua/src/providers/anthropic/generated.rs +++ b/crates/lingua/src/providers/anthropic/generated.rs @@ -419,6 +419,12 @@ pub enum Citations { #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, TS)] #[ts(export_to = "anthropic/")] pub struct RequestLocationCitation { + /// The full text of the cited block range, concatenated. + /// + /// Always equals the contents of `content[start_block_index:end_block_index]` joined + /// together. The text block is the minimal citable unit; this field is never a substring of + /// a single block. Not counted toward output tokens, and not counted toward input tokens + /// when sent back in subsequent turns. pub cited_text: String, #[serde(skip_serializing_if = "Option::is_none")] pub document_index: Option, @@ -434,8 +440,13 @@ pub struct RequestLocationCitation { pub end_page_number: Option, #[serde(skip_serializing_if = "Option::is_none")] pub start_page_number: Option, + /// Exclusive 0-based end index of the cited block range in the source's `content` array. + /// + /// Always greater than `start_block_index`; a single-block citation has `end_block_index = + /// start_block_index + 1`. #[serde(skip_serializing_if = "Option::is_none")] pub end_block_index: Option, + /// 0-based index of the first cited block in the source's `content` array. #[serde(skip_serializing_if = "Option::is_none")] pub start_block_index: Option, #[serde(skip_serializing_if = "Option::is_none")] @@ -444,6 +455,11 @@ pub struct RequestLocationCitation { pub title: Option, #[serde(skip_serializing_if = "Option::is_none")] pub url: Option, + /// 0-based index of the cited search result among all `search_result` content blocks in the + /// request, in the order they appear across messages and tool results. + /// + /// Counted separately from `document_index`; server-side web search results are not included + /// in this count. #[serde(skip_serializing_if = "Option::is_none")] pub search_result_index: Option, #[serde(skip_serializing_if = "Option::is_none")] @@ -1809,6 +1825,12 @@ pub struct ContentBlock { #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, TS)] #[ts(export_to = "anthropic/")] pub struct ResponseLocationCitation { + /// The full text of the cited block range, concatenated. + /// + /// Always equals the contents of `content[start_block_index:end_block_index]` joined + /// together. The text block is the minimal citable unit; this field is never a substring of + /// a single block. Not counted toward output tokens, and not counted toward input tokens + /// when sent back in subsequent turns. pub cited_text: String, #[serde(skip_serializing_if = "Option::is_none")] pub document_index: Option, @@ -1826,8 +1848,13 @@ pub struct ResponseLocationCitation { pub end_page_number: Option, #[serde(skip_serializing_if = "Option::is_none")] pub start_page_number: Option, + /// Exclusive 0-based end index of the cited block range in the source's `content` array. + /// + /// Always greater than `start_block_index`; a single-block citation has `end_block_index = + /// start_block_index + 1`. #[serde(skip_serializing_if = "Option::is_none")] pub end_block_index: Option, + /// 0-based index of the first cited block in the source's `content` array. #[serde(skip_serializing_if = "Option::is_none")] pub start_block_index: Option, #[serde(skip_serializing_if = "Option::is_none")] @@ -1836,6 +1863,11 @@ pub struct ResponseLocationCitation { pub title: Option, #[serde(skip_serializing_if = "Option::is_none")] pub url: Option, + /// 0-based index of the cited search result among all `search_result` content blocks in the + /// request, in the order they appear across messages and tool results. + /// + /// Counted separately from `document_index`; server-side web search results are not included + /// in this count. #[serde(skip_serializing_if = "Option::is_none")] pub search_result_index: Option, #[serde(skip_serializing_if = "Option::is_none")] diff --git a/crates/lingua/src/providers/google/generated.rs b/crates/lingua/src/providers/google/generated.rs index 7848c6f5..3be5562e 100644 --- a/crates/lingua/src/providers/google/generated.rs +++ b/crates/lingua/src/providers/google/generated.rs @@ -306,7 +306,10 @@ pub struct FunctionResponse { /// Required. The function response in JSON object format. Callers can use any keys of their /// choice that fit the function's syntax to return the function output, e.g. "output", /// "result", etc. In particular, if the function call failed to execute, the response can - /// have an "error" key to return error details to the model. + /// have an "error" key to return error details to the model. Multimedia can be included by + /// using a subobject containing a single "$ref" key whose value is the + /// `inline_data.display_name` of a `FunctionResponsePart` holding the multimedia. See + /// https://ai.google.dev/gemini-api/docs/function-calling#multimodal. #[ts(type = "unknown")] #[serde(skip_serializing_if = "Option::is_none")] pub response: Option>, @@ -574,6 +577,10 @@ pub struct GenerationConfig { /// vocabulary. #[serde(skip_serializing_if = "Option::is_none")] pub presence_penalty: Option, + /// Optional. Configuration for the response output format. Allows specifying output + /// configuration per modality (text, audio, image) in a flat structure. + #[serde(skip_serializing_if = "Option::is_none")] + pub response_format: Option, #[serde(rename = "responseJsonSchema")] #[ts(type = "unknown")] #[serde(skip_serializing_if = "Option::is_none")] @@ -677,6 +684,195 @@ pub enum MediaResolutionEnum { MediaResolutionUnspecified, } +/// Optional. Configuration for the response output format. Allows specifying output +/// configuration per modality (text, audio, image) in a flat structure. +/// +/// Configuration for the response output format. This is a flat object where each optional +/// sub-field configures a specific output modality. +#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize, TS)] +#[ts(export_to = "google/")] +pub struct ResponseFormatConfig { + /// Optional. Audio output format configuration. + #[serde(skip_serializing_if = "Option::is_none")] + pub audio: Option, + /// Optional. Image output format configuration. + #[serde(skip_serializing_if = "Option::is_none")] + pub image: Option, + /// Optional. Text output format configuration. + #[serde(skip_serializing_if = "Option::is_none")] + pub text: Option, +} + +/// Optional. Audio output format configuration. +/// +/// Configuration for audio output format. +#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize, TS)] +#[serde(rename_all = "camelCase")] +#[ts(export_to = "google/")] +pub struct AudioResponseFormat { + /// Optional. Bit rate in bits per second (bps). Only applicable for compressed formats (MP3, + /// Opus). + #[serde(skip_serializing_if = "Option::is_none")] + pub bit_rate: Option, + /// Optional. The delivery mode for the audio output. + #[serde(skip_serializing_if = "Option::is_none")] + pub delivery: Option, + /// Optional. The MIME type of the audio output. + #[serde(skip_serializing_if = "Option::is_none")] + pub mime_type: Option, + /// Optional. Sample rate in Hz. + #[serde(skip_serializing_if = "Option::is_none")] + pub sample_rate: Option, +} + +/// Optional. The delivery mode for the audio output. +/// +/// Optional. The delivery mode for the image output. +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, TS)] +#[serde(rename_all = "SCREAMING_SNAKE_CASE")] +#[ts(export_to = "google/")] +pub enum Delivery { + #[serde(rename = "DELIVERY_UNSPECIFIED")] + DeliveryUnspecified, + Inline, + Uri, +} + +/// Optional. The MIME type of the audio output. +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, TS)] +#[serde(rename_all = "SCREAMING_SNAKE_CASE")] +#[ts(export_to = "google/")] +pub enum AudioMimeType { + #[serde(rename = "AUDIO_ALAW")] + AudioAlaw, + #[serde(rename = "AUDIO_L16")] + AudioL16, + #[serde(rename = "AUDIO_MP3")] + AudioMp3, + #[serde(rename = "AUDIO_MULAW")] + AudioMulaw, + #[serde(rename = "AUDIO_OGG_OPUS")] + AudioOggOpus, + #[serde(rename = "AUDIO_WAV")] + AudioWav, + #[serde(rename = "MIME_TYPE_UNSPECIFIED")] + MimeTypeUnspecified, +} + +/// Optional. Image output format configuration. +/// +/// Configuration for image output format. +#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize, TS)] +#[serde(rename_all = "camelCase")] +#[ts(export_to = "google/")] +pub struct ImageResponseFormat { + /// Optional. The aspect ratio for the image output. + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// Optional. The delivery mode for the image output. + #[serde(skip_serializing_if = "Option::is_none")] + pub delivery: Option, + /// Optional. The size of the image output. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// Optional. The MIME type of the image output. + #[serde(skip_serializing_if = "Option::is_none")] + pub mime_type: Option, +} + +/// Optional. The aspect ratio for the image output. +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, TS)] +#[serde(rename_all = "SCREAMING_SNAKE_CASE")] +#[ts(export_to = "google/")] +pub enum AspectRatio { + #[serde(rename = "ASPECT_RATIO_EIGHT_BY_ONE")] + AspectRatioEightByOne, + #[serde(rename = "ASPECT_RATIO_FIVE_BY_FOUR")] + AspectRatioFiveByFour, + #[serde(rename = "ASPECT_RATIO_FOUR_BY_FIVE")] + AspectRatioFourByFive, + #[serde(rename = "ASPECT_RATIO_FOUR_BY_ONE")] + AspectRatioFourByOne, + #[serde(rename = "ASPECT_RATIO_FOUR_BY_THREE")] + AspectRatioFourByThree, + #[serde(rename = "ASPECT_RATIO_NINE_BY_SIXTEEN")] + AspectRatioNineBySixteen, + #[serde(rename = "ASPECT_RATIO_ONE_BY_EIGHT")] + AspectRatioOneByEight, + #[serde(rename = "ASPECT_RATIO_ONE_BY_FOUR")] + AspectRatioOneByFour, + #[serde(rename = "ASPECT_RATIO_ONE_BY_ONE")] + AspectRatioOneByOne, + #[serde(rename = "ASPECT_RATIO_SIXTEEN_BY_NINE")] + AspectRatioSixteenByNine, + #[serde(rename = "ASPECT_RATIO_THREE_BY_FOUR")] + AspectRatioThreeByFour, + #[serde(rename = "ASPECT_RATIO_THREE_BY_TWO")] + AspectRatioThreeByTwo, + #[serde(rename = "ASPECT_RATIO_TWENTY_ONE_BY_NINE")] + AspectRatioTwentyOneByNine, + #[serde(rename = "ASPECT_RATIO_TWO_BY_THREE")] + AspectRatioTwoByThree, + #[serde(rename = "ASPECT_RATIO_UNSPECIFIED")] + AspectRatioUnspecified, +} + +/// Optional. The size of the image output. +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, TS)] +#[serde(rename_all = "SCREAMING_SNAKE_CASE")] +#[ts(export_to = "google/")] +pub enum ImageSize { + #[serde(rename = "IMAGE_SIZE_FIVE_TWELVE")] + ImageSizeFiveTwelve, + #[serde(rename = "IMAGE_SIZE_FOUR_K")] + ImageSizeFourK, + #[serde(rename = "IMAGE_SIZE_ONE_K")] + ImageSizeOneK, + #[serde(rename = "IMAGE_SIZE_TWO_K")] + ImageSizeTwoK, + #[serde(rename = "IMAGE_SIZE_UNSPECIFIED")] + ImageSizeUnspecified, +} + +/// Optional. The MIME type of the image output. +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, TS)] +#[serde(rename_all = "SCREAMING_SNAKE_CASE")] +#[ts(export_to = "google/")] +pub enum ImageMimeType { + #[serde(rename = "IMAGE_JPEG")] + ImageJpeg, + #[serde(rename = "MIME_TYPE_UNSPECIFIED")] + MimeTypeUnspecified, +} + +/// Optional. Text output format configuration. +/// +/// Configuration for text output format. +#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize, TS)] +#[serde(rename_all = "camelCase")] +#[ts(export_to = "google/")] +pub struct TextResponseFormat { + /// Optional. The MIME type of the text output. + #[serde(skip_serializing_if = "Option::is_none")] + pub mime_type: Option, + #[ts(type = "unknown")] + #[serde(skip_serializing_if = "Option::is_none")] + pub schema: Option, +} + +/// Optional. The MIME type of the text output. +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, TS)] +#[serde(rename_all = "SCREAMING_SNAKE_CASE")] +#[ts(export_to = "google/")] +pub enum TextMimeType { + #[serde(rename = "APPLICATION_JSON")] + ApplicationJson, + #[serde(rename = "MIME_TYPE_UNSPECIFIED")] + MimeTypeUnspecified, + #[serde(rename = "TEXT_PLAIN")] + TextPlain, +} + #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, TS)] #[serde(rename_all = "SCREAMING_SNAKE_CASE")] #[ts(export_to = "google/")] @@ -992,6 +1188,8 @@ pub enum Threshold { } /// Optional. The service tier of the request. +/// +/// Output only. Service tier of the request. #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, TS)] #[serde(rename_all = "snake_case")] #[ts(export_to = "google/")] @@ -2107,6 +2305,9 @@ pub struct UsageMetadata { /// Output only. List of modalities that were processed in the request input. #[serde(skip_serializing_if = "Option::is_none")] pub prompt_tokens_details: Option>, + /// Output only. Service tier of the request. + #[serde(skip_serializing_if = "Option::is_none")] + pub service_tier: Option, /// Output only. Number of tokens of thoughts for thinking models. #[serde(skip_serializing_if = "Option::is_none")] pub thoughts_token_count: Option, diff --git a/crates/lingua/src/providers/openai/generated.rs b/crates/lingua/src/providers/openai/generated.rs index d592ab47..1525ad6d 100644 --- a/crates/lingua/src/providers/openai/generated.rs +++ b/crates/lingua/src/providers/openai/generated.rs @@ -59,12 +59,16 @@ pub struct CreateChatCompletionRequestClass { pub service_tier: Option, #[serde(skip_serializing_if = "Option::is_none")] pub temperature: Option, - /// An integer between 0 and 20 specifying the number of most likely tokens to - /// return at each token position, each with an associated log probability. + /// An integer between 0 and 20 specifying the maximum number of most likely + /// tokens to return at each token position, each with an associated log + /// probability. In some cases, the number of returned tokens may be fewer than + /// requested. /// /// - /// An integer between 0 and 20 specifying the number of most likely tokens to - /// return at each token position, each with an associated log probability. + /// An integer between 0 and 20 specifying the maximum number of most likely + /// tokens to return at each token position, each with an associated log + /// probability. In some cases, the number of returned tokens may be fewer than + /// requested. /// `logprobs` must be set to `true` if this parameter is used. #[serde(skip_serializing_if = "Option::is_none")] pub top_logprobs: Option, @@ -1287,8 +1291,8 @@ pub struct ChatCompletionTokenLogprob { pub logprob: f64, /// The token. pub token: String, - /// List of the most likely tokens and their log probability, at this token position. In rare - /// cases, there may be fewer than the number of requested `top_logprobs` returned. + /// List of the most likely tokens and their log probability, at this token position. The + /// number of entries may be fewer than the requested `top_logprobs`. pub top_logprobs: Vec, } @@ -1655,8 +1659,10 @@ pub struct CreateResponseClass { pub service_tier: Option, #[serde(skip_serializing_if = "Option::is_none")] pub temperature: Option, - /// An integer between 0 and 20 specifying the number of most likely tokens to - /// return at each token position, each with an associated log probability. + /// An integer between 0 and 20 specifying the maximum number of most likely + /// tokens to return at each token position, each with an associated log + /// probability. In some cases, the number of returned tokens may be fewer than + /// requested. #[serde(skip_serializing_if = "Option::is_none")] pub top_logprobs: Option, #[serde(skip_serializing_if = "Option::is_none")] @@ -1898,6 +1904,8 @@ pub enum InputParam { /// A call to a custom tool created by the model. /// /// +/// Compacts the current context. Must be the final input item. +/// /// An internal identifier for an item to reference. #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, TS)] #[ts(export, export_to = "openai/")] @@ -1993,6 +2001,9 @@ pub struct InputItem { /// /// /// The type of the custom tool call. Always `custom_tool_call`. + /// + /// + /// The type of the item. Always `compaction_trigger`. #[serde(rename = "type")] #[serde(skip_serializing_if = "Option::is_none")] pub input_item_type: Option, @@ -2309,6 +2320,9 @@ pub struct InputItemAction { /// The action type. /// /// + /// The action type. Always `open_page`. + /// + /// /// The type of the local shell action. Always `exec`. #[serde(rename = "type")] #[serde(skip_serializing_if = "Option::is_none")] @@ -2424,6 +2438,9 @@ pub enum ClickButtonType { /// The action type. /// /// +/// The action type. Always `open_page`. +/// +/// /// The type of the local shell action. Always `exec`. #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, TS)] #[serde(rename_all = "snake_case")] @@ -2963,6 +2980,8 @@ pub enum ToolSearchExecutionType { /// The type of the custom tool call. Always `custom_tool_call`. /// /// +/// The type of the item. Always `compaction_trigger`. +/// /// The type of item to reference. Always `item_reference`. #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, TS)] #[serde(rename_all = "snake_case")] @@ -2975,6 +2994,8 @@ pub enum InputItemType { #[serde(rename = "code_interpreter_call")] CodeInterpreterCall, Compaction, + #[serde(rename = "compaction_trigger")] + CompactionTrigger, #[serde(rename = "computer_call")] ComputerCall, #[serde(rename = "computer_call_output")] @@ -3648,10 +3669,17 @@ pub struct InputItemTool { /// or `auto`. Default: `auto`. #[serde(skip_serializing_if = "Option::is_none")] pub quality: Option, - /// The size of the generated image. One of `1024x1024`, `1024x1536`, - /// `1536x1024`, or `auto`. Default: `auto`. + /// The size of the generated images. For `gpt-image-2` and `gpt-image-2-2026-04-21`, + /// arbitrary resolutions are supported as `WIDTHxHEIGHT` strings, for example `1536x864`. + /// Width and height must both be divisible by 16 and the requested aspect ratio must be + /// between 1:3 and 3:1. Resolutions above `2560x1440` are experimental, and the maximum + /// supported resolution is `3840x2160`. The requested size must also satisfy the model's + /// current pixel and edge limits. The standard sizes `1024x1024`, `1536x1024`, and + /// `1024x1536` are supported by the GPT image models; `auto` is supported for models that + /// allow automatic sizing. For `dall-e-2`, use one of `256x256`, `512x512`, or `1024x1024`. + /// For `dall-e-3`, use one of `1024x1024`, `1792x1024`, or `1024x1792`. #[serde(skip_serializing_if = "Option::is_none")] - pub size: Option, + pub size: Option, /// The input format for the custom tool. Default is unconstrained text. #[serde(skip_serializing_if = "Option::is_none")] pub format: Option, @@ -4219,21 +4247,6 @@ pub enum SearchContentType { Text, } -/// The size of the generated image. One of `1024x1024`, `1024x1536`, -/// `1536x1024`, or `auto`. Default: `auto`. -#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, TS)] -#[serde(rename_all = "snake_case")] -#[ts(export_to = "openai/")] -pub enum Size { - Auto, - #[serde(rename = "1024x1024")] - The1024X1024, - #[serde(rename = "1024x1536")] - The1024X1536, - #[serde(rename = "1536x1024")] - The1536X1024, -} - /// The type of the function tool. Always `function`. /// /// The type of the file search tool. Always `file_search`. @@ -4916,10 +4929,10 @@ pub struct ImageGenTool { /// or `auto`. Default: `auto`. #[serde(skip_serializing_if = "Option::is_none")] pub quality: Option, - /// The size of the generated image. One of `1024x1024`, `1024x1536`, - /// `1536x1024`, or `auto`. Default: `auto`. + /// The size of the generated images. For `gpt-image-2` and `gpt-image-2-2026-04-21`, arbitrary resolutions are supported as `WIDTHxHEIGHT` strings, for example `1536x864`. Width and height must both be divisible by 16 and the requested aspect ratio must be between 1:3 and 3:1. Resolutions above `2560x1440` are experimental, and the maximum supported resolution is `3840x2160`. The requested size must also satisfy the model's current pixel and edge limits. The standard sizes `1024x1024`, `1536x1024`, and `1024x1536` are supported by the GPT image models; `auto` is supported for models that allow automatic sizing. For `dall-e-2`, use one of `256x256`, `512x512`, or `1024x1024`. For `dall-e-3`, use one of `1024x1024`, `1792x1024`, or `1024x1792`. #[serde(skip_serializing_if = "Option::is_none")] - pub size: Option, + #[ts(type = "unknown")] + pub size: Option, } /// A tool that allows the model to execute shell commands in a local environment. @@ -5715,6 +5728,9 @@ pub struct OutputItemAction { /// The action type. /// /// + /// The action type. Always `open_page`. + /// + /// /// Specifies the event type. For a click action, this property is always `click`. /// /// Specifies the event type. For a double click action, this property is always set to @@ -6339,10 +6355,17 @@ pub struct OutputItemTool { /// or `auto`. Default: `auto`. #[serde(skip_serializing_if = "Option::is_none")] pub quality: Option, - /// The size of the generated image. One of `1024x1024`, `1024x1536`, - /// `1536x1024`, or `auto`. Default: `auto`. + /// The size of the generated images. For `gpt-image-2` and `gpt-image-2-2026-04-21`, + /// arbitrary resolutions are supported as `WIDTHxHEIGHT` strings, for example `1536x864`. + /// Width and height must both be divisible by 16 and the requested aspect ratio must be + /// between 1:3 and 3:1. Resolutions above `2560x1440` are experimental, and the maximum + /// supported resolution is `3840x2160`. The requested size must also satisfy the model's + /// current pixel and edge limits. The standard sizes `1024x1024`, `1536x1024`, and + /// `1024x1536` are supported by the GPT image models; `auto` is supported for models that + /// allow automatic sizing. For `dall-e-2`, use one of `256x256`, `512x512`, or `1024x1024`. + /// For `dall-e-3`, use one of `1024x1024`, `1792x1024`, or `1024x1792`. #[serde(skip_serializing_if = "Option::is_none")] - pub size: Option, + pub size: Option, /// The input format for the custom tool. Default is unconstrained text. #[serde(skip_serializing_if = "Option::is_none")] pub format: Option, diff --git a/specs/anthropic/.stats.yml b/specs/anthropic/.stats.yml index 7027e4e5..c59f1a4b 100644 --- a/specs/anthropic/.stats.yml +++ b/specs/anthropic/.stats.yml @@ -1,4 +1,4 @@ -configured_endpoints: 91 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/anthropic/anthropic-ad9228826393d94e86ecf4c22853ae51b1d4094960c836238b3ab79a1044be32.yml -openapi_spec_hash: dc43ed54947d427a084a891b7c4a783a -config_hash: bbf09e23cb2e12b5bb8cbcee3044ceec +configured_endpoints: 106 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/anthropic/anthropic-56896df83861385b03a49bdf36623a811f5dedd599fdacf5680c73f9e73e1546.yml +openapi_spec_hash: e1812c6c53a1029d12b5d83ca50f4b78 +config_hash: 45b88a8e434814b9e6f4258be5804047 diff --git a/specs/anthropic/openapi.yml b/specs/anthropic/openapi.yml index c95fe4ee..ce79bc6c 100644 --- a/specs/anthropic/openapi.yml +++ b/specs/anthropic/openapi.yml @@ -2371,6 +2371,90 @@ } } }, + "/v1/skills/{skill_id}/versions/{version}/content?beta=true": { + "get": { + "summary": "Download Skill Version Content", + "description": "Download a skill version's content as a zip archive.", + "operationId": "beta_download_skill_version_content_v1_skills__skill_id__versions__version__content_get", + "parameters": [ + { + "name": "skill_id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "description": "Unique identifier for the skill.\n\nThe format and length of IDs may change over time.", + "title": "Skill Id" + }, + "description": "Unique identifier for the skill.\n\nThe format and length of IDs may change over time." + }, + { + "name": "version", + "in": "path", + "required": true, + "schema": { + "type": "string", + "description": "Version identifier for the skill.\n\nEach version is identified by a Unix epoch timestamp (e.g., \"1759178010641129\").", + "title": "Version" + }, + "description": "Version identifier for the skill.\n\nEach version is identified by a Unix epoch timestamp (e.g., \"1759178010641129\")." + }, + { + "name": "anthropic-beta", + "in": "header", + "required": false, + "schema": { + "type": "string", + "items": { "type": "string" }, + "description": "Optional header to specify the beta version(s) you want to use.\n\nTo use multiple betas, use a comma separated list like `beta1,beta2` or specify the header multiple times for each beta.", + "title": "Anthropic-Beta", + "x-stainless-override-schema": { + "x-stainless-param": "betas", + "x-stainless-extend-default": true, + "type": "array", + "description": "Optional header to specify the beta version(s) you want to use.", + "items": { "$ref": "#/components/schemas/AnthropicBeta" } + } + }, + "description": "Optional header to specify the beta version(s) you want to use.\n\nTo use multiple betas, use a comma separated list like `beta1,beta2` or specify the header multiple times for each beta." + }, + { + "name": "anthropic-version", + "in": "header", + "required": false, + "schema": { + "type": "string", + "description": "The version of the Claude API you want to use.\n\nRead more about versioning and our version history [here](https://docs.claude.com/en/api/versioning).", + "title": "Anthropic-Version" + }, + "description": "The version of the Claude API you want to use.\n\nRead more about versioning and our version history [here](https://docs.claude.com/en/api/versioning)." + }, + { + "name": "x-api-key", + "in": "header", + "required": false, + "schema": { + "type": "string", + "description": "Your unique API key for authentication.\n\nThis key is required in the header of all API requests, to authenticate your account and access Anthropic's services. Get your API key through the [Console](https://console.anthropic.com/settings/keys). Each key is scoped to a Workspace.", + "title": "X-Api-Key" + }, + "description": "Your unique API key for authentication.\n\nThis key is required in the header of all API requests, to authenticate your account and access Anthropic's services. Get your API key through the [Console](https://console.anthropic.com/settings/keys). Each key is scoped to a Workspace." + } + ], + "responses": { + "200": { + "description": "Successful Response", + "content": { "application/zip": { "schema": { "type": "string" } } } + }, + "4XX": { + "description": "Error response.\n\nSee our [errors documentation](https://docs.claude.com/en/api/errors) for more details.", + "content": { + "application/zip": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } + } + } + } + } + }, "/v1/environments?beta=true": { "post": { "summary": "Create Environment", @@ -2785,118 +2869,19 @@ } } }, - "/v1/sessions?beta=true": { - "post": { - "operationId": "BetaCreateSession", - "summary": "Create Session", - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/BetaManagedAgentsCreateSessionParams" } - } - } - }, - "responses": { - "200": { - "description": "Successful response (OK)", - "content": { - "application/json": { "schema": { "$ref": "#/components/schemas/BetaManagedAgentsSession" } } - } - }, - "400": { - "description": "Invalid argument - The client specified an invalid argument", - "content": { - "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } - } - }, - "401": { - "description": "Unauthenticated - The request does not have valid authentication credentials", - "content": { - "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } - } - }, - "403": { - "description": "Permission denied - The caller does not have permission to execute the specified operation", - "content": { - "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } - } - }, - "404": { - "description": "Not found - Some requested entity was not found", - "content": { - "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } - } - }, - "408": { - "description": "Deadline exceeded - The deadline expired before the operation could complete", - "content": { - "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } - } - }, - "409": { - "description": "Aborted - The operation was aborted due to concurrency issue", - "content": { - "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } - } - }, - "412": { - "description": "Failed precondition - Operation was rejected because the system is not in required state", - "content": { - "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } - } - }, - "413": { - "description": "Out of range - Operation was attempted past the valid range", - "content": { - "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } - } - }, - "429": { - "description": "Resource exhausted - Some resource has been exhausted (rate limiting)", - "content": { - "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } - } - }, - "431": { - "description": "Request header fields too large - Request metadata was too large", - "content": { - "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } - } - }, - "499": { - "description": "Cancelled - The operation was cancelled by the client", - "content": { - "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } - } - }, - "500": { - "description": "Internal - Internal server error", - "content": { - "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } - } - }, - "501": { - "description": "Unimplemented - The operation is not implemented or supported", - "content": { - "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } - } - }, - "503": { - "description": "Unavailable - The service is currently unavailable", - "content": { - "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } - } - }, - "504": { - "description": "Deadline exceeded - Upstream service did not respond in time", - "content": { - "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } - } - } - }, + "/v1/environments/{environment_id}/work/stats?beta=true": { + "get": { + "summary": "Get Queue Statistics", + "description": "Get statistics about the work queue for an environment.", + "operationId": "beta_get_environment_stats_v1_environments__environment_id__work_stats_get", "parameters": [ - { "name": "anthropic-version", "in": "header", "required": false, "schema": { "type": "string" } }, + { + "name": "environment_id", + "in": "path", + "required": true, + "schema": { "type": "string", "title": "Environment Id" }, + "example": "env_011CZkZ9X2dpNyB7HsEFoRfW" + }, { "name": "anthropic-beta", "in": "header", @@ -2904,6 +2889,8 @@ "schema": { "type": "string", "items": { "type": "string" }, + "description": "Optional header to specify the beta version(s) you want to use.\n\nTo use multiple betas, use a comma separated list like `beta1,beta2` or specify the header multiple times for each beta.", + "title": "Anthropic-Beta", "x-stainless-override-schema": { "x-stainless-param": "betas", "x-stainless-extend-default": true, @@ -2911,205 +2898,148 @@ "description": "Optional header to specify the beta version(s) you want to use.", "items": { "$ref": "#/components/schemas/AnthropicBeta" } } - } - } - ] - }, - "get": { - "operationId": "BetaListSessions", - "summary": "List Sessions", - "parameters": [ - { "name": "x-api-key", "in": "header", "required": false, "schema": { "type": "string" } }, - { "name": "anthropic-version", "in": "header", "required": false, "schema": { "type": "string" } }, + }, + "description": "Optional header to specify the beta version(s) you want to use.\n\nTo use multiple betas, use a comma separated list like `beta1,beta2` or specify the header multiple times for each beta." + }, { - "name": "anthropic-beta", + "name": "anthropic-version", "in": "header", "required": false, "schema": { "type": "string", - "items": { "type": "string" }, - "x-stainless-override-schema": { - "x-stainless-param": "betas", - "x-stainless-extend-default": true, - "type": "array", - "description": "Optional header to specify the beta version(s) you want to use.", - "items": { "$ref": "#/components/schemas/AnthropicBeta" } - } - } - }, - { - "name": "limit", - "in": "query", - "required": false, - "schema": { "type": "integer", "format": "int32" }, - "description": "Maximum number of results to return." + "description": "The version of the Claude API you want to use.\n\nRead more about versioning and our version history [here](https://docs.claude.com/en/api/versioning).", + "title": "Anthropic-Version" + }, + "description": "The version of the Claude API you want to use.\n\nRead more about versioning and our version history [here](https://docs.claude.com/en/api/versioning)." }, { - "name": "page", - "in": "query", + "name": "x-api-key", + "in": "header", "required": false, - "schema": { "type": "string" }, - "description": "Opaque pagination cursor from a previous response's next_page." + "schema": { "anyOf": [{ "type": "string" }, { "type": "null" }], "title": "X-Api-Key" } }, { - "name": "include_archived", - "in": "query", + "name": "authorization", + "in": "header", "required": false, - "schema": { "type": "boolean" }, - "description": "When true, includes archived sessions. Default: false (exclude archived)." - }, - { - "name": "created_at[gte]", - "in": "query", - "required": false, - "schema": { "$ref": "#/components/schemas/BetaTimestamp" }, - "description": "Return sessions created at or after this time (inclusive)." + "schema": { "anyOf": [{ "type": "string" }, { "type": "null" }], "title": "Authorization" } + } + ], + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/BetaSelfHostedWorkQueueStats" } + } + } }, + "4XX": { + "description": "Error response.\n\nSee our [errors documentation](https://docs.claude.com/en/api/errors) for more details.", + "content": { + "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } + } + } + } + } + }, + "/v1/environments/{environment_id}/work/poll?beta=true": { + "get": { + "summary": "Poll for Work", + "description": "Note: these endpoints are called automatically by the pre-built environment worker provided in the SDKs and CLI, for orchestrating sessions with self-hosted sandbox environments. They are included here as a reference; you do not need to invoke them directly.\n\nLong poll for work items in the queue.", + "operationId": "beta_poll_work_v1_environments__environment_id__work_poll_get", + "parameters": [ { - "name": "created_at[gt]", - "in": "query", - "required": false, - "schema": { "$ref": "#/components/schemas/BetaTimestamp" }, - "description": "Return sessions created after this time (exclusive)." + "name": "environment_id", + "in": "path", + "required": true, + "schema": { "type": "string", "title": "Environment Id" }, + "example": "env_011CZkZ9X2dpNyB7HsEFoRfW" }, { - "name": "created_at[lte]", + "name": "block_ms", "in": "query", "required": false, - "schema": { "$ref": "#/components/schemas/BetaTimestamp" }, - "description": "Return sessions created at or before this time (inclusive)." + "schema": { + "anyOf": [{ "type": "integer", "minimum": 1 }, { "type": "null" }], + "description": "How long to wait for work to arrive before returning. Must be 1-999 in milliseconds. Defaults to non-blocking (returns immediately if no work is available).", + "title": "Block Ms" + }, + "description": "How long to wait for work to arrive before returning. Must be 1-999 in milliseconds. Defaults to non-blocking (returns immediately if no work is available)." }, { - "name": "created_at[lt]", + "name": "reclaim_older_than_ms", "in": "query", "required": false, - "schema": { "$ref": "#/components/schemas/BetaTimestamp" }, - "description": "Return sessions created before this time (exclusive)." + "schema": { + "anyOf": [{ "type": "integer", "minimum": 1 }, { "type": "null" }], + "description": "Reclaim unacknowledged work items older than this many milliseconds. If omitted, uses the default (5000ms).", + "title": "Reclaim Older Than Ms" + }, + "description": "Reclaim unacknowledged work items older than this many milliseconds. If omitted, uses the default (5000ms)." }, { - "name": "agent_id", - "in": "query", + "name": "anthropic-beta", + "in": "header", "required": false, - "schema": { "type": "string" }, - "description": "Filter sessions created with this agent ID." + "schema": { + "type": "string", + "items": { "type": "string" }, + "description": "Optional header to specify the beta version(s) you want to use.\n\nTo use multiple betas, use a comma separated list like `beta1,beta2` or specify the header multiple times for each beta.", + "title": "Anthropic-Beta", + "x-stainless-override-schema": { + "x-stainless-param": "betas", + "x-stainless-extend-default": true, + "type": "array", + "description": "Optional header to specify the beta version(s) you want to use.", + "items": { "$ref": "#/components/schemas/AnthropicBeta" } + } + }, + "description": "Optional header to specify the beta version(s) you want to use.\n\nTo use multiple betas, use a comma separated list like `beta1,beta2` or specify the header multiple times for each beta." }, { - "name": "agent_version", - "in": "query", + "name": "anthropic-version", + "in": "header", "required": false, - "schema": { "type": "integer", "format": "int32" }, - "description": "Filter by agent version. Only applies when agent_id is also set." + "schema": { + "type": "string", + "description": "The version of the Claude API you want to use.\n\nRead more about versioning and our version history [here](https://docs.claude.com/en/api/versioning).", + "title": "Anthropic-Version" + }, + "description": "The version of the Claude API you want to use.\n\nRead more about versioning and our version history [here](https://docs.claude.com/en/api/versioning)." }, { - "name": "order", - "in": "query", + "name": "Anthropic-Worker-ID", + "in": "header", "required": false, - "schema": { "$ref": "#/components/schemas/BetaManagedAgentsListOrder" }, - "description": "Sort direction for results, ordered by created_at. Defaults to desc (newest first)." + "schema": { + "anyOf": [{ "type": "string" }, { "type": "null" }], + "description": "Unique identifier for the specific worker polling, used to track aggregated environment-level work metrics in Console", + "title": "Anthropic-Worker-Id" + }, + "description": "Unique identifier for the specific worker polling, used to track aggregated environment-level work metrics in Console" }, { - "name": "memory_store_id", - "in": "query", + "name": "authorization", + "in": "header", "required": false, - "schema": { "type": "string" }, - "description": "Filter sessions whose resources contain a memory_store with this memory store ID." + "schema": { "anyOf": [{ "type": "string" }, { "type": "null" }], "title": "Authorization" } } ], "responses": { "200": { - "description": "Successful response (OK)", + "description": "Successful Response", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/BetaManagedAgentsListSessions" } + "schema": { + "anyOf": [{ "$ref": "#/components/schemas/BetaSelfHostedWork" }, { "type": "null" }], + "title": "Response Poll Work V1 Environments Environment Id Work Poll Get" + } } } }, - "400": { - "description": "Invalid argument - The client specified an invalid argument", - "content": { - "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } - } - }, - "401": { - "description": "Unauthenticated - The request does not have valid authentication credentials", - "content": { - "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } - } - }, - "403": { - "description": "Permission denied - The caller does not have permission to execute the specified operation", - "content": { - "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } - } - }, - "404": { - "description": "Not found - Some requested entity was not found", - "content": { - "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } - } - }, - "408": { - "description": "Deadline exceeded - The deadline expired before the operation could complete", - "content": { - "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } - } - }, - "409": { - "description": "Aborted - The operation was aborted due to concurrency issue", - "content": { - "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } - } - }, - "412": { - "description": "Failed precondition - Operation was rejected because the system is not in required state", - "content": { - "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } - } - }, - "413": { - "description": "Out of range - Operation was attempted past the valid range", - "content": { - "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } - } - }, - "429": { - "description": "Resource exhausted - Some resource has been exhausted (rate limiting)", - "content": { - "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } - } - }, - "431": { - "description": "Request header fields too large - Request metadata was too large", - "content": { - "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } - } - }, - "499": { - "description": "Cancelled - The operation was cancelled by the client", - "content": { - "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } - } - }, - "500": { - "description": "Internal - Internal server error", - "content": { - "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } - } - }, - "501": { - "description": "Unimplemented - The operation is not implemented or supported", - "content": { - "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } - } - }, - "503": { - "description": "Unavailable - The service is currently unavailable", - "content": { - "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } - } - }, - "504": { - "description": "Deadline exceeded - Upstream service did not respond in time", + "4XX": { + "description": "Error response.\n\nSee our [errors documentation](https://docs.claude.com/en/api/errors) for more details.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } } @@ -3117,13 +3047,25 @@ } } }, - "/v1/sessions/{session_id}?beta=true": { - "get": { - "operationId": "BetaGetSession", - "summary": "Get Session", + "/v1/environments/{environment_id}/work/{work_id}/ack?beta=true": { + "post": { + "summary": "Acknowledge Work", + "description": "Note: these endpoints are called automatically by the pre-built environment worker provided in the SDKs and CLI, for orchestrating sessions with self-hosted sandbox environments. They are included here as a reference; you do not need to invoke them directly.\n\nAcknowledge receipt of a work item, transitioning it from 'queued' to 'starting' and removing it from the queue.", + "operationId": "beta_acknowledge_work_v1_environments__environment_id__work__work_id__ack_post", "parameters": [ - { "name": "x-api-key", "in": "header", "required": false, "schema": { "type": "string" } }, - { "name": "anthropic-version", "in": "header", "required": false, "schema": { "type": "string" } }, + { + "name": "environment_id", + "in": "path", + "required": true, + "schema": { "type": "string", "title": "Environment Id" }, + "example": "env_011CZkZ9X2dpNyB7HsEFoRfW" + }, + { + "name": "work_id", + "in": "path", + "required": true, + "schema": { "type": "string", "title": "Work Id" } + }, { "name": "anthropic-beta", "in": "header", @@ -3131,6 +3073,8 @@ "schema": { "type": "string", "items": { "type": "string" }, + "description": "Optional header to specify the beta version(s) you want to use.\n\nTo use multiple betas, use a comma separated list like `beta1,beta2` or specify the header multiple times for each beta.", + "title": "Anthropic-Beta", "x-stainless-override-schema": { "x-stainless-param": "betas", "x-stainless-extend-default": true, @@ -3138,110 +3082,292 @@ "description": "Optional header to specify the beta version(s) you want to use.", "items": { "$ref": "#/components/schemas/AnthropicBeta" } } - } + }, + "description": "Optional header to specify the beta version(s) you want to use.\n\nTo use multiple betas, use a comma separated list like `beta1,beta2` or specify the header multiple times for each beta." }, { - "name": "session_id", - "in": "path", - "required": true, - "schema": { "type": "string" }, - "description": "Path parameter session_id", - "example": "sesn_011CZkZAtmR3yMPDzynEDxu7" + "name": "anthropic-version", + "in": "header", + "required": false, + "schema": { + "type": "string", + "description": "The version of the Claude API you want to use.\n\nRead more about versioning and our version history [here](https://docs.claude.com/en/api/versioning).", + "title": "Anthropic-Version" + }, + "description": "The version of the Claude API you want to use.\n\nRead more about versioning and our version history [here](https://docs.claude.com/en/api/versioning)." + }, + { + "name": "authorization", + "in": "header", + "required": false, + "schema": { "anyOf": [{ "type": "string" }, { "type": "null" }], "title": "Authorization" } } ], "responses": { "200": { - "description": "Successful response (OK)", + "description": "Successful Response", "content": { - "application/json": { "schema": { "$ref": "#/components/schemas/BetaManagedAgentsSession" } } + "application/json": { "schema": { "$ref": "#/components/schemas/BetaSelfHostedWork" } } } }, - "400": { - "description": "Invalid argument - The client specified an invalid argument", + "4XX": { + "description": "Error response.\n\nSee our [errors documentation](https://docs.claude.com/en/api/errors) for more details.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } } + } + } + } + }, + "/v1/environments/{environment_id}/work/{work_id}/heartbeat?beta=true": { + "post": { + "summary": "Record Heartbeat", + "description": "Note: these endpoints are called automatically by the pre-built environment worker provided in the SDKs and CLI, for orchestrating sessions with self-hosted sandbox environments. They are included here as a reference; you do not need to invoke them directly.\n\nRecord a heartbeat for a work item to maintain the lease.", + "operationId": "beta_record_heartbeat_v1_environments__environment_id__work__work_id__heartbeat_post", + "parameters": [ + { + "name": "environment_id", + "in": "path", + "required": true, + "schema": { "type": "string", "title": "Environment Id" }, + "example": "env_011CZkZ9X2dpNyB7HsEFoRfW" }, - "401": { - "description": "Unauthenticated - The request does not have valid authentication credentials", - "content": { - "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } - } + { + "name": "work_id", + "in": "path", + "required": true, + "schema": { "type": "string", "title": "Work Id" } }, - "403": { - "description": "Permission denied - The caller does not have permission to execute the specified operation", - "content": { - "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } - } + { + "name": "desired_ttl_seconds", + "in": "query", + "required": false, + "schema": { + "anyOf": [{ "type": "integer" }, { "type": "null" }], + "description": "Desired TTL in seconds", + "title": "Desired Ttl Seconds" + }, + "description": "Desired TTL in seconds" }, - "404": { - "description": "Not found - Some requested entity was not found", - "content": { - "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } + { + "name": "expected_last_heartbeat", + "in": "query", + "required": false, + "schema": { + "anyOf": [{ "type": "string" }, { "type": "null" }], + "description": "Expected last_heartbeat for conditional update (optimistic concurrency). Use literal 'NO_HEARTBEAT' to claim an unclaimed lease (first heartbeat). For subsequent heartbeats, echo the server's previous last_heartbeat value exactly. Returns 412 Precondition Failed if the actual value doesn't match.", + "title": "Expected Last Heartbeat" + }, + "description": "Expected last_heartbeat for conditional update (optimistic concurrency). Use literal 'NO_HEARTBEAT' to claim an unclaimed lease (first heartbeat). For subsequent heartbeats, echo the server's previous last_heartbeat value exactly. Returns 412 Precondition Failed if the actual value doesn't match.", + "examples": { + "first_claim": { + "summary": "First heartbeat (claim unclaimed lease)", + "value": "NO_HEARTBEAT" + }, + "subsequent": { + "summary": "Subsequent heartbeat (echo server's value)", + "value": "2026-05-14T10:30:45.123456Z" + } } }, - "408": { - "description": "Deadline exceeded - The deadline expired before the operation could complete", - "content": { - "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } - } + { + "name": "anthropic-beta", + "in": "header", + "required": false, + "schema": { + "type": "string", + "items": { "type": "string" }, + "description": "Optional header to specify the beta version(s) you want to use.\n\nTo use multiple betas, use a comma separated list like `beta1,beta2` or specify the header multiple times for each beta.", + "title": "Anthropic-Beta", + "x-stainless-override-schema": { + "x-stainless-param": "betas", + "x-stainless-extend-default": true, + "type": "array", + "description": "Optional header to specify the beta version(s) you want to use.", + "items": { "$ref": "#/components/schemas/AnthropicBeta" } + } + }, + "description": "Optional header to specify the beta version(s) you want to use.\n\nTo use multiple betas, use a comma separated list like `beta1,beta2` or specify the header multiple times for each beta." }, - "409": { - "description": "Aborted - The operation was aborted due to concurrency issue", - "content": { - "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } - } + { + "name": "anthropic-version", + "in": "header", + "required": false, + "schema": { + "type": "string", + "description": "The version of the Claude API you want to use.\n\nRead more about versioning and our version history [here](https://docs.claude.com/en/api/versioning).", + "title": "Anthropic-Version" + }, + "description": "The version of the Claude API you want to use.\n\nRead more about versioning and our version history [here](https://docs.claude.com/en/api/versioning)." }, - "412": { - "description": "Failed precondition - Operation was rejected because the system is not in required state", + { + "name": "authorization", + "in": "header", + "required": false, + "schema": { "anyOf": [{ "type": "string" }, { "type": "null" }], "title": "Authorization" } + } + ], + "responses": { + "200": { + "description": "Successful Response", "content": { - "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } + "application/json": { + "schema": { "$ref": "#/components/schemas/BetaSelfHostedWorkHeartbeatResponse" } + } } }, - "413": { - "description": "Out of range - Operation was attempted past the valid range", + "4XX": { + "description": "Error response.\n\nSee our [errors documentation](https://docs.claude.com/en/api/errors) for more details.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } } + } + } + } + }, + "/v1/environments/{environment_id}/work/{work_id}/stop?beta=true": { + "post": { + "summary": "Stop Work", + "description": "Note: these endpoints are called automatically by the pre-built environment worker provided in the SDKs and CLI, for orchestrating sessions with self-hosted sandbox environments. They are included here as a reference; you do not need to invoke them directly.\n\nStop a work item, initiating graceful or forced shutdown.", + "operationId": "beta_stop_work_v1_environments__environment_id__work__work_id__stop_post", + "parameters": [ + { + "name": "environment_id", + "in": "path", + "required": true, + "schema": { "type": "string", "title": "Environment Id" }, + "example": "env_011CZkZ9X2dpNyB7HsEFoRfW" }, - "429": { - "description": "Resource exhausted - Some resource has been exhausted (rate limiting)", - "content": { - "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } - } + { + "name": "work_id", + "in": "path", + "required": true, + "schema": { "type": "string", "title": "Work Id" } }, - "431": { - "description": "Request header fields too large - Request metadata was too large", - "content": { - "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } - } + { + "name": "anthropic-beta", + "in": "header", + "required": false, + "schema": { + "type": "string", + "items": { "type": "string" }, + "description": "Optional header to specify the beta version(s) you want to use.\n\nTo use multiple betas, use a comma separated list like `beta1,beta2` or specify the header multiple times for each beta.", + "title": "Anthropic-Beta", + "x-stainless-override-schema": { + "x-stainless-param": "betas", + "x-stainless-extend-default": true, + "type": "array", + "description": "Optional header to specify the beta version(s) you want to use.", + "items": { "$ref": "#/components/schemas/AnthropicBeta" } + } + }, + "description": "Optional header to specify the beta version(s) you want to use.\n\nTo use multiple betas, use a comma separated list like `beta1,beta2` or specify the header multiple times for each beta." }, - "499": { - "description": "Cancelled - The operation was cancelled by the client", - "content": { - "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } - } + { + "name": "anthropic-version", + "in": "header", + "required": false, + "schema": { + "type": "string", + "description": "The version of the Claude API you want to use.\n\nRead more about versioning and our version history [here](https://docs.claude.com/en/api/versioning).", + "title": "Anthropic-Version" + }, + "description": "The version of the Claude API you want to use.\n\nRead more about versioning and our version history [here](https://docs.claude.com/en/api/versioning)." }, - "500": { - "description": "Internal - Internal server error", + { + "name": "authorization", + "in": "header", + "required": false, + "schema": { "anyOf": [{ "type": "string" }, { "type": "null" }], "title": "Authorization" } + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { "schema": { "$ref": "#/components/schemas/BetaSelfHostedWorkStopRequest" } } + } + }, + "responses": { + "200": { + "description": "Successful Response", "content": { - "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } + "application/json": { "schema": { "$ref": "#/components/schemas/BetaSelfHostedWork" } } } }, - "501": { - "description": "Unimplemented - The operation is not implemented or supported", + "4XX": { + "description": "Error response.\n\nSee our [errors documentation](https://docs.claude.com/en/api/errors) for more details.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } } + } + } + } + }, + "/v1/environments/{environment_id}/work/{work_id}?beta=true": { + "get": { + "summary": "Get Work Item", + "description": "Note: these endpoints are called automatically by the pre-built environment worker provided in the SDKs and CLI, for orchestrating sessions with self-hosted sandbox environments. They are included here as a reference; you do not need to invoke them directly.\n\nRetrieve detailed information about a specific work item.", + "operationId": "beta_get_work_v1_environments__environment_id__work__work_id__get", + "parameters": [ + { + "name": "environment_id", + "in": "path", + "required": true, + "schema": { "type": "string", "title": "Environment Id" }, + "example": "env_011CZkZ9X2dpNyB7HsEFoRfW" }, - "503": { - "description": "Unavailable - The service is currently unavailable", + { + "name": "work_id", + "in": "path", + "required": true, + "schema": { "type": "string", "title": "Work Id" } + }, + { + "name": "anthropic-beta", + "in": "header", + "required": false, + "schema": { + "type": "string", + "items": { "type": "string" }, + "description": "Optional header to specify the beta version(s) you want to use.\n\nTo use multiple betas, use a comma separated list like `beta1,beta2` or specify the header multiple times for each beta.", + "title": "Anthropic-Beta", + "x-stainless-override-schema": { + "x-stainless-param": "betas", + "x-stainless-extend-default": true, + "type": "array", + "description": "Optional header to specify the beta version(s) you want to use.", + "items": { "$ref": "#/components/schemas/AnthropicBeta" } + } + }, + "description": "Optional header to specify the beta version(s) you want to use.\n\nTo use multiple betas, use a comma separated list like `beta1,beta2` or specify the header multiple times for each beta." + }, + { + "name": "anthropic-version", + "in": "header", + "required": false, + "schema": { + "type": "string", + "description": "The version of the Claude API you want to use.\n\nRead more about versioning and our version history [here](https://docs.claude.com/en/api/versioning).", + "title": "Anthropic-Version" + }, + "description": "The version of the Claude API you want to use.\n\nRead more about versioning and our version history [here](https://docs.claude.com/en/api/versioning)." + }, + { + "name": "x-api-key", + "in": "header", + "required": false, + "schema": { "anyOf": [{ "type": "string" }, { "type": "null" }], "title": "X-Api-Key" } + } + ], + "responses": { + "200": { + "description": "Successful Response", "content": { - "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } + "application/json": { "schema": { "$ref": "#/components/schemas/BetaSelfHostedWork" } } } }, - "504": { - "description": "Deadline exceeded - Upstream service did not respond in time", + "4XX": { + "description": "Error response.\n\nSee our [errors documentation](https://docs.claude.com/en/api/errors) for more details.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } } @@ -3249,10 +3375,23 @@ } }, "post": { - "operationId": "BetaUpdateSession", - "summary": "Update Session", + "summary": "Update Work Item", + "description": "Note: these endpoints are called automatically by the pre-built environment worker provided in the SDKs and CLI, for orchestrating sessions with self-hosted sandbox environments. They are included here as a reference; you do not need to invoke them directly.\n\nUpdate work item metadata with merge semantics.", + "operationId": "beta_update_work_v1_environments__environment_id__work__work_id__post", "parameters": [ - { "name": "anthropic-version", "in": "header", "required": false, "schema": { "type": "string" } }, + { + "name": "environment_id", + "in": "path", + "required": true, + "schema": { "type": "string", "title": "Environment Id" }, + "example": "env_011CZkZ9X2dpNyB7HsEFoRfW" + }, + { + "name": "work_id", + "in": "path", + "required": true, + "schema": { "type": "string", "title": "Work Id" } + }, { "name": "anthropic-beta", "in": "header", @@ -3260,6 +3399,8 @@ "schema": { "type": "string", "items": { "type": "string" }, + "description": "Optional header to specify the beta version(s) you want to use.\n\nTo use multiple betas, use a comma separated list like `beta1,beta2` or specify the header multiple times for each beta.", + "title": "Anthropic-Beta", "x-stainless-override-schema": { "x-stainless-param": "betas", "x-stainless-extend-default": true, @@ -3267,45 +3408,169 @@ "description": "Optional header to specify the beta version(s) you want to use.", "items": { "$ref": "#/components/schemas/AnthropicBeta" } } - } + }, + "description": "Optional header to specify the beta version(s) you want to use.\n\nTo use multiple betas, use a comma separated list like `beta1,beta2` or specify the header multiple times for each beta." }, { - "name": "session_id", - "in": "path", - "required": true, - "schema": { "type": "string", "x-stainless-cli-data-alias": "id" }, - "description": "Path parameter session_id", - "example": "sesn_011CZkZAtmR3yMPDzynEDxu7" + "name": "anthropic-version", + "in": "header", + "required": false, + "schema": { + "type": "string", + "description": "The version of the Claude API you want to use.\n\nRead more about versioning and our version history [here](https://docs.claude.com/en/api/versioning).", + "title": "Anthropic-Version" + }, + "description": "The version of the Claude API you want to use.\n\nRead more about versioning and our version history [here](https://docs.claude.com/en/api/versioning)." } ], "requestBody": { "required": true, "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/BetaManagedAgentsUpdateSessionParams" } + "schema": { "$ref": "#/components/schemas/BetaSelfHostedWorkUpdateRequest" } } } }, "responses": { "200": { - "description": "Successful response (OK)", - "content": { - "application/json": { "schema": { "$ref": "#/components/schemas/BetaManagedAgentsSession" } } - } - }, - "400": { - "description": "Invalid argument - The client specified an invalid argument", + "description": "Successful Response", "content": { - "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } + "application/json": { "schema": { "$ref": "#/components/schemas/BetaSelfHostedWork" } } } }, - "401": { - "description": "Unauthenticated - The request does not have valid authentication credentials", + "4XX": { + "description": "Error response.\n\nSee our [errors documentation](https://docs.claude.com/en/api/errors) for more details.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } } - }, - "403": { + } + } + } + }, + "/v1/environments/{environment_id}/work?beta=true": { + "get": { + "summary": "List Work Items", + "description": "Note: these endpoints are called automatically by the pre-built environment worker provided in the SDKs and CLI, for orchestrating sessions with self-hosted sandbox environments. They are included here as a reference; you do not need to invoke them directly.\n\nList work items in an environment.", + "operationId": "beta_list_work_v1_environments__environment_id__work_get", + "parameters": [ + { + "name": "environment_id", + "in": "path", + "required": true, + "schema": { "type": "string", "title": "Environment Id" }, + "example": "env_011CZkZ9X2dpNyB7HsEFoRfW" + }, + { + "name": "limit", + "in": "query", + "required": false, + "schema": { + "type": "integer", + "maximum": 1000, + "minimum": 1, + "description": "Maximum number of work items to return", + "default": 20, + "title": "Limit" + }, + "description": "Maximum number of work items to return" + }, + { + "name": "page", + "in": "query", + "required": false, + "schema": { + "anyOf": [{ "type": "string" }, { "type": "null" }], + "description": "Opaque cursor from previous response for pagination", + "x-stainless-pagination-property": { "purpose": "next_cursor_param" }, + "title": "Page" + }, + "description": "Opaque cursor from previous response for pagination" + }, + { + "name": "anthropic-beta", + "in": "header", + "required": false, + "schema": { + "type": "string", + "items": { "type": "string" }, + "description": "Optional header to specify the beta version(s) you want to use.\n\nTo use multiple betas, use a comma separated list like `beta1,beta2` or specify the header multiple times for each beta.", + "title": "Anthropic-Beta", + "x-stainless-override-schema": { + "x-stainless-param": "betas", + "x-stainless-extend-default": true, + "type": "array", + "description": "Optional header to specify the beta version(s) you want to use.", + "items": { "$ref": "#/components/schemas/AnthropicBeta" } + } + }, + "description": "Optional header to specify the beta version(s) you want to use.\n\nTo use multiple betas, use a comma separated list like `beta1,beta2` or specify the header multiple times for each beta." + }, + { + "name": "anthropic-version", + "in": "header", + "required": false, + "schema": { + "type": "string", + "description": "The version of the Claude API you want to use.\n\nRead more about versioning and our version history [here](https://docs.claude.com/en/api/versioning).", + "title": "Anthropic-Version" + }, + "description": "The version of the Claude API you want to use.\n\nRead more about versioning and our version history [here](https://docs.claude.com/en/api/versioning)." + }, + { + "name": "authorization", + "in": "header", + "required": false, + "schema": { "anyOf": [{ "type": "string" }, { "type": "null" }], "title": "Authorization" } + } + ], + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/BetaSelfHostedWorkListResponse" } + } + } + }, + "4XX": { + "description": "Error response.\n\nSee our [errors documentation](https://docs.claude.com/en/api/errors) for more details.", + "content": { + "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } + } + } + } + } + }, + "/v1/user_profiles?beta=true": { + "post": { + "operationId": "BetaCreateUserProfile", + "summary": "Create User Profile", + "requestBody": { + "required": true, + "content": { + "application/json": { "schema": { "$ref": "#/components/schemas/BetaCreateUserProfileRequest" } } + } + }, + "responses": { + "200": { + "description": "Successful response (OK)", + "content": { + "application/json": { "schema": { "$ref": "#/components/schemas/BetaUserProfile" } } + } + }, + "400": { + "description": "Invalid argument - The client specified an invalid argument", + "content": { + "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } + } + }, + "401": { + "description": "Unauthenticated - The request does not have valid authentication credentials", + "content": { + "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } + } + }, + "403": { "description": "Permission denied - The caller does not have permission to execute the specified operation", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } @@ -3383,11 +3648,30 @@ "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } } } - } + }, + "parameters": [ + { "name": "anthropic-version", "in": "header", "required": false, "schema": { "type": "string" } }, + { + "name": "anthropic-beta", + "in": "header", + "required": false, + "schema": { + "type": "string", + "items": { "type": "string" }, + "x-stainless-override-schema": { + "x-stainless-param": "betas", + "x-stainless-extend-default": true, + "type": "array", + "description": "Optional header to specify the beta version(s) you want to use.", + "items": { "$ref": "#/components/schemas/AnthropicBeta" } + } + } + } + ] }, - "delete": { - "operationId": "BetaDeleteSession", - "summary": "Delete Session", + "get": { + "operationId": "BetaListUserProfiles", + "summary": "List User Profiles", "parameters": [ { "name": "x-api-key", "in": "header", "required": false, "schema": { "type": "string" } }, { "name": "anthropic-version", "in": "header", "required": false, "schema": { "type": "string" } }, @@ -3408,12 +3692,25 @@ } }, { - "name": "session_id", - "in": "path", - "required": true, + "name": "limit", + "in": "query", + "required": false, + "schema": { "type": "integer", "format": "int32" }, + "description": "Query parameter for limit" + }, + { + "name": "page", + "in": "query", + "required": false, "schema": { "type": "string" }, - "description": "Path parameter session_id", - "example": "sesn_011CZkZAtmR3yMPDzynEDxu7" + "description": "Query parameter for page" + }, + { + "name": "order", + "in": "query", + "required": false, + "schema": { "$ref": "#/components/schemas/BetaUserProfileListOrder" }, + "description": "Query parameter for order" } ], "responses": { @@ -3421,7 +3718,7 @@ "description": "Successful response (OK)", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/BetaManagedAgentsDeletedSession" } + "schema": { "$ref": "#/components/schemas/BetaListUserProfilesResponse" } } } }, @@ -3518,10 +3815,10 @@ } } }, - "/v1/sessions/{session_id}/events?beta=true": { + "/v1/user_profiles/{user_profile_id}?beta=true": { "get": { - "operationId": "BetaListEvents", - "summary": "List Events", + "operationId": "BetaGetUserProfile", + "summary": "Get User Profile", "parameters": [ { "name": "x-api-key", "in": "header", "required": false, "schema": { "type": "string" } }, { "name": "anthropic-version", "in": "header", "required": false, "schema": { "type": "string" } }, @@ -3542,42 +3839,19 @@ } }, { - "name": "session_id", + "name": "user_profile_id", "in": "path", "required": true, "schema": { "type": "string" }, - "description": "Path parameter session_id", - "example": "sesn_011CZkZAtmR3yMPDzynEDxu7" - }, - { - "name": "limit", - "in": "query", - "required": false, - "schema": { "type": "integer", "format": "int32" }, - "description": "Query parameter for limit" - }, - { - "name": "page", - "in": "query", - "required": false, - "schema": { "type": "string" }, - "description": "Opaque pagination cursor from a previous response's next_page." - }, - { - "name": "order", - "in": "query", - "required": false, - "schema": { "$ref": "#/components/schemas/BetaManagedAgentsListOrder" }, - "description": "Sort direction for results, ordered by created_at. Defaults to asc (chronological)." + "description": "Path parameter user_profile_id", + "example": "uprof_011CZkZCu8hGbp5mYRQgUmz9" } ], "responses": { "200": { "description": "Successful response (OK)", "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/BetaManagedAgentsListSessionEvents" } - } + "application/json": { "schema": { "$ref": "#/components/schemas/BetaUserProfile" } } } }, "400": { @@ -3673,8 +3947,8 @@ } }, "post": { - "operationId": "BetaSendEvents", - "summary": "Send Events", + "operationId": "BetaUpdateUserProfile", + "summary": "Update User Profile", "parameters": [ { "name": "anthropic-version", "in": "header", "required": false, "schema": { "type": "string" } }, { @@ -3694,19 +3968,19 @@ } }, { - "name": "session_id", + "name": "user_profile_id", "in": "path", "required": true, "schema": { "type": "string" }, - "description": "Path parameter session_id", - "example": "sesn_011CZkZAtmR3yMPDzynEDxu7" + "description": "Path parameter user_profile_id", + "example": "uprof_011CZkZCu8hGbp5mYRQgUmz9" } ], "requestBody": { "required": true, "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/BetaManagedAgentsSendSessionEventsParams" } + "schema": { "$ref": "#/components/schemas/BetaUpdateUserProfileRequestBody" } } } }, @@ -3714,9 +3988,7 @@ "200": { "description": "Successful response (OK)", "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/BetaManagedAgentsSendSessionEvents" } - } + "application/json": { "schema": { "$ref": "#/components/schemas/BetaUserProfile" } } } }, "400": { @@ -3812,12 +4084,11 @@ } } }, - "/v1/sessions/{session_id}/events/stream?beta=true": { - "get": { - "operationId": "BetaStreamSessionEvents", - "summary": "Stream Events", + "/v1/user_profiles/{user_profile_id}/enrollment_url?beta=true": { + "post": { + "operationId": "BetaCreateEnrollmentUrl", + "summary": "Create Enrollment URL", "parameters": [ - { "name": "x-api-key", "in": "header", "required": false, "schema": { "type": "string" } }, { "name": "anthropic-version", "in": "header", "required": false, "schema": { "type": "string" } }, { "name": "anthropic-beta", @@ -3836,21 +4107,19 @@ } }, { - "name": "session_id", + "name": "user_profile_id", "in": "path", "required": true, "schema": { "type": "string" }, - "description": "Path parameter session_id", - "example": "sesn_011CZkZAtmR3yMPDzynEDxu7" + "description": "Path parameter user_profile_id", + "example": "uprof_011CZkZCu8hGbp5mYRQgUmz9" } ], "responses": { "200": { "description": "Successful response (OK)", "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/BetaManagedAgentsStreamSessionEvents" } - } + "application/json": { "schema": { "$ref": "#/components/schemas/BetaEnrollmentUrl" } } } }, "400": { @@ -3946,37 +4215,18 @@ } } }, - "/v1/sessions/{session_id}/archive?beta=true": { + "/v1/sessions?beta=true": { "post": { - "operationId": "BetaArchiveSession", - "summary": "Archive Session", - "parameters": [ - { "name": "anthropic-version", "in": "header", "required": false, "schema": { "type": "string" } }, - { - "name": "anthropic-beta", - "in": "header", - "required": false, - "schema": { - "type": "string", - "items": { "type": "string" }, - "x-stainless-override-schema": { - "x-stainless-param": "betas", - "x-stainless-extend-default": true, - "type": "array", - "description": "Optional header to specify the beta version(s) you want to use.", - "items": { "$ref": "#/components/schemas/AnthropicBeta" } - } + "operationId": "BetaCreateSession", + "summary": "Create Session", + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/BetaManagedAgentsCreateSessionParams" } } - }, - { - "name": "session_id", - "in": "path", - "required": true, - "schema": { "type": "string" }, - "description": "Path parameter session_id", - "example": "sesn_011CZkZAtmR3yMPDzynEDxu7" } - ], + }, "responses": { "200": { "description": "Successful response (OK)", @@ -4074,13 +4324,30 @@ "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } } } - } - } - }, - "/v1/sessions/{session_id}/resources?beta=true": { + }, + "parameters": [ + { "name": "anthropic-version", "in": "header", "required": false, "schema": { "type": "string" } }, + { + "name": "anthropic-beta", + "in": "header", + "required": false, + "schema": { + "type": "string", + "items": { "type": "string" }, + "x-stainless-override-schema": { + "x-stainless-param": "betas", + "x-stainless-extend-default": true, + "type": "array", + "description": "Optional header to specify the beta version(s) you want to use.", + "items": { "$ref": "#/components/schemas/AnthropicBeta" } + } + } + } + ] + }, "get": { - "operationId": "BetaListResources", - "summary": "List Session Resources", + "operationId": "BetaListSessions", + "summary": "List Sessions", "parameters": [ { "name": "x-api-key", "in": "header", "required": false, "schema": { "type": "string" } }, { "name": "anthropic-version", "in": "header", "required": false, "schema": { "type": "string" } }, @@ -4101,26 +4368,93 @@ } }, { - "name": "session_id", - "in": "path", - "required": true, + "name": "limit", + "in": "query", + "required": false, + "schema": { "type": "integer", "format": "int32" }, + "description": "Maximum number of results to return." + }, + { + "name": "page", + "in": "query", + "required": false, "schema": { "type": "string" }, - "description": "Path parameter session_id", - "example": "sesn_011CZkZAtmR3yMPDzynEDxu7" + "description": "Opaque pagination cursor from a previous response's next_page." }, { - "name": "limit", + "name": "include_archived", + "in": "query", + "required": false, + "schema": { "type": "boolean" }, + "description": "When true, includes archived sessions. Default: false (exclude archived)." + }, + { + "name": "created_at[gte]", + "in": "query", + "required": false, + "schema": { "$ref": "#/components/schemas/BetaTimestamp" }, + "description": "Return sessions created at or after this time (inclusive)." + }, + { + "name": "created_at[gt]", + "in": "query", + "required": false, + "schema": { "$ref": "#/components/schemas/BetaTimestamp" }, + "description": "Return sessions created after this time (exclusive)." + }, + { + "name": "created_at[lte]", + "in": "query", + "required": false, + "schema": { "$ref": "#/components/schemas/BetaTimestamp" }, + "description": "Return sessions created at or before this time (inclusive)." + }, + { + "name": "created_at[lt]", + "in": "query", + "required": false, + "schema": { "$ref": "#/components/schemas/BetaTimestamp" }, + "description": "Return sessions created before this time (exclusive)." + }, + { + "name": "agent_id", + "in": "query", + "required": false, + "schema": { "type": "string" }, + "description": "Filter sessions created with this agent ID." + }, + { + "name": "agent_version", "in": "query", "required": false, "schema": { "type": "integer", "format": "int32" }, - "description": "Maximum number of resources to return per page (max 1000). If omitted, returns all resources." + "description": "Filter by agent version. Only applies when agent_id is also set." }, { - "name": "page", + "name": "order", + "in": "query", + "required": false, + "schema": { "$ref": "#/components/schemas/BetaManagedAgentsListOrder" }, + "description": "Sort direction for results, ordered by created_at. Defaults to desc (newest first)." + }, + { + "name": "memory_store_id", "in": "query", "required": false, "schema": { "type": "string" }, - "description": "Opaque cursor from a previous response's next_page field." + "description": "Filter sessions whose resources contain a memory_store with this memory store ID." + }, + { + "name": "statuses[]", + "in": "query", + "required": false, + "style": "form", + "explode": true, + "schema": { + "type": "array", + "items": { "$ref": "#/components/schemas/BetaManagedAgentsSessionStatus" } + }, + "description": "Filter by session status. Repeat the parameter to match any of multiple statuses." } ], "responses": { @@ -4128,7 +4462,7 @@ "description": "Successful response (OK)", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/BetaManagedAgentsListSessionResources" } + "schema": { "$ref": "#/components/schemas/BetaManagedAgentsListSessions" } } } }, @@ -4223,11 +4557,14 @@ } } } - }, - "post": { - "operationId": "BetaAddResource", - "summary": "Add Session Resource", + } + }, + "/v1/sessions/{session_id}?beta=true": { + "get": { + "operationId": "BetaGetSession", + "summary": "Get Session", "parameters": [ + { "name": "x-api-key", "in": "header", "required": false, "schema": { "type": "string" } }, { "name": "anthropic-version", "in": "header", "required": false, "schema": { "type": "string" } }, { "name": "anthropic-beta", @@ -4254,21 +4591,11 @@ "example": "sesn_011CZkZAtmR3yMPDzynEDxu7" } ], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/BetaManagedAgentsAddSessionResourceParams" } - } - } - }, "responses": { "200": { "description": "Successful response (OK)", "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/BetaManagedAgentsAddSessionResource" } - } + "application/json": { "schema": { "$ref": "#/components/schemas/BetaManagedAgentsSession" } } } }, "400": { @@ -4362,14 +4689,11 @@ } } } - } - }, - "/v1/sessions/{session_id}/resources/{resource_id}?beta=true": { - "get": { - "operationId": "BetaGetResource", - "summary": "Get Session Resource", + }, + "post": { + "operationId": "BetaUpdateSession", + "summary": "Update Session", "parameters": [ - { "name": "x-api-key", "in": "header", "required": false, "schema": { "type": "string" } }, { "name": "anthropic-version", "in": "header", "required": false, "schema": { "type": "string" } }, { "name": "anthropic-beta", @@ -4391,26 +4715,24 @@ "name": "session_id", "in": "path", "required": true, - "schema": { "type": "string" }, + "schema": { "type": "string", "x-stainless-cli-data-alias": "id" }, "description": "Path parameter session_id", "example": "sesn_011CZkZAtmR3yMPDzynEDxu7" - }, - { - "name": "resource_id", - "in": "path", - "required": true, - "schema": { "type": "string" }, - "description": "Path parameter resource_id", - "example": "sesrsc_011CZkZBJq5dWxk9fVLNcPht" } ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/BetaManagedAgentsUpdateSessionParams" } + } + } + }, "responses": { "200": { "description": "Successful response (OK)", "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/BetaManagedAgentsGetSessionResource" } - } + "application/json": { "schema": { "$ref": "#/components/schemas/BetaManagedAgentsSession" } } } }, "400": { @@ -4506,8 +4828,8 @@ } }, "delete": { - "operationId": "BetaDeleteResource", - "summary": "Delete Session Resource", + "operationId": "BetaDeleteSession", + "summary": "Delete Session", "parameters": [ { "name": "x-api-key", "in": "header", "required": false, "schema": { "type": "string" } }, { "name": "anthropic-version", "in": "header", "required": false, "schema": { "type": "string" } }, @@ -4534,14 +4856,6 @@ "schema": { "type": "string" }, "description": "Path parameter session_id", "example": "sesn_011CZkZAtmR3yMPDzynEDxu7" - }, - { - "name": "resource_id", - "in": "path", - "required": true, - "schema": { "type": "string" }, - "description": "Path parameter resource_id", - "example": "sesrsc_011CZkZBJq5dWxk9fVLNcPht" } ], "responses": { @@ -4549,7 +4863,7 @@ "description": "Successful response (OK)", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/BetaManagedAgentsDeleteSessionResource" } + "schema": { "$ref": "#/components/schemas/BetaManagedAgentsDeletedSession" } } } }, @@ -4644,11 +4958,14 @@ } } } - }, - "post": { - "operationId": "BetaUpdateResource", - "summary": "Update Session Resource", + } + }, + "/v1/sessions/{session_id}/events?beta=true": { + "get": { + "operationId": "BetaListEvents", + "summary": "List Events", "parameters": [ + { "name": "x-api-key", "in": "header", "required": false, "schema": { "type": "string" } }, { "name": "anthropic-version", "in": "header", "required": false, "schema": { "type": "string" } }, { "name": "anthropic-beta", @@ -4675,40 +4992,82 @@ "example": "sesn_011CZkZAtmR3yMPDzynEDxu7" }, { - "name": "resource_id", - "in": "path", - "required": true, - "schema": { "type": "string", "x-stainless-cli-data-alias": "id" }, - "description": "Path parameter resource_id", - "example": "sesrsc_011CZkZBJq5dWxk9fVLNcPht" - } - ], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/BetaManagedAgentsUpdateSessionResourceParams" } - } - } - }, - "responses": { - "200": { - "description": "Successful response (OK)", - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/BetaManagedAgentsUpdateSessionResource" } - } - } + "name": "limit", + "in": "query", + "required": false, + "schema": { "type": "integer", "format": "int32" }, + "description": "Query parameter for limit" }, - "400": { - "description": "Invalid argument - The client specified an invalid argument", - "content": { - "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } - } + { + "name": "page", + "in": "query", + "required": false, + "schema": { "type": "string" }, + "description": "Opaque pagination cursor from a previous response's next_page." }, - "401": { - "description": "Unauthenticated - The request does not have valid authentication credentials", - "content": { + { + "name": "order", + "in": "query", + "required": false, + "schema": { "$ref": "#/components/schemas/BetaManagedAgentsListOrder" }, + "description": "Sort direction for results, ordered by created_at. Defaults to asc (chronological)." + }, + { + "name": "types[]", + "in": "query", + "required": false, + "style": "form", + "explode": true, + "schema": { "type": "array", "items": { "type": "string" } }, + "description": "Filter by event type. Values match the `type` field on returned events (for example, `user.message` or `agent.tool_use`). Omit to return all event types." + }, + { + "name": "created_at[gte]", + "in": "query", + "required": false, + "schema": { "$ref": "#/components/schemas/BetaTimestamp" }, + "description": "Return events created at or after this time (inclusive)." + }, + { + "name": "created_at[gt]", + "in": "query", + "required": false, + "schema": { "$ref": "#/components/schemas/BetaTimestamp" }, + "description": "Return events created after this time (exclusive)." + }, + { + "name": "created_at[lte]", + "in": "query", + "required": false, + "schema": { "$ref": "#/components/schemas/BetaTimestamp" }, + "description": "Return events created at or before this time (inclusive)." + }, + { + "name": "created_at[lt]", + "in": "query", + "required": false, + "schema": { "$ref": "#/components/schemas/BetaTimestamp" }, + "description": "Return events created before this time (exclusive)." + } + ], + "responses": { + "200": { + "description": "Successful response (OK)", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/BetaManagedAgentsListSessionEvents" } + } + } + }, + "400": { + "description": "Invalid argument - The client specified an invalid argument", + "content": { + "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } + } + }, + "401": { + "description": "Unauthenticated - The request does not have valid authentication credentials", + "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } } }, @@ -4791,17 +5150,42 @@ } } } - } - }, - "/v1/agents?beta=true": { + }, "post": { - "operationId": "BetaCreateAgent", - "summary": "Create Agent", + "operationId": "BetaSendEvents", + "summary": "Send Events", + "parameters": [ + { "name": "anthropic-version", "in": "header", "required": false, "schema": { "type": "string" } }, + { + "name": "anthropic-beta", + "in": "header", + "required": false, + "schema": { + "type": "string", + "items": { "type": "string" }, + "x-stainless-override-schema": { + "x-stainless-param": "betas", + "x-stainless-extend-default": true, + "type": "array", + "description": "Optional header to specify the beta version(s) you want to use.", + "items": { "$ref": "#/components/schemas/AnthropicBeta" } + } + } + }, + { + "name": "session_id", + "in": "path", + "required": true, + "schema": { "type": "string" }, + "description": "Path parameter session_id", + "example": "sesn_011CZkZAtmR3yMPDzynEDxu7" + } + ], "requestBody": { "required": true, "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/BetaManagedAgentsCreateAgentParams" } + "schema": { "$ref": "#/components/schemas/BetaManagedAgentsSendSessionEventsParams" } } } }, @@ -4809,7 +5193,9 @@ "200": { "description": "Successful response (OK)", "content": { - "application/json": { "schema": { "$ref": "#/components/schemas/BetaManagedAgentsAgent" } } + "application/json": { + "schema": { "$ref": "#/components/schemas/BetaManagedAgentsSendSessionEvents" } + } } }, "400": { @@ -4902,30 +5288,13 @@ "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } } } - }, - "parameters": [ - { "name": "anthropic-version", "in": "header", "required": false, "schema": { "type": "string" } }, - { - "name": "anthropic-beta", - "in": "header", - "required": false, - "schema": { - "type": "string", - "items": { "type": "string" }, - "x-stainless-override-schema": { - "x-stainless-param": "betas", - "x-stainless-extend-default": true, - "type": "array", - "description": "Optional header to specify the beta version(s) you want to use.", - "items": { "$ref": "#/components/schemas/AnthropicBeta" } - } - } - } - ] - }, + } + } + }, + "/v1/sessions/{session_id}/events/stream?beta=true": { "get": { - "operationId": "BetaListAgents", - "summary": "List Agents", + "operationId": "BetaStreamSessionEvents", + "summary": "Stream Events", "parameters": [ { "name": "x-api-key", "in": "header", "required": false, "schema": { "type": "string" } }, { "name": "anthropic-version", "in": "header", "required": false, "schema": { "type": "string" } }, @@ -4946,49 +5315,21 @@ } }, { - "name": "limit", - "in": "query", - "required": false, - "schema": { "type": "integer", "format": "int32" }, - "description": "Maximum results per page. Default 20, maximum 100." - }, - { - "name": "page", - "in": "query", - "required": false, - "schema": { - "type": "string", - "x-stainless-pagination-property": { "purpose": "next_cursor_param" } - }, - "description": "Opaque pagination cursor from a previous response." - }, - { - "name": "created_at[gte]", - "in": "query", - "required": false, - "schema": { "$ref": "#/components/schemas/BetaTimestamp" }, - "description": "Return agents created at or after this time (inclusive)." - }, - { - "name": "created_at[lte]", - "in": "query", - "required": false, - "schema": { "$ref": "#/components/schemas/BetaTimestamp" }, - "description": "Return agents created at or before this time (inclusive)." - }, - { - "name": "include_archived", - "in": "query", - "required": false, - "schema": { "type": "boolean" }, - "description": "Include archived agents in results. Defaults to false." + "name": "session_id", + "in": "path", + "required": true, + "schema": { "type": "string" }, + "description": "Path parameter session_id", + "example": "sesn_011CZkZAtmR3yMPDzynEDxu7" } ], "responses": { "200": { "description": "Successful response (OK)", "content": { - "application/json": { "schema": { "$ref": "#/components/schemas/BetaManagedAgentsListAgents" } } + "application/json": { + "schema": { "$ref": "#/components/schemas/BetaManagedAgentsStreamSessionEvents" } + } } }, "400": { @@ -5084,12 +5425,11 @@ } } }, - "/v1/agents/{agent_id}?beta=true": { - "get": { - "operationId": "BetaGetAgent", - "summary": "Get Agent", + "/v1/sessions/{session_id}/archive?beta=true": { + "post": { + "operationId": "BetaArchiveSession", + "summary": "Archive Session", "parameters": [ - { "name": "x-api-key", "in": "header", "required": false, "schema": { "type": "string" } }, { "name": "anthropic-version", "in": "header", "required": false, "schema": { "type": "string" } }, { "name": "anthropic-beta", @@ -5108,26 +5448,19 @@ } }, { - "name": "agent_id", + "name": "session_id", "in": "path", "required": true, "schema": { "type": "string" }, - "description": "Path parameter agent_id", - "example": "agent_011CZkYpogX7uDKUyvBTophP" - }, - { - "name": "version", - "in": "query", - "required": false, - "schema": { "type": "integer", "format": "int32" }, - "description": "Agent version. Omit for the most recent version. Must be at least 1 if specified." + "description": "Path parameter session_id", + "example": "sesn_011CZkZAtmR3yMPDzynEDxu7" } ], "responses": { "200": { "description": "Successful response (OK)", "content": { - "application/json": { "schema": { "$ref": "#/components/schemas/BetaManagedAgentsAgent" } } + "application/json": { "schema": { "$ref": "#/components/schemas/BetaManagedAgentsSession" } } } }, "400": { @@ -5221,11 +5554,14 @@ } } } - }, - "post": { - "operationId": "BetaUpdateAgent", - "summary": "Update Agent", + } + }, + "/v1/sessions/{session_id}/threads?beta=true": { + "get": { + "operationId": "BetaListSessionThreads", + "summary": "List Session Threads", "parameters": [ + { "name": "x-api-key", "in": "header", "required": false, "schema": { "type": "string" } }, { "name": "anthropic-version", "in": "header", "required": false, "schema": { "type": "string" } }, { "name": "anthropic-beta", @@ -5244,27 +5580,35 @@ } }, { - "name": "agent_id", + "name": "session_id", "in": "path", "required": true, - "schema": { "type": "string", "x-stainless-cli-data-alias": "id" }, - "description": "Path parameter agent_id", - "example": "agent_011CZkYpogX7uDKUyvBTophP" + "schema": { "type": "string" }, + "description": "Path parameter session_id", + "example": "sesn_011CZkZAtmR3yMPDzynEDxu7" + }, + { + "name": "limit", + "in": "query", + "required": false, + "schema": { "type": "integer", "format": "int32" }, + "description": "Maximum results per page. Defaults to 1000." + }, + { + "name": "page", + "in": "query", + "required": false, + "schema": { "type": "string" }, + "description": "Opaque pagination cursor from a previous response's next_page. Forward-only." } ], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/BetaManagedAgentsUpdateAgentParams" } - } - } - }, "responses": { "200": { "description": "Successful response (OK)", "content": { - "application/json": { "schema": { "$ref": "#/components/schemas/BetaManagedAgentsAgent" } } + "application/json": { + "schema": { "$ref": "#/components/schemas/BetaManagedAgentsListSessionThreads" } + } } }, "400": { @@ -5360,11 +5704,12 @@ } } }, - "/v1/agents/{agent_id}/archive?beta=true": { - "post": { - "operationId": "BetaArchiveAgent", - "summary": "Archive Agent", + "/v1/sessions/{session_id}/threads/{thread_id}?beta=true": { + "get": { + "operationId": "BetaGetSessionThread", + "summary": "Get Session Thread", "parameters": [ + { "name": "x-api-key", "in": "header", "required": false, "schema": { "type": "string" } }, { "name": "anthropic-version", "in": "header", "required": false, "schema": { "type": "string" } }, { "name": "anthropic-beta", @@ -5383,19 +5728,29 @@ } }, { - "name": "agent_id", + "name": "session_id", "in": "path", "required": true, "schema": { "type": "string" }, - "description": "Path parameter agent_id", - "example": "agent_011CZkYpogX7uDKUyvBTophP" + "description": "Path parameter session_id", + "example": "sesn_011CZkZAtmR3yMPDzynEDxu7" + }, + { + "name": "thread_id", + "in": "path", + "required": true, + "schema": { "type": "string" }, + "description": "Path parameter thread_id", + "example": "sthr_011CZkZVWa6oIjw0rgXZpnBt" } ], "responses": { "200": { "description": "Successful response (OK)", "content": { - "application/json": { "schema": { "$ref": "#/components/schemas/BetaManagedAgentsAgent" } } + "application/json": { + "schema": { "$ref": "#/components/schemas/BetaManagedAgentsSessionThread" } + } } }, "400": { @@ -5491,10 +5846,10 @@ } } }, - "/v1/agents/{agent_id}/versions?beta=true": { + "/v1/sessions/{session_id}/threads/{thread_id}/events?beta=true": { "get": { - "operationId": "BetaListAgentVersions", - "summary": "List Agent Versions", + "operationId": "BetaListSessionThreadEvents", + "summary": "List Session Thread Events", "parameters": [ { "name": "x-api-key", "in": "header", "required": false, "schema": { "type": "string" } }, { "name": "anthropic-version", "in": "header", "required": false, "schema": { "type": "string" } }, @@ -5515,29 +5870,34 @@ } }, { - "name": "agent_id", + "name": "session_id", "in": "path", "required": true, "schema": { "type": "string" }, - "description": "Path parameter agent_id", - "example": "agent_011CZkYpogX7uDKUyvBTophP" + "description": "Path parameter session_id", + "example": "sesn_011CZkZAtmR3yMPDzynEDxu7" + }, + { + "name": "thread_id", + "in": "path", + "required": true, + "schema": { "type": "string" }, + "description": "Path parameter thread_id", + "example": "sthr_011CZkZVWa6oIjw0rgXZpnBt" }, { "name": "limit", "in": "query", "required": false, "schema": { "type": "integer", "format": "int32" }, - "description": "Maximum results per page. Default 20, maximum 100." + "description": "Query parameter for limit" }, { "name": "page", "in": "query", "required": false, - "schema": { - "type": "string", - "x-stainless-pagination-property": { "purpose": "next_cursor_param" } - }, - "description": "Opaque pagination cursor." + "schema": { "type": "string" }, + "description": "Query parameter for page" } ], "responses": { @@ -5545,7 +5905,7 @@ "description": "Successful response (OK)", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/BetaManagedAgentsListAgentVersions" } + "schema": { "$ref": "#/components/schemas/BetaManagedAgentsListSessionThreadEvents" } } } }, @@ -5642,23 +6002,53 @@ } } }, - "/v1/vaults?beta=true": { - "post": { - "operationId": "BetaCreateVault", - "summary": "Create Vault", - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/BetaManagedAgentsCreateVaultRequest" } + "/v1/sessions/{session_id}/threads/{thread_id}/stream?beta=true": { + "get": { + "operationId": "BetaStreamSessionThreadEvents", + "summary": "Stream Session Thread Events", + "parameters": [ + { "name": "x-api-key", "in": "header", "required": false, "schema": { "type": "string" } }, + { "name": "anthropic-version", "in": "header", "required": false, "schema": { "type": "string" } }, + { + "name": "anthropic-beta", + "in": "header", + "required": false, + "schema": { + "type": "string", + "items": { "type": "string" }, + "x-stainless-override-schema": { + "x-stainless-param": "betas", + "x-stainless-extend-default": true, + "type": "array", + "description": "Optional header to specify the beta version(s) you want to use.", + "items": { "$ref": "#/components/schemas/AnthropicBeta" } + } } + }, + { + "name": "session_id", + "in": "path", + "required": true, + "schema": { "type": "string" }, + "description": "Path parameter session_id", + "example": "sesn_011CZkZAtmR3yMPDzynEDxu7" + }, + { + "name": "thread_id", + "in": "path", + "required": true, + "schema": { "type": "string" }, + "description": "Path parameter thread_id", + "example": "sthr_011CZkZVWa6oIjw0rgXZpnBt" } - }, + ], "responses": { "200": { "description": "Successful response (OK)", "content": { - "application/json": { "schema": { "$ref": "#/components/schemas/BetaManagedAgentsVault" } } + "application/json": { + "schema": { "$ref": "#/components/schemas/BetaManagedAgentsStreamSessionThreadEvents" } + } } }, "400": { @@ -5751,32 +6141,14 @@ "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } } } - }, - "parameters": [ - { "name": "anthropic-version", "in": "header", "required": false, "schema": { "type": "string" } }, - { - "name": "anthropic-beta", - "in": "header", - "required": false, - "schema": { - "type": "string", - "items": { "type": "string" }, - "x-stainless-override-schema": { - "x-stainless-param": "betas", - "x-stainless-extend-default": true, - "type": "array", - "description": "Optional header to specify the beta version(s) you want to use.", - "items": { "$ref": "#/components/schemas/AnthropicBeta" } - } - } - } - ] - }, - "get": { - "operationId": "BetaListVaults", - "summary": "List Vaults", + } + } + }, + "/v1/sessions/{session_id}/threads/{thread_id}/archive?beta=true": { + "post": { + "operationId": "BetaArchiveSessionThread", + "summary": "Archive Session Thread", "parameters": [ - { "name": "x-api-key", "in": "header", "required": false, "schema": { "type": "string" } }, { "name": "anthropic-version", "in": "header", "required": false, "schema": { "type": "string" } }, { "name": "anthropic-beta", @@ -5795,25 +6167,20 @@ } }, { - "name": "limit", - "in": "query", - "required": false, - "schema": { "type": "integer", "format": "int32" }, - "description": "Maximum number of vaults to return per page. Defaults to 20, maximum 100." - }, - { - "name": "page", - "in": "query", - "required": false, + "name": "session_id", + "in": "path", + "required": true, "schema": { "type": "string" }, - "description": "Opaque pagination token from a previous `list_vaults` response." + "description": "Path parameter session_id", + "example": "sesn_011CZkZAtmR3yMPDzynEDxu7" }, { - "name": "include_archived", - "in": "query", - "required": false, - "schema": { "type": "boolean" }, - "description": "Whether to include archived vaults in the results." + "name": "thread_id", + "in": "path", + "required": true, + "schema": { "type": "string" }, + "description": "Path parameter thread_id", + "example": "sthr_011CZkZVWa6oIjw0rgXZpnBt" } ], "responses": { @@ -5821,7 +6188,7 @@ "description": "Successful response (OK)", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/BetaManagedAgentsListVaultsResponse" } + "schema": { "$ref": "#/components/schemas/BetaManagedAgentsSessionThread" } } } }, @@ -5918,10 +6285,10 @@ } } }, - "/v1/vaults/{vault_id}?beta=true": { + "/v1/sessions/{session_id}/resources?beta=true": { "get": { - "operationId": "BetaGetVault", - "summary": "Get Vault", + "operationId": "BetaListResources", + "summary": "List Session Resources", "parameters": [ { "name": "x-api-key", "in": "header", "required": false, "schema": { "type": "string" } }, { "name": "anthropic-version", "in": "header", "required": false, "schema": { "type": "string" } }, @@ -5942,19 +6309,35 @@ } }, { - "name": "vault_id", + "name": "session_id", "in": "path", "required": true, "schema": { "type": "string" }, - "description": "Path parameter vault_id", - "example": "vlt_011CZkZDLs7fYzm1hXNPeRjv" + "description": "Path parameter session_id", + "example": "sesn_011CZkZAtmR3yMPDzynEDxu7" + }, + { + "name": "limit", + "in": "query", + "required": false, + "schema": { "type": "integer", "format": "int32" }, + "description": "Maximum number of resources to return per page (max 1000). If omitted, returns all resources." + }, + { + "name": "page", + "in": "query", + "required": false, + "schema": { "type": "string" }, + "description": "Opaque cursor from a previous response's next_page field." } ], "responses": { "200": { "description": "Successful response (OK)", "content": { - "application/json": { "schema": { "$ref": "#/components/schemas/BetaManagedAgentsVault" } } + "application/json": { + "schema": { "$ref": "#/components/schemas/BetaManagedAgentsListSessionResources" } + } } }, "400": { @@ -6050,8 +6433,8 @@ } }, "post": { - "operationId": "BetaUpdateVault", - "summary": "Update Vault", + "operationId": "BetaAddResource", + "summary": "Add Session Resource", "parameters": [ { "name": "anthropic-version", "in": "header", "required": false, "schema": { "type": "string" } }, { @@ -6071,19 +6454,19 @@ } }, { - "name": "vault_id", + "name": "session_id", "in": "path", "required": true, - "schema": { "type": "string", "x-stainless-cli-data-alias": "id" }, - "description": "Path parameter vault_id", - "example": "vlt_011CZkZDLs7fYzm1hXNPeRjv" + "schema": { "type": "string" }, + "description": "Path parameter session_id", + "example": "sesn_011CZkZAtmR3yMPDzynEDxu7" } ], "requestBody": { "required": true, "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/BetaManagedAgentsUpdateVaultRequestBody" } + "schema": { "$ref": "#/components/schemas/BetaManagedAgentsAddSessionResourceParams" } } } }, @@ -6091,7 +6474,9 @@ "200": { "description": "Successful response (OK)", "content": { - "application/json": { "schema": { "$ref": "#/components/schemas/BetaManagedAgentsVault" } } + "application/json": { + "schema": { "$ref": "#/components/schemas/BetaManagedAgentsAddSessionResource" } + } } }, "400": { @@ -6185,10 +6570,12 @@ } } } - }, - "delete": { - "operationId": "BetaDeleteVault", - "summary": "Delete Vault", + } + }, + "/v1/sessions/{session_id}/resources/{resource_id}?beta=true": { + "get": { + "operationId": "BetaGetResource", + "summary": "Get Session Resource", "parameters": [ { "name": "x-api-key", "in": "header", "required": false, "schema": { "type": "string" } }, { "name": "anthropic-version", "in": "header", "required": false, "schema": { "type": "string" } }, @@ -6209,12 +6596,20 @@ } }, { - "name": "vault_id", + "name": "session_id", "in": "path", "required": true, "schema": { "type": "string" }, - "description": "Path parameter vault_id", - "example": "vlt_011CZkZDLs7fYzm1hXNPeRjv" + "description": "Path parameter session_id", + "example": "sesn_011CZkZAtmR3yMPDzynEDxu7" + }, + { + "name": "resource_id", + "in": "path", + "required": true, + "schema": { "type": "string" }, + "description": "Path parameter resource_id", + "example": "sesrsc_011CZkZBJq5dWxk9fVLNcPht" } ], "responses": { @@ -6222,7 +6617,7 @@ "description": "Successful response (OK)", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/BetaManagedAgentsDeletedVault" } + "schema": { "$ref": "#/components/schemas/BetaManagedAgentsGetSessionResource" } } } }, @@ -6317,13 +6712,12 @@ } } } - } - }, - "/v1/vaults/{vault_id}/archive?beta=true": { - "post": { - "operationId": "BetaArchiveVault", - "summary": "Archive Vault", + }, + "delete": { + "operationId": "BetaDeleteResource", + "summary": "Delete Session Resource", "parameters": [ + { "name": "x-api-key", "in": "header", "required": false, "schema": { "type": "string" } }, { "name": "anthropic-version", "in": "header", "required": false, "schema": { "type": "string" } }, { "name": "anthropic-beta", @@ -6342,19 +6736,29 @@ } }, { - "name": "vault_id", + "name": "session_id", "in": "path", "required": true, "schema": { "type": "string" }, - "description": "Path parameter vault_id", - "example": "vlt_011CZkZDLs7fYzm1hXNPeRjv" + "description": "Path parameter session_id", + "example": "sesn_011CZkZAtmR3yMPDzynEDxu7" + }, + { + "name": "resource_id", + "in": "path", + "required": true, + "schema": { "type": "string" }, + "description": "Path parameter resource_id", + "example": "sesrsc_011CZkZBJq5dWxk9fVLNcPht" } ], "responses": { "200": { "description": "Successful response (OK)", "content": { - "application/json": { "schema": { "$ref": "#/components/schemas/BetaManagedAgentsVault" } } + "application/json": { + "schema": { "$ref": "#/components/schemas/BetaManagedAgentsDeleteSessionResource" } + } } }, "400": { @@ -6448,12 +6852,10 @@ } } } - } - }, - "/v1/vaults/{vault_id}/credentials?beta=true": { + }, "post": { - "operationId": "BetaCreateCredential", - "summary": "Create Credential", + "operationId": "BetaUpdateResource", + "summary": "Update Session Resource", "parameters": [ { "name": "anthropic-version", "in": "header", "required": false, "schema": { "type": "string" } }, { @@ -6473,19 +6875,27 @@ } }, { - "name": "vault_id", + "name": "session_id", "in": "path", "required": true, "schema": { "type": "string" }, - "description": "Path parameter vault_id", - "example": "vlt_011CZkZDLs7fYzm1hXNPeRjv" + "description": "Path parameter session_id", + "example": "sesn_011CZkZAtmR3yMPDzynEDxu7" + }, + { + "name": "resource_id", + "in": "path", + "required": true, + "schema": { "type": "string", "x-stainless-cli-data-alias": "id" }, + "description": "Path parameter resource_id", + "example": "sesrsc_011CZkZBJq5dWxk9fVLNcPht" } ], "requestBody": { "required": true, "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/BetaManagedAgentsCreateCredentialRequestBody" } + "schema": { "$ref": "#/components/schemas/BetaManagedAgentsUpdateSessionResourceParams" } } } }, @@ -6493,7 +6903,9 @@ "200": { "description": "Successful response (OK)", "content": { - "application/json": { "schema": { "$ref": "#/components/schemas/BetaManagedAgentsCredential" } } + "application/json": { + "schema": { "$ref": "#/components/schemas/BetaManagedAgentsUpdateSessionResource" } + } } }, "400": { @@ -6587,66 +6999,25 @@ } } } - }, - "get": { - "operationId": "BetaListCredentials", - "summary": "List Credentials", - "parameters": [ - { "name": "x-api-key", "in": "header", "required": false, "schema": { "type": "string" } }, - { "name": "anthropic-version", "in": "header", "required": false, "schema": { "type": "string" } }, - { - "name": "anthropic-beta", - "in": "header", - "required": false, - "schema": { - "type": "string", - "items": { "type": "string" }, - "x-stainless-override-schema": { - "x-stainless-param": "betas", - "x-stainless-extend-default": true, - "type": "array", - "description": "Optional header to specify the beta version(s) you want to use.", - "items": { "$ref": "#/components/schemas/AnthropicBeta" } - } + } + }, + "/v1/agents?beta=true": { + "post": { + "operationId": "BetaCreateAgent", + "summary": "Create Agent", + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/BetaManagedAgentsCreateAgentParams" } } - }, - { - "name": "vault_id", - "in": "path", - "required": true, - "schema": { "type": "string" }, - "description": "Path parameter vault_id", - "example": "vlt_011CZkZDLs7fYzm1hXNPeRjv" - }, - { - "name": "limit", - "in": "query", - "required": false, - "schema": { "type": "integer", "format": "int32" }, - "description": "Maximum number of credentials to return per page. Defaults to 20, maximum 100." - }, - { - "name": "page", - "in": "query", - "required": false, - "schema": { "type": "string" }, - "description": "Opaque pagination token from a previous `list_credentials` response." - }, - { - "name": "include_archived", - "in": "query", - "required": false, - "schema": { "type": "boolean" }, - "description": "Whether to include archived credentials in the results." } - ], + }, "responses": { "200": { "description": "Successful response (OK)", "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/BetaManagedAgentsListCredentialsResponse" } - } + "application/json": { "schema": { "$ref": "#/components/schemas/BetaManagedAgentsAgent" } } } }, "400": { @@ -6739,13 +7110,30 @@ "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } } } - } - } - }, - "/v1/vaults/{vault_id}/credentials/{credential_id}?beta=true": { + }, + "parameters": [ + { "name": "anthropic-version", "in": "header", "required": false, "schema": { "type": "string" } }, + { + "name": "anthropic-beta", + "in": "header", + "required": false, + "schema": { + "type": "string", + "items": { "type": "string" }, + "x-stainless-override-schema": { + "x-stainless-param": "betas", + "x-stainless-extend-default": true, + "type": "array", + "description": "Optional header to specify the beta version(s) you want to use.", + "items": { "$ref": "#/components/schemas/AnthropicBeta" } + } + } + } + ] + }, "get": { - "operationId": "BetaGetCredential", - "summary": "Get Credential", + "operationId": "BetaListAgents", + "summary": "List Agents", "parameters": [ { "name": "x-api-key", "in": "header", "required": false, "schema": { "type": "string" } }, { "name": "anthropic-version", "in": "header", "required": false, "schema": { "type": "string" } }, @@ -6766,27 +7154,49 @@ } }, { - "name": "vault_id", - "in": "path", - "required": true, - "schema": { "type": "string" }, - "description": "Path parameter vault_id", - "example": "vlt_011CZkZDLs7fYzm1hXNPeRjv" + "name": "limit", + "in": "query", + "required": false, + "schema": { "type": "integer", "format": "int32" }, + "description": "Maximum results per page. Default 20, maximum 100." }, { - "name": "credential_id", - "in": "path", - "required": true, - "schema": { "type": "string" }, - "description": "Path parameter credential_id", - "example": "vcrd_011CZkZEMt8gZan2iYOQfSkw" + "name": "page", + "in": "query", + "required": false, + "schema": { + "type": "string", + "x-stainless-pagination-property": { "purpose": "next_cursor_param" } + }, + "description": "Opaque pagination cursor from a previous response." + }, + { + "name": "created_at[gte]", + "in": "query", + "required": false, + "schema": { "$ref": "#/components/schemas/BetaTimestamp" }, + "description": "Return agents created at or after this time (inclusive)." + }, + { + "name": "created_at[lte]", + "in": "query", + "required": false, + "schema": { "$ref": "#/components/schemas/BetaTimestamp" }, + "description": "Return agents created at or before this time (inclusive)." + }, + { + "name": "include_archived", + "in": "query", + "required": false, + "schema": { "type": "boolean" }, + "description": "Include archived agents in results. Defaults to false." } ], "responses": { "200": { "description": "Successful response (OK)", "content": { - "application/json": { "schema": { "$ref": "#/components/schemas/BetaManagedAgentsCredential" } } + "application/json": { "schema": { "$ref": "#/components/schemas/BetaManagedAgentsListAgents" } } } }, "400": { @@ -6880,11 +7290,14 @@ } } } - }, - "post": { - "operationId": "BetaUpdateCredential", - "summary": "Update Credential", + } + }, + "/v1/agents/{agent_id}?beta=true": { + "get": { + "operationId": "BetaGetAgent", + "summary": "Get Agent", "parameters": [ + { "name": "x-api-key", "in": "header", "required": false, "schema": { "type": "string" } }, { "name": "anthropic-version", "in": "header", "required": false, "schema": { "type": "string" } }, { "name": "anthropic-beta", @@ -6903,35 +7316,26 @@ } }, { - "name": "vault_id", + "name": "agent_id", "in": "path", "required": true, "schema": { "type": "string" }, - "description": "Path parameter vault_id", - "example": "vlt_011CZkZDLs7fYzm1hXNPeRjv" + "description": "Path parameter agent_id", + "example": "agent_011CZkYpogX7uDKUyvBTophP" }, { - "name": "credential_id", - "in": "path", - "required": true, - "schema": { "type": "string", "x-stainless-cli-data-alias": "id" }, - "description": "Path parameter credential_id", - "example": "vcrd_011CZkZEMt8gZan2iYOQfSkw" + "name": "version", + "in": "query", + "required": false, + "schema": { "type": "integer", "format": "int32" }, + "description": "Agent version. Omit for the most recent version. Must be at least 1 if specified." } ], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/BetaManagedAgentsUpdateCredentialRequestBody" } - } - } - }, "responses": { "200": { "description": "Successful response (OK)", "content": { - "application/json": { "schema": { "$ref": "#/components/schemas/BetaManagedAgentsCredential" } } + "application/json": { "schema": { "$ref": "#/components/schemas/BetaManagedAgentsAgent" } } } }, "400": { @@ -7026,11 +7430,10 @@ } } }, - "delete": { - "operationId": "BetaDeleteCredential", - "summary": "Delete Credential", + "post": { + "operationId": "BetaUpdateAgent", + "summary": "Update Agent", "parameters": [ - { "name": "x-api-key", "in": "header", "required": false, "schema": { "type": "string" } }, { "name": "anthropic-version", "in": "header", "required": false, "schema": { "type": "string" } }, { "name": "anthropic-beta", @@ -7049,29 +7452,27 @@ } }, { - "name": "vault_id", - "in": "path", - "required": true, - "schema": { "type": "string" }, - "description": "Path parameter vault_id", - "example": "vlt_011CZkZDLs7fYzm1hXNPeRjv" - }, - { - "name": "credential_id", + "name": "agent_id", "in": "path", "required": true, - "schema": { "type": "string" }, - "description": "Path parameter credential_id", - "example": "vcrd_011CZkZEMt8gZan2iYOQfSkw" + "schema": { "type": "string", "x-stainless-cli-data-alias": "id" }, + "description": "Path parameter agent_id", + "example": "agent_011CZkYpogX7uDKUyvBTophP" } ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/BetaManagedAgentsUpdateAgentParams" } + } + } + }, "responses": { "200": { "description": "Successful response (OK)", "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/BetaManagedAgentsDeletedCredential" } - } + "application/json": { "schema": { "$ref": "#/components/schemas/BetaManagedAgentsAgent" } } } }, "400": { @@ -7167,10 +7568,10 @@ } } }, - "/v1/vaults/{vault_id}/credentials/{credential_id}/archive?beta=true": { + "/v1/agents/{agent_id}/archive?beta=true": { "post": { - "operationId": "BetaArchiveCredential", - "summary": "Archive Credential", + "operationId": "BetaArchiveAgent", + "summary": "Archive Agent", "parameters": [ { "name": "anthropic-version", "in": "header", "required": false, "schema": { "type": "string" } }, { @@ -7190,27 +7591,19 @@ } }, { - "name": "vault_id", - "in": "path", - "required": true, - "schema": { "type": "string" }, - "description": "Path parameter vault_id", - "example": "vlt_011CZkZDLs7fYzm1hXNPeRjv" - }, - { - "name": "credential_id", + "name": "agent_id", "in": "path", "required": true, "schema": { "type": "string" }, - "description": "Path parameter credential_id", - "example": "vcrd_011CZkZEMt8gZan2iYOQfSkw" + "description": "Path parameter agent_id", + "example": "agent_011CZkYpogX7uDKUyvBTophP" } ], "responses": { "200": { "description": "Successful response (OK)", "content": { - "application/json": { "schema": { "$ref": "#/components/schemas/BetaManagedAgentsCredential" } } + "application/json": { "schema": { "$ref": "#/components/schemas/BetaManagedAgentsAgent" } } } }, "400": { @@ -7306,11 +7699,12 @@ } } }, - "/v1/memory_stores/{memory_store_id}/memories?beta=true": { - "post": { - "operationId": "BetaCreateMemory", - "summary": "Create a memory", + "/v1/agents/{agent_id}/versions?beta=true": { + "get": { + "operationId": "BetaListAgentVersions", + "summary": "List Agent Versions", "parameters": [ + { "name": "x-api-key", "in": "header", "required": false, "schema": { "type": "string" } }, { "name": "anthropic-version", "in": "header", "required": false, "schema": { "type": "string" } }, { "name": "anthropic-beta", @@ -7329,374 +7723,268 @@ } }, { - "name": "memory_store_id", + "name": "agent_id", "in": "path", "required": true, "schema": { "type": "string" }, - "description": "Path parameter memory_store_id" + "description": "Path parameter agent_id", + "example": "agent_011CZkYpogX7uDKUyvBTophP" }, { - "name": "view", + "name": "limit", "in": "query", "required": false, - "schema": { "$ref": "#/components/schemas/BetaManagedAgentsMemoryView" }, - "description": "Query parameter for view" - } - ], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/BetaManagedAgentsCreateMemoryParams" } - } + "schema": { "type": "integer", "format": "int32" }, + "description": "Maximum results per page. Default 20, maximum 100." + }, + { + "name": "page", + "in": "query", + "required": false, + "schema": { + "type": "string", + "x-stainless-pagination-property": { "purpose": "next_cursor_param" } + }, + "description": "Opaque pagination cursor." } - }, + ], "responses": { "200": { "description": "Successful response (OK)", "content": { - "application/json": { "schema": { "$ref": "#/components/schemas/BetaManagedAgentsMemory" } } + "application/json": { + "schema": { "$ref": "#/components/schemas/BetaManagedAgentsListAgentVersions" } + } } }, "400": { "description": "Invalid argument - The client specified an invalid argument", "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/BetaManagedAgentsErrorResponse" } - } + "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } } }, "401": { "description": "Unauthenticated - The request does not have valid authentication credentials", "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/BetaManagedAgentsErrorResponse" } - } + "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } } }, "403": { "description": "Permission denied - The caller does not have permission to execute the specified operation", "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/BetaManagedAgentsErrorResponse" } - } + "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } } }, "404": { "description": "Not found - Some requested entity was not found", "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/BetaManagedAgentsErrorResponse" } - } + "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } } }, "408": { "description": "Deadline exceeded - The deadline expired before the operation could complete", "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/BetaManagedAgentsErrorResponse" } - } + "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } } }, "409": { - "description": "Custom error status", + "description": "Aborted - The operation was aborted due to concurrency issue", "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/BetaManagedAgentsErrorResponse" } - } + "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } } }, "412": { "description": "Failed precondition - Operation was rejected because the system is not in required state", "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/BetaManagedAgentsErrorResponse" } - } + "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } } }, "413": { "description": "Out of range - Operation was attempted past the valid range", "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/BetaManagedAgentsErrorResponse" } - } + "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } } }, "429": { "description": "Resource exhausted - Some resource has been exhausted (rate limiting)", "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/BetaManagedAgentsErrorResponse" } - } + "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } } }, "431": { "description": "Request header fields too large - Request metadata was too large", "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/BetaManagedAgentsErrorResponse" } - } + "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } } }, "499": { "description": "Cancelled - The operation was cancelled by the client", "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/BetaManagedAgentsErrorResponse" } - } + "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } } }, "500": { "description": "Internal - Internal server error", "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/BetaManagedAgentsErrorResponse" } - } + "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } } }, "501": { "description": "Unimplemented - The operation is not implemented or supported", "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/BetaManagedAgentsErrorResponse" } - } + "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } } }, "503": { "description": "Unavailable - The service is currently unavailable", "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/BetaManagedAgentsErrorResponse" } - } + "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } } }, "504": { "description": "Deadline exceeded - Upstream service did not respond in time", "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/BetaManagedAgentsErrorResponse" } - } + "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } } } } - }, - "get": { - "operationId": "BetaListMemories", - "summary": "List memories", - "parameters": [ - { "name": "x-api-key", "in": "header", "required": false, "schema": { "type": "string" } }, - { "name": "anthropic-version", "in": "header", "required": false, "schema": { "type": "string" } }, - { - "name": "anthropic-beta", - "in": "header", - "required": false, - "schema": { - "type": "string", - "items": { "type": "string" }, - "x-stainless-override-schema": { - "x-stainless-param": "betas", - "x-stainless-extend-default": true, - "type": "array", - "description": "Optional header to specify the beta version(s) you want to use.", - "items": { "$ref": "#/components/schemas/AnthropicBeta" } - } + } + }, + "/v1/vaults?beta=true": { + "post": { + "operationId": "BetaCreateVault", + "summary": "Create Vault", + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/BetaManagedAgentsCreateVaultRequest" } } - }, - { - "name": "memory_store_id", - "in": "path", - "required": true, - "schema": { "type": "string" }, - "description": "Path parameter memory_store_id" - }, - { - "name": "path_prefix", - "in": "query", - "required": false, - "schema": { "type": "string" }, - "description": "Optional path prefix filter (raw string-prefix match; include a trailing slash for directory-scoped lists). This value appears in request URLs. Do not include secrets or personally identifiable information." - }, - { - "name": "depth", - "in": "query", - "required": false, - "schema": { "type": "integer", "format": "int32" }, - "description": "Query parameter for depth" - }, - { - "name": "order_by", - "in": "query", - "required": false, - "schema": { "type": "string" }, - "description": "Query parameter for order_by" - }, - { - "name": "order", - "in": "query", - "required": false, - "schema": { "$ref": "#/components/schemas/BetaManagedAgentsListOrder" }, - "description": "Query parameter for order" - }, - { - "name": "limit", - "in": "query", - "required": false, - "schema": { "type": "integer", "format": "int32" }, - "description": "Query parameter for limit" - }, - { - "name": "page", - "in": "query", - "required": false, - "schema": { "type": "string" }, - "description": "Query parameter for page" - }, - { - "name": "view", - "in": "query", - "required": false, - "schema": { "$ref": "#/components/schemas/BetaManagedAgentsMemoryView" }, - "description": "Query parameter for view" } - ], + }, "responses": { "200": { "description": "Successful response (OK)", "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/BetaManagedAgentsListMemoriesResult" } - } + "application/json": { "schema": { "$ref": "#/components/schemas/BetaManagedAgentsVault" } } } }, "400": { "description": "Invalid argument - The client specified an invalid argument", "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/BetaManagedAgentsErrorResponse" } - } + "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } } }, "401": { "description": "Unauthenticated - The request does not have valid authentication credentials", "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/BetaManagedAgentsErrorResponse" } - } + "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } } }, "403": { "description": "Permission denied - The caller does not have permission to execute the specified operation", "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/BetaManagedAgentsErrorResponse" } - } + "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } } }, "404": { "description": "Not found - Some requested entity was not found", "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/BetaManagedAgentsErrorResponse" } - } + "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } } }, "408": { "description": "Deadline exceeded - The deadline expired before the operation could complete", "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/BetaManagedAgentsErrorResponse" } - } + "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } } }, "409": { - "description": "Custom error status", + "description": "Aborted - The operation was aborted due to concurrency issue", "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/BetaManagedAgentsErrorResponse" } - } + "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } } }, "412": { "description": "Failed precondition - Operation was rejected because the system is not in required state", "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/BetaManagedAgentsErrorResponse" } - } + "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } } }, "413": { "description": "Out of range - Operation was attempted past the valid range", "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/BetaManagedAgentsErrorResponse" } - } + "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } } }, "429": { "description": "Resource exhausted - Some resource has been exhausted (rate limiting)", "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/BetaManagedAgentsErrorResponse" } - } + "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } } }, "431": { "description": "Request header fields too large - Request metadata was too large", "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/BetaManagedAgentsErrorResponse" } - } + "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } } }, "499": { "description": "Cancelled - The operation was cancelled by the client", "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/BetaManagedAgentsErrorResponse" } - } + "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } } }, "500": { "description": "Internal - Internal server error", "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/BetaManagedAgentsErrorResponse" } - } + "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } } }, "501": { "description": "Unimplemented - The operation is not implemented or supported", "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/BetaManagedAgentsErrorResponse" } - } + "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } } }, "503": { "description": "Unavailable - The service is currently unavailable", "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/BetaManagedAgentsErrorResponse" } - } + "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } } }, "504": { "description": "Deadline exceeded - Upstream service did not respond in time", "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/BetaManagedAgentsErrorResponse" } - } + "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } } } - } - } - }, - "/v1/memory_stores/{memory_store_id}/memories/{memory_id}?beta=true": { - "get": { - "operationId": "BetaGetMemory", - "summary": "Retrieve a memory", + }, "parameters": [ - { "name": "x-api-key", "in": "header", "required": false, "schema": { "type": "string" } }, + { "name": "anthropic-version", "in": "header", "required": false, "schema": { "type": "string" } }, + { + "name": "anthropic-beta", + "in": "header", + "required": false, + "schema": { + "type": "string", + "items": { "type": "string" }, + "x-stainless-override-schema": { + "x-stainless-param": "betas", + "x-stainless-extend-default": true, + "type": "array", + "description": "Optional header to specify the beta version(s) you want to use.", + "items": { "$ref": "#/components/schemas/AnthropicBeta" } + } + } + } + ] + }, + "get": { + "operationId": "BetaListVaults", + "summary": "List Vaults", + "parameters": [ + { "name": "x-api-key", "in": "header", "required": false, "schema": { "type": "string" } }, { "name": "anthropic-version", "in": "header", "required": false, "schema": { "type": "string" } }, { "name": "anthropic-beta", @@ -7715,160 +8003,135 @@ } }, { - "name": "memory_store_id", - "in": "path", - "required": true, - "schema": { "type": "string" }, - "description": "Path parameter memory_store_id" - }, - { - "name": "memory_id", - "in": "path", - "required": true, + "name": "limit", + "in": "query", + "required": false, + "schema": { "type": "integer", "format": "int32" }, + "description": "Maximum number of vaults to return per page. Defaults to 20, maximum 100." + }, + { + "name": "page", + "in": "query", + "required": false, "schema": { "type": "string" }, - "description": "Path parameter memory_id" + "description": "Opaque pagination token from a previous `list_vaults` response." }, { - "name": "view", + "name": "include_archived", "in": "query", "required": false, - "schema": { "$ref": "#/components/schemas/BetaManagedAgentsMemoryView" }, - "description": "Query parameter for view" + "schema": { "type": "boolean" }, + "description": "Whether to include archived vaults in the results." } ], "responses": { "200": { "description": "Successful response (OK)", "content": { - "application/json": { "schema": { "$ref": "#/components/schemas/BetaManagedAgentsMemory" } } + "application/json": { + "schema": { "$ref": "#/components/schemas/BetaManagedAgentsListVaultsResponse" } + } } }, "400": { "description": "Invalid argument - The client specified an invalid argument", "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/BetaManagedAgentsErrorResponse" } - } + "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } } }, "401": { "description": "Unauthenticated - The request does not have valid authentication credentials", "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/BetaManagedAgentsErrorResponse" } - } + "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } } }, "403": { "description": "Permission denied - The caller does not have permission to execute the specified operation", "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/BetaManagedAgentsErrorResponse" } - } + "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } } }, "404": { "description": "Not found - Some requested entity was not found", "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/BetaManagedAgentsErrorResponse" } - } + "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } } }, "408": { "description": "Deadline exceeded - The deadline expired before the operation could complete", "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/BetaManagedAgentsErrorResponse" } - } + "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } } }, "409": { - "description": "Custom error status", + "description": "Aborted - The operation was aborted due to concurrency issue", "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/BetaManagedAgentsErrorResponse" } - } + "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } } }, "412": { "description": "Failed precondition - Operation was rejected because the system is not in required state", "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/BetaManagedAgentsErrorResponse" } - } + "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } } }, "413": { "description": "Out of range - Operation was attempted past the valid range", "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/BetaManagedAgentsErrorResponse" } - } + "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } } }, "429": { "description": "Resource exhausted - Some resource has been exhausted (rate limiting)", "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/BetaManagedAgentsErrorResponse" } - } + "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } } }, "431": { "description": "Request header fields too large - Request metadata was too large", "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/BetaManagedAgentsErrorResponse" } - } + "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } } }, "499": { "description": "Cancelled - The operation was cancelled by the client", "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/BetaManagedAgentsErrorResponse" } - } + "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } } }, "500": { "description": "Internal - Internal server error", "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/BetaManagedAgentsErrorResponse" } - } + "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } } }, "501": { "description": "Unimplemented - The operation is not implemented or supported", "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/BetaManagedAgentsErrorResponse" } - } + "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } } }, "503": { "description": "Unavailable - The service is currently unavailable", "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/BetaManagedAgentsErrorResponse" } - } + "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } } }, "504": { "description": "Deadline exceeded - Upstream service did not respond in time", "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/BetaManagedAgentsErrorResponse" } - } + "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } } } } - }, - "post": { - "operationId": "BetaUpdateMemory", - "summary": "Update a memory", + } + }, + "/v1/vaults/{vault_id}?beta=true": { + "get": { + "operationId": "BetaGetVault", + "summary": "Get Vault", "parameters": [ + { "name": "x-api-key", "in": "header", "required": false, "schema": { "type": "string" } }, { "name": "anthropic-version", "in": "header", "required": false, "schema": { "type": "string" } }, { "name": "anthropic-beta", @@ -7887,169 +8150,117 @@ } }, { - "name": "memory_store_id", + "name": "vault_id", "in": "path", "required": true, "schema": { "type": "string" }, - "description": "Path parameter memory_store_id" - }, - { - "name": "memory_id", - "in": "path", - "required": true, - "schema": { "type": "string", "x-stainless-cli-data-alias": "id" }, - "description": "Path parameter memory_id" - }, - { - "name": "view", - "in": "query", - "required": false, - "schema": { "$ref": "#/components/schemas/BetaManagedAgentsMemoryView" }, - "description": "Query parameter for view" + "description": "Path parameter vault_id", + "example": "vlt_011CZkZDLs7fYzm1hXNPeRjv" } ], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/BetaManagedAgentsUpdateMemoryParams" } - } - } - }, "responses": { "200": { "description": "Successful response (OK)", "content": { - "application/json": { "schema": { "$ref": "#/components/schemas/BetaManagedAgentsMemory" } } + "application/json": { "schema": { "$ref": "#/components/schemas/BetaManagedAgentsVault" } } } }, "400": { "description": "Invalid argument - The client specified an invalid argument", "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/BetaManagedAgentsErrorResponse" } - } + "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } } }, "401": { "description": "Unauthenticated - The request does not have valid authentication credentials", "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/BetaManagedAgentsErrorResponse" } - } + "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } } }, "403": { "description": "Permission denied - The caller does not have permission to execute the specified operation", "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/BetaManagedAgentsErrorResponse" } - } + "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } } }, "404": { "description": "Not found - Some requested entity was not found", "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/BetaManagedAgentsErrorResponse" } - } + "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } } }, "408": { "description": "Deadline exceeded - The deadline expired before the operation could complete", "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/BetaManagedAgentsErrorResponse" } - } + "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } } }, "409": { - "description": "Custom error status", + "description": "Aborted - The operation was aborted due to concurrency issue", "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/BetaManagedAgentsErrorResponse" } - } + "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } } }, "412": { "description": "Failed precondition - Operation was rejected because the system is not in required state", "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/BetaManagedAgentsErrorResponse" } - } + "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } } }, "413": { "description": "Out of range - Operation was attempted past the valid range", "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/BetaManagedAgentsErrorResponse" } - } + "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } } }, "429": { "description": "Resource exhausted - Some resource has been exhausted (rate limiting)", "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/BetaManagedAgentsErrorResponse" } - } + "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } } }, "431": { "description": "Request header fields too large - Request metadata was too large", "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/BetaManagedAgentsErrorResponse" } - } + "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } } }, "499": { "description": "Cancelled - The operation was cancelled by the client", "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/BetaManagedAgentsErrorResponse" } - } + "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } } }, "500": { "description": "Internal - Internal server error", "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/BetaManagedAgentsErrorResponse" } - } + "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } } }, "501": { "description": "Unimplemented - The operation is not implemented or supported", "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/BetaManagedAgentsErrorResponse" } - } + "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } } }, "503": { "description": "Unavailable - The service is currently unavailable", "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/BetaManagedAgentsErrorResponse" } - } + "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } } }, "504": { "description": "Deadline exceeded - Upstream service did not respond in time", "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/BetaManagedAgentsErrorResponse" } - } + "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } } } } }, - "delete": { - "operationId": "BetaDeleteMemory", - "summary": "Delete a memory", + "post": { + "operationId": "BetaUpdateVault", + "summary": "Update Vault", "parameters": [ - { "name": "x-api-key", "in": "header", "required": false, "schema": { "type": "string" } }, { "name": "anthropic-version", "in": "header", "required": false, "schema": { "type": "string" } }, { "name": "anthropic-beta", @@ -8068,163 +8279,124 @@ } }, { - "name": "memory_store_id", - "in": "path", - "required": true, - "schema": { "type": "string" }, - "description": "Path parameter memory_store_id" - }, - { - "name": "memory_id", + "name": "vault_id", "in": "path", "required": true, - "schema": { "type": "string" }, - "description": "Path parameter memory_id" - }, - { - "name": "expected_content_sha256", - "in": "query", - "required": false, - "schema": { "type": "string" }, - "description": "Query parameter for expected_content_sha256" + "schema": { "type": "string", "x-stainless-cli-data-alias": "id" }, + "description": "Path parameter vault_id", + "example": "vlt_011CZkZDLs7fYzm1hXNPeRjv" } ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/BetaManagedAgentsUpdateVaultRequestBody" } + } + } + }, "responses": { "200": { "description": "Successful response (OK)", "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/BetaManagedAgentsDeletedMemory" } - } + "application/json": { "schema": { "$ref": "#/components/schemas/BetaManagedAgentsVault" } } } }, "400": { "description": "Invalid argument - The client specified an invalid argument", "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/BetaManagedAgentsErrorResponse" } - } + "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } } }, "401": { "description": "Unauthenticated - The request does not have valid authentication credentials", "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/BetaManagedAgentsErrorResponse" } - } + "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } } }, "403": { "description": "Permission denied - The caller does not have permission to execute the specified operation", "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/BetaManagedAgentsErrorResponse" } - } + "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } } }, "404": { "description": "Not found - Some requested entity was not found", "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/BetaManagedAgentsErrorResponse" } - } + "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } } }, "408": { "description": "Deadline exceeded - The deadline expired before the operation could complete", "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/BetaManagedAgentsErrorResponse" } - } + "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } } }, "409": { - "description": "Custom error status", + "description": "Aborted - The operation was aborted due to concurrency issue", "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/BetaManagedAgentsErrorResponse" } - } + "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } } }, "412": { "description": "Failed precondition - Operation was rejected because the system is not in required state", "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/BetaManagedAgentsErrorResponse" } - } + "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } } }, "413": { "description": "Out of range - Operation was attempted past the valid range", "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/BetaManagedAgentsErrorResponse" } - } + "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } } }, "429": { "description": "Resource exhausted - Some resource has been exhausted (rate limiting)", "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/BetaManagedAgentsErrorResponse" } - } + "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } } }, "431": { "description": "Request header fields too large - Request metadata was too large", "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/BetaManagedAgentsErrorResponse" } - } + "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } } }, "499": { "description": "Cancelled - The operation was cancelled by the client", "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/BetaManagedAgentsErrorResponse" } - } + "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } } }, "500": { "description": "Internal - Internal server error", "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/BetaManagedAgentsErrorResponse" } - } + "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } } }, "501": { "description": "Unimplemented - The operation is not implemented or supported", "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/BetaManagedAgentsErrorResponse" } - } + "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } } }, "503": { "description": "Unavailable - The service is currently unavailable", "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/BetaManagedAgentsErrorResponse" } - } + "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } } }, "504": { "description": "Deadline exceeded - Upstream service did not respond in time", "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/BetaManagedAgentsErrorResponse" } - } + "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } } } } - } - }, - "/v1/memory_stores/{memory_store_id}/memory_versions?beta=true": { - "get": { - "operationId": "BetaListMemoryVersions", - "summary": "List memory versions", + }, + "delete": { + "operationId": "BetaDeleteVault", + "summary": "Delete Vault", "parameters": [ { "name": "x-api-key", "in": "header", "required": false, "schema": { "type": "string" } }, { "name": "anthropic-version", "in": "header", "required": false, "schema": { "type": "string" } }, @@ -8245,74 +8417,12 @@ } }, { - "name": "memory_store_id", + "name": "vault_id", "in": "path", "required": true, "schema": { "type": "string" }, - "description": "Path parameter memory_store_id" - }, - { - "name": "memory_id", - "in": "query", - "required": false, - "schema": { "type": "string" }, - "description": "Query parameter for memory_id" - }, - { - "name": "session_id", - "in": "query", - "required": false, - "schema": { "type": "string" }, - "description": "Query parameter for session_id" - }, - { - "name": "api_key_id", - "in": "query", - "required": false, - "schema": { "type": "string" }, - "description": "Query parameter for api_key_id" - }, - { - "name": "operation", - "in": "query", - "required": false, - "schema": { "$ref": "#/components/schemas/BetaManagedAgentsMemoryVersionOperation" }, - "description": "Query parameter for operation" - }, - { - "name": "created_at[gte]", - "in": "query", - "required": false, - "schema": { "$ref": "#/components/schemas/BetaTimestamp" }, - "description": "Return versions created at or after this time (inclusive)." - }, - { - "name": "created_at[lte]", - "in": "query", - "required": false, - "schema": { "$ref": "#/components/schemas/BetaTimestamp" }, - "description": "Return versions created at or before this time (inclusive)." - }, - { - "name": "limit", - "in": "query", - "required": false, - "schema": { "type": "integer", "format": "int32" }, - "description": "Query parameter for limit" - }, - { - "name": "page", - "in": "query", - "required": false, - "schema": { "type": "string" }, - "description": "Query parameter for page" - }, - { - "name": "view", - "in": "query", - "required": false, - "schema": { "$ref": "#/components/schemas/BetaManagedAgentsMemoryView" }, - "description": "Query parameter for view" + "description": "Path parameter vault_id", + "example": "vlt_011CZkZDLs7fYzm1hXNPeRjv" } ], "responses": { @@ -8320,139 +8430,108 @@ "description": "Successful response (OK)", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/BetaManagedAgentsListMemoryVersionsResult" } + "schema": { "$ref": "#/components/schemas/BetaManagedAgentsDeletedVault" } } } }, "400": { "description": "Invalid argument - The client specified an invalid argument", "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/BetaManagedAgentsErrorResponse" } - } + "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } } }, "401": { "description": "Unauthenticated - The request does not have valid authentication credentials", "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/BetaManagedAgentsErrorResponse" } - } + "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } } }, "403": { "description": "Permission denied - The caller does not have permission to execute the specified operation", "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/BetaManagedAgentsErrorResponse" } - } + "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } } }, "404": { "description": "Not found - Some requested entity was not found", "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/BetaManagedAgentsErrorResponse" } - } + "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } } }, "408": { "description": "Deadline exceeded - The deadline expired before the operation could complete", "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/BetaManagedAgentsErrorResponse" } - } + "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } } }, "409": { - "description": "Custom error status", + "description": "Aborted - The operation was aborted due to concurrency issue", "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/BetaManagedAgentsErrorResponse" } - } + "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } } }, "412": { "description": "Failed precondition - Operation was rejected because the system is not in required state", "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/BetaManagedAgentsErrorResponse" } - } + "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } } }, "413": { "description": "Out of range - Operation was attempted past the valid range", "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/BetaManagedAgentsErrorResponse" } - } + "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } } }, "429": { "description": "Resource exhausted - Some resource has been exhausted (rate limiting)", "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/BetaManagedAgentsErrorResponse" } - } + "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } } }, "431": { "description": "Request header fields too large - Request metadata was too large", "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/BetaManagedAgentsErrorResponse" } - } + "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } } }, "499": { "description": "Cancelled - The operation was cancelled by the client", "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/BetaManagedAgentsErrorResponse" } - } + "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } } }, "500": { "description": "Internal - Internal server error", "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/BetaManagedAgentsErrorResponse" } - } + "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } } }, "501": { "description": "Unimplemented - The operation is not implemented or supported", "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/BetaManagedAgentsErrorResponse" } - } + "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } } }, "503": { "description": "Unavailable - The service is currently unavailable", "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/BetaManagedAgentsErrorResponse" } - } + "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } } }, "504": { "description": "Deadline exceeded - Upstream service did not respond in time", "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/BetaManagedAgentsErrorResponse" } - } + "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } } } } } }, - "/v1/memory_stores/{memory_store_id}/memory_versions/{memory_version_id}?beta=true": { - "get": { - "operationId": "BetaGetMemoryVersion", - "summary": "Retrieve a memory version", + "/v1/vaults/{vault_id}/archive?beta=true": { + "post": { + "operationId": "BetaArchiveVault", + "summary": "Archive Vault", "parameters": [ - { "name": "x-api-key", "in": "header", "required": false, "schema": { "type": "string" } }, { "name": "anthropic-version", "in": "header", "required": false, "schema": { "type": "string" } }, { "name": "anthropic-beta", @@ -8471,163 +8550,118 @@ } }, { - "name": "memory_store_id", - "in": "path", - "required": true, - "schema": { "type": "string" }, - "description": "Path parameter memory_store_id" - }, - { - "name": "memory_version_id", + "name": "vault_id", "in": "path", "required": true, "schema": { "type": "string" }, - "description": "Path parameter memory_version_id" - }, - { - "name": "view", - "in": "query", - "required": false, - "schema": { "$ref": "#/components/schemas/BetaManagedAgentsMemoryView" }, - "description": "Query parameter for view" + "description": "Path parameter vault_id", + "example": "vlt_011CZkZDLs7fYzm1hXNPeRjv" } ], "responses": { "200": { "description": "Successful response (OK)", "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/BetaManagedAgentsMemoryVersion" } - } + "application/json": { "schema": { "$ref": "#/components/schemas/BetaManagedAgentsVault" } } } }, "400": { "description": "Invalid argument - The client specified an invalid argument", "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/BetaManagedAgentsErrorResponse" } - } + "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } } }, "401": { "description": "Unauthenticated - The request does not have valid authentication credentials", "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/BetaManagedAgentsErrorResponse" } - } + "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } } }, "403": { "description": "Permission denied - The caller does not have permission to execute the specified operation", "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/BetaManagedAgentsErrorResponse" } - } + "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } } }, "404": { "description": "Not found - Some requested entity was not found", "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/BetaManagedAgentsErrorResponse" } - } + "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } } }, "408": { "description": "Deadline exceeded - The deadline expired before the operation could complete", "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/BetaManagedAgentsErrorResponse" } - } + "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } } }, "409": { - "description": "Custom error status", + "description": "Aborted - The operation was aborted due to concurrency issue", "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/BetaManagedAgentsErrorResponse" } - } + "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } } }, "412": { "description": "Failed precondition - Operation was rejected because the system is not in required state", "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/BetaManagedAgentsErrorResponse" } - } + "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } } }, "413": { "description": "Out of range - Operation was attempted past the valid range", "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/BetaManagedAgentsErrorResponse" } - } + "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } } }, "429": { "description": "Resource exhausted - Some resource has been exhausted (rate limiting)", "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/BetaManagedAgentsErrorResponse" } - } + "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } } }, "431": { "description": "Request header fields too large - Request metadata was too large", "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/BetaManagedAgentsErrorResponse" } - } + "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } } }, "499": { "description": "Cancelled - The operation was cancelled by the client", "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/BetaManagedAgentsErrorResponse" } - } + "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } } }, "500": { "description": "Internal - Internal server error", "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/BetaManagedAgentsErrorResponse" } - } + "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } } }, "501": { "description": "Unimplemented - The operation is not implemented or supported", "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/BetaManagedAgentsErrorResponse" } - } + "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } } }, "503": { "description": "Unavailable - The service is currently unavailable", "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/BetaManagedAgentsErrorResponse" } - } + "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } } }, "504": { "description": "Deadline exceeded - Upstream service did not respond in time", "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/BetaManagedAgentsErrorResponse" } - } + "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } } } } } }, - "/v1/memory_stores/{memory_store_id}/memory_versions/{memory_version_id}/redact?beta=true": { + "/v1/vaults/{vault_id}/credentials?beta=true": { "post": { - "operationId": "BetaRedactMemoryVersion", - "summary": "Redact a memory version", + "operationId": "BetaCreateCredential", + "summary": "Create Credential", "parameters": [ { "name": "anthropic-version", "in": "header", "required": false, "schema": { "type": "string" } }, { @@ -8647,161 +8681,19 @@ } }, { - "name": "memory_store_id", - "in": "path", - "required": true, - "schema": { "type": "string" }, - "description": "Path parameter memory_store_id" - }, - { - "name": "memory_version_id", + "name": "vault_id", "in": "path", "required": true, "schema": { "type": "string" }, - "description": "Path parameter memory_version_id" + "description": "Path parameter vault_id", + "example": "vlt_011CZkZDLs7fYzm1hXNPeRjv" } ], - "responses": { - "200": { - "description": "Successful response (OK)", - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/BetaManagedAgentsMemoryVersion" } - } - } - }, - "400": { - "description": "Invalid argument - The client specified an invalid argument", - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/BetaManagedAgentsErrorResponse" } - } - } - }, - "401": { - "description": "Unauthenticated - The request does not have valid authentication credentials", - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/BetaManagedAgentsErrorResponse" } - } - } - }, - "403": { - "description": "Permission denied - The caller does not have permission to execute the specified operation", - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/BetaManagedAgentsErrorResponse" } - } - } - }, - "404": { - "description": "Not found - Some requested entity was not found", - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/BetaManagedAgentsErrorResponse" } - } - } - }, - "408": { - "description": "Deadline exceeded - The deadline expired before the operation could complete", - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/BetaManagedAgentsErrorResponse" } - } - } - }, - "409": { - "description": "Custom error status", - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/BetaManagedAgentsErrorResponse" } - } - } - }, - "412": { - "description": "Failed precondition - Operation was rejected because the system is not in required state", - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/BetaManagedAgentsErrorResponse" } - } - } - }, - "413": { - "description": "Out of range - Operation was attempted past the valid range", - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/BetaManagedAgentsErrorResponse" } - } - } - }, - "429": { - "description": "Resource exhausted - Some resource has been exhausted (rate limiting)", - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/BetaManagedAgentsErrorResponse" } - } - } - }, - "431": { - "description": "Request header fields too large - Request metadata was too large", - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/BetaManagedAgentsErrorResponse" } - } - } - }, - "499": { - "description": "Cancelled - The operation was cancelled by the client", - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/BetaManagedAgentsErrorResponse" } - } - } - }, - "500": { - "description": "Internal - Internal server error", - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/BetaManagedAgentsErrorResponse" } - } - } - }, - "501": { - "description": "Unimplemented - The operation is not implemented or supported", - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/BetaManagedAgentsErrorResponse" } - } - } - }, - "503": { - "description": "Unavailable - The service is currently unavailable", - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/BetaManagedAgentsErrorResponse" } - } - } - }, - "504": { - "description": "Deadline exceeded - Upstream service did not respond in time", - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/BetaManagedAgentsErrorResponse" } - } - } - } - } - } - }, - "/v1/memory_stores?beta=true": { - "post": { - "operationId": "BetaCreateMemoryStore", - "summary": "Create a memory store", "requestBody": { "required": true, "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/BetaManagedAgentsCreateMemoryStoreRequest" } + "schema": { "$ref": "#/components/schemas/BetaManagedAgentsCreateCredentialRequestBody" } } } }, @@ -8809,9 +8701,7 @@ "200": { "description": "Successful response (OK)", "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/BetaManagedAgentsCreateMemoryStoreResponse" } - } + "application/json": { "schema": { "$ref": "#/components/schemas/BetaManagedAgentsCredential" } } } }, "400": { @@ -8904,30 +8794,11 @@ "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } } } - }, - "parameters": [ - { "name": "anthropic-version", "in": "header", "required": false, "schema": { "type": "string" } }, - { - "name": "anthropic-beta", - "in": "header", - "required": false, - "schema": { - "type": "string", - "items": { "type": "string" }, - "x-stainless-override-schema": { - "x-stainless-param": "betas", - "x-stainless-extend-default": true, - "type": "array", - "description": "Optional header to specify the beta version(s) you want to use.", - "items": { "$ref": "#/components/schemas/AnthropicBeta" } - } - } - } - ] + } }, "get": { - "operationId": "BetaListMemoryStores", - "summary": "List memory stores", + "operationId": "BetaListCredentials", + "summary": "List Credentials", "parameters": [ { "name": "x-api-key", "in": "header", "required": false, "schema": { "type": "string" } }, { "name": "anthropic-version", "in": "header", "required": false, "schema": { "type": "string" } }, @@ -8947,40 +8818,34 @@ } } }, + { + "name": "vault_id", + "in": "path", + "required": true, + "schema": { "type": "string" }, + "description": "Path parameter vault_id", + "example": "vlt_011CZkZDLs7fYzm1hXNPeRjv" + }, { "name": "limit", "in": "query", "required": false, "schema": { "type": "integer", "format": "int32" }, - "description": "Maximum number of stores to return per page. Must be between 1 and 100. Defaults to 20 when omitted." + "description": "Maximum number of credentials to return per page. Defaults to 20, maximum 100." }, { "name": "page", "in": "query", "required": false, "schema": { "type": "string" }, - "description": "Opaque pagination cursor (a `page_...` value). Pass the `next_page` value from a previous response to fetch the next page; omit for the first page." + "description": "Opaque pagination token from a previous `list_credentials` response." }, { "name": "include_archived", "in": "query", "required": false, "schema": { "type": "boolean" }, - "description": "When `true`, archived stores are included in the results. Defaults to `false` (archived stores are excluded)." - }, - { - "name": "created_at[gte]", - "in": "query", - "required": false, - "schema": { "$ref": "#/components/schemas/BetaTimestamp" }, - "description": "Return only stores whose `created_at` is at or after this time (inclusive). Sent on the wire as `created_at[gte]`." - }, - { - "name": "created_at[lte]", - "in": "query", - "required": false, - "schema": { "$ref": "#/components/schemas/BetaTimestamp" }, - "description": "Return only stores whose `created_at` is at or before this time (inclusive). Sent on the wire as `created_at[lte]`." + "description": "Whether to include archived credentials in the results." } ], "responses": { @@ -8988,7 +8853,7 @@ "description": "Successful response (OK)", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/BetaManagedAgentsListMemoryStoresResponse" } + "schema": { "$ref": "#/components/schemas/BetaManagedAgentsListCredentialsResponse" } } } }, @@ -9085,10 +8950,10 @@ } } }, - "/v1/memory_stores/{memory_store_id}?beta=true": { + "/v1/vaults/{vault_id}/credentials/{credential_id}?beta=true": { "get": { - "operationId": "BetaGetMemoryStore", - "summary": "Retrieve a memory store", + "operationId": "BetaGetCredential", + "summary": "Get Credential", "parameters": [ { "name": "x-api-key", "in": "header", "required": false, "schema": { "type": "string" } }, { "name": "anthropic-version", "in": "header", "required": false, "schema": { "type": "string" } }, @@ -9109,20 +8974,27 @@ } }, { - "name": "memory_store_id", + "name": "vault_id", "in": "path", "required": true, "schema": { "type": "string" }, - "description": "Path parameter memory_store_id" + "description": "Path parameter vault_id", + "example": "vlt_011CZkZDLs7fYzm1hXNPeRjv" + }, + { + "name": "credential_id", + "in": "path", + "required": true, + "schema": { "type": "string" }, + "description": "Path parameter credential_id", + "example": "vcrd_011CZkZEMt8gZan2iYOQfSkw" } ], "responses": { "200": { "description": "Successful response (OK)", "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/BetaManagedAgentsGetMemoryStoreResponse" } - } + "application/json": { "schema": { "$ref": "#/components/schemas/BetaManagedAgentsCredential" } } } }, "400": { @@ -9218,8 +9090,8 @@ } }, "post": { - "operationId": "BetaUpdateMemoryStore", - "summary": "Update a memory store", + "operationId": "BetaUpdateCredential", + "summary": "Update Credential", "parameters": [ { "name": "anthropic-version", "in": "header", "required": false, "schema": { "type": "string" } }, { @@ -9239,18 +9111,27 @@ } }, { - "name": "memory_store_id", + "name": "vault_id", + "in": "path", + "required": true, + "schema": { "type": "string" }, + "description": "Path parameter vault_id", + "example": "vlt_011CZkZDLs7fYzm1hXNPeRjv" + }, + { + "name": "credential_id", "in": "path", "required": true, "schema": { "type": "string", "x-stainless-cli-data-alias": "id" }, - "description": "Path parameter memory_store_id" + "description": "Path parameter credential_id", + "example": "vcrd_011CZkZEMt8gZan2iYOQfSkw" } ], "requestBody": { "required": true, "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/BetaManagedAgentsUpdateMemoryStoreRequestBody" } + "schema": { "$ref": "#/components/schemas/BetaManagedAgentsUpdateCredentialRequestBody" } } } }, @@ -9258,9 +9139,7 @@ "200": { "description": "Successful response (OK)", "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/BetaManagedAgentsUpdateMemoryStoreResponse" } - } + "application/json": { "schema": { "$ref": "#/components/schemas/BetaManagedAgentsCredential" } } } }, "400": { @@ -9356,8 +9235,8 @@ } }, "delete": { - "operationId": "BetaDeleteMemoryStore", - "summary": "Delete a memory store", + "operationId": "BetaDeleteCredential", + "summary": "Delete Credential", "parameters": [ { "name": "x-api-key", "in": "header", "required": false, "schema": { "type": "string" } }, { "name": "anthropic-version", "in": "header", "required": false, "schema": { "type": "string" } }, @@ -9378,11 +9257,20 @@ } }, { - "name": "memory_store_id", + "name": "vault_id", "in": "path", "required": true, "schema": { "type": "string" }, - "description": "Path parameter memory_store_id" + "description": "Path parameter vault_id", + "example": "vlt_011CZkZDLs7fYzm1hXNPeRjv" + }, + { + "name": "credential_id", + "in": "path", + "required": true, + "schema": { "type": "string" }, + "description": "Path parameter credential_id", + "example": "vcrd_011CZkZEMt8gZan2iYOQfSkw" } ], "responses": { @@ -9390,7 +9278,7 @@ "description": "Successful response (OK)", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/BetaManagedAgentsDeleteMemoryStoreResponse" } + "schema": { "$ref": "#/components/schemas/BetaManagedAgentsDeletedCredential" } } } }, @@ -9487,10 +9375,10 @@ } } }, - "/v1/memory_stores/{memory_store_id}/archive?beta=true": { + "/v1/vaults/{vault_id}/credentials/{credential_id}/archive?beta=true": { "post": { - "operationId": "BetaArchiveMemoryStore", - "summary": "Archive a memory store", + "operationId": "BetaArchiveCredential", + "summary": "Archive Credential", "parameters": [ { "name": "anthropic-version", "in": "header", "required": false, "schema": { "type": "string" } }, { @@ -9510,20 +9398,27 @@ } }, { - "name": "memory_store_id", + "name": "vault_id", "in": "path", "required": true, "schema": { "type": "string" }, - "description": "Path parameter memory_store_id" + "description": "Path parameter vault_id", + "example": "vlt_011CZkZDLs7fYzm1hXNPeRjv" + }, + { + "name": "credential_id", + "in": "path", + "required": true, + "schema": { "type": "string" }, + "description": "Path parameter credential_id", + "example": "vcrd_011CZkZEMt8gZan2iYOQfSkw" } ], "responses": { "200": { "description": "Successful response (OK)", "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/BetaManagedAgentsArchiveMemoryStoreResponse" } - } + "application/json": { "schema": { "$ref": "#/components/schemas/BetaManagedAgentsCredential" } } } }, "400": { @@ -9619,21 +9514,52 @@ } } }, - "/v1/user_profiles?beta=true": { + "/v1/vaults/{vault_id}/credentials/{credential_id}/mcp_oauth_validate?beta=true": { "post": { - "operationId": "BetaCreateUserProfile", - "summary": "Create User Profile", - "requestBody": { - "required": true, - "content": { - "application/json": { "schema": { "$ref": "#/components/schemas/BetaCreateUserProfileRequest" } } + "operationId": "BetaValidateCredential", + "summary": "Validate Credential", + "parameters": [ + { "name": "anthropic-version", "in": "header", "required": false, "schema": { "type": "string" } }, + { + "name": "anthropic-beta", + "in": "header", + "required": false, + "schema": { + "type": "string", + "items": { "type": "string" }, + "x-stainless-override-schema": { + "x-stainless-param": "betas", + "x-stainless-extend-default": true, + "type": "array", + "description": "Optional header to specify the beta version(s) you want to use.", + "items": { "$ref": "#/components/schemas/AnthropicBeta" } + } + } + }, + { + "name": "vault_id", + "in": "path", + "required": true, + "schema": { "type": "string" }, + "description": "Path parameter vault_id", + "example": "vlt_011CZkZDLs7fYzm1hXNPeRjv" + }, + { + "name": "credential_id", + "in": "path", + "required": true, + "schema": { "type": "string" }, + "description": "Path parameter credential_id", + "example": "vcrd_011CZkZEMt8gZan2iYOQfSkw" } - }, + ], "responses": { "200": { "description": "Successful response (OK)", "content": { - "application/json": { "schema": { "$ref": "#/components/schemas/BetaUserProfile" } } + "application/json": { + "schema": { "$ref": "#/components/schemas/BetaManagedAgentsCredentialValidation" } + } } }, "400": { @@ -9726,32 +9652,14 @@ "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } } } - }, - "parameters": [ - { "name": "anthropic-version", "in": "header", "required": false, "schema": { "type": "string" } }, - { - "name": "anthropic-beta", - "in": "header", - "required": false, - "schema": { - "type": "string", - "items": { "type": "string" }, - "x-stainless-override-schema": { - "x-stainless-param": "betas", - "x-stainless-extend-default": true, - "type": "array", - "description": "Optional header to specify the beta version(s) you want to use.", - "items": { "$ref": "#/components/schemas/AnthropicBeta" } - } - } - } - ] - }, - "get": { - "operationId": "BetaListUserProfiles", - "summary": "List User Profiles", + } + } + }, + "/v1/memory_stores/{memory_store_id}/memories?beta=true": { + "post": { + "operationId": "BetaCreateMemory", + "summary": "Create a memory", "parameters": [ - { "name": "x-api-key", "in": "header", "required": false, "schema": { "type": "string" } }, { "name": "anthropic-version", "in": "header", "required": false, "schema": { "type": "string" } }, { "name": "anthropic-beta", @@ -9770,133 +9678,160 @@ } }, { - "name": "limit", - "in": "query", - "required": false, - "schema": { "type": "integer", "format": "int32" }, - "description": "Query parameter for limit" - }, - { - "name": "page", - "in": "query", - "required": false, + "name": "memory_store_id", + "in": "path", + "required": true, "schema": { "type": "string" }, - "description": "Query parameter for page" + "description": "Path parameter memory_store_id" }, { - "name": "order", + "name": "view", "in": "query", "required": false, - "schema": { "$ref": "#/components/schemas/BetaUserProfileListOrder" }, - "description": "Query parameter for order" + "schema": { "$ref": "#/components/schemas/BetaManagedAgentsMemoryView" }, + "description": "Query parameter for view" } ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/BetaManagedAgentsCreateMemoryParams" } + } + } + }, "responses": { "200": { "description": "Successful response (OK)", "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/BetaListUserProfilesResponse" } - } + "application/json": { "schema": { "$ref": "#/components/schemas/BetaManagedAgentsMemory" } } } }, "400": { "description": "Invalid argument - The client specified an invalid argument", "content": { - "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } + "application/json": { + "schema": { "$ref": "#/components/schemas/BetaManagedAgentsErrorResponse" } + } } }, "401": { "description": "Unauthenticated - The request does not have valid authentication credentials", "content": { - "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } + "application/json": { + "schema": { "$ref": "#/components/schemas/BetaManagedAgentsErrorResponse" } + } } }, "403": { "description": "Permission denied - The caller does not have permission to execute the specified operation", "content": { - "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } + "application/json": { + "schema": { "$ref": "#/components/schemas/BetaManagedAgentsErrorResponse" } + } } }, "404": { "description": "Not found - Some requested entity was not found", "content": { - "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } + "application/json": { + "schema": { "$ref": "#/components/schemas/BetaManagedAgentsErrorResponse" } + } } }, "408": { "description": "Deadline exceeded - The deadline expired before the operation could complete", "content": { - "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } + "application/json": { + "schema": { "$ref": "#/components/schemas/BetaManagedAgentsErrorResponse" } + } } }, "409": { - "description": "Aborted - The operation was aborted due to concurrency issue", + "description": "Custom error status", "content": { - "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } + "application/json": { + "schema": { "$ref": "#/components/schemas/BetaManagedAgentsErrorResponse" } + } } }, "412": { "description": "Failed precondition - Operation was rejected because the system is not in required state", "content": { - "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } + "application/json": { + "schema": { "$ref": "#/components/schemas/BetaManagedAgentsErrorResponse" } + } } }, "413": { "description": "Out of range - Operation was attempted past the valid range", "content": { - "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } + "application/json": { + "schema": { "$ref": "#/components/schemas/BetaManagedAgentsErrorResponse" } + } } }, "429": { "description": "Resource exhausted - Some resource has been exhausted (rate limiting)", "content": { - "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } + "application/json": { + "schema": { "$ref": "#/components/schemas/BetaManagedAgentsErrorResponse" } + } } }, "431": { "description": "Request header fields too large - Request metadata was too large", "content": { - "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } + "application/json": { + "schema": { "$ref": "#/components/schemas/BetaManagedAgentsErrorResponse" } + } } }, "499": { "description": "Cancelled - The operation was cancelled by the client", "content": { - "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } + "application/json": { + "schema": { "$ref": "#/components/schemas/BetaManagedAgentsErrorResponse" } + } } }, "500": { "description": "Internal - Internal server error", "content": { - "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } + "application/json": { + "schema": { "$ref": "#/components/schemas/BetaManagedAgentsErrorResponse" } + } } }, "501": { "description": "Unimplemented - The operation is not implemented or supported", "content": { - "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } + "application/json": { + "schema": { "$ref": "#/components/schemas/BetaManagedAgentsErrorResponse" } + } } }, "503": { "description": "Unavailable - The service is currently unavailable", "content": { - "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } + "application/json": { + "schema": { "$ref": "#/components/schemas/BetaManagedAgentsErrorResponse" } + } } }, "504": { "description": "Deadline exceeded - Upstream service did not respond in time", "content": { - "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } - } + "application/json": { + "schema": { "$ref": "#/components/schemas/BetaManagedAgentsErrorResponse" } + } + } } } - } - }, - "/v1/user_profiles/{user_profile_id}?beta=true": { + }, "get": { - "operationId": "BetaGetUserProfile", - "summary": "Get User Profile", + "operationId": "BetaListMemories", + "summary": "List memories", "parameters": [ { "name": "x-api-key", "in": "header", "required": false, "schema": { "type": "string" } }, { "name": "anthropic-version", "in": "header", "required": false, "schema": { "type": "string" } }, @@ -9917,117 +9852,200 @@ } }, { - "name": "user_profile_id", + "name": "memory_store_id", "in": "path", "required": true, "schema": { "type": "string" }, - "description": "Path parameter user_profile_id", - "example": "uprof_011CZkZCu8hGbp5mYRQgUmz9" + "description": "Path parameter memory_store_id" + }, + { + "name": "path_prefix", + "in": "query", + "required": false, + "schema": { "type": "string" }, + "description": "Optional path prefix filter (raw string-prefix match; include a trailing slash for directory-scoped lists). This value appears in request URLs. Do not include secrets or personally identifiable information." + }, + { + "name": "depth", + "in": "query", + "required": false, + "schema": { "type": "integer", "format": "int32" }, + "description": "Query parameter for depth" + }, + { + "name": "order_by", + "in": "query", + "required": false, + "schema": { "type": "string" }, + "description": "Query parameter for order_by" + }, + { + "name": "order", + "in": "query", + "required": false, + "schema": { "$ref": "#/components/schemas/BetaManagedAgentsListOrder" }, + "description": "Query parameter for order" + }, + { + "name": "limit", + "in": "query", + "required": false, + "schema": { "type": "integer", "format": "int32" }, + "description": "Query parameter for limit" + }, + { + "name": "page", + "in": "query", + "required": false, + "schema": { "type": "string" }, + "description": "Query parameter for page" + }, + { + "name": "view", + "in": "query", + "required": false, + "schema": { "$ref": "#/components/schemas/BetaManagedAgentsMemoryView" }, + "description": "Query parameter for view" } ], "responses": { "200": { "description": "Successful response (OK)", "content": { - "application/json": { "schema": { "$ref": "#/components/schemas/BetaUserProfile" } } + "application/json": { + "schema": { "$ref": "#/components/schemas/BetaManagedAgentsListMemoriesResult" } + } } }, "400": { "description": "Invalid argument - The client specified an invalid argument", "content": { - "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } + "application/json": { + "schema": { "$ref": "#/components/schemas/BetaManagedAgentsErrorResponse" } + } } }, "401": { "description": "Unauthenticated - The request does not have valid authentication credentials", "content": { - "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } + "application/json": { + "schema": { "$ref": "#/components/schemas/BetaManagedAgentsErrorResponse" } + } } }, "403": { "description": "Permission denied - The caller does not have permission to execute the specified operation", "content": { - "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } + "application/json": { + "schema": { "$ref": "#/components/schemas/BetaManagedAgentsErrorResponse" } + } } }, "404": { "description": "Not found - Some requested entity was not found", "content": { - "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } + "application/json": { + "schema": { "$ref": "#/components/schemas/BetaManagedAgentsErrorResponse" } + } } }, "408": { "description": "Deadline exceeded - The deadline expired before the operation could complete", "content": { - "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } + "application/json": { + "schema": { "$ref": "#/components/schemas/BetaManagedAgentsErrorResponse" } + } } }, "409": { - "description": "Aborted - The operation was aborted due to concurrency issue", + "description": "Custom error status", "content": { - "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } + "application/json": { + "schema": { "$ref": "#/components/schemas/BetaManagedAgentsErrorResponse" } + } } }, "412": { "description": "Failed precondition - Operation was rejected because the system is not in required state", "content": { - "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } + "application/json": { + "schema": { "$ref": "#/components/schemas/BetaManagedAgentsErrorResponse" } + } } }, "413": { "description": "Out of range - Operation was attempted past the valid range", "content": { - "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } + "application/json": { + "schema": { "$ref": "#/components/schemas/BetaManagedAgentsErrorResponse" } + } } }, "429": { "description": "Resource exhausted - Some resource has been exhausted (rate limiting)", "content": { - "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } + "application/json": { + "schema": { "$ref": "#/components/schemas/BetaManagedAgentsErrorResponse" } + } } }, "431": { "description": "Request header fields too large - Request metadata was too large", "content": { - "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } + "application/json": { + "schema": { "$ref": "#/components/schemas/BetaManagedAgentsErrorResponse" } + } } }, "499": { "description": "Cancelled - The operation was cancelled by the client", "content": { - "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } + "application/json": { + "schema": { "$ref": "#/components/schemas/BetaManagedAgentsErrorResponse" } + } } }, "500": { "description": "Internal - Internal server error", "content": { - "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } + "application/json": { + "schema": { "$ref": "#/components/schemas/BetaManagedAgentsErrorResponse" } + } } }, "501": { "description": "Unimplemented - The operation is not implemented or supported", "content": { - "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } + "application/json": { + "schema": { "$ref": "#/components/schemas/BetaManagedAgentsErrorResponse" } + } } }, "503": { "description": "Unavailable - The service is currently unavailable", "content": { - "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } + "application/json": { + "schema": { "$ref": "#/components/schemas/BetaManagedAgentsErrorResponse" } + } } }, "504": { "description": "Deadline exceeded - Upstream service did not respond in time", "content": { - "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } + "application/json": { + "schema": { "$ref": "#/components/schemas/BetaManagedAgentsErrorResponse" } + } } } } - }, - "post": { - "operationId": "BetaUpdateUserProfile", - "summary": "Update User Profile", + } + }, + "/v1/memory_stores/{memory_store_id}/memories/{memory_id}?beta=true": { + "get": { + "operationId": "BetaGetMemory", + "summary": "Retrieve a memory", "parameters": [ + { "name": "x-api-key", "in": "header", "required": false, "schema": { "type": "string" } }, { "name": "anthropic-version", "in": "header", "required": false, "schema": { "type": "string" } }, { "name": "anthropic-beta", @@ -10046,126 +10064,159 @@ } }, { - "name": "user_profile_id", + "name": "memory_store_id", "in": "path", "required": true, "schema": { "type": "string" }, - "description": "Path parameter user_profile_id", - "example": "uprof_011CZkZCu8hGbp5mYRQgUmz9" + "description": "Path parameter memory_store_id" + }, + { + "name": "memory_id", + "in": "path", + "required": true, + "schema": { "type": "string" }, + "description": "Path parameter memory_id" + }, + { + "name": "view", + "in": "query", + "required": false, + "schema": { "$ref": "#/components/schemas/BetaManagedAgentsMemoryView" }, + "description": "Query parameter for view" } ], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/BetaUpdateUserProfileRequestBody" } - } - } - }, "responses": { "200": { "description": "Successful response (OK)", "content": { - "application/json": { "schema": { "$ref": "#/components/schemas/BetaUserProfile" } } + "application/json": { "schema": { "$ref": "#/components/schemas/BetaManagedAgentsMemory" } } } }, "400": { "description": "Invalid argument - The client specified an invalid argument", "content": { - "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } + "application/json": { + "schema": { "$ref": "#/components/schemas/BetaManagedAgentsErrorResponse" } + } } }, "401": { "description": "Unauthenticated - The request does not have valid authentication credentials", "content": { - "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } + "application/json": { + "schema": { "$ref": "#/components/schemas/BetaManagedAgentsErrorResponse" } + } } }, "403": { "description": "Permission denied - The caller does not have permission to execute the specified operation", "content": { - "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } + "application/json": { + "schema": { "$ref": "#/components/schemas/BetaManagedAgentsErrorResponse" } + } } }, "404": { "description": "Not found - Some requested entity was not found", "content": { - "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } + "application/json": { + "schema": { "$ref": "#/components/schemas/BetaManagedAgentsErrorResponse" } + } } }, "408": { "description": "Deadline exceeded - The deadline expired before the operation could complete", "content": { - "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } + "application/json": { + "schema": { "$ref": "#/components/schemas/BetaManagedAgentsErrorResponse" } + } } }, "409": { - "description": "Aborted - The operation was aborted due to concurrency issue", + "description": "Custom error status", "content": { - "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } + "application/json": { + "schema": { "$ref": "#/components/schemas/BetaManagedAgentsErrorResponse" } + } } }, "412": { "description": "Failed precondition - Operation was rejected because the system is not in required state", "content": { - "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } + "application/json": { + "schema": { "$ref": "#/components/schemas/BetaManagedAgentsErrorResponse" } + } } }, "413": { "description": "Out of range - Operation was attempted past the valid range", "content": { - "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } + "application/json": { + "schema": { "$ref": "#/components/schemas/BetaManagedAgentsErrorResponse" } + } } }, "429": { "description": "Resource exhausted - Some resource has been exhausted (rate limiting)", "content": { - "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } + "application/json": { + "schema": { "$ref": "#/components/schemas/BetaManagedAgentsErrorResponse" } + } } }, "431": { "description": "Request header fields too large - Request metadata was too large", "content": { - "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } + "application/json": { + "schema": { "$ref": "#/components/schemas/BetaManagedAgentsErrorResponse" } + } } }, "499": { "description": "Cancelled - The operation was cancelled by the client", "content": { - "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } + "application/json": { + "schema": { "$ref": "#/components/schemas/BetaManagedAgentsErrorResponse" } + } } }, "500": { "description": "Internal - Internal server error", "content": { - "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } + "application/json": { + "schema": { "$ref": "#/components/schemas/BetaManagedAgentsErrorResponse" } + } } }, "501": { "description": "Unimplemented - The operation is not implemented or supported", "content": { - "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } + "application/json": { + "schema": { "$ref": "#/components/schemas/BetaManagedAgentsErrorResponse" } + } } }, "503": { "description": "Unavailable - The service is currently unavailable", "content": { - "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } + "application/json": { + "schema": { "$ref": "#/components/schemas/BetaManagedAgentsErrorResponse" } + } } }, "504": { "description": "Deadline exceeded - Upstream service did not respond in time", "content": { - "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } + "application/json": { + "schema": { "$ref": "#/components/schemas/BetaManagedAgentsErrorResponse" } + } } } } - } - }, - "/v1/user_profiles/{user_profile_id}/enrollment_url?beta=true": { + }, "post": { - "operationId": "BetaCreateEnrollmentUrl", - "summary": "Create Enrollment URL", + "operationId": "BetaUpdateMemory", + "summary": "Update a memory", "parameters": [ { "name": "anthropic-version", "in": "header", "required": false, "schema": { "type": "string" } }, { @@ -10185,225 +10236,1849 @@ } }, { - "name": "user_profile_id", + "name": "memory_store_id", "in": "path", "required": true, "schema": { "type": "string" }, - "description": "Path parameter user_profile_id", - "example": "uprof_011CZkZCu8hGbp5mYRQgUmz9" - } - ], - "responses": { - "200": { - "description": "Successful response (OK)", - "content": { - "application/json": { "schema": { "$ref": "#/components/schemas/BetaEnrollmentUrl" } } - } + "description": "Path parameter memory_store_id" }, - "400": { + { + "name": "memory_id", + "in": "path", + "required": true, + "schema": { "type": "string", "x-stainless-cli-data-alias": "id" }, + "description": "Path parameter memory_id" + }, + { + "name": "view", + "in": "query", + "required": false, + "schema": { "$ref": "#/components/schemas/BetaManagedAgentsMemoryView" }, + "description": "Query parameter for view" + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/BetaManagedAgentsUpdateMemoryParams" } + } + } + }, + "responses": { + "200": { + "description": "Successful response (OK)", + "content": { + "application/json": { "schema": { "$ref": "#/components/schemas/BetaManagedAgentsMemory" } } + } + }, + "400": { "description": "Invalid argument - The client specified an invalid argument", "content": { - "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } + "application/json": { + "schema": { "$ref": "#/components/schemas/BetaManagedAgentsErrorResponse" } + } } }, "401": { "description": "Unauthenticated - The request does not have valid authentication credentials", "content": { - "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } + "application/json": { + "schema": { "$ref": "#/components/schemas/BetaManagedAgentsErrorResponse" } + } } }, "403": { "description": "Permission denied - The caller does not have permission to execute the specified operation", "content": { - "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } + "application/json": { + "schema": { "$ref": "#/components/schemas/BetaManagedAgentsErrorResponse" } + } } }, "404": { "description": "Not found - Some requested entity was not found", "content": { - "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } + "application/json": { + "schema": { "$ref": "#/components/schemas/BetaManagedAgentsErrorResponse" } + } } }, "408": { "description": "Deadline exceeded - The deadline expired before the operation could complete", "content": { - "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } + "application/json": { + "schema": { "$ref": "#/components/schemas/BetaManagedAgentsErrorResponse" } + } } }, "409": { - "description": "Aborted - The operation was aborted due to concurrency issue", + "description": "Custom error status", "content": { - "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } + "application/json": { + "schema": { "$ref": "#/components/schemas/BetaManagedAgentsErrorResponse" } + } } }, "412": { "description": "Failed precondition - Operation was rejected because the system is not in required state", "content": { - "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } + "application/json": { + "schema": { "$ref": "#/components/schemas/BetaManagedAgentsErrorResponse" } + } } }, "413": { "description": "Out of range - Operation was attempted past the valid range", "content": { - "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } + "application/json": { + "schema": { "$ref": "#/components/schemas/BetaManagedAgentsErrorResponse" } + } } }, "429": { "description": "Resource exhausted - Some resource has been exhausted (rate limiting)", "content": { - "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } + "application/json": { + "schema": { "$ref": "#/components/schemas/BetaManagedAgentsErrorResponse" } + } } }, "431": { "description": "Request header fields too large - Request metadata was too large", "content": { - "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } + "application/json": { + "schema": { "$ref": "#/components/schemas/BetaManagedAgentsErrorResponse" } + } } }, "499": { "description": "Cancelled - The operation was cancelled by the client", "content": { - "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } + "application/json": { + "schema": { "$ref": "#/components/schemas/BetaManagedAgentsErrorResponse" } + } } }, "500": { "description": "Internal - Internal server error", "content": { - "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } + "application/json": { + "schema": { "$ref": "#/components/schemas/BetaManagedAgentsErrorResponse" } + } } }, "501": { "description": "Unimplemented - The operation is not implemented or supported", "content": { - "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } + "application/json": { + "schema": { "$ref": "#/components/schemas/BetaManagedAgentsErrorResponse" } + } } }, "503": { "description": "Unavailable - The service is currently unavailable", "content": { - "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } + "application/json": { + "schema": { "$ref": "#/components/schemas/BetaManagedAgentsErrorResponse" } + } } }, "504": { "description": "Deadline exceeded - Upstream service did not respond in time", "content": { - "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } + "application/json": { + "schema": { "$ref": "#/components/schemas/BetaManagedAgentsErrorResponse" } + } } } } - } - } - }, - "components": { - "schemas": { - "APIError": { - "properties": { - "message": { "default": "Internal server error", "title": "Message", "type": "string" }, - "type": { "const": "api_error", "default": "api_error", "title": "Type", "type": "string" } - }, - "required": ["message", "type"], - "title": "APIError", - "type": "object" - }, - "AllowedCaller": { - "description": "Specifies who can invoke a tool.\n\nValues:\n direct: The model can call this tool directly.\n code_execution_20250825: The tool can be called from the code execution environment (v1).\n code_execution_20260120: The tool can be called from the code execution environment (v2 with persistence).", - "enum": ["direct", "code_execution_20250825", "code_execution_20260120"], - "title": "AllowedCaller", - "type": "string" - }, - "AuthenticationError": { - "properties": { - "message": { "default": "Authentication error", "title": "Message", "type": "string" }, - "type": { - "const": "authentication_error", - "default": "authentication_error", - "title": "Type", - "type": "string" - } - }, - "required": ["message", "type"], - "title": "AuthenticationError", - "type": "object" - }, - "Base64ImageSource": { - "additionalProperties": false, - "properties": { - "data": { "format": "byte", "title": "Data", "type": "string" }, - "media_type": { - "enum": ["image/jpeg", "image/png", "image/gif", "image/webp"], - "title": "Media Type", - "type": "string" - }, - "type": { "const": "base64", "title": "Type", "type": "string" } - }, - "required": ["data", "media_type", "type"], - "title": "Base64ImageSource", - "type": "object" - }, - "Base64PDFSource": { - "additionalProperties": false, - "properties": { - "data": { "format": "byte", "title": "Data", "type": "string" }, - "media_type": { "const": "application/pdf", "title": "Media Type", "type": "string" }, - "type": { "const": "base64", "title": "Type", "type": "string" } - }, - "required": ["data", "media_type", "type"], - "title": "Base64PDFSource", - "type": "object" - }, - "BashCodeExecutionToolResultErrorCode": { - "enum": [ - "invalid_tool_input", - "unavailable", - "too_many_requests", - "execution_time_exceeded", - "output_file_too_large" - ], - "title": "BashCodeExecutionToolResultErrorCode", - "type": "string" }, - "BashTool_20250124": { - "additionalProperties": false, - "properties": { - "allowed_callers": { - "items": { "$ref": "#/components/schemas/AllowedCaller" }, - "title": "Allowed Callers", - "type": "array" + "delete": { + "operationId": "BetaDeleteMemory", + "summary": "Delete a memory", + "parameters": [ + { "name": "x-api-key", "in": "header", "required": false, "schema": { "type": "string" } }, + { "name": "anthropic-version", "in": "header", "required": false, "schema": { "type": "string" } }, + { + "name": "anthropic-beta", + "in": "header", + "required": false, + "schema": { + "type": "string", + "items": { "type": "string" }, + "x-stainless-override-schema": { + "x-stainless-param": "betas", + "x-stainless-extend-default": true, + "type": "array", + "description": "Optional header to specify the beta version(s) you want to use.", + "items": { "$ref": "#/components/schemas/AnthropicBeta" } + } + } }, - "cache_control": { - "anyOf": [ - { - "discriminator": { - "mapping": { "ephemeral": "#/components/schemas/CacheControlEphemeral" }, - "propertyName": "type" - }, - "oneOf": [{ "$ref": "#/components/schemas/CacheControlEphemeral" }] - }, - { "type": "null" } - ], - "description": "Create a cache control breakpoint at this content block.", - "title": "Cache Control" + { + "name": "memory_store_id", + "in": "path", + "required": true, + "schema": { "type": "string" }, + "description": "Path parameter memory_store_id" }, - "defer_loading": { - "description": "If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.", - "title": "Defer Loading", - "type": "boolean" + { + "name": "memory_id", + "in": "path", + "required": true, + "schema": { "type": "string" }, + "description": "Path parameter memory_id" }, - "input_examples": { - "items": { - "additionalProperties": { "$ref": "#/components/schemas/JsonValue" }, - "type": "object" - }, - "title": "Input Examples", - "type": "array" + { + "name": "expected_content_sha256", + "in": "query", + "required": false, + "schema": { "type": "string" }, + "description": "Query parameter for expected_content_sha256" + } + ], + "responses": { + "200": { + "description": "Successful response (OK)", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/BetaManagedAgentsDeletedMemory" } + } + } }, - "name": { - "const": "bash", - "description": "Name of the tool.\n\nThis is how the tool will be called by the model and in `tool_use` blocks.", - "title": "Name", - "type": "string" + "400": { + "description": "Invalid argument - The client specified an invalid argument", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/BetaManagedAgentsErrorResponse" } + } + } }, - "strict": { + "401": { + "description": "Unauthenticated - The request does not have valid authentication credentials", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/BetaManagedAgentsErrorResponse" } + } + } + }, + "403": { + "description": "Permission denied - The caller does not have permission to execute the specified operation", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/BetaManagedAgentsErrorResponse" } + } + } + }, + "404": { + "description": "Not found - Some requested entity was not found", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/BetaManagedAgentsErrorResponse" } + } + } + }, + "408": { + "description": "Deadline exceeded - The deadline expired before the operation could complete", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/BetaManagedAgentsErrorResponse" } + } + } + }, + "409": { + "description": "Custom error status", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/BetaManagedAgentsErrorResponse" } + } + } + }, + "412": { + "description": "Failed precondition - Operation was rejected because the system is not in required state", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/BetaManagedAgentsErrorResponse" } + } + } + }, + "413": { + "description": "Out of range - Operation was attempted past the valid range", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/BetaManagedAgentsErrorResponse" } + } + } + }, + "429": { + "description": "Resource exhausted - Some resource has been exhausted (rate limiting)", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/BetaManagedAgentsErrorResponse" } + } + } + }, + "431": { + "description": "Request header fields too large - Request metadata was too large", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/BetaManagedAgentsErrorResponse" } + } + } + }, + "499": { + "description": "Cancelled - The operation was cancelled by the client", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/BetaManagedAgentsErrorResponse" } + } + } + }, + "500": { + "description": "Internal - Internal server error", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/BetaManagedAgentsErrorResponse" } + } + } + }, + "501": { + "description": "Unimplemented - The operation is not implemented or supported", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/BetaManagedAgentsErrorResponse" } + } + } + }, + "503": { + "description": "Unavailable - The service is currently unavailable", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/BetaManagedAgentsErrorResponse" } + } + } + }, + "504": { + "description": "Deadline exceeded - Upstream service did not respond in time", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/BetaManagedAgentsErrorResponse" } + } + } + } + } + } + }, + "/v1/memory_stores/{memory_store_id}/memory_versions?beta=true": { + "get": { + "operationId": "BetaListMemoryVersions", + "summary": "List memory versions", + "parameters": [ + { "name": "x-api-key", "in": "header", "required": false, "schema": { "type": "string" } }, + { "name": "anthropic-version", "in": "header", "required": false, "schema": { "type": "string" } }, + { + "name": "anthropic-beta", + "in": "header", + "required": false, + "schema": { + "type": "string", + "items": { "type": "string" }, + "x-stainless-override-schema": { + "x-stainless-param": "betas", + "x-stainless-extend-default": true, + "type": "array", + "description": "Optional header to specify the beta version(s) you want to use.", + "items": { "$ref": "#/components/schemas/AnthropicBeta" } + } + } + }, + { + "name": "memory_store_id", + "in": "path", + "required": true, + "schema": { "type": "string" }, + "description": "Path parameter memory_store_id" + }, + { + "name": "memory_id", + "in": "query", + "required": false, + "schema": { "type": "string" }, + "description": "Query parameter for memory_id" + }, + { + "name": "session_id", + "in": "query", + "required": false, + "schema": { "type": "string" }, + "description": "Query parameter for session_id" + }, + { + "name": "api_key_id", + "in": "query", + "required": false, + "schema": { "type": "string" }, + "description": "Query parameter for api_key_id" + }, + { + "name": "operation", + "in": "query", + "required": false, + "schema": { "$ref": "#/components/schemas/BetaManagedAgentsMemoryVersionOperation" }, + "description": "Query parameter for operation" + }, + { + "name": "created_at[gte]", + "in": "query", + "required": false, + "schema": { "$ref": "#/components/schemas/BetaTimestamp" }, + "description": "Return versions created at or after this time (inclusive)." + }, + { + "name": "created_at[lte]", + "in": "query", + "required": false, + "schema": { "$ref": "#/components/schemas/BetaTimestamp" }, + "description": "Return versions created at or before this time (inclusive)." + }, + { + "name": "limit", + "in": "query", + "required": false, + "schema": { "type": "integer", "format": "int32" }, + "description": "Query parameter for limit" + }, + { + "name": "page", + "in": "query", + "required": false, + "schema": { "type": "string" }, + "description": "Query parameter for page" + }, + { + "name": "view", + "in": "query", + "required": false, + "schema": { "$ref": "#/components/schemas/BetaManagedAgentsMemoryView" }, + "description": "Query parameter for view" + } + ], + "responses": { + "200": { + "description": "Successful response (OK)", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/BetaManagedAgentsListMemoryVersionsResult" } + } + } + }, + "400": { + "description": "Invalid argument - The client specified an invalid argument", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/BetaManagedAgentsErrorResponse" } + } + } + }, + "401": { + "description": "Unauthenticated - The request does not have valid authentication credentials", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/BetaManagedAgentsErrorResponse" } + } + } + }, + "403": { + "description": "Permission denied - The caller does not have permission to execute the specified operation", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/BetaManagedAgentsErrorResponse" } + } + } + }, + "404": { + "description": "Not found - Some requested entity was not found", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/BetaManagedAgentsErrorResponse" } + } + } + }, + "408": { + "description": "Deadline exceeded - The deadline expired before the operation could complete", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/BetaManagedAgentsErrorResponse" } + } + } + }, + "409": { + "description": "Custom error status", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/BetaManagedAgentsErrorResponse" } + } + } + }, + "412": { + "description": "Failed precondition - Operation was rejected because the system is not in required state", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/BetaManagedAgentsErrorResponse" } + } + } + }, + "413": { + "description": "Out of range - Operation was attempted past the valid range", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/BetaManagedAgentsErrorResponse" } + } + } + }, + "429": { + "description": "Resource exhausted - Some resource has been exhausted (rate limiting)", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/BetaManagedAgentsErrorResponse" } + } + } + }, + "431": { + "description": "Request header fields too large - Request metadata was too large", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/BetaManagedAgentsErrorResponse" } + } + } + }, + "499": { + "description": "Cancelled - The operation was cancelled by the client", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/BetaManagedAgentsErrorResponse" } + } + } + }, + "500": { + "description": "Internal - Internal server error", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/BetaManagedAgentsErrorResponse" } + } + } + }, + "501": { + "description": "Unimplemented - The operation is not implemented or supported", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/BetaManagedAgentsErrorResponse" } + } + } + }, + "503": { + "description": "Unavailable - The service is currently unavailable", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/BetaManagedAgentsErrorResponse" } + } + } + }, + "504": { + "description": "Deadline exceeded - Upstream service did not respond in time", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/BetaManagedAgentsErrorResponse" } + } + } + } + } + } + }, + "/v1/memory_stores/{memory_store_id}/memory_versions/{memory_version_id}?beta=true": { + "get": { + "operationId": "BetaGetMemoryVersion", + "summary": "Retrieve a memory version", + "parameters": [ + { "name": "x-api-key", "in": "header", "required": false, "schema": { "type": "string" } }, + { "name": "anthropic-version", "in": "header", "required": false, "schema": { "type": "string" } }, + { + "name": "anthropic-beta", + "in": "header", + "required": false, + "schema": { + "type": "string", + "items": { "type": "string" }, + "x-stainless-override-schema": { + "x-stainless-param": "betas", + "x-stainless-extend-default": true, + "type": "array", + "description": "Optional header to specify the beta version(s) you want to use.", + "items": { "$ref": "#/components/schemas/AnthropicBeta" } + } + } + }, + { + "name": "memory_store_id", + "in": "path", + "required": true, + "schema": { "type": "string" }, + "description": "Path parameter memory_store_id" + }, + { + "name": "memory_version_id", + "in": "path", + "required": true, + "schema": { "type": "string" }, + "description": "Path parameter memory_version_id" + }, + { + "name": "view", + "in": "query", + "required": false, + "schema": { "$ref": "#/components/schemas/BetaManagedAgentsMemoryView" }, + "description": "Query parameter for view" + } + ], + "responses": { + "200": { + "description": "Successful response (OK)", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/BetaManagedAgentsMemoryVersion" } + } + } + }, + "400": { + "description": "Invalid argument - The client specified an invalid argument", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/BetaManagedAgentsErrorResponse" } + } + } + }, + "401": { + "description": "Unauthenticated - The request does not have valid authentication credentials", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/BetaManagedAgentsErrorResponse" } + } + } + }, + "403": { + "description": "Permission denied - The caller does not have permission to execute the specified operation", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/BetaManagedAgentsErrorResponse" } + } + } + }, + "404": { + "description": "Not found - Some requested entity was not found", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/BetaManagedAgentsErrorResponse" } + } + } + }, + "408": { + "description": "Deadline exceeded - The deadline expired before the operation could complete", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/BetaManagedAgentsErrorResponse" } + } + } + }, + "409": { + "description": "Custom error status", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/BetaManagedAgentsErrorResponse" } + } + } + }, + "412": { + "description": "Failed precondition - Operation was rejected because the system is not in required state", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/BetaManagedAgentsErrorResponse" } + } + } + }, + "413": { + "description": "Out of range - Operation was attempted past the valid range", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/BetaManagedAgentsErrorResponse" } + } + } + }, + "429": { + "description": "Resource exhausted - Some resource has been exhausted (rate limiting)", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/BetaManagedAgentsErrorResponse" } + } + } + }, + "431": { + "description": "Request header fields too large - Request metadata was too large", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/BetaManagedAgentsErrorResponse" } + } + } + }, + "499": { + "description": "Cancelled - The operation was cancelled by the client", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/BetaManagedAgentsErrorResponse" } + } + } + }, + "500": { + "description": "Internal - Internal server error", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/BetaManagedAgentsErrorResponse" } + } + } + }, + "501": { + "description": "Unimplemented - The operation is not implemented or supported", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/BetaManagedAgentsErrorResponse" } + } + } + }, + "503": { + "description": "Unavailable - The service is currently unavailable", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/BetaManagedAgentsErrorResponse" } + } + } + }, + "504": { + "description": "Deadline exceeded - Upstream service did not respond in time", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/BetaManagedAgentsErrorResponse" } + } + } + } + } + } + }, + "/v1/memory_stores/{memory_store_id}/memory_versions/{memory_version_id}/redact?beta=true": { + "post": { + "operationId": "BetaRedactMemoryVersion", + "summary": "Redact a memory version", + "parameters": [ + { "name": "anthropic-version", "in": "header", "required": false, "schema": { "type": "string" } }, + { + "name": "anthropic-beta", + "in": "header", + "required": false, + "schema": { + "type": "string", + "items": { "type": "string" }, + "x-stainless-override-schema": { + "x-stainless-param": "betas", + "x-stainless-extend-default": true, + "type": "array", + "description": "Optional header to specify the beta version(s) you want to use.", + "items": { "$ref": "#/components/schemas/AnthropicBeta" } + } + } + }, + { + "name": "memory_store_id", + "in": "path", + "required": true, + "schema": { "type": "string" }, + "description": "Path parameter memory_store_id" + }, + { + "name": "memory_version_id", + "in": "path", + "required": true, + "schema": { "type": "string" }, + "description": "Path parameter memory_version_id" + } + ], + "responses": { + "200": { + "description": "Successful response (OK)", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/BetaManagedAgentsMemoryVersion" } + } + } + }, + "400": { + "description": "Invalid argument - The client specified an invalid argument", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/BetaManagedAgentsErrorResponse" } + } + } + }, + "401": { + "description": "Unauthenticated - The request does not have valid authentication credentials", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/BetaManagedAgentsErrorResponse" } + } + } + }, + "403": { + "description": "Permission denied - The caller does not have permission to execute the specified operation", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/BetaManagedAgentsErrorResponse" } + } + } + }, + "404": { + "description": "Not found - Some requested entity was not found", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/BetaManagedAgentsErrorResponse" } + } + } + }, + "408": { + "description": "Deadline exceeded - The deadline expired before the operation could complete", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/BetaManagedAgentsErrorResponse" } + } + } + }, + "409": { + "description": "Custom error status", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/BetaManagedAgentsErrorResponse" } + } + } + }, + "412": { + "description": "Failed precondition - Operation was rejected because the system is not in required state", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/BetaManagedAgentsErrorResponse" } + } + } + }, + "413": { + "description": "Out of range - Operation was attempted past the valid range", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/BetaManagedAgentsErrorResponse" } + } + } + }, + "429": { + "description": "Resource exhausted - Some resource has been exhausted (rate limiting)", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/BetaManagedAgentsErrorResponse" } + } + } + }, + "431": { + "description": "Request header fields too large - Request metadata was too large", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/BetaManagedAgentsErrorResponse" } + } + } + }, + "499": { + "description": "Cancelled - The operation was cancelled by the client", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/BetaManagedAgentsErrorResponse" } + } + } + }, + "500": { + "description": "Internal - Internal server error", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/BetaManagedAgentsErrorResponse" } + } + } + }, + "501": { + "description": "Unimplemented - The operation is not implemented or supported", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/BetaManagedAgentsErrorResponse" } + } + } + }, + "503": { + "description": "Unavailable - The service is currently unavailable", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/BetaManagedAgentsErrorResponse" } + } + } + }, + "504": { + "description": "Deadline exceeded - Upstream service did not respond in time", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/BetaManagedAgentsErrorResponse" } + } + } + } + } + } + }, + "/v1/memory_stores?beta=true": { + "post": { + "operationId": "BetaCreateMemoryStore", + "summary": "Create a memory store", + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/BetaManagedAgentsCreateMemoryStoreRequest" } + } + } + }, + "responses": { + "200": { + "description": "Successful response (OK)", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/BetaManagedAgentsCreateMemoryStoreResponse" } + } + } + }, + "400": { + "description": "Invalid argument - The client specified an invalid argument", + "content": { + "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } + } + }, + "401": { + "description": "Unauthenticated - The request does not have valid authentication credentials", + "content": { + "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } + } + }, + "403": { + "description": "Permission denied - The caller does not have permission to execute the specified operation", + "content": { + "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } + } + }, + "404": { + "description": "Not found - Some requested entity was not found", + "content": { + "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } + } + }, + "408": { + "description": "Deadline exceeded - The deadline expired before the operation could complete", + "content": { + "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } + } + }, + "409": { + "description": "Aborted - The operation was aborted due to concurrency issue", + "content": { + "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } + } + }, + "412": { + "description": "Failed precondition - Operation was rejected because the system is not in required state", + "content": { + "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } + } + }, + "413": { + "description": "Out of range - Operation was attempted past the valid range", + "content": { + "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } + } + }, + "429": { + "description": "Resource exhausted - Some resource has been exhausted (rate limiting)", + "content": { + "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } + } + }, + "431": { + "description": "Request header fields too large - Request metadata was too large", + "content": { + "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } + } + }, + "499": { + "description": "Cancelled - The operation was cancelled by the client", + "content": { + "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } + } + }, + "500": { + "description": "Internal - Internal server error", + "content": { + "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } + } + }, + "501": { + "description": "Unimplemented - The operation is not implemented or supported", + "content": { + "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } + } + }, + "503": { + "description": "Unavailable - The service is currently unavailable", + "content": { + "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } + } + }, + "504": { + "description": "Deadline exceeded - Upstream service did not respond in time", + "content": { + "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } + } + } + }, + "parameters": [ + { "name": "anthropic-version", "in": "header", "required": false, "schema": { "type": "string" } }, + { + "name": "anthropic-beta", + "in": "header", + "required": false, + "schema": { + "type": "string", + "items": { "type": "string" }, + "x-stainless-override-schema": { + "x-stainless-param": "betas", + "x-stainless-extend-default": true, + "type": "array", + "description": "Optional header to specify the beta version(s) you want to use.", + "items": { "$ref": "#/components/schemas/AnthropicBeta" } + } + } + } + ] + }, + "get": { + "operationId": "BetaListMemoryStores", + "summary": "List memory stores", + "parameters": [ + { "name": "x-api-key", "in": "header", "required": false, "schema": { "type": "string" } }, + { "name": "anthropic-version", "in": "header", "required": false, "schema": { "type": "string" } }, + { + "name": "anthropic-beta", + "in": "header", + "required": false, + "schema": { + "type": "string", + "items": { "type": "string" }, + "x-stainless-override-schema": { + "x-stainless-param": "betas", + "x-stainless-extend-default": true, + "type": "array", + "description": "Optional header to specify the beta version(s) you want to use.", + "items": { "$ref": "#/components/schemas/AnthropicBeta" } + } + } + }, + { + "name": "limit", + "in": "query", + "required": false, + "schema": { "type": "integer", "format": "int32" }, + "description": "Maximum number of stores to return per page. Must be between 1 and 100. Defaults to 20 when omitted." + }, + { + "name": "page", + "in": "query", + "required": false, + "schema": { "type": "string" }, + "description": "Opaque pagination cursor (a `page_...` value). Pass the `next_page` value from a previous response to fetch the next page; omit for the first page." + }, + { + "name": "include_archived", + "in": "query", + "required": false, + "schema": { "type": "boolean" }, + "description": "When `true`, archived stores are included in the results. Defaults to `false` (archived stores are excluded)." + }, + { + "name": "created_at[gte]", + "in": "query", + "required": false, + "schema": { "$ref": "#/components/schemas/BetaTimestamp" }, + "description": "Return only stores whose `created_at` is at or after this time (inclusive). Sent on the wire as `created_at[gte]`." + }, + { + "name": "created_at[lte]", + "in": "query", + "required": false, + "schema": { "$ref": "#/components/schemas/BetaTimestamp" }, + "description": "Return only stores whose `created_at` is at or before this time (inclusive). Sent on the wire as `created_at[lte]`." + } + ], + "responses": { + "200": { + "description": "Successful response (OK)", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/BetaManagedAgentsListMemoryStoresResponse" } + } + } + }, + "400": { + "description": "Invalid argument - The client specified an invalid argument", + "content": { + "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } + } + }, + "401": { + "description": "Unauthenticated - The request does not have valid authentication credentials", + "content": { + "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } + } + }, + "403": { + "description": "Permission denied - The caller does not have permission to execute the specified operation", + "content": { + "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } + } + }, + "404": { + "description": "Not found - Some requested entity was not found", + "content": { + "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } + } + }, + "408": { + "description": "Deadline exceeded - The deadline expired before the operation could complete", + "content": { + "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } + } + }, + "409": { + "description": "Aborted - The operation was aborted due to concurrency issue", + "content": { + "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } + } + }, + "412": { + "description": "Failed precondition - Operation was rejected because the system is not in required state", + "content": { + "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } + } + }, + "413": { + "description": "Out of range - Operation was attempted past the valid range", + "content": { + "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } + } + }, + "429": { + "description": "Resource exhausted - Some resource has been exhausted (rate limiting)", + "content": { + "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } + } + }, + "431": { + "description": "Request header fields too large - Request metadata was too large", + "content": { + "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } + } + }, + "499": { + "description": "Cancelled - The operation was cancelled by the client", + "content": { + "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } + } + }, + "500": { + "description": "Internal - Internal server error", + "content": { + "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } + } + }, + "501": { + "description": "Unimplemented - The operation is not implemented or supported", + "content": { + "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } + } + }, + "503": { + "description": "Unavailable - The service is currently unavailable", + "content": { + "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } + } + }, + "504": { + "description": "Deadline exceeded - Upstream service did not respond in time", + "content": { + "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } + } + } + } + } + }, + "/v1/memory_stores/{memory_store_id}?beta=true": { + "get": { + "operationId": "BetaGetMemoryStore", + "summary": "Retrieve a memory store", + "parameters": [ + { "name": "x-api-key", "in": "header", "required": false, "schema": { "type": "string" } }, + { "name": "anthropic-version", "in": "header", "required": false, "schema": { "type": "string" } }, + { + "name": "anthropic-beta", + "in": "header", + "required": false, + "schema": { + "type": "string", + "items": { "type": "string" }, + "x-stainless-override-schema": { + "x-stainless-param": "betas", + "x-stainless-extend-default": true, + "type": "array", + "description": "Optional header to specify the beta version(s) you want to use.", + "items": { "$ref": "#/components/schemas/AnthropicBeta" } + } + } + }, + { + "name": "memory_store_id", + "in": "path", + "required": true, + "schema": { "type": "string" }, + "description": "Path parameter memory_store_id" + } + ], + "responses": { + "200": { + "description": "Successful response (OK)", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/BetaManagedAgentsGetMemoryStoreResponse" } + } + } + }, + "400": { + "description": "Invalid argument - The client specified an invalid argument", + "content": { + "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } + } + }, + "401": { + "description": "Unauthenticated - The request does not have valid authentication credentials", + "content": { + "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } + } + }, + "403": { + "description": "Permission denied - The caller does not have permission to execute the specified operation", + "content": { + "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } + } + }, + "404": { + "description": "Not found - Some requested entity was not found", + "content": { + "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } + } + }, + "408": { + "description": "Deadline exceeded - The deadline expired before the operation could complete", + "content": { + "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } + } + }, + "409": { + "description": "Aborted - The operation was aborted due to concurrency issue", + "content": { + "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } + } + }, + "412": { + "description": "Failed precondition - Operation was rejected because the system is not in required state", + "content": { + "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } + } + }, + "413": { + "description": "Out of range - Operation was attempted past the valid range", + "content": { + "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } + } + }, + "429": { + "description": "Resource exhausted - Some resource has been exhausted (rate limiting)", + "content": { + "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } + } + }, + "431": { + "description": "Request header fields too large - Request metadata was too large", + "content": { + "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } + } + }, + "499": { + "description": "Cancelled - The operation was cancelled by the client", + "content": { + "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } + } + }, + "500": { + "description": "Internal - Internal server error", + "content": { + "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } + } + }, + "501": { + "description": "Unimplemented - The operation is not implemented or supported", + "content": { + "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } + } + }, + "503": { + "description": "Unavailable - The service is currently unavailable", + "content": { + "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } + } + }, + "504": { + "description": "Deadline exceeded - Upstream service did not respond in time", + "content": { + "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } + } + } + } + }, + "post": { + "operationId": "BetaUpdateMemoryStore", + "summary": "Update a memory store", + "parameters": [ + { "name": "anthropic-version", "in": "header", "required": false, "schema": { "type": "string" } }, + { + "name": "anthropic-beta", + "in": "header", + "required": false, + "schema": { + "type": "string", + "items": { "type": "string" }, + "x-stainless-override-schema": { + "x-stainless-param": "betas", + "x-stainless-extend-default": true, + "type": "array", + "description": "Optional header to specify the beta version(s) you want to use.", + "items": { "$ref": "#/components/schemas/AnthropicBeta" } + } + } + }, + { + "name": "memory_store_id", + "in": "path", + "required": true, + "schema": { "type": "string", "x-stainless-cli-data-alias": "id" }, + "description": "Path parameter memory_store_id" + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/BetaManagedAgentsUpdateMemoryStoreRequestBody" } + } + } + }, + "responses": { + "200": { + "description": "Successful response (OK)", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/BetaManagedAgentsUpdateMemoryStoreResponse" } + } + } + }, + "400": { + "description": "Invalid argument - The client specified an invalid argument", + "content": { + "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } + } + }, + "401": { + "description": "Unauthenticated - The request does not have valid authentication credentials", + "content": { + "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } + } + }, + "403": { + "description": "Permission denied - The caller does not have permission to execute the specified operation", + "content": { + "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } + } + }, + "404": { + "description": "Not found - Some requested entity was not found", + "content": { + "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } + } + }, + "408": { + "description": "Deadline exceeded - The deadline expired before the operation could complete", + "content": { + "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } + } + }, + "409": { + "description": "Aborted - The operation was aborted due to concurrency issue", + "content": { + "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } + } + }, + "412": { + "description": "Failed precondition - Operation was rejected because the system is not in required state", + "content": { + "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } + } + }, + "413": { + "description": "Out of range - Operation was attempted past the valid range", + "content": { + "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } + } + }, + "429": { + "description": "Resource exhausted - Some resource has been exhausted (rate limiting)", + "content": { + "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } + } + }, + "431": { + "description": "Request header fields too large - Request metadata was too large", + "content": { + "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } + } + }, + "499": { + "description": "Cancelled - The operation was cancelled by the client", + "content": { + "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } + } + }, + "500": { + "description": "Internal - Internal server error", + "content": { + "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } + } + }, + "501": { + "description": "Unimplemented - The operation is not implemented or supported", + "content": { + "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } + } + }, + "503": { + "description": "Unavailable - The service is currently unavailable", + "content": { + "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } + } + }, + "504": { + "description": "Deadline exceeded - Upstream service did not respond in time", + "content": { + "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } + } + } + } + }, + "delete": { + "operationId": "BetaDeleteMemoryStore", + "summary": "Delete a memory store", + "parameters": [ + { "name": "x-api-key", "in": "header", "required": false, "schema": { "type": "string" } }, + { "name": "anthropic-version", "in": "header", "required": false, "schema": { "type": "string" } }, + { + "name": "anthropic-beta", + "in": "header", + "required": false, + "schema": { + "type": "string", + "items": { "type": "string" }, + "x-stainless-override-schema": { + "x-stainless-param": "betas", + "x-stainless-extend-default": true, + "type": "array", + "description": "Optional header to specify the beta version(s) you want to use.", + "items": { "$ref": "#/components/schemas/AnthropicBeta" } + } + } + }, + { + "name": "memory_store_id", + "in": "path", + "required": true, + "schema": { "type": "string" }, + "description": "Path parameter memory_store_id" + } + ], + "responses": { + "200": { + "description": "Successful response (OK)", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/BetaManagedAgentsDeleteMemoryStoreResponse" } + } + } + }, + "400": { + "description": "Invalid argument - The client specified an invalid argument", + "content": { + "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } + } + }, + "401": { + "description": "Unauthenticated - The request does not have valid authentication credentials", + "content": { + "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } + } + }, + "403": { + "description": "Permission denied - The caller does not have permission to execute the specified operation", + "content": { + "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } + } + }, + "404": { + "description": "Not found - Some requested entity was not found", + "content": { + "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } + } + }, + "408": { + "description": "Deadline exceeded - The deadline expired before the operation could complete", + "content": { + "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } + } + }, + "409": { + "description": "Aborted - The operation was aborted due to concurrency issue", + "content": { + "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } + } + }, + "412": { + "description": "Failed precondition - Operation was rejected because the system is not in required state", + "content": { + "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } + } + }, + "413": { + "description": "Out of range - Operation was attempted past the valid range", + "content": { + "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } + } + }, + "429": { + "description": "Resource exhausted - Some resource has been exhausted (rate limiting)", + "content": { + "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } + } + }, + "431": { + "description": "Request header fields too large - Request metadata was too large", + "content": { + "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } + } + }, + "499": { + "description": "Cancelled - The operation was cancelled by the client", + "content": { + "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } + } + }, + "500": { + "description": "Internal - Internal server error", + "content": { + "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } + } + }, + "501": { + "description": "Unimplemented - The operation is not implemented or supported", + "content": { + "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } + } + }, + "503": { + "description": "Unavailable - The service is currently unavailable", + "content": { + "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } + } + }, + "504": { + "description": "Deadline exceeded - Upstream service did not respond in time", + "content": { + "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } + } + } + } + } + }, + "/v1/memory_stores/{memory_store_id}/archive?beta=true": { + "post": { + "operationId": "BetaArchiveMemoryStore", + "summary": "Archive a memory store", + "parameters": [ + { "name": "anthropic-version", "in": "header", "required": false, "schema": { "type": "string" } }, + { + "name": "anthropic-beta", + "in": "header", + "required": false, + "schema": { + "type": "string", + "items": { "type": "string" }, + "x-stainless-override-schema": { + "x-stainless-param": "betas", + "x-stainless-extend-default": true, + "type": "array", + "description": "Optional header to specify the beta version(s) you want to use.", + "items": { "$ref": "#/components/schemas/AnthropicBeta" } + } + } + }, + { + "name": "memory_store_id", + "in": "path", + "required": true, + "schema": { "type": "string" }, + "description": "Path parameter memory_store_id" + } + ], + "responses": { + "200": { + "description": "Successful response (OK)", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/BetaManagedAgentsArchiveMemoryStoreResponse" } + } + } + }, + "400": { + "description": "Invalid argument - The client specified an invalid argument", + "content": { + "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } + } + }, + "401": { + "description": "Unauthenticated - The request does not have valid authentication credentials", + "content": { + "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } + } + }, + "403": { + "description": "Permission denied - The caller does not have permission to execute the specified operation", + "content": { + "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } + } + }, + "404": { + "description": "Not found - Some requested entity was not found", + "content": { + "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } + } + }, + "408": { + "description": "Deadline exceeded - The deadline expired before the operation could complete", + "content": { + "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } + } + }, + "409": { + "description": "Aborted - The operation was aborted due to concurrency issue", + "content": { + "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } + } + }, + "412": { + "description": "Failed precondition - Operation was rejected because the system is not in required state", + "content": { + "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } + } + }, + "413": { + "description": "Out of range - Operation was attempted past the valid range", + "content": { + "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } + } + }, + "429": { + "description": "Resource exhausted - Some resource has been exhausted (rate limiting)", + "content": { + "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } + } + }, + "431": { + "description": "Request header fields too large - Request metadata was too large", + "content": { + "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } + } + }, + "499": { + "description": "Cancelled - The operation was cancelled by the client", + "content": { + "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } + } + }, + "500": { + "description": "Internal - Internal server error", + "content": { + "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } + } + }, + "501": { + "description": "Unimplemented - The operation is not implemented or supported", + "content": { + "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } + } + }, + "503": { + "description": "Unavailable - The service is currently unavailable", + "content": { + "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } + } + }, + "504": { + "description": "Deadline exceeded - Upstream service did not respond in time", + "content": { + "application/json": { "schema": { "$ref": "#/components/schemas/BetaErrorResponse" } } + } + } + } + } + } + }, + "components": { + "schemas": { + "APIError": { + "properties": { + "message": { "default": "Internal server error", "title": "Message", "type": "string" }, + "type": { "const": "api_error", "default": "api_error", "title": "Type", "type": "string" } + }, + "required": ["message", "type"], + "title": "APIError", + "type": "object" + }, + "AllowedCaller": { + "description": "Specifies who can invoke a tool.\n\nValues:\n direct: The model can call this tool directly.\n code_execution_20250825: The tool can be called from the code execution environment (v1).\n code_execution_20260120: The tool can be called from the code execution environment (v2 with persistence).", + "enum": ["direct", "code_execution_20250825", "code_execution_20260120"], + "title": "AllowedCaller", + "type": "string" + }, + "AuthenticationError": { + "properties": { + "message": { "default": "Authentication error", "title": "Message", "type": "string" }, + "type": { + "const": "authentication_error", + "default": "authentication_error", + "title": "Type", + "type": "string" + } + }, + "required": ["message", "type"], + "title": "AuthenticationError", + "type": "object" + }, + "Base64ImageSource": { + "additionalProperties": false, + "properties": { + "data": { "format": "byte", "title": "Data", "type": "string" }, + "media_type": { + "enum": ["image/jpeg", "image/png", "image/gif", "image/webp"], + "title": "Media Type", + "type": "string" + }, + "type": { "const": "base64", "title": "Type", "type": "string" } + }, + "required": ["data", "media_type", "type"], + "title": "Base64ImageSource", + "type": "object" + }, + "Base64PDFSource": { + "additionalProperties": false, + "properties": { + "data": { "format": "byte", "title": "Data", "type": "string" }, + "media_type": { "const": "application/pdf", "title": "Media Type", "type": "string" }, + "type": { "const": "base64", "title": "Type", "type": "string" } + }, + "required": ["data", "media_type", "type"], + "title": "Base64PDFSource", + "type": "object" + }, + "BashCodeExecutionToolResultErrorCode": { + "enum": [ + "invalid_tool_input", + "unavailable", + "too_many_requests", + "execution_time_exceeded", + "output_file_too_large" + ], + "title": "BashCodeExecutionToolResultErrorCode", + "type": "string" + }, + "BashTool_20250124": { + "additionalProperties": false, + "properties": { + "allowed_callers": { + "items": { "$ref": "#/components/schemas/AllowedCaller" }, + "title": "Allowed Callers", + "type": "array" + }, + "cache_control": { + "anyOf": [ + { + "discriminator": { + "mapping": { "ephemeral": "#/components/schemas/CacheControlEphemeral" }, + "propertyName": "type" + }, + "oneOf": [{ "$ref": "#/components/schemas/CacheControlEphemeral" }] + }, + { "type": "null" } + ], + "description": "Create a cache control breakpoint at this content block.", + "title": "Cache Control" + }, + "defer_loading": { + "description": "If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.", + "title": "Defer Loading", + "type": "boolean" + }, + "input_examples": { + "items": { + "additionalProperties": { "$ref": "#/components/schemas/JsonValue" }, + "type": "object" + }, + "title": "Input Examples", + "type": "array" + }, + "name": { + "const": "bash", + "description": "Name of the tool.\n\nThis is how the tool will be called by the model and in `tool_use` blocks.", + "title": "Name", + "type": "string" + }, + "strict": { "description": "When true, guarantees schema validation on tool names and inputs", "title": "Strict", "type": "boolean" @@ -10564,132 +12239,8 @@ "BetaAllowedCaller": { "description": "Specifies who can invoke a tool.\n\nValues:\n direct: The model can call this tool directly.\n code_execution_20250825: The tool can be called from the code execution environment (v1).\n code_execution_20260120: The tool can be called from the code execution environment (v2 with persistence).", "enum": ["direct", "code_execution_20250825", "code_execution_20260120"], - "title": "AllowedCaller", - "type": "string" - }, - "BetaCloudConfig": { - "properties": { - "networking": { - "oneOf": [ - { "$ref": "#/components/schemas/BetaUnrestrictedNetwork" }, - { "$ref": "#/components/schemas/BetaLimitedNetwork" } - ], - "title": "Networking", - "description": "Network configuration policy.", - "discriminator": { - "propertyName": "type", - "mapping": { - "limited": "#/components/schemas/BetaLimitedNetwork", - "unrestricted": "#/components/schemas/BetaUnrestrictedNetwork" - } - }, - "examples": [ - { - "type": "limited", - "allowed_hosts": ["api.example.com"], - "allow_package_managers": true, - "allow_mcp_servers": false - } - ] - }, - "packages": { - "$ref": "#/components/schemas/BetaPackages", - "description": "Package manager configuration.", - "examples": [ - { - "type": "packages", - "pip": ["pandas", "numpy"], - "npm": [], - "apt": [], - "cargo": [], - "gem": [], - "go": [] - } - ] - }, - "type": { - "type": "string", - "const": "cloud", - "title": "Type", - "description": "Environment type", - "examples": ["cloud"] - } - }, - "type": "object", - "required": ["networking", "packages", "type"], - "title": "CloudConfig", - "description": "`cloud` environment configuration.", - "example": { - "type": "cloud", - "networking": { - "type": "limited", - "allowed_hosts": ["api.example.com"], - "allow_package_managers": true, - "allow_mcp_servers": false - }, - "packages": { - "type": "packages", - "pip": ["pandas", "numpy"], - "npm": [], - "apt": [], - "cargo": [], - "gem": [], - "go": [] - } - } - }, - "BetaCloudConfigParams": { - "properties": { - "networking": { - "anyOf": [ - { - "oneOf": [ - { "$ref": "#/components/schemas/BetaUnrestrictedNetwork" }, - { "$ref": "#/components/schemas/BetaLimitedNetworkParams" } - ], - "discriminator": { - "propertyName": "type", - "mapping": { - "limited": "#/components/schemas/BetaLimitedNetworkParams", - "unrestricted": "#/components/schemas/BetaUnrestrictedNetwork" - } - } - }, - { "type": "null" } - ], - "title": "Networking", - "description": "Network configuration policy. Omit on update to preserve the existing value.", - "examples": [ - { "type": "limited", "allowed_hosts": ["api.example.com"], "allow_package_managers": true } - ] - }, - "packages": { - "anyOf": [{ "$ref": "#/components/schemas/BetaPackagesParams" }, { "type": "null" }], - "description": "Package manager configuration. Omit on update to preserve the existing value.", - "examples": [{ "pip": ["pandas", "numpy"] }] - }, - "type": { - "type": "string", - "const": "cloud", - "title": "Type", - "description": "Environment type", - "examples": ["cloud"] - } - }, - "additionalProperties": false, - "type": "object", - "required": ["type"], - "title": "CloudConfigParams", - "description": "Request params for `cloud` environment configuration.\n\nFields default to null; on update, omitted fields preserve the\nexisting value.", - "example": { - "type": "cloud", - "networking": { - "type": "limited", - "allowed_hosts": ["api.example.com"], - "allow_package_managers": true - }, - "packages": { "pip": ["pandas", "numpy"] } - } + "title": "AllowedCaller", + "type": "string" }, "BetaAuthenticationError": { "properties": { @@ -10926,6 +12477,89 @@ "title": "CacheCreation", "type": "object" }, + "BetaCacheMissMessagesChanged": { + "properties": { + "cache_missed_input_tokens": { + "description": "Approximate number of input tokens that would have been read from cache had the prefix matched the previous request.", + "title": "Cache Missed Input Tokens", + "type": "integer" + }, + "type": { + "const": "messages_changed", + "default": "messages_changed", + "title": "Type", + "type": "string" + } + }, + "required": ["cache_missed_input_tokens", "type"], + "title": "CacheMissMessagesChanged", + "type": "object" + }, + "BetaCacheMissModelChanged": { + "properties": { + "cache_missed_input_tokens": { + "description": "Approximate number of input tokens that would have been read from cache had the prefix matched the previous request.", + "title": "Cache Missed Input Tokens", + "type": "integer" + }, + "type": { "const": "model_changed", "default": "model_changed", "title": "Type", "type": "string" } + }, + "required": ["cache_missed_input_tokens", "type"], + "title": "CacheMissModelChanged", + "type": "object" + }, + "BetaCacheMissPreviousMessageNotFound": { + "properties": { + "type": { + "const": "previous_message_not_found", + "default": "previous_message_not_found", + "title": "Type", + "type": "string" + } + }, + "required": ["type"], + "title": "CacheMissPreviousMessageNotFound", + "type": "object" + }, + "BetaCacheMissSystemChanged": { + "properties": { + "cache_missed_input_tokens": { + "description": "Approximate number of input tokens that would have been read from cache had the prefix matched the previous request.", + "title": "Cache Missed Input Tokens", + "type": "integer" + }, + "type": { + "const": "system_changed", + "default": "system_changed", + "title": "Type", + "type": "string" + } + }, + "required": ["cache_missed_input_tokens", "type"], + "title": "CacheMissSystemChanged", + "type": "object" + }, + "BetaCacheMissToolsChanged": { + "properties": { + "cache_missed_input_tokens": { + "description": "Approximate number of input tokens that would have been read from cache had the prefix matched the previous request.", + "title": "Cache Missed Input Tokens", + "type": "integer" + }, + "type": { "const": "tools_changed", "default": "tools_changed", "title": "Type", "type": "string" } + }, + "required": ["cache_missed_input_tokens", "type"], + "title": "CacheMissToolsChanged", + "type": "object" + }, + "BetaCacheMissUnavailable": { + "properties": { + "type": { "const": "unavailable", "default": "unavailable", "title": "Type", "type": "string" } + }, + "required": ["type"], + "title": "CacheMissUnavailable", + "type": "object" + }, "BetaCanceledResult": { "properties": { "type": { "const": "canceled", "default": "canceled", "title": "Type", "type": "string" } @@ -11060,6 +12694,130 @@ "title": "ClearToolUses20250919", "type": "object" }, + "BetaCloudConfig": { + "properties": { + "networking": { + "oneOf": [ + { "$ref": "#/components/schemas/BetaUnrestrictedNetwork" }, + { "$ref": "#/components/schemas/BetaLimitedNetwork" } + ], + "title": "Networking", + "description": "Network configuration policy.", + "discriminator": { + "propertyName": "type", + "mapping": { + "limited": "#/components/schemas/BetaLimitedNetwork", + "unrestricted": "#/components/schemas/BetaUnrestrictedNetwork" + } + }, + "examples": [ + { + "type": "limited", + "allowed_hosts": ["api.example.com"], + "allow_package_managers": true, + "allow_mcp_servers": false + } + ] + }, + "packages": { + "$ref": "#/components/schemas/BetaPackages", + "description": "Package manager configuration.", + "examples": [ + { + "type": "packages", + "pip": ["pandas", "numpy"], + "npm": [], + "apt": [], + "cargo": [], + "gem": [], + "go": [] + } + ] + }, + "type": { + "type": "string", + "const": "cloud", + "title": "Type", + "description": "Environment type", + "examples": ["cloud"] + } + }, + "type": "object", + "required": ["networking", "packages", "type"], + "title": "CloudConfig", + "description": "`cloud` environment configuration.", + "example": { + "type": "cloud", + "networking": { + "type": "limited", + "allowed_hosts": ["api.example.com"], + "allow_package_managers": true, + "allow_mcp_servers": false + }, + "packages": { + "type": "packages", + "pip": ["pandas", "numpy"], + "npm": [], + "apt": [], + "cargo": [], + "gem": [], + "go": [] + } + } + }, + "BetaCloudConfigParams": { + "properties": { + "networking": { + "anyOf": [ + { + "oneOf": [ + { "$ref": "#/components/schemas/BetaUnrestrictedNetwork" }, + { "$ref": "#/components/schemas/BetaLimitedNetworkParams" } + ], + "discriminator": { + "propertyName": "type", + "mapping": { + "limited": "#/components/schemas/BetaLimitedNetworkParams", + "unrestricted": "#/components/schemas/BetaUnrestrictedNetwork" + } + } + }, + { "type": "null" } + ], + "title": "Networking", + "description": "Network configuration policy. Omit on update to preserve the existing value.", + "examples": [ + { "type": "limited", "allowed_hosts": ["api.example.com"], "allow_package_managers": true } + ] + }, + "packages": { + "anyOf": [{ "$ref": "#/components/schemas/BetaPackagesParams" }, { "type": "null" }], + "description": "Package manager configuration. Omit on update to preserve the existing value.", + "examples": [{ "pip": ["pandas", "numpy"] }] + }, + "type": { + "type": "string", + "const": "cloud", + "title": "Type", + "description": "Environment type", + "examples": ["cloud"] + } + }, + "additionalProperties": false, + "type": "object", + "required": ["type"], + "title": "CloudConfigParams", + "description": "Request params for `cloud` environment configuration.\n\nFields default to null; on update, omitted fields preserve the\nexisting value.", + "example": { + "type": "cloud", + "networking": { + "type": "limited", + "allowed_hosts": ["api.example.com"], + "allow_package_managers": true + }, + "packages": { "pip": ["pandas", "numpy"] } + } + }, "BetaCodeExecutionToolResultErrorCode": { "enum": ["invalid_tool_input", "unavailable", "too_many_requests", "execution_time_exceeded"], "title": "CodeExecutionToolResultErrorCode", @@ -11958,6 +13716,10 @@ "anyOf": [{ "$ref": "#/components/schemas/BetaContextManagementConfig" }, { "type": "null" }], "description": "Context management configuration.\n\nThis allows you to control how Claude manages context across multiple requests, such as whether to clear function results or not." }, + "diagnostics": { + "anyOf": [{ "$ref": "#/components/schemas/BetaDiagnosticsParam" }, { "type": "null" }], + "description": "Request-level diagnostics. Supply `previous_message_id` to have the response include `diagnostics.cache_miss_reason` explaining any prompt-cache divergence from that prior request." + }, "inference_geo": { "anyOf": [{ "type": "string" }, { "type": "null" }], "description": "Specifies the geographic region for inference processing. If not specified, the workspace's `default_inference_geo` is used.", @@ -12232,6 +13994,17 @@ "nullable": true, "examples": ["user_12345"] }, + "name": { + "description": "Display name of the entity this profile represents. Required when relationship is `resold` (the resold-to company's name); optional otherwise. Maximum 255 characters.", + "type": "string", + "minLength": 1, + "maxLength": 255, + "nullable": true + }, + "relationship": { + "description": "How the entity relates to the platform. `external` (default): an individual end-user. `resold`: a company the platform resells Claude access to. `internal`: the platform's own usage.", + "allOf": [{ "$ref": "#/components/schemas/BetaUserProfileRelationship" }] + }, "metadata": { "description": "Free-form key-value data to attach to this user profile. Maximum 16 keys, with keys up to 64 characters and values up to 512 characters. Values must be non-empty strings.", "type": "object", @@ -12299,6 +14072,56 @@ "required": ["id", "type"], "title": "DeleteSkillVersionResponse" }, + "BetaDiagnostics": { + "description": "Response envelope for request-level diagnostics. Present (possibly\nnull) whenever the caller supplied `diagnostics` on the request.", + "properties": { + "cache_miss_reason": { + "anyOf": [ + { + "discriminator": { + "mapping": { + "messages_changed": "#/components/schemas/BetaCacheMissMessagesChanged", + "model_changed": "#/components/schemas/BetaCacheMissModelChanged", + "previous_message_not_found": "#/components/schemas/BetaCacheMissPreviousMessageNotFound", + "system_changed": "#/components/schemas/BetaCacheMissSystemChanged", + "tools_changed": "#/components/schemas/BetaCacheMissToolsChanged", + "unavailable": "#/components/schemas/BetaCacheMissUnavailable" + }, + "propertyName": "type" + }, + "oneOf": [ + { "$ref": "#/components/schemas/BetaCacheMissModelChanged" }, + { "$ref": "#/components/schemas/BetaCacheMissSystemChanged" }, + { "$ref": "#/components/schemas/BetaCacheMissToolsChanged" }, + { "$ref": "#/components/schemas/BetaCacheMissMessagesChanged" }, + { "$ref": "#/components/schemas/BetaCacheMissPreviousMessageNotFound" }, + { "$ref": "#/components/schemas/BetaCacheMissUnavailable" } + ] + }, + { "type": "null" } + ], + "default": null, + "description": "Explains why the prompt cache could not fully reuse the prefix from the request identified by `diagnostics.previous_message_id`. `null` means diagnosis is still pending — the response was serialized before the background comparison completed.", + "title": "Cache Miss Reason" + } + }, + "required": ["cache_miss_reason"], + "title": "Diagnostics", + "type": "object" + }, + "BetaDiagnosticsParam": { + "additionalProperties": false, + "description": "Request-level diagnostics. Currently carries the previous response\nid for prompt-cache divergence reporting.", + "properties": { + "previous_message_id": { + "anyOf": [{ "maxLength": 256, "type": "string" }, { "type": "null" }], + "description": "The `id` (`msg_...`) from this client's previous /v1/messages response. The server compares that request's prompt fingerprint against this one and returns `diagnostics.cache_miss_reason` when the prompt-cache prefix could not be reused. Pass `null` on the first turn to opt in without a prior message to compare.", + "title": "Previous Message Id" + } + }, + "title": "DiagnosticsParam", + "type": "object" + }, "BetaDirectCaller": { "additionalProperties": false, "description": "Tool invocation directly from the model.", @@ -12383,12 +14206,18 @@ "examples": [null] }, "config": { - "oneOf": [{ "$ref": "#/components/schemas/BetaCloudConfig" }], + "oneOf": [ + { "$ref": "#/components/schemas/BetaCloudConfig" }, + { "$ref": "#/components/schemas/BetaSelfHostedConfig" } + ], "title": "Config", "description": "Environment configuration (either Anthropic Cloud or self-hosted)", "discriminator": { "propertyName": "type", - "mapping": { "cloud": "#/components/schemas/BetaCloudConfig" } + "mapping": { + "cloud": "#/components/schemas/BetaCloudConfig", + "self_hosted": "#/components/schemas/BetaSelfHostedConfig" + } }, "examples": [ { @@ -12442,6 +14271,12 @@ "description": "Human-readable name for the environment", "examples": ["python-data-analysis"] }, + "scope": { + "type": "string", + "enum": ["organization", "account"], + "title": "Scope", + "description": "The visibility scope for this environment. 'organization' means visible to all accounts. 'account' means visible only to the owning account." + }, "type": { "type": "string", "const": "environment", @@ -13163,6 +14998,8 @@ "id": "uprof_011CZkZCu8hGbp5mYRQgUmz9", "type": "user_profile", "external_id": "user_12345", + "name": "Example User", + "relationship": "external", "trust_grants": { "cyber": { "status": "active" } }, "metadata": {}, "created_at": "2026-03-15T10:00:00Z", @@ -13184,6 +15021,8 @@ "id": "uprof_011CZkZCu8hGbp5mYRQgUmz9", "type": "user_profile", "external_id": "user_12345", + "name": "Example User", + "relationship": "external", "trust_grants": { "cyber": { "status": "active" } }, "metadata": {}, "created_at": "2026-03-15T10:00:00Z", @@ -13317,7 +15156,8 @@ "metadata", "created_at", "updated_at", - "archived_at" + "archived_at", + "multiagent" ], "properties": { "type": { "type": "string", "enum": ["agent"], "examples": ["agent"] }, @@ -13399,6 +15239,12 @@ "allOf": [{ "$ref": "#/components/schemas/BetaTimestamp" }], "nullable": true, "examples": [null] + }, + "multiagent": { + "description": "Multiagent orchestration configuration. Null when the agent is single-threaded.", + "allOf": [{ "$ref": "#/components/schemas/BetaManagedAgentsMultiagent" }], + "nullable": true, + "examples": [null] } }, "example": { @@ -13427,6 +15273,7 @@ { "type": "anthropic", "skill_id": "xlsx", "version": "1" }, { "type": "custom", "skill_id": "skill_011CZkZFNu9hAbo3jZPRgTlx", "version": "2" } ], + "multiagent": null, "metadata": { "foo": "bar" }, "created_at": "2026-03-15T10:00:00Z", "updated_at": "2026-03-15T10:00:00Z", @@ -13449,6 +15296,11 @@ "processed_at": { "description": "Timestamp when this tool use was processed.", "allOf": [{ "$ref": "#/components/schemas/BetaTimestamp" }] + }, + "session_thread_id": { + "description": "When set, this event was cross-posted from a subagent's thread to surface its custom tool use on the primary thread's stream. Empty on the thread's own events. Echo this on a `user.custom_tool_result` event to route the result back.", + "type": "string", + "nullable": true } } }, @@ -13509,6 +15361,11 @@ "evaluated_permission": { "description": "The evaluated permission policy for this tool invocation.", "allOf": [{ "$ref": "#/components/schemas/BetaManagedAgentsAgentEvaluatedPermission" }] + }, + "session_thread_id": { + "description": "When set, this event was cross-posted from a subagent's thread to surface its permission request on the primary thread's stream. Empty on the thread's own events. Echo this on a `user.tool_confirmation` event to route the approval back.", + "type": "string", + "nullable": true } } }, @@ -13558,6 +15415,18 @@ } } }, + "BetaManagedAgentsAgentReference": { + "description": "A resolved agent reference with a concrete version.", + "type": "object", + "additionalProperties": false, + "required": ["type", "id", "version"], + "properties": { + "type": { "type": "string", "enum": ["agent"], "examples": ["agent"] }, + "id": { "type": "string", "examples": ["agent_011CZkYqphY8vELVzwCUpqiQ"] }, + "version": { "type": "integer", "format": "int32", "examples": [1] } + }, + "example": { "type": "agent", "id": "agent_011CZkYqphY8vELVzwCUpqiQ", "version": 1 } + }, "BetaManagedAgentsAgentThinkingEvent": { "description": "Indicates the agent is making forward progress via extended thinking. A progress signal, not a content carrier.", "type": "object", @@ -13572,17 +15441,73 @@ } } }, - "BetaManagedAgentsAgentThreadContextCompactedEvent": { - "description": "Indicates that context compaction (summarization) occurred during the session.", + "BetaManagedAgentsAgentThreadContextCompactedEvent": { + "description": "Indicates that context compaction (summarization) occurred during the session.", + "type": "object", + "additionalProperties": false, + "required": ["type", "id", "processed_at"], + "properties": { + "type": { "type": "string", "enum": ["agent.thread_context_compacted"] }, + "id": { "description": "Unique identifier for this event.", "type": "string" }, + "processed_at": { + "description": "Timestamp when compaction was processed.", + "allOf": [{ "$ref": "#/components/schemas/BetaTimestamp" }] + } + } + }, + "BetaManagedAgentsAgentThreadMessageReceivedEvent": { + "description": "Delivery event written to the target thread's input stream when an agent-to-agent message arrives.", + "type": "object", + "additionalProperties": false, + "required": ["type", "id", "processed_at", "content", "from_session_thread_id"], + "properties": { + "type": { "type": "string", "enum": ["agent.thread_message_received"] }, + "id": { "description": "Unique identifier for this event.", "type": "string" }, + "processed_at": { + "description": "Timestamp when the message was received.", + "allOf": [{ "$ref": "#/components/schemas/BetaTimestamp" }] + }, + "from_agent_name": { + "description": "Name of the callable agent this message came from. Absent when received from the primary agent.", + "type": "string", + "nullable": true + }, + "content": { + "description": "Message content blocks.", + "type": "array", + "items": { "$ref": "#/components/schemas/BetaManagedAgentsUserContentBlock" } + }, + "from_session_thread_id": { + "description": "Public `sthr_` ID of the thread that sent the message.", + "type": "string" + } + } + }, + "BetaManagedAgentsAgentThreadMessageSentEvent": { + "description": "Observability event emitted to the sender's output stream when an agent-to-agent message is sent.", "type": "object", "additionalProperties": false, - "required": ["type", "id", "processed_at"], + "required": ["type", "id", "processed_at", "content", "to_session_thread_id"], "properties": { - "type": { "type": "string", "enum": ["agent.thread_context_compacted"] }, + "type": { "type": "string", "enum": ["agent.thread_message_sent"] }, "id": { "description": "Unique identifier for this event.", "type": "string" }, "processed_at": { - "description": "Timestamp when compaction was processed.", + "description": "Timestamp when the message was sent.", "allOf": [{ "$ref": "#/components/schemas/BetaTimestamp" }] + }, + "to_agent_name": { + "description": "Name of the callable agent this message was sent to. Absent when sent to the primary agent.", + "type": "string", + "nullable": true + }, + "content": { + "description": "Message content blocks.", + "type": "array", + "items": { "$ref": "#/components/schemas/BetaManagedAgentsUserContentBlock" } + }, + "to_session_thread_id": { + "description": "Public `sthr_` ID of the thread the message was sent to.", + "type": "string" } } }, @@ -13703,6 +15628,11 @@ "evaluated_permission": { "description": "The evaluated permission policy for this tool invocation.", "allOf": [{ "$ref": "#/components/schemas/BetaManagedAgentsAgentEvaluatedPermission" }] + }, + "session_thread_id": { + "description": "When set, this event was cross-posted from a subagent's thread to surface its permission request on the primary thread's stream. Empty on the thread's own events. Echo this on a `user.tool_confirmation` event to route the approval back.", + "type": "string", + "nullable": true } } }, @@ -14010,6 +15940,11 @@ "type": "object", "additionalProperties": { "type": "string" }, "examples": [{ "foo": "bar" }] + }, + "multiagent": { + "description": "Multiagent orchestration configuration. Currently supports the `coordinator` topology with a roster of 1-20 agents.", + "allOf": [{ "$ref": "#/components/schemas/BetaManagedAgentsMultiagentParams" }], + "nullable": true } }, "example": { @@ -14290,6 +16225,11 @@ "mcp_server_url": "https://example-server.modelcontextprotocol.io/sse" } }, + "BetaManagedAgentsCredentialRefreshStatus": { + "type": "string", + "description": "Outcome of a refresh-token exchange attempted during credential validation.", + "enum": ["succeeded", "failed", "connect_error", "no_refresh_token"] + }, "BetaManagedAgentsCredentialUpdateAuth": { "description": "Updated authentication details for a credential.", "type": "object", @@ -14305,6 +16245,80 @@ { "$ref": "#/components/schemas/BetaManagedAgentsStaticBearerUpdateParams" } ] }, + "BetaManagedAgentsCredentialValidation": { + "description": "Result of live-probing a credential against its configured MCP server.", + "type": "object", + "additionalProperties": false, + "required": [ + "type", + "credential_id", + "vault_id", + "status", + "validated_at", + "has_refresh_token", + "mcp_probe", + "refresh" + ], + "properties": { + "type": { + "type": "string", + "enum": ["vault_credential_validation"], + "examples": ["vault_credential_validation"] + }, + "credential_id": { + "description": "Unique identifier of the credential that was validated.", + "type": "string", + "examples": ["vcrd_011CZkZEMt8gZan2iYOQfSkw"] + }, + "vault_id": { + "description": "Identifier of the vault containing the credential.", + "type": "string", + "examples": ["vlt_011CZkZDLs7fYzm1hXNPeRjv"] + }, + "status": { + "description": "Overall verdict of the validation probe.", + "allOf": [{ "$ref": "#/components/schemas/BetaManagedAgentsCredentialValidationStatus" }], + "examples": ["valid"] + }, + "validated_at": { + "description": "When the validation probe was performed.", + "allOf": [{ "$ref": "#/components/schemas/BetaTimestamp" }], + "examples": ["2026-03-15T10:00:00Z"] + }, + "has_refresh_token": { + "description": "Whether the credential has a refresh token configured.", + "type": "boolean", + "examples": [true] + }, + "mcp_probe": { + "description": "Details of the failing MCP probe step. Null when the probe succeeded.", + "allOf": [{ "$ref": "#/components/schemas/BetaManagedAgentsMcpProbe" }], + "nullable": true, + "examples": [null] + }, + "refresh": { + "description": "Details of the refresh-token exchange attempted on a 401. Null when no refresh was attempted.", + "allOf": [{ "$ref": "#/components/schemas/BetaManagedAgentsRefreshObject" }], + "nullable": true, + "examples": [null] + } + }, + "example": { + "type": "vault_credential_validation", + "credential_id": "vcrd_011CZkZEMt8gZan2iYOQfSkw", + "vault_id": "vlt_011CZkZDLs7fYzm1hXNPeRjv", + "status": "valid", + "validated_at": "2026-03-15T10:00:00Z", + "has_refresh_token": true, + "mcp_probe": null, + "refresh": null + } + }, + "BetaManagedAgentsCredentialValidationStatus": { + "type": "string", + "description": "Overall verdict of a credential validation probe.", + "enum": ["valid", "invalid", "unknown"] + }, "BetaManagedAgentsCustomSkill": { "description": "A resolved user-created custom skill.", "type": "object", @@ -14553,14 +16567,18 @@ "user.message": "#/components/schemas/BetaManagedAgentsUserMessageEventParams", "user.interrupt": "#/components/schemas/BetaManagedAgentsUserInterruptEventParams", "user.tool_confirmation": "#/components/schemas/BetaManagedAgentsUserToolConfirmationEventParams", - "user.custom_tool_result": "#/components/schemas/BetaManagedAgentsUserCustomToolResultEventParams" + "user.custom_tool_result": "#/components/schemas/BetaManagedAgentsUserCustomToolResultEventParams", + "user.define_outcome": "#/components/schemas/BetaManagedAgentsUserDefineOutcomeEventParams", + "user.tool_result": "#/components/schemas/BetaManagedAgentsUserToolResultEventParams" } }, "oneOf": [ { "$ref": "#/components/schemas/BetaManagedAgentsUserMessageEventParams" }, { "$ref": "#/components/schemas/BetaManagedAgentsUserInterruptEventParams" }, { "$ref": "#/components/schemas/BetaManagedAgentsUserToolConfirmationEventParams" }, - { "$ref": "#/components/schemas/BetaManagedAgentsUserCustomToolResultEventParams" } + { "$ref": "#/components/schemas/BetaManagedAgentsUserCustomToolResultEventParams" }, + { "$ref": "#/components/schemas/BetaManagedAgentsUserDefineOutcomeEventParams" }, + { "$ref": "#/components/schemas/BetaManagedAgentsUserToolResultEventParams" } ] }, "BetaManagedAgentsFileDocumentSource": { @@ -14636,6 +16654,31 @@ "mount_path": "/uploads/receipt.pdf" } }, + "BetaManagedAgentsFileRubric": { + "description": "Rubric referenced by a file uploaded via the Files API.", + "type": "object", + "additionalProperties": false, + "required": ["type", "file_id"], + "properties": { + "type": { "type": "string", "enum": ["file"] }, + "file_id": { "description": "ID of the rubric file.", "type": "string" } + } + }, + "BetaManagedAgentsFileRubricParams": { + "description": "Rubric referenced by a file uploaded via the Files API.", + "type": "object", + "additionalProperties": false, + "required": ["type", "file_id"], + "properties": { + "type": { "type": "string", "enum": ["file"], "examples": ["file"] }, + "file_id": { + "description": "ID of the rubric file.", + "type": "string", + "examples": ["file_011CNha8iCJcU1wXNR6q4V8w"] + } + }, + "example": { "type": "file", "file_id": "file_011CNha8iCJcU1wXNR6q4V8w" } + }, "BetaManagedAgentsGetMemoryStoreResponse": { "description": "Response from retrieving a `memory_store`. Returns the store, including archived stores.", "type": "object", @@ -14692,105 +16735,375 @@ "updated_at": "2026-03-15T10:00:00Z" } }, - "BetaManagedAgentsGitHubRepositoryResourceParams": { - "description": "Mount a GitHub repository into the session's container.", + "BetaManagedAgentsGitHubRepositoryResourceParams": { + "description": "Mount a GitHub repository into the session's container.", + "type": "object", + "additionalProperties": false, + "required": ["type", "url", "authorization_token"], + "properties": { + "type": { "type": "string", "enum": ["github_repository"], "examples": ["github_repository"] }, + "url": { + "description": "Github URL of the repository", + "type": "string", + "minLength": 1, + "maxLength": 2048, + "examples": ["https://github.com/example-org/example-repo"] + }, + "authorization_token": { + "description": "GitHub authorization token used to clone the repository.", + "type": "string", + "minLength": 1, + "maxLength": 4096, + "examples": ["ghp_exampletoken"] + }, + "mount_path": { + "description": "Mount path in the container. Defaults to `/workspace/`.", + "type": "string", + "minLength": 1, + "maxLength": 4096, + "nullable": true + }, + "checkout": { + "description": "Branch or commit to check out. Defaults to the repository's default branch.", + "allOf": [{ "$ref": "#/components/schemas/BetaManagedAgentsRepositoryCheckout" }], + "nullable": true + } + }, + "example": { + "type": "github_repository", + "url": "https://github.com/example-org/example-repo", + "authorization_token": "ghp_exampletoken" + } + }, + "BetaManagedAgentsImageBlock": { + "description": "Image content specified directly as base64 data or as a reference via a URL.", + "type": "object", + "additionalProperties": false, + "required": ["type", "source"], + "properties": { + "type": { "type": "string", "enum": ["image"] }, + "source": { + "description": "The source of the image data.", + "allOf": [{ "$ref": "#/components/schemas/BetaManagedAgentsImageSource" }] + } + } + }, + "BetaManagedAgentsImageSource": { + "description": "Union type for image source variants.", + "type": "object", + "discriminator": { + "propertyName": "type", + "mapping": { + "base64": "#/components/schemas/BetaManagedAgentsBase64ImageSource", + "url": "#/components/schemas/BetaManagedAgentsURLImageSource", + "file": "#/components/schemas/BetaManagedAgentsFileImageSource" + } + }, + "oneOf": [ + { "$ref": "#/components/schemas/BetaManagedAgentsBase64ImageSource" }, + { "$ref": "#/components/schemas/BetaManagedAgentsURLImageSource" }, + { "$ref": "#/components/schemas/BetaManagedAgentsFileImageSource" } + ] + }, + "BetaManagedAgentsInputEvent": { + "description": "Union type for events that can be sent to a session.", + "type": "object", + "discriminator": { + "propertyName": "type", + "mapping": { + "user.message": "#/components/schemas/BetaManagedAgentsUserMessageEvent", + "user.interrupt": "#/components/schemas/BetaManagedAgentsUserInterruptEvent", + "user.tool_confirmation": "#/components/schemas/BetaManagedAgentsUserToolConfirmationEvent", + "user.custom_tool_result": "#/components/schemas/BetaManagedAgentsUserCustomToolResultEvent", + "user.define_outcome": "#/components/schemas/BetaManagedAgentsUserDefineOutcomeEvent", + "user.tool_result": "#/components/schemas/BetaManagedAgentsUserToolResultEvent" + } + }, + "oneOf": [ + { "$ref": "#/components/schemas/BetaManagedAgentsUserMessageEvent" }, + { "$ref": "#/components/schemas/BetaManagedAgentsUserInterruptEvent" }, + { "$ref": "#/components/schemas/BetaManagedAgentsUserToolConfirmationEvent" }, + { "$ref": "#/components/schemas/BetaManagedAgentsUserCustomToolResultEvent" }, + { "$ref": "#/components/schemas/BetaManagedAgentsUserDefineOutcomeEvent" }, + { "$ref": "#/components/schemas/BetaManagedAgentsUserToolResultEvent" } + ] + }, + "BetaManagedAgentsListAgentVersions": { + "description": "Paginated list of agent versions.", + "type": "object", + "additionalProperties": false, + "properties": { + "data": { + "description": "Agent versions.", + "x-stainless-pagination-property": { "purpose": "items" }, + "type": "array", + "items": { "$ref": "#/components/schemas/BetaManagedAgentsAgent" } + }, + "next_page": { + "description": "Opaque cursor for the next page. Null when no more results.", + "x-stainless-pagination-property": { "purpose": "next_cursor_field" }, + "type": "string", + "nullable": true + } + } + }, + "BetaManagedAgentsListAgents": { + "description": "Paginated list of agents.", + "type": "object", + "additionalProperties": false, + "properties": { + "data": { + "description": "List of agents.", + "x-stainless-pagination-property": { "purpose": "items" }, + "type": "array", + "items": { "$ref": "#/components/schemas/BetaManagedAgentsAgent" } + }, + "next_page": { + "description": "Opaque cursor for the next page. Null when no more results.", + "x-stainless-pagination-property": { "purpose": "next_cursor_field" }, + "type": "string", + "nullable": true + } + } + }, + "BetaManagedAgentsListCredentialsResponse": { + "description": "Response containing a paginated list of credentials.", + "type": "object", + "additionalProperties": false, + "properties": { + "data": { + "description": "List of credentials.", + "type": "array", + "items": { "$ref": "#/components/schemas/BetaManagedAgentsCredential" }, + "examples": [ + [ + { + "type": "vault_credential", + "id": "vcrd_011CZkZEMt8gZan2iYOQfSkw", + "vault_id": "vlt_011CZkZDLs7fYzm1hXNPeRjv", + "display_name": "Example credential", + "metadata": { "environment": "production" }, + "created_at": "2026-03-15T10:00:00Z", + "updated_at": "2026-03-15T10:00:00Z", + "archived_at": null, + "auth": { + "type": "static_bearer", + "mcp_server_url": "https://example-server.modelcontextprotocol.io/sse" + } + } + ] + ] + }, + "next_page": { + "description": "Pagination token for the next page, or null if no more results.", + "type": "string", + "nullable": true, + "examples": ["page_MjAyNS0wNS0xNFQwMDowMDowMFo="] + } + }, + "example": { + "data": [ + { + "type": "vault_credential", + "id": "vcrd_011CZkZEMt8gZan2iYOQfSkw", + "vault_id": "vlt_011CZkZDLs7fYzm1hXNPeRjv", + "display_name": "Example credential", + "metadata": { "environment": "production" }, + "created_at": "2026-03-15T10:00:00Z", + "updated_at": "2026-03-15T10:00:00Z", + "archived_at": null, + "auth": { + "type": "static_bearer", + "mcp_server_url": "https://example-server.modelcontextprotocol.io/sse" + } + } + ], + "next_page": "page_MjAyNS0wNS0xNFQwMDowMDowMFo=" + } + }, + "BetaManagedAgentsListMemoriesResult": { + "description": "Response payload for [List memories](/en/api/beta/memory_stores/memories/list).", "type": "object", "additionalProperties": false, - "required": ["type", "url", "authorization_token"], "properties": { - "type": { "type": "string", "enum": ["github_repository"], "examples": ["github_repository"] }, - "url": { - "description": "Github URL of the repository", - "type": "string", - "minLength": 1, - "maxLength": 2048, - "examples": ["https://github.com/example-org/example-repo"] - }, - "authorization_token": { - "description": "GitHub authorization token used to clone the repository.", - "type": "string", - "minLength": 1, - "maxLength": 4096, - "examples": ["ghp_exampletoken"] + "data": { + "description": "One page of results. Each item is either a `memory` object or, when `depth` was set, a `memory_prefix` rollup marker. Items appear in the requested `order_by`/`order`.", + "type": "array", + "items": { "$ref": "#/components/schemas/BetaManagedAgentsMemoryListItem" } }, - "mount_path": { - "description": "Mount path in the container. Defaults to `/workspace/`.", + "next_page": { + "description": "Opaque cursor for the next page (a `page_...` value), or `null` if there are no more results. Pass as `page` on the next request.", "type": "string", - "minLength": 1, - "maxLength": 4096, "nullable": true + } + } + }, + "BetaManagedAgentsListMemoryStoresResponse": { + "description": "A page of `memory_store` results, ordered by `created_at` descending (newest first).", + "type": "object", + "additionalProperties": false, + "properties": { + "data": { + "description": "Memory stores on this page, newest first. Empty when there are no stores matching the filters.", + "type": "array", + "items": { "$ref": "#/components/schemas/BetaManagedAgentsMemoryStore" } }, - "checkout": { - "description": "Branch or commit to check out. Defaults to the repository's default branch.", - "allOf": [{ "$ref": "#/components/schemas/BetaManagedAgentsRepositoryCheckout" }], + "next_page": { + "description": "Opaque cursor for the next page (a `page_...` value). Pass as `page` on the next request. `null` when there are no more results.", + "type": "string", "nullable": true } - }, - "example": { - "type": "github_repository", - "url": "https://github.com/example-org/example-repo", - "authorization_token": "ghp_exampletoken" } }, - "BetaManagedAgentsImageBlock": { - "description": "Image content specified directly as base64 data or as a reference via a URL.", + "BetaManagedAgentsListMemoryVersionsResult": { + "description": "Response payload for [List memory versions](/en/api/beta/memory_stores/memory_versions/list).", "type": "object", "additionalProperties": false, - "required": ["type", "source"], "properties": { - "type": { "type": "string", "enum": ["image"] }, - "source": { - "description": "The source of the image data.", - "allOf": [{ "$ref": "#/components/schemas/BetaManagedAgentsImageSource" }] + "data": { + "description": "One page of `memory_version` objects, ordered by `created_at` descending (newest first), with `id` as tiebreak.", + "type": "array", + "items": { "$ref": "#/components/schemas/BetaManagedAgentsMemoryVersion" } + }, + "next_page": { + "description": "Opaque cursor for the next page (a `page_...` value), or `null` if there are no more results. Pass as `page` on the next request.", + "type": "string", + "nullable": true } } }, - "BetaManagedAgentsImageSource": { - "description": "Union type for image source variants.", + "BetaManagedAgentsListOrder": { + "type": "string", + "description": "ListOrder enum", + "enum": ["asc", "desc"] + }, + "BetaManagedAgentsListSessionEvents": { + "description": "Paginated list of events for a `session`.", "type": "object", - "discriminator": { - "propertyName": "type", - "mapping": { - "base64": "#/components/schemas/BetaManagedAgentsBase64ImageSource", - "url": "#/components/schemas/BetaManagedAgentsURLImageSource", - "file": "#/components/schemas/BetaManagedAgentsFileImageSource" + "additionalProperties": false, + "properties": { + "data": { + "description": "Events for the session, ordered by `created_at`.", + "x-stainless-pagination-property": { "purpose": "items" }, + "type": "array", + "items": { "$ref": "#/components/schemas/BetaManagedAgentsSessionEvent" }, + "examples": [ + [ + { + "type": "user.message", + "id": "sevt_011CZkZGOp0iBcp4kaQSihUmy", + "content": [{ "type": "text", "text": "Where is my order #1234?" }], + "processed_at": "2026-03-15T10:00:00Z" + }, + { + "type": "agent.message", + "id": "sevt_011CZkZHPq1jCdq5lbRTjiVnz", + "content": [{ "type": "text", "text": "Let me look up order #1234 for you." }], + "processed_at": "2026-03-15T10:00:00Z" + } + ] + ] + }, + "next_page": { + "description": "Opaque cursor for the next page. Null when no more results.", + "x-stainless-pagination-property": { "purpose": "next_cursor_field" }, + "type": "string", + "nullable": true, + "examples": ["page_MjAyNS0wNS0xNFQwMDowMDowMFo="] } }, - "oneOf": [ - { "$ref": "#/components/schemas/BetaManagedAgentsBase64ImageSource" }, - { "$ref": "#/components/schemas/BetaManagedAgentsURLImageSource" }, - { "$ref": "#/components/schemas/BetaManagedAgentsFileImageSource" } - ] + "example": { + "data": [ + { + "type": "user.message", + "id": "sevt_011CZkZGOp0iBcp4kaQSihUmy", + "content": [{ "type": "text", "text": "Where is my order #1234?" }], + "processed_at": "2026-03-15T10:00:00Z" + }, + { + "type": "agent.message", + "id": "sevt_011CZkZHPq1jCdq5lbRTjiVnz", + "content": [{ "type": "text", "text": "Let me look up order #1234 for you." }], + "processed_at": "2026-03-15T10:00:00Z" + } + ], + "next_page": "page_MjAyNS0wNS0xNFQwMDowMDowMFo=" + } }, - "BetaManagedAgentsInputEvent": { - "description": "Union type for events that can be sent to a session.", + "BetaManagedAgentsListSessionResources": { + "description": "Paginated list of resources attached to a session.", "type": "object", - "discriminator": { - "propertyName": "type", - "mapping": { - "user.message": "#/components/schemas/BetaManagedAgentsUserMessageEvent", - "user.interrupt": "#/components/schemas/BetaManagedAgentsUserInterruptEvent", - "user.tool_confirmation": "#/components/schemas/BetaManagedAgentsUserToolConfirmationEvent", - "user.custom_tool_result": "#/components/schemas/BetaManagedAgentsUserCustomToolResultEvent" + "additionalProperties": false, + "required": ["data"], + "properties": { + "data": { + "description": "Resources for the session, ordered by `created_at`.", + "x-stainless-pagination-property": { "purpose": "items" }, + "type": "array", + "items": { "$ref": "#/components/schemas/BetaManagedAgentsSessionResource" }, + "examples": [ + [ + { + "type": "file", + "id": "sesrsc_011CZkZBJq5dWxk9fVLNcPht", + "file_id": "file_011CNha8iCJcU1wXNR6q4V8w", + "mount_path": "/uploads/receipt.pdf", + "created_at": "2026-03-15T10:00:00Z", + "updated_at": "2026-03-15T10:00:00Z" + }, + { + "type": "github_repository", + "id": "sesrsc_011CZkZCKr6eXyl0gWMOdQiu", + "url": "https://github.com/example-org/example-repo", + "mount_path": "/workspace/example-repo", + "checkout": { "type": "branch", "name": "main" }, + "created_at": "2026-03-15T10:00:00Z", + "updated_at": "2026-03-15T10:00:00Z" + } + ] + ] + }, + "next_page": { + "description": "Opaque cursor for the next page. Null when no more results.", + "x-stainless-pagination-property": { "purpose": "next_cursor_field" }, + "type": "string", + "nullable": true, + "examples": ["page_MjAyNS0wNS0xNFQwMDowMDowMFo="] } }, - "oneOf": [ - { "$ref": "#/components/schemas/BetaManagedAgentsUserMessageEvent" }, - { "$ref": "#/components/schemas/BetaManagedAgentsUserInterruptEvent" }, - { "$ref": "#/components/schemas/BetaManagedAgentsUserToolConfirmationEvent" }, - { "$ref": "#/components/schemas/BetaManagedAgentsUserCustomToolResultEvent" } - ] + "example": { + "data": [ + { + "type": "file", + "id": "sesrsc_011CZkZBJq5dWxk9fVLNcPht", + "file_id": "file_011CNha8iCJcU1wXNR6q4V8w", + "mount_path": "/uploads/receipt.pdf", + "created_at": "2026-03-15T10:00:00Z", + "updated_at": "2026-03-15T10:00:00Z" + }, + { + "type": "github_repository", + "id": "sesrsc_011CZkZCKr6eXyl0gWMOdQiu", + "url": "https://github.com/example-org/example-repo", + "mount_path": "/workspace/example-repo", + "checkout": { "type": "branch", "name": "main" }, + "created_at": "2026-03-15T10:00:00Z", + "updated_at": "2026-03-15T10:00:00Z" + } + ], + "next_page": "page_MjAyNS0wNS0xNFQwMDowMDowMFo=" + } }, - "BetaManagedAgentsListAgentVersions": { - "description": "Paginated list of agent versions.", + "BetaManagedAgentsListSessionThreadEvents": { + "description": "Paginated list of events for a single thread within a `session`.", "type": "object", "additionalProperties": false, "properties": { "data": { - "description": "Agent versions.", + "description": "Events for the thread, ordered by `created_at`.", "x-stainless-pagination-property": { "purpose": "items" }, "type": "array", - "items": { "$ref": "#/components/schemas/BetaManagedAgentsAgent" } + "items": { "$ref": "#/components/schemas/BetaManagedAgentsSessionEvent" } }, "next_page": { "description": "Opaque cursor for the next page. Null when no more results.", @@ -14800,49 +17113,146 @@ } } }, - "BetaManagedAgentsListAgents": { - "description": "Paginated list of agents.", + "BetaManagedAgentsListSessionThreads": { + "description": "Paginated list of threads within a `session`.", + "type": "object", + "additionalProperties": false, + "properties": { + "data": { + "description": "Threads in the session, primary first then children in spawn order.", + "x-stainless-pagination-property": { "purpose": "items" }, + "type": "array", + "items": { "$ref": "#/components/schemas/BetaManagedAgentsSessionThread" }, + "examples": [ + [ + { + "type": "session_thread", + "id": "sthr_011CZkZVWa6oIjw0rgXZpnBt", + "session_id": "sesn_011CZkZAtmR3yMPDzynEDxu7", + "status": "idle", + "agent": { + "type": "agent", + "id": "agent_011CZkYqphY8vELVzwCUpqiQ", + "version": 1, + "name": "Researcher", + "description": "A focused research subagent.", + "model": { "id": "claude-sonnet-4-6", "speed": "standard" }, + "system": "You are a research subagent that gathers and summarises sources for the coordinating agent.", + "tools": [ + { + "type": "agent_toolset_20260401", + "default_config": { "enabled": true, "permission_policy": { "type": "always_ask" } }, + "configs": [] + } + ], + "mcp_servers": [], + "skills": [] + }, + "parent_thread_id": null, + "created_at": "2026-03-15T10:00:00Z", + "updated_at": "2026-03-15T10:00:00Z", + "archived_at": null, + "usage": { + "input_tokens": 0, + "output_tokens": 0, + "cache_read_input_tokens": 0, + "cache_creation": { "ephemeral_5m_input_tokens": 0, "ephemeral_1h_input_tokens": 0 } + }, + "stats": { "duration_seconds": 0, "startup_seconds": 0, "active_seconds": 0 } + } + ] + ] + }, + "next_page": { + "description": "Opaque cursor for the next page. Null when no more results.", + "x-stainless-pagination-property": { "purpose": "next_cursor_field" }, + "type": "string", + "nullable": true, + "examples": ["page_MjAyNS0wNS0xNFQwMDowMDowMFo="] + } + }, + "example": { + "data": [ + { + "type": "session_thread", + "id": "sthr_011CZkZVWa6oIjw0rgXZpnBt", + "session_id": "sesn_011CZkZAtmR3yMPDzynEDxu7", + "status": "idle", + "agent": { + "type": "agent", + "id": "agent_011CZkYqphY8vELVzwCUpqiQ", + "version": 1, + "name": "Researcher", + "description": "A focused research subagent.", + "model": { "id": "claude-sonnet-4-6", "speed": "standard" }, + "system": "You are a research subagent that gathers and summarises sources for the coordinating agent.", + "tools": [ + { + "type": "agent_toolset_20260401", + "default_config": { "enabled": true, "permission_policy": { "type": "always_ask" } }, + "configs": [] + } + ], + "mcp_servers": [], + "skills": [] + }, + "parent_thread_id": null, + "created_at": "2026-03-15T10:00:00Z", + "updated_at": "2026-03-15T10:00:00Z", + "archived_at": null, + "usage": { + "input_tokens": 0, + "output_tokens": 0, + "cache_read_input_tokens": 0, + "cache_creation": { "ephemeral_5m_input_tokens": 0, "ephemeral_1h_input_tokens": 0 } + }, + "stats": { "duration_seconds": 0, "startup_seconds": 0, "active_seconds": 0 } + } + ], + "next_page": "page_MjAyNS0wNS0xNFQwMDowMDowMFo=" + } + }, + "BetaManagedAgentsListSessions": { + "description": "Paginated list of sessions.", "type": "object", "additionalProperties": false, "properties": { "data": { - "description": "List of agents.", + "description": "List of sessions.", "x-stainless-pagination-property": { "purpose": "items" }, "type": "array", - "items": { "$ref": "#/components/schemas/BetaManagedAgentsAgent" } + "items": { "$ref": "#/components/schemas/BetaManagedAgentsSession" }, + "examples": [[]] }, "next_page": { "description": "Opaque cursor for the next page. Null when no more results.", "x-stainless-pagination-property": { "purpose": "next_cursor_field" }, "type": "string", - "nullable": true + "nullable": true, + "examples": ["page_MjAyNS0wNS0xNFQwMDowMDowMFo="] } - } + }, + "example": { "data": [], "next_page": "page_MjAyNS0wNS0xNFQwMDowMDowMFo=" } }, - "BetaManagedAgentsListCredentialsResponse": { - "description": "Response containing a paginated list of credentials.", + "BetaManagedAgentsListVaultsResponse": { + "description": "Response containing a paginated list of vaults.", "type": "object", "additionalProperties": false, "properties": { "data": { - "description": "List of credentials.", + "description": "List of vaults.", "type": "array", - "items": { "$ref": "#/components/schemas/BetaManagedAgentsCredential" }, + "items": { "$ref": "#/components/schemas/BetaManagedAgentsVault" }, "examples": [ [ { - "type": "vault_credential", - "id": "vcrd_011CZkZEMt8gZan2iYOQfSkw", - "vault_id": "vlt_011CZkZDLs7fYzm1hXNPeRjv", - "display_name": "Example credential", + "type": "vault", + "id": "vlt_011CZkZDLs7fYzm1hXNPeRjv", + "display_name": "Example vault", "metadata": { "environment": "production" }, "created_at": "2026-03-15T10:00:00Z", "updated_at": "2026-03-15T10:00:00Z", - "archived_at": null, - "auth": { - "type": "static_bearer", - "mcp_server_url": "https://example-server.modelcontextprotocol.io/sse" - } + "archived_at": null } ] ] @@ -14857,1172 +17267,1842 @@ "example": { "data": [ { - "type": "vault_credential", - "id": "vcrd_011CZkZEMt8gZan2iYOQfSkw", - "vault_id": "vlt_011CZkZDLs7fYzm1hXNPeRjv", - "display_name": "Example credential", + "type": "vault", + "id": "vlt_011CZkZDLs7fYzm1hXNPeRjv", + "display_name": "Example vault", "metadata": { "environment": "production" }, "created_at": "2026-03-15T10:00:00Z", "updated_at": "2026-03-15T10:00:00Z", - "archived_at": null, - "auth": { - "type": "static_bearer", - "mcp_server_url": "https://example-server.modelcontextprotocol.io/sse" - } + "archived_at": null } ], "next_page": "page_MjAyNS0wNS0xNFQwMDowMDowMFo=" } }, - "BetaManagedAgentsListMemoriesResult": { - "description": "Response payload for [List memories](/en/api/beta/memory_stores/memories/list).", + "BetaManagedAgentsMCPServer": { + "description": "Union type for MCP server connection definitions returned in API responses.", + "type": "object", + "discriminator": { + "propertyName": "type", + "mapping": { "url": "#/components/schemas/BetaManagedAgentsMCPServerURLDefinition" } + }, + "oneOf": [{ "$ref": "#/components/schemas/BetaManagedAgentsMCPServerURLDefinition" }] + }, + "BetaManagedAgentsMCPServerParams": { + "description": "Union type for MCP server connection definitions.", + "type": "object", + "discriminator": { + "propertyName": "type", + "mapping": { "url": "#/components/schemas/BetaManagedAgentsURLMCPServerParams" } + }, + "oneOf": [{ "$ref": "#/components/schemas/BetaManagedAgentsURLMCPServerParams" }] + }, + "BetaManagedAgentsMCPServerURLDefinition": { + "description": "URL-based MCP server connection as returned in API responses.", + "type": "object", + "additionalProperties": false, + "required": ["type", "name", "url"], + "properties": { + "type": { "type": "string", "enum": ["url"], "examples": ["url"] }, + "name": { "type": "string", "examples": ["example-mcp"] }, + "url": { "type": "string", "examples": ["https://example-server.modelcontextprotocol.io/sse"] } + }, + "example": { + "type": "url", + "name": "example-mcp", + "url": "https://example-server.modelcontextprotocol.io/sse" + } + }, + "BetaManagedAgentsMCPToolConfig": { + "description": "Resolved configuration for a specific MCP tool.", + "type": "object", + "additionalProperties": false, + "required": ["name", "enabled", "permission_policy"], + "properties": { + "name": { "type": "string" }, + "enabled": { "type": "boolean" }, + "permission_policy": { "$ref": "#/components/schemas/BetaManagedAgentsPermissionPolicy" } + } + }, + "BetaManagedAgentsMCPToolConfigParams": { + "description": "Configuration override for a specific MCP tool.", + "type": "object", + "additionalProperties": false, + "required": ["name"], + "properties": { + "name": { + "description": "Name of the MCP tool to configure. 1-128 characters.", + "type": "string", + "minLength": 1, + "maxLength": 128 + }, + "enabled": { + "description": "Whether this tool is enabled. Overrides the `default_config` setting.", + "type": "boolean", + "nullable": true + }, + "permission_policy": { + "description": "Permission policy for this tool. Overrides the `default_config` setting.", + "allOf": [{ "$ref": "#/components/schemas/BetaManagedAgentsPermissionPolicy" }], + "nullable": true + } + } + }, + "BetaManagedAgentsMCPToolset": { + "type": "object", + "additionalProperties": false, + "required": ["type", "mcp_server_name", "default_config", "configs"], + "properties": { + "type": { "type": "string", "enum": ["mcp_toolset"] }, + "mcp_server_name": { "type": "string" }, + "default_config": { "$ref": "#/components/schemas/BetaManagedAgentsMCPToolsetDefaultConfig" }, + "configs": { + "type": "array", + "items": { "$ref": "#/components/schemas/BetaManagedAgentsMCPToolConfig" } + } + } + }, + "BetaManagedAgentsMCPToolsetDefaultConfig": { + "description": "Resolved default configuration for all tools from an MCP server.", + "type": "object", + "additionalProperties": false, + "required": ["enabled", "permission_policy"], + "properties": { + "enabled": { "type": "boolean" }, + "permission_policy": { "$ref": "#/components/schemas/BetaManagedAgentsPermissionPolicy" } + } + }, + "BetaManagedAgentsMCPToolsetDefaultConfigParams": { + "description": "Default configuration for all tools from an MCP server.", + "type": "object", + "additionalProperties": false, + "properties": { + "enabled": { + "description": "Whether tools are enabled by default. Defaults to true if not specified.", + "type": "boolean", + "nullable": true + }, + "permission_policy": { + "description": "Default permission policy for tools from this server.", + "allOf": [{ "$ref": "#/components/schemas/BetaManagedAgentsPermissionPolicy" }], + "nullable": true + } + } + }, + "BetaManagedAgentsMCPToolsetParams": { + "description": "Configuration for tools from an MCP server defined in `mcp_servers`.", + "type": "object", + "additionalProperties": false, + "required": ["type", "mcp_server_name"], + "properties": { + "type": { "type": "string", "enum": ["mcp_toolset"] }, + "mcp_server_name": { + "description": "Name of the MCP server. Must match a server name from the mcp_servers array. 1-255 characters.", + "type": "string", + "minLength": 1, + "maxLength": 255 + }, + "default_config": { + "description": "Default configuration for all tools from this server.", + "allOf": [{ "$ref": "#/components/schemas/BetaManagedAgentsMCPToolsetDefaultConfigParams" }], + "nullable": true + }, + "configs": { + "description": "Per-tool configuration overrides.", + "type": "array", + "items": { "$ref": "#/components/schemas/BetaManagedAgentsMCPToolConfigParams" } + } + } + }, + "BetaManagedAgentsMcpAuthenticationFailedError": { + "description": "Authentication to an MCP server failed.", + "type": "object", + "additionalProperties": false, + "required": ["type", "message", "retry_status", "mcp_server_name"], + "properties": { + "type": { "type": "string", "enum": ["mcp_authentication_failed_error"] }, + "message": { "description": "Human-readable error description.", "type": "string" }, + "retry_status": { + "description": "What the client should do next.", + "allOf": [{ "$ref": "#/components/schemas/BetaManagedAgentsRetryStatus" }] + }, + "mcp_server_name": { + "description": "Name of the MCP server that failed authentication.", + "type": "string" + } + } + }, + "BetaManagedAgentsMcpConnectionFailedError": { + "description": "Failed to connect to an MCP server.", + "type": "object", + "additionalProperties": false, + "required": ["type", "message", "retry_status", "mcp_server_name"], + "properties": { + "type": { "type": "string", "enum": ["mcp_connection_failed_error"] }, + "message": { "description": "Human-readable error description.", "type": "string" }, + "retry_status": { + "description": "What the client should do next.", + "allOf": [{ "$ref": "#/components/schemas/BetaManagedAgentsRetryStatus" }] + }, + "mcp_server_name": { + "description": "Name of the MCP server that failed to connect.", + "type": "string" + } + } + }, + "BetaManagedAgentsMcpOauthAuthResponse": { + "description": "OAuth credential details for an MCP server.", + "type": "object", + "additionalProperties": false, + "required": ["type", "mcp_server_url"], + "properties": { + "type": { "type": "string", "enum": ["mcp_oauth"] }, + "mcp_server_url": { + "description": "URL of the MCP server this credential authenticates against.", + "type": "string" + }, + "expires_at": { "$ref": "#/components/schemas/BetaTimestamp", "nullable": true }, + "refresh": { + "description": "Refresh token configuration, if the credential supports token refresh.", + "allOf": [{ "$ref": "#/components/schemas/BetaManagedAgentsMcpOauthRefreshResponse" }], + "nullable": true + } + } + }, + "BetaManagedAgentsMcpOauthCreateParams": { + "description": "Parameters for creating an MCP OAuth credential.", "type": "object", "additionalProperties": false, + "required": ["type", "mcp_server_url", "access_token"], "properties": { - "data": { - "description": "One page of results. Each item is either a `memory` object or, when `depth` was set, a `memory_prefix` rollup marker. Items appear in the requested `order_by`/`order`.", - "type": "array", - "items": { "$ref": "#/components/schemas/BetaManagedAgentsMemoryListItem" } + "type": { "type": "string", "enum": ["mcp_oauth"] }, + "mcp_server_url": { + "description": "URL of the MCP server this credential authenticates against.", + "type": "string", + "minLength": 1, + "maxLength": 2047 }, - "next_page": { - "description": "Opaque cursor for the next page (a `page_...` value), or `null` if there are no more results. Pass as `page` on the next request.", + "access_token": { + "description": "OAuth access token.", "type": "string", + "minLength": 1, + "maxLength": 8192 + }, + "expires_at": { "$ref": "#/components/schemas/BetaTimestamp", "nullable": true }, + "refresh": { + "description": "Refresh token configuration, if the credential supports token refresh.", + "allOf": [{ "$ref": "#/components/schemas/BetaManagedAgentsMcpOauthRefreshParams" }], "nullable": true } } }, - "BetaManagedAgentsListMemoryStoresResponse": { - "description": "A page of `memory_store` results, ordered by `created_at` descending (newest first).", + "BetaManagedAgentsMcpOauthRefreshParams": { + "description": "OAuth refresh token parameters for creating a credential with refresh support.", "type": "object", "additionalProperties": false, + "required": ["refresh_token", "token_endpoint", "client_id", "token_endpoint_auth"], "properties": { - "data": { - "description": "Memory stores on this page, newest first. Empty when there are no stores matching the filters.", - "type": "array", - "items": { "$ref": "#/components/schemas/BetaManagedAgentsMemoryStore" } + "refresh_token": { + "description": "OAuth refresh token.", + "type": "string", + "minLength": 1, + "maxLength": 4096 }, - "next_page": { - "description": "Opaque cursor for the next page (a `page_...` value). Pass as `page` on the next request. `null` when there are no more results.", + "token_endpoint": { + "description": "Token endpoint URL used to refresh the access token.", + "type": "string", + "minLength": 1, + "maxLength": 2047 + }, + "client_id": { + "description": "OAuth client ID.", + "type": "string", + "minLength": 1, + "maxLength": 1024 + }, + "scope": { + "description": "OAuth scope for the refresh request.", + "type": "string", + "minLength": 1, + "maxLength": 8192, + "nullable": true + }, + "resource": { + "description": "OAuth resource indicator.", "type": "string", + "minLength": 1, + "maxLength": 2047, "nullable": true + }, + "token_endpoint_auth": { + "type": "object", + "discriminator": { + "propertyName": "type", + "mapping": { + "none": "#/components/schemas/BetaManagedAgentsTokenEndpointAuthNoneParam", + "client_secret_basic": "#/components/schemas/BetaManagedAgentsTokenEndpointAuthBasicParam", + "client_secret_post": "#/components/schemas/BetaManagedAgentsTokenEndpointAuthPostParam" + } + }, + "oneOf": [ + { "$ref": "#/components/schemas/BetaManagedAgentsTokenEndpointAuthNoneParam" }, + { "$ref": "#/components/schemas/BetaManagedAgentsTokenEndpointAuthBasicParam" }, + { "$ref": "#/components/schemas/BetaManagedAgentsTokenEndpointAuthPostParam" } + ] } } }, - "BetaManagedAgentsListMemoryVersionsResult": { - "description": "Response payload for [List memory versions](/en/api/beta/memory_stores/memory_versions/list).", + "BetaManagedAgentsMcpOauthRefreshResponse": { + "description": "OAuth refresh token configuration returned in credential responses.", "type": "object", "additionalProperties": false, + "required": ["token_endpoint", "client_id", "token_endpoint_auth"], "properties": { - "data": { - "description": "One page of `memory_version` objects, ordered by `created_at` descending (newest first), with `id` as tiebreak.", - "type": "array", - "items": { "$ref": "#/components/schemas/BetaManagedAgentsMemoryVersion" } + "token_endpoint": { + "description": "Token endpoint URL used to refresh the access token.", + "type": "string" }, - "next_page": { - "description": "Opaque cursor for the next page (a `page_...` value), or `null` if there are no more results. Pass as `page` on the next request.", + "client_id": { "description": "OAuth client ID.", "type": "string" }, + "resource": { "description": "OAuth resource indicator.", "type": "string", "nullable": true }, + "scope": { + "description": "OAuth scope for the refresh request.", "type": "string", "nullable": true + }, + "token_endpoint_auth": { + "type": "object", + "discriminator": { + "propertyName": "type", + "mapping": { + "none": "#/components/schemas/BetaManagedAgentsTokenEndpointAuthNoneResponse", + "client_secret_basic": "#/components/schemas/BetaManagedAgentsTokenEndpointAuthBasicResponse", + "client_secret_post": "#/components/schemas/BetaManagedAgentsTokenEndpointAuthPostResponse" + } + }, + "oneOf": [ + { "$ref": "#/components/schemas/BetaManagedAgentsTokenEndpointAuthNoneResponse" }, + { "$ref": "#/components/schemas/BetaManagedAgentsTokenEndpointAuthBasicResponse" }, + { "$ref": "#/components/schemas/BetaManagedAgentsTokenEndpointAuthPostResponse" } + ] } } }, - "BetaManagedAgentsListOrder": { - "type": "string", - "description": "ListOrder enum", - "enum": ["asc", "desc"] - }, - "BetaManagedAgentsListSessionEvents": { - "description": "Paginated list of events for a `session`.", + "BetaManagedAgentsMcpOauthRefreshUpdateParams": { + "description": "Parameters for updating OAuth refresh token configuration.", "type": "object", "additionalProperties": false, "properties": { - "data": { - "description": "Events for the session, ordered by `created_at`.", - "x-stainless-pagination-property": { "purpose": "items" }, - "type": "array", - "items": { "$ref": "#/components/schemas/BetaManagedAgentsSessionEvent" }, - "examples": [ - [ - { - "type": "user.message", - "id": "sevt_011CZkZGOp0iBcp4kaQSihUmy", - "content": [{ "type": "text", "text": "Where is my order #1234?" }], - "processed_at": "2026-03-15T10:00:00Z" - }, - { - "type": "agent.message", - "id": "sevt_011CZkZHPq1jCdq5lbRTjiVnz", - "content": [{ "type": "text", "text": "Let me look up order #1234 for you." }], - "processed_at": "2026-03-15T10:00:00Z" - } - ] - ] + "refresh_token": { + "description": "Updated OAuth refresh token.", + "type": "string", + "minLength": 1, + "maxLength": 4096, + "nullable": true }, - "next_page": { - "description": "Opaque cursor for the next page. Null when no more results.", - "x-stainless-pagination-property": { "purpose": "next_cursor_field" }, + "scope": { + "description": "Updated OAuth scope for the refresh request.", "type": "string", - "nullable": true, - "examples": ["page_MjAyNS0wNS0xNFQwMDowMDowMFo="] - } - }, - "example": { - "data": [ - { - "type": "user.message", - "id": "sevt_011CZkZGOp0iBcp4kaQSihUmy", - "content": [{ "type": "text", "text": "Where is my order #1234?" }], - "processed_at": "2026-03-15T10:00:00Z" + "maxLength": 8192, + "nullable": true + }, + "token_endpoint_auth": { + "type": "object", + "discriminator": { + "propertyName": "type", + "mapping": { + "client_secret_basic": "#/components/schemas/BetaManagedAgentsTokenEndpointAuthBasicUpdateParam", + "client_secret_post": "#/components/schemas/BetaManagedAgentsTokenEndpointAuthPostUpdateParam" + } }, - { - "type": "agent.message", - "id": "sevt_011CZkZHPq1jCdq5lbRTjiVnz", - "content": [{ "type": "text", "text": "Let me look up order #1234 for you." }], - "processed_at": "2026-03-15T10:00:00Z" - } - ], - "next_page": "page_MjAyNS0wNS0xNFQwMDowMDowMFo=" + "oneOf": [ + { "$ref": "#/components/schemas/BetaManagedAgentsTokenEndpointAuthBasicUpdateParam" }, + { "$ref": "#/components/schemas/BetaManagedAgentsTokenEndpointAuthPostUpdateParam" } + ] + } } }, - "BetaManagedAgentsListSessionResources": { - "description": "Paginated list of resources attached to a session.", + "BetaManagedAgentsMcpOauthUpdateParams": { + "description": "Parameters for updating an MCP OAuth credential. The `mcp_server_url` is immutable.", "type": "object", "additionalProperties": false, - "required": ["data"], + "required": ["type"], "properties": { - "data": { - "description": "Resources for the session, ordered by `created_at`.", - "x-stainless-pagination-property": { "purpose": "items" }, - "type": "array", - "items": { "$ref": "#/components/schemas/BetaManagedAgentsSessionResource" }, - "examples": [ - [ - { - "type": "file", - "id": "sesrsc_011CZkZBJq5dWxk9fVLNcPht", - "file_id": "file_011CNha8iCJcU1wXNR6q4V8w", - "mount_path": "/uploads/receipt.pdf", - "created_at": "2026-03-15T10:00:00Z", - "updated_at": "2026-03-15T10:00:00Z" - }, - { - "type": "github_repository", - "id": "sesrsc_011CZkZCKr6eXyl0gWMOdQiu", - "url": "https://github.com/example-org/example-repo", - "mount_path": "/workspace/example-repo", - "checkout": { "type": "branch", "name": "main" }, - "created_at": "2026-03-15T10:00:00Z", - "updated_at": "2026-03-15T10:00:00Z" - } - ] - ] - }, - "next_page": { - "description": "Opaque cursor for the next page. Null when no more results.", - "x-stainless-pagination-property": { "purpose": "next_cursor_field" }, + "type": { "type": "string", "enum": ["mcp_oauth"] }, + "access_token": { + "description": "Updated OAuth access token.", "type": "string", - "nullable": true, - "examples": ["page_MjAyNS0wNS0xNFQwMDowMDowMFo="] - } - }, - "example": { - "data": [ - { - "type": "file", - "id": "sesrsc_011CZkZBJq5dWxk9fVLNcPht", - "file_id": "file_011CNha8iCJcU1wXNR6q4V8w", - "mount_path": "/uploads/receipt.pdf", - "created_at": "2026-03-15T10:00:00Z", - "updated_at": "2026-03-15T10:00:00Z" - }, - { - "type": "github_repository", - "id": "sesrsc_011CZkZCKr6eXyl0gWMOdQiu", - "url": "https://github.com/example-org/example-repo", - "mount_path": "/workspace/example-repo", - "checkout": { "type": "branch", "name": "main" }, - "created_at": "2026-03-15T10:00:00Z", - "updated_at": "2026-03-15T10:00:00Z" - } - ], - "next_page": "page_MjAyNS0wNS0xNFQwMDowMDowMFo=" + "minLength": 1, + "maxLength": 8192, + "nullable": true + }, + "expires_at": { "$ref": "#/components/schemas/BetaTimestamp", "nullable": true }, + "refresh": { + "description": "Updated refresh token configuration.", + "allOf": [{ "$ref": "#/components/schemas/BetaManagedAgentsMcpOauthRefreshUpdateParams" }], + "nullable": true + } } }, - "BetaManagedAgentsListSessions": { - "description": "Paginated list of sessions.", + "BetaManagedAgentsMcpProbe": { + "description": "The failing step of an MCP validation probe.", "type": "object", "additionalProperties": false, + "required": ["method", "http_response"], "properties": { - "data": { - "description": "List of sessions.", - "x-stainless-pagination-property": { "purpose": "items" }, - "type": "array", - "items": { "$ref": "#/components/schemas/BetaManagedAgentsSession" }, - "examples": [[]] + "method": { + "description": "The MCP method that failed (for example `initialize` or `tools/list`).", + "type": "string" }, - "next_page": { - "description": "Opaque cursor for the next page. Null when no more results.", - "x-stainless-pagination-property": { "purpose": "next_cursor_field" }, - "type": "string", - "nullable": true, - "examples": ["page_MjAyNS0wNS0xNFQwMDowMDowMFo="] + "http_response": { + "description": "The captured HTTP error response. Null when no HTTP response was received (timeout, DNS, TLS).", + "allOf": [{ "$ref": "#/components/schemas/BetaManagedAgentsRefreshHttpResponse" }], + "nullable": true } - }, - "example": { "data": [], "next_page": "page_MjAyNS0wNS0xNFQwMDowMDowMFo=" } + } }, - "BetaManagedAgentsListVaultsResponse": { - "description": "Response containing a paginated list of vaults.", + "BetaManagedAgentsMemory": { + "description": "A `memory` object: a single text document at a hierarchical path inside a memory store. The `content` field is populated when `view=full` and `null` when `view=basic`; the `content_size_bytes` and `content_sha256` fields are always populated so sync clients can diff without fetching content. Memories are addressed by their `mem_...` ID; the path is the create key and can be changed via update.", "type": "object", "additionalProperties": false, + "required": [ + "type", + "id", + "memory_store_id", + "path", + "content_size_bytes", + "content_sha256", + "memory_version_id", + "created_at", + "updated_at" + ], "properties": { - "data": { - "description": "List of vaults.", - "type": "array", - "items": { "$ref": "#/components/schemas/BetaManagedAgentsVault" }, - "examples": [ - [ - { - "type": "vault", - "id": "vlt_011CZkZDLs7fYzm1hXNPeRjv", - "display_name": "Example vault", - "metadata": { "environment": "production" }, - "created_at": "2026-03-15T10:00:00Z", - "updated_at": "2026-03-15T10:00:00Z", - "archived_at": null - } - ] - ] + "type": { "type": "string", "enum": ["memory"] }, + "id": { + "description": "Unique identifier for this memory (a `mem_...` value). Stable across renames; use this ID, not the path, to read, update, or delete the memory.", + "type": "string" }, - "next_page": { - "description": "Pagination token for the next page, or null if no more results.", + "memory_store_id": { + "description": "ID of the memory store this memory belongs to (a `memstore_...` value).", + "type": "string" + }, + "path": { + "description": "Hierarchical path of the memory within the store, e.g. `/projects/foo/notes.md`. Always starts with `/`. Paths are case-sensitive and unique within a store. Maximum 1,024 bytes.", + "type": "string" + }, + "content": { + "description": "The memory's UTF-8 text content. Populated when `view=full`; `null` when `view=basic`. Maximum 100 kB (102,400 bytes).", "type": "string", - "nullable": true, - "examples": ["page_MjAyNS0wNS0xNFQwMDowMDowMFo="] + "nullable": true + }, + "content_size_bytes": { + "description": "Size of `content` in bytes (the UTF-8 plaintext length). Always populated, regardless of `view`.", + "type": "integer", + "format": "int32" + }, + "content_sha256": { + "description": "Lowercase hex SHA-256 digest of the UTF-8 `content` bytes (64 characters). The server applies no normalization, so clients can compute the same hash locally for staleness checks and as the value for a `content_sha256` precondition on update. Always populated, regardless of `view`.", + "type": "string" + }, + "memory_version_id": { + "description": "ID of the `memory_version` representing this memory's current content (a `memver_...` value). This is the authoritative head pointer; `memory_version` objects do not carry an `is_latest` flag, so compare against this field instead. Enumerate the full history via [List memory versions](/en/api/beta/memory_stores/memory_versions/list).", + "type": "string" + }, + "created_at": { + "description": "When this memory was created, in RFC 3339 format.", + "allOf": [{ "$ref": "#/components/schemas/BetaTimestamp" }] + }, + "updated_at": { + "description": "When this memory was last modified, in RFC 3339 format. Use this as a cheap freshness signal; for who made the change, look up the head version's `created_by` via [List memory versions](/en/api/beta/memory_stores/memory_versions/list).", + "allOf": [{ "$ref": "#/components/schemas/BetaTimestamp" }] } - }, - "example": { - "data": [ - { - "type": "vault", - "id": "vlt_011CZkZDLs7fYzm1hXNPeRjv", - "display_name": "Example vault", - "metadata": { "environment": "production" }, - "created_at": "2026-03-15T10:00:00Z", - "updated_at": "2026-03-15T10:00:00Z", - "archived_at": null - } - ], - "next_page": "page_MjAyNS0wNS0xNFQwMDowMDowMFo=" } }, - "BetaManagedAgentsMCPServer": { - "description": "Union type for MCP server connection definitions returned in API responses.", - "type": "object", - "discriminator": { - "propertyName": "type", - "mapping": { "url": "#/components/schemas/BetaManagedAgentsMCPServerURLDefinition" } - }, - "oneOf": [{ "$ref": "#/components/schemas/BetaManagedAgentsMCPServerURLDefinition" }] - }, - "BetaManagedAgentsMCPServerParams": { - "description": "Union type for MCP server connection definitions.", + "BetaManagedAgentsMemoryListItem": { + "description": "One item in a [List memories](/en/api/beta/memory_stores/memories/list) response: either a `memory` object or, when `depth` is set, a `memory_prefix` rollup marker.", "type": "object", "discriminator": { "propertyName": "type", - "mapping": { "url": "#/components/schemas/BetaManagedAgentsURLMCPServerParams" } + "mapping": { + "memory": "#/components/schemas/BetaManagedAgentsMemory", + "memory_prefix": "#/components/schemas/BetaManagedAgentsMemoryPrefix" + } }, - "oneOf": [{ "$ref": "#/components/schemas/BetaManagedAgentsURLMCPServerParams" }] + "oneOf": [ + { "$ref": "#/components/schemas/BetaManagedAgentsMemory" }, + { "$ref": "#/components/schemas/BetaManagedAgentsMemoryPrefix" } + ] }, - "BetaManagedAgentsMCPServerURLDefinition": { - "description": "URL-based MCP server connection as returned in API responses.", + "BetaManagedAgentsMemoryPathConflictError": { "type": "object", "additionalProperties": false, - "required": ["type", "name", "url"], + "required": ["type"], "properties": { - "type": { "type": "string", "enum": ["url"], "examples": ["url"] }, - "name": { "type": "string", "examples": ["example-mcp"] }, - "url": { "type": "string", "examples": ["https://example-server.modelcontextprotocol.io/sse"] } - }, - "example": { - "type": "url", - "name": "example-mcp", - "url": "https://example-server.modelcontextprotocol.io/sse" + "type": { "type": "string", "enum": ["memory_path_conflict_error"] }, + "message": { "type": "string" }, + "conflicting_path": { "type": "string" }, + "conflicting_memory_id": { "type": "string" } } }, - "BetaManagedAgentsMCPToolConfig": { - "description": "Resolved configuration for a specific MCP tool.", + "BetaManagedAgentsMemoryPreconditionFailedError": { "type": "object", "additionalProperties": false, - "required": ["name", "enabled", "permission_policy"], + "required": ["type"], "properties": { - "name": { "type": "string" }, - "enabled": { "type": "boolean" }, - "permission_policy": { "$ref": "#/components/schemas/BetaManagedAgentsPermissionPolicy" } + "type": { "type": "string", "enum": ["memory_precondition_failed_error"] }, + "message": { "type": "string" } } }, - "BetaManagedAgentsMCPToolConfigParams": { - "description": "Configuration override for a specific MCP tool.", + "BetaManagedAgentsMemoryPrefix": { + "description": "A rolled-up directory marker returned by [List memories](/en/api/beta/memory_stores/memories/list) when `depth` is set. Indicates that one or more memories exist deeper than the requested depth under this prefix. This is a list-time rollup, not a stored resource; it has no ID and no lifecycle. Each prefix counts toward the page `limit` and interleaves with `memory` items in path order.", "type": "object", "additionalProperties": false, - "required": ["name"], + "required": ["type", "path"], "properties": { - "name": { - "description": "Name of the MCP tool to configure. 1-128 characters.", - "type": "string", - "minLength": 1, - "maxLength": 128 - }, - "enabled": { - "description": "Whether this tool is enabled. Overrides the `default_config` setting.", - "type": "boolean", - "nullable": true - }, - "permission_policy": { - "description": "Permission policy for this tool. Overrides the `default_config` setting.", - "allOf": [{ "$ref": "#/components/schemas/BetaManagedAgentsPermissionPolicy" }], - "nullable": true + "type": { "type": "string", "enum": ["memory_prefix"] }, + "path": { + "description": "The rolled-up path prefix, including a trailing `/` (e.g. `/projects/foo/`). Pass this value as `path_prefix` on a subsequent list call to drill into the directory.", + "type": "string" } } }, - "BetaManagedAgentsMCPToolset": { + "BetaManagedAgentsMemoryStore": { + "description": "A `memory_store`: a named container for agent memories, scoped to a workspace. Attach a store to a session via `resources[]` to mount it as a directory the agent can read and write.", "type": "object", "additionalProperties": false, - "required": ["type", "mcp_server_name", "default_config", "configs"], + "required": ["type", "id", "name", "created_at", "updated_at"], "properties": { - "type": { "type": "string", "enum": ["mcp_toolset"] }, - "mcp_server_name": { "type": "string" }, - "default_config": { "$ref": "#/components/schemas/BetaManagedAgentsMCPToolsetDefaultConfig" }, - "configs": { - "type": "array", - "items": { "$ref": "#/components/schemas/BetaManagedAgentsMCPToolConfig" } + "type": { "type": "string", "enum": ["memory_store"] }, + "id": { + "description": "Unique identifier for the memory store (a `memstore_...` tagged ID). Use this when attaching the store to a session, or in the `{memory_store_id}` path parameter of subsequent calls.", + "type": "string" + }, + "name": { + "description": "Human-readable name for the store. 1–255 characters. The store's mount-path slug under `/mnt/memory/` is derived from this name.", + "type": "string" + }, + "description": { + "description": "Free-text description of what the store contains, up to 1024 characters. Included in the agent's system prompt when the store is attached, so word it to be useful to the agent. Empty string when unset.", + "type": "string" + }, + "created_at": { + "description": "Timestamp when the store was created.", + "allOf": [{ "$ref": "#/components/schemas/BetaTimestamp" }] + }, + "updated_at": { + "description": "Timestamp when the store's `name`, `description`, or `metadata` was last modified. Memory writes inside the store do not advance this.", + "allOf": [{ "$ref": "#/components/schemas/BetaTimestamp" }] + }, + "metadata": { + "description": "Arbitrary key-value tags for your own bookkeeping (such as the end user a store belongs to). Up to 16 pairs; keys 1–64 characters; values up to 512 characters. Returned on retrieve/list but not filterable.", + "type": "object", + "additionalProperties": { "type": "string" } + }, + "archived_at": { + "description": "Timestamp when the store was archived, or `null` if active. Set once and never cleared; archiving is one-way. Archived stores are read-only and cannot be attached to new sessions.", + "allOf": [{ "$ref": "#/components/schemas/BetaTimestamp" }], + "nullable": true } } }, - "BetaManagedAgentsMCPToolsetDefaultConfig": { - "description": "Resolved default configuration for all tools from an MCP server.", - "type": "object", - "additionalProperties": false, - "required": ["enabled", "permission_policy"], - "properties": { - "enabled": { "type": "boolean" }, - "permission_policy": { "$ref": "#/components/schemas/BetaManagedAgentsPermissionPolicy" } - } - }, - "BetaManagedAgentsMCPToolsetDefaultConfigParams": { - "description": "Default configuration for all tools from an MCP server.", + "BetaManagedAgentsMemoryStoreResource": { + "description": "A memory store attached to an agent session.", "type": "object", "additionalProperties": false, + "required": ["type", "memory_store_id"], "properties": { - "enabled": { - "description": "Whether tools are enabled by default. Defaults to true if not specified.", - "type": "boolean", + "type": { "type": "string", "enum": ["memory_store"] }, + "memory_store_id": { + "description": "The memory store ID (memstore_...). Must belong to the caller's organization and workspace.", + "type": "string" + }, + "access": { + "description": "Access mode for the mounted store. Defaults to read_write. read_only mounts the store as a read-only filesystem.", + "allOf": [{ "$ref": "#/components/schemas/BetaManagedAgentsMountMode" }], + "nullable": true + }, + "name": { + "description": "Display name of the memory store, snapshotted at attach time. Later edits to the store's name do not propagate to this resource.", + "type": "string", "nullable": true }, - "permission_policy": { - "description": "Default permission policy for tools from this server.", - "allOf": [{ "$ref": "#/components/schemas/BetaManagedAgentsPermissionPolicy" }], + "description": { + "description": "Description of the memory store, snapshotted at attach time. Rendered into the agent's system prompt. Empty string when the store has no description.", + "type": "string" + }, + "instructions": { + "description": "Per-attachment guidance for the agent on how to use this store. Rendered into the memory section of the system prompt. Max 4096 chars.", + "type": "string", + "maxLength": 4096, + "nullable": true + }, + "mount_path": { + "description": "Filesystem path where the store is mounted in the session container, e.g. /mnt/memory/user-preferences. Derived from the store's name. Output-only.", + "type": "string", "nullable": true } } }, - "BetaManagedAgentsMCPToolsetParams": { - "description": "Configuration for tools from an MCP server defined in `mcp_servers`.", + "BetaManagedAgentsMemoryStoreResourceParam": { + "description": "Parameters for attaching a memory store to an agent session.", "type": "object", "additionalProperties": false, - "required": ["type", "mcp_server_name"], + "required": ["type", "memory_store_id"], "properties": { - "type": { "type": "string", "enum": ["mcp_toolset"] }, - "mcp_server_name": { - "description": "Name of the MCP server. Must match a server name from the mcp_servers array. 1-255 characters.", - "type": "string", - "minLength": 1, - "maxLength": 255 + "type": { "type": "string", "enum": ["memory_store"] }, + "memory_store_id": { + "description": "The memory store ID (memstore_...). Must belong to the caller's organization and workspace.", + "type": "string" }, - "default_config": { - "description": "Default configuration for all tools from this server.", - "allOf": [{ "$ref": "#/components/schemas/BetaManagedAgentsMCPToolsetDefaultConfigParams" }], + "access": { + "description": "Access mode for the mounted store. Defaults to read_write. read_only mounts the store as a read-only filesystem.", + "allOf": [{ "$ref": "#/components/schemas/BetaManagedAgentsMountMode" }], "nullable": true }, - "configs": { - "description": "Per-tool configuration overrides.", - "type": "array", - "items": { "$ref": "#/components/schemas/BetaManagedAgentsMCPToolConfigParams" } + "instructions": { + "description": "Per-attachment guidance for the agent on how to use this store. Rendered into the memory section of the system prompt. Max 4096 chars.", + "type": "string", + "maxLength": 4096, + "nullable": true } } }, - "BetaManagedAgentsMcpAuthenticationFailedError": { - "description": "Authentication to an MCP server failed.", + "BetaManagedAgentsMemoryVersion": { + "description": "A `memory_version` object: one immutable, attributed row in a memory's append-only history. Every non-no-op mutation to a memory produces a new version. Versions belong to the store (not the individual memory) and persist after the memory is deleted. Retrieving a redacted version returns 200 with `content`, `path`, `content_size_bytes`, and `content_sha256` set to `null`; branch on `redacted_at`, not HTTP status.", "type": "object", "additionalProperties": false, - "required": ["type", "message", "retry_status", "mcp_server_name"], + "required": ["type", "id", "memory_store_id", "memory_id", "operation", "created_at"], "properties": { - "type": { "type": "string", "enum": ["mcp_authentication_failed_error"] }, - "message": { "description": "Human-readable error description.", "type": "string" }, - "retry_status": { - "description": "What the client should do next.", - "allOf": [{ "$ref": "#/components/schemas/BetaManagedAgentsRetryStatus" }] + "type": { "type": "string", "enum": ["memory_version"] }, + "id": { + "description": "Unique identifier for this version (a `memver_...` value).", + "type": "string" }, - "mcp_server_name": { - "description": "Name of the MCP server that failed authentication.", + "memory_store_id": { + "description": "ID of the memory store this version belongs to (a `memstore_...` value).", + "type": "string" + }, + "memory_id": { + "description": "ID of the memory this version snapshots (a `mem_...` value). Remains valid after the memory is deleted; pass it as `memory_id` to [List memory versions](/en/api/beta/memory_stores/memory_versions/list) to retrieve the full lineage including the `deleted` row.", "type": "string" + }, + "path": { + "description": "The memory's path at the time of this write. `null` if and only if `redacted_at` is set.", + "type": "string", + "nullable": true + }, + "operation": { + "description": "The kind of mutation this version records: `created`, `modified`, or `deleted`.", + "allOf": [{ "$ref": "#/components/schemas/BetaManagedAgentsMemoryVersionOperation" }] + }, + "content": { + "description": "The memory's UTF-8 text content as of this version. `null` when `view=basic`, when `operation` is `deleted`, or when `redacted_at` is set.", + "type": "string", + "nullable": true + }, + "content_size_bytes": { + "description": "Size of `content` in bytes as of this version. `null` when `redacted_at` is set or `operation` is `deleted`. Populated regardless of `view` otherwise.", + "type": "integer", + "format": "int32", + "nullable": true + }, + "content_sha256": { + "description": "Lowercase hex SHA-256 digest of `content` as of this version (64 characters). `null` when `redacted_at` is set or `operation` is `deleted`. Populated regardless of `view` otherwise.", + "type": "string", + "nullable": true + }, + "created_by": { + "description": "Who performed this write: a `session_actor`, `api_actor`, or `user_actor`. Captured at write time and preserved through redaction.", + "allOf": [{ "$ref": "#/components/schemas/BetaManagedAgentsActor" }] + }, + "created_at": { + "description": "When this version was written, in RFC 3339 format.", + "allOf": [{ "$ref": "#/components/schemas/BetaTimestamp" }] + }, + "redacted_at": { + "description": "When this version was redacted, in RFC 3339 format, or `null` if it has not been redacted. When set, `content`, `path`, `content_size_bytes`, and `content_sha256` are all `null`. See [Redact a memory version](/en/api/beta/memory_stores/memory_versions/redact).", + "allOf": [{ "$ref": "#/components/schemas/BetaTimestamp" }], + "nullable": true + }, + "redacted_by": { + "description": "Who redacted this version, or `null` if it has not been redacted. In practice always an `api_actor` or `user_actor` (agents do not have a redact capability).", + "allOf": [{ "$ref": "#/components/schemas/BetaManagedAgentsActor" }] } } }, - "BetaManagedAgentsMcpConnectionFailedError": { - "description": "Failed to connect to an MCP server.", + "BetaManagedAgentsMemoryVersionOperation": { + "type": "string", + "description": "The kind of mutation a `memory_version` records. Every non-no-op mutation to a memory appends exactly one version row with one of these values.", + "enum": ["created", "modified", "deleted"] + }, + "BetaManagedAgentsMemoryView": { + "type": "string", + "description": "Selects which projection of a `memory` or `memory_version` the server returns. `basic` returns the object with `content` set to `null`; `full` populates `content`. When omitted, the default is endpoint-specific: retrieve operations default to `full`; list, create, and update operations default to `basic`. Listing with `view=full` caps `limit` at 20.", + "enum": ["basic", "full"] + }, + "BetaManagedAgentsModelConfig": { + "description": "Model identifier and configuration.", "type": "object", "additionalProperties": false, - "required": ["type", "message", "retry_status", "mcp_server_name"], + "required": ["id"], "properties": { - "type": { "type": "string", "enum": ["mcp_connection_failed_error"] }, - "message": { "description": "Human-readable error description.", "type": "string" }, - "retry_status": { - "description": "What the client should do next.", - "allOf": [{ "$ref": "#/components/schemas/BetaManagedAgentsRetryStatus" }] - }, - "mcp_server_name": { - "description": "Name of the MCP server that failed to connect.", - "type": "string" + "id": { "$ref": "#/components/schemas/BetaManagedAgentsModel" }, + "speed": { + "description": "Inference speed mode. `fast` provides significantly faster output token generation at premium pricing. Defaults to `standard`. Not all models support `fast`; invalid combinations are rejected at create time.", + "allOf": [{ "$ref": "#/components/schemas/BetaManagedAgentsSpeed" }], + "examples": ["standard"] } - } + }, + "example": { "id": "claude-opus-4-6", "speed": "standard" } }, - "BetaManagedAgentsMcpOauthAuthResponse": { - "description": "OAuth credential details for an MCP server.", + "BetaManagedAgentsModelConfigParams": { + "description": "An object that defines additional configuration control over model use", "type": "object", "additionalProperties": false, - "required": ["type", "mcp_server_url"], + "required": ["id"], "properties": { - "type": { "type": "string", "enum": ["mcp_oauth"] }, - "mcp_server_url": { - "description": "URL of the MCP server this credential authenticates against.", - "type": "string" - }, - "expires_at": { "$ref": "#/components/schemas/BetaTimestamp", "nullable": true }, - "refresh": { - "description": "Refresh token configuration, if the credential supports token refresh.", - "allOf": [{ "$ref": "#/components/schemas/BetaManagedAgentsMcpOauthRefreshResponse" }], + "id": { "$ref": "#/components/schemas/BetaManagedAgentsModel" }, + "speed": { + "description": "Inference speed mode. Defaults to `standard`.", + "allOf": [{ "$ref": "#/components/schemas/BetaManagedAgentsSpeed" }], "nullable": true } - } + }, + "example": { "id": "claude-opus-4-6" } }, - "BetaManagedAgentsMcpOauthCreateParams": { - "description": "Parameters for creating an MCP OAuth credential.", + "BetaManagedAgentsModelOverloadedError": { + "description": "The model is currently overloaded. Emitted after automatic retries are exhausted.", "type": "object", "additionalProperties": false, - "required": ["type", "mcp_server_url", "access_token"], + "required": ["type", "message", "retry_status"], "properties": { - "type": { "type": "string", "enum": ["mcp_oauth"] }, - "mcp_server_url": { - "description": "URL of the MCP server this credential authenticates against.", - "type": "string", - "minLength": 1, - "maxLength": 2047 - }, - "access_token": { - "description": "OAuth access token.", - "type": "string", - "minLength": 1, - "maxLength": 8192 - }, - "expires_at": { "$ref": "#/components/schemas/BetaTimestamp", "nullable": true }, - "refresh": { - "description": "Refresh token configuration, if the credential supports token refresh.", - "allOf": [{ "$ref": "#/components/schemas/BetaManagedAgentsMcpOauthRefreshParams" }], - "nullable": true + "type": { "type": "string", "enum": ["model_overloaded_error"] }, + "message": { "description": "Human-readable error description.", "type": "string" }, + "retry_status": { + "description": "What the client should do next.", + "allOf": [{ "$ref": "#/components/schemas/BetaManagedAgentsRetryStatus" }] } } }, - "BetaManagedAgentsMcpOauthRefreshParams": { - "description": "OAuth refresh token parameters for creating a credential with refresh support.", - "type": "object", - "additionalProperties": false, - "required": ["refresh_token", "token_endpoint", "client_id", "token_endpoint_auth"], - "properties": { - "refresh_token": { - "description": "OAuth refresh token.", - "type": "string", - "minLength": 1, - "maxLength": 4096 - }, - "token_endpoint": { - "description": "Token endpoint URL used to refresh the access token.", - "type": "string", - "minLength": 1, - "maxLength": 2047 - }, - "client_id": { - "description": "OAuth client ID.", - "type": "string", - "minLength": 1, - "maxLength": 1024 - }, - "scope": { - "description": "OAuth scope for the refresh request.", - "type": "string", - "minLength": 1, - "maxLength": 8192, - "nullable": true - }, - "resource": { - "description": "OAuth resource indicator.", - "type": "string", - "minLength": 1, - "maxLength": 2047, - "nullable": true + "BetaManagedAgentsModelParams": { + "oneOf": [ + { + "title": "BetaManagedAgentsModel", + "allOf": [{ "$ref": "#/components/schemas/BetaManagedAgentsModel" }], + "x-stainless-skip": ["go", "cli"] }, - "token_endpoint_auth": { - "type": "object", - "discriminator": { - "propertyName": "type", - "mapping": { - "none": "#/components/schemas/BetaManagedAgentsTokenEndpointAuthNoneParam", - "client_secret_basic": "#/components/schemas/BetaManagedAgentsTokenEndpointAuthBasicParam", - "client_secret_post": "#/components/schemas/BetaManagedAgentsTokenEndpointAuthPostParam" - } - }, - "oneOf": [ - { "$ref": "#/components/schemas/BetaManagedAgentsTokenEndpointAuthNoneParam" }, - { "$ref": "#/components/schemas/BetaManagedAgentsTokenEndpointAuthBasicParam" }, - { "$ref": "#/components/schemas/BetaManagedAgentsTokenEndpointAuthPostParam" } - ] + { "$ref": "#/components/schemas/BetaManagedAgentsModelConfigParams" } + ] + }, + "BetaManagedAgentsModelRateLimitedError": { + "description": "The model request was rate-limited.", + "type": "object", + "additionalProperties": false, + "required": ["type", "message", "retry_status"], + "properties": { + "type": { "type": "string", "enum": ["model_rate_limited_error"] }, + "message": { "description": "Human-readable error description.", "type": "string" }, + "retry_status": { + "description": "What the client should do next.", + "allOf": [{ "$ref": "#/components/schemas/BetaManagedAgentsRetryStatus" }] } } }, - "BetaManagedAgentsMcpOauthRefreshResponse": { - "description": "OAuth refresh token configuration returned in credential responses.", + "BetaManagedAgentsModelRequestFailedError": { + "description": "A model request failed for a reason other than overload or rate-limiting.", "type": "object", "additionalProperties": false, - "required": ["token_endpoint", "client_id", "token_endpoint_auth"], + "required": ["type", "message", "retry_status"], "properties": { - "token_endpoint": { - "description": "Token endpoint URL used to refresh the access token.", - "type": "string" - }, - "client_id": { "description": "OAuth client ID.", "type": "string" }, - "resource": { "description": "OAuth resource indicator.", "type": "string", "nullable": true }, - "scope": { - "description": "OAuth scope for the refresh request.", - "type": "string", - "nullable": true - }, - "token_endpoint_auth": { - "type": "object", - "discriminator": { - "propertyName": "type", - "mapping": { - "none": "#/components/schemas/BetaManagedAgentsTokenEndpointAuthNoneResponse", - "client_secret_basic": "#/components/schemas/BetaManagedAgentsTokenEndpointAuthBasicResponse", - "client_secret_post": "#/components/schemas/BetaManagedAgentsTokenEndpointAuthPostResponse" - } - }, - "oneOf": [ - { "$ref": "#/components/schemas/BetaManagedAgentsTokenEndpointAuthNoneResponse" }, - { "$ref": "#/components/schemas/BetaManagedAgentsTokenEndpointAuthBasicResponse" }, - { "$ref": "#/components/schemas/BetaManagedAgentsTokenEndpointAuthPostResponse" } - ] + "type": { "type": "string", "enum": ["model_request_failed_error"] }, + "message": { "description": "Human-readable error description.", "type": "string" }, + "retry_status": { + "description": "What the client should do next.", + "allOf": [{ "$ref": "#/components/schemas/BetaManagedAgentsRetryStatus" }] } } }, - "BetaManagedAgentsMcpOauthRefreshUpdateParams": { - "description": "Parameters for updating OAuth refresh token configuration.", + "BetaManagedAgentsMountMode": { + "type": "string", + "description": "Access mode for an attached memory store.", + "enum": ["read_write", "read_only"] + }, + "BetaManagedAgentsMultiagent": { + "description": "Resolved multiagent orchestration configuration as returned in API responses.", + "discriminator": { + "propertyName": "type", + "mapping": { "coordinator": "#/components/schemas/BetaManagedAgentsMultiagentCoordinator" } + }, + "oneOf": [{ "$ref": "#/components/schemas/BetaManagedAgentsMultiagentCoordinator" }] + }, + "BetaManagedAgentsMultiagentCoordinator": { + "description": "Resolved coordinator topology with a concrete agent roster.", "type": "object", "additionalProperties": false, + "required": ["type", "agents"], "properties": { - "refresh_token": { - "description": "Updated OAuth refresh token.", - "type": "string", - "minLength": 1, - "maxLength": 4096, - "nullable": true - }, - "scope": { - "description": "Updated OAuth scope for the refresh request.", - "type": "string", - "maxLength": 8192, - "nullable": true - }, - "token_endpoint_auth": { - "type": "object", + "type": { "type": "string", "enum": ["coordinator"] }, + "agents": { + "description": "Agents the coordinator may spawn as session threads, each resolved to a specific version.", + "type": "array", + "items": { "$ref": "#/components/schemas/BetaManagedAgentsAgentReference" } + } + } + }, + "BetaManagedAgentsMultiagentCoordinatorParams": { + "description": "A coordinator topology: the session's primary thread orchestrates work by spawning session threads, each running an agent drawn from the `agents` roster.", + "type": "object", + "additionalProperties": false, + "required": ["type", "agents"], + "properties": { + "type": { "type": "string", "enum": ["coordinator"], "examples": ["coordinator"] }, + "agents": { + "description": "Agents the coordinator may spawn as session threads. 1–20 entries. Each entry is an agent ID string, a versioned `{\"type\":\"agent\",\"id\",\"version\"}` reference, or `{\"type\":\"self\"}` to allow recursive self-invocation. Entries must reference distinct agents (after resolving `self` and string forms); at most one `self`. Referenced agents must exist, must not be archived, and must not themselves have `multiagent` set (depth limit 1).", + "type": "array", + "items": { "$ref": "#/components/schemas/BetaManagedAgentsMultiagentRosterEntryParams" }, + "examples": [["agent_011CZkYqphY8vELVzwCUpqiQ", { "type": "self" }]] + } + }, + "example": { "type": "coordinator", "agents": ["agent_011CZkYqphY8vELVzwCUpqiQ", { "type": "self" }] } + }, + "BetaManagedAgentsMultiagentParams": { + "description": "Multiagent orchestration configuration. Currently supports the `coordinator` topology.", + "discriminator": { + "propertyName": "type", + "mapping": { "coordinator": "#/components/schemas/BetaManagedAgentsMultiagentCoordinatorParams" } + }, + "oneOf": [{ "$ref": "#/components/schemas/BetaManagedAgentsMultiagentCoordinatorParams" }] + }, + "BetaManagedAgentsMultiagentRosterEntryParams": { + "description": "An entry in a multiagent roster: an agent ID string, a versioned agent reference, or `self`.", + "oneOf": [ + { "type": "string" }, + { + "oneOf": [ + { "$ref": "#/components/schemas/BetaManagedAgentsAgentParams" }, + { "$ref": "#/components/schemas/BetaManagedAgentsMultiagentSelfParams" } + ], "discriminator": { "propertyName": "type", "mapping": { - "client_secret_basic": "#/components/schemas/BetaManagedAgentsTokenEndpointAuthBasicUpdateParam", - "client_secret_post": "#/components/schemas/BetaManagedAgentsTokenEndpointAuthPostUpdateParam" + "agent": "#/components/schemas/BetaManagedAgentsAgentParams", + "self": "#/components/schemas/BetaManagedAgentsMultiagentSelfParams" } - }, - "oneOf": [ - { "$ref": "#/components/schemas/BetaManagedAgentsTokenEndpointAuthBasicUpdateParam" }, - { "$ref": "#/components/schemas/BetaManagedAgentsTokenEndpointAuthPostUpdateParam" } - ] + } } - } + ] }, - "BetaManagedAgentsMcpOauthUpdateParams": { - "description": "Parameters for updating an MCP OAuth credential. The `mcp_server_url` is immutable.", + "BetaManagedAgentsMultiagentSelfParams": { + "description": "Sentinel roster entry meaning \"the agent that owns this configuration\". Resolved server-side to a concrete agent reference.", "type": "object", "additionalProperties": false, "required": ["type"], - "properties": { - "type": { "type": "string", "enum": ["mcp_oauth"] }, - "access_token": { - "description": "Updated OAuth access token.", - "type": "string", - "minLength": 1, - "maxLength": 8192, - "nullable": true - }, - "expires_at": { "$ref": "#/components/schemas/BetaTimestamp", "nullable": true }, - "refresh": { - "description": "Updated refresh token configuration.", - "allOf": [{ "$ref": "#/components/schemas/BetaManagedAgentsMcpOauthRefreshUpdateParams" }], - "nullable": true - } - } + "properties": { "type": { "type": "string", "enum": ["self"], "examples": ["self"] } }, + "example": { "type": "self" } }, - "BetaManagedAgentsMemory": { - "description": "A `memory` object: a single text document at a hierarchical path inside a memory store. The `content` field is populated when `view=full` and `null` when `view=basic`; the `content_size_bytes` and `content_sha256` fields are always populated so sync clients can diff without fetching content. Memories are addressed by their `mem_...` ID; the path is the create key and can be changed via update.", + "BetaManagedAgentsOutcomeEvaluationResource": { + "description": "Evaluation state for a single outcome defined via a define_outcome event.", "type": "object", "additionalProperties": false, "required": [ "type", - "id", - "memory_store_id", - "path", - "content_size_bytes", - "content_sha256", - "memory_version_id", - "created_at", - "updated_at" + "outcome_id", + "description", + "result", + "iteration", + "completed_at", + "explanation" ], "properties": { - "type": { "type": "string", "enum": ["memory"] }, - "id": { - "description": "Unique identifier for this memory (a `mem_...` value). Stable across renames; use this ID, not the path, to read, update, or delete the memory.", - "type": "string" - }, - "memory_store_id": { - "description": "ID of the memory store this memory belongs to (a `memstore_...` value).", - "type": "string" + "type": { "type": "string", "enum": ["outcome_evaluation"], "examples": ["outcome_evaluation"] }, + "outcome_id": { + "description": "Server-generated outc_ ID for this outcome.", + "type": "string", + "examples": ["outc_011CZkZRSw2kEfs6ncTVljxP"] }, - "path": { - "description": "Hierarchical path of the memory within the store, e.g. `/projects/foo/notes.md`. Always starts with `/`. Paths are case-sensitive and unique within a store. Maximum 1,024 bytes.", - "type": "string" + "description": { + "description": "What the agent should produce.", + "type": "string", + "examples": ["Produce a 2-page summary as summary.md"] }, - "content": { - "description": "The memory's UTF-8 text content. Populated when `view=full`; `null` when `view=basic`. Maximum 100 kB (102,400 bytes).", + "result": { + "description": "Current evaluation state. `pending` before the agent begins work; `running` while producing or revising; `evaluating` while the grader scores; `satisfied`/`max_iterations_reached`/`failed`/`interrupted` are terminal.", "type": "string", - "nullable": true + "examples": ["satisfied"] }, - "content_size_bytes": { - "description": "Size of `content` in bytes (the UTF-8 plaintext length). Always populated, regardless of `view`.", + "iteration": { + "description": "0-indexed revision cycle the outcome is currently on.", "type": "integer", - "format": "int32" + "format": "int32", + "examples": [0] }, - "content_sha256": { - "description": "Lowercase hex SHA-256 digest of the UTF-8 `content` bytes (64 characters). The server applies no normalization, so clients can compute the same hash locally for staleness checks and as the value for a `content_sha256` precondition on update. Always populated, regardless of `view`.", - "type": "string" + "completed_at": { + "description": "When the outcome reached a terminal result. Null while pending/running/evaluating.", + "allOf": [{ "$ref": "#/components/schemas/BetaTimestamp" }], + "nullable": true, + "examples": ["2026-03-15T10:02:31Z"] }, - "memory_version_id": { - "description": "ID of the `memory_version` representing this memory's current content (a `memver_...` value). This is the authoritative head pointer; `memory_version` objects do not carry an `is_latest` flag, so compare against this field instead. Enumerate the full history via [List memory versions](/en/api/beta/memory_stores/memory_versions/list).", + "explanation": { + "description": "Grader's verdict text from the most recent evaluation. For satisfied, explains why criteria are met; for needs_revision (intermediate), what's missing; for failed, why unrecoverable.", + "type": "string", + "nullable": true, + "examples": ["All five sections present with inline citations."] + } + }, + "example": { + "type": "outcome_evaluation", + "outcome_id": "outc_011CZkZRSw2kEfs6ncTVljxP", + "description": "Produce a 2-page summary as summary.md", + "result": "satisfied", + "iteration": 0, + "completed_at": "2026-03-15T10:02:31Z", + "explanation": "All five sections present with inline citations." + } + }, + "BetaManagedAgentsPermissionPolicy": { + "description": "Permission policy for tool execution.", + "type": "object", + "discriminator": { + "propertyName": "type", + "mapping": { + "always_allow": "#/components/schemas/BetaManagedAgentsAlwaysAllowPolicy", + "always_ask": "#/components/schemas/BetaManagedAgentsAlwaysAskPolicy" + } + }, + "oneOf": [ + { "$ref": "#/components/schemas/BetaManagedAgentsAlwaysAllowPolicy" }, + { "$ref": "#/components/schemas/BetaManagedAgentsAlwaysAskPolicy" } + ] + }, + "BetaManagedAgentsPlainTextDocumentSource": { + "description": "Plain text document content.", + "type": "object", + "additionalProperties": false, + "required": ["type", "media_type", "data"], + "properties": { + "type": { "type": "string", "enum": ["text"] }, + "media_type": { + "description": "MIME type of the text content. Must be \"text/plain\".", + "type": "string", + "enum": ["text/plain"] + }, + "data": { "description": "The plain text content.", "type": "string", "minLength": 1 } + } + }, + "BetaManagedAgentsPrecondition": { + "description": "Optional condition that must hold for an update to apply. When omitted, the update is unconditional. Asserts the current state of the memory being updated. When an update changes `path`, the precondition still refers to the memory's current content, not the destination path. Currently the only supported variant is `content_sha256`.", + "type": "object", + "discriminator": { + "propertyName": "type", + "mapping": { "content_sha256": "#/components/schemas/BetaManagedAgentsContentSha256Precondition" } + }, + "oneOf": [{ "$ref": "#/components/schemas/BetaManagedAgentsContentSha256Precondition" }] + }, + "BetaManagedAgentsRefreshHttpResponse": { + "description": "An HTTP response captured during a credential validation probe.", + "type": "object", + "additionalProperties": false, + "required": ["status_code", "content_type", "body", "body_truncated"], + "properties": { + "status_code": { "description": "HTTP status code.", "type": "integer", "format": "int32" }, + "content_type": { "description": "Value of the `Content-Type` response header.", "type": "string" }, + "body": { + "description": "Response body. May be truncated and has sensitive values scrubbed.", "type": "string" }, - "created_at": { - "description": "When this memory was created, in RFC 3339 format.", - "allOf": [{ "$ref": "#/components/schemas/BetaTimestamp" }] + "body_truncated": { "description": "Whether `body` was truncated.", "type": "boolean" } + } + }, + "BetaManagedAgentsRefreshObject": { + "description": "Outcome of a refresh-token exchange attempted during credential validation.", + "type": "object", + "additionalProperties": false, + "required": ["status", "http_response"], + "properties": { + "status": { + "description": "Outcome of the refresh attempt.", + "allOf": [{ "$ref": "#/components/schemas/BetaManagedAgentsCredentialRefreshStatus" }] }, - "updated_at": { - "description": "When this memory was last modified, in RFC 3339 format. Use this as a cheap freshness signal; for who made the change, look up the head version's `created_by` via [List memory versions](/en/api/beta/memory_stores/memory_versions/list).", - "allOf": [{ "$ref": "#/components/schemas/BetaTimestamp" }] + "http_response": { + "description": "The captured HTTP error response from the token endpoint. Populated only when `status` is `failed`.", + "allOf": [{ "$ref": "#/components/schemas/BetaManagedAgentsRefreshHttpResponse" }], + "nullable": true } } }, - "BetaManagedAgentsMemoryListItem": { - "description": "One item in a [List memories](/en/api/beta/memory_stores/memories/list) response: either a `memory` object or, when `depth` is set, a `memory_prefix` rollup marker.", + "BetaManagedAgentsRepositoryCheckout": { + "type": "object", + "discriminator": { + "propertyName": "type", + "mapping": { + "branch": "#/components/schemas/BetaManagedAgentsBranchCheckout", + "commit": "#/components/schemas/BetaManagedAgentsCommitCheckout" + } + }, + "oneOf": [ + { "$ref": "#/components/schemas/BetaManagedAgentsBranchCheckout" }, + { "$ref": "#/components/schemas/BetaManagedAgentsCommitCheckout" } + ] + }, + "BetaManagedAgentsRetryStatus": { + "description": "What the client should do next in response to this error.", + "type": "object", + "discriminator": { + "propertyName": "type", + "mapping": { + "retrying": "#/components/schemas/BetaManagedAgentsRetryStatusRetrying", + "exhausted": "#/components/schemas/BetaManagedAgentsRetryStatusExhausted", + "terminal": "#/components/schemas/BetaManagedAgentsRetryStatusTerminal" + } + }, + "oneOf": [ + { "$ref": "#/components/schemas/BetaManagedAgentsRetryStatusRetrying" }, + { "$ref": "#/components/schemas/BetaManagedAgentsRetryStatusExhausted" }, + { "$ref": "#/components/schemas/BetaManagedAgentsRetryStatusTerminal" } + ] + }, + "BetaManagedAgentsRetryStatusExhausted": { + "description": "This turn is dead; queued inputs are flushed and the session returns to idle. Client may send a new prompt.", + "type": "object", + "additionalProperties": false, + "required": ["type"], + "properties": { "type": { "type": "string", "enum": ["exhausted"] } } + }, + "BetaManagedAgentsRetryStatusRetrying": { + "description": "The server is retrying automatically. Client should wait; the same error type may fire again as retrying, then once as exhausted when the retry budget runs out.", + "type": "object", + "additionalProperties": false, + "required": ["type"], + "properties": { "type": { "type": "string", "enum": ["retrying"] } } + }, + "BetaManagedAgentsRetryStatusTerminal": { + "description": "The session encountered a terminal error and will transition to `terminated` state.", "type": "object", + "additionalProperties": false, + "required": ["type"], + "properties": { "type": { "type": "string", "enum": ["terminal"] } } + }, + "BetaManagedAgentsRubric": { + "description": "Rubric for grading the quality of an outcome.", "discriminator": { "propertyName": "type", "mapping": { - "memory": "#/components/schemas/BetaManagedAgentsMemory", - "memory_prefix": "#/components/schemas/BetaManagedAgentsMemoryPrefix" + "file": "#/components/schemas/BetaManagedAgentsFileRubric", + "text": "#/components/schemas/BetaManagedAgentsTextRubric" } }, "oneOf": [ - { "$ref": "#/components/schemas/BetaManagedAgentsMemory" }, - { "$ref": "#/components/schemas/BetaManagedAgentsMemoryPrefix" } + { "$ref": "#/components/schemas/BetaManagedAgentsFileRubric" }, + { "$ref": "#/components/schemas/BetaManagedAgentsTextRubric" } ] }, - "BetaManagedAgentsMemoryPathConflictError": { + "BetaManagedAgentsRubricParams": { + "description": "Rubric for grading the quality of an outcome.", + "discriminator": { + "propertyName": "type", + "mapping": { + "file": "#/components/schemas/BetaManagedAgentsFileRubricParams", + "text": "#/components/schemas/BetaManagedAgentsTextRubricParams" + } + }, + "oneOf": [ + { "$ref": "#/components/schemas/BetaManagedAgentsFileRubricParams" }, + { "$ref": "#/components/schemas/BetaManagedAgentsTextRubricParams" } + ] + }, + "BetaManagedAgentsSearchResultBlock": { + "description": "A block containing a web search result.", "type": "object", "additionalProperties": false, - "required": ["type"], + "required": ["type", "source", "title", "content", "citations"], "properties": { - "type": { "type": "string", "enum": ["memory_path_conflict_error"] }, - "message": { "type": "string" }, - "conflicting_path": { "type": "string" }, - "conflicting_memory_id": { "type": "string" } + "type": { "type": "string", "enum": ["search_result"] }, + "source": { + "description": "The URL source of the search result.", + "type": "string", + "minLength": 1 + }, + "title": { "description": "The title of the search result.", "type": "string", "minLength": 1 }, + "content": { + "description": "Array of text content blocks from the search result.", + "type": "array", + "items": { "$ref": "#/components/schemas/BetaManagedAgentsSearchResultContent" } + }, + "citations": { + "description": "Citation settings for this search result.", + "allOf": [{ "$ref": "#/components/schemas/BetaManagedAgentsSearchResultCitations" }] + } } }, - "BetaManagedAgentsMemoryPreconditionFailedError": { + "BetaManagedAgentsSearchResultCitations": { + "description": "Citation settings for a search result.", "type": "object", "additionalProperties": false, - "required": ["type"], + "required": ["enabled"], "properties": { - "type": { "type": "string", "enum": ["memory_precondition_failed_error"] }, - "message": { "type": "string" } + "enabled": { + "description": "Whether citations are enabled for this search result.", + "type": "boolean" + } } }, - "BetaManagedAgentsMemoryPrefix": { - "description": "A rolled-up directory marker returned by [List memories](/en/api/beta/memory_stores/memories/list) when `depth` is set. Indicates that one or more memories exist deeper than the requested depth under this prefix. This is a list-time rollup, not a stored resource; it has no ID and no lifecycle. Each prefix counts toward the page `limit` and interleaves with `memory` items in path order.", + "BetaManagedAgentsSearchResultContent": { + "description": "Text content within a search result.", "type": "object", "additionalProperties": false, - "required": ["type", "path"], + "required": ["type", "text"], "properties": { - "type": { "type": "string", "enum": ["memory_prefix"] }, - "path": { - "description": "The rolled-up path prefix, including a trailing `/` (e.g. `/projects/foo/`). Pass this value as `path_prefix` on a subsequent list call to drill into the directory.", - "type": "string" + "type": { "type": "string", "enum": ["text"] }, + "text": { "description": "The text content.", "type": "string", "minLength": 1 } + } + }, + "BetaManagedAgentsSendSessionEvents": { + "description": "Events that were successfully sent to the session.", + "type": "object", + "additionalProperties": false, + "properties": { + "data": { + "description": "Sent events", + "type": "array", + "items": { "$ref": "#/components/schemas/BetaManagedAgentsInputEvent" } } } }, - "BetaManagedAgentsMemoryStore": { - "description": "A `memory_store`: a named container for agent memories, scoped to a workspace. Attach a store to a session via `resources[]` to mount it as a directory the agent can read and write.", + "BetaManagedAgentsSendSessionEventsParams": { + "description": "Request parameters for sending events to a `session`.", "type": "object", "additionalProperties": false, - "required": ["type", "id", "name", "created_at", "updated_at"], + "required": ["events"], "properties": { - "type": { "type": "string", "enum": ["memory_store"] }, - "id": { - "description": "Unique identifier for the memory store (a `memstore_...` tagged ID). Use this when attaching the store to a session, or in the `{memory_store_id}` path parameter of subsequent calls.", - "type": "string" - }, - "name": { - "description": "Human-readable name for the store. 1–255 characters. The store's mount-path slug under `/mnt/memory/` is derived from this name.", - "type": "string" - }, - "description": { - "description": "Free-text description of what the store contains, up to 1024 characters. Included in the agent's system prompt when the store is attached, so word it to be useful to the agent. Empty string when unset.", - "type": "string" - }, + "events": { + "description": "Events to send to the `session`.", + "type": "array", + "items": { "$ref": "#/components/schemas/BetaManagedAgentsEventParams" }, + "examples": [ + [ + { + "type": "user.message", + "content": [{ "type": "text", "text": "Where is my order #1234?" }] + } + ] + ] + } + }, + "example": { + "events": [ + { "type": "user.message", "content": [{ "type": "text", "text": "Where is my order #1234?" }] } + ] + } + }, + "BetaManagedAgentsSession": { + "description": "A Managed Agents `session`.", + "type": "object", + "additionalProperties": false, + "required": [ + "type", + "id", + "status", + "created_at", + "updated_at", + "environment_id", + "title", + "metadata", + "agent", + "resources", + "vault_ids", + "outcome_evaluations", + "usage", + "stats", + "archived_at" + ], + "properties": { + "type": { "type": "string", "enum": ["session"], "examples": ["session"] }, + "id": { "type": "string", "examples": ["sesn_011CZkZAtmR3yMPDzynEDxu7"] }, + "status": { "$ref": "#/components/schemas/BetaManagedAgentsSessionStatus", "examples": ["idle"] }, "created_at": { - "description": "Timestamp when the store was created.", - "allOf": [{ "$ref": "#/components/schemas/BetaTimestamp" }] + "$ref": "#/components/schemas/BetaTimestamp", + "examples": ["2026-03-15T10:00:00Z"] }, "updated_at": { - "description": "Timestamp when the store's `name`, `description`, or `metadata` was last modified. Memory writes inside the store do not advance this.", - "allOf": [{ "$ref": "#/components/schemas/BetaTimestamp" }] + "$ref": "#/components/schemas/BetaTimestamp", + "examples": ["2026-03-15T10:00:00Z"] }, + "environment_id": { "type": "string", "examples": ["env_011CZkZ9X2dpNyB7HsEFoRfW"] }, + "title": { "type": "string", "nullable": true, "examples": ["Order #1234 inquiry"] }, "metadata": { - "description": "Arbitrary key-value tags for your own bookkeeping (such as the end user a store belongs to). Up to 16 pairs; keys 1–64 characters; values up to 512 characters. Returned on retrieve/list but not filterable.", "type": "object", - "additionalProperties": { "type": "string" } + "additionalProperties": { "type": "string" }, + "examples": [{ "key": "value" }] }, - "archived_at": { - "description": "Timestamp when the store was archived, or `null` if active. Set once and never cleared; archiving is one-way. Archived stores are read-only and cannot be attached to new sessions.", - "allOf": [{ "$ref": "#/components/schemas/BetaTimestamp" }], - "nullable": true - } - } - }, - "BetaManagedAgentsMemoryStoreResource": { - "description": "A memory store attached to an agent session.", - "type": "object", - "additionalProperties": false, - "required": ["type", "memory_store_id"], - "properties": { - "type": { "type": "string", "enum": ["memory_store"] }, - "memory_store_id": { - "description": "The memory store ID (memstore_...). Must belong to the caller's organization and workspace.", - "type": "string" + "agent": { + "$ref": "#/components/schemas/BetaManagedAgentsSessionAgent", + "examples": [ + { + "type": "agent", + "id": "agent_011CZkYpogX7uDKUyvBTophP", + "version": 1, + "name": "My First Agent", + "description": "A general-purpose starter agent.", + "model": { "id": "claude-sonnet-4-6", "speed": "standard" }, + "system": "You are a general-purpose agent that can research, write code, run commands, and use connected tools to complete the user's task end to end.", + "tools": [ + { + "type": "agent_toolset_20260401", + "default_config": { "enabled": true, "permission_policy": { "type": "always_ask" } }, + "configs": [] + } + ], + "mcp_servers": [ + { + "type": "url", + "name": "example-mcp", + "url": "https://example-server.modelcontextprotocol.io/sse" + } + ], + "skills": [ + { "type": "anthropic", "skill_id": "xlsx", "version": "1" }, + { "type": "custom", "skill_id": "skill_011CZkZFNu9hAbo3jZPRgTlx", "version": "2" } + ], + "multiagent": null + } + ] }, - "access": { - "description": "Access mode for the mounted store. Defaults to read_write. read_only mounts the store as a read-only filesystem.", - "allOf": [{ "$ref": "#/components/schemas/BetaManagedAgentsMountMode" }], - "nullable": true + "resources": { + "type": "array", + "items": { "$ref": "#/components/schemas/BetaManagedAgentsSessionResource" }, + "examples": [ + [ + { + "type": "file", + "id": "sesrsc_011CZkZBJq5dWxk9fVLNcPht", + "file_id": "file_011CNha8iCJcU1wXNR6q4V8w", + "mount_path": "/uploads/receipt.pdf", + "created_at": "2026-03-15T10:00:00Z", + "updated_at": "2026-03-15T10:00:00Z" + }, + { + "type": "github_repository", + "id": "sesrsc_011CZkZCKr6eXyl0gWMOdQiu", + "url": "https://github.com/example-org/example-repo", + "mount_path": "/workspace/example-repo", + "checkout": { "type": "branch", "name": "main" }, + "created_at": "2026-03-15T10:00:00Z", + "updated_at": "2026-03-15T10:00:00Z" + } + ] + ] }, - "name": { - "description": "Display name of the memory store, snapshotted at attach time. Later edits to the store's name do not propagate to this resource.", - "type": "string", - "nullable": true + "vault_ids": { + "description": "Vault IDs attached to the session at creation. Empty when no vaults were supplied.", + "type": "array", + "items": { "type": "string" }, + "examples": [["vlt_011CZkZDLs7fYzm1hXNPeRjv"]] }, - "description": { - "description": "Description of the memory store, snapshotted at attach time. Rendered into the agent's system prompt. Empty string when the store has no description.", - "type": "string" + "outcome_evaluations": { + "description": "Per-outcome evaluation state. One entry per define_outcome event sent to the session.", + "type": "array", + "items": { "$ref": "#/components/schemas/BetaManagedAgentsOutcomeEvaluationResource" }, + "examples": [ + [ + { + "type": "outcome_evaluation", + "outcome_id": "outc_011CZkZRSw2kEfs6ncTVljxP", + "description": "Produce a 2-page summary as summary.md", + "result": "satisfied", + "iteration": 0, + "completed_at": "2026-03-15T10:02:31Z", + "explanation": "All five sections present with inline citations." + } + ] + ] }, - "instructions": { - "description": "Per-attachment guidance for the agent on how to use this store. Rendered into the memory section of the system prompt. Max 4096 chars.", - "type": "string", - "maxLength": 4096, - "nullable": true + "usage": { + "description": "Cumulative token usage for the session.", + "allOf": [{ "$ref": "#/components/schemas/BetaManagedAgentsSessionUsage" }], + "examples": [{ "input_tokens": 0, "output_tokens": 0, "cache_read_input_tokens": 0 }] }, - "mount_path": { - "description": "Filesystem path where the store is mounted in the session container, e.g. /mnt/memory/user-preferences. Derived from the store's name. Output-only.", - "type": "string", - "nullable": true + "stats": { + "description": "Timing statistics for the session.", + "allOf": [{ "$ref": "#/components/schemas/BetaManagedAgentsSessionStats" }], + "examples": [{ "duration_seconds": 0, "active_seconds": 0 }] + }, + "archived_at": { + "description": "When the session was archived. Null if not archived.", + "allOf": [{ "$ref": "#/components/schemas/BetaTimestamp" }], + "nullable": true, + "examples": [null] } + }, + "example": { + "type": "session", + "id": "sesn_011CZkZAtmR3yMPDzynEDxu7", + "status": "idle", + "created_at": "2026-03-15T10:00:00Z", + "updated_at": "2026-03-15T10:00:00Z", + "archived_at": null, + "environment_id": "env_011CZkZ9X2dpNyB7HsEFoRfW", + "title": "Order #1234 inquiry", + "metadata": {}, + "agent": { + "type": "agent", + "id": "agent_011CZkYpogX7uDKUyvBTophP", + "version": 1, + "name": "My First Agent", + "description": "A general-purpose starter agent.", + "model": { "id": "claude-sonnet-4-6", "speed": "standard" }, + "system": "You are a general-purpose agent that can research, write code, run commands, and use connected tools to complete the user's task end to end.", + "tools": [ + { + "type": "agent_toolset_20260401", + "default_config": { "enabled": true, "permission_policy": { "type": "always_ask" } }, + "configs": [] + } + ], + "mcp_servers": [ + { + "type": "url", + "name": "example-mcp", + "url": "https://example-server.modelcontextprotocol.io/sse" + } + ], + "skills": [ + { "type": "anthropic", "skill_id": "xlsx", "version": "1" }, + { "type": "custom", "skill_id": "skill_011CZkZFNu9hAbo3jZPRgTlx", "version": "2" } + ], + "multiagent": null + }, + "resources": [ + { + "type": "file", + "id": "sesrsc_011CZkZBJq5dWxk9fVLNcPht", + "file_id": "file_011CNha8iCJcU1wXNR6q4V8w", + "mount_path": "/uploads/receipt.pdf", + "created_at": "2026-03-15T10:00:00Z", + "updated_at": "2026-03-15T10:00:00Z" + }, + { + "type": "github_repository", + "id": "sesrsc_011CZkZCKr6eXyl0gWMOdQiu", + "url": "https://github.com/example-org/example-repo", + "mount_path": "/workspace/example-repo", + "checkout": { "type": "branch", "name": "main" }, + "created_at": "2026-03-15T10:00:00Z", + "updated_at": "2026-03-15T10:00:00Z" + } + ], + "vault_ids": ["vlt_011CZkZDLs7fYzm1hXNPeRjv"], + "usage": { "input_tokens": 0, "output_tokens": 0, "cache_read_input_tokens": 0 }, + "stats": { "duration_seconds": 0, "active_seconds": 0 }, + "outcome_evaluations": [ + { + "type": "outcome_evaluation", + "outcome_id": "outc_011CZkZRSw2kEfs6ncTVljxP", + "description": "Produce a 2-page summary as summary.md", + "result": "satisfied", + "iteration": 0, + "completed_at": "2026-03-15T10:02:31Z", + "explanation": "All five sections present with inline citations." + } + ] } }, - "BetaManagedAgentsMemoryStoreResourceParam": { - "description": "Parameters for attaching a memory store to an agent session.", + "BetaManagedAgentsSessionActor": { + "description": "Attribution for a write made by an agent during a session, through the mounted filesystem at `/mnt/memory/`.", "type": "object", "additionalProperties": false, - "required": ["type", "memory_store_id"], + "required": ["type", "session_id"], "properties": { - "type": { "type": "string", "enum": ["memory_store"] }, - "memory_store_id": { - "description": "The memory store ID (memstore_...). Must belong to the caller's organization and workspace.", - "type": "string" - }, - "access": { - "description": "Access mode for the mounted store. Defaults to read_write. read_only mounts the store as a read-only filesystem.", - "allOf": [{ "$ref": "#/components/schemas/BetaManagedAgentsMountMode" }], - "nullable": true - }, - "instructions": { - "description": "Per-attachment guidance for the agent on how to use this store. Rendered into the memory section of the system prompt. Max 4096 chars.", + "type": { "type": "string", "enum": ["session_actor"] }, + "session_id": { + "description": "ID of the session that performed the write (a `sesn_...` value). Look up the session via [Retrieve a session](/en/api/sessions-retrieve) for further provenance.", "type": "string", - "maxLength": 4096, - "nullable": true + "minLength": 1 } } }, - "BetaManagedAgentsMemoryVersion": { - "description": "A `memory_version` object: one immutable, attributed row in a memory's append-only history. Every non-no-op mutation to a memory produces a new version. Versions belong to the store (not the individual memory) and persist after the memory is deleted. Retrieving a redacted version returns 200 with `content`, `path`, `content_size_bytes`, and `content_sha256` set to `null`; branch on `redacted_at`, not HTTP status.", + "BetaManagedAgentsSessionAgent": { + "description": "Resolved `agent` definition for a `session`. Snapshot of the `agent` at `session` creation time.", "type": "object", "additionalProperties": false, - "required": ["type", "id", "memory_store_id", "memory_id", "operation", "created_at"], + "required": [ + "type", + "id", + "version", + "name", + "description", + "model", + "system", + "tools", + "mcp_servers", + "skills", + "multiagent" + ], "properties": { - "type": { "type": "string", "enum": ["memory_version"] }, - "id": { - "description": "Unique identifier for this version (a `memver_...` value).", - "type": "string" - }, - "memory_store_id": { - "description": "ID of the memory store this version belongs to (a `memstore_...` value).", - "type": "string" - }, - "memory_id": { - "description": "ID of the memory this version snapshots (a `mem_...` value). Remains valid after the memory is deleted; pass it as `memory_id` to [List memory versions](/en/api/beta/memory_stores/memory_versions/list) to retrieve the full lineage including the `deleted` row.", - "type": "string" - }, - "path": { - "description": "The memory's path at the time of this write. `null` if and only if `redacted_at` is set.", - "type": "string", - "nullable": true - }, - "operation": { - "description": "The kind of mutation this version records: `created`, `modified`, or `deleted`.", - "allOf": [{ "$ref": "#/components/schemas/BetaManagedAgentsMemoryVersionOperation" }] - }, - "content": { - "description": "The memory's UTF-8 text content as of this version. `null` when `view=basic`, when `operation` is `deleted`, or when `redacted_at` is set.", + "type": { "type": "string", "enum": ["agent"], "examples": ["agent"] }, + "id": { "type": "string", "examples": ["agent_011CZkYpogX7uDKUyvBTophP"] }, + "version": { "type": "integer", "format": "int32", "examples": [1] }, + "name": { "type": "string", "examples": ["My First Agent"] }, + "description": { "type": "string", - "nullable": true + "nullable": true, + "examples": ["A general-purpose starter agent."] }, - "content_size_bytes": { - "description": "Size of `content` in bytes as of this version. `null` when `redacted_at` is set or `operation` is `deleted`. Populated regardless of `view` otherwise.", - "type": "integer", - "format": "int32", - "nullable": true + "model": { + "$ref": "#/components/schemas/BetaManagedAgentsModelConfig", + "examples": [{ "id": "claude-sonnet-4-6", "speed": "standard" }] }, - "content_sha256": { - "description": "Lowercase hex SHA-256 digest of `content` as of this version (64 characters). `null` when `redacted_at` is set or `operation` is `deleted`. Populated regardless of `view` otherwise.", + "system": { "type": "string", - "nullable": true + "nullable": true, + "examples": [ + "You are a general-purpose agent that can research, write code, run commands, and use connected tools to complete the user's task end to end." + ] }, - "created_by": { - "description": "Who performed this write: a `session_actor`, `api_actor`, or `user_actor`. Captured at write time and preserved through redaction.", - "allOf": [{ "$ref": "#/components/schemas/BetaManagedAgentsActor" }] + "tools": { + "type": "array", + "items": { "$ref": "#/components/schemas/BetaManagedAgentsAgentTool" }, + "examples": [ + [ + { + "type": "agent_toolset_20260401", + "default_config": { "enabled": true, "permission_policy": { "type": "always_ask" } }, + "configs": [] + } + ] + ] }, - "created_at": { - "description": "When this version was written, in RFC 3339 format.", - "allOf": [{ "$ref": "#/components/schemas/BetaTimestamp" }] + "mcp_servers": { + "type": "array", + "items": { "$ref": "#/components/schemas/BetaManagedAgentsMCPServer" }, + "examples": [ + [ + { + "type": "url", + "name": "example-mcp", + "url": "https://example-server.modelcontextprotocol.io/sse" + } + ] + ] }, - "redacted_at": { - "description": "When this version was redacted, in RFC 3339 format, or `null` if it has not been redacted. When set, `content`, `path`, `content_size_bytes`, and `content_sha256` are all `null`. See [Redact a memory version](/en/api/beta/memory_stores/memory_versions/redact).", - "allOf": [{ "$ref": "#/components/schemas/BetaTimestamp" }], - "nullable": true + "skills": { + "type": "array", + "items": { "$ref": "#/components/schemas/BetaManagedAgentsSkill" }, + "examples": [ + [ + { "type": "anthropic", "skill_id": "xlsx", "version": "1" }, + { "type": "custom", "skill_id": "skill_011CZkZFNu9hAbo3jZPRgTlx", "version": "2" } + ] + ] }, - "redacted_by": { - "description": "Who redacted this version, or `null` if it has not been redacted. In practice always an `api_actor` or `user_actor` (agents do not have a redact capability).", - "allOf": [{ "$ref": "#/components/schemas/BetaManagedAgentsActor" }] - } - } - }, - "BetaManagedAgentsMemoryVersionOperation": { - "type": "string", - "description": "The kind of mutation a `memory_version` records. Every non-no-op mutation to a memory appends exactly one version row with one of these values.", - "enum": ["created", "modified", "deleted"] - }, - "BetaManagedAgentsMemoryView": { - "type": "string", - "description": "Selects which projection of a `memory` or `memory_version` the server returns. `basic` returns the object with `content` set to `null`; `full` populates `content`. When omitted, the default is endpoint-specific: retrieve operations default to `full`; list, create, and update operations default to `basic`. Listing with `view=full` caps `limit` at 20.", - "enum": ["basic", "full"] - }, - "BetaManagedAgentsModelConfig": { - "description": "Model identifier and configuration.", - "type": "object", - "additionalProperties": false, - "required": ["id"], - "properties": { - "id": { "$ref": "#/components/schemas/BetaManagedAgentsModel" }, - "speed": { - "description": "Inference speed mode. `fast` provides significantly faster output token generation at premium pricing. Defaults to `standard`. Not all models support `fast`; invalid combinations are rejected at create time.", - "allOf": [{ "$ref": "#/components/schemas/BetaManagedAgentsSpeed" }], - "examples": ["standard"] + "multiagent": { + "description": "Resolved multiagent orchestration configuration. Null when the agent is single-threaded.", + "allOf": [{ "$ref": "#/components/schemas/BetaManagedAgentsSessionMultiagent" }], + "nullable": true, + "examples": [null] } }, - "example": { "id": "claude-opus-4-6", "speed": "standard" } + "example": { + "type": "agent", + "id": "agent_011CZkYpogX7uDKUyvBTophP", + "version": 1, + "name": "My First Agent", + "description": "A general-purpose starter agent.", + "model": { "id": "claude-sonnet-4-6", "speed": "standard" }, + "system": "You are a general-purpose agent that can research, write code, run commands, and use connected tools to complete the user's task end to end.", + "tools": [ + { + "type": "agent_toolset_20260401", + "default_config": { "enabled": true, "permission_policy": { "type": "always_ask" } }, + "configs": [] + } + ], + "mcp_servers": [ + { + "type": "url", + "name": "example-mcp", + "url": "https://example-server.modelcontextprotocol.io/sse" + } + ], + "skills": [ + { "type": "anthropic", "skill_id": "xlsx", "version": "1" }, + { "type": "custom", "skill_id": "skill_011CZkZFNu9hAbo3jZPRgTlx", "version": "2" } + ], + "multiagent": null + } }, - "BetaManagedAgentsModelConfigParams": { - "description": "An object that defines additional configuration control over model use", + "BetaManagedAgentsSessionAgentUpdate": { + "description": "Mid-session agent configuration update. Only `tools` and `mcp_servers` are updatable. Full replacement: the provided array becomes the new value. To preserve existing entries, GET the session, modify the array, and POST it back.", "type": "object", "additionalProperties": false, - "required": ["id"], "properties": { - "id": { "$ref": "#/components/schemas/BetaManagedAgentsModel" }, - "speed": { - "description": "Inference speed mode. Defaults to `standard`.", - "allOf": [{ "$ref": "#/components/schemas/BetaManagedAgentsSpeed" }], - "nullable": true + "tools": { + "description": "Replacement tool list. Full replacement: the provided array becomes the new value. Send an empty array to clear; omit to preserve.", + "type": "array", + "items": { "$ref": "#/components/schemas/BetaManagedAgentsAgentToolParams" } + }, + "mcp_servers": { + "description": "Replacement MCP server list. Full replacement: the provided array becomes the new value. Send an empty array to clear; omit to preserve.", + "type": "array", + "items": { "$ref": "#/components/schemas/BetaManagedAgentsMCPServerParams" } } - }, - "example": { "id": "claude-opus-4-6" } + } }, - "BetaManagedAgentsModelOverloadedError": { - "description": "The model is currently overloaded. Emitted after automatic retries are exhausted.", + "BetaManagedAgentsSessionDeletedEvent": { + "description": "Emitted when a session has been deleted. Terminates any active event stream — no further events will be emitted for this session.", "type": "object", "additionalProperties": false, - "required": ["type", "message", "retry_status"], + "required": ["type", "id", "processed_at"], "properties": { - "type": { "type": "string", "enum": ["model_overloaded_error"] }, - "message": { "description": "Human-readable error description.", "type": "string" }, - "retry_status": { - "description": "What the client should do next.", - "allOf": [{ "$ref": "#/components/schemas/BetaManagedAgentsRetryStatus" }] + "type": { "type": "string", "enum": ["session.deleted"] }, + "id": { "description": "Unique identifier for this event.", "type": "string" }, + "processed_at": { + "description": "Timestamp when the session was deleted.", + "allOf": [{ "$ref": "#/components/schemas/BetaTimestamp" }] } } }, - "BetaManagedAgentsModelParams": { - "oneOf": [ - { - "title": "BetaManagedAgentsModel", - "allOf": [{ "$ref": "#/components/schemas/BetaManagedAgentsModel" }], - "x-stainless-skip": ["go", "cli"] - }, - { "$ref": "#/components/schemas/BetaManagedAgentsModelConfigParams" } - ] - }, - "BetaManagedAgentsModelRateLimitedError": { - "description": "The model request was rate-limited.", + "BetaManagedAgentsSessionEndTurn": { + "description": "The agent completed its turn naturally and is ready for the next user message.", "type": "object", "additionalProperties": false, - "required": ["type", "message", "retry_status"], - "properties": { - "type": { "type": "string", "enum": ["model_rate_limited_error"] }, - "message": { "description": "Human-readable error description.", "type": "string" }, - "retry_status": { - "description": "What the client should do next.", - "allOf": [{ "$ref": "#/components/schemas/BetaManagedAgentsRetryStatus" }] - } - } + "required": ["type"], + "properties": { "type": { "type": "string", "enum": ["end_turn"] } } }, - "BetaManagedAgentsModelRequestFailedError": { - "description": "A model request failed for a reason other than overload or rate-limiting.", + "BetaManagedAgentsSessionErrorEvent": { + "description": "An error event indicating a problem occurred during session execution.", "type": "object", "additionalProperties": false, - "required": ["type", "message", "retry_status"], + "required": ["type", "id", "processed_at", "error"], "properties": { - "type": { "type": "string", "enum": ["model_request_failed_error"] }, - "message": { "description": "Human-readable error description.", "type": "string" }, - "retry_status": { - "description": "What the client should do next.", - "allOf": [{ "$ref": "#/components/schemas/BetaManagedAgentsRetryStatus" }] + "type": { "type": "string", "enum": ["session.error"] }, + "id": { "description": "Unique identifier for this event.", "type": "string" }, + "processed_at": { + "description": "Timestamp when the error occurred.", + "allOf": [{ "$ref": "#/components/schemas/BetaTimestamp" }] + }, + "error": { + "type": "object", + "discriminator": { + "propertyName": "type", + "mapping": { + "unknown_error": "#/components/schemas/BetaManagedAgentsUnknownError", + "model_overloaded_error": "#/components/schemas/BetaManagedAgentsModelOverloadedError", + "model_rate_limited_error": "#/components/schemas/BetaManagedAgentsModelRateLimitedError", + "model_request_failed_error": "#/components/schemas/BetaManagedAgentsModelRequestFailedError", + "mcp_connection_failed_error": "#/components/schemas/BetaManagedAgentsMcpConnectionFailedError", + "mcp_authentication_failed_error": "#/components/schemas/BetaManagedAgentsMcpAuthenticationFailedError", + "billing_error": "#/components/schemas/BetaManagedAgentsBillingError" + } + }, + "oneOf": [ + { "$ref": "#/components/schemas/BetaManagedAgentsUnknownError" }, + { "$ref": "#/components/schemas/BetaManagedAgentsModelOverloadedError" }, + { "$ref": "#/components/schemas/BetaManagedAgentsModelRateLimitedError" }, + { "$ref": "#/components/schemas/BetaManagedAgentsModelRequestFailedError" }, + { "$ref": "#/components/schemas/BetaManagedAgentsMcpConnectionFailedError" }, + { "$ref": "#/components/schemas/BetaManagedAgentsMcpAuthenticationFailedError" }, + { "$ref": "#/components/schemas/BetaManagedAgentsBillingError" } + ] } } }, - "BetaManagedAgentsMountMode": { - "type": "string", - "description": "Access mode for an attached memory store.", - "enum": ["read_write", "read_only"] - }, - "BetaManagedAgentsPermissionPolicy": { - "description": "Permission policy for tool execution.", + "BetaManagedAgentsSessionEvent": { + "description": "Union type for all event types in a session.", "type": "object", "discriminator": { "propertyName": "type", "mapping": { - "always_allow": "#/components/schemas/BetaManagedAgentsAlwaysAllowPolicy", - "always_ask": "#/components/schemas/BetaManagedAgentsAlwaysAskPolicy" + "user.message": "#/components/schemas/BetaManagedAgentsUserMessageEvent", + "user.interrupt": "#/components/schemas/BetaManagedAgentsUserInterruptEvent", + "user.tool_confirmation": "#/components/schemas/BetaManagedAgentsUserToolConfirmationEvent", + "user.custom_tool_result": "#/components/schemas/BetaManagedAgentsUserCustomToolResultEvent", + "agent.custom_tool_use": "#/components/schemas/BetaManagedAgentsAgentCustomToolUseEvent", + "agent.message": "#/components/schemas/BetaManagedAgentsAgentMessageEvent", + "agent.thinking": "#/components/schemas/BetaManagedAgentsAgentThinkingEvent", + "agent.mcp_tool_use": "#/components/schemas/BetaManagedAgentsAgentMcpToolUseEvent", + "agent.mcp_tool_result": "#/components/schemas/BetaManagedAgentsAgentMcpToolResultEvent", + "agent.tool_use": "#/components/schemas/BetaManagedAgentsAgentToolUseEvent", + "agent.tool_result": "#/components/schemas/BetaManagedAgentsAgentToolResultEvent", + "agent.thread_message_received": "#/components/schemas/BetaManagedAgentsAgentThreadMessageReceivedEvent", + "agent.thread_message_sent": "#/components/schemas/BetaManagedAgentsAgentThreadMessageSentEvent", + "agent.thread_context_compacted": "#/components/schemas/BetaManagedAgentsAgentThreadContextCompactedEvent", + "session.error": "#/components/schemas/BetaManagedAgentsSessionErrorEvent", + "session.status_rescheduled": "#/components/schemas/BetaManagedAgentsSessionStatusRescheduledEvent", + "session.status_running": "#/components/schemas/BetaManagedAgentsSessionStatusRunningEvent", + "session.status_idle": "#/components/schemas/BetaManagedAgentsSessionStatusIdleEvent", + "session.status_terminated": "#/components/schemas/BetaManagedAgentsSessionStatusTerminatedEvent", + "session.thread_created": "#/components/schemas/BetaManagedAgentsSessionThreadCreatedEvent", + "span.outcome_evaluation_start": "#/components/schemas/BetaManagedAgentsSpanOutcomeEvaluationStartEvent", + "span.outcome_evaluation_end": "#/components/schemas/BetaManagedAgentsSpanOutcomeEvaluationEndEvent", + "span.model_request_start": "#/components/schemas/BetaManagedAgentsSpanModelRequestStartEvent", + "span.model_request_end": "#/components/schemas/BetaManagedAgentsSpanModelRequestEndEvent", + "span.outcome_evaluation_ongoing": "#/components/schemas/BetaManagedAgentsSpanOutcomeEvaluationOngoingEvent", + "user.define_outcome": "#/components/schemas/BetaManagedAgentsUserDefineOutcomeEvent", + "session.deleted": "#/components/schemas/BetaManagedAgentsSessionDeletedEvent", + "session.thread_status_running": "#/components/schemas/BetaManagedAgentsSessionThreadStatusRunningEvent", + "session.thread_status_idle": "#/components/schemas/BetaManagedAgentsSessionThreadStatusIdleEvent", + "session.thread_status_terminated": "#/components/schemas/BetaManagedAgentsSessionThreadStatusTerminatedEvent", + "user.tool_result": "#/components/schemas/BetaManagedAgentsUserToolResultEvent", + "session.thread_status_rescheduled": "#/components/schemas/BetaManagedAgentsSessionThreadStatusRescheduledEvent", + "session.updated": "#/components/schemas/BetaManagedAgentsSessionUpdatedEvent" } }, "oneOf": [ - { "$ref": "#/components/schemas/BetaManagedAgentsAlwaysAllowPolicy" }, - { "$ref": "#/components/schemas/BetaManagedAgentsAlwaysAskPolicy" } + { "$ref": "#/components/schemas/BetaManagedAgentsUserMessageEvent" }, + { "$ref": "#/components/schemas/BetaManagedAgentsUserInterruptEvent" }, + { "$ref": "#/components/schemas/BetaManagedAgentsUserToolConfirmationEvent" }, + { "$ref": "#/components/schemas/BetaManagedAgentsUserCustomToolResultEvent" }, + { "$ref": "#/components/schemas/BetaManagedAgentsAgentCustomToolUseEvent" }, + { "$ref": "#/components/schemas/BetaManagedAgentsAgentMessageEvent" }, + { "$ref": "#/components/schemas/BetaManagedAgentsAgentThinkingEvent" }, + { "$ref": "#/components/schemas/BetaManagedAgentsAgentMcpToolUseEvent" }, + { "$ref": "#/components/schemas/BetaManagedAgentsAgentMcpToolResultEvent" }, + { "$ref": "#/components/schemas/BetaManagedAgentsAgentToolUseEvent" }, + { "$ref": "#/components/schemas/BetaManagedAgentsAgentToolResultEvent" }, + { "$ref": "#/components/schemas/BetaManagedAgentsAgentThreadMessageReceivedEvent" }, + { "$ref": "#/components/schemas/BetaManagedAgentsAgentThreadMessageSentEvent" }, + { "$ref": "#/components/schemas/BetaManagedAgentsAgentThreadContextCompactedEvent" }, + { "$ref": "#/components/schemas/BetaManagedAgentsSessionErrorEvent" }, + { "$ref": "#/components/schemas/BetaManagedAgentsSessionStatusRescheduledEvent" }, + { "$ref": "#/components/schemas/BetaManagedAgentsSessionStatusRunningEvent" }, + { "$ref": "#/components/schemas/BetaManagedAgentsSessionStatusIdleEvent" }, + { "$ref": "#/components/schemas/BetaManagedAgentsSessionStatusTerminatedEvent" }, + { "$ref": "#/components/schemas/BetaManagedAgentsSessionThreadCreatedEvent" }, + { "$ref": "#/components/schemas/BetaManagedAgentsSpanOutcomeEvaluationStartEvent" }, + { "$ref": "#/components/schemas/BetaManagedAgentsSpanOutcomeEvaluationEndEvent" }, + { "$ref": "#/components/schemas/BetaManagedAgentsSpanModelRequestStartEvent" }, + { "$ref": "#/components/schemas/BetaManagedAgentsSpanModelRequestEndEvent" }, + { "$ref": "#/components/schemas/BetaManagedAgentsSpanOutcomeEvaluationOngoingEvent" }, + { "$ref": "#/components/schemas/BetaManagedAgentsUserDefineOutcomeEvent" }, + { "$ref": "#/components/schemas/BetaManagedAgentsSessionDeletedEvent" }, + { "$ref": "#/components/schemas/BetaManagedAgentsSessionThreadStatusRunningEvent" }, + { "$ref": "#/components/schemas/BetaManagedAgentsSessionThreadStatusIdleEvent" }, + { "$ref": "#/components/schemas/BetaManagedAgentsSessionThreadStatusTerminatedEvent" }, + { "$ref": "#/components/schemas/BetaManagedAgentsUserToolResultEvent" }, + { "$ref": "#/components/schemas/BetaManagedAgentsSessionThreadStatusRescheduledEvent" }, + { "$ref": "#/components/schemas/BetaManagedAgentsSessionUpdatedEvent" } ] }, - "BetaManagedAgentsPlainTextDocumentSource": { - "description": "Plain text document content.", + "BetaManagedAgentsSessionMultiagent": { + "description": "Resolved multiagent orchestration configuration as returned on a `session`.", + "discriminator": { + "propertyName": "type", + "mapping": { "coordinator": "#/components/schemas/BetaManagedAgentsSessionMultiagentCoordinator" } + }, + "oneOf": [{ "$ref": "#/components/schemas/BetaManagedAgentsSessionMultiagentCoordinator" }] + }, + "BetaManagedAgentsSessionMultiagentCoordinator": { + "description": "Resolved coordinator topology with full agent definitions for each roster member.", "type": "object", "additionalProperties": false, - "required": ["type", "media_type", "data"], + "required": ["type", "agents"], "properties": { - "type": { "type": "string", "enum": ["text"] }, - "media_type": { - "description": "MIME type of the text content. Must be \"text/plain\".", - "type": "string", - "enum": ["text/plain"] - }, - "data": { "description": "The plain text content.", "type": "string", "minLength": 1 } + "type": { "type": "string", "enum": ["coordinator"] }, + "agents": { + "description": "Full `agent` definitions the coordinator may spawn as session threads.", + "type": "array", + "items": { "$ref": "#/components/schemas/BetaManagedAgentsSessionThreadAgent" } + } } }, - "BetaManagedAgentsPrecondition": { - "description": "Optional condition that must hold for an update to apply. When omitted, the update is unconditional. Asserts the current state of the memory being updated. When an update changes `path`, the precondition still refers to the memory's current content, not the destination path. Currently the only supported variant is `content_sha256`.", + "BetaManagedAgentsSessionRequiresAction": { + "description": "The agent is idle waiting on one or more blocking user-input events (tool confirmation, custom tool result, etc.). Resolving all of them transitions the session back to running.", "type": "object", - "discriminator": { - "propertyName": "type", - "mapping": { "content_sha256": "#/components/schemas/BetaManagedAgentsContentSha256Precondition" } - }, - "oneOf": [{ "$ref": "#/components/schemas/BetaManagedAgentsContentSha256Precondition" }] + "additionalProperties": false, + "required": ["type", "event_ids"], + "properties": { + "type": { "type": "string", "enum": ["requires_action"] }, + "event_ids": { + "description": "The ids of events the agent is blocked on. Resolving fewer than all re-emits `session.status_idle` with the remainder.", + "type": "array", + "items": { "type": "string" } + } + } }, - "BetaManagedAgentsRepositoryCheckout": { + "BetaManagedAgentsSessionResource": { "type": "object", "discriminator": { "propertyName": "type", "mapping": { - "branch": "#/components/schemas/BetaManagedAgentsBranchCheckout", - "commit": "#/components/schemas/BetaManagedAgentsCommitCheckout" + "github_repository": "#/components/schemas/BetaManagedAgentsGitHubRepositoryResource", + "file": "#/components/schemas/BetaManagedAgentsFileResource", + "memory_store": "#/components/schemas/BetaManagedAgentsMemoryStoreResource" } }, "oneOf": [ - { "$ref": "#/components/schemas/BetaManagedAgentsBranchCheckout" }, - { "$ref": "#/components/schemas/BetaManagedAgentsCommitCheckout" } + { "$ref": "#/components/schemas/BetaManagedAgentsGitHubRepositoryResource" }, + { "$ref": "#/components/schemas/BetaManagedAgentsFileResource" }, + { "$ref": "#/components/schemas/BetaManagedAgentsMemoryStoreResource" } ] }, - "BetaManagedAgentsRetryStatus": { - "description": "What the client should do next in response to this error.", + "BetaManagedAgentsSessionResourceParams": { + "description": "Union of resources that can be mounted into a session.", "type": "object", "discriminator": { "propertyName": "type", "mapping": { - "retrying": "#/components/schemas/BetaManagedAgentsRetryStatusRetrying", - "exhausted": "#/components/schemas/BetaManagedAgentsRetryStatusExhausted", - "terminal": "#/components/schemas/BetaManagedAgentsRetryStatusTerminal" + "github_repository": "#/components/schemas/BetaManagedAgentsGitHubRepositoryResourceParams", + "file": "#/components/schemas/BetaManagedAgentsFileResourceParams", + "memory_store": "#/components/schemas/BetaManagedAgentsMemoryStoreResourceParam" } }, "oneOf": [ - { "$ref": "#/components/schemas/BetaManagedAgentsRetryStatusRetrying" }, - { "$ref": "#/components/schemas/BetaManagedAgentsRetryStatusExhausted" }, - { "$ref": "#/components/schemas/BetaManagedAgentsRetryStatusTerminal" } - ] + { "$ref": "#/components/schemas/BetaManagedAgentsGitHubRepositoryResourceParams" }, + { "$ref": "#/components/schemas/BetaManagedAgentsFileResourceParams" }, + { "$ref": "#/components/schemas/BetaManagedAgentsMemoryStoreResourceParam" } + ], + "example": { + "type": "file", + "file_id": "file_011CNha8iCJcU1wXNR6q4V8w", + "mount_path": "/uploads/receipt.pdf" + } }, - "BetaManagedAgentsRetryStatusExhausted": { - "description": "This turn is dead; queued inputs are flushed and the session returns to idle. Client may send a new prompt.", + "BetaManagedAgentsSessionRetriesExhausted": { + "description": "The turn ended because the retry budget was exhausted (`max_iterations` hit or an error escalated to `retry_status: 'exhausted'`).", "type": "object", "additionalProperties": false, "required": ["type"], - "properties": { "type": { "type": "string", "enum": ["exhausted"] } } + "properties": { "type": { "type": "string", "enum": ["retries_exhausted"] } } + }, + "BetaManagedAgentsSessionStats": { + "description": "Timing statistics for a session.", + "type": "object", + "additionalProperties": false, + "properties": { + "duration_seconds": { + "description": "Elapsed time since session creation in seconds. For terminated sessions, frozen at the final update.", + "type": "number", + "format": "double" + }, + "active_seconds": { + "description": "Cumulative time in seconds the session spent in running status. Excludes idle time.", + "type": "number", + "format": "double" + } + } + }, + "BetaManagedAgentsSessionStatus": { + "type": "string", + "description": "SessionStatus enum", + "enum": ["rescheduling", "running", "idle", "terminated"] }, - "BetaManagedAgentsRetryStatusRetrying": { - "description": "The server is retrying automatically. Client should wait; the same error type may fire again as retrying, then once as exhausted when the retry budget runs out.", + "BetaManagedAgentsSessionStatusIdleEvent": { + "description": "Indicates the agent has paused and is awaiting user input.", "type": "object", "additionalProperties": false, - "required": ["type"], - "properties": { "type": { "type": "string", "enum": ["retrying"] } } + "required": ["type", "id", "processed_at", "stop_reason"], + "properties": { + "type": { "type": "string", "enum": ["session.status_idle"] }, + "id": { "description": "Unique identifier for this event.", "type": "string" }, + "processed_at": { + "description": "Timestamp of status change.", + "allOf": [{ "$ref": "#/components/schemas/BetaTimestamp" }] + }, + "stop_reason": { + "type": "object", + "discriminator": { + "propertyName": "type", + "mapping": { + "end_turn": "#/components/schemas/BetaManagedAgentsSessionEndTurn", + "requires_action": "#/components/schemas/BetaManagedAgentsSessionRequiresAction", + "retries_exhausted": "#/components/schemas/BetaManagedAgentsSessionRetriesExhausted" + } + }, + "oneOf": [ + { "$ref": "#/components/schemas/BetaManagedAgentsSessionEndTurn" }, + { "$ref": "#/components/schemas/BetaManagedAgentsSessionRequiresAction" }, + { "$ref": "#/components/schemas/BetaManagedAgentsSessionRetriesExhausted" } + ] + } + } }, - "BetaManagedAgentsRetryStatusTerminal": { - "description": "The session encountered a terminal error and will transition to `terminated` state.", + "BetaManagedAgentsSessionStatusRescheduledEvent": { + "description": "Indicates the session is recovering from an error state and is rescheduled for execution.", "type": "object", "additionalProperties": false, - "required": ["type"], - "properties": { "type": { "type": "string", "enum": ["terminal"] } } + "required": ["type", "id", "processed_at"], + "properties": { + "type": { "type": "string", "enum": ["session.status_rescheduled"] }, + "id": { "description": "Unique identifier for this event.", "type": "string" }, + "processed_at": { + "description": "Timestamp of status change.", + "allOf": [{ "$ref": "#/components/schemas/BetaTimestamp" }] + } + } }, - "BetaManagedAgentsSendSessionEvents": { - "description": "Events that were successfully sent to the session.", + "BetaManagedAgentsSessionStatusRunningEvent": { + "description": "Indicates the session is actively running and the agent is working.", "type": "object", "additionalProperties": false, + "required": ["type", "id", "processed_at"], "properties": { - "data": { - "description": "Sent events", - "type": "array", - "items": { "$ref": "#/components/schemas/BetaManagedAgentsInputEvent" } + "type": { "type": "string", "enum": ["session.status_running"] }, + "id": { "description": "Unique identifier for this event.", "type": "string" }, + "processed_at": { + "description": "Timestamp of status change.", + "allOf": [{ "$ref": "#/components/schemas/BetaTimestamp" }] } } }, - "BetaManagedAgentsSendSessionEventsParams": { - "description": "Request parameters for sending events to a `session`.", + "BetaManagedAgentsSessionStatusTerminatedEvent": { + "description": "Indicates the session has terminated, either due to an error or completion.", "type": "object", "additionalProperties": false, - "required": ["events"], + "required": ["type", "id", "processed_at"], "properties": { - "events": { - "description": "Events to send to the `session`.", - "type": "array", - "items": { "$ref": "#/components/schemas/BetaManagedAgentsEventParams" }, - "examples": [ - [ - { - "type": "user.message", - "content": [{ "type": "text", "text": "Where is my order #1234?" }] - } - ] - ] + "type": { "type": "string", "enum": ["session.status_terminated"] }, + "id": { "description": "Unique identifier for this event.", "type": "string" }, + "processed_at": { + "description": "Timestamp of status change.", + "allOf": [{ "$ref": "#/components/schemas/BetaTimestamp" }] } - }, - "example": { - "events": [ - { "type": "user.message", "content": [{ "type": "text", "text": "Where is my order #1234?" }] } - ] } }, - "BetaManagedAgentsSession": { - "description": "A Managed Agents `session`.", + "BetaManagedAgentsSessionThread": { + "description": "An execution thread within a `session`. Each session has one primary thread plus zero or more child threads spawned by the coordinator.", "type": "object", "additionalProperties": false, "required": [ "type", "id", + "session_id", "status", + "agent", + "parent_thread_id", "created_at", "updated_at", - "environment_id", - "title", - "metadata", - "agent", - "resources", - "vault_ids", + "archived_at", "usage", - "stats", - "archived_at" + "stats" ], "properties": { - "type": { "type": "string", "enum": ["session"], "examples": ["session"] }, - "id": { "type": "string", "examples": ["sesn_011CZkZAtmR3yMPDzynEDxu7"] }, - "status": { "$ref": "#/components/schemas/BetaManagedAgentsSessionStatus", "examples": ["idle"] }, - "created_at": { - "$ref": "#/components/schemas/BetaTimestamp", - "examples": ["2026-03-15T10:00:00Z"] + "type": { "type": "string", "enum": ["session_thread"], "examples": ["session_thread"] }, + "id": { + "description": "Unique identifier for this thread.", + "type": "string", + "examples": ["sthr_011CZkZVWa6oIjw0rgXZpnBt"] }, - "updated_at": { - "$ref": "#/components/schemas/BetaTimestamp", - "examples": ["2026-03-15T10:00:00Z"] + "session_id": { + "description": "The session this thread belongs to.", + "type": "string", + "examples": ["sesn_011CZkZAtmR3yMPDzynEDxu7"] }, - "environment_id": { "type": "string", "examples": ["env_011CZkZ9X2dpNyB7HsEFoRfW"] }, - "title": { "type": "string", "nullable": true, "examples": ["Order #1234 inquiry"] }, - "metadata": { - "type": "object", - "additionalProperties": { "type": "string" }, - "examples": [{ "key": "value" }] + "status": { + "description": "Current execution status of the thread.", + "allOf": [{ "$ref": "#/components/schemas/BetaManagedAgentsSessionThreadStatus" }], + "examples": ["idle"] }, "agent": { - "$ref": "#/components/schemas/BetaManagedAgentsSessionAgent", + "description": "Resolved agent definition for this thread. Snapshot of the agent at thread creation time.", + "allOf": [{ "$ref": "#/components/schemas/BetaManagedAgentsSessionThreadAgent" }], "examples": [ { "type": "agent", - "id": "agent_011CZkYpogX7uDKUyvBTophP", + "id": "agent_011CZkYqphY8vELVzwCUpqiQ", "version": 1, - "name": "My First Agent", - "description": "A general-purpose starter agent.", + "name": "Researcher", + "description": "A focused research subagent.", "model": { "id": "claude-sonnet-4-6", "speed": "standard" }, - "system": "You are a general-purpose agent that can research, write code, run commands, and use connected tools to complete the user's task end to end.", + "system": "You are a research subagent that gathers and summarises sources for the coordinating agent.", "tools": [ { "type": "agent_toolset_20260401", @@ -16030,86 +19110,66 @@ "configs": [] } ], - "mcp_servers": [ - { - "type": "url", - "name": "example-mcp", - "url": "https://example-server.modelcontextprotocol.io/sse" - } - ], - "skills": [ - { "type": "anthropic", "skill_id": "xlsx", "version": "1" }, - { "type": "custom", "skill_id": "skill_011CZkZFNu9hAbo3jZPRgTlx", "version": "2" } - ] + "mcp_servers": [], + "skills": [] } ] }, - "resources": { - "type": "array", - "items": { "$ref": "#/components/schemas/BetaManagedAgentsSessionResource" }, - "examples": [ - [ - { - "type": "file", - "id": "sesrsc_011CZkZBJq5dWxk9fVLNcPht", - "file_id": "file_011CNha8iCJcU1wXNR6q4V8w", - "mount_path": "/uploads/receipt.pdf", - "created_at": "2026-03-15T10:00:00Z", - "updated_at": "2026-03-15T10:00:00Z" - }, - { - "type": "github_repository", - "id": "sesrsc_011CZkZCKr6eXyl0gWMOdQiu", - "url": "https://github.com/example-org/example-repo", - "mount_path": "/workspace/example-repo", - "checkout": { "type": "branch", "name": "main" }, - "created_at": "2026-03-15T10:00:00Z", - "updated_at": "2026-03-15T10:00:00Z" - } - ] - ] - }, - "vault_ids": { - "description": "Vault IDs attached to the session at creation. Empty when no vaults were supplied.", - "type": "array", - "items": { "type": "string" }, - "examples": [["vlt_011CZkZDLs7fYzm1hXNPeRjv"]] + "parent_thread_id": { + "description": "Parent thread that spawned this thread. Null for the primary thread.", + "type": "string", + "nullable": true, + "examples": [null] }, - "usage": { - "description": "Cumulative token usage for the session.", - "allOf": [{ "$ref": "#/components/schemas/BetaManagedAgentsSessionUsage" }], - "examples": [{ "input_tokens": 0, "output_tokens": 0, "cache_read_input_tokens": 0 }] + "created_at": { + "description": "When the thread was created.", + "allOf": [{ "$ref": "#/components/schemas/BetaTimestamp" }], + "examples": ["2026-03-15T10:00:00Z"] }, - "stats": { - "description": "Timing statistics for the session.", - "allOf": [{ "$ref": "#/components/schemas/BetaManagedAgentsSessionStats" }], - "examples": [{ "duration_seconds": 0, "active_seconds": 0 }] + "updated_at": { + "description": "When the thread was last updated.", + "allOf": [{ "$ref": "#/components/schemas/BetaTimestamp" }], + "examples": ["2026-03-15T10:00:00Z"] }, "archived_at": { - "description": "When the session was archived. Null if not archived.", + "description": "When the thread was archived. Null if not archived.", "allOf": [{ "$ref": "#/components/schemas/BetaTimestamp" }], "nullable": true, "examples": [null] + }, + "usage": { + "description": "Cumulative token usage for this thread. Null until the thread's first idle transition.", + "allOf": [{ "$ref": "#/components/schemas/BetaManagedAgentsSessionThreadUsage" }], + "nullable": true, + "examples": [ + { + "input_tokens": 0, + "output_tokens": 0, + "cache_read_input_tokens": 0, + "cache_creation": { "ephemeral_5m_input_tokens": 0, "ephemeral_1h_input_tokens": 0 } + } + ] + }, + "stats": { + "description": "Timing statistics for this thread. Null until the thread's first status transition.", + "allOf": [{ "$ref": "#/components/schemas/BetaManagedAgentsSessionThreadStats" }], + "nullable": true, + "examples": [{ "duration_seconds": 0, "startup_seconds": 0, "active_seconds": 0 }] } }, "example": { - "type": "session", - "id": "sesn_011CZkZAtmR3yMPDzynEDxu7", + "type": "session_thread", + "id": "sthr_011CZkZVWa6oIjw0rgXZpnBt", + "session_id": "sesn_011CZkZAtmR3yMPDzynEDxu7", "status": "idle", - "created_at": "2026-03-15T10:00:00Z", - "updated_at": "2026-03-15T10:00:00Z", - "archived_at": null, - "environment_id": "env_011CZkZ9X2dpNyB7HsEFoRfW", - "title": "Order #1234 inquiry", - "metadata": {}, "agent": { "type": "agent", - "id": "agent_011CZkYpogX7uDKUyvBTophP", + "id": "agent_011CZkYqphY8vELVzwCUpqiQ", "version": 1, - "name": "My First Agent", - "description": "A general-purpose starter agent.", + "name": "Researcher", + "description": "A focused research subagent.", "model": { "id": "claude-sonnet-4-6", "speed": "standard" }, - "system": "You are a general-purpose agent that can research, write code, run commands, and use connected tools to complete the user's task end to end.", + "system": "You are a research subagent that gathers and summarises sources for the coordinating agent.", "tools": [ { "type": "agent_toolset_20260401", @@ -16117,58 +19177,24 @@ "configs": [] } ], - "mcp_servers": [ - { - "type": "url", - "name": "example-mcp", - "url": "https://example-server.modelcontextprotocol.io/sse" - } - ], - "skills": [ - { "type": "anthropic", "skill_id": "xlsx", "version": "1" }, - { "type": "custom", "skill_id": "skill_011CZkZFNu9hAbo3jZPRgTlx", "version": "2" } - ] - }, - "resources": [ - { - "type": "file", - "id": "sesrsc_011CZkZBJq5dWxk9fVLNcPht", - "file_id": "file_011CNha8iCJcU1wXNR6q4V8w", - "mount_path": "/uploads/receipt.pdf", - "created_at": "2026-03-15T10:00:00Z", - "updated_at": "2026-03-15T10:00:00Z" - }, - { - "type": "github_repository", - "id": "sesrsc_011CZkZCKr6eXyl0gWMOdQiu", - "url": "https://github.com/example-org/example-repo", - "mount_path": "/workspace/example-repo", - "checkout": { "type": "branch", "name": "main" }, - "created_at": "2026-03-15T10:00:00Z", - "updated_at": "2026-03-15T10:00:00Z" - } - ], - "vault_ids": ["vlt_011CZkZDLs7fYzm1hXNPeRjv"], - "usage": { "input_tokens": 0, "output_tokens": 0, "cache_read_input_tokens": 0 }, - "stats": { "duration_seconds": 0, "active_seconds": 0 } - } - }, - "BetaManagedAgentsSessionActor": { - "description": "Attribution for a write made by an agent during a session, through the mounted filesystem at `/mnt/memory/`.", - "type": "object", - "additionalProperties": false, - "required": ["type", "session_id"], - "properties": { - "type": { "type": "string", "enum": ["session_actor"] }, - "session_id": { - "description": "ID of the session that performed the write (a `sesn_...` value). Look up the session via [Retrieve a session](/en/api/sessions-retrieve) for further provenance.", - "type": "string", - "minLength": 1 - } + "mcp_servers": [], + "skills": [] + }, + "parent_thread_id": null, + "created_at": "2026-03-15T10:00:00Z", + "updated_at": "2026-03-15T10:00:00Z", + "archived_at": null, + "usage": { + "input_tokens": 0, + "output_tokens": 0, + "cache_read_input_tokens": 0, + "cache_creation": { "ephemeral_5m_input_tokens": 0, "ephemeral_1h_input_tokens": 0 } + }, + "stats": { "duration_seconds": 0, "startup_seconds": 0, "active_seconds": 0 } } }, - "BetaManagedAgentsSessionAgent": { - "description": "Resolved `agent` definition for a `session`. Snapshot of the `agent` at `session` creation time.", + "BetaManagedAgentsSessionThreadAgent": { + "description": "Resolved `agent` definition for a single `session_thread`. Snapshot of the agent at thread creation time. The multiagent roster is not repeated here; read it from `Session.agent`.", "type": "object", "additionalProperties": false, "required": [ @@ -16185,14 +19211,10 @@ ], "properties": { "type": { "type": "string", "enum": ["agent"], "examples": ["agent"] }, - "id": { "type": "string", "examples": ["agent_011CZkYpogX7uDKUyvBTophP"] }, + "id": { "type": "string", "examples": ["agent_011CZkYqphY8vELVzwCUpqiQ"] }, "version": { "type": "integer", "format": "int32", "examples": [1] }, - "name": { "type": "string", "examples": ["My First Agent"] }, - "description": { - "type": "string", - "nullable": true, - "examples": ["A general-purpose starter agent."] - }, + "name": { "type": "string", "examples": ["Researcher"] }, + "description": { "type": "string", "nullable": true, "examples": ["A focused research subagent."] }, "model": { "$ref": "#/components/schemas/BetaManagedAgentsModelConfig", "examples": [{ "id": "claude-sonnet-4-6", "speed": "standard" }] @@ -16201,7 +19223,7 @@ "type": "string", "nullable": true, "examples": [ - "You are a general-purpose agent that can research, write code, run commands, and use connected tools to complete the user's task end to end." + "You are a research subagent that gathers and summarises sources for the coordinating agent." ] }, "tools": { @@ -16220,35 +19242,22 @@ "mcp_servers": { "type": "array", "items": { "$ref": "#/components/schemas/BetaManagedAgentsMCPServer" }, - "examples": [ - [ - { - "type": "url", - "name": "example-mcp", - "url": "https://example-server.modelcontextprotocol.io/sse" - } - ] - ] + "examples": [[]] }, "skills": { "type": "array", "items": { "$ref": "#/components/schemas/BetaManagedAgentsSkill" }, - "examples": [ - [ - { "type": "anthropic", "skill_id": "xlsx", "version": "1" }, - { "type": "custom", "skill_id": "skill_011CZkZFNu9hAbo3jZPRgTlx", "version": "2" } - ] - ] + "examples": [[]] } }, "example": { "type": "agent", - "id": "agent_011CZkYpogX7uDKUyvBTophP", + "id": "agent_011CZkYqphY8vELVzwCUpqiQ", "version": 1, - "name": "My First Agent", - "description": "A general-purpose starter agent.", + "name": "Researcher", + "description": "A focused research subagent.", "model": { "id": "claude-sonnet-4-6", "speed": "standard" }, - "system": "You are a general-purpose agent that can research, write code, run commands, and use connected tools to complete the user's task end to end.", + "system": "You are a research subagent that gathers and summarises sources for the coordinating agent.", "tools": [ { "type": "agent_toolset_20260401", @@ -16256,221 +19265,107 @@ "configs": [] } ], - "mcp_servers": [ - { - "type": "url", - "name": "example-mcp", - "url": "https://example-server.modelcontextprotocol.io/sse" - } - ], - "skills": [ - { "type": "anthropic", "skill_id": "xlsx", "version": "1" }, - { "type": "custom", "skill_id": "skill_011CZkZFNu9hAbo3jZPRgTlx", "version": "2" } - ] + "mcp_servers": [], + "skills": [] } }, - "BetaManagedAgentsSessionDeletedEvent": { - "description": "Emitted when a session has been deleted. Terminates any active event stream — no further events will be emitted for this session.", - "type": "object", - "additionalProperties": false, - "required": ["type", "id", "processed_at"], - "properties": { - "type": { "type": "string", "enum": ["session.deleted"] }, - "id": { "description": "Unique identifier for this event.", "type": "string" }, - "processed_at": { - "description": "Timestamp when the session was deleted.", - "allOf": [{ "$ref": "#/components/schemas/BetaTimestamp" }] - } - } - }, - "BetaManagedAgentsSessionEndTurn": { - "description": "The agent completed its turn naturally and is ready for the next user message.", - "type": "object", - "additionalProperties": false, - "required": ["type"], - "properties": { "type": { "type": "string", "enum": ["end_turn"] } } - }, - "BetaManagedAgentsSessionErrorEvent": { - "description": "An error event indicating a problem occurred during session execution.", + "BetaManagedAgentsSessionThreadCreatedEvent": { + "description": "Emitted when a subagent is spawned as a new thread. Written to the parent thread's output stream so clients observing the session see child creation.", "type": "object", "additionalProperties": false, - "required": ["type", "id", "processed_at", "error"], + "required": ["type", "id", "processed_at", "agent_name", "session_thread_id"], "properties": { - "type": { "type": "string", "enum": ["session.error"] }, - "id": { "description": "Unique identifier for this event.", "type": "string" }, + "type": { + "type": "string", + "enum": ["session.thread_created"], + "examples": ["session.thread_created"] + }, + "id": { + "description": "Unique identifier for this event.", + "type": "string", + "examples": ["sevt_011CZkZWXb7pJkx1shYaqoCu"] + }, "processed_at": { - "description": "Timestamp when the error occurred.", - "allOf": [{ "$ref": "#/components/schemas/BetaTimestamp" }] + "description": "Timestamp when the thread was created.", + "allOf": [{ "$ref": "#/components/schemas/BetaTimestamp" }], + "examples": ["2026-03-15T10:00:00Z"] }, - "error": { - "type": "object", - "discriminator": { - "propertyName": "type", - "mapping": { - "unknown_error": "#/components/schemas/BetaManagedAgentsUnknownError", - "model_overloaded_error": "#/components/schemas/BetaManagedAgentsModelOverloadedError", - "model_rate_limited_error": "#/components/schemas/BetaManagedAgentsModelRateLimitedError", - "model_request_failed_error": "#/components/schemas/BetaManagedAgentsModelRequestFailedError", - "mcp_connection_failed_error": "#/components/schemas/BetaManagedAgentsMcpConnectionFailedError", - "mcp_authentication_failed_error": "#/components/schemas/BetaManagedAgentsMcpAuthenticationFailedError", - "billing_error": "#/components/schemas/BetaManagedAgentsBillingError" - } - }, - "oneOf": [ - { "$ref": "#/components/schemas/BetaManagedAgentsUnknownError" }, - { "$ref": "#/components/schemas/BetaManagedAgentsModelOverloadedError" }, - { "$ref": "#/components/schemas/BetaManagedAgentsModelRateLimitedError" }, - { "$ref": "#/components/schemas/BetaManagedAgentsModelRequestFailedError" }, - { "$ref": "#/components/schemas/BetaManagedAgentsMcpConnectionFailedError" }, - { "$ref": "#/components/schemas/BetaManagedAgentsMcpAuthenticationFailedError" }, - { "$ref": "#/components/schemas/BetaManagedAgentsBillingError" } - ] - } - } - }, - "BetaManagedAgentsSessionEvent": { - "description": "Union type for all event types in a session.", - "type": "object", - "discriminator": { - "propertyName": "type", - "mapping": { - "user.message": "#/components/schemas/BetaManagedAgentsUserMessageEvent", - "user.interrupt": "#/components/schemas/BetaManagedAgentsUserInterruptEvent", - "user.tool_confirmation": "#/components/schemas/BetaManagedAgentsUserToolConfirmationEvent", - "user.custom_tool_result": "#/components/schemas/BetaManagedAgentsUserCustomToolResultEvent", - "agent.custom_tool_use": "#/components/schemas/BetaManagedAgentsAgentCustomToolUseEvent", - "agent.message": "#/components/schemas/BetaManagedAgentsAgentMessageEvent", - "agent.thinking": "#/components/schemas/BetaManagedAgentsAgentThinkingEvent", - "agent.mcp_tool_use": "#/components/schemas/BetaManagedAgentsAgentMcpToolUseEvent", - "agent.mcp_tool_result": "#/components/schemas/BetaManagedAgentsAgentMcpToolResultEvent", - "agent.tool_use": "#/components/schemas/BetaManagedAgentsAgentToolUseEvent", - "agent.tool_result": "#/components/schemas/BetaManagedAgentsAgentToolResultEvent", - "agent.thread_context_compacted": "#/components/schemas/BetaManagedAgentsAgentThreadContextCompactedEvent", - "session.error": "#/components/schemas/BetaManagedAgentsSessionErrorEvent", - "session.status_rescheduled": "#/components/schemas/BetaManagedAgentsSessionStatusRescheduledEvent", - "session.status_running": "#/components/schemas/BetaManagedAgentsSessionStatusRunningEvent", - "session.status_idle": "#/components/schemas/BetaManagedAgentsSessionStatusIdleEvent", - "session.status_terminated": "#/components/schemas/BetaManagedAgentsSessionStatusTerminatedEvent", - "span.model_request_start": "#/components/schemas/BetaManagedAgentsSpanModelRequestStartEvent", - "span.model_request_end": "#/components/schemas/BetaManagedAgentsSpanModelRequestEndEvent", - "session.deleted": "#/components/schemas/BetaManagedAgentsSessionDeletedEvent" - } - }, - "oneOf": [ - { "$ref": "#/components/schemas/BetaManagedAgentsUserMessageEvent" }, - { "$ref": "#/components/schemas/BetaManagedAgentsUserInterruptEvent" }, - { "$ref": "#/components/schemas/BetaManagedAgentsUserToolConfirmationEvent" }, - { "$ref": "#/components/schemas/BetaManagedAgentsUserCustomToolResultEvent" }, - { "$ref": "#/components/schemas/BetaManagedAgentsAgentCustomToolUseEvent" }, - { "$ref": "#/components/schemas/BetaManagedAgentsAgentMessageEvent" }, - { "$ref": "#/components/schemas/BetaManagedAgentsAgentThinkingEvent" }, - { "$ref": "#/components/schemas/BetaManagedAgentsAgentMcpToolUseEvent" }, - { "$ref": "#/components/schemas/BetaManagedAgentsAgentMcpToolResultEvent" }, - { "$ref": "#/components/schemas/BetaManagedAgentsAgentToolUseEvent" }, - { "$ref": "#/components/schemas/BetaManagedAgentsAgentToolResultEvent" }, - { "$ref": "#/components/schemas/BetaManagedAgentsAgentThreadContextCompactedEvent" }, - { "$ref": "#/components/schemas/BetaManagedAgentsSessionErrorEvent" }, - { "$ref": "#/components/schemas/BetaManagedAgentsSessionStatusRescheduledEvent" }, - { "$ref": "#/components/schemas/BetaManagedAgentsSessionStatusRunningEvent" }, - { "$ref": "#/components/schemas/BetaManagedAgentsSessionStatusIdleEvent" }, - { "$ref": "#/components/schemas/BetaManagedAgentsSessionStatusTerminatedEvent" }, - { "$ref": "#/components/schemas/BetaManagedAgentsSpanModelRequestStartEvent" }, - { "$ref": "#/components/schemas/BetaManagedAgentsSpanModelRequestEndEvent" }, - { "$ref": "#/components/schemas/BetaManagedAgentsSessionDeletedEvent" } - ] - }, - "BetaManagedAgentsSessionRequiresAction": { - "description": "The agent is idle waiting on one or more blocking user-input events (tool confirmation, custom tool result, etc.). Resolving all of them transitions the session back to running.", - "type": "object", - "additionalProperties": false, - "required": ["type", "event_ids"], - "properties": { - "type": { "type": "string", "enum": ["requires_action"] }, - "event_ids": { - "description": "The ids of events the agent is blocked on. Resolving fewer than all re-emits `session.status_idle` with the remainder.", - "type": "array", - "items": { "type": "string" } - } - } - }, - "BetaManagedAgentsSessionResource": { - "type": "object", - "discriminator": { - "propertyName": "type", - "mapping": { - "github_repository": "#/components/schemas/BetaManagedAgentsGitHubRepositoryResource", - "file": "#/components/schemas/BetaManagedAgentsFileResource", - "memory_store": "#/components/schemas/BetaManagedAgentsMemoryStoreResource" - } - }, - "oneOf": [ - { "$ref": "#/components/schemas/BetaManagedAgentsGitHubRepositoryResource" }, - { "$ref": "#/components/schemas/BetaManagedAgentsFileResource" }, - { "$ref": "#/components/schemas/BetaManagedAgentsMemoryStoreResource" } - ] - }, - "BetaManagedAgentsSessionResourceParams": { - "description": "Union of resources that can be mounted into a session.", - "type": "object", - "discriminator": { - "propertyName": "type", - "mapping": { - "github_repository": "#/components/schemas/BetaManagedAgentsGitHubRepositoryResourceParams", - "file": "#/components/schemas/BetaManagedAgentsFileResourceParams", - "memory_store": "#/components/schemas/BetaManagedAgentsMemoryStoreResourceParam" + "agent_name": { + "description": "Name of the callable agent the thread runs.", + "type": "string", + "examples": ["Researcher"] + }, + "session_thread_id": { + "description": "Public `sthr_` ID of the newly created thread.", + "type": "string", + "examples": ["sthr_011CZkZVWa6oIjw0rgXZpnBt"] } }, - "oneOf": [ - { "$ref": "#/components/schemas/BetaManagedAgentsGitHubRepositoryResourceParams" }, - { "$ref": "#/components/schemas/BetaManagedAgentsFileResourceParams" }, - { "$ref": "#/components/schemas/BetaManagedAgentsMemoryStoreResourceParam" } - ], "example": { - "type": "file", - "file_id": "file_011CNha8iCJcU1wXNR6q4V8w", - "mount_path": "/uploads/receipt.pdf" + "type": "session.thread_created", + "id": "sevt_011CZkZWXb7pJkx1shYaqoCu", + "session_thread_id": "sthr_011CZkZVWa6oIjw0rgXZpnBt", + "processed_at": "2026-03-15T10:00:00Z", + "agent_name": "Researcher" } }, - "BetaManagedAgentsSessionRetriesExhausted": { - "description": "The turn ended because the retry budget was exhausted (`max_iterations` hit or an error escalated to `retry_status: 'exhausted'`).", - "type": "object", - "additionalProperties": false, - "required": ["type"], - "properties": { "type": { "type": "string", "enum": ["retries_exhausted"] } } - }, - "BetaManagedAgentsSessionStats": { - "description": "Timing statistics for a session.", + "BetaManagedAgentsSessionThreadStats": { + "description": "Timing statistics for a session thread.", "type": "object", "additionalProperties": false, "properties": { "duration_seconds": { - "description": "Elapsed time since session creation in seconds. For terminated sessions, frozen at the final update.", + "description": "Elapsed time since thread creation in seconds. For archived threads, frozen at the final update.", + "type": "number", + "format": "double" + }, + "startup_seconds": { + "description": "Time in seconds for the thread to begin running. Zero for child threads, which start immediately.", "type": "number", "format": "double" }, "active_seconds": { - "description": "Cumulative time in seconds the session spent in running status. Excludes idle time.", + "description": "Cumulative time in seconds the thread spent actively running. Excludes idle time.", "type": "number", "format": "double" } } }, - "BetaManagedAgentsSessionStatus": { + "BetaManagedAgentsSessionThreadStatus": { "type": "string", - "description": "SessionStatus enum", - "enum": ["rescheduling", "running", "idle", "terminated"] + "description": "SessionThreadStatus enum", + "enum": ["running", "idle", "rescheduling", "terminated"] }, - "BetaManagedAgentsSessionStatusIdleEvent": { - "description": "Indicates the agent has paused and is awaiting user input.", + "BetaManagedAgentsSessionThreadStatusIdleEvent": { + "description": "A session thread has yielded and is awaiting input. Emitted on the thread's own stream and cross-posted to the primary stream for child threads.", "type": "object", "additionalProperties": false, - "required": ["type", "id", "processed_at", "stop_reason"], + "required": ["type", "id", "session_thread_id", "processed_at", "agent_name", "stop_reason"], "properties": { - "type": { "type": "string", "enum": ["session.status_idle"] }, - "id": { "description": "Unique identifier for this event.", "type": "string" }, + "type": { + "type": "string", + "enum": ["session.thread_status_idle"], + "examples": ["session.thread_status_idle"] + }, + "id": { + "description": "Unique identifier for this event.", + "type": "string", + "examples": ["sevt_011CZkZXYc8qKly2tiZbrpDv"] + }, + "session_thread_id": { + "description": "Public sthr_ ID of the thread that went idle.", + "type": "string", + "examples": ["sthr_011CZkZVWa6oIjw0rgXZpnBt"] + }, "processed_at": { - "description": "Timestamp of status change.", - "allOf": [{ "$ref": "#/components/schemas/BetaTimestamp" }] + "description": "Timestamp of the status transition.", + "allOf": [{ "$ref": "#/components/schemas/BetaTimestamp" }], + "examples": ["2026-03-15T10:00:00Z"] + }, + "agent_name": { + "description": "Name of the agent the thread runs.", + "type": "string", + "examples": ["Researcher"] }, "stop_reason": { "type": "object", @@ -16486,49 +19381,128 @@ { "$ref": "#/components/schemas/BetaManagedAgentsSessionEndTurn" }, { "$ref": "#/components/schemas/BetaManagedAgentsSessionRequiresAction" }, { "$ref": "#/components/schemas/BetaManagedAgentsSessionRetriesExhausted" } - ] + ], + "examples": [{ "type": "end_turn" }] } + }, + "example": { + "type": "session.thread_status_idle", + "id": "sevt_011CZkZXYc8qKly2tiZbrpDv", + "session_thread_id": "sthr_011CZkZVWa6oIjw0rgXZpnBt", + "processed_at": "2026-03-15T10:00:00Z", + "agent_name": "Researcher", + "stop_reason": { "type": "end_turn" } + } + }, + "BetaManagedAgentsSessionThreadStatusRescheduledEvent": { + "description": "A session thread hit a transient error and is retrying automatically. Emitted on the thread's own stream and cross-posted to the primary stream for child threads.", + "type": "object", + "additionalProperties": false, + "required": ["type", "id", "session_thread_id", "processed_at", "agent_name"], + "properties": { + "type": { "type": "string", "enum": ["session.thread_status_rescheduled"] }, + "id": { "description": "Unique identifier for this event.", "type": "string" }, + "session_thread_id": { + "description": "Public sthr_ ID of the thread that is retrying.", + "type": "string" + }, + "processed_at": { + "description": "Timestamp of the status transition.", + "allOf": [{ "$ref": "#/components/schemas/BetaTimestamp" }] + }, + "agent_name": { "description": "Name of the agent the thread runs.", "type": "string" } } }, - "BetaManagedAgentsSessionStatusRescheduledEvent": { - "description": "Indicates the session is recovering from an error state and is rescheduled for execution.", + "BetaManagedAgentsSessionThreadStatusRunningEvent": { + "description": "A session thread has begun executing. Emitted on the thread's own stream and cross-posted to the primary stream for child threads.", "type": "object", "additionalProperties": false, - "required": ["type", "id", "processed_at"], + "required": ["type", "id", "session_thread_id", "processed_at", "agent_name"], "properties": { - "type": { "type": "string", "enum": ["session.status_rescheduled"] }, + "type": { "type": "string", "enum": ["session.thread_status_running"] }, "id": { "description": "Unique identifier for this event.", "type": "string" }, + "session_thread_id": { + "description": "Public sthr_ ID of the thread that started running.", + "type": "string" + }, "processed_at": { - "description": "Timestamp of status change.", + "description": "Timestamp of the status transition.", "allOf": [{ "$ref": "#/components/schemas/BetaTimestamp" }] - } + }, + "agent_name": { "description": "Name of the agent the thread runs.", "type": "string" } } }, - "BetaManagedAgentsSessionStatusRunningEvent": { - "description": "Indicates the session is actively running and the agent is working.", + "BetaManagedAgentsSessionThreadStatusTerminatedEvent": { + "description": "A session thread has terminated and will accept no further input. Emitted on the thread's own stream and cross-posted to the primary stream for child threads.", "type": "object", "additionalProperties": false, - "required": ["type", "id", "processed_at"], + "required": ["type", "id", "session_thread_id", "processed_at", "agent_name"], "properties": { - "type": { "type": "string", "enum": ["session.status_running"] }, + "type": { "type": "string", "enum": ["session.thread_status_terminated"] }, "id": { "description": "Unique identifier for this event.", "type": "string" }, + "session_thread_id": { + "description": "Public sthr_ ID of the thread that terminated.", + "type": "string" + }, "processed_at": { - "description": "Timestamp of status change.", + "description": "Timestamp of the status transition.", "allOf": [{ "$ref": "#/components/schemas/BetaTimestamp" }] + }, + "agent_name": { "description": "Name of the agent the thread runs.", "type": "string" } + } + }, + "BetaManagedAgentsSessionThreadUsage": { + "description": "Cumulative token usage for a session thread across all turns.", + "type": "object", + "additionalProperties": false, + "properties": { + "input_tokens": { + "description": "Total input tokens consumed across all turns.", + "type": "integer", + "format": "int32" + }, + "output_tokens": { + "description": "Total output tokens generated across all turns.", + "type": "integer", + "format": "int32" + }, + "cache_read_input_tokens": { + "description": "Total tokens read from prompt cache.", + "type": "integer", + "format": "int32" + }, + "cache_creation": { + "description": "Tokens used to create prompt cache entries, broken down by cache TTL.", + "allOf": [{ "$ref": "#/components/schemas/BetaManagedAgentsCacheCreationUsage" }] } } }, - "BetaManagedAgentsSessionStatusTerminatedEvent": { - "description": "Indicates the session has terminated, either due to an error or completion.", + "BetaManagedAgentsSessionUpdatedEvent": { + "description": "Emitted when an UpdateSession request changed at least one field. Carries only the fields that changed; absent fields were not part of the update. The new configuration applies from the next turn.", "type": "object", "additionalProperties": false, "required": ["type", "id", "processed_at"], "properties": { - "type": { "type": "string", "enum": ["session.status_terminated"] }, + "type": { "type": "string", "enum": ["session.updated"] }, "id": { "description": "Unique identifier for this event.", "type": "string" }, "processed_at": { - "description": "Timestamp of status change.", + "description": "Timestamp when the update was applied.", "allOf": [{ "$ref": "#/components/schemas/BetaTimestamp" }] + }, + "title": { + "description": "The session's new title. Present only when the update changed it.", + "type": "string", + "nullable": true + }, + "metadata": { + "description": "The session's full metadata bag after the update. Present when the update set non-empty metadata; absent when metadata was unchanged or cleared to empty.", + "type": "object", + "additionalProperties": { "type": "string" } + }, + "agent": { + "description": "The session's effective agent configuration after the update. Present only when the update changed `agent` (tools or mcp_servers); when present it is the full materialised snapshot, not a diff.", + "allOf": [{ "$ref": "#/components/schemas/BetaManagedAgentsSessionAgent" }], + "nullable": true } } }, @@ -16665,6 +19639,175 @@ } } }, + "BetaManagedAgentsSpanOutcomeEvaluationEndEvent": { + "description": "Emitted when an outcome evaluation cycle completes. Carries the verdict and aggregate token usage. A verdict of `needs_revision` means another evaluation cycle follows; `satisfied`, `max_iterations_reached`, `failed`, or `interrupted` are terminal — no further evaluation cycles follow.", + "type": "object", + "additionalProperties": false, + "required": [ + "type", + "id", + "processed_at", + "outcome_evaluation_start_id", + "iteration", + "result", + "explanation", + "usage", + "outcome_id" + ], + "properties": { + "type": { + "type": "string", + "enum": ["span.outcome_evaluation_end"], + "examples": ["span.outcome_evaluation_end"] + }, + "id": { + "description": "Unique identifier for this event.", + "type": "string", + "examples": ["sevt_011CZkZUVz5nHiv9qfWYomas"] + }, + "processed_at": { + "description": "Timestamp when outcome evaluation ended.", + "allOf": [{ "$ref": "#/components/schemas/BetaTimestamp" }], + "examples": ["2026-03-15T10:02:31Z"] + }, + "outcome_evaluation_start_id": { + "description": "The id of the corresponding `span.outcome_evaluation_start` event.", + "type": "string", + "examples": ["sevt_011CZkZTUy4mGhu8peVXnlzr"] + }, + "iteration": { + "description": "0-indexed revision cycle, matching the corresponding `span.outcome_evaluation_start`.", + "type": "integer", + "format": "int32", + "examples": [0] + }, + "result": { + "description": "Evaluation verdict. 'satisfied': criteria met, session goes idle. 'needs_revision': criteria not met, another revision cycle follows. 'max_iterations_reached': evaluation budget exhausted with criteria still unmet — one final acknowledgment turn follows before the session goes idle, but no further evaluation runs. 'failed': grader determined the rubric does not apply to the deliverables. 'interrupted': user sent an interrupt while evaluation was in progress.", + "type": "string", + "examples": ["satisfied"] + }, + "explanation": { + "description": "Human-readable explanation of the verdict. For `needs_revision`, describes which criteria failed and why.", + "type": "string", + "examples": ["All five sections present with inline citations."] + }, + "usage": { + "description": "Aggregate token usage for this evaluation cycle. Sums across all grader model requests within the cycle.", + "allOf": [{ "$ref": "#/components/schemas/BetaManagedAgentsSpanModelUsage" }], + "examples": [ + { + "input_tokens": 1842, + "output_tokens": 213, + "cache_creation_input_tokens": 0, + "cache_read_input_tokens": 1536 + } + ] + }, + "outcome_id": { + "description": "The `outc_` ID of the outcome being evaluated.", + "type": "string", + "examples": ["outc_011CZkZRSw2kEfs6ncTVljxP"] + } + }, + "example": { + "type": "span.outcome_evaluation_end", + "id": "sevt_011CZkZUVz5nHiv9qfWYomas", + "processed_at": "2026-03-15T10:02:31Z", + "outcome_evaluation_start_id": "sevt_011CZkZTUy4mGhu8peVXnlzr", + "iteration": 0, + "result": "satisfied", + "explanation": "All five sections present with inline citations.", + "usage": { + "input_tokens": 1842, + "output_tokens": 213, + "cache_creation_input_tokens": 0, + "cache_read_input_tokens": 1536 + }, + "outcome_id": "outc_011CZkZRSw2kEfs6ncTVljxP" + } + }, + "BetaManagedAgentsSpanOutcomeEvaluationOngoingEvent": { + "description": "Periodic heartbeat emitted while an outcome evaluation cycle is in progress. Distinguishes 'evaluation is actively running' from 'evaluation is stuck' between the corresponding `span.outcome_evaluation_start` and `span.outcome_evaluation_end` events.", + "type": "object", + "additionalProperties": false, + "required": ["type", "id", "processed_at", "iteration", "outcome_id"], + "properties": { + "type": { + "type": "string", + "enum": ["span.outcome_evaluation_ongoing"], + "examples": ["span.outcome_evaluation_ongoing"] + }, + "id": { + "description": "Unique identifier for this event.", + "type": "string", + "examples": ["sevt_011CZkZbCG2uOpc6xmDfvTzh"] + }, + "processed_at": { + "description": "Timestamp when this heartbeat was emitted.", + "allOf": [{ "$ref": "#/components/schemas/BetaTimestamp" }], + "examples": ["2026-03-15T10:02:14Z"] + }, + "iteration": { + "description": "0-indexed revision cycle, matching the corresponding `span.outcome_evaluation_start`.", + "type": "integer", + "format": "int32", + "examples": [0] + }, + "outcome_id": { + "description": "The `outc_` ID of the outcome being evaluated.", + "type": "string", + "examples": ["outc_011CZkZRSw2kEfs6ncTVljxP"] + } + }, + "example": { + "type": "span.outcome_evaluation_ongoing", + "id": "sevt_011CZkZbCG2uOpc6xmDfvTzh", + "processed_at": "2026-03-15T10:02:14Z", + "iteration": 0, + "outcome_id": "outc_011CZkZRSw2kEfs6ncTVljxP" + } + }, + "BetaManagedAgentsSpanOutcomeEvaluationStartEvent": { + "description": "Emitted when an outcome evaluation cycle begins.", + "type": "object", + "additionalProperties": false, + "required": ["type", "id", "processed_at", "iteration", "outcome_id"], + "properties": { + "type": { + "type": "string", + "enum": ["span.outcome_evaluation_start"], + "examples": ["span.outcome_evaluation_start"] + }, + "id": { + "description": "Unique identifier for this event.", + "type": "string", + "examples": ["sevt_011CZkZTUy4mGhu8peVXnlzr"] + }, + "processed_at": { + "description": "Timestamp when outcome evaluation started.", + "allOf": [{ "$ref": "#/components/schemas/BetaTimestamp" }], + "examples": ["2026-03-15T10:02:14Z"] + }, + "iteration": { + "description": "0-indexed revision cycle. 0 is the first evaluation; 1 is the re-evaluation after the first revision; etc.", + "type": "integer", + "format": "int32", + "examples": [0] + }, + "outcome_id": { + "description": "The `outc_` ID of the outcome being evaluated.", + "type": "string", + "examples": ["outc_011CZkZRSw2kEfs6ncTVljxP"] + } + }, + "example": { + "type": "span.outcome_evaluation_start", + "id": "sevt_011CZkZTUy4mGhu8peVXnlzr", + "processed_at": "2026-03-15T10:02:14Z", + "iteration": 0, + "outcome_id": "outc_011CZkZRSw2kEfs6ncTVljxP" + } + }, "BetaManagedAgentsSpeed": { "type": "string", "description": "Inference speed mode. `fast` provides significantly faster output token generation at premium pricing. Not all models support `fast`; invalid combinations are rejected at create time.", @@ -16749,15 +19892,105 @@ "agent.mcp_tool_result": "#/components/schemas/BetaManagedAgentsAgentMcpToolResultEvent", "agent.tool_use": "#/components/schemas/BetaManagedAgentsAgentToolUseEvent", "agent.tool_result": "#/components/schemas/BetaManagedAgentsAgentToolResultEvent", + "agent.thread_message_received": "#/components/schemas/BetaManagedAgentsAgentThreadMessageReceivedEvent", + "agent.thread_message_sent": "#/components/schemas/BetaManagedAgentsAgentThreadMessageSentEvent", + "agent.thread_context_compacted": "#/components/schemas/BetaManagedAgentsAgentThreadContextCompactedEvent", + "session.error": "#/components/schemas/BetaManagedAgentsSessionErrorEvent", + "session.status_rescheduled": "#/components/schemas/BetaManagedAgentsSessionStatusRescheduledEvent", + "session.status_running": "#/components/schemas/BetaManagedAgentsSessionStatusRunningEvent", + "session.status_idle": "#/components/schemas/BetaManagedAgentsSessionStatusIdleEvent", + "session.status_terminated": "#/components/schemas/BetaManagedAgentsSessionStatusTerminatedEvent", + "session.thread_created": "#/components/schemas/BetaManagedAgentsSessionThreadCreatedEvent", + "span.outcome_evaluation_start": "#/components/schemas/BetaManagedAgentsSpanOutcomeEvaluationStartEvent", + "span.outcome_evaluation_end": "#/components/schemas/BetaManagedAgentsSpanOutcomeEvaluationEndEvent", + "span.model_request_start": "#/components/schemas/BetaManagedAgentsSpanModelRequestStartEvent", + "span.model_request_end": "#/components/schemas/BetaManagedAgentsSpanModelRequestEndEvent", + "span.outcome_evaluation_ongoing": "#/components/schemas/BetaManagedAgentsSpanOutcomeEvaluationOngoingEvent", + "user.define_outcome": "#/components/schemas/BetaManagedAgentsUserDefineOutcomeEvent", + "session.deleted": "#/components/schemas/BetaManagedAgentsSessionDeletedEvent", + "session.thread_status_running": "#/components/schemas/BetaManagedAgentsSessionThreadStatusRunningEvent", + "session.thread_status_idle": "#/components/schemas/BetaManagedAgentsSessionThreadStatusIdleEvent", + "session.thread_status_terminated": "#/components/schemas/BetaManagedAgentsSessionThreadStatusTerminatedEvent", + "user.tool_result": "#/components/schemas/BetaManagedAgentsUserToolResultEvent", + "session.thread_status_rescheduled": "#/components/schemas/BetaManagedAgentsSessionThreadStatusRescheduledEvent", + "session.updated": "#/components/schemas/BetaManagedAgentsSessionUpdatedEvent" + } + }, + "oneOf": [ + { "$ref": "#/components/schemas/BetaManagedAgentsUserMessageEvent" }, + { "$ref": "#/components/schemas/BetaManagedAgentsUserInterruptEvent" }, + { "$ref": "#/components/schemas/BetaManagedAgentsUserToolConfirmationEvent" }, + { "$ref": "#/components/schemas/BetaManagedAgentsUserCustomToolResultEvent" }, + { "$ref": "#/components/schemas/BetaManagedAgentsAgentCustomToolUseEvent" }, + { "$ref": "#/components/schemas/BetaManagedAgentsAgentMessageEvent" }, + { "$ref": "#/components/schemas/BetaManagedAgentsAgentThinkingEvent" }, + { "$ref": "#/components/schemas/BetaManagedAgentsAgentMcpToolUseEvent" }, + { "$ref": "#/components/schemas/BetaManagedAgentsAgentMcpToolResultEvent" }, + { "$ref": "#/components/schemas/BetaManagedAgentsAgentToolUseEvent" }, + { "$ref": "#/components/schemas/BetaManagedAgentsAgentToolResultEvent" }, + { "$ref": "#/components/schemas/BetaManagedAgentsAgentThreadMessageReceivedEvent" }, + { "$ref": "#/components/schemas/BetaManagedAgentsAgentThreadMessageSentEvent" }, + { "$ref": "#/components/schemas/BetaManagedAgentsAgentThreadContextCompactedEvent" }, + { "$ref": "#/components/schemas/BetaManagedAgentsSessionErrorEvent" }, + { "$ref": "#/components/schemas/BetaManagedAgentsSessionStatusRescheduledEvent" }, + { "$ref": "#/components/schemas/BetaManagedAgentsSessionStatusRunningEvent" }, + { "$ref": "#/components/schemas/BetaManagedAgentsSessionStatusIdleEvent" }, + { "$ref": "#/components/schemas/BetaManagedAgentsSessionStatusTerminatedEvent" }, + { "$ref": "#/components/schemas/BetaManagedAgentsSessionThreadCreatedEvent" }, + { "$ref": "#/components/schemas/BetaManagedAgentsSpanOutcomeEvaluationStartEvent" }, + { "$ref": "#/components/schemas/BetaManagedAgentsSpanOutcomeEvaluationEndEvent" }, + { "$ref": "#/components/schemas/BetaManagedAgentsSpanModelRequestStartEvent" }, + { "$ref": "#/components/schemas/BetaManagedAgentsSpanModelRequestEndEvent" }, + { "$ref": "#/components/schemas/BetaManagedAgentsSpanOutcomeEvaluationOngoingEvent" }, + { "$ref": "#/components/schemas/BetaManagedAgentsUserDefineOutcomeEvent" }, + { "$ref": "#/components/schemas/BetaManagedAgentsSessionDeletedEvent" }, + { "$ref": "#/components/schemas/BetaManagedAgentsSessionThreadStatusRunningEvent" }, + { "$ref": "#/components/schemas/BetaManagedAgentsSessionThreadStatusIdleEvent" }, + { "$ref": "#/components/schemas/BetaManagedAgentsSessionThreadStatusTerminatedEvent" }, + { "$ref": "#/components/schemas/BetaManagedAgentsUserToolResultEvent" }, + { "$ref": "#/components/schemas/BetaManagedAgentsSessionThreadStatusRescheduledEvent" }, + { "$ref": "#/components/schemas/BetaManagedAgentsSessionUpdatedEvent" } + ] + }, + "BetaManagedAgentsStreamSessionThreadEvents": { + "description": "Server-sent event in a single thread's stream.", + "type": "object", + "discriminator": { + "propertyName": "type", + "mapping": { + "user.message": "#/components/schemas/BetaManagedAgentsUserMessageEvent", + "user.interrupt": "#/components/schemas/BetaManagedAgentsUserInterruptEvent", + "user.tool_confirmation": "#/components/schemas/BetaManagedAgentsUserToolConfirmationEvent", + "user.custom_tool_result": "#/components/schemas/BetaManagedAgentsUserCustomToolResultEvent", + "agent.custom_tool_use": "#/components/schemas/BetaManagedAgentsAgentCustomToolUseEvent", + "agent.message": "#/components/schemas/BetaManagedAgentsAgentMessageEvent", + "agent.thinking": "#/components/schemas/BetaManagedAgentsAgentThinkingEvent", + "agent.mcp_tool_use": "#/components/schemas/BetaManagedAgentsAgentMcpToolUseEvent", + "agent.mcp_tool_result": "#/components/schemas/BetaManagedAgentsAgentMcpToolResultEvent", + "agent.tool_use": "#/components/schemas/BetaManagedAgentsAgentToolUseEvent", + "agent.tool_result": "#/components/schemas/BetaManagedAgentsAgentToolResultEvent", + "agent.thread_message_received": "#/components/schemas/BetaManagedAgentsAgentThreadMessageReceivedEvent", + "agent.thread_message_sent": "#/components/schemas/BetaManagedAgentsAgentThreadMessageSentEvent", "agent.thread_context_compacted": "#/components/schemas/BetaManagedAgentsAgentThreadContextCompactedEvent", "session.error": "#/components/schemas/BetaManagedAgentsSessionErrorEvent", "session.status_rescheduled": "#/components/schemas/BetaManagedAgentsSessionStatusRescheduledEvent", "session.status_running": "#/components/schemas/BetaManagedAgentsSessionStatusRunningEvent", "session.status_idle": "#/components/schemas/BetaManagedAgentsSessionStatusIdleEvent", "session.status_terminated": "#/components/schemas/BetaManagedAgentsSessionStatusTerminatedEvent", + "session.thread_created": "#/components/schemas/BetaManagedAgentsSessionThreadCreatedEvent", + "span.outcome_evaluation_start": "#/components/schemas/BetaManagedAgentsSpanOutcomeEvaluationStartEvent", + "span.outcome_evaluation_end": "#/components/schemas/BetaManagedAgentsSpanOutcomeEvaluationEndEvent", "span.model_request_start": "#/components/schemas/BetaManagedAgentsSpanModelRequestStartEvent", "span.model_request_end": "#/components/schemas/BetaManagedAgentsSpanModelRequestEndEvent", - "session.deleted": "#/components/schemas/BetaManagedAgentsSessionDeletedEvent" + "span.outcome_evaluation_ongoing": "#/components/schemas/BetaManagedAgentsSpanOutcomeEvaluationOngoingEvent", + "user.define_outcome": "#/components/schemas/BetaManagedAgentsUserDefineOutcomeEvent", + "session.deleted": "#/components/schemas/BetaManagedAgentsSessionDeletedEvent", + "session.thread_status_running": "#/components/schemas/BetaManagedAgentsSessionThreadStatusRunningEvent", + "session.thread_status_idle": "#/components/schemas/BetaManagedAgentsSessionThreadStatusIdleEvent", + "session.thread_status_terminated": "#/components/schemas/BetaManagedAgentsSessionThreadStatusTerminatedEvent", + "user.tool_result": "#/components/schemas/BetaManagedAgentsUserToolResultEvent", + "session.thread_status_rescheduled": "#/components/schemas/BetaManagedAgentsSessionThreadStatusRescheduledEvent", + "session.updated": "#/components/schemas/BetaManagedAgentsSessionUpdatedEvent" } }, "oneOf": [ @@ -16772,15 +20005,28 @@ { "$ref": "#/components/schemas/BetaManagedAgentsAgentMcpToolResultEvent" }, { "$ref": "#/components/schemas/BetaManagedAgentsAgentToolUseEvent" }, { "$ref": "#/components/schemas/BetaManagedAgentsAgentToolResultEvent" }, + { "$ref": "#/components/schemas/BetaManagedAgentsAgentThreadMessageReceivedEvent" }, + { "$ref": "#/components/schemas/BetaManagedAgentsAgentThreadMessageSentEvent" }, { "$ref": "#/components/schemas/BetaManagedAgentsAgentThreadContextCompactedEvent" }, { "$ref": "#/components/schemas/BetaManagedAgentsSessionErrorEvent" }, { "$ref": "#/components/schemas/BetaManagedAgentsSessionStatusRescheduledEvent" }, { "$ref": "#/components/schemas/BetaManagedAgentsSessionStatusRunningEvent" }, { "$ref": "#/components/schemas/BetaManagedAgentsSessionStatusIdleEvent" }, { "$ref": "#/components/schemas/BetaManagedAgentsSessionStatusTerminatedEvent" }, + { "$ref": "#/components/schemas/BetaManagedAgentsSessionThreadCreatedEvent" }, + { "$ref": "#/components/schemas/BetaManagedAgentsSpanOutcomeEvaluationStartEvent" }, + { "$ref": "#/components/schemas/BetaManagedAgentsSpanOutcomeEvaluationEndEvent" }, { "$ref": "#/components/schemas/BetaManagedAgentsSpanModelRequestStartEvent" }, { "$ref": "#/components/schemas/BetaManagedAgentsSpanModelRequestEndEvent" }, - { "$ref": "#/components/schemas/BetaManagedAgentsSessionDeletedEvent" } + { "$ref": "#/components/schemas/BetaManagedAgentsSpanOutcomeEvaluationOngoingEvent" }, + { "$ref": "#/components/schemas/BetaManagedAgentsUserDefineOutcomeEvent" }, + { "$ref": "#/components/schemas/BetaManagedAgentsSessionDeletedEvent" }, + { "$ref": "#/components/schemas/BetaManagedAgentsSessionThreadStatusRunningEvent" }, + { "$ref": "#/components/schemas/BetaManagedAgentsSessionThreadStatusIdleEvent" }, + { "$ref": "#/components/schemas/BetaManagedAgentsSessionThreadStatusTerminatedEvent" }, + { "$ref": "#/components/schemas/BetaManagedAgentsUserToolResultEvent" }, + { "$ref": "#/components/schemas/BetaManagedAgentsSessionThreadStatusRescheduledEvent" }, + { "$ref": "#/components/schemas/BetaManagedAgentsSessionUpdatedEvent" } ] }, "BetaManagedAgentsStruct": { "type": "object", "additionalProperties": true }, @@ -16800,6 +20046,35 @@ }, "example": { "type": "text", "text": "Where is my order #1234?" } }, + "BetaManagedAgentsTextRubric": { + "description": "Rubric content provided inline as text.", + "type": "object", + "additionalProperties": false, + "required": ["type", "content"], + "properties": { + "type": { "type": "string", "enum": ["text"] }, + "content": { + "description": "Rubric content. Plain text or markdown — the grader treats it as freeform text.", + "type": "string" + } + } + }, + "BetaManagedAgentsTextRubricParams": { + "description": "Rubric content provided inline as text.", + "type": "object", + "additionalProperties": false, + "required": ["type", "content"], + "properties": { + "type": { "type": "string", "enum": ["text"], "examples": ["text"] }, + "content": { + "description": "Rubric content. Plain text or markdown — the grader treats it as freeform text. Maximum 262144 characters.", + "type": "string", + "maxLength": 262144, + "examples": ["Must cover all five sections; cite sources inline."] + } + }, + "example": { "type": "text", "content": "Must cover all five sections; cite sources inline." } + }, "BetaManagedAgentsTokenEndpointAuthBasicParam": { "description": "Token endpoint uses HTTP Basic authentication with client credentials.", "type": "object", @@ -16898,13 +20173,15 @@ "mapping": { "text": "#/components/schemas/BetaManagedAgentsTextBlock", "image": "#/components/schemas/BetaManagedAgentsImageBlock", - "document": "#/components/schemas/BetaManagedAgentsDocumentBlock" + "document": "#/components/schemas/BetaManagedAgentsDocumentBlock", + "search_result": "#/components/schemas/BetaManagedAgentsSearchResultBlock" } }, "oneOf": [ { "$ref": "#/components/schemas/BetaManagedAgentsTextBlock" }, { "$ref": "#/components/schemas/BetaManagedAgentsImageBlock" }, - { "$ref": "#/components/schemas/BetaManagedAgentsDocumentBlock" } + { "$ref": "#/components/schemas/BetaManagedAgentsDocumentBlock" }, + { "$ref": "#/components/schemas/BetaManagedAgentsSearchResultBlock" } ] }, "BetaManagedAgentsURLDocumentSource": { @@ -17027,6 +20304,11 @@ "type": "object", "additionalProperties": { "type": "string", "nullable": true }, "nullable": true + }, + "multiagent": { + "description": "Multiagent orchestration configuration. Full replacement. Omit to preserve; send null to clear.", + "allOf": [{ "$ref": "#/components/schemas/BetaManagedAgentsMultiagentParams" }], + "nullable": true } }, "example": { @@ -17140,6 +20422,10 @@ "description": "Vault IDs (`vlt_*`) to attach to the session. Not yet supported; requests setting this field are rejected. Reserved for future use.", "type": "array", "items": { "type": "string" } + }, + "agent": { + "description": "Agent configuration update. Only `tools` and `mcp_servers` are updatable mid-session. Only valid for sessions created from an agent or deployment reference. The session must not be running.", + "allOf": [{ "$ref": "#/components/schemas/BetaManagedAgentsSessionAgentUpdate" }] } }, "example": { "title": "Order #1234 inquiry" } @@ -17256,6 +20542,11 @@ "description": "Timestamp when this result was processed.", "allOf": [{ "$ref": "#/components/schemas/BetaTimestamp" }], "nullable": true + }, + "session_thread_id": { + "description": "Routes this result to a subagent thread. Copy from the `agent.custom_tool_use` event's `session_thread_id`.", + "type": "string", + "nullable": true } } }, @@ -17284,6 +20575,88 @@ } } }, + "BetaManagedAgentsUserDefineOutcomeEvent": { + "description": "Echo of a `user.define_outcome` input event. Carries the server-generated `outcome_id` that subsequent `span.outcome_evaluation_*` events reference.", + "type": "object", + "additionalProperties": false, + "required": ["type", "id", "processed_at", "outcome_id", "description", "max_iterations", "rubric"], + "properties": { + "type": { "type": "string", "enum": ["user.define_outcome"], "examples": ["user.define_outcome"] }, + "id": { + "description": "Unique identifier for this event.", + "type": "string", + "examples": ["sevt_011CZkZSTx3lFgt7odUWmkyq"] + }, + "processed_at": { + "description": "Timestamp when the outcome was accepted.", + "allOf": [{ "$ref": "#/components/schemas/BetaTimestamp" }], + "examples": ["2026-03-15T10:02:14Z"] + }, + "outcome_id": { + "description": "Server-generated `outc_` ID for this outcome. Referenced by `span.outcome_evaluation_*` events and the session's `outcome_evaluations` list.", + "type": "string", + "examples": ["outc_011CZkZRSw2kEfs6ncTVljxP"] + }, + "description": { + "description": "What the agent should produce. Copied from the input event.", + "type": "string", + "examples": ["Produce a 2-page summary as summary.md"] + }, + "max_iterations": { + "description": "Evaluate-then-revise cycles before giving up. Default 3, max 20.", + "type": "integer", + "format": "int32", + "nullable": true, + "examples": [3] + }, + "rubric": { + "description": "How to grade the outcome. File rubrics are currently resolved to their text content; clients should handle both variants.", + "allOf": [{ "$ref": "#/components/schemas/BetaManagedAgentsRubric" }], + "examples": [{ "type": "text", "content": "Must cover all five sections; cite sources inline." }] + } + }, + "example": { + "type": "user.define_outcome", + "id": "sevt_011CZkZSTx3lFgt7odUWmkyq", + "processed_at": "2026-03-15T10:02:14Z", + "outcome_id": "outc_011CZkZRSw2kEfs6ncTVljxP", + "description": "Produce a 2-page summary as summary.md", + "max_iterations": 3, + "rubric": { "type": "text", "content": "Must cover all five sections; cite sources inline." } + } + }, + "BetaManagedAgentsUserDefineOutcomeEventParams": { + "description": "Parameters for defining an outcome the agent should work toward. The agent begins work on receipt.", + "type": "object", + "additionalProperties": false, + "required": ["type", "description", "rubric"], + "properties": { + "type": { "type": "string", "enum": ["user.define_outcome"], "examples": ["user.define_outcome"] }, + "description": { + "description": "What the agent should produce. This is the task specification.", + "type": "string", + "examples": ["Produce a 2-page summary as summary.md"] + }, + "rubric": { + "description": "How to grade the outcome. Text or file reference.", + "allOf": [{ "$ref": "#/components/schemas/BetaManagedAgentsRubricParams" }], + "examples": [{ "type": "text", "content": "Must cover all five sections; cite sources inline." }] + }, + "max_iterations": { + "description": "Eval→revision cycles before giving up. Default 3, max 20.", + "type": "integer", + "format": "int32", + "nullable": true, + "examples": [3] + } + }, + "example": { + "type": "user.define_outcome", + "description": "Produce a 2-page summary as summary.md", + "rubric": { "type": "text", "content": "Must cover all five sections; cite sources inline." }, + "max_iterations": 3 + } + }, "BetaManagedAgentsUserInterruptEvent": { "description": "An interrupt event that pauses agent execution and returns control to the user.", "type": "object", @@ -17296,6 +20669,11 @@ "description": "Timestamp when the interrupt was processed.", "allOf": [{ "$ref": "#/components/schemas/BetaTimestamp" }], "nullable": true + }, + "session_thread_id": { + "description": "If absent, interrupts every non-archived thread in a multiagent session (or the primary alone in a single-agent session). If present, interrupts only the named thread.", + "type": "string", + "nullable": true } } }, @@ -17304,7 +20682,14 @@ "type": "object", "additionalProperties": false, "required": ["type"], - "properties": { "type": { "type": "string", "enum": ["user.interrupt"] } } + "properties": { + "type": { "type": "string", "enum": ["user.interrupt"] }, + "session_thread_id": { + "description": "If absent, interrupts every non-archived thread in a multiagent session (or the primary alone in a single-agent session). If present, interrupts only the named thread.", + "type": "string", + "nullable": true + } + } }, "BetaManagedAgentsUserMessageEvent": { "description": "A user message event in the session conversation.", @@ -17383,6 +20768,11 @@ "description": "Timestamp when the confirmation was processed.", "allOf": [{ "$ref": "#/components/schemas/BetaTimestamp" }], "nullable": true + }, + "session_thread_id": { + "description": "When set, the confirmation routes to this subagent's thread rather than the primary. Echo this from the `session_thread_id` on the `agent.tool_use` or `agent.mcp_tool_use` event that prompted the approval.", + "type": "string", + "nullable": true } } }, @@ -17416,6 +20806,65 @@ "description": "UserToolConfirmationResult enum", "enum": ["allow", "deny"] }, + "BetaManagedAgentsUserToolResultEvent": { + "description": "Event sent by the client providing the result of an agent-toolset tool execution. Only valid on `self_hosted` environments, where sandbox-routed tools are executed by the client rather than the server.", + "type": "object", + "additionalProperties": false, + "required": ["type", "id", "tool_use_id"], + "properties": { + "type": { "type": "string", "enum": ["user.tool_result"] }, + "id": { "description": "Unique identifier for this event.", "type": "string" }, + "tool_use_id": { + "description": "The id of the `agent.tool_use` event this result corresponds to, which can be found in the last `session.status_idle` [event's](https://platform.claude.com/docs/en/api/beta/sessions/events/list#beta_managed_agents_session_requires_action.event_ids) `stop_reason.event_ids` field.", + "type": "string" + }, + "content": { + "description": "The result content returned by the tool.", + "type": "array", + "items": { "$ref": "#/components/schemas/BetaManagedAgentsToolResultContentBlock" } + }, + "is_error": { + "description": "Whether the tool execution resulted in an error.", + "type": "boolean", + "nullable": true + }, + "processed_at": { + "description": "Timestamp when this result was processed.", + "allOf": [{ "$ref": "#/components/schemas/BetaTimestamp" }], + "nullable": true + }, + "session_thread_id": { + "description": "Routes this result to a subagent thread. Copy from the `agent.tool_use` event's `session_thread_id`.", + "type": "string", + "nullable": true + } + } + }, + "BetaManagedAgentsUserToolResultEventParams": { + "description": "Parameters for providing the result of an agent-toolset tool execution. Only valid on `self_hosted` environments, where sandbox-routed tools are executed by the client rather than the server.", + "type": "object", + "additionalProperties": false, + "required": ["type", "tool_use_id"], + "properties": { + "type": { "type": "string", "enum": ["user.tool_result"] }, + "tool_use_id": { + "description": "The id of the `agent.tool_use` event this result corresponds to, which can be found in the last `session.status_idle` [event's](https://platform.claude.com/docs/en/api/beta/sessions/events/list#beta_managed_agents_session_requires_action.event_ids) `stop_reason.event_ids` field.", + "type": "string", + "minLength": 1, + "maxLength": 128 + }, + "content": { + "description": "The result content returned by the tool.", + "type": "array", + "items": { "$ref": "#/components/schemas/BetaManagedAgentsToolResultContentBlock" } + }, + "is_error": { + "description": "Whether the tool execution resulted in an error.", + "type": "boolean", + "nullable": true + } + } + }, "BetaManagedAgentsVault": { "description": "A vault that stores credentials for use by agents during sessions.", "type": "object", @@ -17580,6 +21029,11 @@ "description": "Billing and rate-limit usage.\n\nAnthropic's API bills and rate-limits by token counts, as tokens represent the underlying cost to our systems.\n\nUnder the hood, the API transforms requests into a format suitable for the model. The model's output then goes through a parsing stage before becoming an API response. As a result, the token counts in `usage` will not match one-to-one with the exact visible content of an API request or response.\n\nFor example, `output_tokens` will be non-zero, even for an empty string response from Claude.\n\nTotal input tokens in a request is the summation of `input_tokens`, `cache_creation_input_tokens`, and `cache_read_input_tokens`.", "examples": [{ "input_tokens": 2095, "output_tokens": 503 }] }, + "diagnostics": { + "anyOf": [{ "$ref": "#/components/schemas/BetaDiagnostics" }, { "type": "null" }], + "default": null, + "description": "Request-level diagnostics. Present only when `diagnostics` was supplied on the request; `null` when no prompt-cache divergence was detected." + }, "context_management": { "anyOf": [{ "$ref": "#/components/schemas/BetaResponseContextManagement" }, { "type": "null" }], "default": null, @@ -17601,6 +21055,7 @@ "stop_sequence", "stop_details", "usage", + "diagnostics", "context_management", "container" ], @@ -18226,10 +21681,16 @@ "config": { "anyOf": [ { - "oneOf": [{ "$ref": "#/components/schemas/BetaCloudConfigParams" }], + "oneOf": [ + { "$ref": "#/components/schemas/BetaCloudConfigParams" }, + { "$ref": "#/components/schemas/BetaSelfHostedConfigParams" } + ], "discriminator": { "propertyName": "type", - "mapping": { "cloud": "#/components/schemas/BetaCloudConfigParams" } + "mapping": { + "cloud": "#/components/schemas/BetaCloudConfigParams", + "self_hosted": "#/components/schemas/BetaSelfHostedConfigParams" + } } }, { "type": "null" } @@ -18267,6 +21728,11 @@ "title": "Name", "description": "Human-readable name for the environment", "examples": ["python-data-analysis"] + }, + "scope": { + "anyOf": [{ "type": "string", "enum": ["organization", "account"] }, { "type": "null" }], + "title": "Scope", + "description": "The visibility scope for this environment. 'organization' makes the environment visible to all accounts. 'account' restricts visibility to the owning account only. Only applicable for self-hosted environments. If not specified, defaults based on organization type." } }, "additionalProperties": false, @@ -18293,10 +21759,16 @@ "config": { "anyOf": [ { - "oneOf": [{ "$ref": "#/components/schemas/BetaCloudConfigParams" }], + "oneOf": [ + { "$ref": "#/components/schemas/BetaCloudConfigParams" }, + { "$ref": "#/components/schemas/BetaSelfHostedConfigParams" } + ], "discriminator": { "propertyName": "type", - "mapping": { "cloud": "#/components/schemas/BetaCloudConfigParams" } + "mapping": { + "cloud": "#/components/schemas/BetaCloudConfigParams", + "self_hosted": "#/components/schemas/BetaSelfHostedConfigParams" + } } }, { "type": "null" } @@ -18320,6 +21792,11 @@ "anyOf": [{ "type": "string", "maxLength": 256, "minLength": 1 }, { "type": "null" }], "title": "Name", "description": "Updated name for the environment" + }, + "scope": { + "anyOf": [{ "type": "string", "enum": ["organization", "account"] }, { "type": "null" }], + "title": "Scope", + "description": "The visibility scope for this environment. 'organization' makes the environment visible to all accounts. 'account' restricts visibility to the owning account only." } }, "additionalProperties": false, @@ -18631,7 +22108,7 @@ }, "type": { "const": "compaction", "title": "Type", "type": "string" } }, - "required": ["content", "type"], + "required": ["type"], "title": "RequestCompactionBlock", "type": "object" }, @@ -18663,14 +22140,27 @@ "BetaRequestContentBlockLocationCitation": { "additionalProperties": false, "properties": { - "cited_text": { "title": "Cited Text", "type": "string" }, + "cited_text": { + "description": "The full text of the cited block range, concatenated.\n\nAlways equals the contents of `content[start_block_index:end_block_index]` joined together. The text block is the minimal citable unit; this field is never a substring of a single block. Not counted toward output tokens, and not counted toward input tokens when sent back in subsequent turns.", + "title": "Cited Text", + "type": "string" + }, "document_index": { "minimum": 0, "title": "Document Index", "type": "integer" }, "document_title": { "anyOf": [{ "maxLength": 255, "minLength": 1, "type": "string" }, { "type": "null" }], "title": "Document Title" }, - "end_block_index": { "title": "End Block Index", "type": "integer" }, - "start_block_index": { "minimum": 0, "title": "Start Block Index", "type": "integer" }, + "end_block_index": { + "description": "Exclusive 0-based end index of the cited block range in the source's `content` array.\n\nAlways greater than `start_block_index`; a single-block citation has `end_block_index = start_block_index + 1`.", + "title": "End Block Index", + "type": "integer" + }, + "start_block_index": { + "description": "0-based index of the first cited block in the source's `content` array.", + "minimum": 0, + "title": "Start Block Index", + "type": "integer" + }, "type": { "const": "content_block_location", "title": "Type", "type": "string" } }, "required": [ @@ -19008,11 +22498,29 @@ "BetaRequestSearchResultLocationCitation": { "additionalProperties": false, "properties": { - "cited_text": { "title": "Cited Text", "type": "string" }, - "end_block_index": { "title": "End Block Index", "type": "integer" }, - "search_result_index": { "minimum": 0, "title": "Search Result Index", "type": "integer" }, + "cited_text": { + "description": "The full text of the cited block range, concatenated.\n\nAlways equals the contents of `content[start_block_index:end_block_index]` joined together. The text block is the minimal citable unit; this field is never a substring of a single block. Not counted toward output tokens, and not counted toward input tokens when sent back in subsequent turns.", + "title": "Cited Text", + "type": "string" + }, + "end_block_index": { + "description": "Exclusive 0-based end index of the cited block range in the source's `content` array.\n\nAlways greater than `start_block_index`; a single-block citation has `end_block_index = start_block_index + 1`.", + "title": "End Block Index", + "type": "integer" + }, + "search_result_index": { + "description": "0-based index of the cited search result among all `search_result` content blocks in the request, in the order they appear across messages and tool results.\n\nCounted separately from `document_index`; server-side web search results are not included in this count.", + "minimum": 0, + "title": "Search Result Index", + "type": "integer" + }, "source": { "title": "Source", "type": "string" }, - "start_block_index": { "minimum": 0, "title": "Start Block Index", "type": "integer" }, + "start_block_index": { + "description": "0-based index of the first cited block in the source's `content` array.", + "minimum": 0, + "title": "Start Block Index", + "type": "integer" + }, "title": { "anyOf": [{ "type": "string" }, { "type": "null" }], "title": "Title" }, "type": { "const": "search_result_location", "title": "Type", "type": "string" } }, @@ -19925,19 +23433,32 @@ }, "BetaResponseContentBlockLocationCitation": { "properties": { - "cited_text": { "title": "Cited Text", "type": "string" }, + "cited_text": { + "description": "The full text of the cited block range, concatenated.\n\nAlways equals the contents of `content[start_block_index:end_block_index]` joined together. The text block is the minimal citable unit; this field is never a substring of a single block. Not counted toward output tokens, and not counted toward input tokens when sent back in subsequent turns.", + "title": "Cited Text", + "type": "string" + }, "document_index": { "minimum": 0, "title": "Document Index", "type": "integer" }, "document_title": { "anyOf": [{ "type": "string" }, { "type": "null" }], "title": "Document Title" }, - "end_block_index": { "title": "End Block Index", "type": "integer" }, + "end_block_index": { + "description": "Exclusive 0-based end index of the cited block range in the source's `content` array.\n\nAlways greater than `start_block_index`; a single-block citation has `end_block_index = start_block_index + 1`.", + "title": "End Block Index", + "type": "integer" + }, "file_id": { "anyOf": [{ "type": "string" }, { "type": "null" }], "default": null, "title": "File Id" }, - "start_block_index": { "minimum": 0, "title": "Start Block Index", "type": "integer" }, + "start_block_index": { + "description": "0-based index of the first cited block in the source's `content` array.", + "minimum": 0, + "title": "Start Block Index", + "type": "integer" + }, "type": { "const": "content_block_location", "default": "content_block_location", @@ -20127,11 +23648,29 @@ }, "BetaResponseSearchResultLocationCitation": { "properties": { - "cited_text": { "title": "Cited Text", "type": "string" }, - "end_block_index": { "title": "End Block Index", "type": "integer" }, - "search_result_index": { "minimum": 0, "title": "Search Result Index", "type": "integer" }, + "cited_text": { + "description": "The full text of the cited block range, concatenated.\n\nAlways equals the contents of `content[start_block_index:end_block_index]` joined together. The text block is the minimal citable unit; this field is never a substring of a single block. Not counted toward output tokens, and not counted toward input tokens when sent back in subsequent turns.", + "title": "Cited Text", + "type": "string" + }, + "end_block_index": { + "description": "Exclusive 0-based end index of the cited block range in the source's `content` array.\n\nAlways greater than `start_block_index`; a single-block citation has `end_block_index = start_block_index + 1`.", + "title": "End Block Index", + "type": "integer" + }, + "search_result_index": { + "description": "0-based index of the cited search result among all `search_result` content blocks in the request, in the order they appear across messages and tool results.\n\nCounted separately from `document_index`; server-side web search results are not included in this count.", + "minimum": 0, + "title": "Search Result Index", + "type": "integer" + }, "source": { "title": "Source", "type": "string" }, - "start_block_index": { "minimum": 0, "title": "Start Block Index", "type": "integer" }, + "start_block_index": { + "description": "0-based index of the first cited block in the source's `content` array.", + "minimum": 0, + "title": "Start Block Index", + "type": "integer" + }, "title": { "anyOf": [{ "type": "string" }, { "type": "null" }], "title": "Title" }, "type": { "const": "search_result_location", @@ -20552,95 +24091,325 @@ "encrypted_content": { "title": "Encrypted Content", "type": "string" }, "page_age": { "anyOf": [{ "type": "string" }, { "type": "null" }], - "default": null, - "title": "Page Age" + "default": null, + "title": "Page Age" + }, + "title": { "title": "Title", "type": "string" }, + "type": { + "const": "web_search_result", + "default": "web_search_result", + "title": "Type", + "type": "string" + }, + "url": { "title": "Url", "type": "string" } + }, + "required": ["encrypted_content", "page_age", "title", "type", "url"], + "title": "ResponseWebSearchResultBlock", + "type": "object" + }, + "BetaResponseWebSearchResultLocationCitation": { + "properties": { + "cited_text": { "title": "Cited Text", "type": "string" }, + "encrypted_index": { "title": "Encrypted Index", "type": "string" }, + "title": { + "anyOf": [{ "maxLength": 512, "type": "string" }, { "type": "null" }], + "title": "Title" + }, + "type": { + "const": "web_search_result_location", + "default": "web_search_result_location", + "title": "Type", + "type": "string" + }, + "url": { "title": "Url", "type": "string" } + }, + "required": ["cited_text", "encrypted_index", "title", "type", "url"], + "title": "ResponseWebSearchResultLocationCitation", + "type": "object" + }, + "BetaResponseWebSearchToolResultBlock": { + "properties": { + "caller": { + "discriminator": { + "mapping": { + "code_execution_20250825": "#/components/schemas/BetaServerToolCaller", + "code_execution_20260120": "#/components/schemas/BetaServerToolCaller_20260120", + "direct": "#/components/schemas/BetaDirectCaller" + }, + "propertyName": "type" + }, + "oneOf": [ + { "$ref": "#/components/schemas/BetaDirectCaller" }, + { "$ref": "#/components/schemas/BetaServerToolCaller" }, + { "$ref": "#/components/schemas/BetaServerToolCaller_20260120" } + ], + "title": "Caller" + }, + "content": { + "anyOf": [ + { "$ref": "#/components/schemas/BetaResponseWebSearchToolResultError" }, + { + "items": { "$ref": "#/components/schemas/BetaResponseWebSearchResultBlock" }, + "type": "array" + } + ], + "title": "Content" + }, + "tool_use_id": { "pattern": "^srvtoolu_[a-zA-Z0-9_]+$", "title": "Tool Use Id", "type": "string" }, + "type": { + "const": "web_search_tool_result", + "default": "web_search_tool_result", + "title": "Type", + "type": "string" + } + }, + "required": ["content", "tool_use_id", "type"], + "title": "ResponseWebSearchToolResultBlock", + "type": "object" + }, + "BetaResponseWebSearchToolResultError": { + "properties": { + "error_code": { "$ref": "#/components/schemas/BetaWebSearchToolResultErrorCode" }, + "type": { + "const": "web_search_tool_result_error", + "default": "web_search_tool_result_error", + "title": "Type", + "type": "string" + } + }, + "required": ["error_code", "type"], + "title": "ResponseWebSearchToolResultError", + "type": "object" + }, + "BetaSelfHostedConfig": { + "properties": { + "type": { + "type": "string", + "const": "self_hosted", + "title": "Type", + "description": "Environment type" + } + }, + "additionalProperties": false, + "type": "object", + "required": ["type"], + "title": "SelfHostedConfig", + "description": "Configuration for self-hosted environments." + }, + "BetaSelfHostedConfigParams": { + "properties": { + "type": { + "type": "string", + "const": "self_hosted", + "title": "Type", + "description": "Environment type" + } + }, + "additionalProperties": false, + "type": "object", + "required": ["type"], + "title": "SelfHostedConfigParams", + "description": "Request params for `self_hosted` environment configuration." + }, + "BetaSelfHostedWork": { + "properties": { + "acknowledged_at": { + "anyOf": [{ "type": "string" }, { "type": "null" }], + "title": "Acknowledged At", + "description": "RFC 3339 timestamp when the work item was acknowledged and assigned to a self-hosted sandbox" + }, + "created_at": { + "type": "string", + "title": "Created At", + "description": "RFC 3339 timestamp when work was created" + }, + "data": { + "$ref": "#/components/schemas/BetaSessionWorkData", + "description": "The actual work to be performed" + }, + "environment_id": { + "type": "string", + "title": "Environment Id", + "description": "Environment identifier this work belongs to (e.g., `env_...`)" + }, + "id": { "type": "string", "title": "Id", "description": "Work identifier (e.g., 'work_...')" }, + "latest_heartbeat_at": { + "anyOf": [{ "type": "string" }, { "type": "null" }], + "title": "Latest Heartbeat At", + "description": "RFC 3339 timestamp of the most recent heartbeat" + }, + "metadata": { + "additionalProperties": { "type": "string" }, + "type": "object", + "title": "Metadata", + "description": "User-provided metadata key-value pairs associated with this work item" + }, + "started_at": { + "anyOf": [{ "type": "string" }, { "type": "null" }], + "title": "Started At", + "description": "RFC 3339 timestamp when work execution started" + }, + "state": { + "type": "string", + "enum": ["queued", "starting", "active", "stopping", "stopped"], + "title": "State", + "description": "Current state of the work item" + }, + "stop_requested_at": { + "anyOf": [{ "type": "string" }, { "type": "null" }], + "title": "Stop Requested At", + "description": "RFC 3339 timestamp when stop was requested" + }, + "stopped_at": { + "anyOf": [{ "type": "string" }, { "type": "null" }], + "title": "Stopped At", + "description": "RFC 3339 timestamp when work execution stopped" }, - "title": { "title": "Title", "type": "string" }, "type": { - "const": "web_search_result", - "default": "web_search_result", + "type": "string", + "const": "work", "title": "Type", - "type": "string" - }, - "url": { "title": "Url", "type": "string" } + "description": "The type of object (always 'work')", + "default": "work" + } }, - "required": ["encrypted_content", "page_age", "title", "type", "url"], - "title": "ResponseWebSearchResultBlock", - "type": "object" + "type": "object", + "required": [ + "acknowledged_at", + "created_at", + "data", + "environment_id", + "id", + "latest_heartbeat_at", + "metadata", + "started_at", + "state", + "stop_requested_at", + "stopped_at", + "type" + ], + "title": "SelfHostedWork", + "description": "Work resource representing a unit of work in a self-hosted environment.\n\nWork items are queued when sessions are created or when long-dormant sessions\nreceive new messages. The environment worker polls for work to execute in a\nself-hosted sandbox." }, - "BetaResponseWebSearchResultLocationCitation": { + "BetaSelfHostedWorkHeartbeatResponse": { "properties": { - "cited_text": { "title": "Cited Text", "type": "string" }, - "encrypted_index": { "title": "Encrypted Index", "type": "string" }, - "title": { - "anyOf": [{ "maxLength": 512, "type": "string" }, { "type": "null" }], - "title": "Title" + "last_heartbeat": { + "type": "string", + "title": "Last Heartbeat", + "description": "RFC 3339 timestamp of the actual heartbeat from DB" + }, + "lease_extended": { + "type": "boolean", + "title": "Lease Extended", + "description": "Whether the heartbeat succeeded in extending the lease" + }, + "state": { + "type": "string", + "enum": ["queued", "starting", "active", "stopping", "stopped"], + "title": "State", + "description": "Current state of the work item (active/stopping/stopped)" + }, + "ttl_seconds": { + "type": "integer", + "title": "Ttl Seconds", + "description": "Effective TTL applied to the lease" }, "type": { - "const": "web_search_result_location", - "default": "web_search_result_location", + "type": "string", + "const": "work_heartbeat", "title": "Type", - "type": "string" + "description": "The type of response", + "default": "work_heartbeat" + } + }, + "type": "object", + "required": ["last_heartbeat", "lease_extended", "state", "ttl_seconds", "type"], + "title": "SelfHostedWorkHeartbeatResponse", + "description": "Response after recording a heartbeat for a work item." + }, + "BetaSelfHostedWorkListResponse": { + "properties": { + "data": { + "items": { "$ref": "#/components/schemas/BetaSelfHostedWork" }, + "type": "array", + "title": "Data", + "description": "List of work items", + "x-stainless-pagination-property": { "purpose": "items" } }, - "url": { "title": "Url", "type": "string" } + "next_page": { + "anyOf": [{ "type": "string" }, { "type": "null" }], + "title": "Next Page", + "description": "Opaque cursor for fetching the next page of results", + "x-stainless-pagination-property": { "purpose": "next_cursor_field" } + } }, - "required": ["cited_text", "encrypted_index", "title", "type", "url"], - "title": "ResponseWebSearchResultLocationCitation", - "type": "object" + "type": "object", + "required": ["data", "next_page"], + "title": "SelfHostedWorkListResponse", + "description": "Response when listing work items with cursor-based pagination." }, - "BetaResponseWebSearchToolResultBlock": { + "BetaSelfHostedWorkQueueStats": { "properties": { - "caller": { - "discriminator": { - "mapping": { - "code_execution_20250825": "#/components/schemas/BetaServerToolCaller", - "code_execution_20260120": "#/components/schemas/BetaServerToolCaller_20260120", - "direct": "#/components/schemas/BetaDirectCaller" - }, - "propertyName": "type" - }, - "oneOf": [ - { "$ref": "#/components/schemas/BetaDirectCaller" }, - { "$ref": "#/components/schemas/BetaServerToolCaller" }, - { "$ref": "#/components/schemas/BetaServerToolCaller_20260120" } - ], - "title": "Caller" + "depth": { + "type": "integer", + "title": "Depth", + "description": "Number of work items waiting to be picked up (lag from consumer group)" }, - "content": { - "anyOf": [ - { "$ref": "#/components/schemas/BetaResponseWebSearchToolResultError" }, - { - "items": { "$ref": "#/components/schemas/BetaResponseWebSearchResultBlock" }, - "type": "array" - } - ], - "title": "Content" + "oldest_queued_at": { + "anyOf": [{ "type": "string" }, { "type": "null" }], + "title": "Oldest Queued At", + "description": "RFC 3339 timestamp of oldest item in the work stream (includes both queued and pending items), null if stream empty" + }, + "pending": { + "type": "integer", + "title": "Pending", + "description": "Number of work items being processed (polled but not acknowledged)", + "default": 0 }, - "tool_use_id": { "pattern": "^srvtoolu_[a-zA-Z0-9_]+$", "title": "Tool Use Id", "type": "string" }, "type": { - "const": "web_search_tool_result", - "default": "web_search_tool_result", + "type": "string", + "const": "work_queue_stats", "title": "Type", - "type": "string" + "description": "The type of object", + "default": "work_queue_stats" + }, + "workers_polling": { + "anyOf": [{ "type": "integer" }, { "type": "null" }], + "title": "Workers Polling", + "description": "Number of workers that have polled for work in the last 30 seconds. Requires worker_id to be sent with poll requests." } }, - "required": ["content", "tool_use_id", "type"], - "title": "ResponseWebSearchToolResultBlock", - "type": "object" + "type": "object", + "required": ["depth", "oldest_queued_at", "pending", "type", "workers_polling"], + "title": "SelfHostedWorkQueueStats", + "description": "Statistics about the work queue for an environment.\n\nUses Redis Stream consumer group metrics for O(1) queries." }, - "BetaResponseWebSearchToolResultError": { + "BetaSelfHostedWorkStopRequest": { "properties": { - "error_code": { "$ref": "#/components/schemas/BetaWebSearchToolResultErrorCode" }, - "type": { - "const": "web_search_tool_result_error", - "default": "web_search_tool_result_error", - "title": "Type", - "type": "string" + "force": { + "type": "boolean", + "title": "Force", + "description": "If true, immediately stop work without graceful shutdown", + "default": false } }, - "required": ["error_code", "type"], - "title": "ResponseWebSearchToolResultError", - "type": "object" + "type": "object", + "title": "SelfHostedWorkStopRequest", + "description": "Request to stop a work item." + }, + "BetaSelfHostedWorkUpdateRequest": { + "properties": { + "metadata": { + "additionalProperties": { "anyOf": [{ "type": "string" }, { "type": "null" }] }, + "type": "object", + "title": "Metadata", + "description": "Metadata patch. Set a key to a string to upsert it, or to null to delete it. Omit the field to preserve existing metadata." + } + }, + "type": "object", + "required": ["metadata"], + "title": "SelfHostedWorkUpdateRequest", + "description": "Request to update work item metadata." }, "BetaServerToolCaller": { "additionalProperties": false, @@ -20686,6 +24455,25 @@ "title": "ServerToolUsage", "type": "object" }, + "BetaSessionWorkData": { + "properties": { + "id": { + "type": "string", + "title": "Id", + "description": "Session identifier (e.g., 'session_...')" + }, + "type": { + "type": "string", + "const": "session", + "title": "Type", + "description": "Type of work data" + } + }, + "type": "object", + "required": ["id", "type"], + "title": "SessionWorkData", + "description": "Work data for session work items.\n\nThis resource type is used when work represents a session that needs to be executed\nin a self-hosted environment." + }, "BetaSignatureContentBlockDelta": { "properties": { "signature": { "title": "Signature", "type": "string" }, @@ -21504,6 +25292,18 @@ "description": "Key-value pairs to merge into the stored metadata. Keys provided overwrite existing values. To remove a key, set its value to an empty string. Keys not provided are left unchanged. Maximum 16 keys, with keys up to 64 characters and values up to 512 characters.", "type": "object", "additionalProperties": { "type": "string" } + }, + "name": { + "description": "If present, replaces the stored name. Omit to leave unchanged. Maximum 255 characters.", + "type": "string", + "minLength": 1, + "maxLength": 255, + "nullable": true + }, + "relationship": { + "description": "If present, replaces the stored relationship. Omit to leave unchanged.", + "allOf": [{ "$ref": "#/components/schemas/BetaUserProfileRelationship" }], + "nullable": true } }, "example": { "external_id": "user_12345" } @@ -21618,7 +25418,7 @@ "BetaUserProfile": { "type": "object", "additionalProperties": false, - "required": ["id", "type", "trust_grants", "created_at", "metadata", "updated_at"], + "required": ["id", "type", "relationship", "trust_grants", "created_at", "metadata", "updated_at"], "properties": { "id": { "description": "Unique identifier for this user profile, prefixed `uprof_`.", @@ -21637,6 +25437,17 @@ "nullable": true, "examples": ["user_12345"] }, + "name": { + "description": "Display name of the entity this profile represents. For `resold` this is the resold-to company's name.", + "type": "string", + "nullable": true, + "examples": ["Example User"] + }, + "relationship": { + "description": "How the entity relates to the platform. `external` (default), `resold`, or `internal`.", + "allOf": [{ "$ref": "#/components/schemas/BetaUserProfileRelationship" }], + "examples": ["external"] + }, "trust_grants": { "description": "Trust grants for this profile, keyed by grant name. Key omitted when no grant is active or in flight.", "type": "object", @@ -21664,6 +25475,8 @@ "id": "uprof_011CZkZCu8hGbp5mYRQgUmz9", "type": "user_profile", "external_id": "user_12345", + "name": "Example User", + "relationship": "external", "trust_grants": { "cyber": { "status": "active" } }, "metadata": {}, "created_at": "2026-03-15T10:00:00Z", @@ -21675,6 +25488,11 @@ "description": "ListOrder enum", "enum": ["asc", "desc"] }, + "BetaUserProfileRelationship": { + "type": "string", + "description": "How the entity behind a user profile relates to the platform that owns the API key. `external`: an individual end-user of the platform. `resold`: a company the platform resells Claude access to. `internal`: the platform's own usage.", + "enum": ["external", "resold", "internal"] + }, "BetaUserProfileTrustGrant": { "type": "object", "additionalProperties": false, @@ -21683,8 +25501,8 @@ "status": { "description": "Status of the trust grant.", "type": "string", - "enum": ["active", "pending", "rejected"], - "examples": ["active"] + "examples": ["active"], + "enum": ["active", "pending", "rejected"] } }, "example": { "status": "active" } @@ -22051,6 +25869,376 @@ "title": "WebSearchTool_20260209", "type": "object" }, + "BetaWebhookEvent": { + "type": "object", + "title": "BetaWebhookEvent", + "required": ["type", "id", "created_at", "data"], + "properties": { + "type": { + "type": "string", + "const": "event", + "description": "Object type. Always `event` for webhook payloads.", + "examples": ["event"] + }, + "id": { + "type": "string", + "description": "Unique event identifier for idempotency.", + "examples": ["wevt_011CZkZYZd9rLmz3ujAcsqEw"] + }, + "created_at": { + "type": "string", + "format": "date-time", + "description": "RFC 3339 timestamp when the event occurred.", + "examples": ["2026-03-15T10:00:00Z"] + }, + "data": { + "$ref": "#/components/schemas/BetaWebhookEventData", + "examples": [ + { + "type": "session.status_idled", + "id": "sesn_011CZkZAtmR3yMPDzynEDxu7", + "organization_id": "org_011CZkZZAe0sMna4vkBdtrfx", + "workspace_id": "wrkspc_011CZkZaBF1tNoB5wlCeusgy" + } + ] + } + }, + "example": { + "type": "event", + "id": "wevt_011CZkZYZd9rLmz3ujAcsqEw", + "created_at": "2026-03-15T10:00:00Z", + "data": { + "type": "session.status_idled", + "id": "sesn_011CZkZAtmR3yMPDzynEDxu7", + "organization_id": "org_011CZkZZAe0sMna4vkBdtrfx", + "workspace_id": "wrkspc_011CZkZaBF1tNoB5wlCeusgy" + } + } + }, + "BetaWebhookEventData": { + "title": "BetaWebhookEventData", + "oneOf": [ + { "$ref": "#/components/schemas/BetaWebhookSessionCreatedEventData" }, + { "$ref": "#/components/schemas/BetaWebhookSessionPendingEventData" }, + { "$ref": "#/components/schemas/BetaWebhookSessionRunningEventData" }, + { "$ref": "#/components/schemas/BetaWebhookSessionIdledEventData" }, + { "$ref": "#/components/schemas/BetaWebhookSessionRequiresActionEventData" }, + { "$ref": "#/components/schemas/BetaWebhookSessionArchivedEventData" }, + { "$ref": "#/components/schemas/BetaWebhookSessionDeletedEventData" }, + { "$ref": "#/components/schemas/BetaWebhookSessionStatusRescheduledEventData" }, + { "$ref": "#/components/schemas/BetaWebhookSessionStatusRunStartedEventData" }, + { "$ref": "#/components/schemas/BetaWebhookSessionStatusIdledEventData" }, + { "$ref": "#/components/schemas/BetaWebhookSessionStatusTerminatedEventData" }, + { "$ref": "#/components/schemas/BetaWebhookSessionThreadCreatedEventData" }, + { "$ref": "#/components/schemas/BetaWebhookSessionThreadIdledEventData" }, + { "$ref": "#/components/schemas/BetaWebhookSessionThreadTerminatedEventData" }, + { "$ref": "#/components/schemas/BetaWebhookSessionOutcomeEvaluationEndedEventData" }, + { "$ref": "#/components/schemas/BetaWebhookVaultCreatedEventData" }, + { "$ref": "#/components/schemas/BetaWebhookVaultArchivedEventData" }, + { "$ref": "#/components/schemas/BetaWebhookVaultDeletedEventData" }, + { "$ref": "#/components/schemas/BetaWebhookVaultCredentialCreatedEventData" }, + { "$ref": "#/components/schemas/BetaWebhookVaultCredentialArchivedEventData" }, + { "$ref": "#/components/schemas/BetaWebhookVaultCredentialDeletedEventData" }, + { "$ref": "#/components/schemas/BetaWebhookVaultCredentialRefreshFailedEventData" } + ], + "discriminator": { + "propertyName": "type", + "mapping": { + "session.created": "#/components/schemas/BetaWebhookSessionCreatedEventData", + "session.pending": "#/components/schemas/BetaWebhookSessionPendingEventData", + "session.running": "#/components/schemas/BetaWebhookSessionRunningEventData", + "session.idled": "#/components/schemas/BetaWebhookSessionIdledEventData", + "session.requires_action": "#/components/schemas/BetaWebhookSessionRequiresActionEventData", + "session.archived": "#/components/schemas/BetaWebhookSessionArchivedEventData", + "session.deleted": "#/components/schemas/BetaWebhookSessionDeletedEventData", + "session.status_rescheduled": "#/components/schemas/BetaWebhookSessionStatusRescheduledEventData", + "session.status_run_started": "#/components/schemas/BetaWebhookSessionStatusRunStartedEventData", + "session.status_idled": "#/components/schemas/BetaWebhookSessionStatusIdledEventData", + "session.status_terminated": "#/components/schemas/BetaWebhookSessionStatusTerminatedEventData", + "session.thread_created": "#/components/schemas/BetaWebhookSessionThreadCreatedEventData", + "session.thread_idled": "#/components/schemas/BetaWebhookSessionThreadIdledEventData", + "session.thread_terminated": "#/components/schemas/BetaWebhookSessionThreadTerminatedEventData", + "session.outcome_evaluation_ended": "#/components/schemas/BetaWebhookSessionOutcomeEvaluationEndedEventData", + "vault.created": "#/components/schemas/BetaWebhookVaultCreatedEventData", + "vault.archived": "#/components/schemas/BetaWebhookVaultArchivedEventData", + "vault.deleted": "#/components/schemas/BetaWebhookVaultDeletedEventData", + "vault_credential.created": "#/components/schemas/BetaWebhookVaultCredentialCreatedEventData", + "vault_credential.archived": "#/components/schemas/BetaWebhookVaultCredentialArchivedEventData", + "vault_credential.deleted": "#/components/schemas/BetaWebhookVaultCredentialDeletedEventData", + "vault_credential.refresh_failed": "#/components/schemas/BetaWebhookVaultCredentialRefreshFailedEventData" + } + } + }, + "BetaWebhookSessionArchivedEventData": { + "type": "object", + "title": "BetaWebhookSessionArchivedEventData", + "required": ["type", "id", "organization_id", "workspace_id"], + "properties": { + "type": { "type": "string", "const": "session.archived" }, + "id": { "type": "string", "description": "ID of the resource that triggered the event." }, + "organization_id": { "type": "string" }, + "workspace_id": { "type": "string" } + } + }, + "BetaWebhookSessionCreatedEventData": { + "type": "object", + "title": "BetaWebhookSessionCreatedEventData", + "required": ["type", "id", "organization_id", "workspace_id"], + "properties": { + "type": { "type": "string", "const": "session.created" }, + "id": { "type": "string", "description": "ID of the resource that triggered the event." }, + "organization_id": { "type": "string" }, + "workspace_id": { "type": "string" } + } + }, + "BetaWebhookSessionDeletedEventData": { + "type": "object", + "title": "BetaWebhookSessionDeletedEventData", + "required": ["type", "id", "organization_id", "workspace_id"], + "properties": { + "type": { "type": "string", "const": "session.deleted" }, + "id": { "type": "string", "description": "ID of the resource that triggered the event." }, + "organization_id": { "type": "string" }, + "workspace_id": { "type": "string" } + } + }, + "BetaWebhookSessionIdledEventData": { + "type": "object", + "title": "BetaWebhookSessionIdledEventData", + "required": ["type", "id", "organization_id", "workspace_id"], + "properties": { + "type": { "type": "string", "const": "session.idled" }, + "id": { "type": "string", "description": "ID of the resource that triggered the event." }, + "organization_id": { "type": "string" }, + "workspace_id": { "type": "string" } + } + }, + "BetaWebhookSessionOutcomeEvaluationEndedEventData": { + "type": "object", + "title": "BetaWebhookSessionOutcomeEvaluationEndedEventData", + "required": ["type", "id", "organization_id", "workspace_id"], + "properties": { + "type": { + "type": "string", + "const": "session.outcome_evaluation_ended", + "examples": ["session.outcome_evaluation_ended"] + }, + "id": { + "type": "string", + "description": "ID of the resource that triggered the event.", + "examples": ["sesn_011CZkZAtmR3yMPDzynEDxu7"] + }, + "organization_id": { "type": "string", "examples": ["org_011CZkZZAe0sMna4vkBdtrfx"] }, + "workspace_id": { "type": "string", "examples": ["wrkspc_011CZkZaBF1tNoB5wlCeusgy"] } + }, + "example": { + "type": "session.outcome_evaluation_ended", + "id": "sesn_011CZkZAtmR3yMPDzynEDxu7", + "organization_id": "org_011CZkZZAe0sMna4vkBdtrfx", + "workspace_id": "wrkspc_011CZkZaBF1tNoB5wlCeusgy" + } + }, + "BetaWebhookSessionPendingEventData": { + "type": "object", + "title": "BetaWebhookSessionPendingEventData", + "required": ["type", "id", "organization_id", "workspace_id"], + "properties": { + "type": { "type": "string", "const": "session.pending" }, + "id": { "type": "string", "description": "ID of the resource that triggered the event." }, + "organization_id": { "type": "string" }, + "workspace_id": { "type": "string" } + } + }, + "BetaWebhookSessionRequiresActionEventData": { + "type": "object", + "title": "BetaWebhookSessionRequiresActionEventData", + "required": ["type", "id", "organization_id", "workspace_id"], + "properties": { + "type": { "type": "string", "const": "session.requires_action" }, + "id": { "type": "string", "description": "ID of the resource that triggered the event." }, + "organization_id": { "type": "string" }, + "workspace_id": { "type": "string" } + } + }, + "BetaWebhookSessionRunningEventData": { + "type": "object", + "title": "BetaWebhookSessionRunningEventData", + "required": ["type", "id", "organization_id", "workspace_id"], + "properties": { + "type": { "type": "string", "const": "session.running" }, + "id": { "type": "string", "description": "ID of the resource that triggered the event." }, + "organization_id": { "type": "string" }, + "workspace_id": { "type": "string" } + } + }, + "BetaWebhookSessionStatusIdledEventData": { + "type": "object", + "title": "BetaWebhookSessionStatusIdledEventData", + "required": ["type", "id", "organization_id", "workspace_id"], + "properties": { + "type": { "type": "string", "const": "session.status_idled", "examples": ["session.status_idled"] }, + "id": { + "type": "string", + "description": "ID of the resource that triggered the event.", + "examples": ["sesn_011CZkZAtmR3yMPDzynEDxu7"] + }, + "organization_id": { "type": "string", "examples": ["org_011CZkZZAe0sMna4vkBdtrfx"] }, + "workspace_id": { "type": "string", "examples": ["wrkspc_011CZkZaBF1tNoB5wlCeusgy"] } + }, + "example": { + "type": "session.status_idled", + "id": "sesn_011CZkZAtmR3yMPDzynEDxu7", + "organization_id": "org_011CZkZZAe0sMna4vkBdtrfx", + "workspace_id": "wrkspc_011CZkZaBF1tNoB5wlCeusgy" + } + }, + "BetaWebhookSessionStatusRescheduledEventData": { + "type": "object", + "title": "BetaWebhookSessionStatusRescheduledEventData", + "required": ["type", "id", "organization_id", "workspace_id"], + "properties": { + "type": { "type": "string", "const": "session.status_rescheduled" }, + "id": { "type": "string", "description": "ID of the resource that triggered the event." }, + "organization_id": { "type": "string" }, + "workspace_id": { "type": "string" } + } + }, + "BetaWebhookSessionStatusRunStartedEventData": { + "type": "object", + "title": "BetaWebhookSessionStatusRunStartedEventData", + "required": ["type", "id", "organization_id", "workspace_id"], + "properties": { + "type": { "type": "string", "const": "session.status_run_started" }, + "id": { "type": "string", "description": "ID of the resource that triggered the event." }, + "organization_id": { "type": "string" }, + "workspace_id": { "type": "string" } + } + }, + "BetaWebhookSessionStatusTerminatedEventData": { + "type": "object", + "title": "BetaWebhookSessionStatusTerminatedEventData", + "required": ["type", "id", "organization_id", "workspace_id"], + "properties": { + "type": { "type": "string", "const": "session.status_terminated" }, + "id": { "type": "string", "description": "ID of the resource that triggered the event." }, + "organization_id": { "type": "string" }, + "workspace_id": { "type": "string" } + } + }, + "BetaWebhookSessionThreadCreatedEventData": { + "type": "object", + "title": "BetaWebhookSessionThreadCreatedEventData", + "required": ["type", "id", "organization_id", "workspace_id"], + "properties": { + "type": { "type": "string", "const": "session.thread_created" }, + "id": { "type": "string", "description": "ID of the resource that triggered the event." }, + "organization_id": { "type": "string" }, + "workspace_id": { "type": "string" } + } + }, + "BetaWebhookSessionThreadIdledEventData": { + "type": "object", + "title": "BetaWebhookSessionThreadIdledEventData", + "required": ["type", "id", "organization_id", "workspace_id"], + "properties": { + "type": { "type": "string", "const": "session.thread_idled" }, + "id": { "type": "string", "description": "ID of the resource that triggered the event." }, + "organization_id": { "type": "string" }, + "workspace_id": { "type": "string" } + } + }, + "BetaWebhookSessionThreadTerminatedEventData": { + "type": "object", + "title": "BetaWebhookSessionThreadTerminatedEventData", + "required": ["type", "id", "organization_id", "workspace_id"], + "properties": { + "type": { "type": "string", "const": "session.thread_terminated" }, + "id": { "type": "string", "description": "ID of the resource that triggered the event." }, + "organization_id": { "type": "string" }, + "workspace_id": { "type": "string" } + } + }, + "BetaWebhookVaultArchivedEventData": { + "type": "object", + "title": "BetaWebhookVaultArchivedEventData", + "required": ["type", "id", "organization_id", "workspace_id"], + "properties": { + "type": { "type": "string", "const": "vault.archived" }, + "id": { "type": "string", "description": "ID of the resource that triggered the event." }, + "organization_id": { "type": "string" }, + "workspace_id": { "type": "string" } + } + }, + "BetaWebhookVaultCreatedEventData": { + "type": "object", + "title": "BetaWebhookVaultCreatedEventData", + "required": ["type", "id", "organization_id", "workspace_id"], + "properties": { + "type": { "type": "string", "const": "vault.created" }, + "id": { "type": "string", "description": "ID of the resource that triggered the event." }, + "organization_id": { "type": "string" }, + "workspace_id": { "type": "string" } + } + }, + "BetaWebhookVaultCredentialArchivedEventData": { + "type": "object", + "title": "BetaWebhookVaultCredentialArchivedEventData", + "required": ["type", "id", "organization_id", "workspace_id", "vault_id"], + "properties": { + "type": { "type": "string", "const": "vault_credential.archived" }, + "id": { "type": "string", "description": "ID of the resource that triggered the event." }, + "organization_id": { "type": "string" }, + "workspace_id": { "type": "string" }, + "vault_id": { "type": "string", "description": "ID of the vault that owns this credential." } + } + }, + "BetaWebhookVaultCredentialCreatedEventData": { + "type": "object", + "title": "BetaWebhookVaultCredentialCreatedEventData", + "required": ["type", "id", "organization_id", "workspace_id", "vault_id"], + "properties": { + "type": { "type": "string", "const": "vault_credential.created" }, + "id": { "type": "string", "description": "ID of the resource that triggered the event." }, + "organization_id": { "type": "string" }, + "workspace_id": { "type": "string" }, + "vault_id": { "type": "string", "description": "ID of the vault that owns this credential." } + } + }, + "BetaWebhookVaultCredentialDeletedEventData": { + "type": "object", + "title": "BetaWebhookVaultCredentialDeletedEventData", + "required": ["type", "id", "organization_id", "workspace_id", "vault_id"], + "properties": { + "type": { "type": "string", "const": "vault_credential.deleted" }, + "id": { "type": "string", "description": "ID of the resource that triggered the event." }, + "organization_id": { "type": "string" }, + "workspace_id": { "type": "string" }, + "vault_id": { "type": "string", "description": "ID of the vault that owns this credential." } + } + }, + "BetaWebhookVaultCredentialRefreshFailedEventData": { + "type": "object", + "title": "BetaWebhookVaultCredentialRefreshFailedEventData", + "required": ["type", "id", "organization_id", "workspace_id", "vault_id"], + "properties": { + "type": { "type": "string", "const": "vault_credential.refresh_failed" }, + "id": { "type": "string", "description": "ID of the resource that triggered the event." }, + "organization_id": { "type": "string" }, + "workspace_id": { "type": "string" }, + "vault_id": { "type": "string", "description": "ID of the vault that owns this credential." } + } + }, + "BetaWebhookVaultDeletedEventData": { + "type": "object", + "title": "BetaWebhookVaultDeletedEventData", + "required": ["type", "id", "organization_id", "workspace_id"], + "properties": { + "type": { "type": "string", "const": "vault.deleted" }, + "id": { "type": "string", "description": "ID of the resource that triggered the event." }, + "organization_id": { "type": "string" }, + "workspace_id": { "type": "string" } + } + }, "Betaapi__schemas__skills__Skill": { "properties": { "created_at": { @@ -24022,14 +28210,27 @@ "RequestContentBlockLocationCitation": { "additionalProperties": false, "properties": { - "cited_text": { "title": "Cited Text", "type": "string" }, + "cited_text": { + "description": "The full text of the cited block range, concatenated.\n\nAlways equals the contents of `content[start_block_index:end_block_index]` joined together. The text block is the minimal citable unit; this field is never a substring of a single block. Not counted toward output tokens, and not counted toward input tokens when sent back in subsequent turns.", + "title": "Cited Text", + "type": "string" + }, "document_index": { "minimum": 0, "title": "Document Index", "type": "integer" }, "document_title": { "anyOf": [{ "maxLength": 255, "minLength": 1, "type": "string" }, { "type": "null" }], "title": "Document Title" }, - "end_block_index": { "title": "End Block Index", "type": "integer" }, - "start_block_index": { "minimum": 0, "title": "Start Block Index", "type": "integer" }, + "end_block_index": { + "description": "Exclusive 0-based end index of the cited block range in the source's `content` array.\n\nAlways greater than `start_block_index`; a single-block citation has `end_block_index = start_block_index + 1`.", + "title": "End Block Index", + "type": "integer" + }, + "start_block_index": { + "description": "0-based index of the first cited block in the source's `content` array.", + "minimum": 0, + "title": "Start Block Index", + "type": "integer" + }, "type": { "const": "content_block_location", "title": "Type", "type": "string" } }, "required": [ @@ -24260,11 +28461,29 @@ "RequestSearchResultLocationCitation": { "additionalProperties": false, "properties": { - "cited_text": { "title": "Cited Text", "type": "string" }, - "end_block_index": { "title": "End Block Index", "type": "integer" }, - "search_result_index": { "minimum": 0, "title": "Search Result Index", "type": "integer" }, + "cited_text": { + "description": "The full text of the cited block range, concatenated.\n\nAlways equals the contents of `content[start_block_index:end_block_index]` joined together. The text block is the minimal citable unit; this field is never a substring of a single block. Not counted toward output tokens, and not counted toward input tokens when sent back in subsequent turns.", + "title": "Cited Text", + "type": "string" + }, + "end_block_index": { + "description": "Exclusive 0-based end index of the cited block range in the source's `content` array.\n\nAlways greater than `start_block_index`; a single-block citation has `end_block_index = start_block_index + 1`.", + "title": "End Block Index", + "type": "integer" + }, + "search_result_index": { + "description": "0-based index of the cited search result among all `search_result` content blocks in the request, in the order they appear across messages and tool results.\n\nCounted separately from `document_index`; server-side web search results are not included in this count.", + "minimum": 0, + "title": "Search Result Index", + "type": "integer" + }, "source": { "title": "Source", "type": "string" }, - "start_block_index": { "minimum": 0, "title": "Start Block Index", "type": "integer" }, + "start_block_index": { + "description": "0-based index of the first cited block in the source's `content` array.", + "minimum": 0, + "title": "Start Block Index", + "type": "integer" + }, "title": { "anyOf": [{ "type": "string" }, { "type": "null" }], "title": "Title" }, "type": { "const": "search_result_location", "title": "Type", "type": "string" } }, @@ -25036,19 +29255,32 @@ }, "ResponseContentBlockLocationCitation": { "properties": { - "cited_text": { "title": "Cited Text", "type": "string" }, + "cited_text": { + "description": "The full text of the cited block range, concatenated.\n\nAlways equals the contents of `content[start_block_index:end_block_index]` joined together. The text block is the minimal citable unit; this field is never a substring of a single block. Not counted toward output tokens, and not counted toward input tokens when sent back in subsequent turns.", + "title": "Cited Text", + "type": "string" + }, "document_index": { "minimum": 0, "title": "Document Index", "type": "integer" }, "document_title": { "anyOf": [{ "type": "string" }, { "type": "null" }], "title": "Document Title" }, - "end_block_index": { "title": "End Block Index", "type": "integer" }, + "end_block_index": { + "description": "Exclusive 0-based end index of the cited block range in the source's `content` array.\n\nAlways greater than `start_block_index`; a single-block citation has `end_block_index = start_block_index + 1`.", + "title": "End Block Index", + "type": "integer" + }, "file_id": { "anyOf": [{ "type": "string" }, { "type": "null" }], "default": null, "title": "File Id" }, - "start_block_index": { "minimum": 0, "title": "Start Block Index", "type": "integer" }, + "start_block_index": { + "description": "0-based index of the first cited block in the source's `content` array.", + "minimum": 0, + "title": "Start Block Index", + "type": "integer" + }, "type": { "const": "content_block_location", "default": "content_block_location", @@ -25168,11 +29400,29 @@ }, "ResponseSearchResultLocationCitation": { "properties": { - "cited_text": { "title": "Cited Text", "type": "string" }, - "end_block_index": { "title": "End Block Index", "type": "integer" }, - "search_result_index": { "minimum": 0, "title": "Search Result Index", "type": "integer" }, + "cited_text": { + "description": "The full text of the cited block range, concatenated.\n\nAlways equals the contents of `content[start_block_index:end_block_index]` joined together. The text block is the minimal citable unit; this field is never a substring of a single block. Not counted toward output tokens, and not counted toward input tokens when sent back in subsequent turns.", + "title": "Cited Text", + "type": "string" + }, + "end_block_index": { + "description": "Exclusive 0-based end index of the cited block range in the source's `content` array.\n\nAlways greater than `start_block_index`; a single-block citation has `end_block_index = start_block_index + 1`.", + "title": "End Block Index", + "type": "integer" + }, + "search_result_index": { + "description": "0-based index of the cited search result among all `search_result` content blocks in the request, in the order they appear across messages and tool results.\n\nCounted separately from `document_index`; server-side web search results are not included in this count.", + "minimum": 0, + "title": "Search Result Index", + "type": "integer" + }, "source": { "title": "Source", "type": "string" }, - "start_block_index": { "minimum": 0, "title": "Start Block Index", "type": "integer" }, + "start_block_index": { + "description": "0-based index of the first cited block in the source's `content` array.", + "minimum": 0, + "title": "Start Block Index", + "type": "integer" + }, "title": { "anyOf": [{ "type": "string" }, { "type": "null" }], "title": "Title" }, "type": { "const": "search_result_location", @@ -25903,7 +30153,7 @@ }, "input_examples": { "items": { - "additionalProperties": { "$ref": "#/components/schemas/JsonValue", "type": "unknown" }, + "additionalProperties": { "$ref": "#/components/schemas/JsonValue" }, "type": "object" }, "title": "Input Examples", @@ -26971,7 +31221,9 @@ "fast-mode-2026-02-01", "output-300k-2026-03-24", "user-profiles-2026-03-24", - "advisor-tool-2026-03-01" + "advisor-tool-2026-03-01", + "managed-agents-2026-04-01", + "cache-diagnosis-2026-04-07" ], "x-stainless-nominal": false } @@ -27600,6 +31852,96 @@ } } }, + "BetaManagedAgentsAgentToolset20260401_BashInput": { + "type": "object", + "additionalProperties": false, + "description": "Input payload for the `bash` tool of the\n`agent_toolset_20260401` toolset. All fields are optional;\na normal invocation supplies `command`, while `restart=true`\n(with no `command`) reboots the runner-side bash session.\n", + "properties": { + "command": { + "type": "string", + "description": "Shell command to execute. Omit only when `restart` is true." + }, + "restart": { + "type": "boolean", + "description": "When true, restart the persistent bash session instead of\nrunning a command. Subsequent calls without `restart` will\nrun against the fresh session.\n" + }, + "timeout_ms": { + "type": "integer", + "minimum": 0, + "description": "Per-call timeout in milliseconds. Defaults to the\nrunner-wide tool timeout when omitted or zero.\n" + } + } + }, + "BetaManagedAgentsAgentToolset20260401_ReadInput": { + "type": "object", + "additionalProperties": false, + "required": ["file_path"], + "description": "Input payload for the `read` tool. Reads file contents\nrelative to the runner's working directory (or absolute when\nthe runner permits).\n", + "properties": { + "file_path": { "type": "string", "description": "Path of the file to read." }, + "view_range": { + "type": "array", + "items": { "type": "integer" }, + "minItems": 2, + "maxItems": 2, + "description": "Optional `[start_line, end_line]` 1-indexed inclusive\nrange. When omitted the entire file is returned.\n`end_line` of 0 or negative means \"to end of file\".\n" + } + } + }, + "BetaManagedAgentsAgentToolset20260401_WriteInput": { + "type": "object", + "additionalProperties": false, + "required": ["file_path", "content"], + "description": "Input payload for the `write` tool. Writes (overwriting) the\nentire file contents.\n", + "properties": { + "file_path": { "type": "string", "description": "Path of the file to write." }, + "content": { "type": "string", "description": "Full file contents to write." } + } + }, + "BetaManagedAgentsAgentToolset20260401_EditInput": { + "type": "object", + "additionalProperties": false, + "required": ["file_path", "old_string", "new_string"], + "description": "Input payload for the `edit` tool. Performs a string\nreplacement in the named file; by default `old_string` must\noccur exactly once.\n", + "properties": { + "file_path": { "type": "string", "description": "Path of the file to edit." }, + "old_string": { "type": "string", "description": "Substring to find and replace." }, + "new_string": { "type": "string", "description": "Replacement text." }, + "replace_all": { + "type": "boolean", + "description": "When true, replace every occurrence of `old_string`\ninstead of requiring a unique match.\n" + } + } + }, + "BetaManagedAgentsAgentToolset20260401_GlobInput": { + "type": "object", + "additionalProperties": false, + "required": ["pattern"], + "description": "Input payload for the `glob` tool. Returns paths matching a\ndoublestar glob pattern, newest first.\n", + "properties": { + "pattern": { + "type": "string", + "description": "Doublestar glob pattern (e.g. `**/*.go`). Absolute patterns\nare only permitted when the runner is configured to allow\nthem.\n" + }, + "path": { + "type": "string", + "description": "Optional directory root to search under. Defaults to the\nrunner's working directory.\n" + } + } + }, + "BetaManagedAgentsAgentToolset20260401_GrepInput": { + "type": "object", + "additionalProperties": false, + "required": ["pattern"], + "description": "Input payload for the `grep` tool. Searches file contents for\na regular expression, returning matching lines.\n", + "properties": { + "pattern": { "type": "string", "description": "Regular expression to search for." }, + "path": { + "type": "string", + "description": "Optional directory root to search under. Defaults to the\nrunner's working directory.\n" + } + } + }, "BetaIterationsUsage": { "anyOf": [ { @@ -27632,5 +31974,249 @@ } } }, - "servers": [{ "url": "https://api.anthropic.com" }] + "servers": [{ "url": "https://api.anthropic.com" }], + "webhooks": { + "session.created": { + "post": { + "operationId": "BetaSessionCreatedWebhook", + "summary": "session.created webhook", + "requestBody": { + "required": true, + "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BetaWebhookEvent" } } } + }, + "responses": { "200": { "description": "Return any 2xx status to acknowledge receipt." } } + } + }, + "session.pending": { + "post": { + "operationId": "BetaSessionPendingWebhook", + "summary": "session.pending webhook", + "requestBody": { + "required": true, + "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BetaWebhookEvent" } } } + }, + "responses": { "200": { "description": "Return any 2xx status to acknowledge receipt." } } + } + }, + "session.running": { + "post": { + "operationId": "BetaSessionRunningWebhook", + "summary": "session.running webhook", + "requestBody": { + "required": true, + "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BetaWebhookEvent" } } } + }, + "responses": { "200": { "description": "Return any 2xx status to acknowledge receipt." } } + } + }, + "session.idled": { + "post": { + "operationId": "BetaSessionIdledWebhook", + "summary": "session.idled webhook", + "requestBody": { + "required": true, + "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BetaWebhookEvent" } } } + }, + "responses": { "200": { "description": "Return any 2xx status to acknowledge receipt." } } + } + }, + "session.requires_action": { + "post": { + "operationId": "BetaSessionRequiresActionWebhook", + "summary": "session.requires_action webhook", + "requestBody": { + "required": true, + "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BetaWebhookEvent" } } } + }, + "responses": { "200": { "description": "Return any 2xx status to acknowledge receipt." } } + } + }, + "session.archived": { + "post": { + "operationId": "BetaSessionArchivedWebhook", + "summary": "session.archived webhook", + "requestBody": { + "required": true, + "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BetaWebhookEvent" } } } + }, + "responses": { "200": { "description": "Return any 2xx status to acknowledge receipt." } } + } + }, + "session.deleted": { + "post": { + "operationId": "BetaSessionDeletedWebhook", + "summary": "session.deleted webhook", + "requestBody": { + "required": true, + "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BetaWebhookEvent" } } } + }, + "responses": { "200": { "description": "Return any 2xx status to acknowledge receipt." } } + } + }, + "session.status_rescheduled": { + "post": { + "operationId": "BetaSessionStatusRescheduledWebhook", + "summary": "session.status_rescheduled webhook", + "requestBody": { + "required": true, + "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BetaWebhookEvent" } } } + }, + "responses": { "200": { "description": "Return any 2xx status to acknowledge receipt." } } + } + }, + "session.status_run_started": { + "post": { + "operationId": "BetaSessionStatusRunStartedWebhook", + "summary": "session.status_run_started webhook", + "requestBody": { + "required": true, + "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BetaWebhookEvent" } } } + }, + "responses": { "200": { "description": "Return any 2xx status to acknowledge receipt." } } + } + }, + "session.status_idled": { + "post": { + "operationId": "BetaSessionStatusIdledWebhook", + "summary": "session.status_idled webhook", + "requestBody": { + "required": true, + "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BetaWebhookEvent" } } } + }, + "responses": { "200": { "description": "Return any 2xx status to acknowledge receipt." } } + } + }, + "session.status_terminated": { + "post": { + "operationId": "BetaSessionStatusTerminatedWebhook", + "summary": "session.status_terminated webhook", + "requestBody": { + "required": true, + "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BetaWebhookEvent" } } } + }, + "responses": { "200": { "description": "Return any 2xx status to acknowledge receipt." } } + } + }, + "session.thread_created": { + "post": { + "operationId": "BetaSessionThreadCreatedWebhook", + "summary": "session.thread_created webhook", + "requestBody": { + "required": true, + "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BetaWebhookEvent" } } } + }, + "responses": { "200": { "description": "Return any 2xx status to acknowledge receipt." } } + } + }, + "session.thread_idled": { + "post": { + "operationId": "BetaSessionThreadIdledWebhook", + "summary": "session.thread_idled webhook", + "requestBody": { + "required": true, + "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BetaWebhookEvent" } } } + }, + "responses": { "200": { "description": "Return any 2xx status to acknowledge receipt." } } + } + }, + "session.thread_terminated": { + "post": { + "operationId": "BetaSessionThreadTerminatedWebhook", + "summary": "session.thread_terminated webhook", + "requestBody": { + "required": true, + "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BetaWebhookEvent" } } } + }, + "responses": { "200": { "description": "Return any 2xx status to acknowledge receipt." } } + } + }, + "session.outcome_evaluation_ended": { + "post": { + "operationId": "BetaSessionOutcomeEvaluationEndedWebhook", + "summary": "session.outcome_evaluation_ended webhook", + "requestBody": { + "required": true, + "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BetaWebhookEvent" } } } + }, + "responses": { "200": { "description": "Return any 2xx status to acknowledge receipt." } } + } + }, + "vault.created": { + "post": { + "operationId": "BetaVaultCreatedWebhook", + "summary": "vault.created webhook", + "requestBody": { + "required": true, + "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BetaWebhookEvent" } } } + }, + "responses": { "200": { "description": "Return any 2xx status to acknowledge receipt." } } + } + }, + "vault.archived": { + "post": { + "operationId": "BetaVaultArchivedWebhook", + "summary": "vault.archived webhook", + "requestBody": { + "required": true, + "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BetaWebhookEvent" } } } + }, + "responses": { "200": { "description": "Return any 2xx status to acknowledge receipt." } } + } + }, + "vault.deleted": { + "post": { + "operationId": "BetaVaultDeletedWebhook", + "summary": "vault.deleted webhook", + "requestBody": { + "required": true, + "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BetaWebhookEvent" } } } + }, + "responses": { "200": { "description": "Return any 2xx status to acknowledge receipt." } } + } + }, + "vault_credential.created": { + "post": { + "operationId": "BetaVaultCredentialCreatedWebhook", + "summary": "vault_credential.created webhook", + "requestBody": { + "required": true, + "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BetaWebhookEvent" } } } + }, + "responses": { "200": { "description": "Return any 2xx status to acknowledge receipt." } } + } + }, + "vault_credential.archived": { + "post": { + "operationId": "BetaVaultCredentialArchivedWebhook", + "summary": "vault_credential.archived webhook", + "requestBody": { + "required": true, + "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BetaWebhookEvent" } } } + }, + "responses": { "200": { "description": "Return any 2xx status to acknowledge receipt." } } + } + }, + "vault_credential.deleted": { + "post": { + "operationId": "BetaVaultCredentialDeletedWebhook", + "summary": "vault_credential.deleted webhook", + "requestBody": { + "required": true, + "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BetaWebhookEvent" } } } + }, + "responses": { "200": { "description": "Return any 2xx status to acknowledge receipt." } } + } + }, + "vault_credential.refresh_failed": { + "post": { + "operationId": "BetaVaultCredentialRefreshFailedWebhook", + "summary": "vault_credential.refresh_failed webhook", + "requestBody": { + "required": true, + "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BetaWebhookEvent" } } } + }, + "responses": { "200": { "description": "Return any 2xx status to acknowledge receipt." } } + } + } + } } diff --git a/specs/google/discovery.json b/specs/google/discovery.json index b61a46b1..6f1f0160 100644 --- a/specs/google/discovery.json +++ b/specs/google/discovery.json @@ -1,4679 +1,2978 @@ { - "revision": "20260505", - "servicePath": "", - "id": "generativelanguage:v1beta", - "resources": { - "tunedModels": { - "methods": { - "list": { - "description": "Lists created tuned models.", - "httpMethod": "GET", - "parameterOrder": [], - "path": "v1beta/tunedModels", - "id": "generativelanguage.tunedModels.list", - "parameters": { - "pageSize": { - "format": "int32", - "description": "Optional. The maximum number of `TunedModels` to return (per page). The service may return fewer tuned models. If unspecified, at most 10 tuned models will be returned. This method returns at most 1000 models per page, even if you pass a larger page_size.", - "location": "query", - "type": "integer" - }, - "pageToken": { - "location": "query", - "type": "string", - "description": "Optional. A page token, received from a previous `ListTunedModels` call. Provide the `page_token` returned by one request as an argument to the next request to retrieve the next page. When paginating, all other parameters provided to `ListTunedModels` must match the call that provided the page token." - }, - "filter": { - "location": "query", - "type": "string", - "description": "Optional. A filter is a full text search over the tuned model's description and display name. By default, results will not include tuned models shared with everyone. Additional operators: - owner:me - writers:me - readers:me - readers:everyone Examples: \"owner:me\" returns all tuned models to which caller has owner role \"readers:me\" returns all tuned models to which caller has reader role \"readers:everyone\" returns all tuned models that are shared with everyone" - } - }, - "response": { - "$ref": "ListTunedModelsResponse" - }, - "flatPath": "v1beta/tunedModels" - }, - "create": { - "httpMethod": "POST", - "request": { - "$ref": "TunedModel" - }, - "id": "generativelanguage.tunedModels.create", - "response": { + "icons": { + "x16": "http://www.google.com/images/icons/product/search-16.gif", + "x32": "http://www.google.com/images/icons/product/search-32.gif" + }, + "baseUrl": "https://generativelanguage.googleapis.com/", + "ownerDomain": "google.com", + "documentationLink": "https://developers.generativeai.google/api", + "name": "generativelanguage", + "discoveryVersion": "v1", + "version": "v1beta", + "revision": "20260521", + "schemas": { + "ListOperationsResponse": { + "id": "ListOperationsResponse", + "description": "The response message for Operations.ListOperations.", + "type": "object", + "properties": { + "operations": { + "description": "A list of operations that matches the specified filter in the request.", + "type": "array", + "items": { "$ref": "Operation" - }, - "flatPath": "v1beta/tunedModels", - "description": "Creates a tuned model. Check intermediate tuning progress (if any) through the [google.longrunning.Operations] service. Access status and results through the Operations service. Example: GET /v1/tunedModels/az2mb0bpw6i/operations/000-111-222", - "parameterOrder": [], - "path": "v1beta/tunedModels", - "parameters": { - "tunedModelId": { - "location": "query", - "type": "string", - "description": "Optional. The unique id for the tuned model if specified. This value should be up to 40 characters, the first character must be a letter, the last could be a letter or a number. The id must match the regular expression: `[a-z]([a-z0-9-]{0,38}[a-z0-9])?`." - } } }, - "transferOwnership": { - "httpMethod": "POST", - "request": { - "$ref": "TransferOwnershipRequest" - }, - "flatPath": "v1beta/tunedModels/{tunedModelsId}:transferOwnership", - "id": "generativelanguage.tunedModels.transferOwnership", - "response": { - "$ref": "TransferOwnershipResponse" - }, - "parameterOrder": [ - "name" - ], - "path": "v1beta/{+name}:transferOwnership", - "description": "Transfers ownership of the tuned model. This is the only way to change ownership of the tuned model. The current owner will be downgraded to writer role.", - "parameters": { - "name": { - "location": "path", - "required": true, - "pattern": "^tunedModels/[^/]+$", - "type": "string", - "description": "Required. The resource name of the tuned model to transfer ownership. Format: `tunedModels/my-model-id`" - } + "nextPageToken": { + "description": "The standard List next-page token.", + "type": "string" + }, + "unreachable": { + "description": "Unordered list. Unreachable resources. Populated when the request sets `ListOperationsRequest.return_partial_success` and reads across collections. For example, when attempting to list all resources across all supported locations.", + "type": "array", + "items": { + "type": "string" } + } + } + }, + "Operation": { + "id": "Operation", + "description": "This resource represents a long-running operation that is the result of a network API call.", + "type": "object", + "properties": { + "name": { + "description": "The server-assigned name, which is only unique within the same service that originally returns it. If you use the default HTTP mapping, the `name` should be a resource name ending with `operations/{unique_id}`.", + "type": "string" }, - "delete": { - "httpMethod": "DELETE", - "parameterOrder": [ - "name" - ], - "path": "v1beta/{+name}", - "description": "Deletes a tuned model.", - "flatPath": "v1beta/tunedModels/{tunedModelsId}", - "id": "generativelanguage.tunedModels.delete", - "parameters": { - "name": { - "pattern": "^tunedModels/[^/]+$", - "type": "string", - "description": "Required. The resource name of the model. Format: `tunedModels/my-model-id`", - "location": "path", - "required": true - } - }, - "response": { - "$ref": "Empty" + "metadata": { + "description": "Service-specific metadata associated with the operation. It typically contains progress information and common metadata such as create time. Some services might not provide such metadata. Any method that returns a long-running operation should document the metadata type, if any.", + "type": "object", + "additionalProperties": { + "type": "any", + "description": "Properties of the object. Contains field @type with type URL." } }, - "asyncBatchEmbedContent": { - "description": "Enqueues a batch of `EmbedContent` requests for batch processing. We have a `BatchEmbedContents` handler in `GenerativeService`, but it was synchronized. So we name this one to be `Async` to avoid confusion.", - "parameterOrder": [ - "model" - ], - "path": "v1beta/{+model}:asyncBatchEmbedContent", - "parameters": { - "model": { - "location": "path", - "required": true, - "pattern": "^tunedModels/[^/]+$", - "type": "string", - "description": "Required. The name of the `Model` to use for generating the completion. Format: `models/{model}`." - } - }, - "httpMethod": "POST", - "request": { - "$ref": "AsyncBatchEmbedContentRequest" - }, - "id": "generativelanguage.tunedModels.asyncBatchEmbedContent", - "response": { - "$ref": "Operation" - }, - "flatPath": "v1beta/tunedModels/{tunedModelsId}:asyncBatchEmbedContent" + "done": { + "description": "If the value is `false`, it means the operation is still in progress. If `true`, the operation is completed, and either `error` or `response` is available.", + "type": "boolean" }, - "patch": { - "description": "Updates a tuned model.", - "parameterOrder": [ - "name" - ], - "path": "v1beta/{+name}", - "parameters": { - "updateMask": { - "description": "Optional. The list of fields to update.", - "location": "query", - "type": "string", - "format": "google-fieldmask" - }, - "name": { - "required": true, - "location": "path", - "description": "Output only. The tuned model name. A unique name will be generated on create. Example: `tunedModels/az2mb0bpw6i` If display_name is set on create, the id portion of the name will be set by concatenating the words of the display_name with hyphens and adding a random portion for uniqueness. Example: * display_name = `Sentence Translator` * name = `tunedModels/sentence-translator-u3b7m`", - "type": "string", - "pattern": "^tunedModels/[^/]+$" - } - }, - "httpMethod": "PATCH", - "request": { - "$ref": "TunedModel" - }, - "id": "generativelanguage.tunedModels.patch", - "response": { - "$ref": "TunedModel" - }, - "flatPath": "v1beta/tunedModels/{tunedModelsId}" + "error": { + "description": "The error result of the operation in case of failure or cancellation.", + "$ref": "Status" }, - "generateContent": { - "parameters": { - "model": { - "location": "path", - "required": true, - "pattern": "^tunedModels/[^/]+$", - "type": "string", - "description": "Required. The name of the `Model` to use for generating the completion. Format: `models/{model}`." - } - }, - "description": "Generates a model response given an input `GenerateContentRequest`. Refer to the [text generation guide](https://ai.google.dev/gemini-api/docs/text-generation) for detailed usage information. Input capabilities differ between models, including tuned models. Refer to the [model guide](https://ai.google.dev/gemini-api/docs/models/gemini) and [tuning guide](https://ai.google.dev/gemini-api/docs/model-tuning) for details.", - "parameterOrder": [ - "model" - ], - "path": "v1beta/{+model}:generateContent", - "id": "generativelanguage.tunedModels.generateContent", - "response": { - "$ref": "GenerateContentResponse" - }, - "flatPath": "v1beta/tunedModels/{tunedModelsId}:generateContent", - "httpMethod": "POST", - "request": { - "$ref": "GenerateContentRequest" + "response": { + "description": "The normal, successful response of the operation. If the original method returns no data on success, such as `Delete`, the response is `google.protobuf.Empty`. If the original method is standard `Get`/`Create`/`Update`, the response should be the resource. For other methods, the response should have the type `XxxResponse`, where `Xxx` is the original method name. For example, if the original method name is `TakeSnapshot()`, the inferred response type is `TakeSnapshotResponse`.", + "type": "object", + "additionalProperties": { + "type": "any", + "description": "Properties of the object. Contains field @type with type URL." } + } + } + }, + "Status": { + "id": "Status", + "description": "The `Status` type defines a logical error model that is suitable for different programming environments, including REST APIs and RPC APIs. It is used by [gRPC](https://github.com/grpc). Each `Status` message contains three pieces of data: error code, error message, and error details. You can find out more about this error model and how to work with it in the [API Design Guide](https://cloud.google.com/apis/design/errors).", + "type": "object", + "properties": { + "code": { + "description": "The status code, which should be an enum value of google.rpc.Code.", + "type": "integer", + "format": "int32" }, - "batchGenerateContent": { - "description": "Enqueues a batch of `GenerateContent` requests for batch processing.", - "path": "v1beta/{+model}:batchGenerateContent", - "parameterOrder": [ - "model" - ], - "parameters": { - "model": { - "location": "path", - "required": true, - "type": "string", - "description": "Required. The name of the `Model` to use for generating the completion. Format: `models/{model}`.", - "pattern": "^tunedModels/[^/]+$" - } - }, - "request": { - "$ref": "BatchGenerateContentRequest" - }, - "httpMethod": "POST", - "id": "generativelanguage.tunedModels.batchGenerateContent", - "response": { - "$ref": "Operation" - }, - "flatPath": "v1beta/tunedModels/{tunedModelsId}:batchGenerateContent" + "message": { + "description": "A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the google.rpc.Status.details field, or localized by the client.", + "type": "string" }, - "streamGenerateContent": { - "flatPath": "v1beta/tunedModels/{tunedModelsId}:streamGenerateContent", - "id": "generativelanguage.tunedModels.streamGenerateContent", - "response": { - "$ref": "GenerateContentResponse" - }, - "httpMethod": "POST", - "request": { - "$ref": "GenerateContentRequest" - }, - "parameters": { - "model": { - "type": "string", - "description": "Required. The name of the `Model` to use for generating the completion. Format: `models/{model}`.", - "pattern": "^tunedModels/[^/]+$", - "location": "path", - "required": true + "details": { + "description": "A list of messages that carry the error details. There is a common set of message types for APIs to use.", + "type": "array", + "items": { + "type": "object", + "additionalProperties": { + "type": "any", + "description": "Properties of the object. Contains field @type with type URL." } - }, - "parameterOrder": [ - "model" - ], - "path": "v1beta/{+model}:streamGenerateContent", - "description": "Generates a [streamed response](https://ai.google.dev/gemini-api/docs/text-generation?lang=python#generate-a-text-stream) from the model given an input `GenerateContentRequest`." + } + } + } + }, + "Empty": { + "id": "Empty", + "description": "A generic empty message that you can re-use to avoid defining duplicated empty messages in your APIs. A typical example is to use it as the request or the response type of an API method. For instance: service Foo { rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); }", + "type": "object", + "properties": {} + }, + "GenerateContentRequest": { + "id": "GenerateContentRequest", + "description": "Request to generate a completion from the model.", + "type": "object", + "properties": { + "model": { + "description": "Required. The name of the `Model` to use for generating the completion. Format: `models/{model}`.", + "type": "string" }, - "get": { - "id": "generativelanguage.tunedModels.get", - "parameters": { - "name": { - "pattern": "^tunedModels/[^/]+$", - "type": "string", - "description": "Required. The resource name of the model. Format: `tunedModels/my-model-id`", - "location": "path", - "required": true - } - }, - "response": { - "$ref": "TunedModel" - }, - "flatPath": "v1beta/tunedModels/{tunedModelsId}", - "description": "Gets information about a specific TunedModel.", - "httpMethod": "GET", - "parameterOrder": [ - "name" - ], - "path": "v1beta/{+name}" + "systemInstruction": { + "description": "Optional. Developer set [system instruction(s)](https://ai.google.dev/gemini-api/docs/system-instructions). Currently, text only.", + "$ref": "Content" }, - "generateText": { - "parameters": { - "model": { - "description": "Required. The name of the `Model` or `TunedModel` to use for generating the completion. Examples: models/text-bison-001 tunedModels/sentence-translator-u3b7m", - "type": "string", - "pattern": "^tunedModels/[^/]+$", - "required": true, - "location": "path" - } - }, - "parameterOrder": [ - "model" + "contents": { + "description": "Required. The content of the current conversation with the model. For single-turn queries, this is a single instance. For multi-turn queries like [chat](https://ai.google.dev/gemini-api/docs/text-generation#chat), this is a repeated field that contains the conversation history and the latest request.", + "type": "array", + "items": { + "$ref": "Content" + } + }, + "tools": { + "description": "Optional. A list of `Tools` the `Model` may use to generate the next response. A `Tool` is a piece of code that enables the system to interact with external systems to perform an action, or set of actions, outside of knowledge and scope of the `Model`. Supported `Tool`s are `Function` and `code_execution`. Refer to the [Function calling](https://ai.google.dev/gemini-api/docs/function-calling) and the [Code execution](https://ai.google.dev/gemini-api/docs/code-execution) guides to learn more.", + "type": "array", + "items": { + "$ref": "Tool" + } + }, + "toolConfig": { + "description": "Optional. Tool configuration for any `Tool` specified in the request. Refer to the [Function calling guide](https://ai.google.dev/gemini-api/docs/function-calling#function_calling_mode) for a usage example.", + "$ref": "ToolConfig" + }, + "safetySettings": { + "description": "Optional. A list of unique `SafetySetting` instances for blocking unsafe content. This will be enforced on the `GenerateContentRequest.contents` and `GenerateContentResponse.candidates`. There should not be more than one setting for each `SafetyCategory` type. The API will block any contents and responses that fail to meet the thresholds set by these settings. This list overrides the default settings for each `SafetyCategory` specified in the safety_settings. If there is no `SafetySetting` for a given `SafetyCategory` provided in the list, the API will use the default safety setting for that category. Harm categories HARM_CATEGORY_HATE_SPEECH, HARM_CATEGORY_SEXUALLY_EXPLICIT, HARM_CATEGORY_DANGEROUS_CONTENT, HARM_CATEGORY_HARASSMENT, HARM_CATEGORY_CIVIC_INTEGRITY are supported. Refer to the [guide](https://ai.google.dev/gemini-api/docs/safety-settings) for detailed information on available safety settings. Also refer to the [Safety guidance](https://ai.google.dev/gemini-api/docs/safety-guidance) to learn how to incorporate safety considerations in your AI applications.", + "type": "array", + "items": { + "$ref": "SafetySetting" + } + }, + "generationConfig": { + "description": "Optional. Configuration options for model generation and outputs.", + "$ref": "GenerationConfig" + }, + "cachedContent": { + "description": "Optional. The name of the content [cached](https://ai.google.dev/gemini-api/docs/caching) to use as context to serve the prediction. Format: `cachedContents/{cachedContent}`", + "type": "string" + }, + "serviceTier": { + "description": "Optional. The service tier of the request.", + "type": "string", + "enumDescriptions": [ + "Default service tier, which is standard.", + "Standard service tier.", + "Flex service tier.", + "Priority service tier." ], - "path": "v1beta/{+model}:generateText", - "description": "Generates a response from the model given an input message.", - "flatPath": "v1beta/tunedModels/{tunedModelsId}:generateText", - "id": "generativelanguage.tunedModels.generateText", - "response": { - "$ref": "GenerateTextResponse" - }, - "httpMethod": "POST", - "request": { - "$ref": "GenerateTextRequest" + "enum": [ + "unspecified", + "standard", + "flex", + "priority" + ] + }, + "store": { + "description": "Optional. Configures the logging behavior for a given request. If set, it takes precedence over the project-level logging config.", + "type": "boolean" + } + } + }, + "Content": { + "id": "Content", + "description": "The base structured datatype containing multi-part content of a message. A `Content` includes a `role` field designating the producer of the `Content` and a `parts` field containing multi-part data that contains the content of the message turn.", + "type": "object", + "properties": { + "parts": { + "description": "Ordered `Parts` that constitute a single message. Parts may have different MIME types.", + "type": "array", + "items": { + "$ref": "Part" } + }, + "role": { + "description": "Optional. The producer of the content. Must be either 'user' or 'model'. Useful to set for multi-turn conversations, otherwise can be left blank or unset.", + "type": "string" } - }, - "resources": { - "operations": { - "methods": { - "list": { - "httpMethod": "GET", - "parameterOrder": [ - "name" - ], - "path": "v1beta/{+name}/operations", - "description": "Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns `UNIMPLEMENTED`.", - "flatPath": "v1beta/tunedModels/{tunedModelsId}/operations", - "id": "generativelanguage.tunedModels.operations.list", - "parameters": { - "pageSize": { - "format": "int32", - "location": "query", - "type": "integer", - "description": "The standard list page size." - }, - "returnPartialSuccess": { - "description": "When set to `true`, operations that are reachable are returned as normal, and those that are unreachable are returned in the ListOperationsResponse.unreachable field. This can only be `true` when reading across collections. For example, when `parent` is set to `\"projects/example/locations/-\"`. This field is not supported by default and will result in an `UNIMPLEMENTED` error if set unless explicitly documented otherwise in service or product specific documentation.", - "location": "query", - "type": "boolean" - }, - "filter": { - "description": "The standard list filter.", - "location": "query", - "type": "string" - }, - "name": { - "pattern": "^tunedModels/[^/]+$", - "description": "The name of the operation's parent resource.", - "type": "string", - "required": true, - "location": "path" - }, - "pageToken": { - "location": "query", - "type": "string", - "description": "The standard list page token." - } - }, - "response": { - "$ref": "ListOperationsResponse" - } - }, - "get": { - "flatPath": "v1beta/tunedModels/{tunedModelsId}/operations/{operationsId}", - "id": "generativelanguage.tunedModels.operations.get", - "parameters": { - "name": { - "required": true, - "location": "path", - "description": "The name of the operation resource.", - "type": "string", - "pattern": "^tunedModels/[^/]+/operations/[^/]+$" - } - }, - "response": { - "$ref": "Operation" - }, - "path": "v1beta/{+name}", - "httpMethod": "GET", - "parameterOrder": [ - "name" - ], - "description": "Gets the latest state of a long-running operation. Clients can use this method to poll the operation result at intervals as recommended by the API service." - } + } + }, + "Part": { + "id": "Part", + "description": "A datatype containing media that is part of a multi-part `Content` message. A `Part` consists of data which has an associated datatype. A `Part` can only contain one of the accepted types in `Part.data`. A `Part` must have a fixed IANA MIME type identifying the type and subtype of the media if the `inline_data` field is filled with raw bytes.", + "type": "object", + "properties": { + "text": { + "description": "Inline text.", + "type": "string" + }, + "inlineData": { + "description": "Inline media bytes.", + "$ref": "Blob" + }, + "functionCall": { + "description": "A predicted `FunctionCall` returned from the model that contains a string representing the `FunctionDeclaration.name` with the arguments and their values.", + "$ref": "FunctionCall" + }, + "functionResponse": { + "description": "The result output of a `FunctionCall` that contains a string representing the `FunctionDeclaration.name` and a structured JSON object containing any output from the function is used as context to the model.", + "$ref": "FunctionResponse" + }, + "fileData": { + "description": "URI based data.", + "$ref": "FileData" + }, + "executableCode": { + "description": "Code generated by the model that is meant to be executed.", + "$ref": "ExecutableCode" + }, + "codeExecutionResult": { + "description": "Result of executing the `ExecutableCode`.", + "$ref": "CodeExecutionResult" + }, + "toolCall": { + "description": "Server-side tool call. This field is populated when the model predicts a tool invocation that should be executed on the server. The client is expected to echo this message back to the API.", + "$ref": "ToolCall" + }, + "toolResponse": { + "description": "The output from a server-side `ToolCall` execution. This field is populated by the client with the results of executing the corresponding `ToolCall`.", + "$ref": "ToolResponse" + }, + "videoMetadata": { + "description": "Optional. Video metadata. The metadata should only be specified while the video data is presented in inline_data or file_data.", + "$ref": "VideoMetadata" + }, + "thought": { + "description": "Optional. Indicates if the part is thought from the model.", + "type": "boolean" + }, + "thoughtSignature": { + "description": "Optional. An opaque signature for the thought so it can be reused in subsequent requests.", + "type": "string", + "format": "byte" + }, + "partMetadata": { + "description": "Custom metadata associated with the Part. Agents using genai.Part as content representation may need to keep track of the additional information. For example it can be name of a file/source from which the Part originates or a way to multiplex multiple Part streams.", + "type": "object", + "additionalProperties": { + "type": "any", + "description": "Properties of the object." } }, - "permissions": { - "methods": { - "delete": { - "path": "v1beta/{+name}", - "httpMethod": "DELETE", - "parameterOrder": [ - "name" - ], - "description": "Deletes the permission.", - "flatPath": "v1beta/tunedModels/{tunedModelsId}/permissions/{permissionsId}", - "id": "generativelanguage.tunedModels.permissions.delete", - "parameters": { - "name": { - "required": true, - "location": "path", - "description": "Required. The resource name of the permission. Formats: `tunedModels/{tuned_model}/permissions/{permission}` `corpora/{corpus}/permissions/{permission}`", - "type": "string", - "pattern": "^tunedModels/[^/]+/permissions/[^/]+$" - } - }, - "response": { - "$ref": "Empty" - } - }, - "get": { - "description": "Gets information about a specific Permission.", - "httpMethod": "GET", - "parameterOrder": [ - "name" - ], - "path": "v1beta/{+name}", - "id": "generativelanguage.tunedModels.permissions.get", - "parameters": { - "name": { - "required": true, - "location": "path", - "description": "Required. The resource name of the permission. Formats: `tunedModels/{tuned_model}/permissions/{permission}` `corpora/{corpus}/permissions/{permission}`", - "type": "string", - "pattern": "^tunedModels/[^/]+/permissions/[^/]+$" - } - }, - "response": { - "$ref": "Permission" - }, - "flatPath": "v1beta/tunedModels/{tunedModelsId}/permissions/{permissionsId}" - }, - "create": { - "parameters": { - "parent": { - "required": true, - "location": "path", - "pattern": "^tunedModels/[^/]+$", - "description": "Required. The parent resource of the `Permission`. Formats: `tunedModels/{tuned_model}` `corpora/{corpus}`", - "type": "string" - } - }, - "path": "v1beta/{+parent}/permissions", - "parameterOrder": [ - "parent" - ], - "description": "Create a permission to a specific resource.", - "flatPath": "v1beta/tunedModels/{tunedModelsId}/permissions", - "id": "generativelanguage.tunedModels.permissions.create", - "response": { - "$ref": "Permission" - }, - "request": { - "$ref": "Permission" - }, - "httpMethod": "POST" - }, - "list": { - "id": "generativelanguage.tunedModels.permissions.list", - "parameters": { - "pageSize": { - "location": "query", - "type": "integer", - "description": "Optional. The maximum number of `Permission`s to return (per page). The service may return fewer permissions. If unspecified, at most 10 permissions will be returned. This method returns at most 1000 permissions per page, even if you pass larger page_size.", - "format": "int32" - }, - "parent": { - "location": "path", - "required": true, - "pattern": "^tunedModels/[^/]+$", - "type": "string", - "description": "Required. The parent resource of the permissions. Formats: `tunedModels/{tuned_model}` `corpora/{corpus}`" - }, - "pageToken": { - "description": "Optional. A page token, received from a previous `ListPermissions` call. Provide the `page_token` returned by one request as an argument to the next request to retrieve the next page. When paginating, all other parameters provided to `ListPermissions` must match the call that provided the page token.", - "location": "query", - "type": "string" - } - }, - "response": { - "$ref": "ListPermissionsResponse" - }, - "flatPath": "v1beta/tunedModels/{tunedModelsId}/permissions", - "description": "Lists permissions for the specific resource.", - "path": "v1beta/{+parent}/permissions", - "httpMethod": "GET", - "parameterOrder": [ - "parent" - ] - }, - "patch": { - "parameters": { - "updateMask": { - "description": "Required. The list of fields to update. Accepted ones: - role (`Permission.role` field)", - "location": "query", - "type": "string", - "format": "google-fieldmask" - }, - "name": { - "location": "path", - "required": true, - "pattern": "^tunedModels/[^/]+/permissions/[^/]+$", - "type": "string", - "description": "Output only. Identifier. The permission name. A unique name will be generated on create. Examples: tunedModels/{tuned_model}/permissions/{permission} corpora/{corpus}/permissions/{permission} Output only." - } - }, - "path": "v1beta/{+name}", - "parameterOrder": [ - "name" - ], - "description": "Updates the permission.", - "flatPath": "v1beta/tunedModels/{tunedModelsId}/permissions/{permissionsId}", - "id": "generativelanguage.tunedModels.permissions.patch", - "response": { - "$ref": "Permission" - }, - "request": { - "$ref": "Permission" - }, - "httpMethod": "PATCH" - } - } + "mediaResolution": { + "description": "Optional. Media resolution for the input media.", + "$ref": "MediaResolution" } } }, - "media": { - "methods": { - "uploadToFileSearchStore": { - "httpMethod": "POST", - "request": { - "$ref": "UploadToFileSearchStoreRequest" - }, - "id": "generativelanguage.media.uploadToFileSearchStore", - "response": { - "$ref": "CustomLongRunningOperation" - }, - "flatPath": "v1beta/fileSearchStores/{fileSearchStoresId}:uploadToFileSearchStore", - "supportsMediaUpload": true, - "scopes": [ - "https://www.googleapis.com/auth/devstorage.read_only" - ], - "description": "Uploads data to a FileSearchStore, preprocesses and chunks before storing it in a FileSearchStore Document.", - "parameterOrder": [ - "fileSearchStoreName" - ], - "path": "v1beta/{+fileSearchStoreName}:uploadToFileSearchStore", - "parameters": { - "fileSearchStoreName": { - "description": "Required. Immutable. The name of the `FileSearchStore` to upload the file into. Example: `fileSearchStores/my-file-search-store-123`", - "type": "string", - "pattern": "^fileSearchStores/[^/]+$", - "required": true, - "location": "path" - } - }, - "mediaUpload": { - "accept": [ - "*/*" - ], - "protocols": { - "simple": { - "multipart": true, - "path": "/upload/v1beta/{+fileSearchStoreName}:uploadToFileSearchStore" - }, - "resumable": { - "multipart": true, - "path": "/resumable/upload/v1beta/{+fileSearchStoreName}:uploadToFileSearchStore" - } - }, - "maxSize": "104857600" - } + "Blob": { + "id": "Blob", + "description": "Raw media bytes. Text should not be sent as raw bytes, use the 'text' field.", + "type": "object", + "properties": { + "mimeType": { + "description": "The IANA standard MIME type of the source data. Examples of supported types: - Images: image/png, image/jpeg, image/jpg, image/webp, image/heic, image/heif, image/gif, image/avif - Audio: audio/*, video/audio/s16le, video/audio/wav - Video: video/* - Text: text/plain, text/html, text/css, text/javascript, text/x-typescript, text/csv, text/markdown, text/x-python, text/xml, text/rtf, video/text/timestamp - Applications: application/x-javascript, application/x-typescript, application/x-python-code, application/json, application/x-ipynb+json, application/rtf, application/pdf For additional context, see [Supported file formats](https://ai.google.dev/gemini-api/docs/file-input-methods#supported-content-types). //", + "type": "string" }, - "upload": { - "path": "v1beta/files", - "parameterOrder": [], - "scopes": [ - "https://www.googleapis.com/auth/devstorage.read_only" - ], - "description": "Creates a `File`.", - "supportsMediaUpload": true, - "mediaUpload": { - "accept": [ - "*/*" - ], - "protocols": { - "simple": { - "multipart": true, - "path": "/upload/v1beta/files" - }, - "resumable": { - "multipart": true, - "path": "/resumable/upload/v1beta/files" - } - }, - "maxSize": "2147483648" - }, - "parameters": {}, - "request": { - "$ref": "CreateFileRequest" - }, - "httpMethod": "POST", - "flatPath": "v1beta/files", - "id": "generativelanguage.media.upload", - "response": { - "$ref": "CreateFileResponse" - } + "data": { + "description": "Raw bytes for media formats.", + "type": "string", + "format": "byte" } } }, - "models": { - "methods": { - "predictLongRunning": { - "request": { - "$ref": "PredictLongRunningRequest" - }, - "httpMethod": "POST", - "id": "generativelanguage.models.predictLongRunning", - "response": { - "$ref": "Operation" - }, - "flatPath": "v1beta/models/{modelsId}:predictLongRunning", - "description": "Same as Predict but returns an LRO.", - "path": "v1beta/{+model}:predictLongRunning", - "parameterOrder": [ - "model" - ], - "parameters": { - "model": { - "type": "string", - "description": "Required. The name of the model for prediction. Format: `name=models/{model}`.", - "pattern": "^models/[^/]+$", - "location": "path", - "required": true - } - } + "FunctionCall": { + "id": "FunctionCall", + "description": "A predicted `FunctionCall` returned from the model that contains a string representing the `FunctionDeclaration.name` with the arguments and their values.", + "type": "object", + "properties": { + "id": { + "description": "Optional. Unique identifier of the function call. If populated, the client to execute the `function_call` and return the response with the matching `id`.", + "type": "string" }, - "generateAnswer": { - "parameters": { - "model": { - "location": "path", - "required": true, - "pattern": "^models/[^/]+$", - "type": "string", - "description": "Required. The name of the `Model` to use for generating the grounded response. Format: `model=models/{model}`." - } - }, - "description": "Generates a grounded answer from the model given an input `GenerateAnswerRequest`.", - "path": "v1beta/{+model}:generateAnswer", - "parameterOrder": [ - "model" - ], - "id": "generativelanguage.models.generateAnswer", - "response": { - "$ref": "GenerateAnswerResponse" - }, - "flatPath": "v1beta/models/{modelsId}:generateAnswer", - "request": { - "$ref": "GenerateAnswerRequest" - }, - "httpMethod": "POST" + "name": { + "description": "Required. The name of the function to call. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 128.", + "type": "string" }, - "batchEmbedContents": { - "httpMethod": "POST", - "request": { - "$ref": "BatchEmbedContentsRequest" - }, - "id": "generativelanguage.models.batchEmbedContents", - "response": { - "$ref": "BatchEmbedContentsResponse" - }, - "flatPath": "v1beta/models/{modelsId}:batchEmbedContents", - "description": "Generates multiple embedding vectors from the input `Content` which consists of a batch of strings represented as `EmbedContentRequest` objects.", - "parameterOrder": [ - "model" - ], - "path": "v1beta/{+model}:batchEmbedContents", - "parameters": { - "model": { - "location": "path", - "required": true, - "type": "string", - "description": "Required. The model's resource name. This serves as an ID for the Model to use. This name should match a model name returned by the `ListModels` method. Format: `models/{model}`", - "pattern": "^models/[^/]+$" - } + "args": { + "description": "Optional. The function parameters and values in JSON object format.", + "type": "object", + "additionalProperties": { + "type": "any", + "description": "Properties of the object." } + } + } + }, + "FunctionResponse": { + "id": "FunctionResponse", + "description": "The result output from a `FunctionCall` that contains a string representing the `FunctionDeclaration.name` and a structured JSON object containing any output from the function is used as context to the model. This should contain the result of a`FunctionCall` made based on model prediction.", + "type": "object", + "properties": { + "id": { + "description": "Optional. The identifier of the function call this response is for. Populated by the client to match the corresponding function call `id`.", + "type": "string" }, - "list": { - "flatPath": "v1beta/models", - "id": "generativelanguage.models.list", - "parameters": { - "pageSize": { - "location": "query", - "type": "integer", - "description": "The maximum number of `Models` to return (per page). If unspecified, 50 models will be returned per page. This method returns at most 1000 models per page, even if you pass a larger page_size.", - "format": "int32" - }, - "pageToken": { - "description": "A page token, received from a previous `ListModels` call. Provide the `page_token` returned by one request as an argument to the next request to retrieve the next page. When paginating, all other parameters provided to `ListModels` must match the call that provided the page token.", - "location": "query", - "type": "string" - } - }, - "response": { - "$ref": "ListModelsResponse" - }, - "path": "v1beta/models", - "httpMethod": "GET", - "parameterOrder": [], - "description": "Lists the [`Model`s](https://ai.google.dev/gemini-api/docs/models/gemini) available through the Gemini API." - }, - "embedContent": { - "description": "Generates a text embedding vector from the input `Content` using the specified [Gemini Embedding model](https://ai.google.dev/gemini-api/docs/models/gemini#text-embedding).", - "path": "v1beta/{+model}:embedContent", - "parameterOrder": [ - "model" - ], - "parameters": { - "model": { - "required": true, - "location": "path", - "description": "Required. The model's resource name. This serves as an ID for the Model to use. This name should match a model name returned by the `ListModels` method. Format: `models/{model}`", - "type": "string", - "pattern": "^models/[^/]+$" - } - }, - "request": { - "$ref": "EmbedContentRequest" - }, - "httpMethod": "POST", - "id": "generativelanguage.models.embedContent", - "response": { - "$ref": "EmbedContentResponse" - }, - "flatPath": "v1beta/models/{modelsId}:embedContent" - }, - "batchGenerateContent": { - "flatPath": "v1beta/models/{modelsId}:batchGenerateContent", - "id": "generativelanguage.models.batchGenerateContent", - "response": { - "$ref": "Operation" - }, - "httpMethod": "POST", - "request": { - "$ref": "BatchGenerateContentRequest" - }, - "parameters": { - "model": { - "pattern": "^models/[^/]+$", - "description": "Required. The name of the `Model` to use for generating the completion. Format: `models/{model}`.", - "type": "string", - "required": true, - "location": "path" - } - }, - "parameterOrder": [ - "model" - ], - "path": "v1beta/{+model}:batchGenerateContent", - "description": "Enqueues a batch of `GenerateContent` requests for batch processing." + "name": { + "description": "Required. The name of the function to call. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 128.", + "type": "string" }, - "countMessageTokens": { - "request": { - "$ref": "CountMessageTokensRequest" - }, - "httpMethod": "POST", - "flatPath": "v1beta/models/{modelsId}:countMessageTokens", - "id": "generativelanguage.models.countMessageTokens", - "response": { - "$ref": "CountMessageTokensResponse" - }, - "path": "v1beta/{+model}:countMessageTokens", - "parameterOrder": [ - "model" - ], - "description": "Runs a model's tokenizer on a string and returns the token count.", - "parameters": { - "model": { - "required": true, - "location": "path", - "pattern": "^models/[^/]+$", - "description": "Required. The model's resource name. This serves as an ID for the Model to use. This name should match a model name returned by the `ListModels` method. Format: `models/{model}`", - "type": "string" - } + "response": { + "description": "Required. The function response in JSON object format. Callers can use any keys of their choice that fit the function's syntax to return the function output, e.g. \"output\", \"result\", etc. In particular, if the function call failed to execute, the response can have an \"error\" key to return error details to the model. Multimedia can be included by using a subobject containing a single \"$ref\" key whose value is the `inline_data.display_name` of a `FunctionResponsePart` holding the multimedia. See https://ai.google.dev/gemini-api/docs/function-calling#multimodal.", + "type": "object", + "additionalProperties": { + "type": "any", + "description": "Properties of the object." } }, - "asyncBatchEmbedContent": { - "description": "Enqueues a batch of `EmbedContent` requests for batch processing. We have a `BatchEmbedContents` handler in `GenerativeService`, but it was synchronized. So we name this one to be `Async` to avoid confusion.", - "parameterOrder": [ - "model" - ], - "path": "v1beta/{+model}:asyncBatchEmbedContent", - "parameters": { - "model": { - "description": "Required. The name of the `Model` to use for generating the completion. Format: `models/{model}`.", - "type": "string", - "pattern": "^models/[^/]+$", - "required": true, - "location": "path" - } - }, - "httpMethod": "POST", - "request": { - "$ref": "AsyncBatchEmbedContentRequest" - }, - "id": "generativelanguage.models.asyncBatchEmbedContent", - "response": { - "$ref": "Operation" - }, - "flatPath": "v1beta/models/{modelsId}:asyncBatchEmbedContent" + "parts": { + "description": "Optional. Ordered `Parts` that constitute a function response. Parts may have different IANA MIME types.", + "type": "array", + "items": { + "$ref": "FunctionResponsePart" + } }, - "batchEmbedText": { - "parameters": { - "model": { - "required": true, - "location": "path", - "description": "Required. The name of the `Model` to use for generating the embedding. Examples: models/embedding-gecko-001", - "type": "string", - "pattern": "^models/[^/]+$" - } - }, - "path": "v1beta/{+model}:batchEmbedText", - "parameterOrder": [ - "model" - ], - "description": "Generates multiple embeddings from the model given input text in a synchronous call.", - "flatPath": "v1beta/models/{modelsId}:batchEmbedText", - "id": "generativelanguage.models.batchEmbedText", - "response": { - "$ref": "BatchEmbedTextResponse" - }, - "request": { - "$ref": "BatchEmbedTextRequest" - }, - "httpMethod": "POST" + "willContinue": { + "description": "Optional. Signals that function call continues, and more responses will be returned, turning the function call into a generator. Is only applicable to NON_BLOCKING function calls, is ignored otherwise. If set to false, future responses will not be considered. It is allowed to return empty `response` with `will_continue=False` to signal that the function call is finished. This may still trigger the model generation. To avoid triggering the generation and finish the function call, additionally set `scheduling` to `SILENT`.", + "type": "boolean" }, - "streamGenerateContent": { - "description": "Generates a [streamed response](https://ai.google.dev/gemini-api/docs/text-generation?lang=python#generate-a-text-stream) from the model given an input `GenerateContentRequest`.", - "path": "v1beta/{+model}:streamGenerateContent", - "parameterOrder": [ - "model" + "scheduling": { + "description": "Optional. Specifies how the response should be scheduled in the conversation. Only applicable to NON_BLOCKING function calls, is ignored otherwise. Defaults to WHEN_IDLE.", + "type": "string", + "enumDescriptions": [ + "This value is unused.", + "Only add the result to the conversation context, do not interrupt or trigger generation.", + "Add the result to the conversation context, and prompt to generate output without interrupting ongoing generation.", + "Add the result to the conversation context, interrupt ongoing generation and prompt to generate output." ], - "parameters": { - "model": { - "type": "string", - "description": "Required. The name of the `Model` to use for generating the completion. Format: `models/{model}`.", - "pattern": "^models/[^/]+$", - "location": "path", - "required": true - } - }, - "request": { - "$ref": "GenerateContentRequest" - }, - "httpMethod": "POST", - "id": "generativelanguage.models.streamGenerateContent", - "response": { - "$ref": "GenerateContentResponse" - }, - "flatPath": "v1beta/models/{modelsId}:streamGenerateContent" + "enum": [ + "SCHEDULING_UNSPECIFIED", + "SILENT", + "WHEN_IDLE", + "INTERRUPT" + ] + } + } + }, + "FunctionResponsePart": { + "id": "FunctionResponsePart", + "description": "A datatype containing media that is part of a `FunctionResponse` message. A `FunctionResponsePart` consists of data which has an associated datatype. A `FunctionResponsePart` can only contain one of the accepted types in `FunctionResponsePart.data`. A `FunctionResponsePart` must have a fixed IANA MIME type identifying the type and subtype of the media if the `inline_data` field is filled with raw bytes.", + "type": "object", + "properties": { + "inlineData": { + "description": "Inline media bytes.", + "$ref": "FunctionResponseBlob" + } + } + }, + "FunctionResponseBlob": { + "id": "FunctionResponseBlob", + "description": "Raw media bytes for function response. Text should not be sent as raw bytes, use the 'FunctionResponse.response' field.", + "type": "object", + "properties": { + "mimeType": { + "description": "The IANA standard MIME type of the source data. Examples: - image/png - image/jpeg If an unsupported MIME type is provided, an error will be returned. For a complete list of supported types, see [Supported file formats](https://ai.google.dev/gemini-api/docs/prompting_with_media#supported_file_formats).", + "type": "string" }, - "countTextTokens": { - "parameters": { - "model": { - "type": "string", - "description": "Required. The model's resource name. This serves as an ID for the Model to use. This name should match a model name returned by the `ListModels` method. Format: `models/{model}`", - "pattern": "^models/[^/]+$", - "location": "path", - "required": true - } - }, - "description": "Runs a model's tokenizer on a text and returns the token count.", - "parameterOrder": [ - "model" - ], - "path": "v1beta/{+model}:countTextTokens", - "id": "generativelanguage.models.countTextTokens", - "response": { - "$ref": "CountTextTokensResponse" - }, - "flatPath": "v1beta/models/{modelsId}:countTextTokens", - "httpMethod": "POST", - "request": { - "$ref": "CountTextTokensRequest" - } + "data": { + "description": "Raw bytes for media formats.", + "type": "string", + "format": "byte" + } + } + }, + "FileData": { + "id": "FileData", + "description": "URI based data.", + "type": "object", + "properties": { + "mimeType": { + "description": "Optional. The IANA standard MIME type of the source data.", + "type": "string" }, - "embedText": { - "id": "generativelanguage.models.embedText", - "response": { - "$ref": "EmbedTextResponse" - }, - "flatPath": "v1beta/models/{modelsId}:embedText", - "httpMethod": "POST", - "request": { - "$ref": "EmbedTextRequest" - }, - "parameters": { - "model": { - "description": "Required. The model name to use with the format model=models/{model}.", - "type": "string", - "pattern": "^models/[^/]+$", - "required": true, - "location": "path" - } - }, - "description": "Generates an embedding from the model given an input message.", - "parameterOrder": [ - "model" - ], - "path": "v1beta/{+model}:embedText" + "fileUri": { + "description": "Required. URI.", + "type": "string" + } + } + }, + "ExecutableCode": { + "id": "ExecutableCode", + "description": "Code generated by the model that is meant to be executed, and the result returned to the model. Only generated when using the `CodeExecution` tool, in which the code will be automatically executed, and a corresponding `CodeExecutionResult` will also be generated.", + "type": "object", + "properties": { + "id": { + "description": "Optional. Unique identifier of the `ExecutableCode` part. The server returns the `CodeExecutionResult` with the matching `id`.", + "type": "string" }, - "predict": { - "id": "generativelanguage.models.predict", - "response": { - "$ref": "PredictResponse" - }, - "flatPath": "v1beta/models/{modelsId}:predict", - "httpMethod": "POST", - "request": { - "$ref": "PredictRequest" - }, - "parameters": { - "model": { - "pattern": "^models/[^/]+$", - "type": "string", - "description": "Required. The name of the model for prediction. Format: `name=models/{model}`.", - "location": "path", - "required": true - } - }, - "description": "Performs a prediction request.", - "parameterOrder": [ - "model" + "language": { + "description": "Required. Programming language of the `code`.", + "type": "string", + "enumDescriptions": [ + "Unspecified language. This value should not be used.", + "Python \u003e= 3.10, with numpy and simpy available. Python is the default language." ], - "path": "v1beta/{+model}:predict" + "enum": [ + "LANGUAGE_UNSPECIFIED", + "PYTHON" + ] }, - "generateMessage": { - "description": "Generates a response from the model given an input `MessagePrompt`.", - "parameterOrder": [ - "model" - ], - "path": "v1beta/{+model}:generateMessage", - "parameters": { - "model": { - "pattern": "^models/[^/]+$", - "type": "string", - "description": "Required. The name of the model to use. Format: `name=models/{model}`.", - "location": "path", - "required": true - } - }, - "httpMethod": "POST", - "request": { - "$ref": "GenerateMessageRequest" - }, - "id": "generativelanguage.models.generateMessage", - "response": { - "$ref": "GenerateMessageResponse" - }, - "flatPath": "v1beta/models/{modelsId}:generateMessage" + "code": { + "description": "Required. The code to be executed.", + "type": "string" + } + } + }, + "CodeExecutionResult": { + "id": "CodeExecutionResult", + "description": "Result of executing the `ExecutableCode`. Generated only when the `CodeExecution` tool is used.", + "type": "object", + "properties": { + "id": { + "description": "Optional. The identifier of the `ExecutableCode` part this result is for. Only populated if the corresponding `ExecutableCode` has an id.", + "type": "string" }, - "generateContent": { - "description": "Generates a model response given an input `GenerateContentRequest`. Refer to the [text generation guide](https://ai.google.dev/gemini-api/docs/text-generation) for detailed usage information. Input capabilities differ between models, including tuned models. Refer to the [model guide](https://ai.google.dev/gemini-api/docs/models/gemini) and [tuning guide](https://ai.google.dev/gemini-api/docs/model-tuning) for details.", - "path": "v1beta/{+model}:generateContent", - "parameterOrder": [ - "model" + "outcome": { + "description": "Required. Outcome of the code execution.", + "type": "string", + "enumDescriptions": [ + "Unspecified status. This value should not be used.", + "Code execution completed successfully. `output` contains the stdout, if any.", + "Code execution failed. `output` contains the stderr and stdout, if any.", + "Code execution ran for too long, and was cancelled. There may or may not be a partial `output` present." ], - "parameters": { - "model": { - "pattern": "^models/[^/]+$", - "type": "string", - "description": "Required. The name of the `Model` to use for generating the completion. Format: `models/{model}`.", - "location": "path", - "required": true - } - }, - "request": { - "$ref": "GenerateContentRequest" - }, - "httpMethod": "POST", - "id": "generativelanguage.models.generateContent", - "response": { - "$ref": "GenerateContentResponse" - }, - "flatPath": "v1beta/models/{modelsId}:generateContent" + "enum": [ + "OUTCOME_UNSPECIFIED", + "OUTCOME_OK", + "OUTCOME_FAILED", + "OUTCOME_DEADLINE_EXCEEDED" + ] }, - "countTokens": { - "path": "v1beta/{+model}:countTokens", - "parameterOrder": [ - "model" - ], - "description": "Runs a model's tokenizer on input `Content` and returns the token count. Refer to the [tokens guide](https://ai.google.dev/gemini-api/docs/tokens) to learn more about tokens.", - "parameters": { - "model": { - "pattern": "^models/[^/]+$", - "description": "Required. The model's resource name. This serves as an ID for the Model to use. This name should match a model name returned by the `ListModels` method. Format: `models/{model}`", - "type": "string", - "required": true, - "location": "path" - } - }, - "request": { - "$ref": "CountTokensRequest" - }, - "httpMethod": "POST", - "flatPath": "v1beta/models/{modelsId}:countTokens", - "id": "generativelanguage.models.countTokens", - "response": { - "$ref": "CountTokensResponse" - } + "output": { + "description": "Optional. Contains stdout when code execution is successful, stderr or other description otherwise.", + "type": "string" + } + } + }, + "ToolCall": { + "id": "ToolCall", + "description": "A predicted server-side `ToolCall` returned from the model. This message contains information about a tool that the model wants to invoke. The client is NOT expected to execute this `ToolCall`. Instead, the client should pass this `ToolCall` back to the API in a subsequent turn within a `Content` message, along with the corresponding `ToolResponse`.", + "type": "object", + "properties": { + "id": { + "description": "Optional. Unique identifier of the tool call. The server returns the tool response with the matching `id`.", + "type": "string" }, - "generateText": { - "httpMethod": "POST", - "request": { - "$ref": "GenerateTextRequest" - }, - "flatPath": "v1beta/models/{modelsId}:generateText", - "id": "generativelanguage.models.generateText", - "response": { - "$ref": "GenerateTextResponse" - }, - "parameterOrder": [ - "model" + "toolType": { + "description": "Required. The type of tool that was called.", + "type": "string", + "enumDescriptions": [ + "Unspecified tool type.", + "Google search tool, maps to Tool.google_search.search_types.web_search.", + "Image search tool, maps to Tool.google_search.search_types.image_search.", + "URL context tool, maps to Tool.url_context.", + "Google maps tool, maps to Tool.google_maps.", + "File search tool, maps to Tool.file_search." ], - "path": "v1beta/{+model}:generateText", - "description": "Generates a response from the model given an input message.", - "parameters": { - "model": { - "pattern": "^models/[^/]+$", - "description": "Required. The name of the `Model` or `TunedModel` to use for generating the completion. Examples: models/text-bison-001 tunedModels/sentence-translator-u3b7m", - "type": "string", - "required": true, - "location": "path" - } - } + "enum": [ + "TOOL_TYPE_UNSPECIFIED", + "GOOGLE_SEARCH_WEB", + "GOOGLE_SEARCH_IMAGE", + "URL_CONTEXT", + "GOOGLE_MAPS", + "FILE_SEARCH" + ] }, - "get": { - "id": "generativelanguage.models.get", - "parameters": { - "name": { - "required": true, - "location": "path", - "pattern": "^models/[^/]+$", - "description": "Required. The resource name of the model. This name should match a model name returned by the `ListModels` method. Format: `models/{model}`", - "type": "string" - } - }, - "response": { - "$ref": "Model" - }, - "flatPath": "v1beta/models/{modelsId}", - "description": "Gets information about a specific `Model` such as its version number, token limits, [parameters](https://ai.google.dev/gemini-api/docs/models/generative-models#model-parameters) and other metadata. Refer to the [Gemini models guide](https://ai.google.dev/gemini-api/docs/models/gemini) for detailed model information.", - "httpMethod": "GET", - "parameterOrder": [ - "name" - ], - "path": "v1beta/{+name}" - } - }, - "resources": { - "operations": { - "methods": { - "list": { - "httpMethod": "GET", - "parameterOrder": [ - "name" - ], - "path": "v1beta/{+name}/operations", - "description": "Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns `UNIMPLEMENTED`.", - "flatPath": "v1beta/models/{modelsId}/operations", - "id": "generativelanguage.models.operations.list", - "parameters": { - "filter": { - "description": "The standard list filter.", - "location": "query", - "type": "string" - }, - "name": { - "required": true, - "location": "path", - "description": "The name of the operation's parent resource.", - "type": "string", - "pattern": "^models/[^/]+$" - }, - "pageToken": { - "location": "query", - "type": "string", - "description": "The standard list page token." - }, - "pageSize": { - "location": "query", - "type": "integer", - "description": "The standard list page size.", - "format": "int32" - }, - "returnPartialSuccess": { - "location": "query", - "type": "boolean", - "description": "When set to `true`, operations that are reachable are returned as normal, and those that are unreachable are returned in the ListOperationsResponse.unreachable field. This can only be `true` when reading across collections. For example, when `parent` is set to `\"projects/example/locations/-\"`. This field is not supported by default and will result in an `UNIMPLEMENTED` error if set unless explicitly documented otherwise in service or product specific documentation." - } - }, - "response": { - "$ref": "ListOperationsResponse" - } - }, - "get": { - "path": "v1beta/{+name}", - "httpMethod": "GET", - "parameterOrder": [ - "name" - ], - "description": "Gets the latest state of a long-running operation. Clients can use this method to poll the operation result at intervals as recommended by the API service.", - "flatPath": "v1beta/models/{modelsId}/operations/{operationsId}", - "id": "generativelanguage.models.operations.get", - "parameters": { - "name": { - "required": true, - "location": "path", - "pattern": "^models/[^/]+/operations/[^/]+$", - "description": "The name of the operation resource.", - "type": "string" - } - }, - "response": { - "$ref": "Operation" - } - } - } + "args": { + "description": "Optional. The tool call arguments. Example: {\"arg1\" : \"value1\", \"arg2\" : \"value2\" , ...}", + "type": "object", + "additionalProperties": { + "type": "any", + "description": "Properties of the object." + } } } }, - "fileSearchStores": { - "methods": { - "create": { - "flatPath": "v1beta/fileSearchStores", - "id": "generativelanguage.fileSearchStores.create", - "response": { - "$ref": "FileSearchStore" - }, - "request": { - "$ref": "FileSearchStore" - }, - "httpMethod": "POST", - "parameters": {}, - "path": "v1beta/fileSearchStores", - "parameterOrder": [], - "description": "Creates an empty `FileSearchStore`." - }, - "list": { - "httpMethod": "GET", - "parameterOrder": [], - "path": "v1beta/fileSearchStores", - "description": "Lists all `FileSearchStores` owned by the user.", - "flatPath": "v1beta/fileSearchStores", - "id": "generativelanguage.fileSearchStores.list", - "parameters": { - "pageSize": { - "format": "int32", - "location": "query", - "type": "integer", - "description": "Optional. The maximum number of `FileSearchStores` to return (per page). The service may return fewer `FileSearchStores`. If unspecified, at most 10 `FileSearchStores` will be returned. The maximum size limit is 20 `FileSearchStores` per page." - }, - "pageToken": { - "location": "query", - "type": "string", - "description": "Optional. A page token, received from a previous `ListFileSearchStores` call. Provide the `next_page_token` returned in the response as an argument to the next request to retrieve the next page. When paginating, all other parameters provided to `ListFileSearchStores` must match the call that provided the page token." - } - }, - "response": { - "$ref": "ListFileSearchStoresResponse" - } + "ToolResponse": { + "id": "ToolResponse", + "description": "The output from a server-side `ToolCall` execution. This message contains the results of a tool invocation that was initiated by a `ToolCall` from the model. The client should pass this `ToolResponse` back to the API in a subsequent turn within a `Content` message, along with the corresponding `ToolCall`.", + "type": "object", + "properties": { + "id": { + "description": "Optional. The identifier of the tool call this response is for.", + "type": "string" }, - "importFile": { - "path": "v1beta/{+fileSearchStoreName}:importFile", - "parameterOrder": [ - "fileSearchStoreName" - ], - "scopes": [ - "https://www.googleapis.com/auth/devstorage.read_only" + "toolType": { + "description": "Required. The type of tool that was called, matching the `tool_type` in the corresponding `ToolCall`.", + "type": "string", + "enumDescriptions": [ + "Unspecified tool type.", + "Google search tool, maps to Tool.google_search.search_types.web_search.", + "Image search tool, maps to Tool.google_search.search_types.image_search.", + "URL context tool, maps to Tool.url_context.", + "Google maps tool, maps to Tool.google_maps.", + "File search tool, maps to Tool.file_search." ], - "description": "Imports a `File` from File Service to a `FileSearchStore`.", - "parameters": { - "fileSearchStoreName": { - "required": true, - "location": "path", - "description": "Required. Immutable. The name of the `FileSearchStore` to import the file into. Example: `fileSearchStores/my-file-search-store-123`", - "type": "string", - "pattern": "^fileSearchStores/[^/]+$" - } - }, - "request": { - "$ref": "ImportFileRequest" - }, - "httpMethod": "POST", - "flatPath": "v1beta/fileSearchStores/{fileSearchStoresId}:importFile", - "id": "generativelanguage.fileSearchStores.importFile", - "response": { - "$ref": "Operation" + "enum": [ + "TOOL_TYPE_UNSPECIFIED", + "GOOGLE_SEARCH_WEB", + "GOOGLE_SEARCH_IMAGE", + "URL_CONTEXT", + "GOOGLE_MAPS", + "FILE_SEARCH" + ] + }, + "response": { + "description": "Optional. The tool response.", + "type": "object", + "additionalProperties": { + "type": "any", + "description": "Properties of the object." } + } + } + }, + "VideoMetadata": { + "id": "VideoMetadata", + "deprecated": true, + "description": "Deprecated: Use `GenerateContentRequest.processing_options` instead. Metadata describes the input video content.", + "type": "object", + "properties": { + "startOffset": { + "description": "Optional. The start offset of the video.", + "type": "string", + "format": "google-duration" }, - "delete": { - "flatPath": "v1beta/fileSearchStores/{fileSearchStoresId}", - "id": "generativelanguage.fileSearchStores.delete", - "parameters": { - "name": { - "type": "string", - "description": "Required. The resource name of the `FileSearchStore`. Example: `fileSearchStores/my-file-search-store-123`", - "pattern": "^fileSearchStores/[^/]+$", - "location": "path", - "required": true - }, - "force": { - "location": "query", - "type": "boolean", - "description": "Optional. If set to true, any `Document`s and objects related to this `FileSearchStore` will also be deleted. If false (the default), a `FAILED_PRECONDITION` error will be returned if `FileSearchStore` contains any `Document`s." - } - }, - "response": { - "$ref": "Empty" - }, - "path": "v1beta/{+name}", - "httpMethod": "DELETE", - "parameterOrder": [ - "name" - ], - "description": "Deletes a `FileSearchStore`." + "endOffset": { + "description": "Optional. The end offset of the video.", + "type": "string", + "format": "google-duration" }, - "get": { - "httpMethod": "GET", - "parameterOrder": [ - "name" - ], - "path": "v1beta/{+name}", - "description": "Gets information about a specific `FileSearchStore`.", - "flatPath": "v1beta/fileSearchStores/{fileSearchStoresId}", - "id": "generativelanguage.fileSearchStores.get", - "parameters": { - "name": { - "pattern": "^fileSearchStores/[^/]+$", - "description": "Required. The name of the `FileSearchStore`. Example: `fileSearchStores/my-file-search-store-123`", - "type": "string", - "required": true, - "location": "path" - } - }, - "response": { - "$ref": "FileSearchStore" - } + "fps": { + "description": "Optional. The frame rate of the video sent to the model. If not specified, the default value will be 1.0. The fps range is (0.0, 24.0].", + "type": "number", + "format": "double" } - }, - "resources": { - "operations": { - "methods": { - "get": { - "description": "Gets the latest state of a long-running operation. Clients can use this method to poll the operation result at intervals as recommended by the API service.", - "httpMethod": "GET", - "parameterOrder": [ - "name" - ], - "path": "v1beta/{+name}", - "id": "generativelanguage.fileSearchStores.operations.get", - "parameters": { - "name": { - "location": "path", - "required": true, - "type": "string", - "description": "The name of the operation resource.", - "pattern": "^fileSearchStores/[^/]+/operations/[^/]+$" - } - }, - "response": { - "$ref": "Operation" - }, - "flatPath": "v1beta/fileSearchStores/{fileSearchStoresId}/operations/{operationsId}" - } + } + }, + "Tool": { + "id": "Tool", + "description": "Tool details that the model may use to generate response. A `Tool` is a piece of code that enables the system to interact with external systems to perform an action, or set of actions, outside of knowledge and scope of the model. Next ID: 16", + "type": "object", + "properties": { + "functionDeclarations": { + "description": "Optional. A list of `FunctionDeclarations` available to the model that can be used for function calling. The model or system does not execute the function. Instead the defined function may be returned as a FunctionCall with arguments to the client side for execution. The model may decide to call a subset of these functions by populating FunctionCall in the response. The next conversation turn may contain a FunctionResponse with the Content.role \"function\" generation context for the next model turn.", + "type": "array", + "items": { + "$ref": "FunctionDeclaration" } }, - "upload": { - "resources": { - "operations": { - "methods": { - "get": { - "path": "v1beta/{+name}", - "httpMethod": "GET", - "parameterOrder": [ - "name" - ], - "description": "Gets the latest state of a long-running operation. Clients can use this method to poll the operation result at intervals as recommended by the API service.", - "flatPath": "v1beta/fileSearchStores/{fileSearchStoresId}/upload/operations/{operationsId}", - "id": "generativelanguage.fileSearchStores.upload.operations.get", - "parameters": { - "name": { - "type": "string", - "description": "The name of the operation resource.", - "pattern": "^fileSearchStores/[^/]+/upload/operations/[^/]+$", - "location": "path", - "required": true - } - }, - "response": { - "$ref": "Operation" - } - } - } - } - } + "googleSearchRetrieval": { + "description": "Optional. Retrieval tool that is powered by Google search.", + "$ref": "GoogleSearchRetrieval" }, - "documents": { - "methods": { - "delete": { - "id": "generativelanguage.fileSearchStores.documents.delete", - "parameters": { - "name": { - "required": true, - "location": "path", - "pattern": "^fileSearchStores/[^/]+/documents/[^/]+$", - "description": "Required. The resource name of the `Document` to delete. Example: `fileSearchStores/my-file-search-store-123/documents/the-doc-abc`", - "type": "string" - }, - "force": { - "location": "query", - "type": "boolean", - "description": "Optional. If set to true, any `Chunk`s and objects related to this `Document` will also be deleted. If false (the default), a `FAILED_PRECONDITION` error will be returned if `Document` contains any `Chunk`s." - } - }, - "response": { - "$ref": "Empty" - }, - "flatPath": "v1beta/fileSearchStores/{fileSearchStoresId}/documents/{documentsId}", - "description": "Deletes a `Document`.", - "path": "v1beta/{+name}", - "httpMethod": "DELETE", - "parameterOrder": [ - "name" - ] - }, - "list": { - "id": "generativelanguage.fileSearchStores.documents.list", - "parameters": { - "parent": { - "location": "path", - "required": true, - "pattern": "^fileSearchStores/[^/]+$", - "type": "string", - "description": "Required. The name of the `FileSearchStore` containing `Document`s. Example: `fileSearchStores/my-file-search-store-123`" - }, - "pageToken": { - "description": "Optional. A page token, received from a previous `ListDocuments` call. Provide the `next_page_token` returned in the response as an argument to the next request to retrieve the next page. When paginating, all other parameters provided to `ListDocuments` must match the call that provided the page token.", - "location": "query", - "type": "string" - }, - "pageSize": { - "description": "Optional. The maximum number of `Document`s to return (per page). The service may return fewer `Document`s. If unspecified, at most 10 `Document`s will be returned. The maximum size limit is 20 `Document`s per page.", - "location": "query", - "type": "integer", - "format": "int32" - } - }, - "response": { - "$ref": "ListDocumentsResponse" - }, - "flatPath": "v1beta/fileSearchStores/{fileSearchStoresId}/documents", - "description": "Lists all `Document`s in a `Corpus`.", - "path": "v1beta/{+parent}/documents", - "httpMethod": "GET", - "parameterOrder": [ - "parent" - ] - }, - "get": { - "path": "v1beta/{+name}", - "httpMethod": "GET", - "parameterOrder": [ - "name" - ], - "description": "Gets information about a specific `Document`.", - "flatPath": "v1beta/fileSearchStores/{fileSearchStoresId}/documents/{documentsId}", - "id": "generativelanguage.fileSearchStores.documents.get", - "parameters": { - "name": { - "required": true, - "location": "path", - "pattern": "^fileSearchStores/[^/]+/documents/[^/]+$", - "description": "Required. The name of the `Document` to retrieve. Example: `fileSearchStores/my-file-search-store-123/documents/the-doc-abc`", - "type": "string" - } - }, - "response": { - "$ref": "Document" - } - } + "codeExecution": { + "description": "Optional. Enables the model to execute code as part of generation.", + "$ref": "CodeExecution" + }, + "googleSearch": { + "description": "Optional. GoogleSearch tool type. Tool to support Google Search in Model. Powered by Google.", + "$ref": "GoogleSearch" + }, + "computerUse": { + "description": "Optional. Tool to support the model interacting directly with the computer. If enabled, it automatically populates computer-use specific Function Declarations.", + "$ref": "ComputerUse" + }, + "urlContext": { + "description": "Optional. Tool to support URL context retrieval.", + "$ref": "UrlContext" + }, + "fileSearch": { + "description": "Optional. FileSearch tool type. Tool to retrieve knowledge from Semantic Retrieval corpora.", + "$ref": "FileSearch" + }, + "mcpServers": { + "description": "Optional. MCP Servers to connect to.", + "type": "array", + "items": { + "$ref": "McpServer" } + }, + "googleMaps": { + "description": "Optional. Tool that allows grounding the model's response with geospatial context related to the user's query.", + "$ref": "GoogleMaps" } } }, - "batches": { - "methods": { - "get": { - "httpMethod": "GET", - "parameterOrder": [ - "name" - ], - "path": "v1beta/{+name}", - "description": "Gets the latest state of a long-running operation. Clients can use this method to poll the operation result at intervals as recommended by the API service.", - "flatPath": "v1beta/batches/{batchesId}", - "id": "generativelanguage.batches.get", - "parameters": { - "name": { - "pattern": "^batches/[^/]+$", - "type": "string", - "description": "The name of the operation resource.", - "location": "path", - "required": true - } - }, - "response": { - "$ref": "Operation" - } + "FunctionDeclaration": { + "id": "FunctionDeclaration", + "description": "Structured representation of a function declaration as defined by the [OpenAPI 3.03 specification](https://spec.openapis.org/oas/v3.0.3). Included in this declaration are the function name and parameters. This FunctionDeclaration is a representation of a block of code that can be used as a `Tool` by the model and executed by the client.", + "type": "object", + "properties": { + "name": { + "description": "Required. The name of the function. Must be a-z, A-Z, 0-9, or contain underscores, colons, dots, and dashes, with a maximum length of 128.", + "type": "string" }, - "delete": { - "flatPath": "v1beta/batches/{batchesId}", - "id": "generativelanguage.batches.delete", - "parameters": { - "name": { - "location": "path", - "required": true, - "type": "string", - "description": "The name of the operation resource to be deleted.", - "pattern": "^batches/[^/]+$" - } - }, - "response": { - "$ref": "Empty" - }, - "httpMethod": "DELETE", - "parameterOrder": [ - "name" - ], - "path": "v1beta/{+name}", - "description": "Deletes a long-running operation. This method indicates that the client is no longer interested in the operation result. It does not cancel the operation. If the server doesn't support this method, it returns `google.rpc.Code.UNIMPLEMENTED`." + "description": { + "description": "Required. A brief description of the function.", + "type": "string" }, - "cancel": { - "description": "Starts asynchronous cancellation on a long-running operation. The server makes a best effort to cancel the operation, but success is not guaranteed. If the server doesn't support this method, it returns `google.rpc.Code.UNIMPLEMENTED`. Clients can use Operations.GetOperation or other methods to check whether the cancellation succeeded or whether the operation completed despite cancellation. On successful cancellation, the operation is not deleted; instead, it becomes an operation with an Operation.error value with a google.rpc.Status.code of `1`, corresponding to `Code.CANCELLED`.", - "path": "v1beta/{+name}:cancel", - "httpMethod": "POST", - "parameterOrder": [ - "name" - ], - "id": "generativelanguage.batches.cancel", - "parameters": { - "name": { - "location": "path", - "required": true, - "type": "string", - "description": "The name of the operation resource to be cancelled.", - "pattern": "^batches/[^/]+$" - } - }, - "response": { - "$ref": "Empty" - }, - "flatPath": "v1beta/batches/{batchesId}:cancel" + "parameters": { + "description": "Optional. Describes the parameters to this function. Reflects the Open API 3.03 Parameter Object string Key: the name of the parameter. Parameter names are case sensitive. Schema Value: the Schema defining the type used for the parameter.", + "$ref": "Schema" }, - "updateGenerateContentBatch": { - "parameters": { - "name": { - "pattern": "^batches/[^/]+$", - "description": "Output only. Identifier. Resource name of the batch. Format: `batches/{batch_id}`.", - "type": "string", - "required": true, - "location": "path" - }, - "updateMask": { - "format": "google-fieldmask", - "location": "query", - "type": "string", - "description": "Optional. The list of fields to update." - } - }, - "parameterOrder": [ - "name" - ], - "path": "v1beta/{+name}:updateGenerateContentBatch", - "description": "Updates a batch of GenerateContent requests for batch processing.", - "flatPath": "v1beta/batches/{batchesId}:updateGenerateContentBatch", - "id": "generativelanguage.batches.updateGenerateContentBatch", - "response": { - "$ref": "GenerateContentBatch" - }, - "httpMethod": "PATCH", - "request": { - "$ref": "GenerateContentBatch" - } + "parametersJsonSchema": { + "description": "Optional. Describes the parameters to the function in JSON Schema format. The schema must describe an object where the properties are the parameters to the function. For example: ``` { \"type\": \"object\", \"properties\": { \"name\": { \"type\": \"string\" }, \"age\": { \"type\": \"integer\" } }, \"additionalProperties\": false, \"required\": [\"name\", \"age\"], \"propertyOrdering\": [\"name\", \"age\"] } ``` This field is mutually exclusive with `parameters`.", + "type": "any" }, - "list": { - "description": "Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns `UNIMPLEMENTED`.", - "httpMethod": "GET", - "parameterOrder": [ - "name" + "response": { + "description": "Optional. Describes the output from this function in JSON Schema format. Reflects the Open API 3.03 Response Object. The Schema defines the type used for the response value of the function.", + "$ref": "Schema" + }, + "responseJsonSchema": { + "description": "Optional. Describes the output from this function in JSON Schema format. The value specified by the schema is the response value of the function. This field is mutually exclusive with `response`.", + "type": "any" + }, + "behavior": { + "description": "Optional. Specifies the function Behavior. Currently only supported by the BidiGenerateContent method.", + "type": "string", + "enumDescriptions": [ + "This value is unused.", + "If set, the system will wait to receive the function response before continuing the conversation.", + "If set, the system will not wait to receive the function response. Instead, it will attempt to handle function responses as they become available while maintaining the conversation between the user and the model." ], - "path": "v1beta/{+name}", - "id": "generativelanguage.batches.list", - "parameters": { - "name": { - "location": "path", - "required": true, - "type": "string", - "description": "The name of the operation's parent resource.", - "pattern": "^batches$" - }, - "pageToken": { - "description": "The standard list page token.", - "location": "query", - "type": "string" - }, - "filter": { - "location": "query", - "type": "string", - "description": "The standard list filter." - }, - "pageSize": { - "format": "int32", - "description": "The standard list page size.", - "location": "query", - "type": "integer" - }, - "returnPartialSuccess": { - "location": "query", - "type": "boolean", - "description": "When set to `true`, operations that are reachable are returned as normal, and those that are unreachable are returned in the ListOperationsResponse.unreachable field. This can only be `true` when reading across collections. For example, when `parent` is set to `\"projects/example/locations/-\"`. This field is not supported by default and will result in an `UNIMPLEMENTED` error if set unless explicitly documented otherwise in service or product specific documentation." - } - }, - "response": { - "$ref": "ListOperationsResponse" - }, - "flatPath": "v1beta/batches" - }, - "updateEmbedContentBatch": { - "flatPath": "v1beta/batches/{batchesId}:updateEmbedContentBatch", - "id": "generativelanguage.batches.updateEmbedContentBatch", - "response": { - "$ref": "EmbedContentBatch" - }, - "request": { - "$ref": "EmbedContentBatch" - }, - "httpMethod": "PATCH", - "parameters": { - "name": { - "location": "path", - "required": true, - "pattern": "^batches/[^/]+$", - "type": "string", - "description": "Output only. Identifier. Resource name of the batch. Format: `batches/{batch_id}`." - }, - "updateMask": { - "format": "google-fieldmask", - "location": "query", - "type": "string", - "description": "Optional. The list of fields to update." - } - }, - "path": "v1beta/{+name}:updateEmbedContentBatch", - "parameterOrder": [ - "name" - ], - "description": "Updates a batch of EmbedContent requests for batch processing." + "enum": [ + "UNSPECIFIED", + "BLOCKING", + "NON_BLOCKING" + ] } } }, - "cachedContents": { - "methods": { - "patch": { - "path": "v1beta/{+name}", - "parameterOrder": [ - "name" - ], - "scopes": [ - "https://www.googleapis.com/auth/devstorage.read_only" + "Schema": { + "id": "Schema", + "description": "The `Schema` object allows the definition of input and output data types. These types can be objects, but also primitives and arrays. Represents a select subset of an [OpenAPI 3.0 schema object](https://spec.openapis.org/oas/v3.0.3#schema).", + "type": "object", + "properties": { + "type": { + "description": "Required. Data type.", + "type": "string", + "enumDescriptions": [ + "Not specified, should not be used.", + "String type.", + "Number type.", + "Integer type.", + "Boolean type.", + "Array type.", + "Object type.", + "Null type." ], - "description": "Updates CachedContent resource (only expiration is updatable).", - "parameters": { - "updateMask": { - "format": "google-fieldmask", - "description": "The list of fields to update.", - "location": "query", - "type": "string" - }, - "name": { - "pattern": "^cachedContents/[^/]+$", - "type": "string", - "description": "Output only. Identifier. The resource name referring to the cached content. Format: `cachedContents/{id}`", - "location": "path", - "required": true - } - }, - "request": { - "$ref": "CachedContent" - }, - "httpMethod": "PATCH", - "flatPath": "v1beta/cachedContents/{cachedContentsId}", - "id": "generativelanguage.cachedContents.patch", - "response": { - "$ref": "CachedContent" - } + "enum": [ + "TYPE_UNSPECIFIED", + "STRING", + "NUMBER", + "INTEGER", + "BOOLEAN", + "ARRAY", + "OBJECT", + "NULL" + ] }, - "list": { - "parameters": { - "pageSize": { - "location": "query", - "type": "integer", - "description": "Optional. The maximum number of cached contents to return. The service may return fewer than this value. If unspecified, some default (under maximum) number of items will be returned. The maximum value is 1000; values above 1000 will be coerced to 1000.", - "format": "int32" - }, - "pageToken": { - "description": "Optional. A page token, received from a previous `ListCachedContents` call. Provide this to retrieve the subsequent page. When paginating, all other parameters provided to `ListCachedContents` must match the call that provided the page token.", - "location": "query", - "type": "string" - } - }, - "scopes": [ - "https://www.googleapis.com/auth/devstorage.read_only" - ], - "description": "Lists CachedContents.", - "parameterOrder": [], - "path": "v1beta/cachedContents", - "id": "generativelanguage.cachedContents.list", - "response": { - "$ref": "ListCachedContentsResponse" - }, - "flatPath": "v1beta/cachedContents", - "httpMethod": "GET" + "format": { + "description": "Optional. The format of the data. Any value is allowed, but most do not trigger any special functionality.", + "type": "string" }, - "create": { - "request": { - "$ref": "CachedContent" - }, - "httpMethod": "POST", - "id": "generativelanguage.cachedContents.create", - "response": { - "$ref": "CachedContent" - }, - "flatPath": "v1beta/cachedContents", - "scopes": [ - "https://www.googleapis.com/auth/devstorage.read_only" - ], - "description": "Creates CachedContent resource.", - "path": "v1beta/cachedContents", - "parameterOrder": [], - "parameters": {} + "title": { + "description": "Optional. The title of the schema.", + "type": "string" }, - "get": { - "scopes": [ - "https://www.googleapis.com/auth/devstorage.read_only" - ], - "description": "Reads CachedContent resource.", - "path": "v1beta/{+name}", - "parameterOrder": [ - "name" - ], - "parameters": { - "name": { - "location": "path", - "required": true, - "pattern": "^cachedContents/[^/]+$", - "type": "string", - "description": "Required. The resource name referring to the content cache entry. Format: `cachedContents/{id}`" - } - }, - "httpMethod": "GET", - "id": "generativelanguage.cachedContents.get", - "response": { - "$ref": "CachedContent" - }, - "flatPath": "v1beta/cachedContents/{cachedContentsId}" + "description": { + "description": "Optional. A brief description of the parameter. This could contain examples of use. Parameter description may be formatted as Markdown.", + "type": "string" }, - "delete": { - "parameterOrder": [ - "name" - ], - "path": "v1beta/{+name}", - "scopes": [ - "https://www.googleapis.com/auth/devstorage.read_only" - ], - "description": "Deletes CachedContent resource.", - "parameters": { - "name": { - "required": true, - "location": "path", - "pattern": "^cachedContents/[^/]+$", - "description": "Required. The resource name referring to the content cache entry Format: `cachedContents/{id}`", - "type": "string" - } - }, - "httpMethod": "DELETE", - "flatPath": "v1beta/cachedContents/{cachedContentsId}", - "id": "generativelanguage.cachedContents.delete", - "response": { - "$ref": "Empty" + "nullable": { + "description": "Optional. Indicates if the value may be null.", + "type": "boolean" + }, + "enum": { + "description": "Optional. Possible values of the element of Type.STRING with enum format. For example we can define an Enum Direction as : {type:STRING, format:enum, enum:[\"EAST\", NORTH\", \"SOUTH\", \"WEST\"]}", + "type": "array", + "items": { + "type": "string" } - } - } - }, - "files": { - "methods": { - "register": { - "scopes": [ - "https://www.googleapis.com/auth/devstorage.read_only" - ], - "description": "Registers a Google Cloud Storage files with FileService. The user is expected to provide Google Cloud Storage URIs and will receive a File resource for each URI in return. Note that the files are not copied, just registered with File API. If one file fails to register, the whole request fails.", - "path": "v1beta/files:register", - "parameterOrder": [], - "parameters": {}, - "request": { - "$ref": "RegisterFilesRequest" - }, - "httpMethod": "POST", - "id": "generativelanguage.files.register", - "response": { - "$ref": "RegisterFilesResponse" - }, - "flatPath": "v1beta/files:register" }, - "list": { - "id": "generativelanguage.files.list", - "response": { - "$ref": "ListFilesResponse" - }, - "flatPath": "v1beta/files", - "httpMethod": "GET", - "parameters": { - "pageSize": { - "location": "query", - "type": "integer", - "description": "Optional. Maximum number of `File`s to return per page. If unspecified, defaults to 10. Maximum `page_size` is 100.", - "format": "int32" - }, - "pageToken": { - "description": "Optional. A page token from a previous `ListFiles` call.", - "location": "query", - "type": "string" - } - }, - "scopes": [ - "https://www.googleapis.com/auth/devstorage.read_only" - ], - "description": "Lists the metadata for `File`s owned by the requesting project.", - "path": "v1beta/files", - "parameterOrder": [] + "items": { + "description": "Optional. Schema of the elements of Type.ARRAY.", + "$ref": "Schema" }, - "delete": { - "httpMethod": "DELETE", - "flatPath": "v1beta/files/{filesId}", - "id": "generativelanguage.files.delete", - "response": { - "$ref": "Empty" - }, - "parameterOrder": [ - "name" - ], - "path": "v1beta/{+name}", - "scopes": [ - "https://www.googleapis.com/auth/devstorage.read_only" - ], - "description": "Deletes the `File`.", - "parameters": { - "name": { - "type": "string", - "description": "Required. The name of the `File` to delete. Example: `files/abc-123`", - "pattern": "^files/[^/]+$", - "location": "path", - "required": true - } + "maxItems": { + "description": "Optional. Maximum number of the elements for Type.ARRAY.", + "type": "string", + "format": "int64" + }, + "minItems": { + "description": "Optional. Minimum number of the elements for Type.ARRAY.", + "type": "string", + "format": "int64" + }, + "properties": { + "description": "Optional. Properties of Type.OBJECT.", + "type": "object", + "additionalProperties": { + "$ref": "Schema" } }, - "get": { - "parameters": { - "name": { - "location": "path", - "required": true, - "pattern": "^files/[^/]+$", - "type": "string", - "description": "Required. The name of the `File` to get. Example: `files/abc-123`" - } - }, - "path": "v1beta/{+name}", - "parameterOrder": [ - "name" - ], - "scopes": [ - "https://www.googleapis.com/auth/devstorage.read_only" - ], - "description": "Gets the metadata for the given `File`.", - "flatPath": "v1beta/files/{filesId}", - "id": "generativelanguage.files.get", - "response": { - "$ref": "File" - }, - "httpMethod": "GET" + "required": { + "description": "Optional. Required properties of Type.OBJECT.", + "type": "array", + "items": { + "type": "string" + } + }, + "minProperties": { + "description": "Optional. Minimum number of the properties for Type.OBJECT.", + "type": "string", + "format": "int64" + }, + "maxProperties": { + "description": "Optional. Maximum number of the properties for Type.OBJECT.", + "type": "string", + "format": "int64" + }, + "minimum": { + "description": "Optional. SCHEMA FIELDS FOR TYPE INTEGER and NUMBER Minimum value of the Type.INTEGER and Type.NUMBER", + "type": "number", + "format": "double" + }, + "maximum": { + "description": "Optional. Maximum value of the Type.INTEGER and Type.NUMBER", + "type": "number", + "format": "double" + }, + "minLength": { + "description": "Optional. SCHEMA FIELDS FOR TYPE STRING Minimum length of the Type.STRING", + "type": "string", + "format": "int64" + }, + "maxLength": { + "description": "Optional. Maximum length of the Type.STRING", + "type": "string", + "format": "int64" + }, + "pattern": { + "description": "Optional. Pattern of the Type.STRING to restrict a string to a regular expression.", + "type": "string" + }, + "example": { + "description": "Optional. Example of the object. Will only populated when the object is the root.", + "type": "any" + }, + "anyOf": { + "description": "Optional. The value should be validated against any (one or more) of the subschemas in the list.", + "type": "array", + "items": { + "$ref": "Schema" + } + }, + "propertyOrdering": { + "description": "Optional. The order of the properties. Not a standard field in open api spec. Used to determine the order of the properties in the response.", + "type": "array", + "items": { + "type": "string" + } + }, + "default": { + "description": "Optional. Default value of the field. Per JSON Schema, this field is intended for documentation generators and doesn't affect validation. Thus it's included here and ignored so that developers who send schemas with a `default` field don't get unknown-field errors.", + "type": "any" } } }, - "corpora": { - "methods": { - "get": { - "flatPath": "v1beta/corpora/{corporaId}", - "id": "generativelanguage.corpora.get", - "parameters": { - "name": { - "location": "path", - "required": true, - "pattern": "^corpora/[^/]+$", - "type": "string", - "description": "Required. The name of the `Corpus`. Example: `corpora/my-corpus-123`" - } - }, - "response": { - "$ref": "Corpus" - }, - "path": "v1beta/{+name}", - "httpMethod": "GET", - "parameterOrder": [ - "name" + "GoogleSearchRetrieval": { + "id": "GoogleSearchRetrieval", + "description": "Tool to retrieve public web data for grounding, powered by Google.", + "type": "object", + "properties": { + "dynamicRetrievalConfig": { + "description": "Specifies the dynamic retrieval configuration for the given source.", + "$ref": "DynamicRetrievalConfig" + } + } + }, + "DynamicRetrievalConfig": { + "id": "DynamicRetrievalConfig", + "description": "Describes the options to customize dynamic retrieval.", + "type": "object", + "properties": { + "mode": { + "description": "The mode of the predictor to be used in dynamic retrieval.", + "type": "string", + "enumDescriptions": [ + "Always trigger retrieval.", + "Run retrieval only when system decides it is necessary." ], - "description": "Gets information about a specific `Corpus`." + "enum": [ + "MODE_UNSPECIFIED", + "MODE_DYNAMIC" + ] }, - "create": { - "request": { - "$ref": "Corpus" - }, - "httpMethod": "POST", - "flatPath": "v1beta/corpora", - "id": "generativelanguage.corpora.create", - "response": { - "$ref": "Corpus" - }, - "path": "v1beta/corpora", - "parameterOrder": [], - "description": "Creates an empty `Corpus`.", - "parameters": {} + "dynamicThreshold": { + "description": "The threshold to be used in dynamic retrieval. If not set, a system default value is used.", + "type": "number", + "format": "float" + } + } + }, + "CodeExecution": { + "id": "CodeExecution", + "description": "Tool that executes code generated by the model, and automatically returns the result to the model. See also `ExecutableCode` and `CodeExecutionResult` which are only generated when using this tool.", + "type": "object", + "properties": {} + }, + "GoogleSearch": { + "id": "GoogleSearch", + "description": "GoogleSearch tool type. Tool to support Google Search in Model. Powered by Google.", + "type": "object", + "properties": { + "timeRangeFilter": { + "description": "Optional. Filter search results to a specific time range. If customers set a start time, they must set an end time (and vice versa).", + "$ref": "Interval" }, - "delete": { - "path": "v1beta/{+name}", - "httpMethod": "DELETE", - "parameterOrder": [ - "name" - ], - "description": "Deletes a `Corpus`.", - "flatPath": "v1beta/corpora/{corporaId}", - "id": "generativelanguage.corpora.delete", - "parameters": { - "name": { - "pattern": "^corpora/[^/]+$", - "type": "string", - "description": "Required. The resource name of the `Corpus`. Example: `corpora/my-corpus-123`", - "location": "path", - "required": true - }, - "force": { - "description": "Optional. If set to true, any `Document`s and objects related to this `Corpus` will also be deleted. If false (the default), a `FAILED_PRECONDITION` error will be returned if `Corpus` contains any `Document`s.", - "location": "query", - "type": "boolean" - } - }, - "response": { - "$ref": "Empty" - } + "searchTypes": { + "description": "Optional. The set of search types to enable. If not set, web search is enabled by default.", + "$ref": "SearchTypes" + } + } + }, + "Interval": { + "id": "Interval", + "description": "Represents a time interval, encoded as a Timestamp start (inclusive) and a Timestamp end (exclusive). The start must be less than or equal to the end. When the start equals the end, the interval is empty (matches no time). When both start and end are unspecified, the interval matches any time.", + "type": "object", + "properties": { + "startTime": { + "description": "Optional. Inclusive start of the interval. If specified, a Timestamp matching this interval will have to be the same or after the start.", + "type": "string", + "format": "google-datetime" }, - "list": { - "flatPath": "v1beta/corpora", - "id": "generativelanguage.corpora.list", - "parameters": { - "pageSize": { - "format": "int32", - "location": "query", - "type": "integer", - "description": "Optional. The maximum number of `Corpora` to return (per page). The service may return fewer `Corpora`. If unspecified, at most 10 `Corpora` will be returned. The maximum size limit is 20 `Corpora` per page." - }, - "pageToken": { - "location": "query", - "type": "string", - "description": "Optional. A page token, received from a previous `ListCorpora` call. Provide the `next_page_token` returned in the response as an argument to the next request to retrieve the next page. When paginating, all other parameters provided to `ListCorpora` must match the call that provided the page token." - } - }, - "response": { - "$ref": "ListCorporaResponse" - }, - "path": "v1beta/corpora", - "httpMethod": "GET", - "parameterOrder": [], - "description": "Lists all `Corpora` owned by the user." + "endTime": { + "description": "Optional. Exclusive end of the interval. If specified, a Timestamp matching this interval will have to be before the end.", + "type": "string", + "format": "google-datetime" } - }, - "resources": { - "operations": { - "methods": { - "get": { - "flatPath": "v1beta/corpora/{corporaId}/operations/{operationsId}", - "id": "generativelanguage.corpora.operations.get", - "parameters": { - "name": { - "pattern": "^corpora/[^/]+/operations/[^/]+$", - "description": "The name of the operation resource.", - "type": "string", - "required": true, - "location": "path" - } - }, - "response": { - "$ref": "Operation" - }, - "path": "v1beta/{+name}", - "httpMethod": "GET", - "parameterOrder": [ - "name" - ], - "description": "Gets the latest state of a long-running operation. Clients can use this method to poll the operation result at intervals as recommended by the API service." - } - } + } + }, + "SearchTypes": { + "id": "SearchTypes", + "description": "Different types of search that can be enabled on the GoogleSearch tool.", + "type": "object", + "properties": { + "webSearch": { + "description": "Optional. Enables web search. Only text results are returned.", + "$ref": "WebSearch" }, - "permissions": { - "methods": { - "patch": { - "httpMethod": "PATCH", - "request": { - "$ref": "Permission" - }, - "flatPath": "v1beta/corpora/{corporaId}/permissions/{permissionsId}", - "id": "generativelanguage.corpora.permissions.patch", - "response": { - "$ref": "Permission" - }, - "parameterOrder": [ - "name" - ], - "path": "v1beta/{+name}", - "description": "Updates the permission.", - "parameters": { - "updateMask": { - "format": "google-fieldmask", - "location": "query", - "type": "string", - "description": "Required. The list of fields to update. Accepted ones: - role (`Permission.role` field)" - }, - "name": { - "location": "path", - "required": true, - "pattern": "^corpora/[^/]+/permissions/[^/]+$", - "type": "string", - "description": "Output only. Identifier. The permission name. A unique name will be generated on create. Examples: tunedModels/{tuned_model}/permissions/{permission} corpora/{corpus}/permissions/{permission} Output only." - } - } - }, - "create": { - "id": "generativelanguage.corpora.permissions.create", - "response": { - "$ref": "Permission" - }, - "flatPath": "v1beta/corpora/{corporaId}/permissions", - "request": { - "$ref": "Permission" - }, - "httpMethod": "POST", - "parameters": { - "parent": { - "location": "path", - "required": true, - "pattern": "^corpora/[^/]+$", - "type": "string", - "description": "Required. The parent resource of the `Permission`. Formats: `tunedModels/{tuned_model}` `corpora/{corpus}`" - } - }, - "description": "Create a permission to a specific resource.", - "path": "v1beta/{+parent}/permissions", - "parameterOrder": [ - "parent" - ] - }, - "list": { - "flatPath": "v1beta/corpora/{corporaId}/permissions", - "id": "generativelanguage.corpora.permissions.list", - "parameters": { - "pageToken": { - "description": "Optional. A page token, received from a previous `ListPermissions` call. Provide the `page_token` returned by one request as an argument to the next request to retrieve the next page. When paginating, all other parameters provided to `ListPermissions` must match the call that provided the page token.", - "location": "query", - "type": "string" - }, - "parent": { - "pattern": "^corpora/[^/]+$", - "type": "string", - "description": "Required. The parent resource of the permissions. Formats: `tunedModels/{tuned_model}` `corpora/{corpus}`", - "location": "path", - "required": true - }, - "pageSize": { - "format": "int32", - "location": "query", - "type": "integer", - "description": "Optional. The maximum number of `Permission`s to return (per page). The service may return fewer permissions. If unspecified, at most 10 permissions will be returned. This method returns at most 1000 permissions per page, even if you pass larger page_size." - } - }, - "response": { - "$ref": "ListPermissionsResponse" - }, - "httpMethod": "GET", - "parameterOrder": [ - "parent" - ], - "path": "v1beta/{+parent}/permissions", - "description": "Lists permissions for the specific resource." - }, - "delete": { - "description": "Deletes the permission.", - "path": "v1beta/{+name}", - "httpMethod": "DELETE", - "parameterOrder": [ - "name" - ], - "id": "generativelanguage.corpora.permissions.delete", - "parameters": { - "name": { - "location": "path", - "required": true, - "type": "string", - "description": "Required. The resource name of the permission. Formats: `tunedModels/{tuned_model}/permissions/{permission}` `corpora/{corpus}/permissions/{permission}`", - "pattern": "^corpora/[^/]+/permissions/[^/]+$" - } - }, - "response": { - "$ref": "Empty" - }, - "flatPath": "v1beta/corpora/{corporaId}/permissions/{permissionsId}" - }, - "get": { - "description": "Gets information about a specific Permission.", - "path": "v1beta/{+name}", - "httpMethod": "GET", - "parameterOrder": [ - "name" - ], - "id": "generativelanguage.corpora.permissions.get", - "parameters": { - "name": { - "pattern": "^corpora/[^/]+/permissions/[^/]+$", - "description": "Required. The resource name of the permission. Formats: `tunedModels/{tuned_model}/permissions/{permission}` `corpora/{corpus}/permissions/{permission}`", - "type": "string", - "required": true, - "location": "path" - } - }, - "response": { - "$ref": "Permission" - }, - "flatPath": "v1beta/corpora/{corporaId}/permissions/{permissionsId}" - } - } + "imageSearch": { + "description": "Optional. Enables image search. Image bytes are returned.", + "$ref": "ImageSearch" } } }, - "dynamic": { - "methods": { - "streamGenerateContent": { - "request": { - "$ref": "GenerateContentRequest" - }, - "httpMethod": "POST", - "flatPath": "v1beta/dynamic/{dynamicId}:streamGenerateContent", - "id": "generativelanguage.dynamic.streamGenerateContent", - "response": { - "$ref": "GenerateContentResponse" - }, - "path": "v1beta/{+model}:streamGenerateContent", - "parameterOrder": [ - "model" + "WebSearch": { + "id": "WebSearch", + "description": "Standard web search for grounding and related configurations.", + "type": "object", + "properties": {} + }, + "ImageSearch": { + "id": "ImageSearch", + "description": "Image search for grounding and related configurations.", + "type": "object", + "properties": {} + }, + "ComputerUse": { + "id": "ComputerUse", + "description": "Computer Use tool type.", + "type": "object", + "properties": { + "environment": { + "description": "Required. The environment being operated.", + "type": "string", + "enumDescriptions": [ + "Defaults to browser.", + "Operates in a web browser." ], - "description": "Generates a [streamed response](https://ai.google.dev/gemini-api/docs/text-generation?lang=python#generate-a-text-stream) from the model given an input `GenerateContentRequest`.", - "parameters": { - "model": { - "required": true, - "location": "path", - "pattern": "^dynamic/[^/]+$", - "description": "Required. The name of the `Model` to use for generating the completion. Format: `models/{model}`.", - "type": "string" - } - } + "enum": [ + "ENVIRONMENT_UNSPECIFIED", + "ENVIRONMENT_BROWSER" + ] }, - "generateContent": { - "httpMethod": "POST", - "request": { - "$ref": "GenerateContentRequest" - }, - "flatPath": "v1beta/dynamic/{dynamicId}:generateContent", - "id": "generativelanguage.dynamic.generateContent", - "response": { - "$ref": "GenerateContentResponse" - }, - "parameterOrder": [ - "model" - ], - "path": "v1beta/{+model}:generateContent", - "description": "Generates a model response given an input `GenerateContentRequest`. Refer to the [text generation guide](https://ai.google.dev/gemini-api/docs/text-generation) for detailed usage information. Input capabilities differ between models, including tuned models. Refer to the [model guide](https://ai.google.dev/gemini-api/docs/models/gemini) and [tuning guide](https://ai.google.dev/gemini-api/docs/model-tuning) for details.", - "parameters": { - "model": { - "location": "path", - "required": true, - "type": "string", - "description": "Required. The name of the `Model` to use for generating the completion. Format: `models/{model}`.", - "pattern": "^dynamic/[^/]+$" - } + "excludedPredefinedFunctions": { + "description": "Optional. By default, predefined functions are included in the final model call. Some of them can be explicitly excluded from being automatically included. This can serve two purposes: 1. Using a more restricted / different action space. 2. Improving the definitions / instructions of predefined functions.", + "type": "array", + "items": { + "type": "string" } } } }, - "generatedFiles": { - "methods": { - "list": { - "flatPath": "v1beta/generatedFiles", - "id": "generativelanguage.generatedFiles.list", - "response": { - "$ref": "ListGeneratedFilesResponse" - }, - "httpMethod": "GET", - "parameters": { - "pageSize": { - "location": "query", - "type": "integer", - "description": "Optional. Maximum number of `GeneratedFile`s to return per page. If unspecified, defaults to 10. Maximum `page_size` is 50.", - "format": "int32" - }, - "pageToken": { - "location": "query", - "type": "string", - "description": "Optional. A page token from a previous `ListGeneratedFiles` call." - } - }, - "path": "v1beta/generatedFiles", - "parameterOrder": [], - "scopes": [ - "https://www.googleapis.com/auth/devstorage.read_only" - ], - "description": "Lists the generated files owned by the requesting project." - } - }, - "resources": { - "operations": { - "methods": { - "get": { - "path": "v1beta/{+name}", - "httpMethod": "GET", - "parameterOrder": [ - "name" - ], - "description": "Gets the latest state of a long-running operation. Clients can use this method to poll the operation result at intervals as recommended by the API service.", - "flatPath": "v1beta/generatedFiles/{generatedFilesId}/operations/{operationsId}", - "id": "generativelanguage.generatedFiles.operations.get", - "parameters": { - "name": { - "pattern": "^generatedFiles/[^/]+/operations/[^/]+$", - "type": "string", - "description": "The name of the operation resource.", - "location": "path", - "required": true - } - }, - "response": { - "$ref": "Operation" - } - } - } - } - } - } - }, - "version_module": true, - "protocol": "rest", - "description": "The Gemini API allows developers to build generative AI applications using Gemini models. Gemini is our most capable model, built from the ground up to be multimodal. It can generalize and seamlessly understand, operate across, and combine different types of information including language, images, audio, video, and code. You can use the Gemini API for use cases like reasoning across text and images, content generation, dialogue agents, summarization and classification systems, and more.", - "icons": { - "x16": "http://www.google.com/images/icons/product/search-16.gif", - "x32": "http://www.google.com/images/icons/product/search-32.gif" - }, - "rootUrl": "https://generativelanguage.googleapis.com/", - "ownerName": "Google", - "documentationLink": "https://developers.generativeai.google/api", - "fullyEncodeReservedExpansion": true, - "auth": { - "oauth2": { - "scopes": { - "https://www.googleapis.com/auth/devstorage.read_only": { - "description": "View your data in Google Cloud Storage" - } - } - } - }, - "discoveryVersion": "v1", - "kind": "discovery#restDescription", - "basePath": "", - "schemas": { - "ListGeneratedFilesResponse": { - "id": "ListGeneratedFilesResponse", - "description": "Response for `ListGeneratedFiles`.", + "UrlContext": { + "id": "UrlContext", + "description": "Tool to support URL context retrieval.", + "type": "object", + "properties": {} + }, + "FileSearch": { + "id": "FileSearch", + "description": "The FileSearch tool that retrieves knowledge from Semantic Retrieval corpora. Files are imported to Semantic Retrieval corpora using the ImportFile API.", "type": "object", "properties": { - "generatedFiles": { + "fileSearchStoreNames": { + "description": "Required. The names of the file_search_stores to retrieve from. Example: `fileSearchStores/my-file-search-store-123`", "type": "array", - "description": "The list of `GeneratedFile`s.", "items": { - "$ref": "GeneratedFile" + "type": "string" } }, - "nextPageToken": { - "description": "A token that can be sent as a `page_token` into a subsequent `ListGeneratedFiles` call.", + "topK": { + "description": "Optional. The number of semantic retrieval chunks to retrieve.", + "type": "integer", + "format": "int32" + }, + "metadataFilter": { + "description": "Optional. Metadata filter to apply to the semantic retrieval documents and chunks.", "type": "string" } } }, - "ObjectId": { + "McpServer": { + "id": "McpServer", + "description": "A MCPServer is a server that can be called by the model to perform actions. It is a server that implements the MCP protocol. Next ID: 6", "type": "object", - "id": "ObjectId", - "description": "This is a copy of the tech.blob.ObjectId proto, which could not be used directly here due to transitive closure issues with JavaScript support; see http://b/8801763.", "properties": { - "bucketName": { - "type": "string", - "description": "The name of the bucket to which this object belongs." - }, - "objectName": { - "type": "string", - "description": "The name of the object." + "streamableHttpTransport": { + "description": "A transport that can stream HTTP requests and responses.", + "$ref": "StreamableHttpTransport" }, - "generation": { - "format": "int64", - "description": "Generation of the object. Generations are monotonically increasing across writes, allowing them to be be compared to determine which generation is newer. If this is omitted in a request, then you are requesting the live object. See http://go/bigstore-versions", + "name": { + "description": "The name of the MCPServer.", "type": "string" } } }, - "CountTokensResponse": { + "StreamableHttpTransport": { + "id": "StreamableHttpTransport", + "description": "A transport that can stream HTTP requests and responses. Next ID: 6", + "type": "object", "properties": { - "promptTokensDetails": { - "description": "Output only. List of modalities that were processed in the request input.", - "readOnly": true, - "items": { - "$ref": "ModalityTokenCount" - }, - "type": "array" + "url": { + "description": "The full URL for the MCPServer endpoint. Example: \"https://api.example.com/mcp\"", + "type": "string" }, - "cachedContentTokenCount": { - "format": "int32", - "description": "Number of tokens in the cached part of the prompt (the cached content).", - "type": "integer" + "headers": { + "description": "Optional: Fields for authentication headers, timeouts, etc., if needed.", + "type": "object", + "additionalProperties": { + "type": "string" + } }, - "cacheTokensDetails": { - "description": "Output only. List of modalities that were processed in the cached content.", - "readOnly": true, - "items": { - "$ref": "ModalityTokenCount" - }, - "type": "array" + "timeout": { + "description": "HTTP timeout for regular operations.", + "type": "string", + "format": "google-duration" }, - "totalTokens": { - "description": "The number of tokens that the `Model` tokenizes the `prompt` into. Always non-negative.", - "type": "integer", - "format": "int32" + "sseReadTimeout": { + "description": "Timeout for SSE read operations.", + "type": "string", + "format": "google-duration" + }, + "terminateOnClose": { + "description": "Whether to close the client session when the transport closes.", + "type": "boolean" } - }, - "id": "CountTokensResponse", - "description": "A response from `CountTokens`. It returns the model's `token_count` for the `prompt`.", - "type": "object" + } }, - "CountTextTokensResponse": { - "id": "CountTextTokensResponse", - "description": "A response from `CountTextTokens`. It returns the model's `token_count` for the `prompt`.", + "GoogleMaps": { + "id": "GoogleMaps", + "description": "The GoogleMaps Tool that provides geospatial context for the user's query.", "type": "object", "properties": { - "tokenCount": { - "format": "int32", - "type": "integer", - "description": "The number of tokens that the `model` tokenizes the `prompt` into. Always non-negative." + "enableWidget": { + "description": "Optional. Whether to return a widget context token in the GroundingMetadata of the response. Developers can use the widget context token to render a Google Maps widget with geospatial context related to the places that the model references in the response.", + "type": "boolean" } } }, - "WebSearch": { - "properties": {}, - "id": "WebSearch", - "description": "Standard web search for grounding and related configurations.", - "type": "object" - }, - "ToolResponse": { + "ToolConfig": { + "id": "ToolConfig", + "description": "The Tool configuration containing parameters for specifying `Tool` use in the request.", + "type": "object", "properties": { - "id": { - "description": "Optional. The identifier of the tool call this response is for.", - "type": "string" + "functionCallingConfig": { + "description": "Optional. Function calling config.", + "$ref": "FunctionCallingConfig" }, - "toolType": { - "description": "Required. The type of tool that was called, matching the `tool_type` in the corresponding `ToolCall`.", + "retrievalConfig": { + "description": "Optional. Retrieval config.", + "$ref": "RetrievalConfig" + }, + "includeServerSideToolInvocations": { + "description": "Optional. If true, the API response will include the server-side tool calls and responses within the `Content` message. This allows clients to observe the server's tool interactions.", + "type": "boolean" + } + } + }, + "FunctionCallingConfig": { + "id": "FunctionCallingConfig", + "description": "Configuration for specifying function calling behavior.", + "type": "object", + "properties": { + "mode": { + "description": "Optional. Specifies the mode in which function calling should execute. If unspecified, the default value will be set to AUTO.", "type": "string", "enumDescriptions": [ - "Unspecified tool type.", - "Google search tool, maps to Tool.google_search.search_types.web_search.", - "Image search tool, maps to Tool.google_search.search_types.image_search.", - "URL context tool, maps to Tool.url_context.", - "Google maps tool, maps to Tool.google_maps.", - "File search tool, maps to Tool.file_search." + "Unspecified function calling mode. This value should not be used.", + "Default model behavior, model decides to predict either a function call or a natural language response.", + "Model is constrained to always predicting a function call only. If \"allowed_function_names\" are set, the predicted function call will be limited to any one of \"allowed_function_names\", else the predicted function call will be any one of the provided \"function_declarations\".", + "Model will not predict any function call. Model behavior is same as when not passing any function declarations.", + "Model decides to predict either a function call or a natural language response, but will validate function calls with constrained decoding. If \"allowed_function_names\" are set, the predicted function call will be limited to any one of \"allowed_function_names\", else the predicted function call will be any one of the provided \"function_declarations\"." ], "enum": [ - "TOOL_TYPE_UNSPECIFIED", - "GOOGLE_SEARCH_WEB", - "GOOGLE_SEARCH_IMAGE", - "URL_CONTEXT", - "GOOGLE_MAPS", - "FILE_SEARCH" + "MODE_UNSPECIFIED", + "AUTO", + "ANY", + "NONE", + "VALIDATED" ] }, - "response": { - "type": "object", - "description": "Optional. The tool response.", - "additionalProperties": { - "description": "Properties of the object.", - "type": "any" + "allowedFunctionNames": { + "description": "Optional. A set of function names that, when provided, limits the functions the model will call. This should only be set when the Mode is ANY or VALIDATED. Function names should match [FunctionDeclaration.name]. When set, model will predict a function call from only allowed function names.", + "type": "array", + "items": { + "type": "string" } } - }, - "type": "object", - "id": "ToolResponse", - "description": "The output from a server-side `ToolCall` execution. This message contains the results of a tool invocation that was initiated by a `ToolCall` from the model. The client should pass this `ToolResponse` back to the API in a subsequent turn within a `Content` message, along with the corresponding `ToolCall`." + } }, - "Tool": { - "id": "Tool", - "description": "Tool details that the model may use to generate response. A `Tool` is a piece of code that enables the system to interact with external systems to perform an action, or set of actions, outside of knowledge and scope of the model. Next ID: 16", + "RetrievalConfig": { + "id": "RetrievalConfig", + "description": "Retrieval config.", "type": "object", "properties": { - "computerUse": { - "description": "Optional. Tool to support the model interacting directly with the computer. If enabled, it automatically populates computer-use specific Function Declarations.", - "$ref": "ComputerUse" - }, - "mcpServers": { - "type": "array", - "description": "Optional. MCP Servers to connect to.", - "items": { - "$ref": "McpServer" - } + "latLng": { + "description": "Optional. The location of the user.", + "$ref": "LatLng" }, - "googleSearch": { - "description": "Optional. GoogleSearch tool type. Tool to support Google Search in Model. Powered by Google.", - "$ref": "GoogleSearch" + "languageCode": { + "description": "Optional. The language code of the user. Language code for content. Use language tags defined by [BCP47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt).", + "type": "string" + } + } + }, + "LatLng": { + "id": "LatLng", + "description": "An object that represents a latitude/longitude pair. This is expressed as a pair of doubles to represent degrees latitude and degrees longitude. Unless specified otherwise, this object must conform to the WGS84 standard. Values must be within normalized ranges.", + "type": "object", + "properties": { + "latitude": { + "description": "The latitude in degrees. It must be in the range [-90.0, +90.0].", + "type": "number", + "format": "double" }, - "functionDeclarations": { - "description": "Optional. A list of `FunctionDeclarations` available to the model that can be used for function calling. The model or system does not execute the function. Instead the defined function may be returned as a FunctionCall with arguments to the client side for execution. The model may decide to call a subset of these functions by populating FunctionCall in the response. The next conversation turn may contain a FunctionResponse with the Content.role \"function\" generation context for the next model turn.", - "items": { - "$ref": "FunctionDeclaration" - }, - "type": "array" - }, - "urlContext": { - "description": "Optional. Tool to support URL context retrieval.", - "$ref": "UrlContext" - }, - "googleSearchRetrieval": { - "description": "Optional. Retrieval tool that is powered by Google search.", - "$ref": "GoogleSearchRetrieval" - }, - "googleMaps": { - "description": "Optional. Tool that allows grounding the model's response with geospatial context related to the user's query.", - "$ref": "GoogleMaps" - }, - "codeExecution": { - "description": "Optional. Enables the model to execute code as part of generation.", - "$ref": "CodeExecution" - }, - "fileSearch": { - "description": "Optional. FileSearch tool type. Tool to retrieve knowledge from Semantic Retrieval corpora.", - "$ref": "FileSearch" + "longitude": { + "description": "The longitude in degrees. It must be in the range [-180.0, +180.0].", + "type": "number", + "format": "double" } } }, - "AsyncBatchEmbedContentRequest": { - "properties": { - "batch": { - "description": "Required. The batch to create.", - "$ref": "EmbedContentBatch" - } - }, + "SafetySetting": { + "id": "SafetySetting", + "description": "Safety setting, affecting the safety-blocking behavior. Passing a safety setting for a category changes the allowed probability that content is blocked.", "type": "object", - "id": "AsyncBatchEmbedContentRequest", - "description": "Request for an `AsyncBatchEmbedContent` operation." - }, - "CachedContentUsageMetadata": { "properties": { - "totalTokenCount": { - "format": "int32", - "description": "Total number of tokens that the cached content consumes.", - "type": "integer" + "category": { + "description": "Required. The category for this setting.", + "type": "string", + "enumDescriptions": [ + "Category is unspecified.", + "**PaLM** - Negative or harmful comments targeting identity and/or protected attribute.", + "**PaLM** - Content that is rude, disrespectful, or profane.", + "**PaLM** - Describes scenarios depicting violence against an individual or group, or general descriptions of gore.", + "**PaLM** - Contains references to sexual acts or other lewd content.", + "**PaLM** - Promotes unchecked medical advice.", + "**PaLM** - Dangerous content that promotes, facilitates, or encourages harmful acts.", + "**Gemini** - Harassment content.", + "**Gemini** - Hate speech and content.", + "**Gemini** - Sexually explicit content.", + "**Gemini** - Dangerous content.", + "**Gemini** - Content that may be used to harm civic integrity. DEPRECATED: use enable_enhanced_civic_answers instead." + ], + "enumDeprecated": [ + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + true + ], + "enum": [ + "HARM_CATEGORY_UNSPECIFIED", + "HARM_CATEGORY_DEROGATORY", + "HARM_CATEGORY_TOXICITY", + "HARM_CATEGORY_VIOLENCE", + "HARM_CATEGORY_SEXUAL", + "HARM_CATEGORY_MEDICAL", + "HARM_CATEGORY_DANGEROUS", + "HARM_CATEGORY_HARASSMENT", + "HARM_CATEGORY_HATE_SPEECH", + "HARM_CATEGORY_SEXUALLY_EXPLICIT", + "HARM_CATEGORY_DANGEROUS_CONTENT", + "HARM_CATEGORY_CIVIC_INTEGRITY" + ] + }, + "threshold": { + "description": "Required. Controls the probability threshold at which harm is blocked.", + "type": "string", + "enumDescriptions": [ + "Threshold is unspecified.", + "Content with NEGLIGIBLE will be allowed.", + "Content with NEGLIGIBLE and LOW will be allowed.", + "Content with NEGLIGIBLE, LOW, and MEDIUM will be allowed.", + "All content will be allowed.", + "Turn off the safety filter." + ], + "enum": [ + "HARM_BLOCK_THRESHOLD_UNSPECIFIED", + "BLOCK_LOW_AND_ABOVE", + "BLOCK_MEDIUM_AND_ABOVE", + "BLOCK_ONLY_HIGH", + "BLOCK_NONE", + "OFF" + ] } - }, - "type": "object", - "id": "CachedContentUsageMetadata", - "description": "Metadata on the usage of the cached content." + } }, - "StringList": { + "GenerationConfig": { + "id": "GenerationConfig", + "description": "Configuration options for model generation and outputs. Not all parameters are configurable for every model.", + "type": "object", "properties": { - "values": { - "description": "The string values of the metadata to store.", + "candidateCount": { + "description": "Optional. Number of generated responses to return. If unset, this will default to 1. Please note that this doesn't work for previous generation models (Gemini 1.0 family)", + "type": "integer", + "format": "int32" + }, + "stopSequences": { + "description": "Optional. The set of character sequences (up to 5) that will stop output generation. If specified, the API will stop at the first appearance of a `stop_sequence`. The stop sequence will not be included as part of the response.", + "type": "array", "items": { "type": "string" - }, - "type": "array" - } - }, - "id": "StringList", - "description": "User provided string values assigned to a single metadata key.", - "type": "object" - }, - "VoiceConfig": { - "properties": { - "prebuiltVoiceConfig": { - "description": "The configuration for the prebuilt voice to use.", - "$ref": "PrebuiltVoiceConfig" - } - }, - "id": "VoiceConfig", - "description": "The configuration for the voice to use.", - "type": "object" - }, - "EmbedContentRequest": { - "properties": { - "embedContentConfig": { - "$ref": "EmbedContentConfig", - "description": "Optional. Configuration for the EmbedContent request." + } }, - "model": { - "type": "string", - "description": "Required. The model's resource name. This serves as an ID for the Model to use. This name should match a model name returned by the `ListModels` method. Format: `models/{model}`" + "maxOutputTokens": { + "description": "Optional. The maximum number of tokens to include in a response candidate. Note: The default value varies by model, see the `Model.output_token_limit` attribute of the `Model` returned from the `getModel` function.", + "type": "integer", + "format": "int32" }, - "content": { - "$ref": "Content", - "description": "Required. The content to embed. Only the `parts.text` fields will be counted." + "temperature": { + "description": "Optional. Controls the randomness of the output. Note: The default value varies by model, see the `Model.temperature` attribute of the `Model` returned from the `getModel` function. Values can range from [0.0, 2.0].", + "type": "number", + "format": "float" }, - "outputDimensionality": { - "format": "int32", - "description": "Optional. Deprecated: Please use EmbedContentConfig.output_dimensionality instead. Optional reduced dimension for the output embedding. If set, excessive values in the output embedding are truncated from the end. Supported by newer models since 2024 only. You cannot set this value if using the earlier model (`models/embedding-001`).", - "deprecated": true, - "type": "integer" + "topP": { + "description": "Optional. The maximum cumulative probability of tokens to consider when sampling. The model uses combined Top-k and Top-p (nucleus) sampling. Tokens are sorted based on their assigned probabilities so that only the most likely tokens are considered. Top-k sampling directly limits the maximum number of tokens to consider, while Nucleus sampling limits the number of tokens based on the cumulative probability. Note: The default value varies by `Model` and is specified by the`Model.top_p` attribute returned from the `getModel` function. An empty `top_k` attribute indicates that the model doesn't apply top-k sampling and doesn't allow setting `top_k` on requests.", + "type": "number", + "format": "float" }, - "taskType": { - "enum": [ - "TASK_TYPE_UNSPECIFIED", - "RETRIEVAL_QUERY", - "RETRIEVAL_DOCUMENT", - "SEMANTIC_SIMILARITY", - "CLASSIFICATION", - "CLUSTERING", - "QUESTION_ANSWERING", - "FACT_VERIFICATION", - "CODE_RETRIEVAL_QUERY" - ], - "type": "string", - "description": "Optional. Deprecated: Please use EmbedContentConfig.task_type instead. Optional task type for which the embeddings will be used. Not supported on earlier models (`models/embedding-001`).", - "deprecated": true, - "enumDescriptions": [ - "Unset value, which will default to one of the other enum values.", - "Specifies the given text is a query in a search/retrieval setting.", - "Specifies the given text is a document from the corpus being searched.", - "Specifies the given text will be used for STS.", - "Specifies that the given text will be classified.", - "Specifies that the embeddings will be used for clustering.", - "Specifies that the given text will be used for question answering.", - "Specifies that the given text will be used for fact verification.", - "Specifies that the given text will be used for code retrieval." - ] + "topK": { + "description": "Optional. The maximum number of tokens to consider when sampling. Gemini models use Top-p (nucleus) sampling or a combination of Top-k and nucleus sampling. Top-k sampling considers the set of `top_k` most probable tokens. Models running with nucleus sampling don't allow top_k setting. Note: The default value varies by `Model` and is specified by the`Model.top_p` attribute returned from the `getModel` function. An empty `top_k` attribute indicates that the model doesn't apply top-k sampling and doesn't allow setting `top_k` on requests.", + "type": "integer", + "format": "int32" }, - "title": { - "description": "Optional. Deprecated: Please use EmbedContentConfig.title instead. An optional title for the text. Only applicable when TaskType is `RETRIEVAL_DOCUMENT`. Note: Specifying a `title` for `RETRIEVAL_DOCUMENT` provides better quality embeddings for retrieval.", - "deprecated": true, - "type": "string" - } - }, - "id": "EmbedContentRequest", - "description": "Request containing the `Content` for the model to embed.", - "type": "object" - }, - "FileSearchStore": { - "type": "object", - "id": "FileSearchStore", - "description": "A `FileSearchStore` is a collection of `Document`s.", - "properties": { - "sizeBytes": { - "format": "int64", - "type": "string", - "description": "Output only. The size of raw bytes ingested into the `FileSearchStore`. This is the total size of all the documents in the `FileSearchStore`.", - "readOnly": true + "seed": { + "description": "Optional. Seed used in decoding. If not set, the request uses a randomly generated seed.", + "type": "integer", + "format": "int32" }, - "displayName": { - "description": "Optional. The human-readable display name for the `FileSearchStore`. The display name must be no more than 512 characters in length, including spaces. Example: \"Docs on Semantic Retriever\"", + "responseMimeType": { + "description": "Optional. MIME type of the generated candidate text. Supported MIME types are: `text/plain`: (default) Text output. `application/json`: JSON response in the response candidates. `text/x.enum`: ENUM as a string response in the response candidates. Refer to the [docs](https://ai.google.dev/gemini-api/docs/prompting_with_media#plain_text_formats) for a list of all supported text MIME types.", "type": "string" }, - "activeDocumentsCount": { - "format": "int64", - "description": "Output only. The number of documents in the `FileSearchStore` that are active and ready for retrieval.", - "readOnly": true, - "type": "string" + "responseSchema": { + "description": "Optional. Output schema of the generated candidate text. Schemas must be a subset of the [OpenAPI schema](https://spec.openapis.org/oas/v3.0.3#schema) and can be objects, primitives or arrays. If set, a compatible `response_mime_type` must also be set. Compatible MIME types: `application/json`: Schema for JSON response. Refer to the [JSON text generation guide](https://ai.google.dev/gemini-api/docs/json-mode) for more details.", + "$ref": "Schema" }, - "pendingDocumentsCount": { - "format": "int64", - "description": "Output only. The number of documents in the `FileSearchStore` that are being processed.", - "readOnly": true, - "type": "string" + "_responseJsonSchema": { + "description": "Optional. Output schema of the generated response. This is an alternative to `response_schema` that accepts [JSON Schema](https://json-schema.org/). If set, `response_schema` must be omitted, but `response_mime_type` is required. While the full JSON Schema may be sent, not all features are supported. Specifically, only the following properties are supported: - `$id` - `$defs` - `$ref` - `$anchor` - `type` - `format` - `title` - `description` - `enum` (for strings and numbers) - `items` - `prefixItems` - `minItems` - `maxItems` - `minimum` - `maximum` - `anyOf` - `oneOf` (interpreted the same as `anyOf`) - `properties` - `additionalProperties` - `required` The non-standard `propertyOrdering` property may also be set. Cyclic references are unrolled to a limited degree and, as such, may only be used within non-required properties. (Nullable properties are not sufficient.) If `$ref` is set on a sub-schema, no other properties, except for than those starting as a `$`, may be set.", + "type": "any" }, - "embeddingModel": { - "type": "string", - "description": "Optional. The embedding model to use for the `FileSearchStore`. The model's resource name. This serves as an ID for the Model to use. Format: `models/{model}`. If not specified, the default embedding model will be used." + "responseJsonSchema": { + "description": "Optional. An internal detail. Use `responseJsonSchema` rather than this field.", + "type": "any" }, - "updateTime": { - "description": "Output only. The Timestamp of when the `FileSearchStore` was last updated.", - "readOnly": true, - "type": "string", - "format": "google-datetime" + "presencePenalty": { + "description": "Optional. Presence penalty applied to the next token's logprobs if the token has already been seen in the response. This penalty is binary on/off and not dependant on the number of times the token is used (after the first). Use frequency_penalty for a penalty that increases with each use. A positive penalty will discourage the use of tokens that have already been used in the response, increasing the vocabulary. A negative penalty will encourage the use of tokens that have already been used in the response, decreasing the vocabulary.", + "type": "number", + "format": "float" }, - "createTime": { - "format": "google-datetime", - "type": "string", - "description": "Output only. The Timestamp of when the `FileSearchStore` was created.", - "readOnly": true + "frequencyPenalty": { + "description": "Optional. Frequency penalty applied to the next token's logprobs, multiplied by the number of times each token has been seen in the respponse so far. A positive penalty will discourage the use of tokens that have already been used, proportional to the number of times the token has been used: The more a token is used, the more difficult it is for the model to use that token again increasing the vocabulary of responses. Caution: A _negative_ penalty will encourage the model to reuse tokens proportional to the number of times the token has been used. Small negative values will reduce the vocabulary of a response. Larger negative values will cause the model to start repeating a common token until it hits the max_output_tokens limit.", + "type": "number", + "format": "float" }, - "name": { - "type": "string", - "description": "Output only. Immutable. Identifier. The `FileSearchStore` resource name. It is an ID (name excluding the \"fileSearchStores/\" prefix) that can contain up to 40 characters that are lowercase alphanumeric or dashes (-). It is output only. The unique name will be derived from `display_name` along with a 12 character random suffix. Example: `fileSearchStores/my-awesome-file-search-store-123a456b789c` If `display_name` is not provided, the name will be randomly generated.", - "readOnly": true + "responseLogprobs": { + "description": "Optional. If true, export the logprobs results in response.", + "type": "boolean" }, - "failedDocumentsCount": { - "format": "int64", - "description": "Output only. The number of documents in the `FileSearchStore` that have failed processing.", - "readOnly": true, - "type": "string" - } - } - }, - "EmbeddingUsageMetadata": { - "id": "EmbeddingUsageMetadata", - "description": "Metadata on the usage of the embedding request.", - "type": "object", - "properties": { - "promptTokenCount": { - "format": "int32", + "logprobs": { + "description": "Optional. Only valid if response_logprobs=True. This sets the number of top logprobs, including the chosen candidate, to return at each decoding step in the Candidate.logprobs_result. The number must be in the range of [0, 20].", "type": "integer", - "description": "Output only. Number of tokens in the prompt.", - "readOnly": true + "format": "int32" }, - "promptTokenDetails": { - "description": "Output only. List of modalities that were processed in the request input.", - "readOnly": true, - "items": { - "$ref": "ModalityTokenCount" - }, - "type": "array" - } - } - }, - "ListPermissionsResponse": { - "type": "object", - "id": "ListPermissionsResponse", - "description": "Response from `ListPermissions` containing a paginated list of permissions.", - "properties": { - "nextPageToken": { - "description": "A token, which can be sent as `page_token` to retrieve the next page. If this field is omitted, there are no more pages.", - "type": "string" + "enableEnhancedCivicAnswers": { + "description": "Optional. Enables enhanced civic answers. It may not be available for all models.", + "type": "boolean" }, - "permissions": { - "description": "Returned permissions.", + "responseModalities": { + "description": "Optional. The requested modalities of the response. Represents the set of modalities that the model can return, and should be expected in the response. This is an exact match to the modalities of the response. A model may have multiple combinations of supported modalities. If the requested modalities do not match any of the supported combinations, an error will be returned. An empty list is equivalent to requesting only text.", + "type": "array", "items": { - "$ref": "Permission" - }, - "type": "array" - } - } - }, - "GenerateContentRequest": { - "properties": { - "cachedContent": { - "type": "string", - "description": "Optional. The name of the content [cached](https://ai.google.dev/gemini-api/docs/caching) to use as context to serve the prediction. Format: `cachedContents/{cachedContent}`" - }, - "store": { - "description": "Optional. Configures the logging behavior for a given request. If set, it takes precedence over the project-level logging config.", - "type": "boolean" + "type": "string", + "enumDescriptions": [ + "Default value.", + "Indicates the model should return text.", + "Indicates the model should return images.", + "Indicates the model should return audio." + ], + "enum": [ + "MODALITY_UNSPECIFIED", + "TEXT", + "IMAGE", + "AUDIO" + ] + } }, - "model": { - "type": "string", - "description": "Required. The name of the `Model` to use for generating the completion. Format: `models/{model}`." + "speechConfig": { + "description": "Optional. The speech generation config.", + "$ref": "SpeechConfig" }, - "tools": { - "description": "Optional. A list of `Tools` the `Model` may use to generate the next response. A `Tool` is a piece of code that enables the system to interact with external systems to perform an action, or set of actions, outside of knowledge and scope of the `Model`. Supported `Tool`s are `Function` and `code_execution`. Refer to the [Function calling](https://ai.google.dev/gemini-api/docs/function-calling) and the [Code execution](https://ai.google.dev/gemini-api/docs/code-execution) guides to learn more.", - "items": { - "$ref": "Tool" - }, - "type": "array" + "thinkingConfig": { + "description": "Optional. Config for thinking features. An error will be returned if this field is set for models that don't support thinking.", + "$ref": "ThinkingConfig" }, - "toolConfig": { - "description": "Optional. Tool configuration for any `Tool` specified in the request. Refer to the [Function calling guide](https://ai.google.dev/gemini-api/docs/function-calling#function_calling_mode) for a usage example.", - "$ref": "ToolConfig" + "imageConfig": { + "description": "Optional. Config for image generation. An error will be returned if this field is set for models that don't support these config options.", + "$ref": "ImageConfig" }, - "serviceTier": { + "mediaResolution": { + "description": "Optional. If specified, the media resolution specified will be used.", "type": "string", - "description": "Optional. The service tier of the request.", "enumDescriptions": [ - "Default service tier, which is standard.", - "Standard service tier.", - "Flex service tier.", - "Priority service tier." + "Media resolution has not been set.", + "Media resolution set to low (64 tokens).", + "Media resolution set to medium (256 tokens).", + "Media resolution set to high (zoomed reframing with 256 tokens)." ], "enum": [ - "unspecified", - "standard", - "flex", - "priority" + "MEDIA_RESOLUTION_UNSPECIFIED", + "MEDIA_RESOLUTION_LOW", + "MEDIA_RESOLUTION_MEDIUM", + "MEDIA_RESOLUTION_HIGH" ] }, - "contents": { - "type": "array", - "description": "Required. The content of the current conversation with the model. For single-turn queries, this is a single instance. For multi-turn queries like [chat](https://ai.google.dev/gemini-api/docs/text-generation#chat), this is a repeated field that contains the conversation history and the latest request.", - "items": { - "$ref": "Content" - } - }, - "generationConfig": { - "description": "Optional. Configuration options for model generation and outputs.", - "$ref": "GenerationConfig" - }, - "systemInstruction": { - "description": "Optional. Developer set [system instruction(s)](https://ai.google.dev/gemini-api/docs/system-instructions). Currently, text only.", - "$ref": "Content" - }, - "safetySettings": { - "description": "Optional. A list of unique `SafetySetting` instances for blocking unsafe content. This will be enforced on the `GenerateContentRequest.contents` and `GenerateContentResponse.candidates`. There should not be more than one setting for each `SafetyCategory` type. The API will block any contents and responses that fail to meet the thresholds set by these settings. This list overrides the default settings for each `SafetyCategory` specified in the safety_settings. If there is no `SafetySetting` for a given `SafetyCategory` provided in the list, the API will use the default safety setting for that category. Harm categories HARM_CATEGORY_HATE_SPEECH, HARM_CATEGORY_SEXUALLY_EXPLICIT, HARM_CATEGORY_DANGEROUS_CONTENT, HARM_CATEGORY_HARASSMENT, HARM_CATEGORY_CIVIC_INTEGRITY are supported. Refer to the [guide](https://ai.google.dev/gemini-api/docs/safety-settings) for detailed information on available safety settings. Also refer to the [Safety guidance](https://ai.google.dev/gemini-api/docs/safety-guidance) to learn how to incorporate safety considerations in your AI applications.", - "items": { - "$ref": "SafetySetting" - }, - "type": "array" + "responseFormat": { + "description": "Optional. Configuration for the response output format. Allows specifying output configuration per modality (text, audio, image) in a flat structure.", + "$ref": "ResponseFormatConfig" } - }, - "type": "object", - "id": "GenerateContentRequest", - "description": "Request to generate a completion from the model." + } }, - "UploadToFileSearchStoreRequest": { - "id": "UploadToFileSearchStoreRequest", - "description": "Request for `UploadToFileSearchStore`.", + "SpeechConfig": { + "id": "SpeechConfig", + "description": "Config for speech generation and transcription.", "type": "object", "properties": { - "displayName": { - "type": "string", - "description": "Optional. Display name of the created document." - }, - "customMetadata": { - "description": "Custom metadata to be associated with the data.", - "items": { - "$ref": "CustomMetadata" - }, - "type": "array" + "voiceConfig": { + "description": "The configuration in case of single-voice output.", + "$ref": "VoiceConfig" }, - "chunkingConfig": { - "description": "Optional. Config for telling the service how to chunk the data. If not provided, the service will use default parameters.", - "$ref": "ChunkingConfig" + "multiSpeakerVoiceConfig": { + "description": "Optional. The configuration for the multi-speaker setup. It is mutually exclusive with the voice_config field.", + "$ref": "MultiSpeakerVoiceConfig" }, - "mimeType": { - "type": "string", - "description": "Optional. MIME type of the data. If not provided, it will be inferred from the uploaded content." + "languageCode": { + "description": "Optional. The IETF [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language code that the user configured the app to use. Used for speech recognition and synthesis. Valid values are: `de-DE`, `en-AU`, `en-GB`, `en-IN`, `en-US`, `es-US`, `fr-FR`, `hi-IN`, `pt-BR`, `ar-XA`, `es-ES`, `fr-CA`, `id-ID`, `it-IT`, `ja-JP`, `tr-TR`, `vi-VN`, `bn-IN`, `gu-IN`, `kn-IN`, `ml-IN`, `mr-IN`, `ta-IN`, `te-IN`, `nl-NL`, `ko-KR`, `cmn-CN`, `pl-PL`, `ru-RU`, and `th-TH`.", + "type": "string" } } }, - "SearchEntryPoint": { + "VoiceConfig": { + "id": "VoiceConfig", + "description": "The configuration for the voice to use.", + "type": "object", "properties": { - "renderedContent": { - "type": "string", - "description": "Optional. Web content snippet that can be embedded in a web page or an app webview." - }, - "sdkBlob": { - "type": "string", - "description": "Optional. Base64 encoded JSON representing array of tuple.", - "format": "byte" + "prebuiltVoiceConfig": { + "description": "The configuration for the prebuilt voice to use.", + "$ref": "PrebuiltVoiceConfig" } - }, - "id": "SearchEntryPoint", - "description": "Google search entry point.", - "type": "object" + } }, - "EmbedContentBatchOutput": { - "id": "EmbedContentBatchOutput", - "description": "The output of a batch request. This is returned in the `AsyncBatchEmbedContentResponse` or the `EmbedContentBatch.output` field.", + "PrebuiltVoiceConfig": { + "id": "PrebuiltVoiceConfig", + "description": "The configuration for the prebuilt speaker to use.", "type": "object", "properties": { - "responsesFile": { - "type": "string", - "description": "Output only. The file ID of the file containing the responses. The file will be a JSONL file with a single response per line. The responses will be `EmbedContentResponse` messages formatted as JSON. The responses will be written in the same order as the input requests.", - "readOnly": true - }, - "inlinedResponses": { - "$ref": "InlinedEmbedContentResponses", - "description": "Output only. The responses to the requests in the batch. Returned when the batch was built using inlined requests. The responses will be in the same order as the input requests.", - "readOnly": true + "voiceName": { + "description": "The name of the preset voice to use.", + "type": "string" } } }, - "Content": { + "MultiSpeakerVoiceConfig": { + "id": "MultiSpeakerVoiceConfig", + "description": "The configuration for the multi-speaker setup.", "type": "object", - "id": "Content", - "description": "The base structured datatype containing multi-part content of a message. A `Content` includes a `role` field designating the producer of the `Content` and a `parts` field containing multi-part data that contains the content of the message turn.", "properties": { - "role": { - "description": "Optional. The producer of the content. Must be either 'user' or 'model'. Useful to set for multi-turn conversations, otherwise can be left blank or unset.", - "type": "string" - }, - "parts": { + "speakerVoiceConfigs": { + "description": "Required. All the enabled speaker voices.", "type": "array", - "description": "Ordered `Parts` that constitute a single message. Parts may have different MIME types.", "items": { - "$ref": "Part" + "$ref": "SpeakerVoiceConfig" } } } }, - "DiffVersionResponse": { - "properties": { - "objectVersion": { - "type": "string", - "description": "The version of the object stored at the server." - }, - "objectSizeBytes": { - "description": "The total size of the server object.", - "type": "string", - "format": "int64" - } - }, - "id": "DiffVersionResponse", - "description": "Backend response for a Diff get version response. For details on the Scotty Diff protocol, visit http://go/scotty-diff-protocol.", - "type": "object" - }, - "LogprobsResultCandidate": { + "SpeakerVoiceConfig": { + "id": "SpeakerVoiceConfig", + "description": "The configuration for a single speaker in a multi speaker setup.", + "type": "object", "properties": { - "tokenId": { - "format": "int32", - "type": "integer", - "description": "The candidate’s token id value." - }, - "logProbability": { - "format": "float", - "description": "The candidate's log probability.", - "type": "number" + "speaker": { + "description": "Required. The name of the speaker to use. Should be the same as in the prompt.", + "type": "string" }, - "token": { - "type": "string", - "description": "The candidate’s token string value." + "voiceConfig": { + "description": "Required. The configuration for the voice to use.", + "$ref": "VoiceConfig" } - }, - "type": "object", - "id": "LogprobsResultCandidate", - "description": "Candidate for the logprobs token and score." + } }, - "CitationSource": { - "id": "CitationSource", - "description": "A citation to a source for a portion of a specific response.", + "ThinkingConfig": { + "id": "ThinkingConfig", + "description": "Config for thinking features.", "type": "object", "properties": { - "startIndex": { + "includeThoughts": { + "description": "Indicates whether to include thoughts in the response. If true, thoughts are returned only when available.", + "type": "boolean" + }, + "thinkingBudget": { + "description": "The number of thoughts tokens that the model should generate.", "type": "integer", - "description": "Optional. Start of segment of the response that is attributed to this source. Index indicates the start of the segment, measured in bytes.", "format": "int32" }, - "endIndex": { - "format": "int32", - "description": "Optional. End of the attributed segment, exclusive.", - "type": "integer" - }, - "license": { + "thinkingLevel": { + "description": "Optional. Controls the maximum depth of the model's internal reasoning process before it produces a response. The default value is model-dependent. Refer to the [Thinking levels guide](https://ai.google.dev/gemini-api/docs/thinking#thinking-levels) for more details. Recommended for Gemini 3 or later models. Use with earlier models results in an error.", "type": "string", - "description": "Optional. License for the GitHub project that is attributed as a source for segment. License info is required for code citations." - }, - "uri": { - "description": "Optional. URI that is attributed as a source for a portion of the text.", - "type": "string" + "enumDescriptions": [ + "Default value.", + "Little to no thinking.", + "Low thinking level.", + "Medium thinking level.", + "High thinking level." + ], + "enum": [ + "THINKING_LEVEL_UNSPECIFIED", + "MINIMAL", + "LOW", + "MEDIUM", + "HIGH" + ] } } }, - "EmbedContentBatch": { + "ImageConfig": { + "id": "ImageConfig", + "description": "Config for image generation features.", + "type": "object", "properties": { - "endTime": { - "description": "Output only. The time at which the batch processing completed.", - "readOnly": true, - "type": "string", - "format": "google-datetime" - }, - "displayName": { - "type": "string", - "description": "Required. The user-defined name of this batch." - }, - "state": { - "enumDescriptions": [ - "The batch state is unspecified.", - "The service is preparing to run the batch.", - "The batch is in progress.", - "The batch completed successfully.", - "The batch failed.", - "The batch has been cancelled.", - "The batch has expired." - ], - "readOnly": true, - "enum": [ - "BATCH_STATE_UNSPECIFIED", - "BATCH_STATE_PENDING", - "BATCH_STATE_RUNNING", - "BATCH_STATE_SUCCEEDED", - "BATCH_STATE_FAILED", - "BATCH_STATE_CANCELLED", - "BATCH_STATE_EXPIRED" - ], - "type": "string", - "description": "Output only. The state of the batch." - }, - "name": { - "type": "string", - "description": "Output only. Identifier. Resource name of the batch. Format: `batches/{batch_id}`.", - "readOnly": true - }, - "model": { - "description": "Required. The name of the `Model` to use for generating the completion. Format: `models/{model}`.", + "aspectRatio": { + "description": "Optional. The aspect ratio of the image to generate. Supported aspect ratios: `1:1`, `1:4`, `4:1`, `1:8`, `8:1`, `2:3`, `3:2`, `3:4`, `4:3`, `4:5`, `5:4`, `9:16`, `16:9`, or `21:9`. If not specified, the model will choose a default aspect ratio based on any reference images provided.", "type": "string" }, - "createTime": { - "format": "google-datetime", - "type": "string", - "description": "Output only. The time at which the batch was created.", - "readOnly": true - }, - "output": { - "description": "Output only. The output of the batch request.", - "readOnly": true, - "$ref": "EmbedContentBatchOutput" - }, - "updateTime": { - "description": "Output only. The time at which the batch was last updated.", - "readOnly": true, - "type": "string", - "format": "google-datetime" - }, - "inputConfig": { - "$ref": "InputEmbedContentConfig", - "description": "Required. Input configuration of the instances on which batch processing are performed." - }, - "batchStats": { - "$ref": "EmbedContentBatchStats", - "description": "Output only. Stats about the batch.", - "readOnly": true - }, - "priority": { - "format": "int64", - "description": "Optional. The priority of the batch. Batches with a higher priority value will be processed before batches with a lower priority value. Negative values are allowed. Default is 0.", + "imageSize": { + "description": "Optional. Specifies the size of generated images. Supported values are `512`, `1K`, `2K`, `4K`. If not specified, the model will use default value `1K`.", "type": "string" } - }, - "id": "EmbedContentBatch", - "description": "A resource representing a batch of `EmbedContent` requests.", - "type": "object" + } }, - "LogprobsResult": { + "ResponseFormatConfig": { + "id": "ResponseFormatConfig", + "description": "Configuration for the response output format. This is a flat object where each optional sub-field configures a specific output modality.", + "type": "object", "properties": { - "logProbabilitySum": { - "format": "float", - "type": "number", - "description": "Sum of log probabilities for all tokens." + "text": { + "description": "Optional. Text output format configuration.", + "$ref": "TextResponseFormat" }, - "chosenCandidates": { - "description": "Length = total number of decoding steps. The chosen candidates may or may not be in top_candidates.", - "items": { - "$ref": "LogprobsResultCandidate" - }, - "type": "array" + "audio": { + "description": "Optional. Audio output format configuration.", + "$ref": "AudioResponseFormat" }, - "topCandidates": { - "type": "array", - "description": "Length = total number of decoding steps.", - "items": { - "$ref": "TopCandidates" - } + "image": { + "description": "Optional. Image output format configuration.", + "$ref": "ImageResponseFormat" } - }, - "type": "object", - "id": "LogprobsResult", - "description": "Logprobs Result" + } }, - "InputConfig": { + "TextResponseFormat": { + "id": "TextResponseFormat", + "description": "Configuration for text output format.", + "type": "object", "properties": { - "fileName": { + "mimeType": { + "description": "Optional. The MIME type of the text output.", "type": "string", - "description": "The name of the `File` containing the input requests." + "enumDescriptions": [ + "Default value. This value is unused.", + "JSON output format.", + "Plain text output format." + ], + "enum": [ + "MIME_TYPE_UNSPECIFIED", + "APPLICATION_JSON", + "TEXT_PLAIN" + ] }, - "requests": { - "$ref": "InlinedRequests", - "description": "The requests to be processed in the batch." + "schema": { + "description": "Optional. The JSON schema that the output should conform to. Only applicable when mime_type is APPLICATION_JSON.", + "type": "any" } - }, - "id": "InputConfig", - "description": "Configures the input to the batch request.", - "type": "object" + } }, - "DiffUploadRequest": { + "AudioResponseFormat": { + "id": "AudioResponseFormat", + "description": "Configuration for audio output format.", + "type": "object", "properties": { - "checksumsInfo": { - "description": "The location of the checksums for the new object. Agents must clone the object located here, as the upload server will delete the contents once a response is received. For details on the format of the checksums, see http://go/scotty-diff-protocol.", - "$ref": "CompositeMedia" + "mimeType": { + "description": "Optional. The MIME type of the audio output.", + "type": "string", + "enumDescriptions": [ + "Default value. This value is unused.", + "MP3 audio format.", + "OGG Opus audio format.", + "Raw PCM (L16) audio format.", + "WAV audio format.", + "A-law audio format.", + "Mu-law audio format." + ], + "enum": [ + "MIME_TYPE_UNSPECIFIED", + "AUDIO_MP3", + "AUDIO_OGG_OPUS", + "AUDIO_L16", + "AUDIO_WAV", + "AUDIO_ALAW", + "AUDIO_MULAW" + ] }, - "objectVersion": { - "description": "The object version of the object that is the base version the incoming diff script will be applied to. This field will always be filled in.", - "type": "string" + "delivery": { + "description": "Optional. The delivery mode for the audio output.", + "type": "string", + "enumDescriptions": [ + "Default value. This value is unused.", + "Audio data is returned inline in the response.", + "Audio data is returned as a URI." + ], + "enum": [ + "DELIVERY_UNSPECIFIED", + "INLINE", + "URI" + ] }, - "objectInfo": { - "description": "The location of the new object. Agents must clone the object located here, as the upload server will delete the contents once a response is received.", - "$ref": "CompositeMedia" + "sampleRate": { + "description": "Optional. Sample rate in Hz.", + "type": "integer", + "format": "int32" + }, + "bitRate": { + "description": "Optional. Bit rate in bits per second (bps). Only applicable for compressed formats (MP3, Opus).", + "type": "integer", + "format": "int32" } - }, - "id": "DiffUploadRequest", - "description": "A Diff upload request. For details on the Scotty Diff protocol, visit http://go/scotty-diff-protocol.", - "type": "object" + } }, - "GroundingChunkCustomMetadata": { + "ImageResponseFormat": { + "id": "ImageResponseFormat", + "description": "Configuration for image output format.", "type": "object", - "id": "GroundingChunkCustomMetadata", - "description": "User provided metadata about the GroundingFact.", "properties": { - "stringValue": { - "description": "Optional. The string value of the metadata.", - "type": "string" + "mimeType": { + "description": "Optional. The MIME type of the image output.", + "type": "string", + "enumDescriptions": [ + "Default value. This value is unused.", + "JPEG image format." + ], + "enum": [ + "MIME_TYPE_UNSPECIFIED", + "IMAGE_JPEG" + ] }, - "stringListValue": { - "$ref": "GroundingChunkStringList", - "description": "Optional. A list of string values for the metadata." + "delivery": { + "description": "Optional. The delivery mode for the image output.", + "type": "string", + "enumDescriptions": [ + "Default value. This value is unused.", + "Image data is returned inline in the response.", + "Image data is returned as a URI." + ], + "enum": [ + "DELIVERY_UNSPECIFIED", + "INLINE", + "URI" + ] }, - "numericValue": { - "format": "float", - "description": "Optional. The numeric value of the metadata. The expected range for this value depends on the specific `key` used.", - "type": "number" + "aspectRatio": { + "description": "Optional. The aspect ratio for the image output.", + "type": "string", + "enumDescriptions": [ + "Default value. This value is unused.", + "1:1 aspect ratio.", + "2:3 aspect ratio.", + "3:2 aspect ratio.", + "3:4 aspect ratio.", + "4:3 aspect ratio.", + "4:5 aspect ratio.", + "5:4 aspect ratio.", + "9:16 aspect ratio.", + "16:9 aspect ratio.", + "21:9 aspect ratio.", + "1:8 aspect ratio.", + "8:1 aspect ratio.", + "1:4 aspect ratio.", + "4:1 aspect ratio." + ], + "enum": [ + "ASPECT_RATIO_UNSPECIFIED", + "ASPECT_RATIO_ONE_BY_ONE", + "ASPECT_RATIO_TWO_BY_THREE", + "ASPECT_RATIO_THREE_BY_TWO", + "ASPECT_RATIO_THREE_BY_FOUR", + "ASPECT_RATIO_FOUR_BY_THREE", + "ASPECT_RATIO_FOUR_BY_FIVE", + "ASPECT_RATIO_FIVE_BY_FOUR", + "ASPECT_RATIO_NINE_BY_SIXTEEN", + "ASPECT_RATIO_SIXTEEN_BY_NINE", + "ASPECT_RATIO_TWENTY_ONE_BY_NINE", + "ASPECT_RATIO_ONE_BY_EIGHT", + "ASPECT_RATIO_EIGHT_BY_ONE", + "ASPECT_RATIO_ONE_BY_FOUR", + "ASPECT_RATIO_FOUR_BY_ONE" + ] }, - "key": { + "imageSize": { + "description": "Optional. The size of the image output.", "type": "string", - "description": "The key of the metadata." + "enumDescriptions": [ + "Default value. This value is unused.", + "512px image size.", + "1K image size.", + "2K image size.", + "4K image size." + ], + "enum": [ + "IMAGE_SIZE_UNSPECIFIED", + "IMAGE_SIZE_FIVE_TWELVE", + "IMAGE_SIZE_ONE_K", + "IMAGE_SIZE_TWO_K", + "IMAGE_SIZE_FOUR_K" + ] } } }, - "PredictLongRunningRequest": { + "GenerateContentResponse": { + "id": "GenerateContentResponse", + "description": "Response from the model supporting multiple candidate responses. Safety ratings and content filtering are reported for both prompt in `GenerateContentResponse.prompt_feedback` and for each candidate in `finish_reason` and in `safety_ratings`. The API: - Returns either all requested candidates or none of them - Returns no candidates at all only if there was something wrong with the prompt (check `prompt_feedback`) - Reports feedback on each candidate in `finish_reason` and `safety_ratings`.", + "type": "object", "properties": { - "parameters": { - "description": "Optional. The parameters that govern the prediction call.", - "type": "any" - }, - "instances": { + "candidates": { + "description": "Candidate responses from the model.", "type": "array", - "description": "Required. The instances that are the input to the prediction call.", "items": { - "type": "any" + "$ref": "Candidate" } + }, + "promptFeedback": { + "description": "Returns the prompt's feedback related to the content filters.", + "$ref": "PromptFeedback" + }, + "usageMetadata": { + "description": "Output only. Metadata on the generation requests' token usage.", + "readOnly": true, + "$ref": "UsageMetadata" + }, + "modelVersion": { + "description": "Output only. The model version used to generate the response.", + "readOnly": true, + "type": "string" + }, + "responseId": { + "description": "Output only. response_id is used to identify each response.", + "readOnly": true, + "type": "string" + }, + "modelStatus": { + "description": "Output only. The current model status of this model.", + "readOnly": true, + "$ref": "ModelStatus" } - }, - "type": "object", - "id": "PredictLongRunningRequest", - "description": "Request message for [PredictionService.PredictLongRunning]." + } }, - "GroundingAttribution": { + "Candidate": { + "id": "Candidate", + "description": "A response candidate generated from the model.", + "type": "object", "properties": { - "sourceId": { - "$ref": "AttributionSourceId", - "description": "Output only. Identifier for the source contributing to this attribution.", - "readOnly": true + "index": { + "description": "Output only. Index of the candidate in the list of response candidates.", + "readOnly": true, + "type": "integer", + "format": "int32" }, "content": { - "description": "Grounding source content that makes up this attribution.", + "description": "Output only. Generated content returned from the model.", + "readOnly": true, "$ref": "Content" - } - }, - "id": "GroundingAttribution", - "description": "Attribution for a source that contributed to an answer.", - "type": "object" - }, - "CodeExecutionResult": { - "properties": { - "id": { - "type": "string", - "description": "Optional. The identifier of the `ExecutableCode` part this result is for. Only populated if the corresponding `ExecutableCode` has an id." }, - "outcome": { + "finishReason": { + "description": "Optional. Output only. The reason why the model stopped generating tokens. If empty, the model has not stopped generating tokens.", + "readOnly": true, "type": "string", - "description": "Required. Outcome of the code execution.", "enumDescriptions": [ - "Unspecified status. This value should not be used.", - "Code execution completed successfully. `output` contains the stdout, if any.", - "Code execution failed. `output` contains the stderr and stdout, if any.", - "Code execution ran for too long, and was cancelled. There may or may not be a partial `output` present." + "Default value. This value is unused.", + "Natural stop point of the model or provided stop sequence.", + "The maximum number of tokens as specified in the request was reached.", + "The response candidate content was flagged for safety reasons.", + "The response candidate content was flagged for recitation reasons.", + "The response candidate content was flagged for using an unsupported language.", + "Unknown reason.", + "Token generation stopped because the content contains forbidden terms.", + "Token generation stopped for potentially containing prohibited content.", + "Token generation stopped because the content potentially contains Sensitive Personally Identifiable Information (SPII).", + "The function call generated by the model is invalid.", + "Token generation stopped because generated images contain safety violations.", + "Image generation stopped because generated images has other prohibited content.", + "Image generation stopped because of other miscellaneous issue.", + "The model was expected to generate an image, but none was generated.", + "Image generation stopped due to recitation.", + "Model generated a tool call but no tools were enabled in the request.", + "Model called too many tools consecutively, thus the system exited execution.", + "Request has at least one thought signature missing.", + "Finished due to malformed response." ], "enum": [ - "OUTCOME_UNSPECIFIED", - "OUTCOME_OK", - "OUTCOME_FAILED", - "OUTCOME_DEADLINE_EXCEEDED" + "FINISH_REASON_UNSPECIFIED", + "STOP", + "MAX_TOKENS", + "SAFETY", + "RECITATION", + "LANGUAGE", + "OTHER", + "BLOCKLIST", + "PROHIBITED_CONTENT", + "SPII", + "MALFORMED_FUNCTION_CALL", + "IMAGE_SAFETY", + "IMAGE_PROHIBITED_CONTENT", + "IMAGE_OTHER", + "NO_IMAGE", + "IMAGE_RECITATION", + "UNEXPECTED_TOOL_CALL", + "TOO_MANY_TOOL_CALLS", + "MISSING_THOUGHT_SIGNATURE", + "MALFORMED_RESPONSE" ] }, - "output": { - "description": "Optional. Contains stdout when code execution is successful, stderr or other description otherwise.", + "finishMessage": { + "description": "Optional. Output only. Details the reason why the model stopped generating tokens. This is populated only when `finish_reason` is set.", + "readOnly": true, "type": "string" - } - }, - "type": "object", - "id": "CodeExecutionResult", - "description": "Result of executing the `ExecutableCode`. Generated only when the `CodeExecution` tool is used." - }, - "CountTextTokensRequest": { - "properties": { - "prompt": { - "$ref": "TextPrompt", - "description": "Required. The free-form input text given to the model as a prompt." - } - }, - "id": "CountTextTokensRequest", - "description": "Counts the number of tokens in the `prompt` sent to a model. Models may tokenize text differently, so each model may return a different `token_count`.", - "type": "object" - }, - "ListFilesResponse": { - "properties": { - "files": { - "description": "The list of `File`s.", - "items": { - "$ref": "File" - }, - "type": "array" }, - "nextPageToken": { - "type": "string", - "description": "A token that can be sent as a `page_token` into a subsequent `ListFiles` call." - } - }, - "type": "object", - "id": "ListFilesResponse", - "description": "Response for `ListFiles`." - }, - "Document": { - "properties": { - "customMetadata": { + "safetyRatings": { + "description": "List of ratings for the safety of a response candidate. There is at most one rating per category.", "type": "array", - "description": "Optional. User provided custom metadata stored as key-value pairs used for querying. A `Document` can have a maximum of 20 `CustomMetadata`.", "items": { - "$ref": "CustomMetadata" + "$ref": "SafetyRating" } }, - "sizeBytes": { - "format": "int64", - "type": "string", - "description": "Output only. The size of raw bytes ingested into the Document.", - "readOnly": true - }, - "mimeType": { - "type": "string", - "description": "Output only. The mime type of the Document.", - "readOnly": true - }, - "createTime": { - "type": "string", - "description": "Output only. The Timestamp of when the `Document` was created.", + "citationMetadata": { + "description": "Output only. Citation information for model-generated candidate. This field may be populated with recitation information for any text included in the `content`. These are passages that are \"recited\" from copyrighted material in the foundational LLM's training data.", "readOnly": true, - "format": "google-datetime" - }, - "displayName": { - "description": "Optional. The human-readable display name for the `Document`. The display name must be no more than 512 characters in length, including spaces. Example: \"Semantic Retriever Documentation\"", - "type": "string" + "$ref": "CitationMetadata" }, - "updateTime": { - "format": "google-datetime", - "description": "Output only. The Timestamp of when the `Document` was last updated.", + "tokenCount": { + "description": "Output only. Token count for this candidate.", "readOnly": true, - "type": "string" + "type": "integer", + "format": "int32" }, - "state": { + "groundingAttributions": { + "description": "Output only. Attribution information for sources that contributed to a grounded answer. This field is populated for `GenerateAnswer` calls.", "readOnly": true, - "enumDescriptions": [ - "The default value. This value is used if the state is omitted.", - "Some `Chunks` of the `Document` are being processed (embedding and vector storage).", - "All `Chunks` of the `Document` is processed and available for querying.", - "Some `Chunks` of the `Document` failed processing." - ], - "description": "Output only. Current state of the `Document`.", - "type": "string", - "enum": [ - "STATE_UNSPECIFIED", - "STATE_PENDING", - "STATE_ACTIVE", - "STATE_FAILED" - ] - }, - "name": { - "type": "string", - "description": "Immutable. Identifier. The `Document` resource name. The ID (name excluding the \"fileSearchStores/*/documents/\" prefix) can contain up to 40 characters that are lowercase alphanumeric or dashes (-). The ID cannot start or end with a dash. If the name is empty on create, a unique name will be derived from `display_name` along with a 12 character random suffix. Example: `fileSearchStores/{file_search_store_id}/documents/my-awesome-doc-123a456b789c`" - } - }, - "id": "Document", - "description": "A `Document` is a collection of `Chunk`s.", - "type": "object" - }, - "Maps": { - "properties": { - "text": { - "description": "Text description of the place answer.", - "type": "string" - }, - "placeId": { - "description": "The ID of the place, in `places/{place_id}` format. A user can use this ID to look up that place.", - "type": "string" - }, - "title": { - "description": "Title of the place.", - "type": "string" - }, - "uri": { - "type": "string", - "description": "URI reference of the place." - }, - "placeAnswerSources": { - "$ref": "PlaceAnswerSources", - "description": "Sources that provide answers about the features of a given place in Google Maps." - } - }, - "id": "Maps", - "description": "A grounding chunk from Google Maps. A Maps chunk corresponds to a single place.", - "type": "object" - }, - "InputFeedback": { - "type": "object", - "id": "InputFeedback", - "description": "Feedback related to the input data used to answer the question, as opposed to the model-generated response to the question.", - "properties": { - "blockReason": { - "enumDescriptions": [ - "Default value. This value is unused.", - "Input was blocked due to safety reasons. Inspect `safety_ratings` to understand which safety category blocked it.", - "Input was blocked due to other reasons." - ], - "enum": [ - "BLOCK_REASON_UNSPECIFIED", - "SAFETY", - "OTHER" - ], - "type": "string", - "description": "Optional. If set, the input was blocked and no candidates are returned. Rephrase the input." - }, - "safetyRatings": { "type": "array", - "description": "Ratings for safety of the input. There is at most one rating per category.", "items": { - "$ref": "SafetyRating" + "$ref": "GroundingAttribution" } - } - } - }, - "TuningSnapshot": { - "properties": { - "epoch": { - "type": "integer", - "description": "Output only. The epoch this step was part of.", + }, + "groundingMetadata": { + "description": "Output only. Grounding metadata for the candidate. This field is populated for `GenerateContent` calls.", "readOnly": true, - "format": "int32" + "$ref": "GroundingMetadata" }, - "meanLoss": { - "description": "Output only. The mean loss of the training examples for this step.", + "avgLogprobs": { + "description": "Output only. Average log probability score of the candidate.", "readOnly": true, "type": "number", - "format": "float" + "format": "double" }, - "computeTime": { - "format": "google-datetime", - "description": "Output only. The timestamp when this metric was computed.", + "logprobsResult": { + "description": "Output only. Log-likelihood scores for the response tokens and top tokens", "readOnly": true, - "type": "string" + "$ref": "LogprobsResult" }, - "step": { - "format": "int32", - "description": "Output only. The tuning step.", + "urlContextMetadata": { + "description": "Output only. Metadata related to url context retrieval tool.", "readOnly": true, - "type": "integer" - } - }, - "id": "TuningSnapshot", - "description": "Record for a single tuning step.", - "type": "object" - }, - "ImageSearch": { - "id": "ImageSearch", - "description": "Image search for grounding and related configurations.", - "type": "object", - "properties": {} - }, - "ReviewSnippet": { - "id": "ReviewSnippet", - "description": "Encapsulates a snippet of a user review that answers a question about the features of a specific place in Google Maps.", - "type": "object", - "properties": { - "googleMapsUri": { - "description": "A link that corresponds to the user review on Google Maps.", - "type": "string" - }, - "title": { - "type": "string", - "description": "Title of the review." - }, - "reviewId": { - "description": "The ID of the review snippet.", - "type": "string" + "$ref": "UrlContextMetadata" } } }, - "CountMessageTokensRequest": { + "SafetyRating": { + "id": "SafetyRating", + "description": "Safety rating for a piece of content. The safety rating contains the category of harm and the harm probability level in that category for a piece of content. Content is classified for safety across a number of harm categories and the probability of the harm classification is included here.", "type": "object", - "id": "CountMessageTokensRequest", - "description": "Counts the number of tokens in the `prompt` sent to a model. Models may tokenize text differently, so each model may return a different `token_count`.", "properties": { - "prompt": { - "description": "Required. The prompt, whose token count is to be returned.", - "$ref": "MessagePrompt" + "category": { + "description": "Required. The category for this rating.", + "type": "string", + "enumDescriptions": [ + "Category is unspecified.", + "**PaLM** - Negative or harmful comments targeting identity and/or protected attribute.", + "**PaLM** - Content that is rude, disrespectful, or profane.", + "**PaLM** - Describes scenarios depicting violence against an individual or group, or general descriptions of gore.", + "**PaLM** - Contains references to sexual acts or other lewd content.", + "**PaLM** - Promotes unchecked medical advice.", + "**PaLM** - Dangerous content that promotes, facilitates, or encourages harmful acts.", + "**Gemini** - Harassment content.", + "**Gemini** - Hate speech and content.", + "**Gemini** - Sexually explicit content.", + "**Gemini** - Dangerous content.", + "**Gemini** - Content that may be used to harm civic integrity. DEPRECATED: use enable_enhanced_civic_answers instead." + ], + "enumDeprecated": [ + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + true + ], + "enum": [ + "HARM_CATEGORY_UNSPECIFIED", + "HARM_CATEGORY_DEROGATORY", + "HARM_CATEGORY_TOXICITY", + "HARM_CATEGORY_VIOLENCE", + "HARM_CATEGORY_SEXUAL", + "HARM_CATEGORY_MEDICAL", + "HARM_CATEGORY_DANGEROUS", + "HARM_CATEGORY_HARASSMENT", + "HARM_CATEGORY_HATE_SPEECH", + "HARM_CATEGORY_SEXUALLY_EXPLICIT", + "HARM_CATEGORY_DANGEROUS_CONTENT", + "HARM_CATEGORY_CIVIC_INTEGRITY" + ] + }, + "probability": { + "description": "Required. The probability of harm for this content.", + "type": "string", + "enumDescriptions": [ + "Probability is unspecified.", + "Content has a negligible chance of being unsafe.", + "Content has a low chance of being unsafe.", + "Content has a medium chance of being unsafe.", + "Content has a high chance of being unsafe." + ], + "enum": [ + "HARM_PROBABILITY_UNSPECIFIED", + "NEGLIGIBLE", + "LOW", + "MEDIUM", + "HIGH" + ] + }, + "blocked": { + "description": "Was this content blocked because of this rating?", + "type": "boolean" } } }, - "TuningTask": { + "CitationMetadata": { + "id": "CitationMetadata", + "description": "A collection of source attributions for a piece of content.", + "type": "object", "properties": { - "completeTime": { - "description": "Output only. The timestamp when tuning this model completed.", - "readOnly": true, - "type": "string", - "format": "google-datetime" - }, - "snapshots": { - "description": "Output only. Metrics collected during tuning.", - "readOnly": true, + "citationSources": { + "description": "Citations to sources for a specific response.", + "type": "array", "items": { - "$ref": "TuningSnapshot" - }, - "type": "array" + "$ref": "CitationSource" + } + } + } + }, + "CitationSource": { + "id": "CitationSource", + "description": "A citation to a source for a portion of a specific response.", + "type": "object", + "properties": { + "startIndex": { + "description": "Optional. Start of segment of the response that is attributed to this source. Index indicates the start of the segment, measured in bytes.", + "type": "integer", + "format": "int32" }, - "trainingData": { - "$ref": "Dataset", - "description": "Required. Input only. Immutable. The model training data." + "endIndex": { + "description": "Optional. End of the attributed segment, exclusive.", + "type": "integer", + "format": "int32" }, - "hyperparameters": { - "description": "Immutable. Hyperparameters controlling the tuning process. If not provided, default values will be used.", - "$ref": "Hyperparameters" + "uri": { + "description": "Optional. URI that is attributed as a source for a portion of the text.", + "type": "string" }, - "startTime": { - "format": "google-datetime", - "type": "string", - "description": "Output only. The timestamp when tuning this model started.", - "readOnly": true + "license": { + "description": "Optional. License for the GitHub project that is attributed as a source for segment. License info is required for code citations.", + "type": "string" } - }, - "id": "TuningTask", - "description": "Tuning tasks that create tuned models.", - "type": "object" + } }, - "DownloadMediaResponse": { + "GroundingAttribution": { + "id": "GroundingAttribution", + "description": "Attribution for a source that contributed to an answer.", "type": "object", - "id": "DownloadMediaResponse", - "description": "Response for DownloadMedia.", "properties": { - "blob": { - "description": "Output only. The blob data.", + "sourceId": { + "description": "Output only. Identifier for the source contributing to this attribution.", "readOnly": true, - "$ref": "GdataMedia" + "$ref": "AttributionSourceId" + }, + "content": { + "description": "Grounding source content that makes up this attribution.", + "$ref": "Content" } } }, - "CitationMetadata": { + "AttributionSourceId": { + "id": "AttributionSourceId", + "description": "Identifier for the source contributing to this attribution.", + "type": "object", "properties": { - "citationSources": { - "description": "Citations to sources for a specific response.", - "items": { - "$ref": "CitationSource" - }, - "type": "array" + "groundingPassage": { + "description": "Identifier for an inline passage.", + "$ref": "GroundingPassageId" + }, + "semanticRetrieverChunk": { + "description": "Identifier for a `Chunk` fetched via Semantic Retriever.", + "$ref": "SemanticRetrieverChunk" } - }, - "id": "CitationMetadata", - "description": "A collection of source attributions for a piece of content.", - "type": "object" + } }, - "DiffDownloadResponse": { + "GroundingPassageId": { + "id": "GroundingPassageId", + "description": "Identifier for a part within a `GroundingPassage`.", + "type": "object", "properties": { - "objectLocation": { - "description": "The original object location.", - "$ref": "CompositeMedia" + "passageId": { + "description": "Output only. ID of the passage matching the `GenerateAnswerRequest`'s `GroundingPassage.id`.", + "readOnly": true, + "type": "string" + }, + "partIndex": { + "description": "Output only. Index of the part within the `GenerateAnswerRequest`'s `GroundingPassage.content`.", + "readOnly": true, + "type": "integer", + "format": "int32" } - }, - "type": "object", - "id": "DiffDownloadResponse", - "description": "Backend response for a Diff download response. For details on the Scotty Diff protocol, visit http://go/scotty-diff-protocol." + } }, - "PromptFeedback": { + "SemanticRetrieverChunk": { + "id": "SemanticRetrieverChunk", + "description": "Identifier for a `Chunk` retrieved via Semantic Retriever specified in the `GenerateAnswerRequest` using `SemanticRetrieverConfig`.", + "type": "object", "properties": { - "blockReason": { - "description": "Optional. If set, the prompt was blocked and no candidates are returned. Rephrase the prompt.", - "type": "string", - "enumDescriptions": [ - "Default value. This value is unused.", - "Prompt was blocked due to safety reasons. Inspect `safety_ratings` to understand which safety category blocked it.", - "Prompt was blocked due to unknown reasons.", - "Prompt was blocked due to the terms which are included from the terminology blocklist.", - "Prompt was blocked due to prohibited content.", - "Candidates blocked due to unsafe image generation content." - ], - "enum": [ - "BLOCK_REASON_UNSPECIFIED", - "SAFETY", - "OTHER", - "BLOCKLIST", - "PROHIBITED_CONTENT", - "IMAGE_SAFETY" - ] + "source": { + "description": "Output only. Name of the source matching the request's `SemanticRetrieverConfig.source`. Example: `corpora/123` or `corpora/123/documents/abc`", + "readOnly": true, + "type": "string" }, - "safetyRatings": { - "type": "array", - "description": "Ratings for safety of the prompt. There is at most one rating per category.", - "items": { - "$ref": "SafetyRating" - } + "chunk": { + "description": "Output only. Name of the `Chunk` containing the attributed text. Example: `corpora/123/documents/abc/chunks/xyz`", + "readOnly": true, + "type": "string" } - }, - "type": "object", - "id": "PromptFeedback", - "description": "A set of the feedback metadata the prompt specified in `GenerateContentRequest.content`." + } }, - "CachedContent": { - "id": "CachedContent", - "description": "Content that has been preprocessed and can be used in subsequent request to GenerativeService. Cached content can be only used with model it was created for.", + "GroundingMetadata": { + "id": "GroundingMetadata", + "description": "Metadata returned to client when grounding is enabled.", "type": "object", "properties": { - "toolConfig": { - "description": "Optional. Input only. Immutable. Tool config. This config is shared for all tools.", - "$ref": "ToolConfig" - }, - "expireTime": { - "format": "google-datetime", - "type": "string", - "description": "Timestamp in UTC of when this resource is considered expired. This is *always* provided on output, regardless of what was sent on input." + "searchEntryPoint": { + "description": "Optional. Google search entry for the following-up web searches.", + "$ref": "SearchEntryPoint" }, - "contents": { + "groundingChunks": { + "description": "List of supporting references retrieved from specified grounding source. When streaming, this only contains the grounding chunks that have not been included in the grounding metadata of previous responses.", "type": "array", - "description": "Optional. Input only. Immutable. The content to cache.", "items": { - "$ref": "Content" + "$ref": "GroundingChunk" } }, - "systemInstruction": { - "description": "Optional. Input only. Immutable. Developer set system instruction. Currently text only.", - "$ref": "Content" - }, - "createTime": { - "description": "Output only. Creation time of the cache entry.", - "readOnly": true, - "type": "string", - "format": "google-datetime" + "groundingSupports": { + "description": "List of grounding support.", + "type": "array", + "items": { + "$ref": "GoogleAiGenerativelanguageV1betaGroundingSupport" + } }, - "ttl": { - "format": "google-duration", - "type": "string", - "description": "Input only. New TTL for this resource, input only." + "retrievalMetadata": { + "description": "Metadata related to retrieval in the grounding flow.", + "$ref": "RetrievalMetadata" }, - "updateTime": { - "type": "string", - "description": "Output only. When the cache entry was last updated in UTC time.", - "readOnly": true, - "format": "google-datetime" - }, - "name": { - "description": "Output only. Identifier. The resource name referring to the cached content. Format: `cachedContents/{id}`", - "readOnly": true, - "type": "string" - }, - "usageMetadata": { - "description": "Output only. Metadata on the usage of the cached content.", - "readOnly": true, - "$ref": "CachedContentUsageMetadata" - }, - "model": { - "description": "Required. Immutable. The name of the `Model` to use for cached content Format: `models/{model}`", - "type": "string" + "webSearchQueries": { + "description": "Web search queries for the following-up web search.", + "type": "array", + "items": { + "type": "string" + } }, - "tools": { + "imageSearchQueries": { + "description": "Image search queries used for grounding.", "type": "array", - "description": "Optional. Input only. Immutable. A list of `Tools` the model may use to generate the next response", "items": { - "$ref": "Tool" + "type": "string" } }, - "displayName": { - "description": "Optional. Immutable. The user-generated meaningful display name of the cached content. Maximum 128 Unicode characters.", + "googleMapsWidgetContextToken": { + "description": "Optional. Resource name of the Google Maps widget context token that can be used with the PlacesContextElement widget in order to render contextual data. Only populated in the case that grounding with Google Maps is enabled.", "type": "string" } } }, - "FunctionResponse": { + "SearchEntryPoint": { + "id": "SearchEntryPoint", + "description": "Google search entry point.", + "type": "object", "properties": { - "parts": { - "description": "Optional. Ordered `Parts` that constitute a function response. Parts may have different IANA MIME types.", - "items": { - "$ref": "FunctionResponsePart" - }, - "type": "array" - }, - "willContinue": { - "description": "Optional. Signals that function call continues, and more responses will be returned, turning the function call into a generator. Is only applicable to NON_BLOCKING function calls, is ignored otherwise. If set to false, future responses will not be considered. It is allowed to return empty `response` with `will_continue=False` to signal that the function call is finished. This may still trigger the model generation. To avoid triggering the generation and finish the function call, additionally set `scheduling` to `SILENT`.", - "type": "boolean" - }, - "scheduling": { - "enumDescriptions": [ - "This value is unused.", - "Only add the result to the conversation context, do not interrupt or trigger generation.", - "Add the result to the conversation context, and prompt to generate output without interrupting ongoing generation.", - "Add the result to the conversation context, interrupt ongoing generation and prompt to generate output." - ], - "enum": [ - "SCHEDULING_UNSPECIFIED", - "SILENT", - "WHEN_IDLE", - "INTERRUPT" - ], - "description": "Optional. Specifies how the response should be scheduled in the conversation. Only applicable to NON_BLOCKING function calls, is ignored otherwise. Defaults to WHEN_IDLE.", - "type": "string" - }, - "name": { - "description": "Required. The name of the function to call. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 128.", - "type": "string" - }, - "id": { - "description": "Optional. The identifier of the function call this response is for. Populated by the client to match the corresponding function call `id`.", + "renderedContent": { + "description": "Optional. Web content snippet that can be embedded in a web page or an app webview.", "type": "string" }, - "response": { - "additionalProperties": { - "description": "Properties of the object.", - "type": "any" - }, - "description": "Required. The function response in JSON object format. Callers can use any keys of their choice that fit the function's syntax to return the function output, e.g. \"output\", \"result\", etc. In particular, if the function call failed to execute, the response can have an \"error\" key to return error details to the model.", - "type": "object" + "sdkBlob": { + "description": "Optional. Base64 encoded JSON representing array of tuple.", + "type": "string", + "format": "byte" } - }, - "type": "object", - "id": "FunctionResponse", - "description": "The result output from a `FunctionCall` that contains a string representing the `FunctionDeclaration.name` and a structured JSON object containing any output from the function is used as context to the model. This should contain the result of a`FunctionCall` made based on model prediction." + } }, - "PredictResponse": { - "properties": { - "predictions": { - "type": "array", - "description": "The outputs of the prediction call.", - "items": { - "type": "any" - } - } - }, + "GroundingChunk": { + "id": "GroundingChunk", + "description": "A `GroundingChunk` represents a segment of supporting evidence that grounds the model's response. It can be a chunk from the web, a retrieved context from a file, or information from Google Maps.", "type": "object", - "id": "PredictResponse", - "description": "Response message for [PredictionService.Predict]." - }, - "LatLng": { "properties": { - "longitude": { - "format": "double", - "description": "The longitude in degrees. It must be in the range [-180.0, +180.0].", - "type": "number" + "web": { + "description": "Grounding chunk from the web.", + "$ref": "Web" }, - "latitude": { - "format": "double", - "description": "The latitude in degrees. It must be in the range [-90.0, +90.0].", - "type": "number" - } - }, - "type": "object", - "id": "LatLng", - "description": "An object that represents a latitude/longitude pair. This is expressed as a pair of doubles to represent degrees latitude and degrees longitude. Unless specified otherwise, this object must conform to the WGS84 standard. Values must be within normalized ranges." - }, - "BatchEmbedContentsRequest": { - "properties": { - "requests": { - "description": "Required. Embed requests for the batch. The model in each of these requests must match the model specified `BatchEmbedContentsRequest.model`.", - "items": { - "$ref": "EmbedContentRequest" - }, - "type": "array" + "image": { + "description": "Optional. Grounding chunk from image search.", + "$ref": "Image" + }, + "retrievedContext": { + "description": "Optional. Grounding chunk from context retrieved by the file search tool.", + "$ref": "RetrievedContext" + }, + "maps": { + "description": "Optional. Grounding chunk from Google Maps.", + "$ref": "Maps" } - }, - "id": "BatchEmbedContentsRequest", - "description": "Batch request to get embeddings from the model for a list of prompts.", - "type": "object" - }, - "DownloadFileResponse": { - "type": "object", - "id": "DownloadFileResponse", - "description": "Response for `DownloadFile`.", - "properties": {} + } }, - "Part": { + "Web": { + "id": "Web", + "description": "Chunk from the web.", "type": "object", - "id": "Part", - "description": "A datatype containing media that is part of a multi-part `Content` message. A `Part` consists of data which has an associated datatype. A `Part` can only contain one of the accepted types in `Part.data`. A `Part` must have a fixed IANA MIME type identifying the type and subtype of the media if the `inline_data` field is filled with raw bytes.", "properties": { - "thought": { - "type": "boolean", - "description": "Optional. Indicates if the part is thought from the model." - }, - "fileData": { - "description": "URI based data.", - "$ref": "FileData" - }, - "codeExecutionResult": { - "$ref": "CodeExecutionResult", - "description": "Result of executing the `ExecutableCode`." - }, - "inlineData": { - "$ref": "Blob", - "description": "Inline media bytes." - }, - "text": { - "description": "Inline text.", + "uri": { + "description": "Output only. URI reference of the chunk.", + "readOnly": true, "type": "string" }, - "functionResponse": { - "$ref": "FunctionResponse", - "description": "The result output of a `FunctionCall` that contains a string representing the `FunctionDeclaration.name` and a structured JSON object containing any output from the function is used as context to the model." - }, - "mediaResolution": { - "description": "Optional. Media resolution for the input media.", - "$ref": "MediaResolution" - }, - "videoMetadata": { - "$ref": "VideoMetadata", - "description": "Optional. Video metadata. The metadata should only be specified while the video data is presented in inline_data or file_data." - }, - "toolCall": { - "$ref": "ToolCall", - "description": "Server-side tool call. This field is populated when the model predicts a tool invocation that should be executed on the server. The client is expected to echo this message back to the API." - }, - "toolResponse": { - "$ref": "ToolResponse", - "description": "The output from a server-side `ToolCall` execution. This field is populated by the client with the results of executing the corresponding `ToolCall`." - }, - "executableCode": { - "description": "Code generated by the model that is meant to be executed.", - "$ref": "ExecutableCode" - }, - "thoughtSignature": { - "format": "byte", - "description": "Optional. An opaque signature for the thought so it can be reused in subsequent requests.", + "title": { + "description": "Output only. Title of the chunk.", + "readOnly": true, "type": "string" - }, - "functionCall": { - "$ref": "FunctionCall", - "description": "A predicted `FunctionCall` returned from the model that contains a string representing the `FunctionDeclaration.name` with the arguments and their values." - }, - "partMetadata": { - "description": "Custom metadata associated with the Part. Agents using genai.Part as content representation may need to keep track of the additional information. For example it can be name of a file/source from which the Part originates or a way to multiplex multiple Part streams.", - "type": "object", - "additionalProperties": { - "description": "Properties of the object.", - "type": "any" - } } } }, - "Web": { + "Image": { + "id": "Image", + "description": "Chunk from image search.", + "type": "object", "properties": { + "sourceUri": { + "description": "The web page URI for attribution.", + "type": "string" + }, + "imageUri": { + "description": "The image asset URL.", + "type": "string" + }, "title": { - "type": "string", - "description": "Output only. Title of the chunk.", - "readOnly": true + "description": "The title of the web page that the image is from.", + "type": "string" }, - "uri": { - "type": "string", - "description": "Output only. URI reference of the chunk.", - "readOnly": true + "domain": { + "description": "The root domain of the web page that the image is from, e.g. \"example.com\".", + "type": "string" } - }, - "id": "Web", - "description": "Chunk from the web.", - "type": "object" + } }, "RetrievedContext": { + "id": "RetrievedContext", + "description": "Chunk from context retrieved by the file search tool.", + "type": "object", "properties": { - "customMetadata": { - "description": "Optional. User-provided metadata about the retrieved context.", - "items": { - "$ref": "GroundingChunkCustomMetadata" - }, - "type": "array" + "uri": { + "description": "Optional. URI reference of the semantic retrieval document.", + "type": "string" + }, + "title": { + "description": "Optional. Title of the document.", + "type": "string" }, "text": { "description": "Optional. Text of the chunk.", "type": "string" }, "fileSearchStore": { - "type": "string", - "description": "Optional. Name of the `FileSearchStore` containing the document. Example: `fileSearchStores/123`" + "description": "Optional. Name of the `FileSearchStore` containing the document. Example: `fileSearchStores/123`", + "type": "string" + }, + "customMetadata": { + "description": "Optional. User-provided metadata about the retrieved context.", + "type": "array", + "items": { + "$ref": "GroundingChunkCustomMetadata" + } }, "pageNumber": { "description": "Optional. Page number of the retrieved context, if applicable.", "type": "integer", "format": "int32" }, - "title": { - "type": "string", - "description": "Optional. Title of the document." - }, - "uri": { - "description": "Optional. URI reference of the semantic retrieval document.", - "type": "string" - }, "mediaId": { "description": "Optional. The media blob resource name for multimodal file search results. Format: fileSearchStores/{file_search_store_id}/media/{blob_id}", "type": "string" } - }, - "type": "object", - "id": "RetrievedContext", - "description": "Chunk from context retrieved by the file search tool." + } }, - "BatchEmbedTextRequest": { + "GroundingChunkCustomMetadata": { + "id": "GroundingChunkCustomMetadata", + "description": "User provided metadata about the GroundingFact.", + "type": "object", "properties": { - "texts": { - "type": "array", - "description": "Optional. The free-form input texts that the model will turn into an embedding. The current limit is 100 texts, over which an error will be thrown.", - "items": { - "type": "string" - } - }, - "requests": { - "description": "Optional. Embed requests for the batch. Only one of `texts` or `requests` can be set.", - "items": { - "$ref": "EmbedTextRequest" - }, - "type": "array" - } - }, - "id": "BatchEmbedTextRequest", - "description": "Batch request to get a text embedding from the model.", - "type": "object" - }, - "GroundingChunk": { - "id": "GroundingChunk", - "description": "A `GroundingChunk` represents a segment of supporting evidence that grounds the model's response. It can be a chunk from the web, a retrieved context from a file, or information from Google Maps.", - "type": "object", - "properties": { - "image": { - "description": "Optional. Grounding chunk from image search.", - "$ref": "Image" + "stringValue": { + "description": "Optional. The string value of the metadata.", + "type": "string" }, - "retrievedContext": { - "description": "Optional. Grounding chunk from context retrieved by the file search tool.", - "$ref": "RetrievedContext" + "stringListValue": { + "description": "Optional. A list of string values for the metadata.", + "$ref": "GroundingChunkStringList" }, - "maps": { - "$ref": "Maps", - "description": "Optional. Grounding chunk from Google Maps." + "numericValue": { + "description": "Optional. The numeric value of the metadata. The expected range for this value depends on the specific `key` used.", + "type": "number", + "format": "float" }, - "web": { - "description": "Grounding chunk from the web.", - "$ref": "Web" + "key": { + "description": "The key of the metadata.", + "type": "string" } } }, - "RegisterFilesRequest": { + "GroundingChunkStringList": { + "id": "GroundingChunkStringList", + "description": "A list of string values.", + "type": "object", "properties": { - "uris": { + "values": { + "description": "The string values of the list.", "type": "array", - "description": "Required. The Google Cloud Storage URIs to register. Example: `gs://bucket/object`.", "items": { "type": "string" } } - }, - "id": "RegisterFilesRequest", - "description": "Request for `RegisterFiles`.", - "type": "object" + } }, - "TunedModelSource": { + "Maps": { + "id": "Maps", + "description": "A grounding chunk from Google Maps. A Maps chunk corresponds to a single place.", + "type": "object", "properties": { - "tunedModel": { - "type": "string", - "description": "Immutable. The name of the `TunedModel` to use as the starting point for training the new model. Example: `tunedModels/my-tuned-model`" + "uri": { + "description": "URI reference of the place.", + "type": "string" }, - "baseModel": { - "description": "Output only. The name of the base `Model` this `TunedModel` was tuned from. Example: `models/gemini-1.5-flash-001`", - "readOnly": true, + "title": { + "description": "Title of the place.", + "type": "string" + }, + "text": { + "description": "Text description of the place answer.", + "type": "string" + }, + "placeId": { + "description": "The ID of the place, in `places/{place_id}` format. A user can use this ID to look up that place.", "type": "string" + }, + "placeAnswerSources": { + "description": "Sources that provide answers about the features of a given place in Google Maps.", + "$ref": "PlaceAnswerSources" } - }, + } + }, + "PlaceAnswerSources": { + "id": "PlaceAnswerSources", + "description": "Collection of sources that provide answers about the features of a given place in Google Maps. Each PlaceAnswerSources message corresponds to a specific place in Google Maps. The Google Maps tool used these sources in order to answer questions about features of the place (e.g: \"does Bar Foo have Wifi\" or \"is Foo Bar wheelchair accessible?\"). Currently we only support review snippets as sources.", "type": "object", - "id": "TunedModelSource", - "description": "Tuned model as a source for training a new model." + "properties": { + "reviewSnippets": { + "description": "Snippets of reviews that are used to generate answers about the features of a given place in Google Maps.", + "type": "array", + "items": { + "$ref": "ReviewSnippet" + } + } + } }, - "VideoMetadata": { + "ReviewSnippet": { + "id": "ReviewSnippet", + "description": "Encapsulates a snippet of a user review that answers a question about the features of a specific place in Google Maps.", + "type": "object", "properties": { - "endOffset": { - "format": "google-duration", - "description": "Optional. The end offset of the video.", + "reviewId": { + "description": "The ID of the review snippet.", "type": "string" }, - "fps": { - "description": "Optional. The frame rate of the video sent to the model. If not specified, the default value will be 1.0. The fps range is (0.0, 24.0].", - "type": "number", - "format": "double" + "googleMapsUri": { + "description": "A link that corresponds to the user review on Google Maps.", + "type": "string" }, - "startOffset": { - "format": "google-duration", - "description": "Optional. The start offset of the video.", + "title": { + "description": "Title of the review.", "type": "string" } - }, - "id": "VideoMetadata", - "type": "object", - "deprecated": true, - "description": "Deprecated: Use `GenerateContentRequest.processing_options` instead. Metadata describes the input video content." + } }, - "SpeechConfig": { + "GoogleAiGenerativelanguageV1betaGroundingSupport": { + "id": "GoogleAiGenerativelanguageV1betaGroundingSupport", + "description": "Grounding support.", + "type": "object", "properties": { - "voiceConfig": { - "$ref": "VoiceConfig", - "description": "The configuration in case of single-voice output." + "segment": { + "description": "Segment of the content this support belongs to.", + "$ref": "GoogleAiGenerativelanguageV1betaSegment" }, - "languageCode": { - "type": "string", - "description": "Optional. The IETF [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language code that the user configured the app to use. Used for speech recognition and synthesis. Valid values are: `de-DE`, `en-AU`, `en-GB`, `en-IN`, `en-US`, `es-US`, `fr-FR`, `hi-IN`, `pt-BR`, `ar-XA`, `es-ES`, `fr-CA`, `id-ID`, `it-IT`, `ja-JP`, `tr-TR`, `vi-VN`, `bn-IN`, `gu-IN`, `kn-IN`, `ml-IN`, `mr-IN`, `ta-IN`, `te-IN`, `nl-NL`, `ko-KR`, `cmn-CN`, `pl-PL`, `ru-RU`, and `th-TH`." + "groundingChunkIndices": { + "description": "Optional. A list of indices (into 'grounding_chunk' in `response.candidate.grounding_metadata`) specifying the citations associated with the claim. For instance [1,3,4] means that grounding_chunk[1], grounding_chunk[3], grounding_chunk[4] are the retrieved content attributed to the claim. If the response is streaming, the grounding_chunk_indices refer to the indices across all responses. It is the client's responsibility to accumulate the grounding chunks from all responses (while maintaining the same order).", + "type": "array", + "items": { + "type": "integer", + "format": "int32" + } }, - "multiSpeakerVoiceConfig": { - "$ref": "MultiSpeakerVoiceConfig", - "description": "Optional. The configuration for the multi-speaker setup. It is mutually exclusive with the voice_config field." + "confidenceScores": { + "description": "Optional. Confidence score of the support references. Ranges from 0 to 1. 1 is the most confident. This list must have the same size as the grounding_chunk_indices.", + "type": "array", + "items": { + "type": "number", + "format": "float" + } + }, + "renderedParts": { + "description": "Output only. Indices into the `parts` field of the candidate's content. These indices specify which rendered parts are associated with this support source.", + "readOnly": true, + "type": "array", + "items": { + "type": "integer", + "format": "int32" + } } - }, - "type": "object", - "id": "SpeechConfig", - "description": "Config for speech generation and transcription." + } }, - "CreateFileRequest": { + "GoogleAiGenerativelanguageV1betaSegment": { + "id": "GoogleAiGenerativelanguageV1betaSegment", + "description": "Segment of the content.", "type": "object", - "id": "CreateFileRequest", - "description": "Request for `CreateFile`.", "properties": { - "file": { - "description": "Optional. Metadata for the file to create.", - "$ref": "File" + "partIndex": { + "description": "The index of a Part object within its parent Content object.", + "type": "integer", + "format": "int32" + }, + "startIndex": { + "description": "Start index in the given Part, measured in bytes. Offset from the start of the Part, inclusive, starting at zero.", + "type": "integer", + "format": "int32" + }, + "endIndex": { + "description": "End index in the given Part, measured in bytes. Offset from the start of the Part, exclusive, starting at zero.", + "type": "integer", + "format": "int32" + }, + "text": { + "description": "The text corresponding to the segment from the response.", + "type": "string" } } }, - "FunctionResponsePart": { + "RetrievalMetadata": { + "id": "RetrievalMetadata", + "description": "Metadata related to retrieval in the grounding flow.", + "type": "object", "properties": { - "inlineData": { - "$ref": "FunctionResponseBlob", - "description": "Inline media bytes." + "googleSearchDynamicRetrievalScore": { + "description": "Optional. Score indicating how likely information from google search could help answer the prompt. The score is in the range [0, 1], where 0 is the least likely and 1 is the most likely. This score is only populated when google search grounding and dynamic retrieval is enabled. It will be compared to the threshold to determine whether to trigger google search.", + "type": "number", + "format": "float" } - }, - "id": "FunctionResponsePart", - "description": "A datatype containing media that is part of a `FunctionResponse` message. A `FunctionResponsePart` consists of data which has an associated datatype. A `FunctionResponsePart` can only contain one of the accepted types in `FunctionResponsePart.data`. A `FunctionResponsePart` must have a fixed IANA MIME type identifying the type and subtype of the media if the `inline_data` field is filled with raw bytes.", - "type": "object" + } }, - "SpeakerVoiceConfig": { - "id": "SpeakerVoiceConfig", - "description": "The configuration for a single speaker in a multi speaker setup.", + "LogprobsResult": { + "id": "LogprobsResult", + "description": "Logprobs Result", "type": "object", "properties": { - "speaker": { - "description": "Required. The name of the speaker to use. Should be the same as in the prompt.", - "type": "string" + "logProbabilitySum": { + "description": "Sum of log probabilities for all tokens.", + "type": "number", + "format": "float" }, - "voiceConfig": { - "$ref": "VoiceConfig", - "description": "Required. The configuration for the voice to use." + "topCandidates": { + "description": "Length = total number of decoding steps.", + "type": "array", + "items": { + "$ref": "TopCandidates" + } + }, + "chosenCandidates": { + "description": "Length = total number of decoding steps. The chosen candidates may or may not be in top_candidates.", + "type": "array", + "items": { + "$ref": "LogprobsResultCandidate" + } } } }, - "GroundingPassage": { + "TopCandidates": { + "id": "TopCandidates", + "description": "Candidates with top log probabilities at each decoding step.", "type": "object", - "id": "GroundingPassage", - "description": "Passage included inline with a grounding configuration.", "properties": { - "content": { - "description": "Content of the passage.", - "$ref": "Content" - }, - "id": { - "type": "string", - "description": "Identifier for the passage for attributing this passage in grounded answers." + "candidates": { + "description": "Sorted by log probability in descending order.", + "type": "array", + "items": { + "$ref": "LogprobsResultCandidate" + } } } }, - "ExecutableCode": { + "LogprobsResultCandidate": { + "id": "LogprobsResultCandidate", + "description": "Candidate for the logprobs token and score.", + "type": "object", "properties": { - "id": { - "description": "Optional. Unique identifier of the `ExecutableCode` part. The server returns the `CodeExecutionResult` with the matching `id`.", + "token": { + "description": "The candidate’s token string value.", "type": "string" }, - "language": { - "type": "string", - "description": "Required. Programming language of the `code`.", - "enumDescriptions": [ - "Unspecified language. This value should not be used.", - "Python \u003e= 3.10, with numpy and simpy available. Python is the default language." - ], - "enum": [ - "LANGUAGE_UNSPECIFIED", - "PYTHON" - ] + "tokenId": { + "description": "The candidate’s token id value.", + "type": "integer", + "format": "int32" }, - "code": { - "type": "string", - "description": "Required. The code to be executed." + "logProbability": { + "description": "The candidate's log probability.", + "type": "number", + "format": "float" } - }, - "type": "object", - "id": "ExecutableCode", - "description": "Code generated by the model that is meant to be executed, and the result returned to the model. Only generated when using the `CodeExecution` tool, in which the code will be automatically executed, and a corresponding `CodeExecutionResult` will also be generated." + } }, - "Operation": { - "id": "Operation", - "description": "This resource represents a long-running operation that is the result of a network API call.", + "UrlContextMetadata": { + "id": "UrlContextMetadata", + "description": "Metadata related to url context retrieval tool.", "type": "object", "properties": { - "name": { - "description": "The server-assigned name, which is only unique within the same service that originally returns it. If you use the default HTTP mapping, the `name` should be a resource name ending with `operations/{unique_id}`.", - "type": "string" - }, - "metadata": { - "description": "Service-specific metadata associated with the operation. It typically contains progress information and common metadata such as create time. Some services might not provide such metadata. Any method that returns a long-running operation should document the metadata type, if any.", - "type": "object", - "additionalProperties": { - "type": "any", - "description": "Properties of the object. Contains field @type with type URL." + "urlMetadata": { + "description": "List of url context.", + "type": "array", + "items": { + "$ref": "UrlMetadata" } - }, - "done": { - "description": "If the value is `false`, it means the operation is still in progress. If `true`, the operation is completed, and either `error` or `response` is available.", - "type": "boolean" - }, - "error": { - "$ref": "Status", - "description": "The error result of the operation in case of failure or cancellation." - }, - "response": { - "additionalProperties": { - "type": "any", - "description": "Properties of the object. Contains field @type with type URL." - }, - "type": "object", - "description": "The normal, successful response of the operation. If the original method returns no data on success, such as `Delete`, the response is `google.protobuf.Empty`. If the original method is standard `Get`/`Create`/`Update`, the response should be the resource. For other methods, the response should have the type `XxxResponse`, where `Xxx` is the original method name. For example, if the original method name is `TakeSnapshot()`, the inferred response type is `TakeSnapshotResponse`." } } }, - "Blob": { + "UrlMetadata": { + "id": "UrlMetadata", + "description": "Context of the a single url retrieval.", + "type": "object", "properties": { - "mimeType": { - "description": "The IANA standard MIME type of the source data. Examples of supported types: - Images: image/png, image/jpeg, image/jpg, image/webp, image/heic, image/heif, image/gif, image/avif - Audio: audio/*, video/audio/s16le, video/audio/wav - Video: video/* - Text: text/plain, text/html, text/css, text/javascript, text/x-typescript, text/csv, text/markdown, text/x-python, text/xml, text/rtf, video/text/timestamp - Applications: application/x-javascript, application/x-typescript, application/x-python-code, application/json, application/x-ipynb+json, application/rtf, application/pdf For additional context, see [Supported file formats](https://ai.google.dev/gemini-api/docs/file-input-methods#supported-content-types). //", + "retrievedUrl": { + "description": "Retrieved url by the tool.", "type": "string" }, - "data": { - "format": "byte", + "urlRetrievalStatus": { + "description": "Status of the url retrieval.", "type": "string", - "description": "Raw bytes for media formats." + "enumDescriptions": [ + "Default value. This value is unused.", + "Url retrieval is successful.", + "Url retrieval is failed due to error.", + "Url retrieval is failed because the content is behind paywall.", + "Url retrieval is failed because the content is unsafe." + ], + "enum": [ + "URL_RETRIEVAL_STATUS_UNSPECIFIED", + "URL_RETRIEVAL_STATUS_SUCCESS", + "URL_RETRIEVAL_STATUS_ERROR", + "URL_RETRIEVAL_STATUS_PAYWALL", + "URL_RETRIEVAL_STATUS_UNSAFE" + ] } - }, - "id": "Blob", - "description": "Raw media bytes. Text should not be sent as raw bytes, use the 'text' field.", - "type": "object" + } }, - "SafetySetting": { + "PromptFeedback": { + "id": "PromptFeedback", + "description": "A set of the feedback metadata the prompt specified in `GenerateContentRequest.content`.", + "type": "object", "properties": { - "category": { + "blockReason": { + "description": "Optional. If set, the prompt was blocked and no candidates are returned. Rephrase the prompt.", + "type": "string", "enumDescriptions": [ - "Category is unspecified.", - "**PaLM** - Negative or harmful comments targeting identity and/or protected attribute.", - "**PaLM** - Content that is rude, disrespectful, or profane.", - "**PaLM** - Describes scenarios depicting violence against an individual or group, or general descriptions of gore.", - "**PaLM** - Contains references to sexual acts or other lewd content.", - "**PaLM** - Promotes unchecked medical advice.", - "**PaLM** - Dangerous content that promotes, facilitates, or encourages harmful acts.", - "**Gemini** - Harassment content.", - "**Gemini** - Hate speech and content.", - "**Gemini** - Sexually explicit content.", - "**Gemini** - Dangerous content.", - "**Gemini** - Content that may be used to harm civic integrity. DEPRECATED: use enable_enhanced_civic_answers instead." - ], - "enumDeprecated": [ - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - true + "Default value. This value is unused.", + "Prompt was blocked due to safety reasons. Inspect `safety_ratings` to understand which safety category blocked it.", + "Prompt was blocked due to unknown reasons.", + "Prompt was blocked due to the terms which are included from the terminology blocklist.", + "Prompt was blocked due to prohibited content.", + "Candidates blocked due to unsafe image generation content." ], "enum": [ - "HARM_CATEGORY_UNSPECIFIED", - "HARM_CATEGORY_DEROGATORY", - "HARM_CATEGORY_TOXICITY", - "HARM_CATEGORY_VIOLENCE", - "HARM_CATEGORY_SEXUAL", - "HARM_CATEGORY_MEDICAL", - "HARM_CATEGORY_DANGEROUS", - "HARM_CATEGORY_HARASSMENT", - "HARM_CATEGORY_HATE_SPEECH", - "HARM_CATEGORY_SEXUALLY_EXPLICIT", - "HARM_CATEGORY_DANGEROUS_CONTENT", - "HARM_CATEGORY_CIVIC_INTEGRITY" - ], - "description": "Required. The category for this setting.", - "type": "string" + "BLOCK_REASON_UNSPECIFIED", + "SAFETY", + "OTHER", + "BLOCKLIST", + "PROHIBITED_CONTENT", + "IMAGE_SAFETY" + ] }, - "threshold": { - "enumDescriptions": [ - "Threshold is unspecified.", - "Content with NEGLIGIBLE will be allowed.", - "Content with NEGLIGIBLE and LOW will be allowed.", - "Content with NEGLIGIBLE, LOW, and MEDIUM will be allowed.", - "All content will be allowed.", - "Turn off the safety filter." - ], - "enum": [ - "HARM_BLOCK_THRESHOLD_UNSPECIFIED", - "BLOCK_LOW_AND_ABOVE", - "BLOCK_MEDIUM_AND_ABOVE", - "BLOCK_ONLY_HIGH", - "BLOCK_NONE", - "OFF" - ], - "type": "string", - "description": "Required. Controls the probability threshold at which harm is blocked." + "safetyRatings": { + "description": "Ratings for safety of the prompt. There is at most one rating per category.", + "type": "array", + "items": { + "$ref": "SafetyRating" + } } - }, - "type": "object", - "id": "SafetySetting", - "description": "Safety setting, affecting the safety-blocking behavior. Passing a safety setting for a category changes the allowed probability that content is blocked." + } }, - "GenerateContentResponse": { + "UsageMetadata": { + "id": "UsageMetadata", + "description": "Metadata on the generation request's token usage.", + "type": "object", "properties": { - "promptFeedback": { - "$ref": "PromptFeedback", - "description": "Returns the prompt's feedback related to the content filters." + "promptTokenCount": { + "description": "Number of tokens in the prompt. When `cached_content` is set, this is still the total effective prompt size meaning this includes the number of tokens in the cached content.", + "type": "integer", + "format": "int32" }, - "responseId": { - "type": "string", - "description": "Output only. response_id is used to identify each response.", - "readOnly": true + "cachedContentTokenCount": { + "description": "Number of tokens in the cached part of the prompt (the cached content)", + "type": "integer", + "format": "int32" }, - "candidates": { - "type": "array", - "description": "Candidate responses from the model.", - "items": { - "$ref": "Candidate" - } + "candidatesTokenCount": { + "description": "Total number of tokens across all the generated response candidates.", + "type": "integer", + "format": "int32" }, - "usageMetadata": { - "description": "Output only. Metadata on the generation requests' token usage.", + "toolUsePromptTokenCount": { + "description": "Output only. Number of tokens present in tool-use prompt(s).", "readOnly": true, - "$ref": "UsageMetadata" + "type": "integer", + "format": "int32" }, - "modelVersion": { - "type": "string", - "description": "Output only. The model version used to generate the response.", - "readOnly": true + "thoughtsTokenCount": { + "description": "Output only. Number of tokens of thoughts for thinking models.", + "readOnly": true, + "type": "integer", + "format": "int32" }, - "modelStatus": { - "$ref": "ModelStatus", - "description": "Output only. The current model status of this model.", - "readOnly": true - } - }, - "type": "object", - "id": "GenerateContentResponse", - "description": "Response from the model supporting multiple candidate responses. Safety ratings and content filtering are reported for both prompt in `GenerateContentResponse.prompt_feedback` and for each candidate in `finish_reason` and in `safety_ratings`. The API: - Returns either all requested candidates or none of them - Returns no candidates at all only if there was something wrong with the prompt (check `prompt_feedback`) - Reports feedback on each candidate in `finish_reason` and `safety_ratings`." - }, - "SafetyFeedback": { - "id": "SafetyFeedback", - "description": "Safety feedback for an entire request. This field is populated if content in the input and/or response is blocked due to safety settings. SafetyFeedback may not exist for every HarmCategory. Each SafetyFeedback will return the safety settings used by the request as well as the lowest HarmProbability that should be allowed in order to return a result.", - "type": "object", - "properties": { - "rating": { - "$ref": "SafetyRating", - "description": "Safety rating evaluated from content." + "totalTokenCount": { + "description": "Total token count for the generation request (prompt + thoughts + response candidates).", + "type": "integer", + "format": "int32" }, - "setting": { - "$ref": "SafetySetting", - "description": "Safety settings applied to the request." - } - } - }, - "BatchEmbedTextResponse": { - "properties": { - "embeddings": { + "promptTokensDetails": { + "description": "Output only. List of modalities that were processed in the request input.", + "readOnly": true, "type": "array", - "description": "Output only. The embeddings generated from the input text.", + "items": { + "$ref": "ModalityTokenCount" + } + }, + "cacheTokensDetails": { + "description": "Output only. List of modalities of the cached content in the request input.", "readOnly": true, + "type": "array", "items": { - "$ref": "Embedding" + "$ref": "ModalityTokenCount" } - } - }, - "type": "object", - "id": "BatchEmbedTextResponse", - "description": "The response to a EmbedTextRequest." - }, - "GroundingPassages": { - "properties": { - "passages": { - "description": "List of passages.", + }, + "candidatesTokensDetails": { + "description": "Output only. List of modalities that were returned in the response.", + "readOnly": true, + "type": "array", "items": { - "$ref": "GroundingPassage" - }, - "type": "array" - } - }, - "type": "object", - "id": "GroundingPassages", - "description": "A repeated list of passages." - }, - "ListCorporaResponse": { - "type": "object", - "id": "ListCorporaResponse", - "description": "Response from `ListCorpora` containing a paginated list of `Corpora`. The results are sorted by ascending `corpus.create_time`.", - "properties": { - "corpora": { + "$ref": "ModalityTokenCount" + } + }, + "toolUsePromptTokensDetails": { + "description": "Output only. List of modalities that were processed for tool-use request inputs.", + "readOnly": true, "type": "array", - "description": "The returned corpora.", "items": { - "$ref": "Corpus" + "$ref": "ModalityTokenCount" } }, - "nextPageToken": { - "description": "A token, which can be sent as `page_token` to retrieve the next page. If this field is omitted, there are no more pages.", - "type": "string" - } - } - }, - "VideoFileMetadata": { - "properties": { - "videoDuration": { + "serviceTier": { + "description": "Output only. Service tier of the request.", + "readOnly": true, "type": "string", - "description": "Duration of the video.", - "format": "google-duration" + "enumDescriptions": [ + "Default service tier, which is standard.", + "Standard service tier.", + "Flex service tier.", + "Priority service tier." + ], + "enum": [ + "unspecified", + "standard", + "flex", + "priority" + ] } - }, - "type": "object", - "id": "VideoFileMetadata", - "description": "Metadata for a video `File`." + } }, - "Example": { - "id": "Example", - "description": "An input/output example used to instruct the Model. It demonstrates how the model should respond or format its response.", + "ModalityTokenCount": { + "id": "ModalityTokenCount", + "description": "Represents token counting info for a single modality.", "type": "object", "properties": { - "input": { - "$ref": "Message", - "description": "Required. An example of an input `Message` from the user." + "modality": { + "description": "The modality associated with this token count.", + "type": "string", + "enumDescriptions": [ + "Unspecified modality.", + "Plain text.", + "Image.", + "Video.", + "Audio.", + "Document, e.g. PDF." + ], + "enum": [ + "MODALITY_UNSPECIFIED", + "TEXT", + "IMAGE", + "VIDEO", + "AUDIO", + "DOCUMENT" + ] }, - "output": { - "description": "Required. An example of what the model should output given the input.", - "$ref": "Message" + "tokenCount": { + "description": "Number of tokens.", + "type": "integer", + "format": "int32" } } }, - "ChunkingConfig": { - "properties": { - "whiteSpaceConfig": { - "description": "White space chunking configuration.", - "$ref": "WhiteSpaceConfig" - } - }, + "ModelStatus": { + "id": "ModelStatus", + "description": "The status of the underlying model. This is used to indicate the stage of the underlying model and the retirement time if applicable.", "type": "object", - "id": "ChunkingConfig", - "description": "Parameters for telling the service how to chunk the file. inspired by google3/cloud/ai/platform/extension/lib/retrieval/config/chunker_config.proto" - }, - "GdataMedia": { "properties": { - "timestamp": { + "modelStage": { + "description": "The stage of the underlying model.", "type": "string", - "description": "Time at which the media data was last updated, in milliseconds since UNIX epoch", - "format": "uint64" - }, - "hash": { - "description": "Deprecated, use one of explicit hash type fields instead. These two hash related fields will only be populated on Scotty based media uploads and will contain the content of the hash group in the NotificationRequest: http://cs/#google3/blobstore2/api/scotty/service/proto/upload_listener.proto&q=class:Hash Hex encoded hash value of the uploaded media.", - "deprecated": true, - "type": "string" - }, - "hashVerified": { - "description": "For Scotty uploads only. If a user sends a hash code and the backend has requested that Scotty verify the upload against the client hash, Scotty will perform the check on behalf of the backend and will reject it if the hashes don't match. This is set to true if Scotty performed this verification.", - "type": "boolean" + "enumDescriptions": [ + "Unspecified model stage.", + "The underlying model is subject to lots of tunings.", + "Models in this stage are for experimental purposes only.", + "Models in this stage are more mature than experimental models.", + "Models in this stage are considered stable and ready for production use.", + "If the model is on this stage, it means that this model is on the path to deprecation in near future. Only existing customers can use this model.", + "Models in this stage are deprecated. These models cannot be used.", + "Models in this stage are retired. These models cannot be used." + ], + "enumDeprecated": [ + false, + true, + false, + false, + false, + false, + true, + false + ], + "enum": [ + "MODEL_STAGE_UNSPECIFIED", + "UNSTABLE_EXPERIMENTAL", + "EXPERIMENTAL", + "PREVIEW", + "STABLE", + "LEGACY", + "DEPRECATED", + "RETIRED" + ] }, - "filename": { + "retirementTime": { + "description": "The time at which the model will be retired.", "type": "string", - "description": "Original file name" - }, - "diffChecksumsResponse": { - "$ref": "DiffChecksumsResponse", - "description": "Set if reference_type is DIFF_CHECKSUMS_RESPONSE." + "format": "google-datetime" }, - "length": { - "format": "int64", - "description": "Size of the data, in bytes", + "message": { + "description": "A message explaining the model status.", "type": "string" + } + } + }, + "GenerateAnswerRequest": { + "id": "GenerateAnswerRequest", + "description": "Request to generate a grounded answer from the `Model`.", + "type": "object", + "properties": { + "inlinePassages": { + "description": "Passages provided inline with the request.", + "$ref": "GroundingPassages" }, - "diffDownloadResponse": { - "$ref": "DiffDownloadResponse", - "description": "Set if reference_type is DIFF_DOWNLOAD_RESPONSE." - }, - "downloadParameters": { - "description": "Parameters for a media download.", - "$ref": "DownloadParameters" - }, - "crc32cHash": { - "type": "integer", - "description": "For Scotty Uploads: Scotty-provided hashes for uploads For Scotty Downloads: (WARNING: DO NOT USE WITHOUT PERMISSION FROM THE SCOTTY TEAM.) A Hash provided by the agent to be used to verify the data being downloaded. Currently only supported for inline payloads. Further, only crc32c_hash is currently supported.", - "format": "uint32" + "semanticRetriever": { + "description": "Content retrieved from resources created via the Semantic Retriever API.", + "$ref": "SemanticRetrieverConfig" }, - "compositeMedia": { - "description": "A composite media composed of one or more media objects, set if reference_type is COMPOSITE_MEDIA. The media length field must be set to the sum of the lengths of all composite media objects. Note: All composite media must have length specified.", + "contents": { + "description": "Required. The content of the current conversation with the `Model`. For single-turn queries, this is a single question to answer. For multi-turn queries, this is a repeated field that contains conversation history and the last `Content` in the list containing the question. Note: `GenerateAnswer` only supports queries in English.", + "type": "array", "items": { - "$ref": "CompositeMedia" - }, - "type": "array" + "$ref": "Content" + } }, - "referenceType": { - "description": "Describes what the field reference contains.", + "answerStyle": { + "description": "Required. Style in which answers should be returned.", "type": "string", "enumDescriptions": [ - "Reference contains a GFS path or a local path.", - "Reference points to a blobstore object. This could be either a v1 blob_ref or a v2 blobstore2_info. Clients should check blobstore2_info first, since v1 is being deprecated.", - "Data is included into this proto buffer", - "Data should be accessed from the current service using the operation GetMedia.", - "The content for this media object is stored across multiple partial media objects under the composite_media field.", - "Reference points to a bigstore object", - "Indicates the data is stored in diff_version_response.", - "Indicates the data is stored in diff_checksums_response.", - "Indicates the data is stored in diff_download_response.", - "Indicates the data is stored in diff_upload_request.", - "Indicates the data is stored in diff_upload_response.", - "Indicates the data is stored in cosmo_binary_reference.", - "Informs Scotty to generate a response payload with the size specified in the length field. The contents of the payload are generated by Scotty and are undefined. This is useful for testing download speeds between the user and Scotty without involving a real payload source. Note: range is not supported when using arbitrary_bytes." + "Unspecified answer style.", + "Succinct but abstract style.", + "Very brief and extractive style.", + "Verbose style including extra details. The response may be formatted as a sentence, paragraph, multiple paragraphs, or bullet points, etc." ], "enum": [ - "PATH", - "BLOB_REF", - "INLINE", - "GET_MEDIA", - "COMPOSITE_MEDIA", - "BIGSTORE_REF", - "DIFF_VERSION_RESPONSE", - "DIFF_CHECKSUMS_RESPONSE", - "DIFF_DOWNLOAD_RESPONSE", - "DIFF_UPLOAD_REQUEST", - "DIFF_UPLOAD_RESPONSE", - "COSMO_BINARY_REFERENCE", - "ARBITRARY_BYTES" + "ANSWER_STYLE_UNSPECIFIED", + "ABSTRACTIVE", + "EXTRACTIVE", + "VERBOSE" ] }, - "objectId": { - "description": "Reference to a TI Blob, set if reference_type is BIGSTORE_REF.", - "$ref": "ObjectId" - }, - "diffUploadRequest": { - "description": "Set if reference_type is DIFF_UPLOAD_REQUEST.", - "$ref": "DiffUploadRequest" - }, - "md5Hash": { - "type": "string", - "description": "Scotty-provided MD5 hash for an upload.", - "format": "byte" - }, - "blobRef": { - "type": "string", - "description": "Blobstore v1 reference, set if reference_type is BLOBSTORE_REF This should be the byte representation of a blobstore.BlobRef. Since Blobstore is deprecating v1, use blobstore2_info instead. For now, any v2 blob will also be represented in this field as v1 BlobRef.", - "deprecated": true, - "format": "byte" - }, - "path": { - "type": "string", - "description": "Path to the data, set if reference_type is PATH" - }, - "mediaId": { - "format": "byte", - "type": "string", - "description": "Media id to forward to the operation GetMedia. Can be set if reference_type is GET_MEDIA." - }, - "bigstoreObjectRef": { - "description": "Use object_id instead.", - "deprecated": true, - "type": "string", - "format": "byte" + "safetySettings": { + "description": "Optional. A list of unique `SafetySetting` instances for blocking unsafe content. This will be enforced on the `GenerateAnswerRequest.contents` and `GenerateAnswerResponse.candidate`. There should not be more than one setting for each `SafetyCategory` type. The API will block any contents and responses that fail to meet the thresholds set by these settings. This list overrides the default settings for each `SafetyCategory` specified in the safety_settings. If there is no `SafetySetting` for a given `SafetyCategory` provided in the list, the API will use the default safety setting for that category. Harm categories HARM_CATEGORY_HATE_SPEECH, HARM_CATEGORY_SEXUALLY_EXPLICIT, HARM_CATEGORY_DANGEROUS_CONTENT, HARM_CATEGORY_HARASSMENT are supported. Refer to the [guide](https://ai.google.dev/gemini-api/docs/safety-settings) for detailed information on available safety settings. Also refer to the [Safety guidance](https://ai.google.dev/gemini-api/docs/safety-guidance) to learn how to incorporate safety considerations in your AI applications.", + "type": "array", + "items": { + "$ref": "SafetySetting" + } }, - "contentType": { - "description": "MIME type of the data", - "type": "string" - }, - "diffVersionResponse": { - "$ref": "DiffVersionResponse", - "description": "Set if reference_type is DIFF_VERSION_RESPONSE." - }, - "inline": { - "format": "byte", - "type": "string", - "description": "Media data, set if reference_type is INLINE" - }, - "token": { - "description": "A unique fingerprint/version id for the media data", + "temperature": { + "description": "Optional. Controls the randomness of the output. Values can range from [0.0,1.0], inclusive. A value closer to 1.0 will produce responses that are more varied and creative, while a value closer to 0.0 will typically result in more straightforward responses from the model. A low temperature (~0.2) is usually recommended for Attributed-Question-Answering use cases.", + "type": "number", + "format": "float" + } + } + }, + "GroundingPassages": { + "id": "GroundingPassages", + "description": "A repeated list of passages.", + "type": "object", + "properties": { + "passages": { + "description": "List of passages.", + "type": "array", + "items": { + "$ref": "GroundingPassage" + } + } + } + }, + "GroundingPassage": { + "id": "GroundingPassage", + "description": "Passage included inline with a grounding configuration.", + "type": "object", + "properties": { + "id": { + "description": "Identifier for the passage for attributing this passage in grounded answers.", "type": "string" }, - "sha256Hash": { - "type": "string", - "description": "Scotty-provided SHA256 hash for an upload.", - "format": "byte" - }, - "blobstore2Info": { - "$ref": "Blobstore2Info", - "description": "Blobstore v2 info, set if reference_type is BLOBSTORE_REF and it refers to a v2 blob." - }, - "sha1Hash": { - "format": "byte", - "description": "Scotty-provided SHA1 hash for an upload.", + "content": { + "description": "Content of the passage.", + "$ref": "Content" + } + } + }, + "SemanticRetrieverConfig": { + "id": "SemanticRetrieverConfig", + "description": "Configuration for retrieving grounding content from a `Corpus` or `Document` created using the Semantic Retriever API.", + "type": "object", + "properties": { + "source": { + "description": "Required. Name of the resource for retrieval. Example: `corpora/123` or `corpora/123/documents/abc`.", "type": "string" }, - "isPotentialRetry": { - "description": "|is_potential_retry| is set false only when Scotty is certain that it has not sent the request before. When a client resumes an upload, this field must be set true in agent calls, because Scotty cannot be certain that it has never sent the request before due to potential failure in the session state persistence.", - "type": "boolean" - }, - "cosmoBinaryReference": { - "format": "byte", - "type": "string", - "description": "A binary data reference for a media download. Serves as a technology-agnostic binary reference in some Google infrastructure. This value is a serialized storage_cosmo.BinaryReference proto. Storing it as bytes is a hack to get around the fact that the cosmo proto (as well as others it includes) doesn't support JavaScript. This prevents us from including the actual type of this field." + "query": { + "description": "Required. Query to use for matching `Chunk`s in the given resource by similarity.", + "$ref": "Content" }, - "algorithm": { - "description": "Deprecated, use one of explicit hash type fields instead. Algorithm used for calculating the hash. As of 2011/01/21, \"MD5\" is the only possible value for this field. New values may be added at any time.", - "deprecated": true, - "type": "string" + "metadataFilters": { + "description": "Optional. Filters for selecting `Document`s and/or `Chunk`s from the resource.", + "type": "array", + "items": { + "$ref": "MetadataFilter" + } }, - "diffUploadResponse": { - "$ref": "DiffUploadResponse", - "description": "Set if reference_type is DIFF_UPLOAD_RESPONSE." + "maxChunksCount": { + "description": "Optional. Maximum number of relevant `Chunk`s to retrieve.", + "type": "integer", + "format": "int32" }, - "contentTypeInfo": { - "description": "Extended content type information provided for Scotty uploads.", - "$ref": "ContentTypeInfo" + "minimumRelevanceScore": { + "description": "Optional. Minimum relevance score for retrieved relevant `Chunk`s.", + "type": "number", + "format": "float" } - }, - "id": "GdataMedia", - "description": "A reference to data stored on the filesystem, on GFS or in blobstore.", - "type": "object" + } }, - "ListOperationsResponse": { + "MetadataFilter": { + "id": "MetadataFilter", + "description": "User provided filter to limit retrieval based on `Chunk` or `Document` level metadata values. Example (genre = drama OR genre = action): key = \"document.custom_metadata.genre\" conditions = [{string_value = \"drama\", operation = EQUAL}, {string_value = \"action\", operation = EQUAL}]", + "type": "object", "properties": { - "unreachable": { - "description": "Unordered list. Unreachable resources. Populated when the request sets `ListOperationsRequest.return_partial_success` and reads across collections. For example, when attempting to list all resources across all supported locations.", - "items": { - "type": "string" - }, - "type": "array" - }, - "nextPageToken": { - "type": "string", - "description": "The standard List next-page token." + "key": { + "description": "Required. The key of the metadata to filter on.", + "type": "string" }, - "operations": { - "description": "A list of operations that matches the specified filter in the request.", + "conditions": { + "description": "Required. The `Condition`s for the given key that will trigger this filter. Multiple `Condition`s are joined by logical ORs.", + "type": "array", "items": { - "$ref": "Operation" - }, - "type": "array" + "$ref": "Condition" + } } - }, - "id": "ListOperationsResponse", - "description": "The response message for Operations.ListOperations.", - "type": "object" + } }, - "FunctionDeclaration": { + "Condition": { + "id": "Condition", + "description": "Filter condition applicable to a single key.", + "type": "object", "properties": { - "name": { - "type": "string", - "description": "Required. The name of the function. Must be a-z, A-Z, 0-9, or contain underscores, colons, dots, and dashes, with a maximum length of 128." - }, - "parametersJsonSchema": { - "type": "any", - "description": "Optional. Describes the parameters to the function in JSON Schema format. The schema must describe an object where the properties are the parameters to the function. For example: ``` { \"type\": \"object\", \"properties\": { \"name\": { \"type\": \"string\" }, \"age\": { \"type\": \"integer\" } }, \"additionalProperties\": false, \"required\": [\"name\", \"age\"], \"propertyOrdering\": [\"name\", \"age\"] } ``` This field is mutually exclusive with `parameters`." + "stringValue": { + "description": "The string value to filter the metadata on.", + "type": "string" }, - "responseJsonSchema": { - "type": "any", - "description": "Optional. Describes the output from this function in JSON Schema format. The value specified by the schema is the response value of the function. This field is mutually exclusive with `response`." + "numericValue": { + "description": "The numeric value to filter the metadata on.", + "type": "number", + "format": "float" }, - "description": { + "operation": { + "description": "Required. Operator applied to the given key-value pair to trigger the condition.", "type": "string", - "description": "Required. A brief description of the function." - }, - "behavior": { "enumDescriptions": [ - "This value is unused.", - "If set, the system will wait to receive the function response before continuing the conversation.", - "If set, the system will not wait to receive the function response. Instead, it will attempt to handle function responses as they become available while maintaining the conversation between the user and the model." + "The default value. This value is unused.", + "Supported by numeric.", + "Supported by numeric.", + "Supported by numeric & string.", + "Supported by numeric.", + "Supported by numeric.", + "Supported by numeric & string.", + "Supported by string only when `CustomMetadata` value type for the given key has a `string_list_value`.", + "Supported by string only when `CustomMetadata` value type for the given key has a `string_list_value`." ], "enum": [ - "UNSPECIFIED", - "BLOCKING", - "NON_BLOCKING" - ], - "description": "Optional. Specifies the function Behavior. Currently only supported by the BidiGenerateContent method.", - "type": "string" - }, - "parameters": { - "description": "Optional. Describes the parameters to this function. Reflects the Open API 3.03 Parameter Object string Key: the name of the parameter. Parameter names are case sensitive. Schema Value: the Schema defining the type used for the parameter.", - "$ref": "Schema" - }, - "response": { - "description": "Optional. Describes the output from this function in JSON Schema format. Reflects the Open API 3.03 Response Object. The Schema defines the type used for the response value of the function.", - "$ref": "Schema" + "OPERATOR_UNSPECIFIED", + "LESS", + "LESS_EQUAL", + "EQUAL", + "GREATER_EQUAL", + "GREATER", + "NOT_EQUAL", + "INCLUDES", + "EXCLUDES" + ] } - }, - "id": "FunctionDeclaration", - "description": "Structured representation of a function declaration as defined by the [OpenAPI 3.03 specification](https://spec.openapis.org/oas/v3.0.3). Included in this declaration are the function name and parameters. This FunctionDeclaration is a representation of a block of code that can be used as a `Tool` by the model and executed by the client.", - "type": "object" + } }, - "GroundingPassageId": { + "GenerateAnswerResponse": { + "id": "GenerateAnswerResponse", + "description": "Response from the model for a grounded answer.", "type": "object", - "id": "GroundingPassageId", - "description": "Identifier for a part within a `GroundingPassage`.", "properties": { - "passageId": { - "type": "string", - "description": "Output only. ID of the passage matching the `GenerateAnswerRequest`'s `GroundingPassage.id`.", - "readOnly": true + "answer": { + "description": "Candidate answer from the model. Note: The model *always* attempts to provide a grounded answer, even when the answer is unlikely to be answerable from the given passages. In that case, a low-quality or ungrounded answer may be provided, along with a low `answerable_probability`.", + "$ref": "Candidate" }, - "partIndex": { - "format": "int32", - "description": "Output only. Index of the part within the `GenerateAnswerRequest`'s `GroundingPassage.content`.", + "answerableProbability": { + "description": "Output only. The model's estimate of the probability that its answer is correct and grounded in the input passages. A low `answerable_probability` indicates that the answer might not be grounded in the sources. When `answerable_probability` is low, you may want to: * Display a message to the effect of \"We couldn’t answer that question\" to the user. * Fall back to a general-purpose LLM that answers the question from world knowledge. The threshold and nature of such fallbacks will depend on individual use cases. `0.5` is a good starting threshold.", + "readOnly": true, + "type": "number", + "format": "float" + }, + "inputFeedback": { + "description": "Output only. Feedback related to the input data used to answer the question, as opposed to the model-generated response to the question. The input data can be one or more of the following: - Question specified by the last entry in `GenerateAnswerRequest.content` - Conversation history specified by the other entries in `GenerateAnswerRequest.content` - Grounding sources (`GenerateAnswerRequest.semantic_retriever` or `GenerateAnswerRequest.inline_passages`)", "readOnly": true, - "type": "integer" + "$ref": "InputFeedback" } } }, - "TuningExample": { + "InputFeedback": { + "id": "InputFeedback", + "description": "Feedback related to the input data used to answer the question, as opposed to the model-generated response to the question.", + "type": "object", "properties": { - "textInput": { - "description": "Optional. Text model input.", - "type": "string" - }, - "output": { + "blockReason": { + "description": "Optional. If set, the input was blocked and no candidates are returned. Rephrase the input.", "type": "string", - "description": "Required. The expected model output." + "enumDescriptions": [ + "Default value. This value is unused.", + "Input was blocked due to safety reasons. Inspect `safety_ratings` to understand which safety category blocked it.", + "Input was blocked due to other reasons." + ], + "enum": [ + "BLOCK_REASON_UNSPECIFIED", + "SAFETY", + "OTHER" + ] + }, + "safetyRatings": { + "description": "Ratings for safety of the input. There is at most one rating per category.", + "type": "array", + "items": { + "$ref": "SafetyRating" + } } - }, - "type": "object", - "id": "TuningExample", - "description": "A single example for tuning." + } }, - "Blobstore2Info": { + "EmbedContentRequest": { + "id": "EmbedContentRequest", + "description": "Request containing the `Content` for the model to embed.", + "type": "object", "properties": { - "blobGeneration": { - "format": "int64", - "description": "The blob generation id.", - "type": "string" - }, - "readToken": { - "description": "The blob read token. Needed to read blobs that have not been replicated. Might not be available until the final call.", + "model": { + "description": "Required. The model's resource name. This serves as an ID for the Model to use. This name should match a model name returned by the `ListModels` method. Format: `models/{model}`", "type": "string" }, - "downloadExternalReadToken": { - "description": "A serialized External Read Token passed from Bigstore -\u003e Scotty for a GCS download. This field must never be consumed outside of Bigstore, and is not applicable to non-GCS media uploads.", - "type": "string", - "format": "byte" + "content": { + "description": "Required. The content to embed. Only the `parts.text` fields will be counted.", + "$ref": "Content" }, - "downloadReadHandle": { - "format": "byte", + "taskType": { + "description": "Optional. Deprecated: Please use EmbedContentConfig.task_type instead. Optional task type for which the embeddings will be used. Not supported on earlier models (`models/embedding-001`).", + "deprecated": true, "type": "string", - "description": "Read handle passed from Bigstore -\u003e Scotty for a GCS download. This is a signed, serialized blobstore2.ReadHandle proto which must never be set outside of Bigstore, and is not applicable to non-GCS media downloads." - }, - "blobId": { - "type": "string", - "description": "The blob id, e.g., /blobstore/prod/playground/scotty" - }, - "uploadMetadataContainer": { - "format": "byte", - "type": "string", - "description": "Metadata passed from Blobstore -\u003e Scotty for a new GCS upload. This is a signed, serialized blobstore2.BlobMetadataContainer proto which must never be consumed outside of Bigstore, and is not applicable to non-GCS media uploads." + "enumDescriptions": [ + "Unset value, which will default to one of the other enum values.", + "Specifies the given text is a query in a search/retrieval setting.", + "Specifies the given text is a document from the corpus being searched.", + "Specifies the given text will be used for STS.", + "Specifies that the given text will be classified.", + "Specifies that the embeddings will be used for clustering.", + "Specifies that the given text will be used for question answering.", + "Specifies that the given text will be used for fact verification.", + "Specifies that the given text will be used for code retrieval." + ], + "enum": [ + "TASK_TYPE_UNSPECIFIED", + "RETRIEVAL_QUERY", + "RETRIEVAL_DOCUMENT", + "SEMANTIC_SIMILARITY", + "CLASSIFICATION", + "CLUSTERING", + "QUESTION_ANSWERING", + "FACT_VERIFICATION", + "CODE_RETRIEVAL_QUERY" + ] }, - "uploadFragmentListCreationInfo": { - "format": "byte", - "description": "A serialized Object Fragment List Creation Info passed from Bigstore -\u003e Scotty for a GCS upload. This field must never be consumed outside of Bigstore, and is not applicable to non-GCS media uploads.", + "title": { + "description": "Optional. Deprecated: Please use EmbedContentConfig.title instead. An optional title for the text. Only applicable when TaskType is `RETRIEVAL_DOCUMENT`. Note: Specifying a `title` for `RETRIEVAL_DOCUMENT` provides better quality embeddings for retrieval.", + "deprecated": true, "type": "string" - } - }, - "id": "Blobstore2Info", - "description": "Information to read/write to blobstore2.", - "type": "object" - }, - "Status": { - "id": "Status", - "description": "The `Status` type defines a logical error model that is suitable for different programming environments, including REST APIs and RPC APIs. It is used by [gRPC](https://github.com/grpc). Each `Status` message contains three pieces of data: error code, error message, and error details. You can find out more about this error model and how to work with it in the [API Design Guide](https://cloud.google.com/apis/design/errors).", - "type": "object", - "properties": { - "details": { - "description": "A list of messages that carry the error details. There is a common set of message types for APIs to use.", - "items": { - "type": "object", - "additionalProperties": { - "type": "any", - "description": "Properties of the object. Contains field @type with type URL." - } - }, - "type": "array" }, - "code": { - "description": "The status code, which should be an enum value of google.rpc.Code.", + "outputDimensionality": { + "description": "Optional. Deprecated: Please use EmbedContentConfig.output_dimensionality instead. Optional reduced dimension for the output embedding. If set, excessive values in the output embedding are truncated from the end. Supported by newer models since 2024 only. You cannot set this value if using the earlier model (`models/embedding-001`).", + "deprecated": true, "type": "integer", "format": "int32" }, - "message": { - "description": "A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the google.rpc.Status.details field, or localized by the client.", - "type": "string" + "embedContentConfig": { + "description": "Optional. Configuration for the EmbedContent request.", + "$ref": "EmbedContentConfig" } } }, - "UrlMetadata": { - "id": "UrlMetadata", - "description": "Context of the a single url retrieval.", + "EmbedContentConfig": { + "id": "EmbedContentConfig", + "description": "Configurations for the EmbedContent request.", "type": "object", "properties": { - "urlRetrievalStatus": { - "description": "Status of the url retrieval.", + "title": { + "description": "Optional. The title for the text.", + "type": "string" + }, + "taskType": { + "description": "Optional. The task type of the embedding.", "type": "string", "enumDescriptions": [ - "Default value. This value is unused.", - "Url retrieval is successful.", - "Url retrieval is failed due to error.", - "Url retrieval is failed because the content is behind paywall.", - "Url retrieval is failed because the content is unsafe." + "Unset value, which will default to one of the other enum values.", + "Specifies the given text is a query in a search/retrieval setting.", + "Specifies the given text is a document from the corpus being searched.", + "Specifies the given text will be used for STS.", + "Specifies that the given text will be classified.", + "Specifies that the embeddings will be used for clustering.", + "Specifies that the given text will be used for question answering.", + "Specifies that the given text will be used for fact verification.", + "Specifies that the given text will be used for code retrieval." ], "enum": [ - "URL_RETRIEVAL_STATUS_UNSPECIFIED", - "URL_RETRIEVAL_STATUS_SUCCESS", - "URL_RETRIEVAL_STATUS_ERROR", - "URL_RETRIEVAL_STATUS_PAYWALL", - "URL_RETRIEVAL_STATUS_UNSAFE" + "TASK_TYPE_UNSPECIFIED", + "RETRIEVAL_QUERY", + "RETRIEVAL_DOCUMENT", + "SEMANTIC_SIMILARITY", + "CLASSIFICATION", + "CLUSTERING", + "QUESTION_ANSWERING", + "FACT_VERIFICATION", + "CODE_RETRIEVAL_QUERY" ] }, - "retrievedUrl": { - "description": "Retrieved url by the tool.", - "type": "string" + "autoTruncate": { + "description": "Optional. Whether to silently truncate the input content if it's longer than the maximum sequence length.", + "type": "boolean" + }, + "outputDimensionality": { + "description": "Optional. Reduced dimension for the output embedding. If set, excessive values in the output embedding are truncated from the end.", + "type": "integer", + "format": "int32" + }, + "documentOcr": { + "description": "Optional. Whether to enable OCR for document content.", + "type": "boolean" + }, + "audioTrackExtraction": { + "description": "Optional. Whether to extract audio from video content.", + "type": "boolean" } } }, - "File": { + "EmbedContentResponse": { + "id": "EmbedContentResponse", + "description": "The response to an `EmbedContentRequest`.", + "type": "object", "properties": { - "videoMetadata": { - "$ref": "VideoFileMetadata", - "description": "Output only. Metadata for a video.", - "readOnly": true - }, - "sizeBytes": { - "format": "int64", - "description": "Output only. Size of the file in bytes.", - "readOnly": true, - "type": "string" - }, - "sha256Hash": { - "format": "byte", - "type": "string", - "description": "Output only. SHA-256 hash of the uploaded bytes.", - "readOnly": true - }, - "displayName": { - "description": "Optional. The human-readable display name for the `File`. The display name must be no more than 512 characters in length, including spaces. Example: \"Welcome Image\"", - "type": "string" - }, - "error": { - "$ref": "Status", - "description": "Output only. Error status if File processing failed.", - "readOnly": true - }, - "downloadUri": { - "type": "string", - "description": "Output only. The download uri of the `File`.", - "readOnly": true - }, - "name": { - "description": "Immutable. Identifier. The `File` resource name. The ID (name excluding the \"files/\" prefix) can contain up to 40 characters that are lowercase alphanumeric or dashes (-). The ID cannot start or end with a dash. If the name is empty on create, a unique name will be generated. Example: `files/123-456`", - "type": "string" - }, - "updateTime": { - "type": "string", - "description": "Output only. The timestamp of when the `File` was last updated.", - "readOnly": true, - "format": "google-datetime" - }, - "uri": { - "description": "Output only. The uri of the `File`.", - "readOnly": true, - "type": "string" - }, - "expirationTime": { - "type": "string", - "description": "Output only. The timestamp of when the `File` will be deleted. Only set if the `File` is scheduled to expire.", + "embedding": { + "description": "Output only. The embedding generated from the input content.", "readOnly": true, - "format": "google-datetime" - }, - "state": { - "enum": [ - "STATE_UNSPECIFIED", - "PROCESSING", - "ACTIVE", - "FAILED" - ], - "description": "Output only. Processing state of the File.", - "type": "string", - "enumDescriptions": [ - "The default value. This value is used if the state is omitted.", - "File is being processed and cannot be used for inference yet.", - "File is processed and available for inference.", - "File failed processing." - ], - "readOnly": true - }, - "source": { - "type": "string", - "description": "Source of the File.", - "enumDescriptions": [ - "Used if source is not specified.", - "Indicates the file is uploaded by the user.", - "Indicates the file is generated by Google.", - "Indicates the file is a registered, i.e. a Google Cloud Storage file." - ], - "enum": [ - "SOURCE_UNSPECIFIED", - "UPLOADED", - "GENERATED", - "REGISTERED" - ] - }, - "mimeType": { - "type": "string", - "description": "Output only. MIME type of the file.", - "readOnly": true + "$ref": "ContentEmbedding" }, - "createTime": { - "description": "Output only. The timestamp of when the `File` was created.", + "usageMetadata": { + "description": "Output only. The usage metadata for the request.", "readOnly": true, - "type": "string", - "format": "google-datetime" + "$ref": "EmbeddingUsageMetadata" } - }, - "id": "File", - "description": "A file uploaded to the API. Next ID: 15", - "type": "object" + } }, - "Schema": { + "ContentEmbedding": { + "id": "ContentEmbedding", + "description": "A list of floats representing an embedding.", + "type": "object", "properties": { - "format": { - "type": "string", - "description": "Optional. The format of the data. Any value is allowed, but most do not trigger any special functionality." - }, - "title": { - "description": "Optional. The title of the schema.", - "type": "string" - }, - "anyOf": { + "values": { + "description": "The embedding values. This is for 3P users only and will not be populated for 1P calls.", "type": "array", - "description": "Optional. The value should be validated against any (one or more) of the subschemas in the list.", "items": { - "$ref": "Schema" + "type": "number", + "format": "float" } }, - "description": { - "type": "string", - "description": "Optional. A brief description of the parameter. This could contain examples of use. Parameter description may be formatted as Markdown." - }, - "propertyOrdering": { - "description": "Optional. The order of the properties. Not a standard field in open api spec. Used to determine the order of the properties in the response.", - "items": { - "type": "string" - }, - "type": "array" - }, - "items": { - "$ref": "Schema", - "description": "Optional. Schema of the elements of Type.ARRAY." - }, - "enum": { - "description": "Optional. Possible values of the element of Type.STRING with enum format. For example we can define an Enum Direction as : {type:STRING, format:enum, enum:[\"EAST\", NORTH\", \"SOUTH\", \"WEST\"]}", + "shape": { + "description": "This field stores the soft tokens tensor frame shape (e.g. [1, 1, 256, 2048]).", + "type": "array", "items": { - "type": "string" - }, - "type": "array" - }, - "pattern": { - "type": "string", - "description": "Optional. Pattern of the Type.STRING to restrict a string to a regular expression." - }, - "type": { - "enumDescriptions": [ - "Not specified, should not be used.", - "String type.", - "Number type.", - "Integer type.", - "Boolean type.", - "Array type.", - "Object type.", - "Null type." - ], - "enum": [ - "TYPE_UNSPECIFIED", - "STRING", - "NUMBER", - "INTEGER", - "BOOLEAN", - "ARRAY", - "OBJECT", - "NULL" - ], - "type": "string", - "description": "Required. Data type." - }, - "maxProperties": { - "format": "int64", - "type": "string", - "description": "Optional. Maximum number of the properties for Type.OBJECT." - }, - "minLength": { - "format": "int64", - "description": "Optional. SCHEMA FIELDS FOR TYPE STRING Minimum length of the Type.STRING", - "type": "string" - }, - "default": { - "description": "Optional. Default value of the field. Per JSON Schema, this field is intended for documentation generators and doesn't affect validation. Thus it's included here and ignored so that developers who send schemas with a `default` field don't get unknown-field errors.", - "type": "any" + "type": "integer", + "format": "int32" + } + } + } + }, + "EmbeddingUsageMetadata": { + "id": "EmbeddingUsageMetadata", + "description": "Metadata on the usage of the embedding request.", + "type": "object", + "properties": { + "promptTokenCount": { + "description": "Output only. Number of tokens in the prompt.", + "readOnly": true, + "type": "integer", + "format": "int32" }, - "required": { - "description": "Optional. Required properties of Type.OBJECT.", + "promptTokenDetails": { + "description": "Output only. List of modalities that were processed in the request input.", + "readOnly": true, + "type": "array", "items": { - "type": "string" - }, - "type": "array" - }, - "example": { - "description": "Optional. Example of the object. Will only populated when the object is the root.", - "type": "any" - }, - "maxItems": { - "format": "int64", - "type": "string", - "description": "Optional. Maximum number of the elements for Type.ARRAY." - }, - "minProperties": { - "type": "string", - "description": "Optional. Minimum number of the properties for Type.OBJECT.", - "format": "int64" - }, - "maximum": { - "description": "Optional. Maximum value of the Type.INTEGER and Type.NUMBER", - "type": "number", - "format": "double" - }, - "properties": { - "additionalProperties": { - "$ref": "Schema" - }, - "description": "Optional. Properties of Type.OBJECT.", - "type": "object" - }, - "maxLength": { - "description": "Optional. Maximum length of the Type.STRING", - "type": "string", - "format": "int64" - }, - "minItems": { - "format": "int64", - "description": "Optional. Minimum number of the elements for Type.ARRAY.", - "type": "string" - }, - "minimum": { - "format": "double", - "type": "number", - "description": "Optional. SCHEMA FIELDS FOR TYPE INTEGER and NUMBER Minimum value of the Type.INTEGER and Type.NUMBER" - }, - "nullable": { - "description": "Optional. Indicates if the value may be null.", - "type": "boolean" + "$ref": "ModalityTokenCount" + } } - }, - "type": "object", - "id": "Schema", - "description": "The `Schema` object allows the definition of input and output data types. These types can be objects, but also primitives and arrays. Represents a select subset of an [OpenAPI 3.0 schema object](https://spec.openapis.org/oas/v3.0.3#schema)." + } }, - "InlinedEmbedContentRequest": { - "id": "InlinedEmbedContentRequest", - "description": "The request to be processed in the batch.", + "BatchEmbedContentsRequest": { + "id": "BatchEmbedContentsRequest", + "description": "Batch request to get embeddings from the model for a list of prompts.", "type": "object", "properties": { - "request": { - "$ref": "EmbedContentRequest", - "description": "Required. The request to be processed in the batch." - }, - "metadata": { - "type": "object", - "description": "Optional. The metadata to be associated with the request.", - "additionalProperties": { - "description": "Properties of the object.", - "type": "any" + "requests": { + "description": "Required. Embed requests for the batch. The model in each of these requests must match the model specified `BatchEmbedContentsRequest.model`.", + "type": "array", + "items": { + "$ref": "EmbedContentRequest" } } } @@ -4686,171 +2985,164 @@ "embeddings": { "description": "Output only. The embeddings for each request, in the same order as provided in the batch request.", "readOnly": true, + "type": "array", "items": { "$ref": "ContentEmbedding" - }, - "type": "array" + } }, "usageMetadata": { - "$ref": "EmbeddingUsageMetadata", "description": "Output only. The usage metadata for the request.", - "readOnly": true + "readOnly": true, + "$ref": "EmbeddingUsageMetadata" } } }, - "CreateFileResponse": { - "properties": { - "file": { - "$ref": "File", - "description": "Metadata for the created file." - } - }, - "id": "CreateFileResponse", - "description": "Response for `CreateFile`.", - "type": "object" - }, - "FileSearch": { - "id": "FileSearch", - "description": "The FileSearch tool that retrieves knowledge from Semantic Retrieval corpora. Files are imported to Semantic Retrieval corpora using the ImportFile API.", + "CountTokensRequest": { + "id": "CountTokensRequest", + "description": "Counts the number of tokens in the `prompt` sent to a model. Models may tokenize text differently, so each model may return a different `token_count`.", "type": "object", "properties": { - "fileSearchStoreNames": { + "contents": { + "description": "Optional. The input given to the model as a prompt. This field is ignored when `generate_content_request` is set.", "type": "array", - "description": "Required. The names of the file_search_stores to retrieve from. Example: `fileSearchStores/my-file-search-store-123`", "items": { - "type": "string" + "$ref": "Content" } }, - "metadataFilter": { - "type": "string", - "description": "Optional. Metadata filter to apply to the semantic retrieval documents and chunks." - }, - "topK": { - "format": "int32", - "description": "Optional. The number of semantic retrieval chunks to retrieve.", - "type": "integer" + "generateContentRequest": { + "description": "Optional. The overall input given to the `Model`. This includes the prompt as well as other model steering information like [system instructions](https://ai.google.dev/gemini-api/docs/system-instructions), and/or function declarations for [function calling](https://ai.google.dev/gemini-api/docs/function-calling). `Model`s/`Content`s and `generate_content_request`s are mutually exclusive. You can either send `Model` + `Content`s or a `generate_content_request`, but never both.", + "$ref": "GenerateContentRequest" } } }, - "PredictRequest": { + "CountTokensResponse": { + "id": "CountTokensResponse", + "description": "A response from `CountTokens`. It returns the model's `token_count` for the `prompt`.", "type": "object", - "id": "PredictRequest", - "description": "Request message for PredictionService.Predict.", - "properties": { - "parameters": { - "description": "Optional. The parameters that govern the prediction call.", - "type": "any" - }, - "instances": { - "description": "Required. The instances that are the input to the prediction call.", - "items": { - "type": "any" - }, - "type": "array" - } - } - }, - "MessagePrompt": { "properties": { - "messages": { - "description": "Required. A snapshot of the recent conversation history sorted chronologically. Turns alternate between two authors. If the total input size exceeds the model's `input_token_limit` the input will be truncated: The oldest items will be dropped from `messages`.", - "items": { - "$ref": "Message" - }, - "type": "array" + "totalTokens": { + "description": "The number of tokens that the `Model` tokenizes the `prompt` into. Always non-negative.", + "type": "integer", + "format": "int32" }, - "context": { - "description": "Optional. Text that should be provided to the model first to ground the response. If not empty, this `context` will be given to the model first before the `examples` and `messages`. When using a `context` be sure to provide it with every request to maintain continuity. This field can be a description of your prompt to the model to help provide context and guide the responses. Examples: \"Translate the phrase from English to French.\" or \"Given a statement, classify the sentiment as happy, sad or neutral.\" Anything included in this field will take precedence over message history if the total input size exceeds the model's `input_token_limit` and the input request is truncated.", - "type": "string" + "cachedContentTokenCount": { + "description": "Number of tokens in the cached part of the prompt (the cached content).", + "type": "integer", + "format": "int32" }, - "examples": { + "promptTokensDetails": { + "description": "Output only. List of modalities that were processed in the request input.", + "readOnly": true, "type": "array", - "description": "Optional. Examples of what the model should generate. This includes both user input and the response that the model should emulate. These `examples` are treated identically to conversation messages except that they take precedence over the history in `messages`: If the total input size exceeds the model's `input_token_limit` the input will be truncated. Items will be dropped from `messages` before `examples`.", "items": { - "$ref": "Example" + "$ref": "ModalityTokenCount" } - } - }, - "id": "MessagePrompt", - "description": "All of the structured input text passed to the model as a prompt. A `MessagePrompt` contains a structured set of fields that provide context for the conversation, examples of user input/model output message pairs that prime the model to respond in different ways, and the conversation history or list of messages representing the alternating turns of the conversation between the user and the model.", - "type": "object" - }, - "InlinedResponses": { - "properties": { - "inlinedResponses": { - "type": "array", - "description": "Output only. The responses to the requests in the batch.", + }, + "cacheTokensDetails": { + "description": "Output only. List of modalities that were processed in the cached content.", "readOnly": true, + "type": "array", "items": { - "$ref": "InlinedResponse" + "$ref": "ModalityTokenCount" } } - }, - "id": "InlinedResponses", - "description": "The responses to the requests in the batch.", - "type": "object" - }, - "GoogleSearch": { - "id": "GoogleSearch", - "description": "GoogleSearch tool type. Tool to support Google Search in Model. Powered by Google.", - "type": "object", - "properties": { - "timeRangeFilter": { - "description": "Optional. Filter search results to a specific time range. If customers set a start time, they must set an end time (and vice versa).", - "$ref": "Interval" - }, - "searchTypes": { - "$ref": "SearchTypes", - "description": "Optional. The set of search types to enable. If not set, web search is enabled by default." - } } }, - "GoogleSearchRetrieval": { + "BatchGenerateContentRequest": { + "id": "BatchGenerateContentRequest", + "description": "Request for a `BatchGenerateContent` operation.", "type": "object", - "id": "GoogleSearchRetrieval", - "description": "Tool to retrieve public web data for grounding, powered by Google.", "properties": { - "dynamicRetrievalConfig": { - "description": "Specifies the dynamic retrieval configuration for the given source.", - "$ref": "DynamicRetrievalConfig" + "batch": { + "description": "Required. The batch to create.", + "$ref": "GenerateContentBatch" } } }, - "EmbedContentBatchStats": { + "GenerateContentBatch": { + "id": "GenerateContentBatch", + "description": "A resource representing a batch of `GenerateContent` requests.", + "type": "object", "properties": { - "failedRequestCount": { - "type": "string", - "description": "Output only. The number of requests that failed to be processed.", - "readOnly": true, - "format": "int64" + "model": { + "description": "Required. The name of the `Model` to use for generating the completion. Format: `models/{model}`.", + "type": "string" }, - "pendingRequestCount": { - "format": "int64", - "description": "Output only. The number of requests that are still pending processing.", + "name": { + "description": "Output only. Identifier. Resource name of the batch. Format: `batches/{batch_id}`.", "readOnly": true, "type": "string" }, - "requestCount": { - "type": "string", - "description": "Output only. The number of requests in the batch.", - "readOnly": true, - "format": "int64" + "displayName": { + "description": "Required. The user-defined name of this batch.", + "type": "string" }, - "successfulRequestCount": { - "format": "int64", + "inputConfig": { + "description": "Required. Input configuration of the instances on which batch processing are performed.", + "$ref": "InputConfig" + }, + "output": { + "description": "Output only. The output of the batch request.", + "readOnly": true, + "$ref": "GenerateContentBatchOutput" + }, + "createTime": { + "description": "Output only. The time at which the batch was created.", + "readOnly": true, "type": "string", - "description": "Output only. The number of requests that were successfully processed.", - "readOnly": true + "format": "google-datetime" + }, + "endTime": { + "description": "Output only. The time at which the batch processing completed.", + "readOnly": true, + "type": "string", + "format": "google-datetime" + }, + "updateTime": { + "description": "Output only. The time at which the batch was last updated.", + "readOnly": true, + "type": "string", + "format": "google-datetime" + }, + "batchStats": { + "description": "Output only. Stats about the batch.", + "readOnly": true, + "$ref": "BatchStats" + }, + "state": { + "description": "Output only. The state of the batch.", + "readOnly": true, + "type": "string", + "enumDescriptions": [ + "The batch state is unspecified.", + "The service is preparing to run the batch.", + "The batch is in progress.", + "The batch completed successfully.", + "The batch failed.", + "The batch has been cancelled.", + "The batch has expired." + ], + "enum": [ + "BATCH_STATE_UNSPECIFIED", + "BATCH_STATE_PENDING", + "BATCH_STATE_RUNNING", + "BATCH_STATE_SUCCEEDED", + "BATCH_STATE_FAILED", + "BATCH_STATE_CANCELLED", + "BATCH_STATE_EXPIRED" + ] + }, + "priority": { + "description": "Optional. The priority of the batch. Batches with a higher priority value will be processed before batches with a lower priority value. Negative values are allowed. Default is 0.", + "type": "string", + "format": "int64" } - }, - "type": "object", - "id": "EmbedContentBatchStats", - "description": "Stats about the batch." + } }, - "InputEmbedContentConfig": { - "type": "object", - "id": "InputEmbedContentConfig", + "InputConfig": { + "id": "InputConfig", "description": "Configures the input to the batch request.", + "type": "object", "properties": { "fileName": { "description": "The name of the `File` containing the input requests.", @@ -4858,236 +3150,197 @@ }, "requests": { "description": "The requests to be processed in the batch.", - "$ref": "InlinedEmbedContentRequests" + "$ref": "InlinedRequests" } } }, - "WhiteSpaceConfig": { + "InlinedRequests": { + "id": "InlinedRequests", + "description": "The requests to be processed in the batch if provided as part of the batch creation request.", + "type": "object", "properties": { - "maxOverlapTokens": { - "type": "integer", - "description": "Maximum number of overlapping tokens between two adjacent chunks.", - "format": "int32" - }, - "maxTokensPerChunk": { - "format": "int32", - "description": "Maximum number of tokens per chunk. Tokens are defined as words for this chunking algorithm. Note: we are defining tokens as words split by whitespace as opposed to the output of a tokenizer. The context window of the latest gemini embedding model as of 2025-04-17 is currently 8192 tokens. We assume that the average word is 5 characters. Therefore, we set the upper limit to 2**9, which is 512 words, or 2560 tokens, assuming worst case a character per token. This is a conservative estimate meant to prevent context window overflow.", - "type": "integer" + "requests": { + "description": "Required. The requests to be processed in the batch.", + "type": "array", + "items": { + "$ref": "InlinedRequest" + } } - }, - "id": "WhiteSpaceConfig", - "description": "Configuration for a white space chunking algorithm [white space delimited].", - "type": "object" + } }, - "FunctionResponseBlob": { + "InlinedRequest": { + "id": "InlinedRequest", + "description": "The request to be processed in the batch.", "type": "object", - "id": "FunctionResponseBlob", - "description": "Raw media bytes for function response. Text should not be sent as raw bytes, use the 'FunctionResponse.response' field.", "properties": { - "mimeType": { - "description": "The IANA standard MIME type of the source data. Examples: - image/png - image/jpeg If an unsupported MIME type is provided, an error will be returned. For a complete list of supported types, see [Supported file formats](https://ai.google.dev/gemini-api/docs/prompting_with_media#supported_file_formats).", - "type": "string" + "request": { + "description": "Required. The request to be processed in the batch.", + "$ref": "GenerateContentRequest" }, - "data": { - "description": "Raw bytes for media formats.", - "type": "string", - "format": "byte" + "metadata": { + "description": "Optional. The metadata to be associated with the request.", + "type": "object", + "additionalProperties": { + "type": "any", + "description": "Properties of the object." + } } } }, - "ListCachedContentsResponse": { - "id": "ListCachedContentsResponse", - "description": "Response with CachedContents list.", + "GenerateContentBatchOutput": { + "id": "GenerateContentBatchOutput", + "description": "The output of a batch request. This is returned in the `BatchGenerateContentResponse` or the `GenerateContentBatch.output` field.", "type": "object", "properties": { - "cachedContents": { - "type": "array", - "description": "List of cached contents.", - "items": { - "$ref": "CachedContent" - } + "responsesFile": { + "description": "Output only. The file ID of the file containing the responses. The file will be a JSONL file with a single response per line. The responses will be `GenerateContentResponse` messages formatted as JSON. The responses will be written in the same order as the input requests.", + "readOnly": true, + "type": "string" }, - "nextPageToken": { - "type": "string", - "description": "A token, which can be sent as `page_token` to retrieve the next page. If this field is omitted, there are no subsequent pages." + "inlinedResponses": { + "description": "Output only. The responses to the requests in the batch. Returned when the batch was built using inlined requests. The responses will be in the same order as the input requests.", + "readOnly": true, + "$ref": "InlinedResponses" } } }, - "ListFileSearchStoresResponse": { - "id": "ListFileSearchStoresResponse", - "description": "Response from `ListFileSearchStores` containing a paginated list of `FileSearchStores`. The results are sorted by ascending `file_search_store.create_time`.", + "InlinedResponses": { + "id": "InlinedResponses", + "description": "The responses to the requests in the batch.", "type": "object", "properties": { - "fileSearchStores": { - "description": "The returned rag_stores.", + "inlinedResponses": { + "description": "Output only. The responses to the requests in the batch.", + "readOnly": true, + "type": "array", "items": { - "$ref": "FileSearchStore" - }, - "type": "array" - }, - "nextPageToken": { - "type": "string", - "description": "A token, which can be sent as `page_token` to retrieve the next page. If this field is omitted, there are no more pages." + "$ref": "InlinedResponse" + } } } }, - "GenerateAnswerRequest": { + "InlinedResponse": { + "id": "InlinedResponse", + "description": "The response to a single request in the batch.", + "type": "object", "properties": { - "answerStyle": { - "type": "string", - "description": "Required. Style in which answers should be returned.", - "enumDescriptions": [ - "Unspecified answer style.", - "Succinct but abstract style.", - "Very brief and extractive style.", - "Verbose style including extra details. The response may be formatted as a sentence, paragraph, multiple paragraphs, or bullet points, etc." - ], - "enum": [ - "ANSWER_STYLE_UNSPECIFIED", - "ABSTRACTIVE", - "EXTRACTIVE", - "VERBOSE" - ] - }, - "temperature": { - "description": "Optional. Controls the randomness of the output. Values can range from [0.0,1.0], inclusive. A value closer to 1.0 will produce responses that are more varied and creative, while a value closer to 0.0 will typically result in more straightforward responses from the model. A low temperature (~0.2) is usually recommended for Attributed-Question-Answering use cases.", - "type": "number", - "format": "float" + "error": { + "description": "Output only. The error encountered while processing the request.", + "readOnly": true, + "$ref": "Status" }, - "semanticRetriever": { - "$ref": "SemanticRetrieverConfig", - "description": "Content retrieved from resources created via the Semantic Retriever API." + "response": { + "description": "Output only. The response to the request.", + "readOnly": true, + "$ref": "GenerateContentResponse" }, - "contents": { - "type": "array", - "description": "Required. The content of the current conversation with the `Model`. For single-turn queries, this is a single question to answer. For multi-turn queries, this is a repeated field that contains conversation history and the last `Content` in the list containing the question. Note: `GenerateAnswer` only supports queries in English.", - "items": { - "$ref": "Content" + "metadata": { + "description": "Output only. The metadata associated with the request.", + "readOnly": true, + "type": "object", + "additionalProperties": { + "type": "any", + "description": "Properties of the object." } - }, - "safetySettings": { - "description": "Optional. A list of unique `SafetySetting` instances for blocking unsafe content. This will be enforced on the `GenerateAnswerRequest.contents` and `GenerateAnswerResponse.candidate`. There should not be more than one setting for each `SafetyCategory` type. The API will block any contents and responses that fail to meet the thresholds set by these settings. This list overrides the default settings for each `SafetyCategory` specified in the safety_settings. If there is no `SafetySetting` for a given `SafetyCategory` provided in the list, the API will use the default safety setting for that category. Harm categories HARM_CATEGORY_HATE_SPEECH, HARM_CATEGORY_SEXUALLY_EXPLICIT, HARM_CATEGORY_DANGEROUS_CONTENT, HARM_CATEGORY_HARASSMENT are supported. Refer to the [guide](https://ai.google.dev/gemini-api/docs/safety-settings) for detailed information on available safety settings. Also refer to the [Safety guidance](https://ai.google.dev/gemini-api/docs/safety-guidance) to learn how to incorporate safety considerations in your AI applications.", - "items": { - "$ref": "SafetySetting" - }, - "type": "array" - }, - "inlinePassages": { - "description": "Passages provided inline with the request.", - "$ref": "GroundingPassages" } - }, - "id": "GenerateAnswerRequest", - "description": "Request to generate a grounded answer from the `Model`.", - "type": "object" + } }, - "GenerateAnswerResponse": { - "id": "GenerateAnswerResponse", - "description": "Response from the model for a grounded answer.", + "BatchStats": { + "id": "BatchStats", + "description": "Stats about the batch.", "type": "object", "properties": { - "answer": { - "$ref": "Candidate", - "description": "Candidate answer from the model. Note: The model *always* attempts to provide a grounded answer, even when the answer is unlikely to be answerable from the given passages. In that case, a low-quality or ungrounded answer may be provided, along with a low `answerable_probability`." + "requestCount": { + "description": "Output only. The number of requests in the batch.", + "readOnly": true, + "type": "string", + "format": "int64" }, - "inputFeedback": { - "description": "Output only. Feedback related to the input data used to answer the question, as opposed to the model-generated response to the question. The input data can be one or more of the following: - Question specified by the last entry in `GenerateAnswerRequest.content` - Conversation history specified by the other entries in `GenerateAnswerRequest.content` - Grounding sources (`GenerateAnswerRequest.semantic_retriever` or `GenerateAnswerRequest.inline_passages`)", + "successfulRequestCount": { + "description": "Output only. The number of requests that were successfully processed.", "readOnly": true, - "$ref": "InputFeedback" + "type": "string", + "format": "int64" }, - "answerableProbability": { - "description": "Output only. The model's estimate of the probability that its answer is correct and grounded in the input passages. A low `answerable_probability` indicates that the answer might not be grounded in the sources. When `answerable_probability` is low, you may want to: * Display a message to the effect of \"We couldn’t answer that question\" to the user. * Fall back to a general-purpose LLM that answers the question from world knowledge. The threshold and nature of such fallbacks will depend on individual use cases. `0.5` is a good starting threshold.", + "failedRequestCount": { + "description": "Output only. The number of requests that failed to be processed.", "readOnly": true, - "type": "number", - "format": "float" + "type": "string", + "format": "int64" + }, + "pendingRequestCount": { + "description": "Output only. The number of requests that are still pending processing.", + "readOnly": true, + "type": "string", + "format": "int64" } } }, - "InlinedEmbedContentRequests": { - "id": "InlinedEmbedContentRequests", - "description": "The requests to be processed in the batch if provided as part of the batch creation request.", + "AsyncBatchEmbedContentRequest": { + "id": "AsyncBatchEmbedContentRequest", + "description": "Request for an `AsyncBatchEmbedContent` operation.", "type": "object", "properties": { - "requests": { - "description": "Required. The requests to be processed in the batch.", - "items": { - "$ref": "InlinedEmbedContentRequest" - }, - "type": "array" + "batch": { + "description": "Required. The batch to create.", + "$ref": "EmbedContentBatch" } } }, - "TransferOwnershipResponse": { - "properties": {}, - "type": "object", - "id": "TransferOwnershipResponse", - "description": "Response from `TransferOwnership`." - }, - "Empty": { + "EmbedContentBatch": { + "id": "EmbedContentBatch", + "description": "A resource representing a batch of `EmbedContent` requests.", "type": "object", - "id": "Empty", - "description": "A generic empty message that you can re-use to avoid defining duplicated empty messages in your APIs. A typical example is to use it as the request or the response type of an API method. For instance: service Foo { rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); }", - "properties": {} - }, - "GenerateContentBatch": { "properties": { - "createTime": { - "type": "string", - "description": "Output only. The time at which the batch was created.", + "model": { + "description": "Required. The name of the `Model` to use for generating the completion. Format: `models/{model}`.", + "type": "string" + }, + "name": { + "description": "Output only. Identifier. Resource name of the batch. Format: `batches/{batch_id}`.", "readOnly": true, - "format": "google-datetime" + "type": "string" + }, + "displayName": { + "description": "Required. The user-defined name of this batch.", + "type": "string" + }, + "inputConfig": { + "description": "Required. Input configuration of the instances on which batch processing are performed.", + "$ref": "InputEmbedContentConfig" }, "output": { "description": "Output only. The output of the batch request.", "readOnly": true, - "$ref": "GenerateContentBatchOutput" + "$ref": "EmbedContentBatchOutput" }, - "updateTime": { - "description": "Output only. The time at which the batch was last updated.", + "createTime": { + "description": "Output only. The time at which the batch was created.", "readOnly": true, "type": "string", "format": "google-datetime" }, - "name": { - "type": "string", - "description": "Output only. Identifier. Resource name of the batch. Format: `batches/{batch_id}`.", - "readOnly": true - }, - "model": { + "endTime": { + "description": "Output only. The time at which the batch processing completed.", + "readOnly": true, "type": "string", - "description": "Required. The name of the `Model` to use for generating the completion. Format: `models/{model}`." + "format": "google-datetime" }, - "priority": { - "description": "Optional. The priority of the batch. Batches with a higher priority value will be processed before batches with a lower priority value. Negative values are allowed. Default is 0.", + "updateTime": { + "description": "Output only. The time at which the batch was last updated.", + "readOnly": true, "type": "string", - "format": "int64" - }, - "inputConfig": { - "description": "Required. Input configuration of the instances on which batch processing are performed.", - "$ref": "InputConfig" + "format": "google-datetime" }, "batchStats": { "description": "Output only. Stats about the batch.", "readOnly": true, - "$ref": "BatchStats" - }, - "displayName": { - "description": "Required. The user-defined name of this batch.", - "type": "string" + "$ref": "EmbedContentBatchStats" }, "state": { "description": "Output only. The state of the batch.", - "type": "string", - "enum": [ - "BATCH_STATE_UNSPECIFIED", - "BATCH_STATE_PENDING", - "BATCH_STATE_RUNNING", - "BATCH_STATE_SUCCEEDED", - "BATCH_STATE_FAILED", - "BATCH_STATE_CANCELLED", - "BATCH_STATE_EXPIRED" - ], "readOnly": true, + "type": "string", "enumDescriptions": [ "The batch state is unspecified.", "The service is preparing to run the batch.", @@ -5096,1176 +3349,1065 @@ "The batch failed.", "The batch has been cancelled.", "The batch has expired." + ], + "enum": [ + "BATCH_STATE_UNSPECIFIED", + "BATCH_STATE_PENDING", + "BATCH_STATE_RUNNING", + "BATCH_STATE_SUCCEEDED", + "BATCH_STATE_FAILED", + "BATCH_STATE_CANCELLED", + "BATCH_STATE_EXPIRED" ] }, - "endTime": { + "priority": { + "description": "Optional. The priority of the batch. Batches with a higher priority value will be processed before batches with a lower priority value. Negative values are allowed. Default is 0.", "type": "string", - "description": "Output only. The time at which the batch processing completed.", - "readOnly": true, - "format": "google-datetime" + "format": "int64" } - }, - "type": "object", - "id": "GenerateContentBatch", - "description": "A resource representing a batch of `GenerateContent` requests." + } }, - "GroundingMetadata": { + "InputEmbedContentConfig": { + "id": "InputEmbedContentConfig", + "description": "Configures the input to the batch request.", + "type": "object", "properties": { - "groundingChunks": { - "description": "List of supporting references retrieved from specified grounding source. When streaming, this only contains the grounding chunks that have not been included in the grounding metadata of previous responses.", - "items": { - "$ref": "GroundingChunk" - }, - "type": "array" - }, - "retrievalMetadata": { - "description": "Metadata related to retrieval in the grounding flow.", - "$ref": "RetrievalMetadata" - }, - "groundingSupports": { - "description": "List of grounding support.", - "items": { - "$ref": "GoogleAiGenerativelanguageV1betaGroundingSupport" - }, - "type": "array" - }, - "searchEntryPoint": { - "description": "Optional. Google search entry for the following-up web searches.", - "$ref": "SearchEntryPoint" - }, - "googleMapsWidgetContextToken": { - "type": "string", - "description": "Optional. Resource name of the Google Maps widget context token that can be used with the PlacesContextElement widget in order to render contextual data. Only populated in the case that grounding with Google Maps is enabled." - }, - "webSearchQueries": { - "description": "Web search queries for the following-up web search.", - "items": { - "type": "string" - }, - "type": "array" + "fileName": { + "description": "The name of the `File` containing the input requests.", + "type": "string" }, - "imageSearchQueries": { + "requests": { + "description": "The requests to be processed in the batch.", + "$ref": "InlinedEmbedContentRequests" + } + } + }, + "InlinedEmbedContentRequests": { + "id": "InlinedEmbedContentRequests", + "description": "The requests to be processed in the batch if provided as part of the batch creation request.", + "type": "object", + "properties": { + "requests": { + "description": "Required. The requests to be processed in the batch.", "type": "array", - "description": "Image search queries used for grounding.", "items": { - "type": "string" + "$ref": "InlinedEmbedContentRequest" } } - }, + } + }, + "InlinedEmbedContentRequest": { + "id": "InlinedEmbedContentRequest", + "description": "The request to be processed in the batch.", "type": "object", - "id": "GroundingMetadata", - "description": "Metadata returned to client when grounding is enabled." + "properties": { + "request": { + "description": "Required. The request to be processed in the batch.", + "$ref": "EmbedContentRequest" + }, + "metadata": { + "description": "Optional. The metadata to be associated with the request.", + "type": "object", + "additionalProperties": { + "type": "any", + "description": "Properties of the object." + } + } + } }, - "ContentFilter": { - "id": "ContentFilter", - "description": "Content filtering metadata associated with processing a single request. ContentFilter contains a reason and an optional supporting string. The reason may be unspecified.", + "EmbedContentBatchOutput": { + "id": "EmbedContentBatchOutput", + "description": "The output of a batch request. This is returned in the `AsyncBatchEmbedContentResponse` or the `EmbedContentBatch.output` field.", "type": "object", "properties": { - "reason": { - "enumDescriptions": [ - "A blocked reason was not specified.", - "Content was blocked by safety settings.", - "Content was blocked, but the reason is uncategorized." - ], - "enum": [ - "BLOCKED_REASON_UNSPECIFIED", - "SAFETY", - "OTHER" - ], - "description": "The reason content was blocked during request processing.", + "responsesFile": { + "description": "Output only. The file ID of the file containing the responses. The file will be a JSONL file with a single response per line. The responses will be `EmbedContentResponse` messages formatted as JSON. The responses will be written in the same order as the input requests.", + "readOnly": true, "type": "string" }, - "message": { - "type": "string", - "description": "A string that describes the filtering behavior in more detail." + "inlinedResponses": { + "description": "Output only. The responses to the requests in the batch. Returned when the batch was built using inlined requests. The responses will be in the same order as the input requests.", + "readOnly": true, + "$ref": "InlinedEmbedContentResponses" } } }, - "RegisterFilesResponse": { + "InlinedEmbedContentResponses": { + "id": "InlinedEmbedContentResponses", + "description": "The responses to the requests in the batch.", + "type": "object", "properties": { - "files": { + "inlinedResponses": { + "description": "Output only. The responses to the requests in the batch.", + "readOnly": true, "type": "array", - "description": "The registered files to be used when calling GenerateContent.", "items": { - "$ref": "File" + "$ref": "InlinedEmbedContentResponse" } } - }, - "id": "RegisterFilesResponse", - "description": "Response for `RegisterFiles`.", - "type": "object" + } }, - "GenerationConfig": { + "InlinedEmbedContentResponse": { + "id": "InlinedEmbedContentResponse", + "description": "The response to a single request in the batch.", + "type": "object", "properties": { - "imageConfig": { - "description": "Optional. Config for image generation. An error will be returned if this field is set for models that don't support these config options.", - "$ref": "ImageConfig" - }, - "logprobs": { - "description": "Optional. Only valid if response_logprobs=True. This sets the number of top logprobs, including the chosen candidate, to return at each decoding step in the Candidate.logprobs_result. The number must be in the range of [0, 20].", - "type": "integer", - "format": "int32" - }, - "temperature": { - "format": "float", - "type": "number", - "description": "Optional. Controls the randomness of the output. Note: The default value varies by model, see the `Model.temperature` attribute of the `Model` returned from the `getModel` function. Values can range from [0.0, 2.0]." + "error": { + "description": "Output only. The error encountered while processing the request.", + "readOnly": true, + "$ref": "Status" }, - "presencePenalty": { - "format": "float", - "description": "Optional. Presence penalty applied to the next token's logprobs if the token has already been seen in the response. This penalty is binary on/off and not dependant on the number of times the token is used (after the first). Use frequency_penalty for a penalty that increases with each use. A positive penalty will discourage the use of tokens that have already been used in the response, increasing the vocabulary. A negative penalty will encourage the use of tokens that have already been used in the response, decreasing the vocabulary.", - "type": "number" + "response": { + "description": "Output only. The response to the request.", + "readOnly": true, + "$ref": "EmbedContentResponse" }, - "stopSequences": { - "type": "array", - "description": "Optional. The set of character sequences (up to 5) that will stop output generation. If specified, the API will stop at the first appearance of a `stop_sequence`. The stop sequence will not be included as part of the response.", - "items": { - "type": "string" - } - }, - "topK": { - "description": "Optional. The maximum number of tokens to consider when sampling. Gemini models use Top-p (nucleus) sampling or a combination of Top-k and nucleus sampling. Top-k sampling considers the set of `top_k` most probable tokens. Models running with nucleus sampling don't allow top_k setting. Note: The default value varies by `Model` and is specified by the`Model.top_p` attribute returned from the `getModel` function. An empty `top_k` attribute indicates that the model doesn't apply top-k sampling and doesn't allow setting `top_k` on requests.", - "type": "integer", - "format": "int32" - }, - "enableEnhancedCivicAnswers": { - "description": "Optional. Enables enhanced civic answers. It may not be available for all models.", - "type": "boolean" - }, - "candidateCount": { - "format": "int32", - "type": "integer", - "description": "Optional. Number of generated responses to return. If unset, this will default to 1. Please note that this doesn't work for previous generation models (Gemini 1.0 family)" - }, - "mediaResolution": { - "type": "string", - "description": "Optional. If specified, the media resolution specified will be used.", - "enumDescriptions": [ - "Media resolution has not been set.", - "Media resolution set to low (64 tokens).", - "Media resolution set to medium (256 tokens).", - "Media resolution set to high (zoomed reframing with 256 tokens)." - ], - "enum": [ - "MEDIA_RESOLUTION_UNSPECIFIED", - "MEDIA_RESOLUTION_LOW", - "MEDIA_RESOLUTION_MEDIUM", - "MEDIA_RESOLUTION_HIGH" - ] - }, - "responseMimeType": { - "description": "Optional. MIME type of the generated candidate text. Supported MIME types are: `text/plain`: (default) Text output. `application/json`: JSON response in the response candidates. `text/x.enum`: ENUM as a string response in the response candidates. Refer to the [docs](https://ai.google.dev/gemini-api/docs/prompting_with_media#plain_text_formats) for a list of all supported text MIME types.", - "type": "string" - }, - "maxOutputTokens": { - "format": "int32", - "description": "Optional. The maximum number of tokens to include in a response candidate. Note: The default value varies by model, see the `Model.output_token_limit` attribute of the `Model` returned from the `getModel` function.", - "type": "integer" - }, - "responseModalities": { - "description": "Optional. The requested modalities of the response. Represents the set of modalities that the model can return, and should be expected in the response. This is an exact match to the modalities of the response. A model may have multiple combinations of supported modalities. If the requested modalities do not match any of the supported combinations, an error will be returned. An empty list is equivalent to requesting only text.", - "items": { - "type": "string", - "enumDescriptions": [ - "Default value.", - "Indicates the model should return text.", - "Indicates the model should return images.", - "Indicates the model should return audio." - ], - "enum": [ - "MODALITY_UNSPECIFIED", - "TEXT", - "IMAGE", - "AUDIO" - ] - }, - "type": "array" - }, - "thinkingConfig": { - "description": "Optional. Config for thinking features. An error will be returned if this field is set for models that don't support thinking.", - "$ref": "ThinkingConfig" - }, - "topP": { - "format": "float", - "description": "Optional. The maximum cumulative probability of tokens to consider when sampling. The model uses combined Top-k and Top-p (nucleus) sampling. Tokens are sorted based on their assigned probabilities so that only the most likely tokens are considered. Top-k sampling directly limits the maximum number of tokens to consider, while Nucleus sampling limits the number of tokens based on the cumulative probability. Note: The default value varies by `Model` and is specified by the`Model.top_p` attribute returned from the `getModel` function. An empty `top_k` attribute indicates that the model doesn't apply top-k sampling and doesn't allow setting `top_k` on requests.", - "type": "number" - }, - "responseJsonSchema": { - "type": "any", - "description": "Optional. An internal detail. Use `responseJsonSchema` rather than this field." - }, - "responseLogprobs": { - "description": "Optional. If true, export the logprobs results in response.", - "type": "boolean" - }, - "speechConfig": { - "description": "Optional. The speech generation config.", - "$ref": "SpeechConfig" - }, - "responseSchema": { - "$ref": "Schema", - "description": "Optional. Output schema of the generated candidate text. Schemas must be a subset of the [OpenAPI schema](https://spec.openapis.org/oas/v3.0.3#schema) and can be objects, primitives or arrays. If set, a compatible `response_mime_type` must also be set. Compatible MIME types: `application/json`: Schema for JSON response. Refer to the [JSON text generation guide](https://ai.google.dev/gemini-api/docs/json-mode) for more details." - }, - "frequencyPenalty": { - "type": "number", - "description": "Optional. Frequency penalty applied to the next token's logprobs, multiplied by the number of times each token has been seen in the respponse so far. A positive penalty will discourage the use of tokens that have already been used, proportional to the number of times the token has been used: The more a token is used, the more difficult it is for the model to use that token again increasing the vocabulary of responses. Caution: A _negative_ penalty will encourage the model to reuse tokens proportional to the number of times the token has been used. Small negative values will reduce the vocabulary of a response. Larger negative values will cause the model to start repeating a common token until it hits the max_output_tokens limit.", - "format": "float" - }, - "_responseJsonSchema": { - "type": "any", - "description": "Optional. Output schema of the generated response. This is an alternative to `response_schema` that accepts [JSON Schema](https://json-schema.org/). If set, `response_schema` must be omitted, but `response_mime_type` is required. While the full JSON Schema may be sent, not all features are supported. Specifically, only the following properties are supported: - `$id` - `$defs` - `$ref` - `$anchor` - `type` - `format` - `title` - `description` - `enum` (for strings and numbers) - `items` - `prefixItems` - `minItems` - `maxItems` - `minimum` - `maximum` - `anyOf` - `oneOf` (interpreted the same as `anyOf`) - `properties` - `additionalProperties` - `required` The non-standard `propertyOrdering` property may also be set. Cyclic references are unrolled to a limited degree and, as such, may only be used within non-required properties. (Nullable properties are not sufficient.) If `$ref` is set on a sub-schema, no other properties, except for than those starting as a `$`, may be set." - }, - "seed": { - "description": "Optional. Seed used in decoding. If not set, the request uses a randomly generated seed.", - "type": "integer", - "format": "int32" - } - }, - "id": "GenerationConfig", - "description": "Configuration options for model generation and outputs. Not all parameters are configurable for every model.", - "type": "object" - }, - "InlinedRequests": { - "type": "object", - "id": "InlinedRequests", - "description": "The requests to be processed in the batch if provided as part of the batch creation request.", - "properties": { - "requests": { - "type": "array", - "description": "Required. The requests to be processed in the batch.", - "items": { - "$ref": "InlinedRequest" + "metadata": { + "description": "Output only. The metadata associated with the request.", + "readOnly": true, + "type": "object", + "additionalProperties": { + "type": "any", + "description": "Properties of the object." } } } }, - "EmbedTextRequest": { + "EmbedContentBatchStats": { + "id": "EmbedContentBatchStats", + "description": "Stats about the batch.", "type": "object", - "id": "EmbedTextRequest", - "description": "Request to get a text embedding from the model.", "properties": { - "text": { - "description": "Optional. The free-form input text that the model will turn into an embedding.", - "type": "string" + "requestCount": { + "description": "Output only. The number of requests in the batch.", + "readOnly": true, + "type": "string", + "format": "int64" }, - "model": { + "successfulRequestCount": { + "description": "Output only. The number of requests that were successfully processed.", + "readOnly": true, + "type": "string", + "format": "int64" + }, + "failedRequestCount": { + "description": "Output only. The number of requests that failed to be processed.", + "readOnly": true, + "type": "string", + "format": "int64" + }, + "pendingRequestCount": { + "description": "Output only. The number of requests that are still pending processing.", + "readOnly": true, "type": "string", - "description": "Required. The model name to use with the format model=models/{model}." + "format": "int64" } } }, - "ListModelsResponse": { + "ListCachedContentsResponse": { + "id": "ListCachedContentsResponse", + "description": "Response with CachedContents list.", "type": "object", - "id": "ListModelsResponse", - "description": "Response from `ListModel` containing a paginated list of Models.", "properties": { - "models": { + "cachedContents": { + "description": "List of cached contents.", "type": "array", - "description": "The returned Models.", "items": { - "$ref": "Model" + "$ref": "CachedContent" } }, "nextPageToken": { - "description": "A token, which can be sent as `page_token` to retrieve the next page. If this field is omitted, there are no more pages.", + "description": "A token, which can be sent as `page_token` to retrieve the next page. If this field is omitted, there are no subsequent pages.", "type": "string" } } }, - "ContentTypeInfo": { + "CachedContent": { + "id": "CachedContent", + "description": "Content that has been preprocessed and can be used in subsequent request to GenerativeService. Cached content can be only used with model it was created for.", + "type": "object", "properties": { - "fromUrlPath": { - "type": "string", - "description": "The content type of the file derived from the file extension of the URL path. The URL path is assumed to represent a file name (which is typically only true for agents that are providing a REST API)." - }, - "fromBytes": { - "description": "The content type of the file derived by looking at specific bytes (i.e. \"magic bytes\") of the actual file.", - "type": "string" - }, - "fromFusionId": { - "type": "string", - "description": "The content type of the file detected by Fusion ID. go/fusionid" - }, - "fusionIdDetectionMetadata": { + "expireTime": { + "description": "Timestamp in UTC of when this resource is considered expired. This is *always* provided on output, regardless of what was sent on input.", "type": "string", - "description": "Metadata information from Fusion ID detection. Serialized FusionIdDetectionMetadata proto. Only set if from_fusion_id is set.", - "format": "byte" + "format": "google-datetime" }, - "bestGuess": { + "ttl": { + "description": "Input only. New TTL for this resource, input only.", "type": "string", - "description": "Scotty's best guess of what the content type of the file is." + "format": "google-duration" }, - "fromFileName": { - "description": "The content type of the file derived from the file extension of the original file name used by the client.", + "name": { + "description": "Output only. Identifier. The resource name referring to the cached content. Format: `cachedContents/{id}`", + "readOnly": true, "type": "string" }, - "fromHeader": { - "description": "The content type of the file as specified in the request headers, multipart headers, or RUPIO start request.", + "displayName": { + "description": "Optional. Immutable. The user-generated meaningful display name of the cached content. Maximum 128 Unicode characters.", "type": "string" - } - }, - "id": "ContentTypeInfo", - "description": "Detailed Content-Type information from Scotty. The Content-Type of the media will typically be filled in by the header or Scotty's best_guess, but this extended information provides the backend with more information so that it can make a better decision if needed. This is only used on media upload requests from Scotty.", - "type": "object" - }, - "SearchTypes": { - "properties": { - "imageSearch": { - "description": "Optional. Enables image search. Image bytes are returned.", - "$ref": "ImageSearch" - }, - "webSearch": { - "$ref": "WebSearch", - "description": "Optional. Enables web search. Only text results are returned." - } - }, - "type": "object", - "id": "SearchTypes", - "description": "Different types of search that can be enabled on the GoogleSearch tool." - }, - "Image": { - "type": "object", - "id": "Image", - "description": "Chunk from image search.", - "properties": { - "sourceUri": { - "type": "string", - "description": "The web page URI for attribution." }, - "imageUri": { - "description": "The image asset URL.", + "model": { + "description": "Required. Immutable. The name of the `Model` to use for cached content Format: `models/{model}`", "type": "string" }, - "title": { - "description": "The title of the web page that the image is from.", - "type": "string" + "systemInstruction": { + "description": "Optional. Input only. Immutable. Developer set system instruction. Currently text only.", + "$ref": "Content" }, - "domain": { - "description": "The root domain of the web page that the image is from, e.g. \"example.com\".", - "type": "string" - } - } - }, - "ContentEmbedding": { - "id": "ContentEmbedding", - "description": "A list of floats representing an embedding.", - "type": "object", - "properties": { - "values": { + "contents": { + "description": "Optional. Input only. Immutable. The content to cache.", "type": "array", - "description": "The embedding values. This is for 3P users only and will not be populated for 1P calls.", "items": { - "type": "number", - "format": "float" + "$ref": "Content" } }, - "shape": { + "tools": { + "description": "Optional. Input only. Immutable. A list of `Tools` the model may use to generate the next response", "type": "array", - "description": "This field stores the soft tokens tensor frame shape (e.g. [1, 1, 256, 2048]).", "items": { - "format": "int32", - "type": "integer" + "$ref": "Tool" } + }, + "toolConfig": { + "description": "Optional. Input only. Immutable. Tool config. This config is shared for all tools.", + "$ref": "ToolConfig" + }, + "createTime": { + "description": "Output only. Creation time of the cache entry.", + "readOnly": true, + "type": "string", + "format": "google-datetime" + }, + "updateTime": { + "description": "Output only. When the cache entry was last updated in UTC time.", + "readOnly": true, + "type": "string", + "format": "google-datetime" + }, + "usageMetadata": { + "description": "Output only. Metadata on the usage of the cached content.", + "readOnly": true, + "$ref": "CachedContentUsageMetadata" } } }, - "DownloadParameters": { + "CachedContentUsageMetadata": { + "id": "CachedContentUsageMetadata", + "description": "Metadata on the usage of the cached content.", "type": "object", - "id": "DownloadParameters", - "description": "Parameters specific to media downloads.", "properties": { - "allowGzipCompression": { - "description": "A boolean to be returned in the response to Scotty. Allows/disallows gzip encoding of the payload content when the server thinks it's advantageous (hence, does not guarantee compression) which allows Scotty to GZip the response to the client.", - "type": "boolean" - }, - "ignoreRange": { - "description": "Determining whether or not Apiary should skip the inclusion of any Content-Range header on its response to Scotty.", - "type": "boolean" + "totalTokenCount": { + "description": "Total number of tokens that the cached content consumes.", + "type": "integer", + "format": "int32" } } }, - "GoogleMaps": { + "GenerateMessageRequest": { + "id": "GenerateMessageRequest", + "description": "Request to generate a message response from the model.", + "type": "object", "properties": { - "enableWidget": { - "description": "Optional. Whether to return a widget context token in the GroundingMetadata of the response. Developers can use the widget context token to render a Google Maps widget with geospatial context related to the places that the model references in the response.", - "type": "boolean" + "prompt": { + "description": "Required. The structured textual input given to the model as a prompt. Given a prompt, the model will return what it predicts is the next message in the discussion.", + "$ref": "MessagePrompt" + }, + "temperature": { + "description": "Optional. Controls the randomness of the output. Values can range over `[0.0,1.0]`, inclusive. A value closer to `1.0` will produce responses that are more varied, while a value closer to `0.0` will typically result in less surprising responses from the model.", + "type": "number", + "format": "float" + }, + "candidateCount": { + "description": "Optional. The number of generated response messages to return. This value must be between `[1, 8]`, inclusive. If unset, this will default to `1`.", + "type": "integer", + "format": "int32" + }, + "topP": { + "description": "Optional. The maximum cumulative probability of tokens to consider when sampling. The model uses combined Top-k and nucleus sampling. Nucleus sampling considers the smallest set of tokens whose probability sum is at least `top_p`.", + "type": "number", + "format": "float" + }, + "topK": { + "description": "Optional. The maximum number of tokens to consider when sampling. The model uses combined Top-k and nucleus sampling. Top-k sampling considers the set of `top_k` most probable tokens.", + "type": "integer", + "format": "int32" } - }, - "type": "object", - "id": "GoogleMaps", - "description": "The GoogleMaps Tool that provides geospatial context for the user's query." + } }, - "GroundingChunkStringList": { + "MessagePrompt": { + "id": "MessagePrompt", + "description": "All of the structured input text passed to the model as a prompt. A `MessagePrompt` contains a structured set of fields that provide context for the conversation, examples of user input/model output message pairs that prime the model to respond in different ways, and the conversation history or list of messages representing the alternating turns of the conversation between the user and the model.", + "type": "object", "properties": { - "values": { + "context": { + "description": "Optional. Text that should be provided to the model first to ground the response. If not empty, this `context` will be given to the model first before the `examples` and `messages`. When using a `context` be sure to provide it with every request to maintain continuity. This field can be a description of your prompt to the model to help provide context and guide the responses. Examples: \"Translate the phrase from English to French.\" or \"Given a statement, classify the sentiment as happy, sad or neutral.\" Anything included in this field will take precedence over message history if the total input size exceeds the model's `input_token_limit` and the input request is truncated.", + "type": "string" + }, + "examples": { + "description": "Optional. Examples of what the model should generate. This includes both user input and the response that the model should emulate. These `examples` are treated identically to conversation messages except that they take precedence over the history in `messages`: If the total input size exceeds the model's `input_token_limit` the input will be truncated. Items will be dropped from `messages` before `examples`.", "type": "array", - "description": "The string values of the list.", "items": { - "type": "string" + "$ref": "Example" } - } - }, - "id": "GroundingChunkStringList", - "description": "A list of string values.", - "type": "object" - }, - "PlaceAnswerSources": { - "id": "PlaceAnswerSources", - "description": "Collection of sources that provide answers about the features of a given place in Google Maps. Each PlaceAnswerSources message corresponds to a specific place in Google Maps. The Google Maps tool used these sources in order to answer questions about features of the place (e.g: \"does Bar Foo have Wifi\" or \"is Foo Bar wheelchair accessible?\"). Currently we only support review snippets as sources.", - "type": "object", - "properties": { - "reviewSnippets": { - "description": "Snippets of reviews that are used to generate answers about the features of a given place in Google Maps.", + }, + "messages": { + "description": "Required. A snapshot of the recent conversation history sorted chronologically. Turns alternate between two authors. If the total input size exceeds the model's `input_token_limit` the input will be truncated: The oldest items will be dropped from `messages`.", + "type": "array", "items": { - "$ref": "ReviewSnippet" - }, - "type": "array" + "$ref": "Message" + } } } }, - "SemanticRetrieverChunk": { - "id": "SemanticRetrieverChunk", - "description": "Identifier for a `Chunk` retrieved via Semantic Retriever specified in the `GenerateAnswerRequest` using `SemanticRetrieverConfig`.", + "Example": { + "id": "Example", + "description": "An input/output example used to instruct the Model. It demonstrates how the model should respond or format its response.", "type": "object", "properties": { - "source": { - "description": "Output only. Name of the source matching the request's `SemanticRetrieverConfig.source`. Example: `corpora/123` or `corpora/123/documents/abc`", - "readOnly": true, - "type": "string" + "input": { + "description": "Required. An example of an input `Message` from the user.", + "$ref": "Message" }, - "chunk": { - "type": "string", - "description": "Output only. Name of the `Chunk` containing the attributed text. Example: `corpora/123/documents/abc/chunks/xyz`", - "readOnly": true + "output": { + "description": "Required. An example of what the model should output given the input.", + "$ref": "Message" } } }, - "DiffUploadResponse": { - "id": "DiffUploadResponse", - "description": "Backend response for a Diff upload request. For details on the Scotty Diff protocol, visit http://go/scotty-diff-protocol.", + "Message": { + "id": "Message", + "description": "The base unit of structured text. A `Message` includes an `author` and the `content` of the `Message`. The `author` is used to tag messages when they are fed to the model as text.", "type": "object", "properties": { - "objectVersion": { - "description": "The object version of the object at the server. Must be included in the end notification response. The version in the end notification response must correspond to the new version of the object that is now stored at the server, after the upload.", + "author": { + "description": "Optional. The author of this Message. This serves as a key for tagging the content of this Message when it is fed to the model as text. The author can be any alphanumeric string.", "type": "string" }, - "originalObject": { - "$ref": "CompositeMedia", - "description": "The location of the original file for a diff upload request. Must be filled in if responding to an upload start notification." + "content": { + "description": "Required. The text content of the structured `Message`.", + "type": "string" + }, + "citationMetadata": { + "description": "Output only. Citation information for model-generated `content` in this `Message`. If this `Message` was generated as output from the model, this field may be populated with attribution information for any text included in the `content`. This field is used only on output.", + "readOnly": true, + "$ref": "CitationMetadata" } } }, - "BatchStats": { + "GenerateMessageResponse": { + "id": "GenerateMessageResponse", + "description": "The response from the model. This includes candidate messages and conversation history in the form of chronologically-ordered messages.", + "type": "object", "properties": { - "requestCount": { - "format": "int64", - "type": "string", - "description": "Output only. The number of requests in the batch.", - "readOnly": true - }, - "successfulRequestCount": { - "format": "int64", - "type": "string", - "description": "Output only. The number of requests that were successfully processed.", - "readOnly": true + "candidates": { + "description": "Candidate response messages from the model.", + "type": "array", + "items": { + "$ref": "Message" + } }, - "failedRequestCount": { - "type": "string", - "description": "Output only. The number of requests that failed to be processed.", - "readOnly": true, - "format": "int64" + "messages": { + "description": "The conversation history used by the model.", + "type": "array", + "items": { + "$ref": "Message" + } }, - "pendingRequestCount": { - "format": "int64", - "description": "Output only. The number of requests that are still pending processing.", - "readOnly": true, - "type": "string" + "filters": { + "description": "A set of content filtering metadata for the prompt and response text. This indicates which `SafetyCategory`(s) blocked a candidate from this response, the lowest `HarmProbability` that triggered a block, and the HarmThreshold setting for that category.", + "type": "array", + "items": { + "$ref": "ContentFilter" + } } - }, - "type": "object", - "id": "BatchStats", - "description": "Stats about the batch." + } }, - "ToolCall": { + "ContentFilter": { + "id": "ContentFilter", + "description": "Content filtering metadata associated with processing a single request. ContentFilter contains a reason and an optional supporting string. The reason may be unspecified.", "type": "object", - "id": "ToolCall", - "description": "A predicted server-side `ToolCall` returned from the model. This message contains information about a tool that the model wants to invoke. The client is NOT expected to execute this `ToolCall`. Instead, the client should pass this `ToolCall` back to the API in a subsequent turn within a `Content` message, along with the corresponding `ToolResponse`.", "properties": { - "args": { - "description": "Optional. The tool call arguments. Example: {\"arg1\" : \"value1\", \"arg2\" : \"value2\" , ...}", - "type": "object", - "additionalProperties": { - "description": "Properties of the object.", - "type": "any" - } - }, - "id": { - "description": "Optional. Unique identifier of the tool call. The server returns the tool response with the matching `id`.", - "type": "string" - }, - "toolType": { + "reason": { + "description": "The reason content was blocked during request processing.", + "type": "string", "enumDescriptions": [ - "Unspecified tool type.", - "Google search tool, maps to Tool.google_search.search_types.web_search.", - "Image search tool, maps to Tool.google_search.search_types.image_search.", - "URL context tool, maps to Tool.url_context.", - "Google maps tool, maps to Tool.google_maps.", - "File search tool, maps to Tool.file_search." + "A blocked reason was not specified.", + "Content was blocked by safety settings.", + "Content was blocked, but the reason is uncategorized." ], "enum": [ - "TOOL_TYPE_UNSPECIFIED", - "GOOGLE_SEARCH_WEB", - "GOOGLE_SEARCH_IMAGE", - "URL_CONTEXT", - "GOOGLE_MAPS", - "FILE_SEARCH" - ], - "type": "string", - "description": "Required. The type of tool that was called." + "BLOCKED_REASON_UNSPECIFIED", + "SAFETY", + "OTHER" + ] + }, + "message": { + "description": "A string that describes the filtering behavior in more detail.", + "type": "string" } } }, - "AttributionSourceId": { + "CountMessageTokensRequest": { + "id": "CountMessageTokensRequest", + "description": "Counts the number of tokens in the `prompt` sent to a model. Models may tokenize text differently, so each model may return a different `token_count`.", + "type": "object", "properties": { - "groundingPassage": { - "$ref": "GroundingPassageId", - "description": "Identifier for an inline passage." - }, - "semanticRetrieverChunk": { - "$ref": "SemanticRetrieverChunk", - "description": "Identifier for a `Chunk` fetched via Semantic Retriever." + "prompt": { + "description": "Required. The prompt, whose token count is to be returned.", + "$ref": "MessagePrompt" } - }, + } + }, + "CountMessageTokensResponse": { + "id": "CountMessageTokensResponse", + "description": "A response from `CountMessageTokens`. It returns the model's `token_count` for the `prompt`.", "type": "object", - "id": "AttributionSourceId", - "description": "Identifier for the source contributing to this attribution." + "properties": { + "tokenCount": { + "description": "The number of tokens that the `model` tokenizes the `prompt` into. Always non-negative.", + "type": "integer", + "format": "int32" + } + } }, - "TextPrompt": { - "id": "TextPrompt", - "description": "Text given to the model as a prompt. The Model will use this TextPrompt to Generate a text completion.", + "CreateFileRequest": { + "id": "CreateFileRequest", + "description": "Request for `CreateFile`.", "type": "object", "properties": { - "text": { - "type": "string", - "description": "Required. The prompt text." + "file": { + "description": "Optional. Metadata for the file to create.", + "$ref": "File" } } }, - "TunedModel": { - "id": "TunedModel", - "description": "A fine-tuned model created using ModelService.CreateTunedModel.", + "File": { + "id": "File", + "description": "A file uploaded to the API. Next ID: 15", "type": "object", "properties": { - "temperature": { - "format": "float", - "type": "number", - "description": "Optional. Controls the randomness of the output. Values can range over `[0.0,1.0]`, inclusive. A value closer to `1.0` will produce responses that are more varied, while a value closer to `0.0` will typically result in less surprising responses from the model. This value specifies default to be the one used by the base model while creating the model." - }, - "updateTime": { - "type": "string", - "description": "Output only. The timestamp when this model was updated.", + "videoMetadata": { + "description": "Output only. Metadata for a video.", "readOnly": true, - "format": "google-datetime" - }, - "readerProjectNumbers": { - "type": "array", - "description": "Optional. List of project numbers that have read access to the tuned model.", - "items": { - "type": "string", - "format": "int64" - } - }, - "baseModel": { - "type": "string", - "description": "Immutable. The name of the `Model` to tune. Example: `models/gemini-1.5-flash-001`" + "$ref": "VideoFileMetadata" }, "name": { - "description": "Output only. The tuned model name. A unique name will be generated on create. Example: `tunedModels/az2mb0bpw6i` If display_name is set on create, the id portion of the name will be set by concatenating the words of the display_name with hyphens and adding a random portion for uniqueness. Example: * display_name = `Sentence Translator` * name = `tunedModels/sentence-translator-u3b7m`", - "readOnly": true, + "description": "Immutable. Identifier. The `File` resource name. The ID (name excluding the \"files/\" prefix) can contain up to 40 characters that are lowercase alphanumeric or dashes (-). The ID cannot start or end with a dash. If the name is empty on create, a unique name will be generated. Example: `files/123-456`", "type": "string" }, - "tunedModelSource": { - "description": "Optional. TunedModel to use as the starting point for training the new model.", - "$ref": "TunedModelSource" - }, "displayName": { - "description": "Optional. The name to display for this model in user interfaces. The display name must be up to 40 characters including spaces.", + "description": "Optional. The human-readable display name for the `File`. The display name must be no more than 512 characters in length, including spaces. Example: \"Welcome Image\"", "type": "string" }, - "topK": { - "format": "int32", - "type": "integer", - "description": "Optional. For Top-k sampling. Top-k sampling considers the set of `top_k` most probable tokens. This value specifies default to be used by the backend while making the call to the model. This value specifies default to be the one used by the base model while creating the model." + "mimeType": { + "description": "Output only. MIME type of the file.", + "readOnly": true, + "type": "string" + }, + "sizeBytes": { + "description": "Output only. Size of the file in bytes.", + "readOnly": true, + "type": "string", + "format": "int64" }, "createTime": { - "format": "google-datetime", - "description": "Output only. The timestamp when this model was created.", + "description": "Output only. The timestamp of when the `File` was created.", + "readOnly": true, + "type": "string", + "format": "google-datetime" + }, + "updateTime": { + "description": "Output only. The timestamp of when the `File` was last updated.", + "readOnly": true, + "type": "string", + "format": "google-datetime" + }, + "expirationTime": { + "description": "Output only. The timestamp of when the `File` will be deleted. Only set if the `File` is scheduled to expire.", + "readOnly": true, + "type": "string", + "format": "google-datetime" + }, + "sha256Hash": { + "description": "Output only. SHA-256 hash of the uploaded bytes.", + "readOnly": true, + "type": "string", + "format": "byte" + }, + "uri": { + "description": "Output only. The uri of the `File`.", "readOnly": true, "type": "string" }, - "tuningTask": { - "description": "Required. The tuning task that creates the tuned model.", - "$ref": "TuningTask" + "downloadUri": { + "description": "Output only. The download uri of the `File`.", + "readOnly": true, + "type": "string" }, "state": { + "description": "Output only. Processing state of the File.", + "readOnly": true, + "type": "string", + "enumDescriptions": [ + "The default value. This value is used if the state is omitted.", + "File is being processed and cannot be used for inference yet.", + "File is processed and available for inference.", + "File failed processing." + ], "enum": [ "STATE_UNSPECIFIED", - "CREATING", + "PROCESSING", "ACTIVE", "FAILED" - ], - "description": "Output only. The state of the tuned model.", + ] + }, + "source": { + "description": "Source of the File.", "type": "string", "enumDescriptions": [ - "The default value. This value is unused.", - "The model is being created.", - "The model is ready to be used.", - "The model failed to be created." + "Used if source is not specified.", + "Indicates the file is uploaded by the user.", + "Indicates the file is generated by Google.", + "Indicates the file is a registered, i.e. a Google Cloud Storage file." ], - "readOnly": true - }, - "description": { - "description": "Optional. A short description of this model.", - "type": "string" + "enum": [ + "SOURCE_UNSPECIFIED", + "UPLOADED", + "GENERATED", + "REGISTERED" + ] }, - "topP": { - "type": "number", - "description": "Optional. For Nucleus sampling. Nucleus sampling considers the smallest set of tokens whose probability sum is at least `top_p`. This value specifies default to be the one used by the base model while creating the model.", - "format": "float" + "error": { + "description": "Output only. Error status if File processing failed.", + "readOnly": true, + "$ref": "Status" } } }, - "TopCandidates": { - "id": "TopCandidates", - "description": "Candidates with top log probabilities at each decoding step.", + "VideoFileMetadata": { + "id": "VideoFileMetadata", + "description": "Metadata for a video `File`.", "type": "object", "properties": { - "candidates": { + "videoDuration": { + "description": "Duration of the video.", + "type": "string", + "format": "google-duration" + } + } + }, + "CreateFileResponse": { + "id": "CreateFileResponse", + "description": "Response for `CreateFile`.", + "type": "object", + "properties": { + "file": { + "description": "Metadata for the created file.", + "$ref": "File" + } + } + }, + "RegisterFilesRequest": { + "id": "RegisterFilesRequest", + "description": "Request for `RegisterFiles`.", + "type": "object", + "properties": { + "uris": { + "description": "Required. The Google Cloud Storage URIs to register. Example: `gs://bucket/object`.", "type": "array", - "description": "Sorted by log probability in descending order.", "items": { - "$ref": "LogprobsResultCandidate" + "type": "string" } } } }, - "Candidate": { + "RegisterFilesResponse": { + "id": "RegisterFilesResponse", + "description": "Response for `RegisterFiles`.", "type": "object", - "id": "Candidate", - "description": "A response candidate generated from the model.", "properties": { - "citationMetadata": { - "$ref": "CitationMetadata", - "description": "Output only. Citation information for model-generated candidate. This field may be populated with recitation information for any text included in the `content`. These are passages that are \"recited\" from copyrighted material in the foundational LLM's training data.", - "readOnly": true - }, - "groundingAttributions": { + "files": { + "description": "The registered files to be used when calling GenerateContent.", "type": "array", - "description": "Output only. Attribution information for sources that contributed to a grounded answer. This field is populated for `GenerateAnswer` calls.", - "readOnly": true, "items": { - "$ref": "GroundingAttribution" + "$ref": "File" + } + } + } + }, + "ListFilesResponse": { + "id": "ListFilesResponse", + "description": "Response for `ListFiles`.", + "type": "object", + "properties": { + "files": { + "description": "The list of `File`s.", + "type": "array", + "items": { + "$ref": "File" } }, - "finishReason": { + "nextPageToken": { + "description": "A token that can be sent as a `page_token` into a subsequent `ListFiles` call.", + "type": "string" + } + } + }, + "DownloadFileResponse": { + "id": "DownloadFileResponse", + "description": "Response for `DownloadFile`.", + "type": "object", + "properties": {} + }, + "GeneratedFile": { + "id": "GeneratedFile", + "description": "A file generated on behalf of a user.", + "type": "object", + "properties": { + "name": { + "description": "Identifier. The name of the generated file. Example: `generatedFiles/abc-123`", + "type": "string" + }, + "mimeType": { + "description": "MIME type of the generatedFile.", + "type": "string" + }, + "state": { + "description": "Output only. The state of the GeneratedFile.", "readOnly": true, + "type": "string", "enumDescriptions": [ - "Default value. This value is unused.", - "Natural stop point of the model or provided stop sequence.", - "The maximum number of tokens as specified in the request was reached.", - "The response candidate content was flagged for safety reasons.", - "The response candidate content was flagged for recitation reasons.", - "The response candidate content was flagged for using an unsupported language.", - "Unknown reason.", - "Token generation stopped because the content contains forbidden terms.", - "Token generation stopped for potentially containing prohibited content.", - "Token generation stopped because the content potentially contains Sensitive Personally Identifiable Information (SPII).", - "The function call generated by the model is invalid.", - "Token generation stopped because generated images contain safety violations.", - "Image generation stopped because generated images has other prohibited content.", - "Image generation stopped because of other miscellaneous issue.", - "The model was expected to generate an image, but none was generated.", - "Image generation stopped due to recitation.", - "Model generated a tool call but no tools were enabled in the request.", - "Model called too many tools consecutively, thus the system exited execution.", - "Request has at least one thought signature missing.", - "Finished due to malformed response." + "The default value. This value is used if the state is omitted.", + "Being generated.", + "Generated and is ready for download.", + "Failed to generate the GeneratedFile." ], - "type": "string", - "description": "Optional. Output only. The reason why the model stopped generating tokens. If empty, the model has not stopped generating tokens.", "enum": [ - "FINISH_REASON_UNSPECIFIED", - "STOP", - "MAX_TOKENS", - "SAFETY", - "RECITATION", - "LANGUAGE", - "OTHER", - "BLOCKLIST", - "PROHIBITED_CONTENT", - "SPII", - "MALFORMED_FUNCTION_CALL", - "IMAGE_SAFETY", - "IMAGE_PROHIBITED_CONTENT", - "IMAGE_OTHER", - "NO_IMAGE", - "IMAGE_RECITATION", - "UNEXPECTED_TOOL_CALL", - "TOO_MANY_TOOL_CALLS", - "MISSING_THOUGHT_SIGNATURE", - "MALFORMED_RESPONSE" + "STATE_UNSPECIFIED", + "GENERATING", + "GENERATED", + "FAILED" ] }, - "safetyRatings": { - "description": "List of ratings for the safety of a response candidate. There is at most one rating per category.", + "error": { + "description": "Error details if the GeneratedFile ends up in the STATE_FAILED state.", + "$ref": "Status" + } + } + }, + "ListGeneratedFilesResponse": { + "id": "ListGeneratedFilesResponse", + "description": "Response for `ListGeneratedFiles`.", + "type": "object", + "properties": { + "generatedFiles": { + "description": "The list of `GeneratedFile`s.", + "type": "array", "items": { - "$ref": "SafetyRating" - }, - "type": "array" + "$ref": "GeneratedFile" + } }, - "logprobsResult": { - "description": "Output only. Log-likelihood scores for the response tokens and top tokens", - "readOnly": true, - "$ref": "LogprobsResult" + "nextPageToken": { + "description": "A token that can be sent as a `page_token` into a subsequent `ListGeneratedFiles` call.", + "type": "string" + } + } + }, + "Model": { + "id": "Model", + "description": "Information about a Generative Language Model.", + "type": "object", + "properties": { + "name": { + "description": "Required. The resource name of the `Model`. Refer to [Model variants](https://ai.google.dev/gemini-api/docs/models/gemini#model-variations) for all allowed values. Format: `models/{model}` with a `{model}` naming convention of: * \"{base_model_id}-{version}\" Examples: * `models/gemini-1.5-flash-001`", + "type": "string" }, - "tokenCount": { - "description": "Output only. Token count for this candidate.", - "readOnly": true, - "type": "integer", - "format": "int32" + "baseModelId": { + "description": "Required. The name of the base model, pass this to the generation request. Examples: * `gemini-1.5-flash`", + "type": "string" }, - "content": { - "description": "Output only. Generated content returned from the model.", - "readOnly": true, - "$ref": "Content" + "version": { + "description": "Required. The version number of the model. This represents the major version (`1.0` or `1.5`)", + "type": "string" }, - "avgLogprobs": { - "type": "number", - "description": "Output only. Average log probability score of the candidate.", - "readOnly": true, - "format": "double" + "displayName": { + "description": "The human-readable name of the model. E.g. \"Gemini 1.5 Flash\". The name can be up to 128 characters long and can consist of any UTF-8 characters.", + "type": "string" }, - "finishMessage": { - "type": "string", - "description": "Optional. Output only. Details the reason why the model stopped generating tokens. This is populated only when `finish_reason` is set.", - "readOnly": true + "description": { + "description": "A short description of the model.", + "type": "string" }, - "groundingMetadata": { - "description": "Output only. Grounding metadata for the candidate. This field is populated for `GenerateContent` calls.", - "readOnly": true, - "$ref": "GroundingMetadata" + "inputTokenLimit": { + "description": "Maximum number of input tokens allowed for this model.", + "type": "integer", + "format": "int32" }, - "index": { - "format": "int32", - "description": "Output only. Index of the candidate in the list of response candidates.", - "readOnly": true, - "type": "integer" + "outputTokenLimit": { + "description": "Maximum number of output tokens available for this model.", + "type": "integer", + "format": "int32" }, - "urlContextMetadata": { - "description": "Output only. Metadata related to url context retrieval tool.", - "readOnly": true, - "$ref": "UrlContextMetadata" - } - } - }, - "EmbedContentConfig": { - "id": "EmbedContentConfig", - "description": "Configurations for the EmbedContent request.", - "type": "object", - "properties": { - "title": { - "type": "string", - "description": "Optional. The title for the text." + "supportedGenerationMethods": { + "description": "The model's supported generation methods. The corresponding API method names are defined as Pascal case strings, such as `generateMessage` and `generateContent`.", + "type": "array", + "items": { + "type": "string" + } }, - "taskType": { - "description": "Optional. The task type of the embedding.", - "type": "string", - "enumDescriptions": [ - "Unset value, which will default to one of the other enum values.", - "Specifies the given text is a query in a search/retrieval setting.", - "Specifies the given text is a document from the corpus being searched.", - "Specifies the given text will be used for STS.", - "Specifies that the given text will be classified.", - "Specifies that the embeddings will be used for clustering.", - "Specifies that the given text will be used for question answering.", - "Specifies that the given text will be used for fact verification.", - "Specifies that the given text will be used for code retrieval." - ], - "enum": [ - "TASK_TYPE_UNSPECIFIED", - "RETRIEVAL_QUERY", - "RETRIEVAL_DOCUMENT", - "SEMANTIC_SIMILARITY", - "CLASSIFICATION", - "CLUSTERING", - "QUESTION_ANSWERING", - "FACT_VERIFICATION", - "CODE_RETRIEVAL_QUERY" - ] + "temperature": { + "description": "Controls the randomness of the output. Values can range over `[0.0,max_temperature]`, inclusive. A higher value will produce responses that are more varied, while a value closer to `0.0` will typically result in less surprising responses from the model. This value specifies default to be used by the backend while making the call to the model.", + "type": "number", + "format": "float" }, - "autoTruncate": { - "type": "boolean", - "description": "Optional. Whether to silently truncate the input content if it's longer than the maximum sequence length." + "maxTemperature": { + "description": "The maximum temperature this model can use.", + "type": "number", + "format": "float" }, - "outputDimensionality": { - "format": "int32", - "type": "integer", - "description": "Optional. Reduced dimension for the output embedding. If set, excessive values in the output embedding are truncated from the end." + "topP": { + "description": "For [Nucleus sampling](https://ai.google.dev/gemini-api/docs/prompting-strategies#top-p). Nucleus sampling considers the smallest set of tokens whose probability sum is at least `top_p`. This value specifies default to be used by the backend while making the call to the model.", + "type": "number", + "format": "float" }, - "documentOcr": { - "description": "Optional. Whether to enable OCR for document content.", - "type": "boolean" + "topK": { + "description": "For Top-k sampling. Top-k sampling considers the set of `top_k` most probable tokens. This value specifies default to be used by the backend while making the call to the model. If empty, indicates the model doesn't use top-k sampling, and `top_k` isn't allowed as a generation parameter.", + "type": "integer", + "format": "int32" }, - "audioTrackExtraction": { - "description": "Optional. Whether to extract audio from video content.", + "thinking": { + "description": "Whether the model supports thinking.", "type": "boolean" } } }, - "PrebuiltVoiceConfig": { + "ListModelsResponse": { + "id": "ListModelsResponse", + "description": "Response from `ListModel` containing a paginated list of Models.", + "type": "object", "properties": { - "voiceName": { - "description": "The name of the preset voice to use.", + "models": { + "description": "The returned Models.", + "type": "array", + "items": { + "$ref": "Model" + } + }, + "nextPageToken": { + "description": "A token, which can be sent as `page_token` to retrieve the next page. If this field is omitted, there are no more pages.", "type": "string" } - }, - "id": "PrebuiltVoiceConfig", - "description": "The configuration for the prebuilt speaker to use.", - "type": "object" + } }, - "GoogleAiGenerativelanguageV1betaSegment": { - "id": "GoogleAiGenerativelanguageV1betaSegment", - "description": "Segment of the content.", + "TunedModel": { + "id": "TunedModel", + "description": "A fine-tuned model created using ModelService.CreateTunedModel.", "type": "object", "properties": { - "startIndex": { - "format": "int32", - "type": "integer", - "description": "Start index in the given Part, measured in bytes. Offset from the start of the Part, inclusive, starting at zero." + "tunedModelSource": { + "description": "Optional. TunedModel to use as the starting point for training the new model.", + "$ref": "TunedModelSource" }, - "endIndex": { - "description": "End index in the given Part, measured in bytes. Offset from the start of the Part, exclusive, starting at zero.", + "baseModel": { + "description": "Immutable. The name of the `Model` to tune. Example: `models/gemini-1.5-flash-001`", + "type": "string" + }, + "name": { + "description": "Output only. The tuned model name. A unique name will be generated on create. Example: `tunedModels/az2mb0bpw6i` If display_name is set on create, the id portion of the name will be set by concatenating the words of the display_name with hyphens and adding a random portion for uniqueness. Example: * display_name = `Sentence Translator` * name = `tunedModels/sentence-translator-u3b7m`", + "readOnly": true, + "type": "string" + }, + "displayName": { + "description": "Optional. The name to display for this model in user interfaces. The display name must be up to 40 characters including spaces.", + "type": "string" + }, + "description": { + "description": "Optional. A short description of this model.", + "type": "string" + }, + "temperature": { + "description": "Optional. Controls the randomness of the output. Values can range over `[0.0,1.0]`, inclusive. A value closer to `1.0` will produce responses that are more varied, while a value closer to `0.0` will typically result in less surprising responses from the model. This value specifies default to be the one used by the base model while creating the model.", + "type": "number", + "format": "float" + }, + "topP": { + "description": "Optional. For Nucleus sampling. Nucleus sampling considers the smallest set of tokens whose probability sum is at least `top_p`. This value specifies default to be the one used by the base model while creating the model.", + "type": "number", + "format": "float" + }, + "topK": { + "description": "Optional. For Top-k sampling. Top-k sampling considers the set of `top_k` most probable tokens. This value specifies default to be used by the backend while making the call to the model. This value specifies default to be the one used by the base model while creating the model.", "type": "integer", "format": "int32" }, - "partIndex": { - "format": "int32", - "type": "integer", - "description": "The index of a Part object within its parent Content object." + "state": { + "description": "Output only. The state of the tuned model.", + "readOnly": true, + "type": "string", + "enumDescriptions": [ + "The default value. This value is unused.", + "The model is being created.", + "The model is ready to be used.", + "The model failed to be created." + ], + "enum": [ + "STATE_UNSPECIFIED", + "CREATING", + "ACTIVE", + "FAILED" + ] }, - "text": { + "createTime": { + "description": "Output only. The timestamp when this model was created.", + "readOnly": true, + "type": "string", + "format": "google-datetime" + }, + "updateTime": { + "description": "Output only. The timestamp when this model was updated.", + "readOnly": true, "type": "string", - "description": "The text corresponding to the segment from the response." + "format": "google-datetime" + }, + "tuningTask": { + "description": "Required. The tuning task that creates the tuned model.", + "$ref": "TuningTask" + }, + "readerProjectNumbers": { + "description": "Optional. List of project numbers that have read access to the tuned model.", + "type": "array", + "items": { + "type": "string", + "format": "int64" + } } } }, - "Interval": { + "TunedModelSource": { + "id": "TunedModelSource", + "description": "Tuned model as a source for training a new model.", "type": "object", - "id": "Interval", - "description": "Represents a time interval, encoded as a Timestamp start (inclusive) and a Timestamp end (exclusive). The start must be less than or equal to the end. When the start equals the end, the interval is empty (matches no time). When both start and end are unspecified, the interval matches any time.", "properties": { - "startTime": { - "description": "Optional. Inclusive start of the interval. If specified, a Timestamp matching this interval will have to be the same or after the start.", - "type": "string", - "format": "google-datetime" + "tunedModel": { + "description": "Immutable. The name of the `TunedModel` to use as the starting point for training the new model. Example: `tunedModels/my-tuned-model`", + "type": "string" }, - "endTime": { - "format": "google-datetime", - "description": "Optional. Exclusive end of the interval. If specified, a Timestamp matching this interval will have to be before the end.", + "baseModel": { + "description": "Output only. The name of the base `Model` this `TunedModel` was tuned from. Example: `models/gemini-1.5-flash-001`", + "readOnly": true, "type": "string" } } }, - "ImageConfig": { + "TuningTask": { + "id": "TuningTask", + "description": "Tuning tasks that create tuned models.", + "type": "object", "properties": { - "aspectRatio": { + "startTime": { + "description": "Output only. The timestamp when tuning this model started.", + "readOnly": true, "type": "string", - "description": "Optional. The aspect ratio of the image to generate. Supported aspect ratios: `1:1`, `1:4`, `4:1`, `1:8`, `8:1`, `2:3`, `3:2`, `3:4`, `4:3`, `4:5`, `5:4`, `9:16`, `16:9`, or `21:9`. If not specified, the model will choose a default aspect ratio based on any reference images provided." + "format": "google-datetime" }, - "imageSize": { - "description": "Optional. Specifies the size of generated images. Supported values are `512`, `1K`, `2K`, `4K`. If not specified, the model will use default value `1K`.", - "type": "string" - } - }, - "id": "ImageConfig", - "description": "Config for image generation features.", - "type": "object" - }, - "FunctionCallingConfig": { - "properties": { - "mode": { - "enumDescriptions": [ - "Unspecified function calling mode. This value should not be used.", - "Default model behavior, model decides to predict either a function call or a natural language response.", - "Model is constrained to always predicting a function call only. If \"allowed_function_names\" are set, the predicted function call will be limited to any one of \"allowed_function_names\", else the predicted function call will be any one of the provided \"function_declarations\".", - "Model will not predict any function call. Model behavior is same as when not passing any function declarations.", - "Model decides to predict either a function call or a natural language response, but will validate function calls with constrained decoding. If \"allowed_function_names\" are set, the predicted function call will be limited to any one of \"allowed_function_names\", else the predicted function call will be any one of the provided \"function_declarations\"." - ], - "enum": [ - "MODE_UNSPECIFIED", - "AUTO", - "ANY", - "NONE", - "VALIDATED" - ], - "description": "Optional. Specifies the mode in which function calling should execute. If unspecified, the default value will be set to AUTO.", - "type": "string" + "completeTime": { + "description": "Output only. The timestamp when tuning this model completed.", + "readOnly": true, + "type": "string", + "format": "google-datetime" }, - "allowedFunctionNames": { - "description": "Optional. A set of function names that, when provided, limits the functions the model will call. This should only be set when the Mode is ANY or VALIDATED. Function names should match [FunctionDeclaration.name]. When set, model will predict a function call from only allowed function names.", + "snapshots": { + "description": "Output only. Metrics collected during tuning.", + "readOnly": true, + "type": "array", "items": { - "type": "string" - }, - "type": "array" - } - }, - "id": "FunctionCallingConfig", - "description": "Configuration for specifying function calling behavior.", - "type": "object" - }, - "ToolConfig": { - "id": "ToolConfig", - "description": "The Tool configuration containing parameters for specifying `Tool` use in the request.", - "type": "object", - "properties": { - "includeServerSideToolInvocations": { - "type": "boolean", - "description": "Optional. If true, the API response will include the server-side tool calls and responses within the `Content` message. This allows clients to observe the server's tool interactions." + "$ref": "TuningSnapshot" + } }, - "retrievalConfig": { - "description": "Optional. Retrieval config.", - "$ref": "RetrievalConfig" + "trainingData": { + "description": "Required. Input only. Immutable. The model training data.", + "$ref": "Dataset" }, - "functionCallingConfig": { - "$ref": "FunctionCallingConfig", - "description": "Optional. Function calling config." + "hyperparameters": { + "description": "Immutable. Hyperparameters controlling the tuning process. If not provided, default values will be used.", + "$ref": "Hyperparameters" } } }, - "ModelStatus": { - "id": "ModelStatus", - "description": "The status of the underlying model. This is used to indicate the stage of the underlying model and the retirement time if applicable.", + "TuningSnapshot": { + "id": "TuningSnapshot", + "description": "Record for a single tuning step.", "type": "object", "properties": { - "modelStage": { - "enumDescriptions": [ - "Unspecified model stage.", - "The underlying model is subject to lots of tunings.", - "Models in this stage are for experimental purposes only.", - "Models in this stage are more mature than experimental models.", - "Models in this stage are considered stable and ready for production use.", - "If the model is on this stage, it means that this model is on the path to deprecation in near future. Only existing customers can use this model.", - "Models in this stage are deprecated. These models cannot be used.", - "Models in this stage are retired. These models cannot be used." - ], - "enumDeprecated": [ - false, - true, - false, - false, - false, - false, - true, - false - ], - "enum": [ - "MODEL_STAGE_UNSPECIFIED", - "UNSTABLE_EXPERIMENTAL", - "EXPERIMENTAL", - "PREVIEW", - "STABLE", - "LEGACY", - "DEPRECATED", - "RETIRED" - ], - "type": "string", - "description": "The stage of the underlying model." + "step": { + "description": "Output only. The tuning step.", + "readOnly": true, + "type": "integer", + "format": "int32" }, - "retirementTime": { - "type": "string", - "description": "The time at which the model will be retired.", - "format": "google-datetime" + "epoch": { + "description": "Output only. The epoch this step was part of.", + "readOnly": true, + "type": "integer", + "format": "int32" }, - "message": { + "meanLoss": { + "description": "Output only. The mean loss of the training examples for this step.", + "readOnly": true, + "type": "number", + "format": "float" + }, + "computeTime": { + "description": "Output only. The timestamp when this metric was computed.", + "readOnly": true, "type": "string", - "description": "A message explaining the model status." + "format": "google-datetime" } } }, - "CustomLongRunningOperation": { - "id": "CustomLongRunningOperation", + "Dataset": { + "id": "Dataset", + "description": "Dataset for training or validation.", "type": "object", "properties": { - "error": { - "$ref": "Status", - "description": "The error result of the operation in case of failure or cancellation." - }, - "response": { - "additionalProperties": { - "description": "Properties of the object. Contains field @type with type URL.", - "type": "any" - }, - "description": "The normal, successful response of the operation. If the original method returns no data on success, such as `Delete`, the response is `google.protobuf.Empty`. If the original method is standard `Get`/`Create`/`Update`, the response should be the resource. For other methods, the response should have the type `XxxResponse`, where `Xxx` is the original method name. For example, if the original method name is `TakeSnapshot()`, the inferred response type is `TakeSnapshotResponse`.", - "type": "object" - }, - "name": { - "type": "string", - "description": "The server-assigned name, which is only unique within the same service that originally returns it. If you use the default HTTP mapping, the `name` should be a resource name ending with `operations/{unique_id}`." - }, - "metadata": { - "description": "Service-specific metadata associated with the operation. It typically contains progress information and common metadata such as create time. Some services might not provide such metadata. Any method that returns a long-running operation should document the metadata type, if any.", - "type": "object", - "additionalProperties": { - "description": "Properties of the object. Contains field @type with type URL.", - "type": "any" - } - }, - "done": { - "description": "If the value is `false`, it means the operation is still in progress. If `true`, the operation is completed, and either `error` or `response` is available.", - "type": "boolean" + "examples": { + "description": "Optional. Inline examples with simple input/output text.", + "$ref": "TuningExamples" } } }, - "Dataset": { + "TuningExamples": { + "id": "TuningExamples", + "description": "A set of tuning examples. Can be training or validation data.", "type": "object", - "id": "Dataset", - "description": "Dataset for training or validation.", "properties": { "examples": { - "$ref": "TuningExamples", - "description": "Optional. Inline examples with simple input/output text." + "description": "The examples. Example input can be for text or discuss, but all examples in a set must be of the same type.", + "type": "array", + "items": { + "$ref": "TuningExample" + } } } }, - "FileData": { + "TuningExample": { + "id": "TuningExample", + "description": "A single example for tuning.", + "type": "object", "properties": { - "mimeType": { - "type": "string", - "description": "Optional. The IANA standard MIME type of the source data." + "textInput": { + "description": "Optional. Text model input.", + "type": "string" }, - "fileUri": { - "type": "string", - "description": "Required. URI." + "output": { + "description": "Required. The expected model output.", + "type": "string" } - }, - "type": "object", - "id": "FileData", - "description": "URI based data." + } }, - "GenerateMessageRequest": { + "Hyperparameters": { + "id": "Hyperparameters", + "description": "Hyperparameters controlling the tuning process. Read more at https://ai.google.dev/docs/model_tuning_guidance", "type": "object", - "id": "GenerateMessageRequest", - "description": "Request to generate a message response from the model.", "properties": { - "topP": { - "format": "float", + "learningRate": { + "description": "Optional. Immutable. The learning rate hyperparameter for tuning. If not set, a default of 0.001 or 0.0002 will be calculated based on the number of training examples.", "type": "number", - "description": "Optional. The maximum cumulative probability of tokens to consider when sampling. The model uses combined Top-k and nucleus sampling. Nucleus sampling considers the smallest set of tokens whose probability sum is at least `top_p`." + "format": "float" }, - "prompt": { - "description": "Required. The structured textual input given to the model as a prompt. Given a prompt, the model will return what it predicts is the next message in the discussion.", - "$ref": "MessagePrompt" + "learningRateMultiplier": { + "description": "Optional. Immutable. The learning rate multiplier is used to calculate a final learning_rate based on the default (recommended) value. Actual learning rate := learning_rate_multiplier * default learning rate Default learning rate is dependent on base model and dataset size. If not set, a default of 1.0 will be used.", + "type": "number", + "format": "float" }, - "topK": { - "description": "Optional. The maximum number of tokens to consider when sampling. The model uses combined Top-k and nucleus sampling. Top-k sampling considers the set of `top_k` most probable tokens.", + "epochCount": { + "description": "Immutable. The number of training epochs. An epoch is one pass through the training data. If not set, a default of 5 will be used.", "type": "integer", "format": "int32" }, - "temperature": { - "description": "Optional. Controls the randomness of the output. Values can range over `[0.0,1.0]`, inclusive. A value closer to `1.0` will produce responses that are more varied, while a value closer to `0.0` will typically result in less surprising responses from the model.", - "type": "number", - "format": "float" + "batchSize": { + "description": "Immutable. The batch size hyperparameter for tuning. If not set, a default of 4 or 16 will be used based on the number of training examples.", + "type": "integer", + "format": "int32" + } + } + }, + "ListTunedModelsResponse": { + "id": "ListTunedModelsResponse", + "description": "Response from `ListTunedModels` containing a paginated list of Models.", + "type": "object", + "properties": { + "tunedModels": { + "description": "The returned Models.", + "type": "array", + "items": { + "$ref": "TunedModel" + } }, - "candidateCount": { - "format": "int32", - "description": "Optional. The number of generated response messages to return. This value must be between `[1, 8]`, inclusive. If unset, this will default to `1`.", - "type": "integer" + "nextPageToken": { + "description": "A token, which can be sent as `page_token` to retrieve the next page. If this field is omitted, there are no more pages.", + "type": "string" } } }, - "CompositeMedia": { - "id": "CompositeMedia", - "description": "A sequence of media data references representing composite data. Introduced to support Bigstore composite objects. For details, visit http://go/bigstore-composites.", + "Permission": { + "id": "Permission", + "description": "Permission resource grants user, group or the rest of the world access to the PaLM API resource (e.g. a tuned model, corpus). A role is a collection of permitted operations that allows users to perform specific actions on PaLM API resources. To make them available to users, groups, or service accounts, you assign roles. When you assign a role, you grant permissions that the role contains. There are three concentric roles. Each role is a superset of the previous role's permitted operations: - reader can use the resource (e.g. tuned model, corpus) for inference - writer has reader's permissions and additionally can edit and share - owner has writer's permissions and additionally can delete", "type": "object", "properties": { - "length": { - "format": "int64", - "description": "Size of the data, in bytes", + "name": { + "description": "Output only. Identifier. The permission name. A unique name will be generated on create. Examples: tunedModels/{tuned_model}/permissions/{permission} corpora/{corpus}/permissions/{permission} Output only.", + "readOnly": true, "type": "string" }, - "blobRef": { + "granteeType": { + "description": "Optional. Immutable. The type of the grantee.", "type": "string", - "description": "Blobstore v1 reference, set if reference_type is BLOBSTORE_REF This should be the byte representation of a blobstore.BlobRef. Since Blobstore is deprecating v1, use blobstore2_info instead. For now, any v2 blob will also be represented in this field as v1 BlobRef.", - "deprecated": true, - "format": "byte" + "enumDescriptions": [ + "The default value. This value is unused.", + "Represents a user. When set, you must provide email_address for the user.", + "Represents a group. When set, you must provide email_address for the group.", + "Represents access to everyone. No extra information is required." + ], + "enum": [ + "GRANTEE_TYPE_UNSPECIFIED", + "USER", + "GROUP", + "EVERYONE" + ] }, - "inline": { - "format": "byte", - "type": "string", - "description": "Media data, set if reference_type is INLINE" - }, - "crc32cHash": { - "format": "uint32", - "type": "integer", - "description": "crc32.c hash for the payload." - }, - "path": { - "type": "string", - "description": "Path to the data, set if reference_type is PATH" - }, - "blobstore2Info": { - "$ref": "Blobstore2Info", - "description": "Blobstore v2 info, set if reference_type is BLOBSTORE_REF and it refers to a v2 blob." - }, - "sha1Hash": { - "description": "SHA-1 hash for the payload.", - "type": "string", - "format": "byte" - }, - "cosmoBinaryReference": { - "format": "byte", - "description": "A binary data reference for a media download. Serves as a technology-agnostic binary reference in some Google infrastructure. This value is a serialized storage_cosmo.BinaryReference proto. Storing it as bytes is a hack to get around the fact that the cosmo proto (as well as others it includes) doesn't support JavaScript. This prevents us from including the actual type of this field.", + "emailAddress": { + "description": "Optional. Immutable. The email address of the user of group which this permission refers. Field is not set when permission's grantee type is EVERYONE.", "type": "string" }, - "md5Hash": { - "type": "string", - "description": "MD5 hash for the payload.", - "format": "byte" - }, - "referenceType": { + "role": { + "description": "Required. The role granted by this permission.", "type": "string", - "description": "Describes what the field reference contains.", "enumDescriptions": [ - "Reference contains a GFS path or a local path.", - "Reference points to a blobstore object. This could be either a v1 blob_ref or a v2 blobstore2_info. Clients should check blobstore2_info first, since v1 is being deprecated.", - "Data is included into this proto buffer", - "Reference points to a bigstore object", - "Indicates the data is stored in cosmo_binary_reference." + "The default value. This value is unused.", + "Owner can use, update, share and delete the resource.", + "Writer can use, update and share the resource.", + "Reader can use the resource." ], "enum": [ - "PATH", - "BLOB_REF", - "INLINE", - "BIGSTORE_REF", - "COSMO_BINARY_REFERENCE" + "ROLE_UNSPECIFIED", + "OWNER", + "WRITER", + "READER" ] - }, - "objectId": { - "$ref": "ObjectId", - "description": "Reference to a TI Blob, set if reference_type is BIGSTORE_REF." } } }, - "ListDocumentsResponse": { + "ListPermissionsResponse": { + "id": "ListPermissionsResponse", + "description": "Response from `ListPermissions` containing a paginated list of permissions.", "type": "object", - "id": "ListDocumentsResponse", - "description": "Response from `ListDocuments` containing a paginated list of `Document`s. The `Document`s are sorted by ascending `document.create_time`.", "properties": { - "documents": { + "permissions": { + "description": "Returned permissions.", "type": "array", - "description": "The returned `Document`s.", "items": { - "$ref": "Document" + "$ref": "Permission" } }, "nextPageToken": { @@ -6274,1280 +4416,3350 @@ } } }, - "InlinedEmbedContentResponses": { - "id": "InlinedEmbedContentResponses", - "description": "The responses to the requests in the batch.", + "TransferOwnershipRequest": { + "id": "TransferOwnershipRequest", + "description": "Request to transfer the ownership of the tuned model.", "type": "object", "properties": { - "inlinedResponses": { - "description": "Output only. The responses to the requests in the batch.", - "readOnly": true, - "items": { - "$ref": "InlinedEmbedContentResponse" - }, - "type": "array" + "emailAddress": { + "description": "Required. The email address of the user to whom the tuned model is being transferred to.", + "type": "string" } } }, - "GeneratedFile": { + "TransferOwnershipResponse": { + "id": "TransferOwnershipResponse", + "description": "Response from `TransferOwnership`.", + "type": "object", + "properties": {} + }, + "PredictRequest": { + "id": "PredictRequest", + "description": "Request message for PredictionService.Predict.", + "type": "object", "properties": { - "mimeType": { - "description": "MIME type of the generatedFile.", - "type": "string" - }, - "state": { - "enumDescriptions": [ - "The default value. This value is used if the state is omitted.", - "Being generated.", - "Generated and is ready for download.", - "Failed to generate the GeneratedFile." - ], - "readOnly": true, - "enum": [ - "STATE_UNSPECIFIED", - "GENERATING", - "GENERATED", - "FAILED" - ], - "description": "Output only. The state of the GeneratedFile.", - "type": "string" - }, - "name": { - "description": "Identifier. The name of the generated file. Example: `generatedFiles/abc-123`", - "type": "string" + "instances": { + "description": "Required. The instances that are the input to the prediction call.", + "type": "array", + "items": { + "type": "any" + } }, - "error": { - "$ref": "Status", - "description": "Error details if the GeneratedFile ends up in the STATE_FAILED state." + "parameters": { + "description": "Optional. The parameters that govern the prediction call.", + "type": "any" } - }, - "id": "GeneratedFile", - "description": "A file generated on behalf of a user.", - "type": "object" + } }, - "ImportFileRequest": { - "id": "ImportFileRequest", - "description": "Request for `ImportFile` to import a File API file with a `FileSearchStore`.", + "PredictResponse": { + "id": "PredictResponse", + "description": "Response message for [PredictionService.Predict].", "type": "object", "properties": { - "customMetadata": { - "description": "Custom metadata to be associated with the file.", + "predictions": { + "description": "The outputs of the prediction call.", + "type": "array", "items": { - "$ref": "CustomMetadata" - }, - "type": "array" - }, - "chunkingConfig": { - "$ref": "ChunkingConfig", - "description": "Optional. Config for telling the service how to chunk the file. If not provided, the service will use default parameters." - }, - "fileName": { - "description": "Required. The name of the `File` to import. Example: `files/abc-123`", - "type": "string" + "type": "any" + } } } }, - "Embedding": { + "PredictLongRunningRequest": { + "id": "PredictLongRunningRequest", + "description": "Request message for [PredictionService.PredictLongRunning].", + "type": "object", "properties": { - "value": { - "description": "The embedding values.", + "instances": { + "description": "Required. The instances that are the input to the prediction call.", + "type": "array", "items": { - "format": "float", - "type": "number" - }, - "type": "array" + "type": "any" + } + }, + "parameters": { + "description": "Optional. The parameters that govern the prediction call.", + "type": "any" } - }, - "type": "object", - "id": "Embedding", - "description": "A list of floats representing the embedding." + } }, - "Permission": { + "FileSearchStore": { + "id": "FileSearchStore", + "description": "A `FileSearchStore` is a collection of `Document`s.", + "type": "object", "properties": { - "granteeType": { - "enumDescriptions": [ - "The default value. This value is unused.", - "Represents a user. When set, you must provide email_address for the user.", - "Represents a group. When set, you must provide email_address for the group.", - "Represents access to everyone. No extra information is required." - ], - "enum": [ - "GRANTEE_TYPE_UNSPECIFIED", - "USER", - "GROUP", - "EVERYONE" - ], - "type": "string", - "description": "Optional. Immutable. The type of the grantee." - }, "name": { - "description": "Output only. Identifier. The permission name. A unique name will be generated on create. Examples: tunedModels/{tuned_model}/permissions/{permission} corpora/{corpus}/permissions/{permission} Output only.", + "description": "Output only. Immutable. Identifier. The `FileSearchStore` resource name. It is an ID (name excluding the \"fileSearchStores/\" prefix) that can contain up to 40 characters that are lowercase alphanumeric or dashes (-). It is output only. The unique name will be derived from `display_name` along with a 12 character random suffix. Example: `fileSearchStores/my-awesome-file-search-store-123a456b789c` If `display_name` is not provided, the name will be randomly generated.", "readOnly": true, "type": "string" }, - "emailAddress": { - "description": "Optional. Immutable. The email address of the user of group which this permission refers. Field is not set when permission's grantee type is EVERYONE.", - "type": "string" - }, - "role": { - "enumDescriptions": [ - "The default value. This value is unused.", - "Owner can use, update, share and delete the resource.", - "Writer can use, update and share the resource.", - "Reader can use the resource." - ], - "enum": [ - "ROLE_UNSPECIFIED", - "OWNER", - "WRITER", - "READER" - ], - "description": "Required. The role granted by this permission.", + "displayName": { + "description": "Optional. The human-readable display name for the `FileSearchStore`. The display name must be no more than 512 characters in length, including spaces. Example: \"Docs on Semantic Retriever\"", "type": "string" - } - }, - "type": "object", - "id": "Permission", - "description": "Permission resource grants user, group or the rest of the world access to the PaLM API resource (e.g. a tuned model, corpus). A role is a collection of permitted operations that allows users to perform specific actions on PaLM API resources. To make them available to users, groups, or service accounts, you assign roles. When you assign a role, you grant permissions that the role contains. There are three concentric roles. Each role is a superset of the previous role's permitted operations: - reader can use the resource (e.g. tuned model, corpus) for inference - writer has reader's permissions and additionally can edit and share - owner has writer's permissions and additionally can delete" - }, - "RetrievalMetadata": { - "properties": { - "googleSearchDynamicRetrievalScore": { - "type": "number", - "description": "Optional. Score indicating how likely information from google search could help answer the prompt. The score is in the range [0, 1], where 0 is the least likely and 1 is the most likely. This score is only populated when google search grounding and dynamic retrieval is enabled. It will be compared to the threshold to determine whether to trigger google search.", - "format": "float" - } - }, - "id": "RetrievalMetadata", - "description": "Metadata related to retrieval in the grounding flow.", - "type": "object" - }, - "Corpus": { - "properties": { - "name": { - "type": "string", - "description": "Output only. Immutable. Identifier. The `Corpus` resource name. The ID (name excluding the \"corpora/\" prefix) can contain up to 40 characters that are lowercase alphanumeric or dashes (-). The ID cannot start or end with a dash. If the name is empty on create, a unique name will be derived from `display_name` along with a 12 character random suffix. Example: `corpora/my-awesome-corpora-123a456b789c`", - "readOnly": true }, "createTime": { - "format": "google-datetime", + "description": "Output only. The Timestamp of when the `FileSearchStore` was created.", + "readOnly": true, "type": "string", - "description": "Output only. The Timestamp of when the `Corpus` was created.", - "readOnly": true - }, - "displayName": { - "description": "Optional. The human-readable display name for the `Corpus`. The display name must be no more than 512 characters in length, including spaces. Example: \"Docs on Semantic Retriever\"", - "type": "string" + "format": "google-datetime" }, "updateTime": { - "format": "google-datetime", + "description": "Output only. The Timestamp of when the `FileSearchStore` was last updated.", + "readOnly": true, "type": "string", - "description": "Output only. The Timestamp of when the `Corpus` was last updated.", - "readOnly": true - } - }, - "type": "object", - "id": "Corpus", - "description": "A `Corpus` is a collection of `Document`s. A project can create up to 10 corpora." - }, - "InlinedResponse": { - "properties": { - "response": { - "$ref": "GenerateContentResponse", - "description": "Output only. The response to the request.", - "readOnly": true + "format": "google-datetime" }, - "metadata": { - "additionalProperties": { - "type": "any", - "description": "Properties of the object." - }, - "description": "Output only. The metadata associated with the request.", + "activeDocumentsCount": { + "description": "Output only. The number of documents in the `FileSearchStore` that are active and ready for retrieval.", "readOnly": true, - "type": "object" + "type": "string", + "format": "int64" }, - "error": { - "$ref": "Status", - "description": "Output only. The error encountered while processing the request.", - "readOnly": true - } - }, - "type": "object", - "id": "InlinedResponse", - "description": "The response to a single request in the batch." - }, - "EmbedContentResponse": { - "properties": { - "embedding": { - "$ref": "ContentEmbedding", - "description": "Output only. The embedding generated from the input content.", - "readOnly": true - }, - "usageMetadata": { - "description": "Output only. The usage metadata for the request.", + "pendingDocumentsCount": { + "description": "Output only. The number of documents in the `FileSearchStore` that are being processed.", "readOnly": true, - "$ref": "EmbeddingUsageMetadata" - } - }, - "type": "object", - "id": "EmbedContentResponse", - "description": "The response to an `EmbedContentRequest`." - }, - "Hyperparameters": { - "properties": { - "learningRate": { - "type": "number", - "description": "Optional. Immutable. The learning rate hyperparameter for tuning. If not set, a default of 0.001 or 0.0002 will be calculated based on the number of training examples.", - "format": "float" + "type": "string", + "format": "int64" }, - "epochCount": { - "format": "int32", - "description": "Immutable. The number of training epochs. An epoch is one pass through the training data. If not set, a default of 5 will be used.", - "type": "integer" + "failedDocumentsCount": { + "description": "Output only. The number of documents in the `FileSearchStore` that have failed processing.", + "readOnly": true, + "type": "string", + "format": "int64" }, - "learningRateMultiplier": { - "description": "Optional. Immutable. The learning rate multiplier is used to calculate a final learning_rate based on the default (recommended) value. Actual learning rate := learning_rate_multiplier * default learning rate Default learning rate is dependent on base model and dataset size. If not set, a default of 1.0 will be used.", - "type": "number", - "format": "float" + "sizeBytes": { + "description": "Output only. The size of raw bytes ingested into the `FileSearchStore`. This is the total size of all the documents in the `FileSearchStore`.", + "readOnly": true, + "type": "string", + "format": "int64" }, - "batchSize": { - "type": "integer", - "description": "Immutable. The batch size hyperparameter for tuning. If not set, a default of 4 or 16 will be used based on the number of training examples.", - "format": "int32" + "embeddingModel": { + "description": "Optional. The embedding model to use for the `FileSearchStore`. The model's resource name. This serves as an ID for the Model to use. Format: `models/{model}`. If not specified, the default embedding model will be used.", + "type": "string" } - }, - "id": "Hyperparameters", - "description": "Hyperparameters controlling the tuning process. Read more at https://ai.google.dev/docs/model_tuning_guidance", - "type": "object" + } }, - "ComputerUse": { + "Corpus": { + "id": "Corpus", + "description": "A `Corpus` is a collection of `Document`s. A project can create up to 10 corpora.", "type": "object", - "id": "ComputerUse", - "description": "Computer Use tool type.", "properties": { - "environment": { - "enumDescriptions": [ - "Defaults to browser.", - "Operates in a web browser." - ], - "enum": [ - "ENVIRONMENT_UNSPECIFIED", - "ENVIRONMENT_BROWSER" - ], - "description": "Required. The environment being operated.", + "name": { + "description": "Output only. Immutable. Identifier. The `Corpus` resource name. The ID (name excluding the \"corpora/\" prefix) can contain up to 40 characters that are lowercase alphanumeric or dashes (-). The ID cannot start or end with a dash. If the name is empty on create, a unique name will be derived from `display_name` along with a 12 character random suffix. Example: `corpora/my-awesome-corpora-123a456b789c`", + "readOnly": true, "type": "string" }, - "excludedPredefinedFunctions": { - "description": "Optional. By default, predefined functions are included in the final model call. Some of them can be explicitly excluded from being automatically included. This can serve two purposes: 1. Using a more restricted / different action space. 2. Improving the definitions / instructions of predefined functions.", - "items": { - "type": "string" - }, - "type": "array" + "displayName": { + "description": "Optional. The human-readable display name for the `Corpus`. The display name must be no more than 512 characters in length, including spaces. Example: \"Docs on Semantic Retriever\"", + "type": "string" + }, + "createTime": { + "description": "Output only. The Timestamp of when the `Corpus` was created.", + "readOnly": true, + "type": "string", + "format": "google-datetime" + }, + "updateTime": { + "description": "Output only. The Timestamp of when the `Corpus` was last updated.", + "readOnly": true, + "type": "string", + "format": "google-datetime" } } }, - "GenerateMessageResponse": { + "ListFileSearchStoresResponse": { + "id": "ListFileSearchStoresResponse", + "description": "Response from `ListFileSearchStores` containing a paginated list of `FileSearchStores`. The results are sorted by ascending `file_search_store.create_time`.", + "type": "object", "properties": { - "messages": { - "type": "array", - "description": "The conversation history used by the model.", - "items": { - "$ref": "Message" - } - }, - "filters": { + "fileSearchStores": { + "description": "The returned rag_stores.", "type": "array", - "description": "A set of content filtering metadata for the prompt and response text. This indicates which `SafetyCategory`(s) blocked a candidate from this response, the lowest `HarmProbability` that triggered a block, and the HarmThreshold setting for that category.", "items": { - "$ref": "ContentFilter" + "$ref": "FileSearchStore" } }, - "candidates": { - "description": "Candidate response messages from the model.", - "items": { - "$ref": "Message" - }, - "type": "array" + "nextPageToken": { + "description": "A token, which can be sent as `page_token` to retrieve the next page. If this field is omitted, there are no more pages.", + "type": "string" } - }, - "type": "object", - "id": "GenerateMessageResponse", - "description": "The response from the model. This includes candidate messages and conversation history in the form of chronologically-ordered messages." + } }, - "EmbedTextResponse": { - "id": "EmbedTextResponse", - "description": "The response to a EmbedTextRequest.", + "ListCorporaResponse": { + "id": "ListCorporaResponse", + "description": "Response from `ListCorpora` containing a paginated list of `Corpora`. The results are sorted by ascending `corpus.create_time`.", "type": "object", "properties": { - "embedding": { - "$ref": "Embedding", - "description": "Output only. The embedding generated from the input text.", - "readOnly": true + "corpora": { + "description": "The returned corpora.", + "type": "array", + "items": { + "$ref": "Corpus" + } + }, + "nextPageToken": { + "description": "A token, which can be sent as `page_token` to retrieve the next page. If this field is omitted, there are no more pages.", + "type": "string" } } }, - "Condition": { + "Document": { + "id": "Document", + "description": "A `Document` is a collection of `Chunk`s.", + "type": "object", "properties": { - "stringValue": { + "name": { + "description": "Immutable. Identifier. The `Document` resource name. The ID (name excluding the \"fileSearchStores/*/documents/\" prefix) can contain up to 40 characters that are lowercase alphanumeric or dashes (-). The ID cannot start or end with a dash. If the name is empty on create, a unique name will be derived from `display_name` along with a 12 character random suffix. Example: `fileSearchStores/{file_search_store_id}/documents/my-awesome-doc-123a456b789c`", + "type": "string" + }, + "displayName": { + "description": "Optional. The human-readable display name for the `Document`. The display name must be no more than 512 characters in length, including spaces. Example: \"Semantic Retriever Documentation\"", + "type": "string" + }, + "customMetadata": { + "description": "Optional. User provided custom metadata stored as key-value pairs used for querying. A `Document` can have a maximum of 20 `CustomMetadata`.", + "type": "array", + "items": { + "$ref": "CustomMetadata" + } + }, + "updateTime": { + "description": "Output only. The Timestamp of when the `Document` was last updated.", + "readOnly": true, "type": "string", - "description": "The string value to filter the metadata on." + "format": "google-datetime" }, - "numericValue": { - "type": "number", - "description": "The numeric value to filter the metadata on.", - "format": "float" + "createTime": { + "description": "Output only. The Timestamp of when the `Document` was created.", + "readOnly": true, + "type": "string", + "format": "google-datetime" }, - "operation": { + "state": { + "description": "Output only. Current state of the `Document`.", + "readOnly": true, "type": "string", - "description": "Required. Operator applied to the given key-value pair to trigger the condition.", "enumDescriptions": [ - "The default value. This value is unused.", - "Supported by numeric.", - "Supported by numeric.", - "Supported by numeric & string.", - "Supported by numeric.", - "Supported by numeric.", - "Supported by numeric & string.", - "Supported by string only when `CustomMetadata` value type for the given key has a `string_list_value`.", - "Supported by string only when `CustomMetadata` value type for the given key has a `string_list_value`." + "The default value. This value is used if the state is omitted.", + "Some `Chunks` of the `Document` are being processed (embedding and vector storage).", + "All `Chunks` of the `Document` is processed and available for querying.", + "Some `Chunks` of the `Document` failed processing." ], "enum": [ - "OPERATOR_UNSPECIFIED", - "LESS", - "LESS_EQUAL", - "EQUAL", - "GREATER_EQUAL", - "GREATER", - "NOT_EQUAL", - "INCLUDES", - "EXCLUDES" + "STATE_UNSPECIFIED", + "STATE_PENDING", + "STATE_ACTIVE", + "STATE_FAILED" ] + }, + "sizeBytes": { + "description": "Output only. The size of raw bytes ingested into the Document.", + "readOnly": true, + "type": "string", + "format": "int64" + }, + "mimeType": { + "description": "Output only. The mime type of the Document.", + "readOnly": true, + "type": "string" } - }, - "id": "Condition", - "description": "Filter condition applicable to a single key.", - "type": "object" + } }, - "DiffChecksumsResponse": { + "CustomMetadata": { + "id": "CustomMetadata", + "description": "User provided metadata stored as key-value pairs.", + "type": "object", "properties": { - "objectVersion": { - "description": "The object version of the object the checksums are being returned for.", + "stringValue": { + "description": "The string value of the metadata to store.", "type": "string" }, - "objectLocation": { - "$ref": "CompositeMedia", - "description": "If set, calculate the checksums based on the contents and return them to the caller." + "stringListValue": { + "description": "The StringList value of the metadata to store.", + "$ref": "StringList" }, - "chunkSizeBytes": { - "description": "The chunk size of checksums. Must be a multiple of 256KB.", - "type": "string", - "format": "int64" + "numericValue": { + "description": "The numeric value of the metadata to store.", + "type": "number", + "format": "float" }, - "objectSizeBytes": { - "format": "int64", - "description": "The total size of the server object.", + "key": { + "description": "Required. The key of the metadata to store.", "type": "string" - }, - "checksumsLocation": { - "$ref": "CompositeMedia", - "description": "Exactly one of these fields must be populated. If checksums_location is filled, the server will return the corresponding contents to the user. If object_location is filled, the server will calculate the checksums based on the content there and return that to the user. For details on the format of the checksums, see http://go/scotty-diff-protocol." } - }, - "id": "DiffChecksumsResponse", - "description": "Backend response for a Diff get checksums response. For details on the Scotty Diff protocol, visit http://go/scotty-diff-protocol.", - "type": "object" + } }, - "TuningExamples": { + "StringList": { + "id": "StringList", + "description": "User provided string values assigned to a single metadata key.", "type": "object", - "id": "TuningExamples", - "description": "A set of tuning examples. Can be training or validation data.", "properties": { - "examples": { - "type": "array", - "description": "The examples. Example input can be for text or discuss, but all examples in a set must be of the same type.", + "values": { + "description": "The string values of the metadata to store.", + "type": "array", "items": { - "$ref": "TuningExample" + "type": "string" } } } }, - "GenerateTextRequest": { + "ListDocumentsResponse": { + "id": "ListDocumentsResponse", + "description": "Response from `ListDocuments` containing a paginated list of `Document`s. The `Document`s are sorted by ascending `document.create_time`.", + "type": "object", "properties": { - "prompt": { - "$ref": "TextPrompt", - "description": "Required. The free-form input text given to the model as a prompt. Given a prompt, the model will generate a TextCompletion response it predicts as the completion of the input text." - }, - "topK": { - "format": "int32", - "description": "Optional. The maximum number of tokens to consider when sampling. The model uses combined Top-k and nucleus sampling. Top-k sampling considers the set of `top_k` most probable tokens. Defaults to 40. Note: The default value varies by model, see the `Model.top_k` attribute of the `Model` returned the `getModel` function.", - "type": "integer" - }, - "stopSequences": { - "description": "The set of character sequences (up to 5) that will stop output generation. If specified, the API will stop at the first appearance of a stop sequence. The stop sequence will not be included as part of the response.", + "documents": { + "description": "The returned `Document`s.", + "type": "array", "items": { - "type": "string" - }, - "type": "array" - }, - "topP": { - "type": "number", - "description": "Optional. The maximum cumulative probability of tokens to consider when sampling. The model uses combined Top-k and nucleus sampling. Tokens are sorted based on their assigned probabilities so that only the most likely tokens are considered. Top-k sampling directly limits the maximum number of tokens to consider, while Nucleus sampling limits number of tokens based on the cumulative probability. Note: The default value varies by model, see the `Model.top_p` attribute of the `Model` returned the `getModel` function.", - "format": "float" - }, - "temperature": { - "format": "float", - "type": "number", - "description": "Optional. Controls the randomness of the output. Note: The default value varies by model, see the `Model.temperature` attribute of the `Model` returned the `getModel` function. Values can range from [0.0,1.0], inclusive. A value closer to 1.0 will produce responses that are more varied and creative, while a value closer to 0.0 will typically result in more straightforward responses from the model." - }, - "candidateCount": { - "description": "Optional. Number of generated responses to return. This value must be between [1, 8], inclusive. If unset, this will default to 1.", - "type": "integer", - "format": "int32" - }, - "maxOutputTokens": { - "type": "integer", - "description": "Optional. The maximum number of tokens to include in a candidate. If unset, this will default to output_token_limit specified in the `Model` specification.", - "format": "int32" + "$ref": "Document" + } }, - "safetySettings": { - "description": "Optional. A list of unique `SafetySetting` instances for blocking unsafe content. that will be enforced on the `GenerateTextRequest.prompt` and `GenerateTextResponse.candidates`. There should not be more than one setting for each `SafetyCategory` type. The API will block any prompts and responses that fail to meet the thresholds set by these settings. This list overrides the default settings for each `SafetyCategory` specified in the safety_settings. If there is no `SafetySetting` for a given `SafetyCategory` provided in the list, the API will use the default safety setting for that category. Harm categories HARM_CATEGORY_DEROGATORY, HARM_CATEGORY_TOXICITY, HARM_CATEGORY_VIOLENCE, HARM_CATEGORY_SEXUAL, HARM_CATEGORY_MEDICAL, HARM_CATEGORY_DANGEROUS are supported in text service.", - "items": { - "$ref": "SafetySetting" - }, - "type": "array" + "nextPageToken": { + "description": "A token, which can be sent as `page_token` to retrieve the next page. If this field is omitted, there are no more pages.", + "type": "string" } - }, - "type": "object", - "id": "GenerateTextRequest", - "description": "Request to generate a text completion response from the model." + } }, - "DynamicRetrievalConfig": { - "id": "DynamicRetrievalConfig", - "description": "Describes the options to customize dynamic retrieval.", + "ImportFileRequest": { + "id": "ImportFileRequest", + "description": "Request for `ImportFile` to import a File API file with a `FileSearchStore`.", "type": "object", "properties": { - "mode": { - "type": "string", - "description": "The mode of the predictor to be used in dynamic retrieval.", - "enumDescriptions": [ - "Always trigger retrieval.", - "Run retrieval only when system decides it is necessary." - ], - "enum": [ - "MODE_UNSPECIFIED", - "MODE_DYNAMIC" - ] + "fileName": { + "description": "Required. The name of the `File` to import. Example: `files/abc-123`", + "type": "string" }, - "dynamicThreshold": { - "type": "number", - "description": "The threshold to be used in dynamic retrieval. If not set, a system default value is used.", - "format": "float" + "customMetadata": { + "description": "Custom metadata to be associated with the file.", + "type": "array", + "items": { + "$ref": "CustomMetadata" + } + }, + "chunkingConfig": { + "description": "Optional. Config for telling the service how to chunk the file. If not provided, the service will use default parameters.", + "$ref": "ChunkingConfig" } } }, - "McpServer": { + "ChunkingConfig": { + "id": "ChunkingConfig", + "description": "Parameters for telling the service how to chunk the file. inspired by google3/cloud/ai/platform/extension/lib/retrieval/config/chunker_config.proto", + "type": "object", "properties": { - "streamableHttpTransport": { - "description": "A transport that can stream HTTP requests and responses.", - "$ref": "StreamableHttpTransport" - }, - "name": { - "type": "string", - "description": "The name of the MCPServer." + "whiteSpaceConfig": { + "description": "White space chunking configuration.", + "$ref": "WhiteSpaceConfig" } - }, - "id": "McpServer", - "description": "A MCPServer is a server that can be called by the model to perform actions. It is a server that implements the MCP protocol. Next ID: 6", - "type": "object" + } }, - "CountMessageTokensResponse": { - "id": "CountMessageTokensResponse", - "description": "A response from `CountMessageTokens`. It returns the model's `token_count` for the `prompt`.", + "WhiteSpaceConfig": { + "id": "WhiteSpaceConfig", + "description": "Configuration for a white space chunking algorithm [white space delimited].", "type": "object", "properties": { - "tokenCount": { + "maxTokensPerChunk": { + "description": "Maximum number of tokens per chunk. Tokens are defined as words for this chunking algorithm. Note: we are defining tokens as words split by whitespace as opposed to the output of a tokenizer. The context window of the latest gemini embedding model as of 2025-04-17 is currently 8192 tokens. We assume that the average word is 5 characters. Therefore, we set the upper limit to 2**9, which is 512 words, or 2560 tokens, assuming worst case a character per token. This is a conservative estimate meant to prevent context window overflow.", + "type": "integer", + "format": "int32" + }, + "maxOverlapTokens": { + "description": "Maximum number of overlapping tokens between two adjacent chunks.", "type": "integer", - "description": "The number of tokens that the `model` tokenizes the `prompt` into. Always non-negative.", "format": "int32" } } }, - "InlinedRequest": { + "UploadToFileSearchStoreRequest": { + "id": "UploadToFileSearchStoreRequest", + "description": "Request for `UploadToFileSearchStore`.", "type": "object", - "id": "InlinedRequest", - "description": "The request to be processed in the batch.", "properties": { - "request": { - "description": "Required. The request to be processed in the batch.", - "$ref": "GenerateContentRequest" + "displayName": { + "description": "Optional. Display name of the created document.", + "type": "string" }, - "metadata": { - "additionalProperties": { - "description": "Properties of the object.", - "type": "any" - }, - "description": "Optional. The metadata to be associated with the request.", - "type": "object" + "customMetadata": { + "description": "Custom metadata to be associated with the data.", + "type": "array", + "items": { + "$ref": "CustomMetadata" + } + }, + "chunkingConfig": { + "description": "Optional. Config for telling the service how to chunk the data. If not provided, the service will use default parameters.", + "$ref": "ChunkingConfig" + }, + "mimeType": { + "description": "Optional. MIME type of the data. If not provided, it will be inferred from the uploaded content.", + "type": "string" } } }, - "CountTokensRequest": { - "id": "CountTokensRequest", - "description": "Counts the number of tokens in the `prompt` sent to a model. Models may tokenize text differently, so each model may return a different `token_count`.", + "CustomLongRunningOperation": { + "id": "CustomLongRunningOperation", "type": "object", "properties": { - "contents": { - "description": "Optional. The input given to the model as a prompt. This field is ignored when `generate_content_request` is set.", - "items": { - "$ref": "Content" - }, - "type": "array" + "error": { + "description": "The error result of the operation in case of failure or cancellation.", + "$ref": "Status" }, - "generateContentRequest": { - "description": "Optional. The overall input given to the `Model`. This includes the prompt as well as other model steering information like [system instructions](https://ai.google.dev/gemini-api/docs/system-instructions), and/or function declarations for [function calling](https://ai.google.dev/gemini-api/docs/function-calling). `Model`s/`Content`s and `generate_content_request`s are mutually exclusive. You can either send `Model` + `Content`s or a `generate_content_request`, but never both.", - "$ref": "GenerateContentRequest" + "response": { + "description": "The normal, successful response of the operation. If the original method returns no data on success, such as `Delete`, the response is `google.protobuf.Empty`. If the original method is standard `Get`/`Create`/`Update`, the response should be the resource. For other methods, the response should have the type `XxxResponse`, where `Xxx` is the original method name. For example, if the original method name is `TakeSnapshot()`, the inferred response type is `TakeSnapshotResponse`.", + "type": "object", + "additionalProperties": { + "type": "any", + "description": "Properties of the object. Contains field @type with type URL." + } + }, + "name": { + "description": "The server-assigned name, which is only unique within the same service that originally returns it. If you use the default HTTP mapping, the `name` should be a resource name ending with `operations/{unique_id}`.", + "type": "string" + }, + "metadata": { + "description": "Service-specific metadata associated with the operation. It typically contains progress information and common metadata such as create time. Some services might not provide such metadata. Any method that returns a long-running operation should document the metadata type, if any.", + "type": "object", + "additionalProperties": { + "type": "any", + "description": "Properties of the object. Contains field @type with type URL." + } + }, + "done": { + "description": "If the value is `false`, it means the operation is still in progress. If `true`, the operation is completed, and either `error` or `response` is available.", + "type": "boolean" } } }, - "MetadataFilter": { + "DownloadMediaResponse": { + "id": "DownloadMediaResponse", + "description": "Response for DownloadMedia.", "type": "object", - "id": "MetadataFilter", - "description": "User provided filter to limit retrieval based on `Chunk` or `Document` level metadata values. Example (genre = drama OR genre = action): key = \"document.custom_metadata.genre\" conditions = [{string_value = \"drama\", operation = EQUAL}, {string_value = \"action\", operation = EQUAL}]", "properties": { - "key": { - "type": "string", - "description": "Required. The key of the metadata to filter on." - }, - "conditions": { - "description": "Required. The `Condition`s for the given key that will trigger this filter. Multiple `Condition`s are joined by logical ORs.", - "items": { - "$ref": "Condition" - }, - "type": "array" + "blob": { + "description": "Output only. The blob data.", + "readOnly": true, + "$ref": "GdataMedia" } } }, - "CustomMetadata": { + "GdataMedia": { + "id": "GdataMedia", + "description": "A reference to data stored on the filesystem, on GFS or in blobstore.", + "type": "object", "properties": { - "key": { - "description": "Required. The key of the metadata to store.", + "contentType": { + "description": "MIME type of the data", "type": "string" }, - "numericValue": { - "type": "number", - "description": "The numeric value of the metadata to store.", - "format": "float" - }, - "stringValue": { + "timestamp": { + "description": "Time at which the media data was last updated, in milliseconds since UNIX epoch", "type": "string", - "description": "The string value of the metadata to store." + "format": "uint64" }, - "stringListValue": { - "$ref": "StringList", - "description": "The StringList value of the metadata to store." - } - }, - "id": "CustomMetadata", - "description": "User provided metadata stored as key-value pairs.", - "type": "object" - }, - "StreamableHttpTransport": { - "properties": { - "terminateOnClose": { - "description": "Whether to close the client session when the transport closes.", - "type": "boolean" + "token": { + "description": "A unique fingerprint/version id for the media data", + "type": "string" }, - "url": { + "length": { + "description": "Size of the data, in bytes", "type": "string", - "description": "The full URL for the MCPServer endpoint. Example: \"https://api.example.com/mcp\"" + "format": "int64" }, - "timeout": { - "description": "HTTP timeout for regular operations.", - "type": "string", - "format": "google-duration" + "filename": { + "description": "Original file name", + "type": "string" }, - "sseReadTimeout": { - "format": "google-duration", + "referenceType": { + "description": "Describes what the field reference contains.", "type": "string", - "description": "Timeout for SSE read operations." - }, - "headers": { - "additionalProperties": { - "type": "string" - }, - "description": "Optional: Fields for authentication headers, timeouts, etc., if needed.", - "type": "object" - } - }, - "id": "StreamableHttpTransport", - "description": "A transport that can stream HTTP requests and responses. Next ID: 6", - "type": "object" - }, - "UrlContextMetadata": { - "id": "UrlContextMetadata", - "description": "Metadata related to url context retrieval tool.", - "type": "object", - "properties": { - "urlMetadata": { - "type": "array", - "description": "List of url context.", - "items": { - "$ref": "UrlMetadata" - } - } - } - }, - "SemanticRetrieverConfig": { - "properties": { - "maxChunksCount": { - "description": "Optional. Maximum number of relevant `Chunk`s to retrieve.", - "type": "integer", - "format": "int32" + "enumDescriptions": [ + "Reference contains a GFS path or a local path.", + "Reference points to a blobstore object. This could be either a v1 blob_ref or a v2 blobstore2_info. Clients should check blobstore2_info first, since v1 is being deprecated.", + "Data is included into this proto buffer", + "Data should be accessed from the current service using the operation GetMedia.", + "The content for this media object is stored across multiple partial media objects under the composite_media field.", + "Reference points to a bigstore object", + "Indicates the data is stored in diff_version_response.", + "Indicates the data is stored in diff_checksums_response.", + "Indicates the data is stored in diff_download_response.", + "Indicates the data is stored in diff_upload_request.", + "Indicates the data is stored in diff_upload_response.", + "Indicates the data is stored in cosmo_binary_reference.", + "Informs Scotty to generate a response payload with the size specified in the length field. The contents of the payload are generated by Scotty and are undefined. This is useful for testing download speeds between the user and Scotty without involving a real payload source. Note: range is not supported when using arbitrary_bytes." + ], + "enum": [ + "PATH", + "BLOB_REF", + "INLINE", + "GET_MEDIA", + "COMPOSITE_MEDIA", + "BIGSTORE_REF", + "DIFF_VERSION_RESPONSE", + "DIFF_CHECKSUMS_RESPONSE", + "DIFF_DOWNLOAD_RESPONSE", + "DIFF_UPLOAD_REQUEST", + "DIFF_UPLOAD_RESPONSE", + "COSMO_BINARY_REFERENCE", + "ARBITRARY_BYTES" + ] }, - "source": { + "path": { + "description": "Path to the data, set if reference_type is PATH", + "type": "string" + }, + "blobRef": { + "description": "Blobstore v1 reference, set if reference_type is BLOBSTORE_REF This should be the byte representation of a blobstore.BlobRef. Since Blobstore is deprecating v1, use blobstore2_info instead. For now, any v2 blob will also be represented in this field as v1 BlobRef.", + "deprecated": true, "type": "string", - "description": "Required. Name of the resource for retrieval. Example: `corpora/123` or `corpora/123/documents/abc`." + "format": "byte" }, - "query": { - "$ref": "Content", - "description": "Required. Query to use for matching `Chunk`s in the given resource by similarity." + "inline": { + "description": "Media data, set if reference_type is INLINE", + "type": "string", + "format": "byte" }, - "minimumRelevanceScore": { - "description": "Optional. Minimum relevance score for retrieved relevant `Chunk`s.", - "type": "number", - "format": "float" + "mediaId": { + "description": "Media id to forward to the operation GetMedia. Can be set if reference_type is GET_MEDIA.", + "type": "string", + "format": "byte" }, - "metadataFilters": { - "description": "Optional. Filters for selecting `Document`s and/or `Chunk`s from the resource.", - "items": { - "$ref": "MetadataFilter" - }, - "type": "array" - } - }, - "id": "SemanticRetrieverConfig", - "description": "Configuration for retrieving grounding content from a `Corpus` or `Document` created using the Semantic Retriever API.", - "type": "object" - }, - "TextCompletion": { - "properties": { - "output": { - "description": "Output only. The generated text returned from the model.", - "readOnly": true, + "hash": { + "description": "Deprecated, use one of explicit hash type fields instead. These two hash related fields will only be populated on Scotty based media uploads and will contain the content of the hash group in the NotificationRequest: http://cs/#google3/blobstore2/api/scotty/service/proto/upload_listener.proto&q=class:Hash Hex encoded hash value of the uploaded media.", + "deprecated": true, "type": "string" }, - "safetyRatings": { + "algorithm": { + "description": "Deprecated, use one of explicit hash type fields instead. Algorithm used for calculating the hash. As of 2011/01/21, \"MD5\" is the only possible value for this field. New values may be added at any time.", + "deprecated": true, + "type": "string" + }, + "compositeMedia": { + "description": "A composite media composed of one or more media objects, set if reference_type is COMPOSITE_MEDIA. The media length field must be set to the sum of the lengths of all composite media objects. Note: All composite media must have length specified.", "type": "array", - "description": "Ratings for the safety of a response. There is at most one rating per category.", "items": { - "$ref": "SafetyRating" + "$ref": "CompositeMedia" } }, - "citationMetadata": { - "description": "Output only. Citation information for model-generated `output` in this `TextCompletion`. This field may be populated with attribution information for any text included in the `output`.", - "readOnly": true, - "$ref": "CitationMetadata" - } - }, - "type": "object", - "id": "TextCompletion", - "description": "Output text returned from a model." - }, - "InlinedEmbedContentResponse": { - "properties": { - "response": { - "$ref": "EmbedContentResponse", - "description": "Output only. The response to the request.", - "readOnly": true + "bigstoreObjectRef": { + "description": "Use object_id instead.", + "deprecated": true, + "type": "string", + "format": "byte" }, - "metadata": { - "type": "object", - "description": "Output only. The metadata associated with the request.", - "readOnly": true, - "additionalProperties": { - "type": "any", - "description": "Properties of the object." - } + "objectId": { + "description": "Reference to a TI Blob, set if reference_type is BIGSTORE_REF.", + "$ref": "ObjectId" }, - "error": { - "$ref": "Status", - "description": "Output only. The error encountered while processing the request.", - "readOnly": true - } - }, - "type": "object", - "id": "InlinedEmbedContentResponse", - "description": "The response to a single request in the batch." - }, - "TransferOwnershipRequest": { - "properties": { - "emailAddress": { - "description": "Required. The email address of the user to whom the tuned model is being transferred to.", - "type": "string" - } - }, - "type": "object", - "id": "TransferOwnershipRequest", - "description": "Request to transfer the ownership of the tuned model." - }, - "GenerateContentBatchOutput": { - "id": "GenerateContentBatchOutput", - "description": "The output of a batch request. This is returned in the `BatchGenerateContentResponse` or the `GenerateContentBatch.output` field.", - "type": "object", - "properties": { - "responsesFile": { - "type": "string", - "description": "Output only. The file ID of the file containing the responses. The file will be a JSONL file with a single response per line. The responses will be `GenerateContentResponse` messages formatted as JSON. The responses will be written in the same order as the input requests.", - "readOnly": true + "blobstore2Info": { + "description": "Blobstore v2 info, set if reference_type is BLOBSTORE_REF and it refers to a v2 blob.", + "$ref": "Blobstore2Info" }, - "inlinedResponses": { - "description": "Output only. The responses to the requests in the batch. Returned when the batch was built using inlined requests. The responses will be in the same order as the input requests.", - "readOnly": true, - "$ref": "InlinedResponses" - } - } - }, - "ThinkingConfig": { - "id": "ThinkingConfig", - "description": "Config for thinking features.", - "type": "object", - "properties": { - "thinkingLevel": { - "enumDescriptions": [ - "Default value.", - "Little to no thinking.", - "Low thinking level.", - "Medium thinking level.", - "High thinking level." - ], - "enum": [ - "THINKING_LEVEL_UNSPECIFIED", - "MINIMAL", - "LOW", - "MEDIUM", - "HIGH" - ], - "type": "string", - "description": "Optional. Controls the maximum depth of the model's internal reasoning process before it produces a response. The default value is model-dependent. Refer to the [Thinking levels guide](https://ai.google.dev/gemini-api/docs/thinking#thinking-levels) for more details. Recommended for Gemini 3 or later models. Use with earlier models results in an error." + "diffVersionResponse": { + "description": "Set if reference_type is DIFF_VERSION_RESPONSE.", + "$ref": "DiffVersionResponse" }, - "includeThoughts": { - "description": "Indicates whether to include thoughts in the response. If true, thoughts are returned only when available.", - "type": "boolean" + "diffChecksumsResponse": { + "description": "Set if reference_type is DIFF_CHECKSUMS_RESPONSE.", + "$ref": "DiffChecksumsResponse" }, - "thinkingBudget": { - "description": "The number of thoughts tokens that the model should generate.", - "type": "integer", - "format": "int32" - } - } - }, - "Model": { - "id": "Model", - "description": "Information about a Generative Language Model.", - "type": "object", - "properties": { - "temperature": { - "type": "number", - "description": "Controls the randomness of the output. Values can range over `[0.0,max_temperature]`, inclusive. A higher value will produce responses that are more varied, while a value closer to `0.0` will typically result in less surprising responses from the model. This value specifies default to be used by the backend while making the call to the model.", - "format": "float" + "diffDownloadResponse": { + "description": "Set if reference_type is DIFF_DOWNLOAD_RESPONSE.", + "$ref": "DiffDownloadResponse" }, - "version": { - "type": "string", - "description": "Required. The version number of the model. This represents the major version (`1.0` or `1.5`)" + "diffUploadRequest": { + "description": "Set if reference_type is DIFF_UPLOAD_REQUEST.", + "$ref": "DiffUploadRequest" }, - "name": { - "description": "Required. The resource name of the `Model`. Refer to [Model variants](https://ai.google.dev/gemini-api/docs/models/gemini#model-variations) for all allowed values. Format: `models/{model}` with a `{model}` naming convention of: * \"{base_model_id}-{version}\" Examples: * `models/gemini-1.5-flash-001`", - "type": "string" + "diffUploadResponse": { + "description": "Set if reference_type is DIFF_UPLOAD_RESPONSE.", + "$ref": "DiffUploadResponse" }, - "thinking": { - "type": "boolean", - "description": "Whether the model supports thinking." + "contentTypeInfo": { + "description": "Extended content type information provided for Scotty uploads.", + "$ref": "ContentTypeInfo" }, - "supportedGenerationMethods": { - "type": "array", - "description": "The model's supported generation methods. The corresponding API method names are defined as Pascal case strings, such as `generateMessage` and `generateContent`.", - "items": { - "type": "string" - } + "downloadParameters": { + "description": "Parameters for a media download.", + "$ref": "DownloadParameters" }, - "topK": { - "description": "For Top-k sampling. Top-k sampling considers the set of `top_k` most probable tokens. This value specifies default to be used by the backend while making the call to the model. If empty, indicates the model doesn't use top-k sampling, and `top_k` isn't allowed as a generation parameter.", + "crc32cHash": { + "description": "For Scotty Uploads: Scotty-provided hashes for uploads For Scotty Downloads: (WARNING: DO NOT USE WITHOUT PERMISSION FROM THE SCOTTY TEAM.) A Hash provided by the agent to be used to verify the data being downloaded. Currently only supported for inline payloads. Further, only crc32c_hash is currently supported.", "type": "integer", - "format": "int32" + "format": "uint32" }, - "displayName": { + "md5Hash": { + "description": "Scotty-provided MD5 hash for an upload.", "type": "string", - "description": "The human-readable name of the model. E.g. \"Gemini 1.5 Flash\". The name can be up to 128 characters long and can consist of any UTF-8 characters." + "format": "byte" }, - "inputTokenLimit": { - "format": "int32", - "type": "integer", - "description": "Maximum number of input tokens allowed for this model." + "sha1Hash": { + "description": "Scotty-provided SHA1 hash for an upload.", + "type": "string", + "format": "byte" }, - "outputTokenLimit": { - "format": "int32", - "description": "Maximum number of output tokens available for this model.", - "type": "integer" + "sha256Hash": { + "description": "Scotty-provided SHA256 hash for an upload.", + "type": "string", + "format": "byte" }, - "maxTemperature": { - "format": "float", - "description": "The maximum temperature this model can use.", - "type": "number" + "sha512Hash": { + "description": "Scotty-provided SHA512 hash for an upload.", + "type": "string", + "format": "byte" }, - "topP": { - "description": "For [Nucleus sampling](https://ai.google.dev/gemini-api/docs/prompting-strategies#top-p). Nucleus sampling considers the smallest set of tokens whose probability sum is at least `top_p`. This value specifies default to be used by the backend while making the call to the model.", - "type": "number", - "format": "float" + "isPotentialRetry": { + "description": "|is_potential_retry| is set false only when Scotty is certain that it has not sent the request before. When a client resumes an upload, this field must be set true in agent calls, because Scotty cannot be certain that it has never sent the request before due to potential failure in the session state persistence.", + "type": "boolean" }, - "baseModelId": { + "cosmoBinaryReference": { + "description": "A binary data reference for a media download. Serves as a technology-agnostic binary reference in some Google infrastructure. This value is a serialized storage_cosmo.BinaryReference proto. Storing it as bytes is a hack to get around the fact that the cosmo proto (as well as others it includes) doesn't support JavaScript. This prevents us from including the actual type of this field.", "type": "string", - "description": "Required. The name of the base model, pass this to the generation request. Examples: * `gemini-1.5-flash`" + "format": "byte" }, - "description": { - "type": "string", - "description": "A short description of the model." + "hashVerified": { + "description": "For Scotty uploads only. If a user sends a hash code and the backend has requested that Scotty verify the upload against the client hash, Scotty will perform the check on behalf of the backend and will reject it if the hashes don't match. This is set to true if Scotty performed this verification.", + "type": "boolean" } } }, - "GenerateTextResponse": { + "CompositeMedia": { + "id": "CompositeMedia", + "description": "A sequence of media data references representing composite data. Introduced to support Bigstore composite objects. For details, visit http://go/bigstore-composites.", + "type": "object", "properties": { - "filters": { - "type": "array", - "description": "A set of content filtering metadata for the prompt and response text. This indicates which `SafetyCategory`(s) blocked a candidate from this response, the lowest `HarmProbability` that triggered a block, and the HarmThreshold setting for that category. This indicates the smallest change to the `SafetySettings` that would be necessary to unblock at least 1 response. The blocking is configured by the `SafetySettings` in the request (or the default `SafetySettings` of the API).", - "items": { - "$ref": "ContentFilter" - } + "length": { + "description": "Size of the data, in bytes", + "type": "string", + "format": "int64" }, - "safetyFeedback": { - "description": "Returns any safety feedback related to content filtering.", - "items": { - "$ref": "SafetyFeedback" - }, - "type": "array" + "referenceType": { + "description": "Describes what the field reference contains.", + "type": "string", + "enumDescriptions": [ + "Reference contains a GFS path or a local path.", + "Reference points to a blobstore object. This could be either a v1 blob_ref or a v2 blobstore2_info. Clients should check blobstore2_info first, since v1 is being deprecated.", + "Data is included into this proto buffer", + "Reference points to a bigstore object", + "Indicates the data is stored in cosmo_binary_reference." + ], + "enum": [ + "PATH", + "BLOB_REF", + "INLINE", + "BIGSTORE_REF", + "COSMO_BINARY_REFERENCE" + ] }, - "candidates": { - "type": "array", - "description": "Candidate responses from the model.", - "items": { - "$ref": "TextCompletion" - } + "path": { + "description": "Path to the data, set if reference_type is PATH", + "type": "string" + }, + "blobRef": { + "description": "Blobstore v1 reference, set if reference_type is BLOBSTORE_REF This should be the byte representation of a blobstore.BlobRef. Since Blobstore is deprecating v1, use blobstore2_info instead. For now, any v2 blob will also be represented in this field as v1 BlobRef.", + "deprecated": true, + "type": "string", + "format": "byte" + }, + "inline": { + "description": "Media data, set if reference_type is INLINE", + "type": "string", + "format": "byte" + }, + "objectId": { + "description": "Reference to a TI Blob, set if reference_type is BIGSTORE_REF.", + "$ref": "ObjectId" + }, + "blobstore2Info": { + "description": "Blobstore v2 info, set if reference_type is BLOBSTORE_REF and it refers to a v2 blob.", + "$ref": "Blobstore2Info" + }, + "cosmoBinaryReference": { + "description": "A binary data reference for a media download. Serves as a technology-agnostic binary reference in some Google infrastructure. This value is a serialized storage_cosmo.BinaryReference proto. Storing it as bytes is a hack to get around the fact that the cosmo proto (as well as others it includes) doesn't support JavaScript. This prevents us from including the actual type of this field.", + "type": "string", + "format": "byte" + }, + "crc32cHash": { + "description": "crc32.c hash for the payload.", + "type": "integer", + "format": "uint32" + }, + "md5Hash": { + "description": "MD5 hash for the payload.", + "type": "string", + "format": "byte" + }, + "sha1Hash": { + "description": "SHA-1 hash for the payload.", + "type": "string", + "format": "byte" } - }, - "id": "GenerateTextResponse", - "description": "The response from the model, including candidate completions.", - "type": "object" + } }, - "CodeExecution": { + "ObjectId": { + "id": "ObjectId", + "description": "This is a copy of the tech.blob.ObjectId proto, which could not be used directly here due to transitive closure issues with JavaScript support; see http://b/8801763.", "type": "object", - "id": "CodeExecution", - "description": "Tool that executes code generated by the model, and automatically returns the result to the model. See also `ExecutableCode` and `CodeExecutionResult` which are only generated when using this tool.", - "properties": {} + "properties": { + "bucketName": { + "description": "The name of the bucket to which this object belongs.", + "type": "string" + }, + "objectName": { + "description": "The name of the object.", + "type": "string" + }, + "generation": { + "description": "Generation of the object. Generations are monotonically increasing across writes, allowing them to be be compared to determine which generation is newer. If this is omitted in a request, then you are requesting the live object. See http://go/bigstore-versions", + "type": "string", + "format": "int64" + } + } }, - "FunctionCall": { + "Blobstore2Info": { + "id": "Blobstore2Info", + "description": "Information to read/write to blobstore2.", "type": "object", - "id": "FunctionCall", - "description": "A predicted `FunctionCall` returned from the model that contains a string representing the `FunctionDeclaration.name` with the arguments and their values.", "properties": { - "id": { + "blobId": { + "description": "The blob id, e.g., /blobstore/prod/playground/scotty", + "type": "string" + }, + "blobGeneration": { + "description": "The blob generation id.", "type": "string", - "description": "Optional. Unique identifier of the function call. If populated, the client to execute the `function_call` and return the response with the matching `id`." + "format": "int64" }, - "name": { - "description": "Required. The name of the function to call. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 128.", + "readToken": { + "description": "The blob read token. Needed to read blobs that have not been replicated. Might not be available until the final call.", "type": "string" }, - "args": { - "additionalProperties": { - "description": "Properties of the object.", - "type": "any" - }, - "type": "object", - "description": "Optional. The function parameters and values in JSON object format." + "uploadMetadataContainer": { + "description": "Metadata passed from Blobstore -\u003e Scotty for a new GCS upload. This is a signed, serialized blobstore2.BlobMetadataContainer proto which must never be consumed outside of Bigstore, and is not applicable to non-GCS media uploads.", + "type": "string", + "format": "byte" + }, + "downloadReadHandle": { + "description": "Read handle passed from Bigstore -\u003e Scotty for a GCS download. This is a signed, serialized blobstore2.ReadHandle proto which must never be set outside of Bigstore, and is not applicable to non-GCS media downloads.", + "type": "string", + "format": "byte" + }, + "downloadExternalReadToken": { + "description": "A serialized External Read Token passed from Bigstore -\u003e Scotty for a GCS download. This field must never be consumed outside of Bigstore, and is not applicable to non-GCS media uploads.", + "type": "string", + "format": "byte" + }, + "uploadFragmentListCreationInfo": { + "description": "A serialized Object Fragment List Creation Info passed from Bigstore -\u003e Scotty for a GCS upload. This field must never be consumed outside of Bigstore, and is not applicable to non-GCS media uploads.", + "type": "string", + "format": "byte" } } }, - "RetrievalConfig": { - "id": "RetrievalConfig", - "description": "Retrieval config.", + "DiffVersionResponse": { + "id": "DiffVersionResponse", + "description": "Backend response for a Diff get version response. For details on the Scotty Diff protocol, visit http://go/scotty-diff-protocol.", "type": "object", "properties": { - "latLng": { - "description": "Optional. The location of the user.", - "$ref": "LatLng" + "objectVersion": { + "description": "The version of the object stored at the server.", + "type": "string" }, - "languageCode": { + "objectSizeBytes": { + "description": "The total size of the server object.", "type": "string", - "description": "Optional. The language code of the user. Language code for content. Use language tags defined by [BCP47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt)." + "format": "int64" } } }, - "BatchGenerateContentRequest": { - "id": "BatchGenerateContentRequest", - "description": "Request for a `BatchGenerateContent` operation.", + "DiffChecksumsResponse": { + "id": "DiffChecksumsResponse", + "description": "Backend response for a Diff get checksums response. For details on the Scotty Diff protocol, visit http://go/scotty-diff-protocol.", "type": "object", "properties": { - "batch": { - "description": "Required. The batch to create.", - "$ref": "GenerateContentBatch" + "objectVersion": { + "description": "The object version of the object the checksums are being returned for.", + "type": "string" + }, + "objectSizeBytes": { + "description": "The total size of the server object.", + "type": "string", + "format": "int64" + }, + "chunkSizeBytes": { + "description": "The chunk size of checksums. Must be a multiple of 256KB.", + "type": "string", + "format": "int64" + }, + "checksumsLocation": { + "description": "Exactly one of these fields must be populated. If checksums_location is filled, the server will return the corresponding contents to the user. If object_location is filled, the server will calculate the checksums based on the content there and return that to the user. For details on the format of the checksums, see http://go/scotty-diff-protocol.", + "$ref": "CompositeMedia" + }, + "objectLocation": { + "description": "If set, calculate the checksums based on the contents and return them to the caller.", + "$ref": "CompositeMedia" } } }, - "MultiSpeakerVoiceConfig": { + "DiffDownloadResponse": { + "id": "DiffDownloadResponse", + "description": "Backend response for a Diff download response. For details on the Scotty Diff protocol, visit http://go/scotty-diff-protocol.", "type": "object", - "id": "MultiSpeakerVoiceConfig", - "description": "The configuration for the multi-speaker setup.", "properties": { - "speakerVoiceConfigs": { - "description": "Required. All the enabled speaker voices.", - "items": { - "$ref": "SpeakerVoiceConfig" - }, - "type": "array" + "objectLocation": { + "description": "The original object location.", + "$ref": "CompositeMedia" } } }, - "UrlContext": { - "properties": {}, + "DiffUploadRequest": { + "id": "DiffUploadRequest", + "description": "A Diff upload request. For details on the Scotty Diff protocol, visit http://go/scotty-diff-protocol.", "type": "object", - "id": "UrlContext", - "description": "Tool to support URL context retrieval." + "properties": { + "objectVersion": { + "description": "The object version of the object that is the base version the incoming diff script will be applied to. This field will always be filled in.", + "type": "string" + }, + "objectInfo": { + "description": "The location of the new object. Agents must clone the object located here, as the upload server will delete the contents once a response is received.", + "$ref": "CompositeMedia" + }, + "checksumsInfo": { + "description": "The location of the checksums for the new object. Agents must clone the object located here, as the upload server will delete the contents once a response is received. For details on the format of the checksums, see http://go/scotty-diff-protocol.", + "$ref": "CompositeMedia" + } + } }, - "SafetyRating": { - "id": "SafetyRating", - "description": "Safety rating for a piece of content. The safety rating contains the category of harm and the harm probability level in that category for a piece of content. Content is classified for safety across a number of harm categories and the probability of the harm classification is included here.", + "DiffUploadResponse": { + "id": "DiffUploadResponse", + "description": "Backend response for a Diff upload request. For details on the Scotty Diff protocol, visit http://go/scotty-diff-protocol.", "type": "object", "properties": { - "probability": { - "description": "Required. The probability of harm for this content.", - "type": "string", - "enumDescriptions": [ - "Probability is unspecified.", - "Content has a negligible chance of being unsafe.", - "Content has a low chance of being unsafe.", - "Content has a medium chance of being unsafe.", - "Content has a high chance of being unsafe." - ], - "enum": [ - "HARM_PROBABILITY_UNSPECIFIED", - "NEGLIGIBLE", - "LOW", - "MEDIUM", - "HIGH" - ] + "objectVersion": { + "description": "The object version of the object at the server. Must be included in the end notification response. The version in the end notification response must correspond to the new version of the object that is now stored at the server, after the upload.", + "type": "string" }, - "category": { - "enumDescriptions": [ - "Category is unspecified.", - "**PaLM** - Negative or harmful comments targeting identity and/or protected attribute.", - "**PaLM** - Content that is rude, disrespectful, or profane.", - "**PaLM** - Describes scenarios depicting violence against an individual or group, or general descriptions of gore.", - "**PaLM** - Contains references to sexual acts or other lewd content.", - "**PaLM** - Promotes unchecked medical advice.", - "**PaLM** - Dangerous content that promotes, facilitates, or encourages harmful acts.", - "**Gemini** - Harassment content.", - "**Gemini** - Hate speech and content.", - "**Gemini** - Sexually explicit content.", - "**Gemini** - Dangerous content.", - "**Gemini** - Content that may be used to harm civic integrity. DEPRECATED: use enable_enhanced_civic_answers instead." - ], + "originalObject": { + "description": "The location of the original file for a diff upload request. Must be filled in if responding to an upload start notification.", + "$ref": "CompositeMedia" + } + } + }, + "ContentTypeInfo": { + "id": "ContentTypeInfo", + "description": "Detailed Content-Type information from Scotty. The Content-Type of the media will typically be filled in by the header or Scotty's best_guess, but this extended information provides the backend with more information so that it can make a better decision if needed. This is only used on media upload requests from Scotty.", + "type": "object", + "properties": { + "bestGuess": { + "description": "Scotty's best guess of what the content type of the file is.", + "type": "string" + }, + "fromHeader": { + "description": "The content type of the file as specified in the request headers, multipart headers, or RUPIO start request.", + "type": "string" + }, + "fromFileName": { + "description": "The content type of the file derived from the file extension of the original file name used by the client.", + "type": "string" + }, + "fromUrlPath": { + "description": "The content type of the file derived from the file extension of the URL path. The URL path is assumed to represent a file name (which is typically only true for agents that are providing a REST API).", + "type": "string" + }, + "fromBytes": { + "description": "The content type of the file derived by looking at specific bytes (i.e. \"magic bytes\") of the actual file.", + "type": "string" + }, + "fromFusionId": { + "description": "The content type of the file detected by Fusion ID. go/fusionid", + "type": "string" + }, + "fusionIdDetectionMetadata": { + "description": "Metadata information from Fusion ID detection. Serialized FusionIdDetectionMetadata proto. Only set if from_fusion_id is set.", "type": "string", - "description": "Required. The category for this rating.", - "enumDeprecated": [ - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - true - ], - "enum": [ - "HARM_CATEGORY_UNSPECIFIED", - "HARM_CATEGORY_DEROGATORY", - "HARM_CATEGORY_TOXICITY", - "HARM_CATEGORY_VIOLENCE", - "HARM_CATEGORY_SEXUAL", - "HARM_CATEGORY_MEDICAL", - "HARM_CATEGORY_DANGEROUS", - "HARM_CATEGORY_HARASSMENT", - "HARM_CATEGORY_HATE_SPEECH", - "HARM_CATEGORY_SEXUALLY_EXPLICIT", - "HARM_CATEGORY_DANGEROUS_CONTENT", - "HARM_CATEGORY_CIVIC_INTEGRITY" - ] + "format": "byte" + } + } + }, + "DownloadParameters": { + "id": "DownloadParameters", + "description": "Parameters specific to media downloads.", + "type": "object", + "properties": { + "allowGzipCompression": { + "description": "A boolean to be returned in the response to Scotty. Allows/disallows gzip encoding of the payload content when the server thinks it's advantageous (hence, does not guarantee compression) which allows Scotty to GZip the response to the client.", + "type": "boolean" }, - "blocked": { - "description": "Was this content blocked because of this rating?", + "ignoreRange": { + "description": "Determining whether or not Apiary should skip the inclusion of any Content-Range header on its response to Scotty.", "type": "boolean" } } }, - "ListTunedModelsResponse": { - "id": "ListTunedModelsResponse", - "description": "Response from `ListTunedModels` containing a paginated list of Models.", + "GenerateTextRequest": { + "id": "GenerateTextRequest", + "description": "Request to generate a text completion response from the model.", "type": "object", "properties": { - "tunedModels": { + "prompt": { + "description": "Required. The free-form input text given to the model as a prompt. Given a prompt, the model will generate a TextCompletion response it predicts as the completion of the input text.", + "$ref": "TextPrompt" + }, + "temperature": { + "description": "Optional. Controls the randomness of the output. Note: The default value varies by model, see the `Model.temperature` attribute of the `Model` returned the `getModel` function. Values can range from [0.0,1.0], inclusive. A value closer to 1.0 will produce responses that are more varied and creative, while a value closer to 0.0 will typically result in more straightforward responses from the model.", + "type": "number", + "format": "float" + }, + "candidateCount": { + "description": "Optional. Number of generated responses to return. This value must be between [1, 8], inclusive. If unset, this will default to 1.", + "type": "integer", + "format": "int32" + }, + "maxOutputTokens": { + "description": "Optional. The maximum number of tokens to include in a candidate. If unset, this will default to output_token_limit specified in the `Model` specification.", + "type": "integer", + "format": "int32" + }, + "topP": { + "description": "Optional. The maximum cumulative probability of tokens to consider when sampling. The model uses combined Top-k and nucleus sampling. Tokens are sorted based on their assigned probabilities so that only the most likely tokens are considered. Top-k sampling directly limits the maximum number of tokens to consider, while Nucleus sampling limits number of tokens based on the cumulative probability. Note: The default value varies by model, see the `Model.top_p` attribute of the `Model` returned the `getModel` function.", + "type": "number", + "format": "float" + }, + "topK": { + "description": "Optional. The maximum number of tokens to consider when sampling. The model uses combined Top-k and nucleus sampling. Top-k sampling considers the set of `top_k` most probable tokens. Defaults to 40. Note: The default value varies by model, see the `Model.top_k` attribute of the `Model` returned the `getModel` function.", + "type": "integer", + "format": "int32" + }, + "safetySettings": { + "description": "Optional. A list of unique `SafetySetting` instances for blocking unsafe content. that will be enforced on the `GenerateTextRequest.prompt` and `GenerateTextResponse.candidates`. There should not be more than one setting for each `SafetyCategory` type. The API will block any prompts and responses that fail to meet the thresholds set by these settings. This list overrides the default settings for each `SafetyCategory` specified in the safety_settings. If there is no `SafetySetting` for a given `SafetyCategory` provided in the list, the API will use the default safety setting for that category. Harm categories HARM_CATEGORY_DEROGATORY, HARM_CATEGORY_TOXICITY, HARM_CATEGORY_VIOLENCE, HARM_CATEGORY_SEXUAL, HARM_CATEGORY_MEDICAL, HARM_CATEGORY_DANGEROUS are supported in text service.", "type": "array", - "description": "The returned Models.", "items": { - "$ref": "TunedModel" + "$ref": "SafetySetting" } }, - "nextPageToken": { - "type": "string", - "description": "A token, which can be sent as `page_token` to retrieve the next page. If this field is omitted, there are no more pages." + "stopSequences": { + "description": "The set of character sequences (up to 5) that will stop output generation. If specified, the API will stop at the first appearance of a stop sequence. The stop sequence will not be included as part of the response.", + "type": "array", + "items": { + "type": "string" + } } } }, - "Message": { + "TextPrompt": { + "id": "TextPrompt", + "description": "Text given to the model as a prompt. The Model will use this TextPrompt to Generate a text completion.", + "type": "object", "properties": { - "citationMetadata": { - "$ref": "CitationMetadata", - "description": "Output only. Citation information for model-generated `content` in this `Message`. If this `Message` was generated as output from the model, this field may be populated with attribution information for any text included in the `content`. This field is used only on output.", - "readOnly": true - }, - "author": { - "description": "Optional. The author of this Message. This serves as a key for tagging the content of this Message when it is fed to the model as text. The author can be any alphanumeric string.", + "text": { + "description": "Required. The prompt text.", "type": "string" - }, - "content": { - "type": "string", - "description": "Required. The text content of the structured `Message`." } - }, - "id": "Message", - "description": "The base unit of structured text. A `Message` includes an `author` and the `content` of the `Message`. The `author` is used to tag messages when they are fed to the model as text.", - "type": "object" + } }, - "GoogleAiGenerativelanguageV1betaGroundingSupport": { + "GenerateTextResponse": { + "id": "GenerateTextResponse", + "description": "The response from the model, including candidate completions.", "type": "object", - "id": "GoogleAiGenerativelanguageV1betaGroundingSupport", - "description": "Grounding support.", "properties": { - "confidenceScores": { - "description": "Optional. Confidence score of the support references. Ranges from 0 to 1. 1 is the most confident. This list must have the same size as the grounding_chunk_indices.", + "candidates": { + "description": "Candidate responses from the model.", + "type": "array", "items": { - "type": "number", - "format": "float" - }, - "type": "array" + "$ref": "TextCompletion" + } }, - "renderedParts": { - "description": "Output only. Indices into the `parts` field of the candidate's content. These indices specify which rendered parts are associated with this support source.", - "readOnly": true, + "filters": { + "description": "A set of content filtering metadata for the prompt and response text. This indicates which `SafetyCategory`(s) blocked a candidate from this response, the lowest `HarmProbability` that triggered a block, and the HarmThreshold setting for that category. This indicates the smallest change to the `SafetySettings` that would be necessary to unblock at least 1 response. The blocking is configured by the `SafetySettings` in the request (or the default `SafetySettings` of the API).", + "type": "array", "items": { - "type": "integer", - "format": "int32" - }, - "type": "array" - }, - "segment": { - "description": "Segment of the content this support belongs to.", - "$ref": "GoogleAiGenerativelanguageV1betaSegment" + "$ref": "ContentFilter" + } }, - "groundingChunkIndices": { + "safetyFeedback": { + "description": "Returns any safety feedback related to content filtering.", "type": "array", - "description": "Optional. A list of indices (into 'grounding_chunk' in `response.candidate.grounding_metadata`) specifying the citations associated with the claim. For instance [1,3,4] means that grounding_chunk[1], grounding_chunk[3], grounding_chunk[4] are the retrieved content attributed to the claim. If the response is streaming, the grounding_chunk_indices refer to the indices across all responses. It is the client's responsibility to accumulate the grounding chunks from all responses (while maintaining the same order).", "items": { - "type": "integer", - "format": "int32" + "$ref": "SafetyFeedback" } } } }, - "UsageMetadata": { + "TextCompletion": { + "id": "TextCompletion", + "description": "Output text returned from a model.", + "type": "object", "properties": { - "thoughtsTokenCount": { - "type": "integer", - "description": "Output only. Number of tokens of thoughts for thinking models.", + "output": { + "description": "Output only. The generated text returned from the model.", "readOnly": true, - "format": "int32" - }, - "candidatesTokenCount": { - "type": "integer", - "description": "Total number of tokens across all the generated response candidates.", - "format": "int32" + "type": "string" }, - "promptTokensDetails": { + "safetyRatings": { + "description": "Ratings for the safety of a response. There is at most one rating per category.", "type": "array", - "description": "Output only. List of modalities that were processed in the request input.", - "readOnly": true, "items": { - "$ref": "ModalityTokenCount" + "$ref": "SafetyRating" } }, - "toolUsePromptTokenCount": { - "description": "Output only. Number of tokens present in tool-use prompt(s).", + "citationMetadata": { + "description": "Output only. Citation information for model-generated `output` in this `TextCompletion`. This field may be populated with attribution information for any text included in the `output`.", "readOnly": true, - "type": "integer", - "format": "int32" + "$ref": "CitationMetadata" + } + } + }, + "SafetyFeedback": { + "id": "SafetyFeedback", + "description": "Safety feedback for an entire request. This field is populated if content in the input and/or response is blocked due to safety settings. SafetyFeedback may not exist for every HarmCategory. Each SafetyFeedback will return the safety settings used by the request as well as the lowest HarmProbability that should be allowed in order to return a result.", + "type": "object", + "properties": { + "rating": { + "description": "Safety rating evaluated from content.", + "$ref": "SafetyRating" }, - "candidatesTokensDetails": { - "description": "Output only. List of modalities that were returned in the response.", - "readOnly": true, - "items": { - "$ref": "ModalityTokenCount" - }, - "type": "array" + "setting": { + "description": "Safety settings applied to the request.", + "$ref": "SafetySetting" + } + } + }, + "EmbedTextRequest": { + "id": "EmbedTextRequest", + "description": "Request to get a text embedding from the model.", + "type": "object", + "properties": { + "model": { + "description": "Required. The model name to use with the format model=models/{model}.", + "type": "string" }, - "toolUsePromptTokensDetails": { - "description": "Output only. List of modalities that were processed for tool-use request inputs.", - "readOnly": true, + "text": { + "description": "Optional. The free-form input text that the model will turn into an embedding.", + "type": "string" + } + } + }, + "EmbedTextResponse": { + "id": "EmbedTextResponse", + "description": "The response to a EmbedTextRequest.", + "type": "object", + "properties": { + "embedding": { + "description": "Output only. The embedding generated from the input text.", + "readOnly": true, + "$ref": "Embedding" + } + } + }, + "Embedding": { + "id": "Embedding", + "description": "A list of floats representing the embedding.", + "type": "object", + "properties": { + "value": { + "description": "The embedding values.", + "type": "array", "items": { - "$ref": "ModalityTokenCount" - }, - "type": "array" - }, - "promptTokenCount": { - "format": "int32", - "description": "Number of tokens in the prompt. When `cached_content` is set, this is still the total effective prompt size meaning this includes the number of tokens in the cached content.", - "type": "integer" - }, - "totalTokenCount": { - "format": "int32", - "description": "Total token count for the generation request (prompt + thoughts + response candidates).", - "type": "integer" - }, - "cachedContentTokenCount": { - "format": "int32", - "description": "Number of tokens in the cached part of the prompt (the cached content)", - "type": "integer" + "type": "number", + "format": "float" + } + } + } + }, + "BatchEmbedTextRequest": { + "id": "BatchEmbedTextRequest", + "description": "Batch request to get a text embedding from the model.", + "type": "object", + "properties": { + "texts": { + "description": "Optional. The free-form input texts that the model will turn into an embedding. The current limit is 100 texts, over which an error will be thrown.", + "type": "array", + "items": { + "type": "string" + } }, - "cacheTokensDetails": { - "description": "Output only. List of modalities of the cached content in the request input.", + "requests": { + "description": "Optional. Embed requests for the batch. Only one of `texts` or `requests` can be set.", + "type": "array", + "items": { + "$ref": "EmbedTextRequest" + } + } + } + }, + "BatchEmbedTextResponse": { + "id": "BatchEmbedTextResponse", + "description": "The response to a EmbedTextRequest.", + "type": "object", + "properties": { + "embeddings": { + "description": "Output only. The embeddings generated from the input text.", "readOnly": true, + "type": "array", "items": { - "$ref": "ModalityTokenCount" - }, - "type": "array" + "$ref": "Embedding" + } } - }, + } + }, + "CountTextTokensRequest": { + "id": "CountTextTokensRequest", + "description": "Counts the number of tokens in the `prompt` sent to a model. Models may tokenize text differently, so each model may return a different `token_count`.", "type": "object", - "id": "UsageMetadata", - "description": "Metadata on the generation request's token usage." + "properties": { + "prompt": { + "description": "Required. The free-form input text given to the model as a prompt.", + "$ref": "TextPrompt" + } + } }, - "ModalityTokenCount": { + "CountTextTokensResponse": { + "id": "CountTextTokensResponse", + "description": "A response from `CountTextTokens`. It returns the model's `token_count` for the `prompt`.", + "type": "object", "properties": { - "modality": { - "description": "The modality associated with this token count.", - "type": "string", - "enumDescriptions": [ - "Unspecified modality.", - "Plain text.", - "Image.", - "Video.", - "Audio.", - "Document, e.g. PDF." - ], - "enum": [ - "MODALITY_UNSPECIFIED", - "TEXT", - "IMAGE", - "VIDEO", - "AUDIO", - "DOCUMENT" - ] - }, "tokenCount": { - "description": "Number of tokens.", + "description": "The number of tokens that the `model` tokenizes the `prompt` into. Always non-negative.", "type": "integer", "format": "int32" } - }, - "id": "ModalityTokenCount", - "description": "Represents token counting info for a single modality.", - "type": "object" + } } }, "parameters": { - "callback": { - "type": "string", - "location": "query", - "description": "JSONP" - }, "access_token": { "type": "string", - "location": "query", - "description": "OAuth access token." - }, - "prettyPrint": { - "type": "boolean", - "default": "true", - "location": "query", - "description": "Returns response with indentations and line breaks." + "description": "OAuth access token.", + "location": "query" }, - "oauth_token": { + "alt": { "type": "string", - "location": "query", - "description": "OAuth 2.0 token for the current user." + "description": "Data format for response.", + "default": "json", + "enum": [ + "json", + "media", + "proto" + ], + "enumDescriptions": [ + "Responses with Content-Type of application/json", + "Media download with context-dependent Content-Type", + "Responses with Content-Type of application/x-protobuf" + ], + "location": "query" }, - "uploadType": { + "callback": { "type": "string", - "location": "query", - "description": "Legacy upload protocol for media (e.g. \"media\", \"multipart\")." + "description": "JSONP", + "location": "query" }, "fields": { "type": "string", - "location": "query", - "description": "Selector specifying which fields to include in a partial response." + "description": "Selector specifying which fields to include in a partial response.", + "location": "query" }, "key": { "type": "string", - "location": "query", - "description": "API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token." + "description": "API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.", + "location": "query" }, - "upload_protocol": { + "oauth_token": { "type": "string", - "location": "query", - "description": "Upload protocol for media (e.g. \"raw\", \"multipart\")." + "description": "OAuth 2.0 token for the current user.", + "location": "query" }, - "alt": { - "enum": [ - "json", - "media", - "proto" - ], - "description": "Data format for response.", - "type": "string", - "enumDescriptions": [ - "Responses with Content-Type of application/json", - "Media download with context-dependent Content-Type", - "Responses with Content-Type of application/x-protobuf" - ], - "default": "json", + "prettyPrint": { + "type": "boolean", + "description": "Returns response with indentations and line breaks.", + "default": "true", "location": "query" }, "quotaUser": { + "type": "string", "description": "Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.", + "location": "query" + }, + "upload_protocol": { + "type": "string", + "description": "Upload protocol for media (e.g. \"raw\", \"multipart\").", + "location": "query" + }, + "uploadType": { "type": "string", + "description": "Legacy upload protocol for media (e.g. \"media\", \"multipart\").", "location": "query" }, "$.xgafv": { - "enumDescriptions": [ - "v1 error format", - "v2 error format" - ], - "location": "query", + "type": "string", + "description": "V1 error format.", "enum": [ "1", "2" ], - "type": "string", - "description": "V1 error format." + "enumDescriptions": [ + "v1 error format", + "v2 error format" + ], + "location": "query" } }, - "title": "Gemini API", - "batchPath": "batch", - "name": "generativelanguage", - "version": "v1beta", - "ownerDomain": "google.com", + "canonicalName": "Generative Language", + "ownerName": "Google", + "basePath": "", + "id": "generativelanguage:v1beta", + "description": "The Gemini API allows developers to build generative AI applications using Gemini models. Gemini is our most capable model, built from the ground up to be multimodal. It can generalize and seamlessly understand, operate across, and combine different types of information including language, images, audio, video, and code. You can use the Gemini API for use cases like reasoning across text and images, content generation, dialogue agents, summarization and classification systems, and more.", "mtlsRootUrl": "https://generativelanguage.mtls.googleapis.com/", - "baseUrl": "https://generativelanguage.googleapis.com/", - "canonicalName": "Generative Language" + "version_module": true, + "protocol": "rest", + "rootUrl": "https://generativelanguage.googleapis.com/", + "kind": "discovery#restDescription", + "servicePath": "", + "resources": { + "batches": { + "methods": { + "list": { + "id": "generativelanguage.batches.list", + "path": "v1beta/{+name}", + "flatPath": "v1beta/batches", + "httpMethod": "GET", + "parameters": { + "name": { + "description": "The name of the operation's parent resource.", + "pattern": "^batches$", + "location": "path", + "required": true, + "type": "string" + }, + "filter": { + "description": "The standard list filter.", + "location": "query", + "type": "string" + }, + "pageSize": { + "description": "The standard list page size.", + "location": "query", + "type": "integer", + "format": "int32" + }, + "pageToken": { + "description": "The standard list page token.", + "location": "query", + "type": "string" + }, + "returnPartialSuccess": { + "description": "When set to `true`, operations that are reachable are returned as normal, and those that are unreachable are returned in the ListOperationsResponse.unreachable field. This can only be `true` when reading across collections. For example, when `parent` is set to `\"projects/example/locations/-\"`. This field is not supported by default and will result in an `UNIMPLEMENTED` error if set unless explicitly documented otherwise in service or product specific documentation.", + "location": "query", + "type": "boolean" + } + }, + "parameterOrder": [ + "name" + ], + "response": { + "$ref": "ListOperationsResponse" + }, + "description": "Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns `UNIMPLEMENTED`." + }, + "get": { + "id": "generativelanguage.batches.get", + "path": "v1beta/{+name}", + "flatPath": "v1beta/batches/{batchesId}", + "httpMethod": "GET", + "parameters": { + "name": { + "description": "The name of the operation resource.", + "pattern": "^batches/[^/]+$", + "location": "path", + "required": true, + "type": "string" + } + }, + "parameterOrder": [ + "name" + ], + "response": { + "$ref": "Operation" + }, + "description": "Gets the latest state of a long-running operation. Clients can use this method to poll the operation result at intervals as recommended by the API service." + }, + "delete": { + "id": "generativelanguage.batches.delete", + "path": "v1beta/{+name}", + "flatPath": "v1beta/batches/{batchesId}", + "httpMethod": "DELETE", + "parameters": { + "name": { + "description": "The name of the operation resource to be deleted.", + "pattern": "^batches/[^/]+$", + "location": "path", + "required": true, + "type": "string" + } + }, + "parameterOrder": [ + "name" + ], + "response": { + "$ref": "Empty" + }, + "description": "Deletes a long-running operation. This method indicates that the client is no longer interested in the operation result. It does not cancel the operation. If the server doesn't support this method, it returns `google.rpc.Code.UNIMPLEMENTED`." + }, + "cancel": { + "id": "generativelanguage.batches.cancel", + "path": "v1beta/{+name}:cancel", + "flatPath": "v1beta/batches/{batchesId}:cancel", + "httpMethod": "POST", + "parameters": { + "name": { + "description": "The name of the operation resource to be cancelled.", + "pattern": "^batches/[^/]+$", + "location": "path", + "required": true, + "type": "string" + } + }, + "parameterOrder": [ + "name" + ], + "response": { + "$ref": "Empty" + }, + "description": "Starts asynchronous cancellation on a long-running operation. The server makes a best effort to cancel the operation, but success is not guaranteed. If the server doesn't support this method, it returns `google.rpc.Code.UNIMPLEMENTED`. Clients can use Operations.GetOperation or other methods to check whether the cancellation succeeded or whether the operation completed despite cancellation. On successful cancellation, the operation is not deleted; instead, it becomes an operation with an Operation.error value with a google.rpc.Status.code of `1`, corresponding to `Code.CANCELLED`." + }, + "updateGenerateContentBatch": { + "id": "generativelanguage.batches.updateGenerateContentBatch", + "path": "v1beta/{+name}:updateGenerateContentBatch", + "flatPath": "v1beta/batches/{batchesId}:updateGenerateContentBatch", + "httpMethod": "PATCH", + "parameters": { + "name": { + "description": "Output only. Identifier. Resource name of the batch. Format: `batches/{batch_id}`.", + "pattern": "^batches/[^/]+$", + "location": "path", + "required": true, + "type": "string" + }, + "updateMask": { + "description": "Optional. The list of fields to update.", + "location": "query", + "type": "string", + "format": "google-fieldmask" + } + }, + "parameterOrder": [ + "name" + ], + "request": { + "$ref": "GenerateContentBatch" + }, + "response": { + "$ref": "GenerateContentBatch" + }, + "description": "Updates a batch of GenerateContent requests for batch processing." + }, + "updateEmbedContentBatch": { + "id": "generativelanguage.batches.updateEmbedContentBatch", + "path": "v1beta/{+name}:updateEmbedContentBatch", + "flatPath": "v1beta/batches/{batchesId}:updateEmbedContentBatch", + "httpMethod": "PATCH", + "parameters": { + "name": { + "description": "Output only. Identifier. Resource name of the batch. Format: `batches/{batch_id}`.", + "pattern": "^batches/[^/]+$", + "location": "path", + "required": true, + "type": "string" + }, + "updateMask": { + "description": "Optional. The list of fields to update.", + "location": "query", + "type": "string", + "format": "google-fieldmask" + } + }, + "parameterOrder": [ + "name" + ], + "request": { + "$ref": "EmbedContentBatch" + }, + "response": { + "$ref": "EmbedContentBatch" + }, + "description": "Updates a batch of EmbedContent requests for batch processing." + } + } + }, + "models": { + "methods": { + "generateContent": { + "id": "generativelanguage.models.generateContent", + "path": "v1beta/{+model}:generateContent", + "flatPath": "v1beta/models/{modelsId}:generateContent", + "httpMethod": "POST", + "parameters": { + "model": { + "description": "Required. The name of the `Model` to use for generating the completion. Format: `models/{model}`.", + "pattern": "^models/[^/]+$", + "location": "path", + "required": true, + "type": "string" + } + }, + "parameterOrder": [ + "model" + ], + "request": { + "$ref": "GenerateContentRequest" + }, + "response": { + "$ref": "GenerateContentResponse" + }, + "description": "Generates a model response given an input `GenerateContentRequest`. Refer to the [text generation guide](https://ai.google.dev/gemini-api/docs/text-generation) for detailed usage information. Input capabilities differ between models, including tuned models. Refer to the [model guide](https://ai.google.dev/gemini-api/docs/models/gemini) and [tuning guide](https://ai.google.dev/gemini-api/docs/model-tuning) for details." + }, + "generateAnswer": { + "id": "generativelanguage.models.generateAnswer", + "path": "v1beta/{+model}:generateAnswer", + "flatPath": "v1beta/models/{modelsId}:generateAnswer", + "httpMethod": "POST", + "parameters": { + "model": { + "description": "Required. The name of the `Model` to use for generating the grounded response. Format: `model=models/{model}`.", + "pattern": "^models/[^/]+$", + "location": "path", + "required": true, + "type": "string" + } + }, + "parameterOrder": [ + "model" + ], + "request": { + "$ref": "GenerateAnswerRequest" + }, + "response": { + "$ref": "GenerateAnswerResponse" + }, + "description": "Generates a grounded answer from the model given an input `GenerateAnswerRequest`." + }, + "streamGenerateContent": { + "id": "generativelanguage.models.streamGenerateContent", + "path": "v1beta/{+model}:streamGenerateContent", + "flatPath": "v1beta/models/{modelsId}:streamGenerateContent", + "httpMethod": "POST", + "parameters": { + "model": { + "description": "Required. The name of the `Model` to use for generating the completion. Format: `models/{model}`.", + "pattern": "^models/[^/]+$", + "location": "path", + "required": true, + "type": "string" + } + }, + "parameterOrder": [ + "model" + ], + "request": { + "$ref": "GenerateContentRequest" + }, + "response": { + "$ref": "GenerateContentResponse" + }, + "description": "Generates a [streamed response](https://ai.google.dev/gemini-api/docs/text-generation?lang=python#generate-a-text-stream) from the model given an input `GenerateContentRequest`." + }, + "embedContent": { + "id": "generativelanguage.models.embedContent", + "path": "v1beta/{+model}:embedContent", + "flatPath": "v1beta/models/{modelsId}:embedContent", + "httpMethod": "POST", + "parameters": { + "model": { + "description": "Required. The model's resource name. This serves as an ID for the Model to use. This name should match a model name returned by the `ListModels` method. Format: `models/{model}`", + "pattern": "^models/[^/]+$", + "location": "path", + "required": true, + "type": "string" + } + }, + "parameterOrder": [ + "model" + ], + "request": { + "$ref": "EmbedContentRequest" + }, + "response": { + "$ref": "EmbedContentResponse" + }, + "description": "Generates a text embedding vector from the input `Content` using the specified [Gemini Embedding model](https://ai.google.dev/gemini-api/docs/models/gemini#text-embedding)." + }, + "batchEmbedContents": { + "id": "generativelanguage.models.batchEmbedContents", + "path": "v1beta/{+model}:batchEmbedContents", + "flatPath": "v1beta/models/{modelsId}:batchEmbedContents", + "httpMethod": "POST", + "parameters": { + "model": { + "description": "Required. The model's resource name. This serves as an ID for the Model to use. This name should match a model name returned by the `ListModels` method. Format: `models/{model}`", + "pattern": "^models/[^/]+$", + "location": "path", + "required": true, + "type": "string" + } + }, + "parameterOrder": [ + "model" + ], + "request": { + "$ref": "BatchEmbedContentsRequest" + }, + "response": { + "$ref": "BatchEmbedContentsResponse" + }, + "description": "Generates multiple embedding vectors from the input `Content` which consists of a batch of strings represented as `EmbedContentRequest` objects." + }, + "countTokens": { + "id": "generativelanguage.models.countTokens", + "path": "v1beta/{+model}:countTokens", + "flatPath": "v1beta/models/{modelsId}:countTokens", + "httpMethod": "POST", + "parameters": { + "model": { + "description": "Required. The model's resource name. This serves as an ID for the Model to use. This name should match a model name returned by the `ListModels` method. Format: `models/{model}`", + "pattern": "^models/[^/]+$", + "location": "path", + "required": true, + "type": "string" + } + }, + "parameterOrder": [ + "model" + ], + "request": { + "$ref": "CountTokensRequest" + }, + "response": { + "$ref": "CountTokensResponse" + }, + "description": "Runs a model's tokenizer on input `Content` and returns the token count. Refer to the [tokens guide](https://ai.google.dev/gemini-api/docs/tokens) to learn more about tokens." + }, + "batchGenerateContent": { + "id": "generativelanguage.models.batchGenerateContent", + "path": "v1beta/{+model}:batchGenerateContent", + "flatPath": "v1beta/models/{modelsId}:batchGenerateContent", + "httpMethod": "POST", + "parameters": { + "model": { + "description": "Required. The name of the `Model` to use for generating the completion. Format: `models/{model}`.", + "pattern": "^models/[^/]+$", + "location": "path", + "required": true, + "type": "string" + } + }, + "parameterOrder": [ + "model" + ], + "request": { + "$ref": "BatchGenerateContentRequest" + }, + "response": { + "$ref": "Operation" + }, + "description": "Enqueues a batch of `GenerateContent` requests for batch processing." + }, + "asyncBatchEmbedContent": { + "id": "generativelanguage.models.asyncBatchEmbedContent", + "path": "v1beta/{+model}:asyncBatchEmbedContent", + "flatPath": "v1beta/models/{modelsId}:asyncBatchEmbedContent", + "httpMethod": "POST", + "parameters": { + "model": { + "description": "Required. The name of the `Model` to use for generating the completion. Format: `models/{model}`.", + "pattern": "^models/[^/]+$", + "location": "path", + "required": true, + "type": "string" + } + }, + "parameterOrder": [ + "model" + ], + "request": { + "$ref": "AsyncBatchEmbedContentRequest" + }, + "response": { + "$ref": "Operation" + }, + "description": "Enqueues a batch of `EmbedContent` requests for batch processing. We have a `BatchEmbedContents` handler in `GenerativeService`, but it was synchronized. So we name this one to be `Async` to avoid confusion." + }, + "generateMessage": { + "id": "generativelanguage.models.generateMessage", + "path": "v1beta/{+model}:generateMessage", + "flatPath": "v1beta/models/{modelsId}:generateMessage", + "httpMethod": "POST", + "parameters": { + "model": { + "description": "Required. The name of the model to use. Format: `name=models/{model}`.", + "pattern": "^models/[^/]+$", + "location": "path", + "required": true, + "type": "string" + } + }, + "parameterOrder": [ + "model" + ], + "request": { + "$ref": "GenerateMessageRequest" + }, + "response": { + "$ref": "GenerateMessageResponse" + }, + "description": "Generates a response from the model given an input `MessagePrompt`." + }, + "countMessageTokens": { + "id": "generativelanguage.models.countMessageTokens", + "path": "v1beta/{+model}:countMessageTokens", + "flatPath": "v1beta/models/{modelsId}:countMessageTokens", + "httpMethod": "POST", + "parameters": { + "model": { + "description": "Required. The model's resource name. This serves as an ID for the Model to use. This name should match a model name returned by the `ListModels` method. Format: `models/{model}`", + "pattern": "^models/[^/]+$", + "location": "path", + "required": true, + "type": "string" + } + }, + "parameterOrder": [ + "model" + ], + "request": { + "$ref": "CountMessageTokensRequest" + }, + "response": { + "$ref": "CountMessageTokensResponse" + }, + "description": "Runs a model's tokenizer on a string and returns the token count." + }, + "get": { + "id": "generativelanguage.models.get", + "path": "v1beta/{+name}", + "flatPath": "v1beta/models/{modelsId}", + "httpMethod": "GET", + "parameters": { + "name": { + "description": "Required. The resource name of the model. This name should match a model name returned by the `ListModels` method. Format: `models/{model}`", + "pattern": "^models/[^/]+$", + "location": "path", + "required": true, + "type": "string" + } + }, + "parameterOrder": [ + "name" + ], + "response": { + "$ref": "Model" + }, + "description": "Gets information about a specific `Model` such as its version number, token limits, [parameters](https://ai.google.dev/gemini-api/docs/models/generative-models#model-parameters) and other metadata. Refer to the [Gemini models guide](https://ai.google.dev/gemini-api/docs/models/gemini) for detailed model information." + }, + "list": { + "id": "generativelanguage.models.list", + "path": "v1beta/models", + "flatPath": "v1beta/models", + "httpMethod": "GET", + "parameters": { + "pageSize": { + "description": "The maximum number of `Models` to return (per page). If unspecified, 50 models will be returned per page. This method returns at most 1000 models per page, even if you pass a larger page_size.", + "location": "query", + "type": "integer", + "format": "int32" + }, + "pageToken": { + "description": "A page token, received from a previous `ListModels` call. Provide the `page_token` returned by one request as an argument to the next request to retrieve the next page. When paginating, all other parameters provided to `ListModels` must match the call that provided the page token.", + "location": "query", + "type": "string" + } + }, + "parameterOrder": [], + "response": { + "$ref": "ListModelsResponse" + }, + "description": "Lists the [`Model`s](https://ai.google.dev/gemini-api/docs/models/gemini) available through the Gemini API." + }, + "predict": { + "id": "generativelanguage.models.predict", + "path": "v1beta/{+model}:predict", + "flatPath": "v1beta/models/{modelsId}:predict", + "httpMethod": "POST", + "parameters": { + "model": { + "description": "Required. The name of the model for prediction. Format: `name=models/{model}`.", + "pattern": "^models/[^/]+$", + "location": "path", + "required": true, + "type": "string" + } + }, + "parameterOrder": [ + "model" + ], + "request": { + "$ref": "PredictRequest" + }, + "response": { + "$ref": "PredictResponse" + }, + "description": "Performs a prediction request." + }, + "predictLongRunning": { + "id": "generativelanguage.models.predictLongRunning", + "path": "v1beta/{+model}:predictLongRunning", + "flatPath": "v1beta/models/{modelsId}:predictLongRunning", + "httpMethod": "POST", + "parameters": { + "model": { + "description": "Required. The name of the model for prediction. Format: `name=models/{model}`.", + "pattern": "^models/[^/]+$", + "location": "path", + "required": true, + "type": "string" + } + }, + "parameterOrder": [ + "model" + ], + "request": { + "$ref": "PredictLongRunningRequest" + }, + "response": { + "$ref": "Operation" + }, + "description": "Same as Predict but returns an LRO." + }, + "generateText": { + "id": "generativelanguage.models.generateText", + "path": "v1beta/{+model}:generateText", + "flatPath": "v1beta/models/{modelsId}:generateText", + "httpMethod": "POST", + "parameters": { + "model": { + "description": "Required. The name of the `Model` or `TunedModel` to use for generating the completion. Examples: models/text-bison-001 tunedModels/sentence-translator-u3b7m", + "pattern": "^models/[^/]+$", + "location": "path", + "required": true, + "type": "string" + } + }, + "parameterOrder": [ + "model" + ], + "request": { + "$ref": "GenerateTextRequest" + }, + "response": { + "$ref": "GenerateTextResponse" + }, + "description": "Generates a response from the model given an input message." + }, + "embedText": { + "id": "generativelanguage.models.embedText", + "path": "v1beta/{+model}:embedText", + "flatPath": "v1beta/models/{modelsId}:embedText", + "httpMethod": "POST", + "parameters": { + "model": { + "description": "Required. The model name to use with the format model=models/{model}.", + "pattern": "^models/[^/]+$", + "location": "path", + "required": true, + "type": "string" + } + }, + "parameterOrder": [ + "model" + ], + "request": { + "$ref": "EmbedTextRequest" + }, + "response": { + "$ref": "EmbedTextResponse" + }, + "description": "Generates an embedding from the model given an input message." + }, + "batchEmbedText": { + "id": "generativelanguage.models.batchEmbedText", + "path": "v1beta/{+model}:batchEmbedText", + "flatPath": "v1beta/models/{modelsId}:batchEmbedText", + "httpMethod": "POST", + "parameters": { + "model": { + "description": "Required. The name of the `Model` to use for generating the embedding. Examples: models/embedding-gecko-001", + "pattern": "^models/[^/]+$", + "location": "path", + "required": true, + "type": "string" + } + }, + "parameterOrder": [ + "model" + ], + "request": { + "$ref": "BatchEmbedTextRequest" + }, + "response": { + "$ref": "BatchEmbedTextResponse" + }, + "description": "Generates multiple embeddings from the model given input text in a synchronous call." + }, + "countTextTokens": { + "id": "generativelanguage.models.countTextTokens", + "path": "v1beta/{+model}:countTextTokens", + "flatPath": "v1beta/models/{modelsId}:countTextTokens", + "httpMethod": "POST", + "parameters": { + "model": { + "description": "Required. The model's resource name. This serves as an ID for the Model to use. This name should match a model name returned by the `ListModels` method. Format: `models/{model}`", + "pattern": "^models/[^/]+$", + "location": "path", + "required": true, + "type": "string" + } + }, + "parameterOrder": [ + "model" + ], + "request": { + "$ref": "CountTextTokensRequest" + }, + "response": { + "$ref": "CountTextTokensResponse" + }, + "description": "Runs a model's tokenizer on a text and returns the token count." + } + }, + "resources": { + "operations": { + "methods": { + "list": { + "id": "generativelanguage.models.operations.list", + "path": "v1beta/{+name}/operations", + "flatPath": "v1beta/models/{modelsId}/operations", + "httpMethod": "GET", + "parameters": { + "name": { + "description": "The name of the operation's parent resource.", + "pattern": "^models/[^/]+$", + "location": "path", + "required": true, + "type": "string" + }, + "filter": { + "description": "The standard list filter.", + "location": "query", + "type": "string" + }, + "pageSize": { + "description": "The standard list page size.", + "location": "query", + "type": "integer", + "format": "int32" + }, + "pageToken": { + "description": "The standard list page token.", + "location": "query", + "type": "string" + }, + "returnPartialSuccess": { + "description": "When set to `true`, operations that are reachable are returned as normal, and those that are unreachable are returned in the ListOperationsResponse.unreachable field. This can only be `true` when reading across collections. For example, when `parent` is set to `\"projects/example/locations/-\"`. This field is not supported by default and will result in an `UNIMPLEMENTED` error if set unless explicitly documented otherwise in service or product specific documentation.", + "location": "query", + "type": "boolean" + } + }, + "parameterOrder": [ + "name" + ], + "response": { + "$ref": "ListOperationsResponse" + }, + "description": "Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns `UNIMPLEMENTED`." + }, + "get": { + "id": "generativelanguage.models.operations.get", + "path": "v1beta/{+name}", + "flatPath": "v1beta/models/{modelsId}/operations/{operationsId}", + "httpMethod": "GET", + "parameters": { + "name": { + "description": "The name of the operation resource.", + "pattern": "^models/[^/]+/operations/[^/]+$", + "location": "path", + "required": true, + "type": "string" + } + }, + "parameterOrder": [ + "name" + ], + "response": { + "$ref": "Operation" + }, + "description": "Gets the latest state of a long-running operation. Clients can use this method to poll the operation result at intervals as recommended by the API service." + } + } + } + } + }, + "tunedModels": { + "methods": { + "generateContent": { + "id": "generativelanguage.tunedModels.generateContent", + "path": "v1beta/{+model}:generateContent", + "flatPath": "v1beta/tunedModels/{tunedModelsId}:generateContent", + "httpMethod": "POST", + "parameters": { + "model": { + "description": "Required. The name of the `Model` to use for generating the completion. Format: `models/{model}`.", + "pattern": "^tunedModels/[^/]+$", + "location": "path", + "required": true, + "type": "string" + } + }, + "parameterOrder": [ + "model" + ], + "request": { + "$ref": "GenerateContentRequest" + }, + "response": { + "$ref": "GenerateContentResponse" + }, + "description": "Generates a model response given an input `GenerateContentRequest`. Refer to the [text generation guide](https://ai.google.dev/gemini-api/docs/text-generation) for detailed usage information. Input capabilities differ between models, including tuned models. Refer to the [model guide](https://ai.google.dev/gemini-api/docs/models/gemini) and [tuning guide](https://ai.google.dev/gemini-api/docs/model-tuning) for details." + }, + "streamGenerateContent": { + "id": "generativelanguage.tunedModels.streamGenerateContent", + "path": "v1beta/{+model}:streamGenerateContent", + "flatPath": "v1beta/tunedModels/{tunedModelsId}:streamGenerateContent", + "httpMethod": "POST", + "parameters": { + "model": { + "description": "Required. The name of the `Model` to use for generating the completion. Format: `models/{model}`.", + "pattern": "^tunedModels/[^/]+$", + "location": "path", + "required": true, + "type": "string" + } + }, + "parameterOrder": [ + "model" + ], + "request": { + "$ref": "GenerateContentRequest" + }, + "response": { + "$ref": "GenerateContentResponse" + }, + "description": "Generates a [streamed response](https://ai.google.dev/gemini-api/docs/text-generation?lang=python#generate-a-text-stream) from the model given an input `GenerateContentRequest`." + }, + "batchGenerateContent": { + "id": "generativelanguage.tunedModels.batchGenerateContent", + "path": "v1beta/{+model}:batchGenerateContent", + "flatPath": "v1beta/tunedModels/{tunedModelsId}:batchGenerateContent", + "httpMethod": "POST", + "parameters": { + "model": { + "description": "Required. The name of the `Model` to use for generating the completion. Format: `models/{model}`.", + "pattern": "^tunedModels/[^/]+$", + "location": "path", + "required": true, + "type": "string" + } + }, + "parameterOrder": [ + "model" + ], + "request": { + "$ref": "BatchGenerateContentRequest" + }, + "response": { + "$ref": "Operation" + }, + "description": "Enqueues a batch of `GenerateContent` requests for batch processing." + }, + "asyncBatchEmbedContent": { + "id": "generativelanguage.tunedModels.asyncBatchEmbedContent", + "path": "v1beta/{+model}:asyncBatchEmbedContent", + "flatPath": "v1beta/tunedModels/{tunedModelsId}:asyncBatchEmbedContent", + "httpMethod": "POST", + "parameters": { + "model": { + "description": "Required. The name of the `Model` to use for generating the completion. Format: `models/{model}`.", + "pattern": "^tunedModels/[^/]+$", + "location": "path", + "required": true, + "type": "string" + } + }, + "parameterOrder": [ + "model" + ], + "request": { + "$ref": "AsyncBatchEmbedContentRequest" + }, + "response": { + "$ref": "Operation" + }, + "description": "Enqueues a batch of `EmbedContent` requests for batch processing. We have a `BatchEmbedContents` handler in `GenerativeService`, but it was synchronized. So we name this one to be `Async` to avoid confusion." + }, + "get": { + "id": "generativelanguage.tunedModels.get", + "path": "v1beta/{+name}", + "flatPath": "v1beta/tunedModels/{tunedModelsId}", + "httpMethod": "GET", + "parameters": { + "name": { + "description": "Required. The resource name of the model. Format: `tunedModels/my-model-id`", + "pattern": "^tunedModels/[^/]+$", + "location": "path", + "required": true, + "type": "string" + } + }, + "parameterOrder": [ + "name" + ], + "response": { + "$ref": "TunedModel" + }, + "description": "Gets information about a specific TunedModel." + }, + "list": { + "id": "generativelanguage.tunedModels.list", + "path": "v1beta/tunedModels", + "flatPath": "v1beta/tunedModels", + "httpMethod": "GET", + "parameters": { + "pageSize": { + "description": "Optional. The maximum number of `TunedModels` to return (per page). The service may return fewer tuned models. If unspecified, at most 10 tuned models will be returned. This method returns at most 1000 models per page, even if you pass a larger page_size.", + "location": "query", + "type": "integer", + "format": "int32" + }, + "pageToken": { + "description": "Optional. A page token, received from a previous `ListTunedModels` call. Provide the `page_token` returned by one request as an argument to the next request to retrieve the next page. When paginating, all other parameters provided to `ListTunedModels` must match the call that provided the page token.", + "location": "query", + "type": "string" + }, + "filter": { + "description": "Optional. A filter is a full text search over the tuned model's description and display name. By default, results will not include tuned models shared with everyone. Additional operators: - owner:me - writers:me - readers:me - readers:everyone Examples: \"owner:me\" returns all tuned models to which caller has owner role \"readers:me\" returns all tuned models to which caller has reader role \"readers:everyone\" returns all tuned models that are shared with everyone", + "location": "query", + "type": "string" + } + }, + "parameterOrder": [], + "response": { + "$ref": "ListTunedModelsResponse" + }, + "description": "Lists created tuned models." + }, + "create": { + "id": "generativelanguage.tunedModels.create", + "path": "v1beta/tunedModels", + "flatPath": "v1beta/tunedModels", + "httpMethod": "POST", + "parameters": { + "tunedModelId": { + "description": "Optional. The unique id for the tuned model if specified. This value should be up to 40 characters, the first character must be a letter, the last could be a letter or a number. The id must match the regular expression: `[a-z]([a-z0-9-]{0,38}[a-z0-9])?`.", + "location": "query", + "type": "string" + } + }, + "parameterOrder": [], + "request": { + "$ref": "TunedModel" + }, + "response": { + "$ref": "Operation" + }, + "description": "Creates a tuned model. Check intermediate tuning progress (if any) through the [google.longrunning.Operations] service. Access status and results through the Operations service. Example: GET /v1/tunedModels/az2mb0bpw6i/operations/000-111-222" + }, + "patch": { + "id": "generativelanguage.tunedModels.patch", + "path": "v1beta/{+name}", + "flatPath": "v1beta/tunedModels/{tunedModelsId}", + "httpMethod": "PATCH", + "parameters": { + "name": { + "description": "Output only. The tuned model name. A unique name will be generated on create. Example: `tunedModels/az2mb0bpw6i` If display_name is set on create, the id portion of the name will be set by concatenating the words of the display_name with hyphens and adding a random portion for uniqueness. Example: * display_name = `Sentence Translator` * name = `tunedModels/sentence-translator-u3b7m`", + "pattern": "^tunedModels/[^/]+$", + "location": "path", + "required": true, + "type": "string" + }, + "updateMask": { + "description": "Optional. The list of fields to update.", + "location": "query", + "type": "string", + "format": "google-fieldmask" + } + }, + "parameterOrder": [ + "name" + ], + "request": { + "$ref": "TunedModel" + }, + "response": { + "$ref": "TunedModel" + }, + "description": "Updates a tuned model." + }, + "delete": { + "id": "generativelanguage.tunedModels.delete", + "path": "v1beta/{+name}", + "flatPath": "v1beta/tunedModels/{tunedModelsId}", + "httpMethod": "DELETE", + "parameters": { + "name": { + "description": "Required. The resource name of the model. Format: `tunedModels/my-model-id`", + "pattern": "^tunedModels/[^/]+$", + "location": "path", + "required": true, + "type": "string" + } + }, + "parameterOrder": [ + "name" + ], + "response": { + "$ref": "Empty" + }, + "description": "Deletes a tuned model." + }, + "transferOwnership": { + "id": "generativelanguage.tunedModels.transferOwnership", + "path": "v1beta/{+name}:transferOwnership", + "flatPath": "v1beta/tunedModels/{tunedModelsId}:transferOwnership", + "httpMethod": "POST", + "parameters": { + "name": { + "description": "Required. The resource name of the tuned model to transfer ownership. Format: `tunedModels/my-model-id`", + "pattern": "^tunedModels/[^/]+$", + "location": "path", + "required": true, + "type": "string" + } + }, + "parameterOrder": [ + "name" + ], + "request": { + "$ref": "TransferOwnershipRequest" + }, + "response": { + "$ref": "TransferOwnershipResponse" + }, + "description": "Transfers ownership of the tuned model. This is the only way to change ownership of the tuned model. The current owner will be downgraded to writer role." + }, + "generateText": { + "id": "generativelanguage.tunedModels.generateText", + "path": "v1beta/{+model}:generateText", + "flatPath": "v1beta/tunedModels/{tunedModelsId}:generateText", + "httpMethod": "POST", + "parameters": { + "model": { + "description": "Required. The name of the `Model` or `TunedModel` to use for generating the completion. Examples: models/text-bison-001 tunedModels/sentence-translator-u3b7m", + "pattern": "^tunedModels/[^/]+$", + "location": "path", + "required": true, + "type": "string" + } + }, + "parameterOrder": [ + "model" + ], + "request": { + "$ref": "GenerateTextRequest" + }, + "response": { + "$ref": "GenerateTextResponse" + }, + "description": "Generates a response from the model given an input message." + } + }, + "resources": { + "operations": { + "methods": { + "list": { + "id": "generativelanguage.tunedModels.operations.list", + "path": "v1beta/{+name}/operations", + "flatPath": "v1beta/tunedModels/{tunedModelsId}/operations", + "httpMethod": "GET", + "parameters": { + "name": { + "description": "The name of the operation's parent resource.", + "pattern": "^tunedModels/[^/]+$", + "location": "path", + "required": true, + "type": "string" + }, + "filter": { + "description": "The standard list filter.", + "location": "query", + "type": "string" + }, + "pageSize": { + "description": "The standard list page size.", + "location": "query", + "type": "integer", + "format": "int32" + }, + "pageToken": { + "description": "The standard list page token.", + "location": "query", + "type": "string" + }, + "returnPartialSuccess": { + "description": "When set to `true`, operations that are reachable are returned as normal, and those that are unreachable are returned in the ListOperationsResponse.unreachable field. This can only be `true` when reading across collections. For example, when `parent` is set to `\"projects/example/locations/-\"`. This field is not supported by default and will result in an `UNIMPLEMENTED` error if set unless explicitly documented otherwise in service or product specific documentation.", + "location": "query", + "type": "boolean" + } + }, + "parameterOrder": [ + "name" + ], + "response": { + "$ref": "ListOperationsResponse" + }, + "description": "Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns `UNIMPLEMENTED`." + }, + "get": { + "id": "generativelanguage.tunedModels.operations.get", + "path": "v1beta/{+name}", + "flatPath": "v1beta/tunedModels/{tunedModelsId}/operations/{operationsId}", + "httpMethod": "GET", + "parameters": { + "name": { + "description": "The name of the operation resource.", + "pattern": "^tunedModels/[^/]+/operations/[^/]+$", + "location": "path", + "required": true, + "type": "string" + } + }, + "parameterOrder": [ + "name" + ], + "response": { + "$ref": "Operation" + }, + "description": "Gets the latest state of a long-running operation. Clients can use this method to poll the operation result at intervals as recommended by the API service." + } + } + }, + "permissions": { + "methods": { + "create": { + "id": "generativelanguage.tunedModels.permissions.create", + "path": "v1beta/{+parent}/permissions", + "flatPath": "v1beta/tunedModels/{tunedModelsId}/permissions", + "httpMethod": "POST", + "parameters": { + "parent": { + "description": "Required. The parent resource of the `Permission`. Formats: `tunedModels/{tuned_model}` `corpora/{corpus}`", + "pattern": "^tunedModels/[^/]+$", + "location": "path", + "required": true, + "type": "string" + } + }, + "parameterOrder": [ + "parent" + ], + "request": { + "$ref": "Permission" + }, + "response": { + "$ref": "Permission" + }, + "description": "Create a permission to a specific resource." + }, + "get": { + "id": "generativelanguage.tunedModels.permissions.get", + "path": "v1beta/{+name}", + "flatPath": "v1beta/tunedModels/{tunedModelsId}/permissions/{permissionsId}", + "httpMethod": "GET", + "parameters": { + "name": { + "description": "Required. The resource name of the permission. Formats: `tunedModels/{tuned_model}/permissions/{permission}` `corpora/{corpus}/permissions/{permission}`", + "pattern": "^tunedModels/[^/]+/permissions/[^/]+$", + "location": "path", + "required": true, + "type": "string" + } + }, + "parameterOrder": [ + "name" + ], + "response": { + "$ref": "Permission" + }, + "description": "Gets information about a specific Permission." + }, + "list": { + "id": "generativelanguage.tunedModels.permissions.list", + "path": "v1beta/{+parent}/permissions", + "flatPath": "v1beta/tunedModels/{tunedModelsId}/permissions", + "httpMethod": "GET", + "parameters": { + "parent": { + "description": "Required. The parent resource of the permissions. Formats: `tunedModels/{tuned_model}` `corpora/{corpus}`", + "pattern": "^tunedModels/[^/]+$", + "location": "path", + "required": true, + "type": "string" + }, + "pageSize": { + "description": "Optional. The maximum number of `Permission`s to return (per page). The service may return fewer permissions. If unspecified, at most 10 permissions will be returned. This method returns at most 1000 permissions per page, even if you pass larger page_size.", + "location": "query", + "type": "integer", + "format": "int32" + }, + "pageToken": { + "description": "Optional. A page token, received from a previous `ListPermissions` call. Provide the `page_token` returned by one request as an argument to the next request to retrieve the next page. When paginating, all other parameters provided to `ListPermissions` must match the call that provided the page token.", + "location": "query", + "type": "string" + } + }, + "parameterOrder": [ + "parent" + ], + "response": { + "$ref": "ListPermissionsResponse" + }, + "description": "Lists permissions for the specific resource." + }, + "patch": { + "id": "generativelanguage.tunedModels.permissions.patch", + "path": "v1beta/{+name}", + "flatPath": "v1beta/tunedModels/{tunedModelsId}/permissions/{permissionsId}", + "httpMethod": "PATCH", + "parameters": { + "name": { + "description": "Output only. Identifier. The permission name. A unique name will be generated on create. Examples: tunedModels/{tuned_model}/permissions/{permission} corpora/{corpus}/permissions/{permission} Output only.", + "pattern": "^tunedModels/[^/]+/permissions/[^/]+$", + "location": "path", + "required": true, + "type": "string" + }, + "updateMask": { + "description": "Required. The list of fields to update. Accepted ones: - role (`Permission.role` field)", + "location": "query", + "type": "string", + "format": "google-fieldmask" + } + }, + "parameterOrder": [ + "name" + ], + "request": { + "$ref": "Permission" + }, + "response": { + "$ref": "Permission" + }, + "description": "Updates the permission." + }, + "delete": { + "id": "generativelanguage.tunedModels.permissions.delete", + "path": "v1beta/{+name}", + "flatPath": "v1beta/tunedModels/{tunedModelsId}/permissions/{permissionsId}", + "httpMethod": "DELETE", + "parameters": { + "name": { + "description": "Required. The resource name of the permission. Formats: `tunedModels/{tuned_model}/permissions/{permission}` `corpora/{corpus}/permissions/{permission}`", + "pattern": "^tunedModels/[^/]+/permissions/[^/]+$", + "location": "path", + "required": true, + "type": "string" + } + }, + "parameterOrder": [ + "name" + ], + "response": { + "$ref": "Empty" + }, + "description": "Deletes the permission." + } + } + } + } + }, + "dynamic": { + "methods": { + "generateContent": { + "id": "generativelanguage.dynamic.generateContent", + "path": "v1beta/{+model}:generateContent", + "flatPath": "v1beta/dynamic/{dynamicId}:generateContent", + "httpMethod": "POST", + "parameters": { + "model": { + "description": "Required. The name of the `Model` to use for generating the completion. Format: `models/{model}`.", + "pattern": "^dynamic/[^/]+$", + "location": "path", + "required": true, + "type": "string" + } + }, + "parameterOrder": [ + "model" + ], + "request": { + "$ref": "GenerateContentRequest" + }, + "response": { + "$ref": "GenerateContentResponse" + }, + "description": "Generates a model response given an input `GenerateContentRequest`. Refer to the [text generation guide](https://ai.google.dev/gemini-api/docs/text-generation) for detailed usage information. Input capabilities differ between models, including tuned models. Refer to the [model guide](https://ai.google.dev/gemini-api/docs/models/gemini) and [tuning guide](https://ai.google.dev/gemini-api/docs/model-tuning) for details." + }, + "streamGenerateContent": { + "id": "generativelanguage.dynamic.streamGenerateContent", + "path": "v1beta/{+model}:streamGenerateContent", + "flatPath": "v1beta/dynamic/{dynamicId}:streamGenerateContent", + "httpMethod": "POST", + "parameters": { + "model": { + "description": "Required. The name of the `Model` to use for generating the completion. Format: `models/{model}`.", + "pattern": "^dynamic/[^/]+$", + "location": "path", + "required": true, + "type": "string" + } + }, + "parameterOrder": [ + "model" + ], + "request": { + "$ref": "GenerateContentRequest" + }, + "response": { + "$ref": "GenerateContentResponse" + }, + "description": "Generates a [streamed response](https://ai.google.dev/gemini-api/docs/text-generation?lang=python#generate-a-text-stream) from the model given an input `GenerateContentRequest`." + } + } + }, + "cachedContents": { + "methods": { + "list": { + "id": "generativelanguage.cachedContents.list", + "path": "v1beta/cachedContents", + "flatPath": "v1beta/cachedContents", + "httpMethod": "GET", + "parameters": { + "pageSize": { + "description": "Optional. The maximum number of cached contents to return. The service may return fewer than this value. If unspecified, some default (under maximum) number of items will be returned. The maximum value is 1000; values above 1000 will be coerced to 1000.", + "location": "query", + "type": "integer", + "format": "int32" + }, + "pageToken": { + "description": "Optional. A page token, received from a previous `ListCachedContents` call. Provide this to retrieve the subsequent page. When paginating, all other parameters provided to `ListCachedContents` must match the call that provided the page token.", + "location": "query", + "type": "string" + } + }, + "parameterOrder": [], + "response": { + "$ref": "ListCachedContentsResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/devstorage.read_only" + ], + "description": "Lists CachedContents." + }, + "create": { + "id": "generativelanguage.cachedContents.create", + "path": "v1beta/cachedContents", + "flatPath": "v1beta/cachedContents", + "httpMethod": "POST", + "parameters": {}, + "parameterOrder": [], + "request": { + "$ref": "CachedContent" + }, + "response": { + "$ref": "CachedContent" + }, + "scopes": [ + "https://www.googleapis.com/auth/devstorage.read_only" + ], + "description": "Creates CachedContent resource." + }, + "get": { + "id": "generativelanguage.cachedContents.get", + "path": "v1beta/{+name}", + "flatPath": "v1beta/cachedContents/{cachedContentsId}", + "httpMethod": "GET", + "parameters": { + "name": { + "description": "Required. The resource name referring to the content cache entry. Format: `cachedContents/{id}`", + "pattern": "^cachedContents/[^/]+$", + "location": "path", + "required": true, + "type": "string" + } + }, + "parameterOrder": [ + "name" + ], + "response": { + "$ref": "CachedContent" + }, + "scopes": [ + "https://www.googleapis.com/auth/devstorage.read_only" + ], + "description": "Reads CachedContent resource." + }, + "patch": { + "id": "generativelanguage.cachedContents.patch", + "path": "v1beta/{+name}", + "flatPath": "v1beta/cachedContents/{cachedContentsId}", + "httpMethod": "PATCH", + "parameters": { + "name": { + "description": "Output only. Identifier. The resource name referring to the cached content. Format: `cachedContents/{id}`", + "pattern": "^cachedContents/[^/]+$", + "location": "path", + "required": true, + "type": "string" + }, + "updateMask": { + "description": "The list of fields to update.", + "location": "query", + "type": "string", + "format": "google-fieldmask" + } + }, + "parameterOrder": [ + "name" + ], + "request": { + "$ref": "CachedContent" + }, + "response": { + "$ref": "CachedContent" + }, + "scopes": [ + "https://www.googleapis.com/auth/devstorage.read_only" + ], + "description": "Updates CachedContent resource (only expiration is updatable)." + }, + "delete": { + "id": "generativelanguage.cachedContents.delete", + "path": "v1beta/{+name}", + "flatPath": "v1beta/cachedContents/{cachedContentsId}", + "httpMethod": "DELETE", + "parameters": { + "name": { + "description": "Required. The resource name referring to the content cache entry Format: `cachedContents/{id}`", + "pattern": "^cachedContents/[^/]+$", + "location": "path", + "required": true, + "type": "string" + } + }, + "parameterOrder": [ + "name" + ], + "response": { + "$ref": "Empty" + }, + "scopes": [ + "https://www.googleapis.com/auth/devstorage.read_only" + ], + "description": "Deletes CachedContent resource." + } + } + }, + "media": { + "methods": { + "upload": { + "id": "generativelanguage.media.upload", + "path": "v1beta/files", + "flatPath": "v1beta/files", + "httpMethod": "POST", + "parameters": {}, + "parameterOrder": [], + "supportsMediaUpload": true, + "mediaUpload": { + "accept": [ + "*/*" + ], + "maxSize": "2147483648", + "protocols": { + "resumable": { + "multipart": true, + "path": "/resumable/upload/v1beta/files" + }, + "simple": { + "multipart": true, + "path": "/upload/v1beta/files" + } + } + }, + "request": { + "$ref": "CreateFileRequest" + }, + "response": { + "$ref": "CreateFileResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/devstorage.read_only" + ], + "description": "Creates a `File`." + }, + "uploadToFileSearchStore": { + "id": "generativelanguage.media.uploadToFileSearchStore", + "path": "v1beta/{+fileSearchStoreName}:uploadToFileSearchStore", + "flatPath": "v1beta/fileSearchStores/{fileSearchStoresId}:uploadToFileSearchStore", + "httpMethod": "POST", + "parameters": { + "fileSearchStoreName": { + "description": "Required. Immutable. The name of the `FileSearchStore` to upload the file into. Example: `fileSearchStores/my-file-search-store-123`", + "pattern": "^fileSearchStores/[^/]+$", + "location": "path", + "required": true, + "type": "string" + } + }, + "parameterOrder": [ + "fileSearchStoreName" + ], + "supportsMediaUpload": true, + "mediaUpload": { + "accept": [ + "*/*" + ], + "maxSize": "104857600", + "protocols": { + "resumable": { + "multipart": true, + "path": "/resumable/upload/v1beta/{+fileSearchStoreName}:uploadToFileSearchStore" + }, + "simple": { + "multipart": true, + "path": "/upload/v1beta/{+fileSearchStoreName}:uploadToFileSearchStore" + } + } + }, + "request": { + "$ref": "UploadToFileSearchStoreRequest" + }, + "response": { + "$ref": "CustomLongRunningOperation" + }, + "scopes": [ + "https://www.googleapis.com/auth/devstorage.read_only" + ], + "description": "Uploads data to a FileSearchStore, preprocesses and chunks before storing it in a FileSearchStore Document." + } + } + }, + "files": { + "methods": { + "register": { + "id": "generativelanguage.files.register", + "path": "v1beta/files:register", + "flatPath": "v1beta/files:register", + "httpMethod": "POST", + "parameters": {}, + "parameterOrder": [], + "request": { + "$ref": "RegisterFilesRequest" + }, + "response": { + "$ref": "RegisterFilesResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/devstorage.read_only" + ], + "description": "Registers a Google Cloud Storage files with FileService. The user is expected to provide Google Cloud Storage URIs and will receive a File resource for each URI in return. Note that the files are not copied, just registered with File API. If one file fails to register, the whole request fails." + }, + "list": { + "id": "generativelanguage.files.list", + "path": "v1beta/files", + "flatPath": "v1beta/files", + "httpMethod": "GET", + "parameters": { + "pageSize": { + "description": "Optional. Maximum number of `File`s to return per page. If unspecified, defaults to 10. Maximum `page_size` is 100.", + "location": "query", + "type": "integer", + "format": "int32" + }, + "pageToken": { + "description": "Optional. A page token from a previous `ListFiles` call.", + "location": "query", + "type": "string" + } + }, + "parameterOrder": [], + "response": { + "$ref": "ListFilesResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/devstorage.read_only" + ], + "description": "Lists the metadata for `File`s owned by the requesting project." + }, + "get": { + "id": "generativelanguage.files.get", + "path": "v1beta/{+name}", + "flatPath": "v1beta/files/{filesId}", + "httpMethod": "GET", + "parameters": { + "name": { + "description": "Required. The name of the `File` to get. Example: `files/abc-123`", + "pattern": "^files/[^/]+$", + "location": "path", + "required": true, + "type": "string" + } + }, + "parameterOrder": [ + "name" + ], + "response": { + "$ref": "File" + }, + "scopes": [ + "https://www.googleapis.com/auth/devstorage.read_only" + ], + "description": "Gets the metadata for the given `File`." + }, + "delete": { + "id": "generativelanguage.files.delete", + "path": "v1beta/{+name}", + "flatPath": "v1beta/files/{filesId}", + "httpMethod": "DELETE", + "parameters": { + "name": { + "description": "Required. The name of the `File` to delete. Example: `files/abc-123`", + "pattern": "^files/[^/]+$", + "location": "path", + "required": true, + "type": "string" + } + }, + "parameterOrder": [ + "name" + ], + "response": { + "$ref": "Empty" + }, + "scopes": [ + "https://www.googleapis.com/auth/devstorage.read_only" + ], + "description": "Deletes the `File`." + } + } + }, + "generatedFiles": { + "methods": { + "list": { + "id": "generativelanguage.generatedFiles.list", + "path": "v1beta/generatedFiles", + "flatPath": "v1beta/generatedFiles", + "httpMethod": "GET", + "parameters": { + "pageSize": { + "description": "Optional. Maximum number of `GeneratedFile`s to return per page. If unspecified, defaults to 10. Maximum `page_size` is 50.", + "location": "query", + "type": "integer", + "format": "int32" + }, + "pageToken": { + "description": "Optional. A page token from a previous `ListGeneratedFiles` call.", + "location": "query", + "type": "string" + } + }, + "parameterOrder": [], + "response": { + "$ref": "ListGeneratedFilesResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/devstorage.read_only" + ], + "description": "Lists the generated files owned by the requesting project." + } + }, + "resources": { + "operations": { + "methods": { + "get": { + "id": "generativelanguage.generatedFiles.operations.get", + "path": "v1beta/{+name}", + "flatPath": "v1beta/generatedFiles/{generatedFilesId}/operations/{operationsId}", + "httpMethod": "GET", + "parameters": { + "name": { + "description": "The name of the operation resource.", + "pattern": "^generatedFiles/[^/]+/operations/[^/]+$", + "location": "path", + "required": true, + "type": "string" + } + }, + "parameterOrder": [ + "name" + ], + "response": { + "$ref": "Operation" + }, + "description": "Gets the latest state of a long-running operation. Clients can use this method to poll the operation result at intervals as recommended by the API service." + } + } + } + } + }, + "fileSearchStores": { + "methods": { + "create": { + "id": "generativelanguage.fileSearchStores.create", + "path": "v1beta/fileSearchStores", + "flatPath": "v1beta/fileSearchStores", + "httpMethod": "POST", + "parameters": {}, + "parameterOrder": [], + "request": { + "$ref": "FileSearchStore" + }, + "response": { + "$ref": "FileSearchStore" + }, + "description": "Creates an empty `FileSearchStore`." + }, + "get": { + "id": "generativelanguage.fileSearchStores.get", + "path": "v1beta/{+name}", + "flatPath": "v1beta/fileSearchStores/{fileSearchStoresId}", + "httpMethod": "GET", + "parameters": { + "name": { + "description": "Required. The name of the `FileSearchStore`. Example: `fileSearchStores/my-file-search-store-123`", + "pattern": "^fileSearchStores/[^/]+$", + "location": "path", + "required": true, + "type": "string" + } + }, + "parameterOrder": [ + "name" + ], + "response": { + "$ref": "FileSearchStore" + }, + "description": "Gets information about a specific `FileSearchStore`." + }, + "delete": { + "id": "generativelanguage.fileSearchStores.delete", + "path": "v1beta/{+name}", + "flatPath": "v1beta/fileSearchStores/{fileSearchStoresId}", + "httpMethod": "DELETE", + "parameters": { + "name": { + "description": "Required. The resource name of the `FileSearchStore`. Example: `fileSearchStores/my-file-search-store-123`", + "pattern": "^fileSearchStores/[^/]+$", + "location": "path", + "required": true, + "type": "string" + }, + "force": { + "description": "Optional. If set to true, any `Document`s and objects related to this `FileSearchStore` will also be deleted. If false (the default), a `FAILED_PRECONDITION` error will be returned if `FileSearchStore` contains any `Document`s.", + "location": "query", + "type": "boolean" + } + }, + "parameterOrder": [ + "name" + ], + "response": { + "$ref": "Empty" + }, + "description": "Deletes a `FileSearchStore`." + }, + "list": { + "id": "generativelanguage.fileSearchStores.list", + "path": "v1beta/fileSearchStores", + "flatPath": "v1beta/fileSearchStores", + "httpMethod": "GET", + "parameters": { + "pageSize": { + "description": "Optional. The maximum number of `FileSearchStores` to return (per page). The service may return fewer `FileSearchStores`. If unspecified, at most 10 `FileSearchStores` will be returned. The maximum size limit is 20 `FileSearchStores` per page.", + "location": "query", + "type": "integer", + "format": "int32" + }, + "pageToken": { + "description": "Optional. A page token, received from a previous `ListFileSearchStores` call. Provide the `next_page_token` returned in the response as an argument to the next request to retrieve the next page. When paginating, all other parameters provided to `ListFileSearchStores` must match the call that provided the page token.", + "location": "query", + "type": "string" + } + }, + "parameterOrder": [], + "response": { + "$ref": "ListFileSearchStoresResponse" + }, + "description": "Lists all `FileSearchStores` owned by the user." + }, + "importFile": { + "id": "generativelanguage.fileSearchStores.importFile", + "path": "v1beta/{+fileSearchStoreName}:importFile", + "flatPath": "v1beta/fileSearchStores/{fileSearchStoresId}:importFile", + "httpMethod": "POST", + "parameters": { + "fileSearchStoreName": { + "description": "Required. Immutable. The name of the `FileSearchStore` to import the file into. Example: `fileSearchStores/my-file-search-store-123`", + "pattern": "^fileSearchStores/[^/]+$", + "location": "path", + "required": true, + "type": "string" + } + }, + "parameterOrder": [ + "fileSearchStoreName" + ], + "request": { + "$ref": "ImportFileRequest" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/devstorage.read_only" + ], + "description": "Imports a `File` from File Service to a `FileSearchStore`." + } + }, + "resources": { + "operations": { + "methods": { + "get": { + "id": "generativelanguage.fileSearchStores.operations.get", + "path": "v1beta/{+name}", + "flatPath": "v1beta/fileSearchStores/{fileSearchStoresId}/operations/{operationsId}", + "httpMethod": "GET", + "parameters": { + "name": { + "description": "The name of the operation resource.", + "pattern": "^fileSearchStores/[^/]+/operations/[^/]+$", + "location": "path", + "required": true, + "type": "string" + } + }, + "parameterOrder": [ + "name" + ], + "response": { + "$ref": "Operation" + }, + "description": "Gets the latest state of a long-running operation. Clients can use this method to poll the operation result at intervals as recommended by the API service." + } + } + }, + "upload": { + "resources": { + "operations": { + "methods": { + "get": { + "id": "generativelanguage.fileSearchStores.upload.operations.get", + "path": "v1beta/{+name}", + "flatPath": "v1beta/fileSearchStores/{fileSearchStoresId}/upload/operations/{operationsId}", + "httpMethod": "GET", + "parameters": { + "name": { + "description": "The name of the operation resource.", + "pattern": "^fileSearchStores/[^/]+/upload/operations/[^/]+$", + "location": "path", + "required": true, + "type": "string" + } + }, + "parameterOrder": [ + "name" + ], + "response": { + "$ref": "Operation" + }, + "description": "Gets the latest state of a long-running operation. Clients can use this method to poll the operation result at intervals as recommended by the API service." + } + } + } + } + }, + "documents": { + "methods": { + "get": { + "id": "generativelanguage.fileSearchStores.documents.get", + "path": "v1beta/{+name}", + "flatPath": "v1beta/fileSearchStores/{fileSearchStoresId}/documents/{documentsId}", + "httpMethod": "GET", + "parameters": { + "name": { + "description": "Required. The name of the `Document` to retrieve. Example: `fileSearchStores/my-file-search-store-123/documents/the-doc-abc`", + "pattern": "^fileSearchStores/[^/]+/documents/[^/]+$", + "location": "path", + "required": true, + "type": "string" + } + }, + "parameterOrder": [ + "name" + ], + "response": { + "$ref": "Document" + }, + "description": "Gets information about a specific `Document`." + }, + "delete": { + "id": "generativelanguage.fileSearchStores.documents.delete", + "path": "v1beta/{+name}", + "flatPath": "v1beta/fileSearchStores/{fileSearchStoresId}/documents/{documentsId}", + "httpMethod": "DELETE", + "parameters": { + "name": { + "description": "Required. The resource name of the `Document` to delete. Example: `fileSearchStores/my-file-search-store-123/documents/the-doc-abc`", + "pattern": "^fileSearchStores/[^/]+/documents/[^/]+$", + "location": "path", + "required": true, + "type": "string" + }, + "force": { + "description": "Optional. If set to true, any `Chunk`s and objects related to this `Document` will also be deleted. If false (the default), a `FAILED_PRECONDITION` error will be returned if `Document` contains any `Chunk`s.", + "location": "query", + "type": "boolean" + } + }, + "parameterOrder": [ + "name" + ], + "response": { + "$ref": "Empty" + }, + "description": "Deletes a `Document`." + }, + "list": { + "id": "generativelanguage.fileSearchStores.documents.list", + "path": "v1beta/{+parent}/documents", + "flatPath": "v1beta/fileSearchStores/{fileSearchStoresId}/documents", + "httpMethod": "GET", + "parameters": { + "parent": { + "description": "Required. The name of the `FileSearchStore` containing `Document`s. Example: `fileSearchStores/my-file-search-store-123`", + "pattern": "^fileSearchStores/[^/]+$", + "location": "path", + "required": true, + "type": "string" + }, + "pageSize": { + "description": "Optional. The maximum number of `Document`s to return (per page). The service may return fewer `Document`s. If unspecified, at most 10 `Document`s will be returned. The maximum size limit is 20 `Document`s per page.", + "location": "query", + "type": "integer", + "format": "int32" + }, + "pageToken": { + "description": "Optional. A page token, received from a previous `ListDocuments` call. Provide the `next_page_token` returned in the response as an argument to the next request to retrieve the next page. When paginating, all other parameters provided to `ListDocuments` must match the call that provided the page token.", + "location": "query", + "type": "string" + } + }, + "parameterOrder": [ + "parent" + ], + "response": { + "$ref": "ListDocumentsResponse" + }, + "description": "Lists all `Document`s in a `Corpus`." + } + } + } + } + }, + "corpora": { + "methods": { + "create": { + "id": "generativelanguage.corpora.create", + "path": "v1beta/corpora", + "flatPath": "v1beta/corpora", + "httpMethod": "POST", + "parameters": {}, + "parameterOrder": [], + "request": { + "$ref": "Corpus" + }, + "response": { + "$ref": "Corpus" + }, + "description": "Creates an empty `Corpus`." + }, + "get": { + "id": "generativelanguage.corpora.get", + "path": "v1beta/{+name}", + "flatPath": "v1beta/corpora/{corporaId}", + "httpMethod": "GET", + "parameters": { + "name": { + "description": "Required. The name of the `Corpus`. Example: `corpora/my-corpus-123`", + "pattern": "^corpora/[^/]+$", + "location": "path", + "required": true, + "type": "string" + } + }, + "parameterOrder": [ + "name" + ], + "response": { + "$ref": "Corpus" + }, + "description": "Gets information about a specific `Corpus`." + }, + "delete": { + "id": "generativelanguage.corpora.delete", + "path": "v1beta/{+name}", + "flatPath": "v1beta/corpora/{corporaId}", + "httpMethod": "DELETE", + "parameters": { + "name": { + "description": "Required. The resource name of the `Corpus`. Example: `corpora/my-corpus-123`", + "pattern": "^corpora/[^/]+$", + "location": "path", + "required": true, + "type": "string" + }, + "force": { + "description": "Optional. If set to true, any `Document`s and objects related to this `Corpus` will also be deleted. If false (the default), a `FAILED_PRECONDITION` error will be returned if `Corpus` contains any `Document`s.", + "location": "query", + "type": "boolean" + } + }, + "parameterOrder": [ + "name" + ], + "response": { + "$ref": "Empty" + }, + "description": "Deletes a `Corpus`." + }, + "list": { + "id": "generativelanguage.corpora.list", + "path": "v1beta/corpora", + "flatPath": "v1beta/corpora", + "httpMethod": "GET", + "parameters": { + "pageSize": { + "description": "Optional. The maximum number of `Corpora` to return (per page). The service may return fewer `Corpora`. If unspecified, at most 10 `Corpora` will be returned. The maximum size limit is 20 `Corpora` per page.", + "location": "query", + "type": "integer", + "format": "int32" + }, + "pageToken": { + "description": "Optional. A page token, received from a previous `ListCorpora` call. Provide the `next_page_token` returned in the response as an argument to the next request to retrieve the next page. When paginating, all other parameters provided to `ListCorpora` must match the call that provided the page token.", + "location": "query", + "type": "string" + } + }, + "parameterOrder": [], + "response": { + "$ref": "ListCorporaResponse" + }, + "description": "Lists all `Corpora` owned by the user." + } + }, + "resources": { + "operations": { + "methods": { + "get": { + "id": "generativelanguage.corpora.operations.get", + "path": "v1beta/{+name}", + "flatPath": "v1beta/corpora/{corporaId}/operations/{operationsId}", + "httpMethod": "GET", + "parameters": { + "name": { + "description": "The name of the operation resource.", + "pattern": "^corpora/[^/]+/operations/[^/]+$", + "location": "path", + "required": true, + "type": "string" + } + }, + "parameterOrder": [ + "name" + ], + "response": { + "$ref": "Operation" + }, + "description": "Gets the latest state of a long-running operation. Clients can use this method to poll the operation result at intervals as recommended by the API service." + } + } + }, + "permissions": { + "methods": { + "create": { + "id": "generativelanguage.corpora.permissions.create", + "path": "v1beta/{+parent}/permissions", + "flatPath": "v1beta/corpora/{corporaId}/permissions", + "httpMethod": "POST", + "parameters": { + "parent": { + "description": "Required. The parent resource of the `Permission`. Formats: `tunedModels/{tuned_model}` `corpora/{corpus}`", + "pattern": "^corpora/[^/]+$", + "location": "path", + "required": true, + "type": "string" + } + }, + "parameterOrder": [ + "parent" + ], + "request": { + "$ref": "Permission" + }, + "response": { + "$ref": "Permission" + }, + "description": "Create a permission to a specific resource." + }, + "get": { + "id": "generativelanguage.corpora.permissions.get", + "path": "v1beta/{+name}", + "flatPath": "v1beta/corpora/{corporaId}/permissions/{permissionsId}", + "httpMethod": "GET", + "parameters": { + "name": { + "description": "Required. The resource name of the permission. Formats: `tunedModels/{tuned_model}/permissions/{permission}` `corpora/{corpus}/permissions/{permission}`", + "pattern": "^corpora/[^/]+/permissions/[^/]+$", + "location": "path", + "required": true, + "type": "string" + } + }, + "parameterOrder": [ + "name" + ], + "response": { + "$ref": "Permission" + }, + "description": "Gets information about a specific Permission." + }, + "list": { + "id": "generativelanguage.corpora.permissions.list", + "path": "v1beta/{+parent}/permissions", + "flatPath": "v1beta/corpora/{corporaId}/permissions", + "httpMethod": "GET", + "parameters": { + "parent": { + "description": "Required. The parent resource of the permissions. Formats: `tunedModels/{tuned_model}` `corpora/{corpus}`", + "pattern": "^corpora/[^/]+$", + "location": "path", + "required": true, + "type": "string" + }, + "pageSize": { + "description": "Optional. The maximum number of `Permission`s to return (per page). The service may return fewer permissions. If unspecified, at most 10 permissions will be returned. This method returns at most 1000 permissions per page, even if you pass larger page_size.", + "location": "query", + "type": "integer", + "format": "int32" + }, + "pageToken": { + "description": "Optional. A page token, received from a previous `ListPermissions` call. Provide the `page_token` returned by one request as an argument to the next request to retrieve the next page. When paginating, all other parameters provided to `ListPermissions` must match the call that provided the page token.", + "location": "query", + "type": "string" + } + }, + "parameterOrder": [ + "parent" + ], + "response": { + "$ref": "ListPermissionsResponse" + }, + "description": "Lists permissions for the specific resource." + }, + "patch": { + "id": "generativelanguage.corpora.permissions.patch", + "path": "v1beta/{+name}", + "flatPath": "v1beta/corpora/{corporaId}/permissions/{permissionsId}", + "httpMethod": "PATCH", + "parameters": { + "name": { + "description": "Output only. Identifier. The permission name. A unique name will be generated on create. Examples: tunedModels/{tuned_model}/permissions/{permission} corpora/{corpus}/permissions/{permission} Output only.", + "pattern": "^corpora/[^/]+/permissions/[^/]+$", + "location": "path", + "required": true, + "type": "string" + }, + "updateMask": { + "description": "Required. The list of fields to update. Accepted ones: - role (`Permission.role` field)", + "location": "query", + "type": "string", + "format": "google-fieldmask" + } + }, + "parameterOrder": [ + "name" + ], + "request": { + "$ref": "Permission" + }, + "response": { + "$ref": "Permission" + }, + "description": "Updates the permission." + }, + "delete": { + "id": "generativelanguage.corpora.permissions.delete", + "path": "v1beta/{+name}", + "flatPath": "v1beta/corpora/{corporaId}/permissions/{permissionsId}", + "httpMethod": "DELETE", + "parameters": { + "name": { + "description": "Required. The resource name of the permission. Formats: `tunedModels/{tuned_model}/permissions/{permission}` `corpora/{corpus}/permissions/{permission}`", + "pattern": "^corpora/[^/]+/permissions/[^/]+$", + "location": "path", + "required": true, + "type": "string" + } + }, + "parameterOrder": [ + "name" + ], + "response": { + "$ref": "Empty" + }, + "description": "Deletes the permission." + } + } + } + } + } + }, + "batchPath": "batch", + "title": "Gemini API", + "fullyEncodeReservedExpansion": true, + "auth": { + "oauth2": { + "scopes": { + "https://www.googleapis.com/auth/devstorage.read_only": { + "description": "View your data in Google Cloud Storage" + } + } + } + } } diff --git a/specs/openai/openapi.yml b/specs/openai/openapi.yml index 6595bece..e6c7e700 100644 --- a/specs/openai/openapi.yml +++ b/specs/openai/openapi.yml @@ -15691,7 +15691,8 @@ paths: }, "line_item": null, "project_id": null, - "api_key_id": null + "api_key_id": null, + "quantity": null } ] } @@ -19131,6 +19132,596 @@ paths: "object": "project.group.deleted", "deleted": true } + /organization/projects/{project_id}/hosted_tool_permissions: + get: + security: + - AdminApiKeyAuth: [] + summary: Returns hosted tool permissions for a project. + operationId: retrieve-project-hosted-tool-permissions + tags: + - Hosted tools + parameters: + - name: project_id + in: path + description: The ID of the project. + required: true + schema: + type: string + responses: + '200': + description: Project hosted tool permissions retrieved successfully. + content: + application/json: + schema: + $ref: '#/components/schemas/ProjectHostedToolPermissions' + x-oaiMeta: + name: Retrieve project hosted tool permissions + group: administration + examples: + request: + curl: > + curl + https://api.openai.com/v1/organization/projects/proj_abc/hosted_tool_permissions + \ + -H "Authorization: Bearer $OPENAI_ADMIN_KEY" \ + -H "Content-Type: application/json" + node.js: |- + import OpenAI from 'openai'; + + const client = new OpenAI({ + adminAPIKey: process.env['OPENAI_ADMIN_KEY'], // This is the default and can be omitted + }); + + const projectHostedToolPermissions = + await client.admin.organization.projects.hostedToolPermissions.retrieve('project_id'); + + console.log(projectHostedToolPermissions.code_interpreter); + python: >- + import os + + from openai import OpenAI + + + client = OpenAI( + admin_api_key=os.environ.get("OPENAI_ADMIN_KEY"), # This is the default and can be omitted + ) + + project_hosted_tool_permissions = + client.admin.organization.projects.hosted_tool_permissions.retrieve( + "project_id", + ) + + print(project_hosted_tool_permissions.code_interpreter) + go: "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAdminAPIKey(\"My Admin API Key\"),\n\t)\n\tprojectHostedToolPermissions, err := client.Admin.Organization.Projects.HostedToolPermissions.Get(context.TODO(), \"project_id\")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\\n\", projectHostedToolPermissions.CodeInterpreter)\n}\n" + java: >- + package com.openai.example; + + + import com.openai.client.OpenAIClient; + + import com.openai.client.okhttp.OpenAIOkHttpClient; + + import + com.openai.models.admin.organization.projects.hostedtoolpermissions.HostedToolPermissionRetrieveParams; + + import + com.openai.models.admin.organization.projects.hostedtoolpermissions.ProjectHostedToolPermissions; + + + public final class Main { + private Main() {} + + public static void main(String[] args) { + OpenAIClient client = OpenAIOkHttpClient.fromEnv(); + + ProjectHostedToolPermissions projectHostedToolPermissions = client.admin().organization().projects().hostedToolPermissions().retrieve("project_id"); + } + } + ruby: >- + require "openai" + + + openai = OpenAI::Client.new(admin_api_key: "My Admin API Key") + + + project_hosted_tool_permissions = + openai.admin.organization.projects.hosted_tool_permissions.retrieve("project_id") + + + puts(project_hosted_tool_permissions) + response: | + { + "file_search": { + "enabled": true + }, + "web_search": { + "enabled": true + }, + "image_generation": { + "enabled": true + }, + "mcp": { + "enabled": true + }, + "code_interpreter": { + "enabled": true + } + } + post: + security: + - AdminApiKeyAuth: [] + summary: Updates hosted tool permissions for a project. + operationId: update-project-hosted-tool-permissions + tags: + - Hosted tools + parameters: + - name: project_id + in: path + description: The ID of the project. + required: true + schema: + type: string + requestBody: + description: The project hosted tool permissions update request payload. + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/ProjectHostedToolPermissionsUpdateRequest' + responses: + '200': + description: Project hosted tool permissions updated successfully. + content: + application/json: + schema: + $ref: '#/components/schemas/ProjectHostedToolPermissions' + x-oaiMeta: + name: Modify project hosted tool permissions + group: administration + examples: + request: + curl: > + curl -X POST + https://api.openai.com/v1/organization/projects/proj_abc/hosted_tool_permissions + \ + -H "Authorization: Bearer $OPENAI_ADMIN_KEY" \ + -H "Content-Type: application/json" \ + -d '{ + "file_search": { + "enabled": true + }, + "image_generation": { + "enabled": false + } + }' + node.js: |- + import OpenAI from 'openai'; + + const client = new OpenAI({ + adminAPIKey: process.env['OPENAI_ADMIN_KEY'], // This is the default and can be omitted + }); + + const projectHostedToolPermissions = + await client.admin.organization.projects.hostedToolPermissions.update('project_id'); + + console.log(projectHostedToolPermissions.code_interpreter); + python: >- + import os + + from openai import OpenAI + + + client = OpenAI( + admin_api_key=os.environ.get("OPENAI_ADMIN_KEY"), # This is the default and can be omitted + ) + + project_hosted_tool_permissions = + client.admin.organization.projects.hosted_tool_permissions.update( + project_id="project_id", + ) + + print(project_hosted_tool_permissions.code_interpreter) + go: "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAdminAPIKey(\"My Admin API Key\"),\n\t)\n\tprojectHostedToolPermissions, err := client.Admin.Organization.Projects.HostedToolPermissions.Update(\n\t\tcontext.TODO(),\n\t\t\"project_id\",\n\t\topenai.AdminOrganizationProjectHostedToolPermissionUpdateParams{},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\\n\", projectHostedToolPermissions.CodeInterpreter)\n}\n" + java: >- + package com.openai.example; + + + import com.openai.client.OpenAIClient; + + import com.openai.client.okhttp.OpenAIOkHttpClient; + + import + com.openai.models.admin.organization.projects.hostedtoolpermissions.HostedToolPermissionUpdateParams; + + import + com.openai.models.admin.organization.projects.hostedtoolpermissions.ProjectHostedToolPermissions; + + + public final class Main { + private Main() {} + + public static void main(String[] args) { + OpenAIClient client = OpenAIOkHttpClient.fromEnv(); + + ProjectHostedToolPermissions projectHostedToolPermissions = client.admin().organization().projects().hostedToolPermissions().update("project_id"); + } + } + ruby: >- + require "openai" + + + openai = OpenAI::Client.new(admin_api_key: "My Admin API Key") + + + project_hosted_tool_permissions = + openai.admin.organization.projects.hosted_tool_permissions.update("project_id") + + + puts(project_hosted_tool_permissions) + response: | + { + "file_search": { + "enabled": true + }, + "web_search": { + "enabled": true + }, + "image_generation": { + "enabled": false + }, + "mcp": { + "enabled": true + }, + "code_interpreter": { + "enabled": true + } + } + /organization/projects/{project_id}/model_permissions: + get: + security: + - AdminApiKeyAuth: [] + summary: Returns model permissions for a project. + operationId: retrieve-project-model-permissions + tags: + - Projects + parameters: + - name: project_id + in: path + description: The ID of the project. + required: true + schema: + type: string + responses: + '200': + description: Project model permissions retrieved successfully. + content: + application/json: + schema: + $ref: '#/components/schemas/ProjectModelPermissions' + x-oaiMeta: + name: Retrieve project model permissions + group: administration + examples: + request: + curl: > + curl + https://api.openai.com/v1/organization/projects/proj_abc/model_permissions + \ + -H "Authorization: Bearer $OPENAI_ADMIN_KEY" \ + -H "Content-Type: application/json" + node.js: >- + import OpenAI from 'openai'; + + + const client = new OpenAI({ + adminAPIKey: process.env['OPENAI_ADMIN_KEY'], // This is the default and can be omitted + }); + + + const projectModelPermissions = await + client.admin.organization.projects.modelPermissions.retrieve( + 'project_id', + ); + + + console.log(projectModelPermissions.model_ids); + python: >- + import os + + from openai import OpenAI + + + client = OpenAI( + admin_api_key=os.environ.get("OPENAI_ADMIN_KEY"), # This is the default and can be omitted + ) + + project_model_permissions = + client.admin.organization.projects.model_permissions.retrieve( + "project_id", + ) + + print(project_model_permissions.model_ids) + go: "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAdminAPIKey(\"My Admin API Key\"),\n\t)\n\tprojectModelPermissions, err := client.Admin.Organization.Projects.ModelPermissions.Get(context.TODO(), \"project_id\")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\\n\", projectModelPermissions.ModelIDs)\n}\n" + java: >- + package com.openai.example; + + + import com.openai.client.OpenAIClient; + + import com.openai.client.okhttp.OpenAIOkHttpClient; + + import + com.openai.models.admin.organization.projects.modelpermissions.ModelPermissionRetrieveParams; + + import + com.openai.models.admin.organization.projects.modelpermissions.ProjectModelPermissions; + + + public final class Main { + private Main() {} + + public static void main(String[] args) { + OpenAIClient client = OpenAIOkHttpClient.fromEnv(); + + ProjectModelPermissions projectModelPermissions = client.admin().organization().projects().modelPermissions().retrieve("project_id"); + } + } + ruby: >- + require "openai" + + + openai = OpenAI::Client.new(admin_api_key: "My Admin API Key") + + + project_model_permissions = + openai.admin.organization.projects.model_permissions.retrieve("project_id") + + + puts(project_model_permissions) + response: | + { + "object": "project.model_permissions", + "mode": "allow_list", + "model_ids": [ + "gpt-4.1", + "o3" + ] + } + post: + security: + - AdminApiKeyAuth: [] + summary: Updates model permissions for a project. + operationId: update-project-model-permissions + tags: + - Projects + parameters: + - name: project_id + in: path + description: The ID of the project. + required: true + schema: + type: string + requestBody: + description: The project model permissions update request payload. + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/ProjectModelPermissionsUpdateRequest' + responses: + '200': + description: Project model permissions updated successfully. + content: + application/json: + schema: + $ref: '#/components/schemas/ProjectModelPermissions' + x-oaiMeta: + name: Modify project model permissions + group: administration + examples: + request: + curl: > + curl -X POST + https://api.openai.com/v1/organization/projects/proj_abc/model_permissions + \ + -H "Authorization: Bearer $OPENAI_ADMIN_KEY" \ + -H "Content-Type: application/json" \ + -d '{ + "mode": "deny_list", + "model_ids": [ + "o3" + ] + }' + node.js: >- + import OpenAI from 'openai'; + + + const client = new OpenAI({ + adminAPIKey: process.env['OPENAI_ADMIN_KEY'], // This is the default and can be omitted + }); + + + const projectModelPermissions = await + client.admin.organization.projects.modelPermissions.update( + 'project_id', + { mode: 'allow_list', model_ids: ['string'] }, + ); + + + console.log(projectModelPermissions.model_ids); + python: >- + import os + + from openai import OpenAI + + + client = OpenAI( + admin_api_key=os.environ.get("OPENAI_ADMIN_KEY"), # This is the default and can be omitted + ) + + project_model_permissions = + client.admin.organization.projects.model_permissions.update( + project_id="project_id", + mode="allow_list", + model_ids=["string"], + ) + + print(project_model_permissions.model_ids) + go: "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAdminAPIKey(\"My Admin API Key\"),\n\t)\n\tprojectModelPermissions, err := client.Admin.Organization.Projects.ModelPermissions.Update(\n\t\tcontext.TODO(),\n\t\t\"project_id\",\n\t\topenai.AdminOrganizationProjectModelPermissionUpdateParams{\n\t\t\tMode: openai.AdminOrganizationProjectModelPermissionUpdateParamsModeAllowList,\n\t\t\tModelIDs: []string{\"string\"},\n\t\t},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\\n\", projectModelPermissions.ModelIDs)\n}\n" + java: >- + package com.openai.example; + + + import com.openai.client.OpenAIClient; + + import com.openai.client.okhttp.OpenAIOkHttpClient; + + import + com.openai.models.admin.organization.projects.modelpermissions.ModelPermissionUpdateParams; + + import + com.openai.models.admin.organization.projects.modelpermissions.ProjectModelPermissions; + + + public final class Main { + private Main() {} + + public static void main(String[] args) { + OpenAIClient client = OpenAIOkHttpClient.fromEnv(); + + ModelPermissionUpdateParams params = ModelPermissionUpdateParams.builder() + .projectId("project_id") + .mode(ModelPermissionUpdateParams.Mode.ALLOW_LIST) + .addModelId("string") + .build(); + ProjectModelPermissions projectModelPermissions = client.admin().organization().projects().modelPermissions().update(params); + } + } + ruby: >- + require "openai" + + + openai = OpenAI::Client.new(admin_api_key: "My Admin API Key") + + + project_model_permissions = + openai.admin.organization.projects.model_permissions.update( + "project_id", + mode: :allow_list, + model_ids: ["string"] + ) + + + puts(project_model_permissions) + response: | + { + "object": "project.model_permissions", + "mode": "deny_list", + "model_ids": [ + "o3" + ] + } + delete: + security: + - AdminApiKeyAuth: [] + summary: Deletes model permissions for a project. + operationId: delete-project-model-permissions + tags: + - Projects + parameters: + - name: project_id + in: path + description: The ID of the project. + required: true + schema: + type: string + responses: + '200': + description: Project model permissions deleted successfully. + content: + application/json: + schema: + $ref: '#/components/schemas/ProjectModelPermissionsDeleteResponse' + x-oaiMeta: + name: Delete project model permissions + group: administration + examples: + request: + curl: > + curl -X DELETE + https://api.openai.com/v1/organization/projects/proj_abc/model_permissions + \ + -H "Authorization: Bearer $OPENAI_ADMIN_KEY" \ + -H "Content-Type: application/json" + node.js: |- + import OpenAI from 'openai'; + + const client = new OpenAI({ + adminAPIKey: process.env['OPENAI_ADMIN_KEY'], // This is the default and can be omitted + }); + + const projectModelPermissionsDeleted = + await client.admin.organization.projects.modelPermissions.delete('project_id'); + + console.log(projectModelPermissionsDeleted.deleted); + python: >- + import os + + from openai import OpenAI + + + client = OpenAI( + admin_api_key=os.environ.get("OPENAI_ADMIN_KEY"), # This is the default and can be omitted + ) + + project_model_permissions_deleted = + client.admin.organization.projects.model_permissions.delete( + "project_id", + ) + + print(project_model_permissions_deleted.deleted) + go: "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAdminAPIKey(\"My Admin API Key\"),\n\t)\n\tprojectModelPermissionsDeleted, err := client.Admin.Organization.Projects.ModelPermissions.Delete(context.TODO(), \"project_id\")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\\n\", projectModelPermissionsDeleted.Deleted)\n}\n" + java: >- + package com.openai.example; + + + import com.openai.client.OpenAIClient; + + import com.openai.client.okhttp.OpenAIOkHttpClient; + + import + com.openai.models.admin.organization.projects.modelpermissions.ModelPermissionDeleteParams; + + import + com.openai.models.admin.organization.projects.modelpermissions.ProjectModelPermissionsDeleted; + + + public final class Main { + private Main() {} + + public static void main(String[] args) { + OpenAIClient client = OpenAIOkHttpClient.fromEnv(); + + ProjectModelPermissionsDeleted projectModelPermissionsDeleted = client.admin().organization().projects().modelPermissions().delete("project_id"); + } + } + ruby: >- + require "openai" + + + openai = OpenAI::Client.new(admin_api_key: "My Admin API Key") + + + project_model_permissions_deleted = + openai.admin.organization.projects.model_permissions.delete("project_id") + + + puts(project_model_permissions_deleted) + response: | + { + "object": "project.model_permissions.deleted", + "deleted": true + } /organization/projects/{project_id}/rate_limits: get: security: @@ -22087,6 +22678,214 @@ paths: "has_more": false, "next_page": null } + /organization/usage/file_search_calls: + get: + security: + - AdminApiKeyAuth: [] + summary: Get file search calls usage details for the organization. + operationId: usage-file-search-calls + tags: + - Usage + parameters: + - name: start_time + in: query + description: Start time (Unix seconds) of the query time range, inclusive. + required: true + schema: + type: integer + - name: end_time + in: query + description: End time (Unix seconds) of the query time range, exclusive. + required: false + schema: + type: integer + - name: bucket_width + in: query + description: >- + Width of each time bucket in response. Currently `1m`, `1h` and `1d` + are supported, default to `1d`. + required: false + schema: + type: string + enum: + - 1m + - 1h + - 1d + default: 1d + - name: project_ids + in: query + description: Return only usage for these projects. + required: false + schema: + type: array + items: + type: string + - name: user_ids + in: query + description: Return only usage for these users. + required: false + schema: + type: array + items: + type: string + - name: api_key_ids + in: query + description: Return only usage for these API keys. + required: false + schema: + type: array + items: + type: string + - name: vector_store_ids + in: query + description: Return only usage for these vector stores. + required: false + schema: + type: array + items: + type: string + - name: group_by + in: query + description: >- + Group the usage data by the specified fields. Support fields include + `project_id`, `user_id`, `api_key_id`, `vector_store_id` or any + combination of them. + required: false + schema: + type: array + items: + type: string + enum: + - project_id + - user_id + - api_key_id + - vector_store_id + - name: limit + in: query + description: | + Specifies the number of buckets to return. + - `bucket_width=1d`: default: 7, max: 31 + - `bucket_width=1h`: default: 24, max: 168 + - `bucket_width=1m`: default: 60, max: 1440 + required: false + schema: + type: integer + - name: page + in: query + description: >- + A cursor for use in pagination. Corresponding to the `next_page` + field from the previous response. + schema: + type: string + responses: + '200': + description: Usage data retrieved successfully. + content: + application/json: + schema: + $ref: '#/components/schemas/UsageResponse' + x-oaiMeta: + name: File search calls + group: usage-file-search-calls + examples: + request: + curl: > + curl + "https://api.openai.com/v1/organization/usage/file_search_calls?start_time=1730419200&limit=1" + \ + + -H "Authorization: Bearer $OPENAI_ADMIN_KEY" \ + + -H "Content-Type: application/json" + node.js: >- + import OpenAI from 'openai'; + + + const client = new OpenAI({ + adminAPIKey: process.env['OPENAI_ADMIN_KEY'], // This is the default and can be omitted + }); + + + const response = await + client.admin.organization.usage.fileSearchCalls({ start_time: 0 + }); + + + console.log(response.data); + python: |- + import os + from openai import OpenAI + + client = OpenAI( + admin_api_key=os.environ.get("OPENAI_ADMIN_KEY"), # This is the default and can be omitted + ) + response = client.admin.organization.usage.file_search_calls( + start_time=0, + ) + print(response.data) + go: "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAdminAPIKey(\"My Admin API Key\"),\n\t)\n\tresponse, err := client.Admin.Organization.Usage.FileSearchCalls(context.TODO(), openai.AdminOrganizationUsageFileSearchCallsParams{\n\t\tStartTime: 0,\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\\n\", response.Data)\n}\n" + java: >- + package com.openai.example; + + + import com.openai.client.OpenAIClient; + + import com.openai.client.okhttp.OpenAIOkHttpClient; + + import + com.openai.models.admin.organization.usage.UsageFileSearchCallsParams; + + import + com.openai.models.admin.organization.usage.UsageFileSearchCallsResponse; + + + public final class Main { + private Main() {} + + public static void main(String[] args) { + OpenAIClient client = OpenAIOkHttpClient.fromEnv(); + + UsageFileSearchCallsParams params = UsageFileSearchCallsParams.builder() + .startTime(0L) + .build(); + UsageFileSearchCallsResponse response = client.admin().organization().usage().fileSearchCalls(params); + } + } + ruby: >- + require "openai" + + + openai = OpenAI::Client.new(admin_api_key: "My Admin API Key") + + + response = + openai.admin.organization.usage.file_search_calls(start_time: 0) + + + puts(response) + response: | + { + "object": "page", + "data": [ + { + "object": "bucket", + "start_time": 1730419200, + "end_time": 1730505600, + "results": [ + { + "object": "organization.usage.file_searches.result", + "num_requests": 2, + "project_id": null, + "user_id": null, + "api_key_id": null, + "vector_store_id": null + } + ] + } + ], + "has_more": false, + "next_page": null + } /organization/usage/images: get: security: @@ -22711,6 +23510,228 @@ paths: "has_more": false, "next_page": null } + /organization/usage/web_search_calls: + get: + security: + - AdminApiKeyAuth: [] + summary: Get web search calls usage details for the organization. + operationId: usage-web-search-calls + tags: + - Usage + parameters: + - name: start_time + in: query + description: Start time (Unix seconds) of the query time range, inclusive. + required: true + schema: + type: integer + - name: end_time + in: query + description: End time (Unix seconds) of the query time range, exclusive. + required: false + schema: + type: integer + - name: bucket_width + in: query + description: >- + Width of each time bucket in response. Currently `1m`, `1h` and `1d` + are supported, default to `1d`. + required: false + schema: + type: string + enum: + - 1m + - 1h + - 1d + default: 1d + - name: project_ids + in: query + description: Return only usage for these projects. + required: false + schema: + type: array + items: + type: string + - name: user_ids + in: query + description: Return only usage for these users. + required: false + schema: + type: array + items: + type: string + - name: api_key_ids + in: query + description: Return only usage for these API keys. + required: false + schema: + type: array + items: + type: string + - name: models + in: query + description: Return only usage for these models. + required: false + schema: + type: array + items: + type: string + - name: context_levels + in: query + description: Return only web search usage for these context levels. + required: false + schema: + type: array + items: + type: string + enum: + - low + - medium + - high + - name: group_by + in: query + description: >- + Group the usage data by the specified fields. Support fields include + `project_id`, `user_id`, `api_key_id`, `model`, `context_level` or + any combination of them. + required: false + schema: + type: array + items: + type: string + enum: + - project_id + - user_id + - api_key_id + - model + - context_level + - name: limit + in: query + description: | + Specifies the number of buckets to return. + - `bucket_width=1d`: default: 7, max: 31 + - `bucket_width=1h`: default: 24, max: 168 + - `bucket_width=1m`: default: 60, max: 1440 + required: false + schema: + type: integer + - name: page + in: query + description: >- + A cursor for use in pagination. Corresponding to the `next_page` + field from the previous response. + schema: + type: string + responses: + '200': + description: Usage data retrieved successfully. + content: + application/json: + schema: + $ref: '#/components/schemas/UsageResponse' + x-oaiMeta: + name: Web search calls + group: usage-web-search-calls + examples: + request: + curl: > + curl + "https://api.openai.com/v1/organization/usage/web_search_calls?start_time=1730419200&limit=1" + \ + + -H "Authorization: Bearer $OPENAI_ADMIN_KEY" \ + + -H "Content-Type: application/json" + node.js: >- + import OpenAI from 'openai'; + + + const client = new OpenAI({ + adminAPIKey: process.env['OPENAI_ADMIN_KEY'], // This is the default and can be omitted + }); + + + const response = await + client.admin.organization.usage.webSearchCalls({ start_time: 0 }); + + + console.log(response.data); + python: |- + import os + from openai import OpenAI + + client = OpenAI( + admin_api_key=os.environ.get("OPENAI_ADMIN_KEY"), # This is the default and can be omitted + ) + response = client.admin.organization.usage.web_search_calls( + start_time=0, + ) + print(response.data) + go: "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAdminAPIKey(\"My Admin API Key\"),\n\t)\n\tresponse, err := client.Admin.Organization.Usage.WebSearchCalls(context.TODO(), openai.AdminOrganizationUsageWebSearchCallsParams{\n\t\tStartTime: 0,\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\\n\", response.Data)\n}\n" + java: >- + package com.openai.example; + + + import com.openai.client.OpenAIClient; + + import com.openai.client.okhttp.OpenAIOkHttpClient; + + import + com.openai.models.admin.organization.usage.UsageWebSearchCallsParams; + + import + com.openai.models.admin.organization.usage.UsageWebSearchCallsResponse; + + + public final class Main { + private Main() {} + + public static void main(String[] args) { + OpenAIClient client = OpenAIOkHttpClient.fromEnv(); + + UsageWebSearchCallsParams params = UsageWebSearchCallsParams.builder() + .startTime(0L) + .build(); + UsageWebSearchCallsResponse response = client.admin().organization().usage().webSearchCalls(params); + } + } + ruby: >- + require "openai" + + + openai = OpenAI::Client.new(admin_api_key: "My Admin API Key") + + + response = + openai.admin.organization.usage.web_search_calls(start_time: 0) + + + puts(response) + response: | + { + "object": "page", + "data": [ + { + "object": "bucket", + "start_time": 1730419200, + "end_time": 1730505600, + "results": [ + { + "object": "organization.usage.web_searches.result", + "num_model_requests": 2, + "num_requests": 2, + "project_id": null, + "user_id": null, + "api_key_id": null, + "model": null, + "context_level": null + } + ] + } + ], + "has_more": false, + "next_page": null + } /organization/users: get: security: @@ -25723,6 +26744,102 @@ paths: }, "client_secret": null } + /realtime/translations/client_secrets: + post: + summary: > + Create a Realtime translation client secret with an associated + translation session configuration. + + + Client secrets are short-lived tokens that can be passed to a client + app, + + such as a web frontend or mobile client, which grants access to the + Realtime + + Translation API without leaking your main API key. You can configure a + custom + + TTL for each client secret. + + + Returns the created client secret and the effective translation session + object. + + The client secret is a string that looks like `ek_1234`. + operationId: create-realtime-translation-client-secret + tags: + - Realtime + requestBody: + description: >- + Create a client secret with the given translation session + configuration. + required: true + content: + application/json: + schema: + $ref: >- + #/components/schemas/RealtimeTranslationClientSecretCreateRequest + responses: + '200': + description: Translation client secret created successfully. + content: + application/json: + schema: + $ref: >- + #/components/schemas/RealtimeTranslationClientSecretCreateResponse + x-oaiMeta: + name: Create translation client secret + group: realtime + examples: + request: + curl: > + curl -X POST + https://api.openai.com/v1/realtime/translations/client_secrets \ + -H "Authorization: Bearer $OPENAI_API_KEY" \ + -H "Content-Type: application/json" \ + -d '{ + "expires_after": { + "anchor": "created_at", + "seconds": 600 + }, + "session": { + "model": "gpt-realtime-translate", + "audio": { + "input": { + "transcription": { + "model": "gpt-realtime-whisper" + }, + "noise_reduction": null + }, + "output": { + "language": "es" + } + } + } + }' + response: | + { + "value": "ek_68af296e8e408191a1120ab6383263c2", + "expires_at": 1756310470, + "session": { + "id": "sess_C9CiUVUzUzYIssh3ELY1d", + "type": "translation", + "expires_at": 1756310470, + "model": "gpt-realtime-translate", + "audio": { + "input": { + "transcription": { + "model": "gpt-realtime-whisper" + }, + "noise_reduction": null + }, + "output": { + "language": "es" + } + } + } + } /responses: post: operationId: createResponse @@ -38902,9 +40019,9 @@ components: description: > The model to use for transcription. Current options are `whisper-1`, `gpt-4o-mini-transcribe`, `gpt-4o-mini-transcribe-2025-12-15`, - `gpt-4o-transcribe`, and `gpt-4o-transcribe-diarize`. Use - `gpt-4o-transcribe-diarize` when you need diarization with speaker - labels. + `gpt-4o-transcribe`, `gpt-4o-transcribe-diarize`, and + `gpt-realtime-whisper`. Use `gpt-4o-transcribe-diarize` when you + need diarization with speaker labels. anyOf: - type: string - type: string @@ -38914,6 +40031,7 @@ components: - gpt-4o-mini-transcribe-2025-12-15 - gpt-4o-transcribe - gpt-4o-transcribe-diarize + - gpt-realtime-whisper language: type: string description: > @@ -38937,6 +40055,52 @@ components: For `gpt-4o-transcribe` models (excluding `gpt-4o-transcribe-diarize`), the prompt is a free text string, for example "expect words related to technology". + + Prompt is not supported with `gpt-realtime-whisper` in GA Realtime + sessions. + delay: + type: string + description: > + Controls how long the model waits before emitting transcription + text. + + Higher values can improve transcription accuracy at the cost of + latency. + + Only supported with `gpt-realtime-whisper` in GA Realtime sessions. + enum: + - minimal + - low + - medium + - high + - xhigh + AudioTranscriptionResponse: + type: object + properties: + model: + description: > + The model used for transcription. Current options are `whisper-1`, + `gpt-4o-mini-transcribe`, `gpt-4o-mini-transcribe-2025-12-15`, + `gpt-4o-transcribe`, `gpt-4o-transcribe-diarize`, and + `gpt-realtime-whisper`. + anyOf: + - type: string + - type: string + enum: + - whisper-1 + - gpt-4o-mini-transcribe + - gpt-4o-mini-transcribe-2025-12-15 + - gpt-4o-transcribe + - gpt-4o-transcribe-diarize + - gpt-realtime-whisper + language: + type: string + description: | + The language of the input audio. + prompt: + type: string + description: | + The prompt configured for input audio transcription, when present. AuditLog: type: object description: A log of a user action or configuration change within this organization. @@ -41271,8 +42435,8 @@ components: top_logprobs: description: >- List of the most likely tokens and their log probability, at this - token position. In rare cases, there may be fewer than the number of - requested `top_logprobs` returned. + token position. The number of entries may be fewer than the + requested `top_logprobs`. type: array items: type: object @@ -42177,6 +43341,13 @@ components: When `group_by=api_key_id`, this field provides the API Key ID of the grouped costs result. - type: 'null' + quantity: + anyOf: + - type: number + description: >- + When `group_by=line_item`, this field provides the quantity of + the grouped costs result. + - type: 'null' required: - object x-oaiMeta: @@ -42189,7 +43360,8 @@ components: "currency": "usd" }, "line_item": "Image models", - "project_id": "proj_abc" + "project_id": "proj_abc", + "quantity": 10000 } CreateAssistantRequest: type: object @@ -42515,11 +43687,16 @@ components: $ref: '#/components/schemas/WebSearchContextSize' top_logprobs: description: > - An integer between 0 and 20 specifying the number of most likely - tokens to + An integer between 0 and 20 specifying the maximum number of + most likely - return at each token position, each with an associated log - probability. + tokens to return at each token position, each with an associated + log + + probability. In some cases, the number of returned tokens may be + fewer than + + requested. `logprobs` must be set to `true` if this parameter is used. type: integer @@ -44683,22 +45860,32 @@ components: nullable: true description: The number of images to generate. Must be between 1 and 10. size: - type: string - enum: - - 256x256 - - 512x512 - - 1024x1024 - - 1536x1024 - - 1024x1536 - - auto + anyOf: + - type: string + - type: string + enum: + - 256x256 + - 512x512 + - 1024x1024 + - 1536x1024 + - 1024x1536 + - auto default: 1024x1024 example: 1024x1024 nullable: true description: >- - The size of the generated images. Must be one of `1024x1024`, - `1536x1024` (landscape), `1024x1536` (portrait), or `auto` (default - value) for the GPT image models, and one of `256x256`, `512x512`, or - `1024x1024` for `dall-e-2`. + The size of the generated images. For `gpt-image-2` and + `gpt-image-2-2026-04-21`, arbitrary resolutions are supported as + `WIDTHxHEIGHT` strings, for example `1536x864`. Width and height + must both be divisible by 16 and the requested aspect ratio must be + between 1:3 and 3:1. Resolutions above `2560x1440` are experimental, + and the maximum supported resolution is `3840x2160`. The requested + size must also satisfy the model's current pixel and edge limits. + The standard sizes `1024x1024`, `1536x1024`, and `1024x1536` are + supported by the GPT image models; `auto` is supported for models + that allow automatic sizing. For `dall-e-2`, use one of `256x256`, + `512x512`, or `1024x1024`. For `dall-e-3`, use one of `1024x1024`, + `1792x1024`, or `1024x1792`. response_format: type: string enum: @@ -44896,25 +46083,34 @@ components: partial_images: $ref: '#/components/schemas/PartialImages' size: - type: string - enum: - - auto - - 1024x1024 - - 1536x1024 - - 1024x1536 - - 256x256 - - 512x512 - - 1792x1024 - - 1024x1792 + anyOf: + - type: string + - type: string + enum: + - auto + - 1024x1024 + - 1536x1024 + - 1024x1536 + - 256x256 + - 512x512 + - 1792x1024 + - 1024x1792 default: auto example: 1024x1024 nullable: true description: >- - The size of the generated images. Must be one of `1024x1024`, - `1536x1024` (landscape), `1024x1536` (portrait), or `auto` (default - value) for the GPT image models, one of `256x256`, `512x512`, or - `1024x1024` for `dall-e-2`, and one of `1024x1024`, `1792x1024`, or - `1024x1792` for `dall-e-3`. + The size of the generated images. For `gpt-image-2` and + `gpt-image-2-2026-04-21`, arbitrary resolutions are supported as + `WIDTHxHEIGHT` strings, for example `1536x864`. Width and height + must both be divisible by 16 and the requested aspect ratio must be + between 1:3 and 3:1. Resolutions above `2560x1440` are experimental, + and the maximum supported resolution is `3840x2160`. The requested + size must also satisfy the model's current pixel and edge limits. + The standard sizes `1024x1024`, `1536x1024`, and `1024x1536` are + supported by the GPT image models; `auto` is supported for models + that allow automatic sizing. For `dall-e-2`, use one of `256x256`, + `512x512`, or `1024x1024`. For `dall-e-3`, use one of `1024x1024`, + `1792x1024`, or `1024x1792`. moderation: type: string enum: @@ -45114,11 +46310,16 @@ components: properties: top_logprobs: description: > - An integer between 0 and 20 specifying the number of most likely - tokens to + An integer between 0 and 20 specifying the maximum number of + most likely + + tokens to return at each token position, each with an associated + log + + probability. In some cases, the number of returned tokens may be + fewer than - return at each token position, each with an associated log - probability. + requested. type: integer minimum: 0 maximum: 20 @@ -50860,6 +52061,23 @@ components: "object": "group.user.deleted", "deleted": true } + HostedToolPermission: + type: object + description: Permission state for a single hosted tool on a project. + properties: + enabled: + type: boolean + description: Whether the hosted tool is enabled for the project. + required: + - enabled + HostedToolPermissionUpdate: + type: object + properties: + enabled: + type: boolean + description: Whether to enable the hosted tool for the project. + required: + - enabled Image: type: object description: >- @@ -51279,15 +52497,27 @@ components: or `auto`. Default: `auto`. default: auto size: - type: string - enum: - - 1024x1024 - - 1024x1536 - - 1536x1024 - - auto - description: | - The size of the generated image. One of `1024x1024`, `1024x1536`, - `1536x1024`, or `auto`. Default: `auto`. + anyOf: + - type: string + - type: string + enum: + - 1024x1024 + - 1024x1536 + - 1536x1024 + - auto + description: >- + The size of the generated images. For `gpt-image-2` and + `gpt-image-2-2026-04-21`, arbitrary resolutions are supported as + `WIDTHxHEIGHT` strings, for example `1536x864`. Width and height + must both be divisible by 16 and the requested aspect ratio must be + between 1:3 and 3:1. Resolutions above `2560x1440` are experimental, + and the maximum supported resolution is `3840x2160`. The requested + size must also satisfy the model's current pixel and edge limits. + The standard sizes `1024x1024`, `1536x1024`, and `1024x1536` are + supported by the GPT image models; `auto` is supported for models + that allow automatic sizing. For `dall-e-2`, use one of `256x256`, + `512x512`, or `1024x1024`. For `dall-e-3`, use one of `1024x1024`, + `1792x1024`, or `1024x1792`. default: auto output_format: type: string @@ -51589,6 +52819,7 @@ components: generated by the model. Can contain text, images, and audio inputs, as well as previous assistant responses and tool call outputs. $ref: '#/components/schemas/Item' + - $ref: '#/components/schemas/CompactionTriggerItemParam' - $ref: '#/components/schemas/ItemReferenceParam' discriminator: propertyName: type @@ -51855,7 +53086,9 @@ components: description: >- An array of projects to which membership is granted at the same time the org invite is accepted. If omitted, the user will be invited to - the default project for compatibility with legacy behavior. + the default project for compatibility with legacy behavior. If empty + list is passed, the user will not be invited to any projects, + including the default one. items: type: object properties: @@ -53800,11 +55033,16 @@ components: top_logprobs: anyOf: - description: > - An integer between 0 and 20 specifying the number of most likely - tokens to + An integer between 0 and 20 specifying the maximum number of + most likely + + tokens to return at each token position, each with an associated + log - return at each token position, each with an associated log - probability. + probability. In some cases, the number of returned tokens may be + fewer than + + requested. type: integer minimum: 0 maximum: 20 @@ -54894,6 +56132,74 @@ components: "has_more": false, "next": null } + ProjectHostedToolPermissions: + type: object + description: Represents hosted tool permissions for a project. + properties: + file_search: + $ref: '#/components/schemas/HostedToolPermission' + web_search: + $ref: '#/components/schemas/HostedToolPermission' + image_generation: + $ref: '#/components/schemas/HostedToolPermission' + mcp: + $ref: '#/components/schemas/HostedToolPermission' + code_interpreter: + $ref: '#/components/schemas/HostedToolPermission' + required: + - file_search + - web_search + - image_generation + - mcp + - code_interpreter + x-oaiMeta: + name: The project hosted tool permissions object + example: | + { + "file_search": { + "enabled": true + }, + "web_search": { + "enabled": true + }, + "image_generation": { + "enabled": true + }, + "mcp": { + "enabled": true + }, + "code_interpreter": { + "enabled": true + } + } + ProjectHostedToolPermissionsUpdateRequest: + type: object + properties: + file_search: + anyOf: + - $ref: '#/components/schemas/HostedToolPermissionUpdate' + - type: 'null' + description: The file search permission update. + web_search: + anyOf: + - $ref: '#/components/schemas/HostedToolPermissionUpdate' + - type: 'null' + description: The web search permission update. + image_generation: + anyOf: + - $ref: '#/components/schemas/HostedToolPermissionUpdate' + - type: 'null' + description: The image generation permission update. + mcp: + anyOf: + - $ref: '#/components/schemas/HostedToolPermissionUpdate' + - type: 'null' + description: The MCP permission update. + code_interpreter: + anyOf: + - $ref: '#/components/schemas/HostedToolPermissionUpdate' + - type: 'null' + description: The code interpreter permission update. ProjectListResponse: type: object properties: @@ -54920,6 +56226,84 @@ components: - object - data - has_more + ProjectModelPermissions: + type: object + description: Represents the model allowlist or denylist policy for a project. + properties: + object: + type: string + enum: + - project.model_permissions + description: The object type, which is always `project.model_permissions`. + x-stainless-const: true + mode: + type: string + enum: + - allow_list + - deny_list + description: Whether the project uses an allowlist or a denylist. + model_ids: + type: array + items: + type: string + description: The model IDs included in the model permissions policy. + required: + - object + - mode + - model_ids + x-oaiMeta: + name: The project model permissions object + example: | + { + "object": "project.model_permissions", + "mode": "allow_list", + "model_ids": [ + "gpt-4.1", + "o3" + ] + } + ProjectModelPermissionsDeleteResponse: + type: object + description: Confirmation payload returned after deleting project model permissions. + properties: + object: + type: string + enum: + - project.model_permissions.deleted + description: >- + The object type, which is always + `project.model_permissions.deleted`. + x-stainless-const: true + deleted: + type: boolean + description: Whether the project model permissions were deleted. + required: + - object + - deleted + x-oaiMeta: + name: Project model permissions deletion confirmation + example: | + { + "object": "project.model_permissions.deleted", + "deleted": true + } + ProjectModelPermissionsUpdateRequest: + type: object + properties: + mode: + type: string + enum: + - allow_list + - deny_list + description: The model permissions mode to apply. + model_ids: + type: array + items: + type: string + description: The model IDs included in this permissions policy. + required: + - mode + - model_ids ProjectRateLimit: type: object description: Represents a project rate limit config. @@ -60190,6 +61574,29 @@ components: required: - type - message + RealtimeReasoning: + type: object + title: Realtime reasoning configuration + description: > + Configuration for reasoning-capable Realtime models such as + `gpt-realtime-2`. + properties: + effort: + $ref: '#/components/schemas/RealtimeReasoningEffort' + RealtimeReasoningEffort: + type: string + description: > + Constrains effort on reasoning for reasoning-capable Realtime models + such as + + `gpt-realtime-2`. + enum: + - minimal + - low + - medium + - high + - xhigh + default: low RealtimeResponse: type: object description: The response resource. @@ -60509,6 +61916,15 @@ components: - $ref: '#/components/schemas/ToolChoiceFunction' - $ref: '#/components/schemas/ToolChoiceMCP' default: auto + parallel_tool_calls: + type: boolean + description: > + Whether the model may call multiple tools in parallel. Only + supported by + + reasoning Realtime models such as `gpt-realtime-2`. + reasoning: + $ref: '#/components/schemas/RealtimeReasoning' max_output_tokens: oneOf: - type: integer @@ -62950,8 +64366,9 @@ components: session: description: The session configuration. oneOf: - - $ref: '#/components/schemas/RealtimeSessionCreateRequestGA' - - $ref: '#/components/schemas/RealtimeTranscriptionSessionCreateRequestGA' + - $ref: '#/components/schemas/RealtimeSessionCreateResponseGA' + - $ref: >- + #/components/schemas/RealtimeTranscriptionSessionCreateResponseGA required: - event_id - type @@ -63026,8 +64443,9 @@ components: session: description: The session configuration. oneOf: - - $ref: '#/components/schemas/RealtimeSessionCreateRequestGA' - - $ref: '#/components/schemas/RealtimeTranscriptionSessionCreateRequestGA' + - $ref: '#/components/schemas/RealtimeSessionCreateResponseGA' + - $ref: >- + #/components/schemas/RealtimeTranscriptionSessionCreateResponseGA required: - event_id - type @@ -63290,7 +64708,7 @@ components: input_audio_transcription: anyOf: - allOf: - - $ref: '#/components/schemas/AudioTranscription' + - $ref: '#/components/schemas/AudioTranscriptionResponse' description: > Configuration for input audio transcription, defaults to off and can be set to `null` to turn off once on. Input audio @@ -63759,6 +65177,7 @@ components: enum: - gpt-realtime - gpt-realtime-1.5 + - gpt-realtime-2 - gpt-realtime-2025-08-28 - gpt-4o-realtime-preview - gpt-4o-realtime-preview-2024-10-01 @@ -63957,6 +65376,15 @@ components: - $ref: '#/components/schemas/ToolChoiceFunction' - $ref: '#/components/schemas/ToolChoiceMCP' default: auto + parallel_tool_calls: + type: boolean + description: > + Whether the model may call multiple tools in parallel. Only + supported by + + reasoning Realtime models such as `gpt-realtime-2`. + reasoning: + $ref: '#/components/schemas/RealtimeReasoning' max_output_tokens: oneOf: - type: integer @@ -64062,7 +65490,7 @@ components: transcription: description: | Configuration for input audio transcription. - $ref: '#/components/schemas/AudioTranscription' + $ref: '#/components/schemas/AudioTranscriptionResponse' noise_reduction: type: object description: | @@ -64243,32 +65671,10 @@ components: } RealtimeSessionCreateResponseGA: type: object + title: Realtime session configuration object description: | - A new Realtime session configuration, with an ephemeral key. Default TTL - for keys is one minute. + A Realtime session configuration object. properties: - client_secret: - type: object - description: Ephemeral key returned by the API. - properties: - value: - type: string - description: > - Ephemeral key usable in client environments to authenticate - connections to the Realtime API. Use this in client-side - environments rather than a standard API token, which should only - be used server-side. - expires_at: - type: integer - format: unixtime - description: > - Timestamp for when the token expires. Currently, all tokens - expire - - after one minute. - required: - - value - - expires_at type: type: string description: > @@ -64277,6 +65683,21 @@ components: enum: - realtime x-stainless-const: true + id: + type: string + description: > + Unique identifier for the session that looks like + `sess_1234567890abcdef`. + object: + type: string + description: The object type. Always `realtime.session`. + enum: + - realtime.session + x-stainless-const: true + expires_at: + type: integer + format: unixtime + description: Expiration timestamp for the session, in seconds since epoch. output_modalities: type: array description: > @@ -64302,6 +65723,7 @@ components: enum: - gpt-realtime - gpt-realtime-1.5 + - gpt-realtime-2 - gpt-realtime-2025-08-28 - gpt-4o-realtime-preview - gpt-4o-realtime-preview-2024-10-01 @@ -64358,7 +65780,7 @@ components: optionally set the language and prompt for transcription, these offer additional guidance to the transcription service. - $ref: '#/components/schemas/AudioTranscription' + $ref: '#/components/schemas/AudioTranscriptionResponse' noise_reduction: type: object default: null @@ -64500,6 +65922,8 @@ components: - $ref: '#/components/schemas/ToolChoiceFunction' - $ref: '#/components/schemas/ToolChoiceMCP' default: auto + reasoning: + $ref: '#/components/schemas/RealtimeReasoning' max_output_tokens: oneOf: - type: integer @@ -64517,8 +65941,9 @@ components: prompt: $ref: '#/components/schemas/Prompt' required: - - client_secret - type + - id + - object x-oaiMeta: name: The session object group: realtime @@ -64735,7 +66160,7 @@ components: input_audio_transcription: description: | Configuration of the transcription model. - $ref: '#/components/schemas/AudioTranscription' + $ref: '#/components/schemas/AudioTranscriptionResponse' turn_detection: type: object description: > @@ -64852,7 +66277,7 @@ components: transcription: description: | Configuration of the transcription model. - $ref: '#/components/schemas/AudioTranscription' + $ref: '#/components/schemas/AudioTranscriptionResponse' noise_reduction: type: object description: | @@ -64861,48 +66286,56 @@ components: type: $ref: '#/components/schemas/NoiseReductionType' turn_detection: - type: object description: > - Configuration for turn detection. Can be set to `null` to - turn off. Server + Configuration for turn detection. For + `gpt-realtime-whisper`, this must be `null`; VAD is not + supported. + anyOf: + - type: object + description: > + Configuration for turn detection. Can be set to `null` + to turn off. Server - VAD means that the model will detect the start and end of - speech based on + VAD means that the model will detect the start and end + of speech based on - audio volume and respond at the end of user speech. - properties: - type: - type: string - description: > - Type of turn detection, only `server_vad` is currently + audio volume and respond at the end of user speech. For + `gpt-realtime-whisper`, this must be `null`; VAD is not supported. - threshold: - type: number - description: > - Activation threshold for VAD (0.0 to 1.0), this defaults - to 0.5. A + properties: + type: + type: string + description: > + Type of turn detection, only `server_vad` is + currently supported. + threshold: + type: number + description: > + Activation threshold for VAD (0.0 to 1.0), this + defaults to 0.5. A - higher threshold will require louder audio to activate - the model, and + higher threshold will require louder audio to + activate the model, and - thus might perform better in noisy environments. - prefix_padding_ms: - type: integer - description: > - Amount of audio to include before the VAD detected - speech (in + thus might perform better in noisy environments. + prefix_padding_ms: + type: integer + description: > + Amount of audio to include before the VAD detected + speech (in - milliseconds). Defaults to 300ms. - silence_duration_ms: - type: integer - description: > - Duration of silence to detect speech stop (in - milliseconds). Defaults + milliseconds). Defaults to 300ms. + silence_duration_ms: + type: integer + description: > + Duration of silence to detect speech stop (in + milliseconds). Defaults - to 500ms. With shorter values the model will respond - more quickly, + to 500ms. With shorter values the model will respond + more quickly, - but may jump in on short pauses from the user. + but may jump in on short pauses from the user. + - type: 'null' required: - type - id @@ -64935,6 +66368,792 @@ components: } } } + RealtimeTranslationClientEvent: + discriminator: + propertyName: type + description: | + A Realtime translation client event. + anyOf: + - $ref: '#/components/schemas/RealtimeTranslationClientEventSessionUpdate' + - $ref: >- + #/components/schemas/RealtimeTranslationClientEventInputAudioBufferAppend + - $ref: '#/components/schemas/RealtimeTranslationClientEventSessionClose' + RealtimeTranslationClientEventInputAudioBufferAppend: + type: object + description: > + Send this event to append audio bytes to the translation session input + audio buffer. + + + WebSocket translation sessions accept base64-encoded 24 kHz PCM16 mono + + little-endian raw audio bytes. Unsupported websocket audio formats + return a + + validation error because lower-quality audio materially degrades + translation + + quality. + + + Translation consumes 200 ms engine frames. For best realtime behavior, + append + + audio in 200 ms chunks. If a chunk is shorter, the server buffers it + until it + + has enough audio for one frame. If a chunk is longer, the server splits + it into + + 200 ms frames and enqueues them back-to-back. + + + Keep appending silence while the session is active. If a client stops + sending + + audio and later resumes, model time treats the resumed audio as + contiguous with + + the previous audio rather than as a real-world pause. + properties: + event_id: + type: string + maxLength: 512 + description: Optional client-generated ID used to identify this event. + type: + type: string + enum: + - session.input_audio_buffer.append + description: The event type, must be `session.input_audio_buffer.append`. + x-stainless-const: true + audio: + type: string + description: Base64-encoded 24 kHz PCM16 mono audio bytes. + required: + - type + - audio + x-oaiMeta: + name: session.input_audio_buffer.append + group: realtime + example: | + { + "event_id": "event_456", + "type": "session.input_audio_buffer.append", + "audio": "Base64EncodedAudioData" + } + RealtimeTranslationClientEventSessionClose: + type: object + description: > + Gracefully close the realtime translation session. The server flushes + pending + + input audio and emits any remaining translated output before closing the + + session. + properties: + event_id: + type: string + maxLength: 512 + description: Optional client-generated ID used to identify this event. + type: + type: string + enum: + - session.close + description: The event type, must be `session.close`. + x-stainless-const: true + required: + - type + x-oaiMeta: + name: session.close + group: realtime + example: | + { + "event_id": "event_789", + "type": "session.close" + } + RealtimeTranslationClientEventSessionUpdate: + type: object + description: > + Send this event to update the translation session configuration. + Translation + + sessions support updates to `audio.output.language`, + `audio.input.transcription`, + + and `audio.input.noise_reduction`. + properties: + event_id: + type: string + maxLength: 512 + description: Optional client-generated ID used to identify this event. + type: + type: string + enum: + - session.update + description: The event type, must be `session.update`. + x-stainless-const: true + session: + $ref: '#/components/schemas/RealtimeTranslationSessionUpdateRequest' + description: > + Translation session fields to update. The session `type` and `model` + are set + + at creation and cannot be changed with `session.update`. + required: + - type + - session + x-oaiMeta: + name: session.update + group: realtime + example: | + { + "type": "session.update", + "session": { + "audio": { + "input": { + "transcription": { + "model": "gpt-realtime-whisper" + }, + "noise_reduction": null + }, + "output": { + "language": "es" + } + } + } + } + RealtimeTranslationClientSecretCreateRequest: + type: object + title: Realtime translation client secret creation request + description: | + Create a translation session and client secret for the Realtime API. + properties: + expires_after: + type: object + title: Client secret expiration + description: > + Configuration for the client secret expiration. Expiration refers to + the time after which + + a client secret will no longer be valid for creating sessions. The + session itself may + + continue after that time once started. A secret can be used to + create multiple sessions + + until it expires. + properties: + anchor: + type: string + enum: + - created_at + description: > + The anchor point for the client secret expiration, meaning that + `seconds` will be added to the `created_at` time of the client + secret to produce an expiration timestamp. Only `created_at` is + currently supported. + default: created_at + x-stainless-const: true + seconds: + type: integer + format: int64 + description: > + The number of seconds from the anchor point to the expiration. + Select a value between `10` and `7200` (2 hours). This default + to 600 seconds (10 minutes) if not specified. + minimum: 10 + maximum: 7200 + default: 600 + session: + $ref: '#/components/schemas/RealtimeTranslationSessionCreateRequest' + required: + - session + RealtimeTranslationClientSecretCreateResponse: + type: object + title: Realtime translation session and client secret + description: > + Response from creating a translation session and client secret for the + Realtime API. + properties: + value: + type: string + description: The generated client secret value. + expires_at: + type: integer + format: unixtime + description: Expiration timestamp for the client secret, in seconds since epoch. + session: + $ref: '#/components/schemas/RealtimeTranslationSession' + required: + - value + - expires_at + - session + x-oaiMeta: + name: Translation session response object + group: realtime + example: | + { + "value": "ek_68af296e8e408191a1120ab6383263c2", + "expires_at": 1756310470, + "session": { + "id": "sess_C9CiUVUzUzYIssh3ELY1d", + "type": "translation", + "expires_at": 1756310470, + "model": "gpt-realtime-translate", + "audio": { + "input": { + "transcription": null, + "noise_reduction": null + }, + "output": { + "language": "es" + } + } + } + } + RealtimeTranslationServerEvent: + discriminator: + propertyName: type + description: | + A Realtime translation server event. + anyOf: + - $ref: '#/components/schemas/RealtimeServerEventError' + - $ref: '#/components/schemas/RealtimeTranslationServerEventSessionCreated' + - $ref: '#/components/schemas/RealtimeTranslationServerEventSessionUpdated' + - $ref: '#/components/schemas/RealtimeTranslationServerEventSessionClosed' + - $ref: >- + #/components/schemas/RealtimeTranslationServerEventSessionInputTranscriptDelta + - $ref: >- + #/components/schemas/RealtimeTranslationServerEventSessionOutputTranscriptDelta + - $ref: >- + #/components/schemas/RealtimeTranslationServerEventSessionOutputAudioDelta + RealtimeTranslationServerEventSessionClosed: + type: object + description: | + Returned when a realtime translation session is closed. + properties: + event_id: + type: string + description: The unique ID of the server event. + type: + type: string + enum: + - session.closed + description: The event type, must be `session.closed`. + x-stainless-const: true + required: + - event_id + - type + x-oaiMeta: + name: session.closed + group: realtime + example: | + { + "event_id": "event_987", + "type": "session.closed" + } + RealtimeTranslationServerEventSessionCreated: + type: object + description: > + Returned when a translation session is created. Emitted automatically + when a + + new connection is established as the first server event. This event + contains + + the default translation session configuration. + properties: + event_id: + type: string + description: The unique ID of the server event. + type: + type: string + enum: + - session.created + description: The event type, must be `session.created`. + x-stainless-const: true + session: + $ref: '#/components/schemas/RealtimeTranslationSession' + description: The translation session configuration. + required: + - event_id + - type + - session + x-oaiMeta: + name: session.created + group: realtime + example: | + { + "type": "session.created", + "event_id": "event_123", + "session": { + "id": "sess_123", + "type": "translation", + "model": "gpt-realtime-translate", + "expires_at": 1714857600, + "audio": { + "input": { + "transcription": { + "model": "gpt-realtime-whisper", + "language": "en" + }, + "noise_reduction": { + "type": "near_field" + } + }, + "output": { + "language": "fr" + } + } + } + } + RealtimeTranslationServerEventSessionInputTranscriptDelta: + type: object + description: > + Returned when optional source-language transcript text is available. + This event + + is emitted only when `audio.input.transcription` is configured. + + + Transcript deltas are append-only text fragments. Clients should not + insert + + unconditional spaces between deltas. + properties: + event_id: + type: string + description: The unique ID of the server event. + type: + type: string + enum: + - session.input_transcript.delta + description: The event type, must be `session.input_transcript.delta`. + x-stainless-const: true + delta: + type: string + description: Append-only source-language transcript text. + elapsed_ms: + anyOf: + - type: integer + description: > + Timing metadata for stream alignment, derived from the + translation frame + + when available. It advances in 200 ms increments, but multiple + transcript + + deltas may share the same `elapsed_ms`. Treat it as alignment + metadata, + + not a unique transcript-delta identifier. + - type: 'null' + required: + - event_id + - type + - delta + x-oaiMeta: + name: session.input_transcript.delta + group: realtime + example: | + { + "event_id": "event_125", + "type": "session.input_transcript.delta", + "delta": " hear", + "elapsed_ms": 1200 + } + RealtimeTranslationServerEventSessionOutputAudioDelta: + type: object + description: > + Returned when translated output audio is available. Output audio deltas + are + + 200 ms frames of PCM16 audio. + properties: + event_id: + type: string + description: The unique ID of the server event. + type: + type: string + enum: + - session.output_audio.delta + description: The event type, must be `session.output_audio.delta`. + x-stainless-const: true + delta: + type: string + description: Base64-encoded translated audio data. + sample_rate: + type: integer + description: Sample rate of the audio delta. + default: 24000 + channels: + type: integer + description: Number of audio channels. + default: 1 + format: + type: string + enum: + - pcm16 + description: Audio encoding for `delta`. + x-stainless-const: true + elapsed_ms: + anyOf: + - type: integer + description: > + Timing metadata for stream alignment, derived from the + translation frame + + when available. Treat `elapsed_ms` as alignment metadata, not a + unique + + event identifier. + - type: 'null' + required: + - event_id + - type + - delta + x-oaiMeta: + name: session.output_audio.delta + group: realtime + example: | + { + "event_id": "event_123", + "type": "session.output_audio.delta", + "delta": "Base64EncodedAudioDelta", + "sample_rate": 24000, + "channels": 1, + "format": "pcm16", + "elapsed_ms": 1200 + } + RealtimeTranslationServerEventSessionOutputTranscriptDelta: + type: object + description: > + Returned when translated transcript text is available. + + + Transcript deltas are append-only text fragments. Clients should not + insert + + unconditional spaces between deltas. + properties: + event_id: + type: string + description: The unique ID of the server event. + type: + type: string + enum: + - session.output_transcript.delta + description: The event type, must be `session.output_transcript.delta`. + x-stainless-const: true + delta: + type: string + description: Append-only transcript text for the translated output audio. + elapsed_ms: + anyOf: + - type: integer + description: > + Timing metadata for stream alignment, derived from the + translation frame + + when available. It advances in 200 ms increments, but multiple + transcript + + deltas may share the same `elapsed_ms`. Treat it as alignment + metadata, + + not a unique transcript-delta identifier. + - type: 'null' + required: + - event_id + - type + - delta + x-oaiMeta: + name: session.output_transcript.delta + group: realtime + example: | + { + "event_id": "event_124", + "type": "session.output_transcript.delta", + "delta": " escuch", + "elapsed_ms": 1200 + } + RealtimeTranslationServerEventSessionUpdated: + type: object + description: > + Returned when a translation session is updated with a `session.update` + event, + + unless there is an error. + properties: + event_id: + type: string + description: The unique ID of the server event. + type: + type: string + enum: + - session.updated + description: The event type, must be `session.updated`. + x-stainless-const: true + session: + $ref: '#/components/schemas/RealtimeTranslationSession' + description: The translation session configuration. + required: + - event_id + - type + - session + x-oaiMeta: + name: session.updated + group: realtime + example: | + { + "type": "session.updated", + "event_id": "event_124", + "session": { + "id": "sess_123", + "type": "translation", + "model": "gpt-realtime-translate", + "expires_at": 1714857600, + "audio": { + "input": { + "transcription": { + "model": "gpt-realtime-whisper", + "language": "en" + }, + "noise_reduction": { + "type": "near_field" + } + }, + "output": { + "language": "es" + } + } + } + } + RealtimeTranslationSession: + type: object + title: Realtime translation session + description: > + A Realtime translation session. Translation sessions continuously + translate input + + audio into the configured output language. + properties: + id: + type: string + description: > + Unique identifier for the session that looks like + `sess_1234567890abcdef`. + type: + type: string + enum: + - translation + description: > + The session type. Always `translation` for Realtime translation + sessions. + x-stainless-const: true + expires_at: + type: integer + format: unixtime + description: Expiration timestamp for the session, in seconds since epoch. + model: + type: string + description: > + The Realtime translation model used for this session. This field is + set at + + session creation and cannot be changed with `session.update`. + audio: + type: object + description: | + Configuration for translation input and output audio. + properties: + input: + type: object + properties: + transcription: + anyOf: + - type: object + description: > + Optional source-language transcription. When configured, + the server emits + + `session.input_transcript.delta` events. Translation + itself still runs from + + the input audio stream. + properties: + model: + type: string + description: >- + The transcription model used for source transcript + deltas. + required: + - model + - type: 'null' + noise_reduction: + anyOf: + - type: object + description: | + Optional input noise reduction. + properties: + type: + $ref: '#/components/schemas/NoiseReductionType' + required: + - type + - type: 'null' + output: + type: object + properties: + language: + type: string + description: > + Target language for translated output audio and transcript + deltas. + required: + - id + - type + - expires_at + - model + - audio + x-oaiMeta: + name: The translation session object + group: realtime + example: | + { + "id": "sess_C9G5QPteg4UIbotdKLoYQ", + "type": "translation", + "expires_at": 1756324625, + "model": "gpt-realtime-translate", + "audio": { + "input": { + "transcription": { + "model": "gpt-realtime-whisper" + }, + "noise_reduction": null + }, + "output": { + "language": "es" + } + } + } + RealtimeTranslationSessionCreateRequest: + type: object + title: Realtime translation session configuration + description: > + Realtime translation session configuration. Translation sessions stream + source + + audio in and translated audio plus transcript deltas out continuously. + properties: + model: + type: string + description: | + The Realtime translation model used for this session. + audio: + type: object + description: | + Configuration for translation input and output audio. + properties: + input: + type: object + properties: + transcription: + anyOf: + - type: object + description: > + Optional source-language transcription. When configured, + the server emits + + `session.input_transcript.delta` events. Translation + itself still runs from + + the input audio stream. + properties: + model: + type: string + description: >- + The transcription model to use for source transcript + deltas. + required: + - model + - type: 'null' + noise_reduction: + anyOf: + - type: object + description: > + Optional input noise reduction. Set to `null` to disable + it. + properties: + type: + $ref: '#/components/schemas/NoiseReductionType' + required: + - type + - type: 'null' + output: + type: object + properties: + language: + type: string + description: > + Target language for translated output audio and transcript + deltas. + required: + - model + RealtimeTranslationSessionUpdateRequest: + type: object + title: Realtime translation session update + description: > + Realtime translation session fields that can be updated with + `session.update`. + properties: + audio: + type: object + description: | + Configuration for translation input and output audio. + properties: + input: + type: object + properties: + transcription: + anyOf: + - type: object + description: > + Optional source-language transcription. When configured, + the server emits + + `session.input_transcript.delta` events. Translation + itself still runs from + + the input audio stream. + properties: + model: + type: string + description: >- + The transcription model to use for source transcript + deltas. + required: + - model + - type: 'null' + noise_reduction: + anyOf: + - type: object + description: > + Optional input noise reduction. Set to `null` to disable + it. + properties: + type: + $ref: '#/components/schemas/NoiseReductionType' + required: + - type + - type: 'null' + output: + type: object + properties: + language: + type: string + description: > + Target language for translated output audio and transcript + deltas. RealtimeTruncation: title: Realtime Truncation Controls description: > @@ -65031,6 +67250,12 @@ components: model will score a low probability of turn end and wait longer for the user to continue speaking. This can be useful for more natural conversations, but may have a higher latency. + + + For `gpt-realtime-whisper` transcription sessions, turn detection + must be + + set to `null`; VAD is not supported. oneOf: - type: object title: Server VAD @@ -67046,7 +69271,7 @@ components: type: number top_logprobs: description: | - The log probability of the top 20 most likely tokens. + The log probabilities of up to 20 of the most likely tokens. type: array items: type: object @@ -71336,150 +73561,230 @@ components: When `group_by=model`, this field provides the model name of the grouped usage result. - type: 'null' - required: - - object - - characters - - num_model_requests - x-oaiMeta: - name: Audio speeches usage object - example: | - { - "object": "organization.usage.audio_speeches.result", - "characters": 45, - "num_model_requests": 1, - "project_id": "proj_abc", - "user_id": "user-abc", - "api_key_id": "key_abc", - "model": "tts-1" - } - UsageAudioTranscriptionsResult: - type: object - description: >- - The aggregated audio transcriptions usage details of the specific time - bucket. - properties: - object: - type: string - enum: - - organization.usage.audio_transcriptions.result - x-stainless-const: true - seconds: - type: integer - format: int64 - description: The number of seconds processed. - num_model_requests: - type: integer - description: The count of requests made to the model. - project_id: - anyOf: - - type: string - description: >- - When `group_by=project_id`, this field provides the project ID - of the grouped usage result. - - type: 'null' - user_id: - anyOf: - - type: string - description: >- - When `group_by=user_id`, this field provides the user ID of the - grouped usage result. - - type: 'null' - api_key_id: + required: + - object + - characters + - num_model_requests + x-oaiMeta: + name: Audio speeches usage object + example: | + { + "object": "organization.usage.audio_speeches.result", + "characters": 45, + "num_model_requests": 1, + "project_id": "proj_abc", + "user_id": "user-abc", + "api_key_id": "key_abc", + "model": "tts-1" + } + UsageAudioTranscriptionsResult: + type: object + description: >- + The aggregated audio transcriptions usage details of the specific time + bucket. + properties: + object: + type: string + enum: + - organization.usage.audio_transcriptions.result + x-stainless-const: true + seconds: + type: integer + format: int64 + description: The number of seconds processed. + num_model_requests: + type: integer + description: The count of requests made to the model. + project_id: + anyOf: + - type: string + description: >- + When `group_by=project_id`, this field provides the project ID + of the grouped usage result. + - type: 'null' + user_id: + anyOf: + - type: string + description: >- + When `group_by=user_id`, this field provides the user ID of the + grouped usage result. + - type: 'null' + api_key_id: + anyOf: + - type: string + description: >- + When `group_by=api_key_id`, this field provides the API key ID + of the grouped usage result. + - type: 'null' + model: + anyOf: + - type: string + description: >- + When `group_by=model`, this field provides the model name of the + grouped usage result. + - type: 'null' + required: + - object + - seconds + - num_model_requests + x-oaiMeta: + name: Audio transcriptions usage object + example: | + { + "object": "organization.usage.audio_transcriptions.result", + "seconds": 10, + "num_model_requests": 1, + "project_id": "proj_abc", + "user_id": "user-abc", + "api_key_id": "key_abc", + "model": "tts-1" + } + UsageCodeInterpreterSessionsResult: + type: object + description: >- + The aggregated code interpreter sessions usage details of the specific + time bucket. + properties: + object: + type: string + enum: + - organization.usage.code_interpreter_sessions.result + x-stainless-const: true + num_sessions: + type: integer + description: The number of code interpreter sessions. + project_id: + anyOf: + - type: string + description: >- + When `group_by=project_id`, this field provides the project ID + of the grouped usage result. + - type: 'null' + required: + - object + - num_sessions + x-oaiMeta: + name: Code interpreter sessions usage object + example: | + { + "object": "organization.usage.code_interpreter_sessions.result", + "num_sessions": 1, + "project_id": "proj_abc" + } + UsageCompletionsResult: + type: object + description: The aggregated completions usage details of the specific time bucket. + properties: + object: + type: string + enum: + - organization.usage.completions.result + x-stainless-const: true + input_tokens: + type: integer + description: >- + The aggregated number of text input tokens used, including cached + tokens. For customers subscribe to scale tier, this includes scale + tier tokens. + input_cached_tokens: + type: integer + description: >- + The aggregated number of text input tokens that has been cached from + previous requests. For customers subscribe to scale tier, this + includes scale tier tokens. + output_tokens: + type: integer + description: >- + The aggregated number of text output tokens used. For customers + subscribe to scale tier, this includes scale tier tokens. + input_audio_tokens: + type: integer + description: >- + The aggregated number of audio input tokens used, including cached + tokens. + output_audio_tokens: + type: integer + description: The aggregated number of audio output tokens used. + num_model_requests: + type: integer + description: The count of requests made to the model. + project_id: + anyOf: + - type: string + description: >- + When `group_by=project_id`, this field provides the project ID + of the grouped usage result. + - type: 'null' + user_id: + anyOf: + - type: string + description: >- + When `group_by=user_id`, this field provides the user ID of the + grouped usage result. + - type: 'null' + api_key_id: + anyOf: + - type: string + description: >- + When `group_by=api_key_id`, this field provides the API key ID + of the grouped usage result. + - type: 'null' + model: + anyOf: + - type: string + description: >- + When `group_by=model`, this field provides the model name of the + grouped usage result. + - type: 'null' + batch: anyOf: - - type: string + - type: boolean description: >- - When `group_by=api_key_id`, this field provides the API key ID - of the grouped usage result. + When `group_by=batch`, this field tells whether the grouped + usage result is batch or not. - type: 'null' - model: + service_tier: anyOf: - type: string description: >- - When `group_by=model`, this field provides the model name of the - grouped usage result. + When `group_by=service_tier`, this field provides the service + tier of the grouped usage result. - type: 'null' required: - object - - seconds + - input_tokens + - output_tokens - num_model_requests x-oaiMeta: - name: Audio transcriptions usage object + name: Completions usage object example: | { - "object": "organization.usage.audio_transcriptions.result", - "seconds": 10, - "num_model_requests": 1, + "object": "organization.usage.completions.result", + "input_tokens": 5000, + "output_tokens": 1000, + "input_cached_tokens": 4000, + "input_audio_tokens": 300, + "output_audio_tokens": 200, + "num_model_requests": 5, "project_id": "proj_abc", "user_id": "user-abc", "api_key_id": "key_abc", - "model": "tts-1" - } - UsageCodeInterpreterSessionsResult: - type: object - description: >- - The aggregated code interpreter sessions usage details of the specific - time bucket. - properties: - object: - type: string - enum: - - organization.usage.code_interpreter_sessions.result - x-stainless-const: true - num_sessions: - type: integer - description: The number of code interpreter sessions. - project_id: - anyOf: - - type: string - description: >- - When `group_by=project_id`, this field provides the project ID - of the grouped usage result. - - type: 'null' - required: - - object - - num_sessions - x-oaiMeta: - name: Code interpreter sessions usage object - example: | - { - "object": "organization.usage.code_interpreter_sessions.result", - "num_sessions": 1, - "project_id": "proj_abc" + "model": "gpt-4o-mini-2024-07-18", + "batch": false, + "service_tier": "default" } - UsageCompletionsResult: + UsageEmbeddingsResult: type: object - description: The aggregated completions usage details of the specific time bucket. + description: The aggregated embeddings usage details of the specific time bucket. properties: object: type: string enum: - - organization.usage.completions.result + - organization.usage.embeddings.result x-stainless-const: true input_tokens: type: integer - description: >- - The aggregated number of text input tokens used, including cached - tokens. For customers subscribe to scale tier, this includes scale - tier tokens. - input_cached_tokens: - type: integer - description: >- - The aggregated number of text input tokens that has been cached from - previous requests. For customers subscribe to scale tier, this - includes scale tier tokens. - output_tokens: - type: integer - description: >- - The aggregated number of text output tokens used. For customers - subscribe to scale tier, this includes scale tier tokens. - input_audio_tokens: - type: integer - description: >- - The aggregated number of audio input tokens used, including cached - tokens. - output_audio_tokens: - type: integer - description: The aggregated number of audio output tokens used. + description: The aggregated number of input tokens used. num_model_requests: type: integer description: The count of requests made to the model. @@ -71511,58 +73816,36 @@ components: When `group_by=model`, this field provides the model name of the grouped usage result. - type: 'null' - batch: - anyOf: - - type: boolean - description: >- - When `group_by=batch`, this field tells whether the grouped - usage result is batch or not. - - type: 'null' - service_tier: - anyOf: - - type: string - description: >- - When `group_by=service_tier`, this field provides the service - tier of the grouped usage result. - - type: 'null' required: - object - input_tokens - - output_tokens - num_model_requests x-oaiMeta: - name: Completions usage object + name: Embeddings usage object example: | { - "object": "organization.usage.completions.result", - "input_tokens": 5000, - "output_tokens": 1000, - "input_cached_tokens": 4000, - "input_audio_tokens": 300, - "output_audio_tokens": 200, - "num_model_requests": 5, + "object": "organization.usage.embeddings.result", + "input_tokens": 20, + "num_model_requests": 2, "project_id": "proj_abc", "user_id": "user-abc", "api_key_id": "key_abc", - "model": "gpt-4o-mini-2024-07-18", - "batch": false, - "service_tier": "default" + "model": "text-embedding-ada-002-v2" } - UsageEmbeddingsResult: + UsageFileSearchCallsResult: type: object - description: The aggregated embeddings usage details of the specific time bucket. + description: >- + The aggregated file search calls usage details of the specific time + bucket. properties: object: type: string enum: - - organization.usage.embeddings.result + - organization.usage.file_searches.result x-stainless-const: true - input_tokens: - type: integer - description: The aggregated number of input tokens used. - num_model_requests: + num_requests: type: integer - description: The count of requests made to the model. + description: The count of file search calls. project_id: anyOf: - type: string @@ -71584,28 +73867,26 @@ components: When `group_by=api_key_id`, this field provides the API key ID of the grouped usage result. - type: 'null' - model: + vector_store_id: anyOf: - type: string description: >- - When `group_by=model`, this field provides the model name of the - grouped usage result. + When `group_by=vector_store_id`, this field provides the vector + store ID of the grouped usage result. - type: 'null' required: - object - - input_tokens - - num_model_requests + - num_requests x-oaiMeta: - name: Embeddings usage object + name: File search calls usage object example: | { - "object": "organization.usage.embeddings.result", - "input_tokens": 20, - "num_model_requests": 2, + "object": "organization.usage.file_searches.result", + "num_requests": 2, "project_id": "proj_abc", "user_id": "user-abc", "api_key_id": "key_abc", - "model": "text-embedding-ada-002-v2" + "vector_store_id": "vs_abc" } UsageImagesResult: type: object @@ -71789,6 +74070,8 @@ components: - $ref: '#/components/schemas/UsageAudioTranscriptionsResult' - $ref: '#/components/schemas/UsageVectorStoresResult' - $ref: '#/components/schemas/UsageCodeInterpreterSessionsResult' + - $ref: '#/components/schemas/UsageFileSearchCallsResult' + - $ref: '#/components/schemas/UsageWebSearchCallsResult' - $ref: '#/components/schemas/CostsResult' discriminator: propertyName: object @@ -71827,6 +74110,75 @@ components: "usage_bytes": 1024, "project_id": "proj_abc" } + UsageWebSearchCallsResult: + type: object + description: >- + The aggregated web search calls usage details of the specific time + bucket. + properties: + object: + type: string + enum: + - organization.usage.web_searches.result + x-stainless-const: true + num_model_requests: + type: integer + description: The count of model requests. + num_requests: + type: integer + description: The count of web search calls. + project_id: + anyOf: + - type: string + description: >- + When `group_by=project_id`, this field provides the project ID + of the grouped usage result. + - type: 'null' + user_id: + anyOf: + - type: string + description: >- + When `group_by=user_id`, this field provides the user ID of the + grouped usage result. + - type: 'null' + api_key_id: + anyOf: + - type: string + description: >- + When `group_by=api_key_id`, this field provides the API key ID + of the grouped usage result. + - type: 'null' + model: + anyOf: + - type: string + description: >- + When `group_by=model`, this field provides the model name of the + grouped usage result. + - type: 'null' + context_level: + anyOf: + - type: string + description: >- + When `group_by=context_level`, this field provides the search + context size of the grouped usage result. + - type: 'null' + required: + - object + - num_model_requests + - num_requests + x-oaiMeta: + name: Web search calls usage object + example: | + { + "object": "organization.usage.web_searches.result", + "num_model_requests": 2, + "num_requests": 2, + "project_id": "proj_abc", + "user_id": "user-abc", + "api_key_id": "key_abc", + "model": "gpt-4o-mini-2024-07-18", + "context_level": "medium" + } User: type: object description: Represents an individual `user` within an organization. @@ -72961,7 +75313,7 @@ components: enum: - open_page description: | - The action type. + The action type. Always `open_page`. x-stainless-const: true url: description: | @@ -76969,6 +79321,20 @@ components: - status title: Apply patch tool call output description: The streamed output emitted by an apply patch tool call. + CompactionTriggerItemParam: + properties: + type: + type: string + enum: + - compaction_trigger + description: The type of the item. Always `compaction_trigger`. + default: compaction_trigger + x-stainless-const: true + type: object + required: + - type + title: Compaction trigger + description: Compacts the current context. Must be the final input item. ItemReferenceParam: properties: type: @@ -77743,6 +80109,13 @@ components: enum: - in_memory - 24h + ServiceTierEnum: + type: string + enum: + - auto + - default + - flex + - priority CompactResponseMethodPublicBody: properties: model: @@ -77798,6 +80171,11 @@ components: - $ref: '#/components/schemas/PromptCacheRetentionEnum' description: How long to retain a prompt cache entry created by this request. - type: 'null' + service_tier: + anyOf: + - $ref: '#/components/schemas/ServiceTierEnum' + description: The service tier to use for this request. + - type: 'null' type: object required: - model @@ -79730,6 +82108,50 @@ x-oaiMeta: - type: object key: RealtimeServerEventRateLimitsUpdated path: + - id: realtime-translation-client-events + title: Translation client events + description: > + These are events that the OpenAI Realtime Translation WebSocket server + will accept from the client. + navigationGroup: realtime + sections: + - type: object + key: RealtimeTranslationClientEventSessionUpdate + path: + - type: object + key: RealtimeTranslationClientEventInputAudioBufferAppend + path: + - type: object + key: RealtimeTranslationClientEventSessionClose + path: + - id: realtime-translation-server-events + title: Translation server events + description: > + These are events emitted from the OpenAI Realtime Translation WebSocket + server to the client. + navigationGroup: realtime + sections: + - type: object + key: RealtimeServerEventError + path: + - type: object + key: RealtimeTranslationServerEventSessionCreated + path: + - type: object + key: RealtimeTranslationServerEventSessionUpdated + path: + - type: object + key: RealtimeTranslationServerEventSessionClosed + path: + - type: object + key: RealtimeTranslationServerEventSessionInputTranscriptDelta + path: + - type: object + key: RealtimeTranslationServerEventSessionOutputTranscriptDelta + path: + - type: object + key: RealtimeTranslationServerEventSessionOutputAudioDelta + path: - id: chat-streaming title: Streaming description: |