Files
Aether/docs/api/provider-interface-definitions.md
T

334 KiB
Raw Blame History

OpenAI / Claude / Gemini 接口定义

生成日期:2026-06-03。

本文档整理 Aether 当前接入和转换矩阵实际涉及的三类 provider 接口面:OpenAI Chat Completions / Responses / Embeddings / ImagesClaude Messages,以及 Gemini GenerateContent / Embeddings / Files / PredictLongRunning 相关接口。它不是三家公司所有管理类、训练类、账单类 API 的全集。

这是 schema inventory / audit input,不是运行时代码的字段 allowlist。Provider 官方新增字段时,同格式运行时路径仍按原始 body 透传;canonical same-format roundtrip 通过 provider extension 保留未映射字段;跨格式转换只有在存在显式语义映射时才开放,否则 fail closed。刷新本文档只用于更新审计基线和决定是否新增跨格式映射。

来源与范围

Provider 结构化来源 官方参考 本文档覆盖
OpenAI OpenAI OpenAPI 2.3.0 / OpenAI API https://platform.openai.com/docs/api-reference /v1/chat/completions, /v1/responses, /v1/responses/compact, /v1/embeddings, /v1/images/*
Claude / Anthropic anthropic-sdk-typescript 中由 Anthropic OpenAPI 生成的 messages.ts https://docs.anthropic.com/en/api/messages /v1/messages, /v1/messages/count_tokens, Messages streaming events
Gemini Google Generative Language Discovery v1beta / Gemini API https://ai.google.dev/api generateContent, streamGenerateContent, embedContent, batchEmbedContents, files, count tokens, predict long-running

结构化来源 URL

说明:字段表中的“必填”来自官方 schema 的 required 或 TypeScript ? 标记;很多接口还会受到模型、账号权限、beta header、区域、Aether provider 配置和上游版本的约束。Aether 的 /v1/rerank 是 OpenAI/Jina compatible 兼容面,不是 OpenAI 官方 OpenAPI 中的 endpoint;它见 docs/api/rerank.md

Aether API Format 对应关系

Aether format Provider 原生接口 请求根 schema 响应根 schema
openai:chat POST /v1/chat/completions CreateChatCompletionRequest CreateChatCompletionResponseCreateChatCompletionStreamResponse
openai:responses POST /v1/responses CreateResponse ResponseResponseStreamEvent
openai:responses:compact POST /v1/responses/compact CompactResponseMethodPublicBody CompactResource
openai:embedding POST /v1/embeddings CreateEmbeddingRequest CreateEmbeddingResponse
openai:image POST /v1/images/generations, /edits, /variations CreateImageRequest, CreateImageEditRequest, CreateImageVariationRequest ImagesResponse 或 image stream event
claude:messages POST /v1/messages MessageCreateParams MessageRawMessageStreamEvent
gemini:generate_content models/{model}:generateContent / :streamGenerateContent GenerateContentRequest GenerateContentResponse
gemini:embedding models/{model}:embedContent / :batchEmbedContents EmbedContentRequest / BatchEmbedContentsRequest EmbedContentResponse / BatchEmbedContentsResponse

OpenAI Endpoints

Method Path Request content type Request schema Response schema
POST /chat/completions application/json CreateChatCompletionRequest CreateChatCompletionResponse / CreateChatCompletionStreamResponse
POST /responses application/json CreateResponse Response / ResponseStreamEvent
POST /responses/compact application/json, application/x-www-form-urlencoded CompactResponseMethodPublicBody CompactResource
POST /embeddings application/json CreateEmbeddingRequest CreateEmbeddingResponse
POST /images/generations application/json CreateImageRequest ImagesResponse / ImageGenStreamEvent
POST /images/edits multipart/form-data, application/json CreateImageEditRequest / EditImageBodyJsonParam ImagesResponse / ImageEditStreamEvent
POST /images/variations multipart/form-data CreateImageVariationRequest ImagesResponse

OpenAI Schema 字段表

以下 schema 从上述 OpenAI endpoint 根 schema 递归引用得到,共 351 个。

AdditionalTools

类型 object
说明 -
字段 必填 类型 枚举/常量 说明
id string - The unique ID of the additional tools item.
role MessageRole - The role that provided the additional tools.
tools array<Tool> - The additional tool definitions made available at this item.
type string additional_tools The type of the item. Always additional_tools.

AdditionalToolsItemParam

类型 object
说明 -
字段 必填 类型 枚举/常量 说明
id string | null - -
role string developer The role that provided the additional tools. Only developer is supported.
tools array<Tool> - A list of additional tools made available at this item.
type string additional_tools The item type. Always additional_tools.

Annotation

类型 FileCitationBody | UrlCitationBody | ContainerFileCitationBody | FilePath
说明 An annotation that applies to a span of output text.
组合 oneOf
变体 类型 说明
1 FileCitationBody -
2 UrlCitationBody -
3 ContainerFileCitationBody -
4 FilePath -

ApplyPatchCallOutputStatus

类型 string
说明 -

ApplyPatchCallOutputStatusParam

类型 string
说明 Outcome values reported for apply_patch tool call outputs.

ApplyPatchCallStatus

类型 string
说明 -

ApplyPatchCallStatusParam

类型 string
说明 Status values reported for apply_patch tool calls.

ApplyPatchCreateFileOperation

类型 object
说明 Instruction describing how to create a file via the apply_patch tool.
字段 必填 类型 枚举/常量 说明
diff string - Diff to apply.
path string - Path of the file to create.
type string create_file Create a new file with the provided diff.

ApplyPatchCreateFileOperationParam

类型 object
说明 Instruction for creating a new file via the apply_patch tool.
字段 必填 类型 枚举/常量 说明
diff string - Unified diff content to apply when creating the file.
path string - Path of the file to create relative to the workspace root.
type string create_file The operation type. Always create_file.

ApplyPatchDeleteFileOperation

类型 object
说明 Instruction describing how to delete a file via the apply_patch tool.
字段 必填 类型 枚举/常量 说明
path string - Path of the file to delete.
type string delete_file Delete the specified file.

ApplyPatchDeleteFileOperationParam

类型 object
说明 Instruction for deleting an existing file via the apply_patch tool.
字段 必填 类型 枚举/常量 说明
path string - Path of the file to delete relative to the workspace root.
type string delete_file The operation type. Always delete_file.

ApplyPatchOperationParam

类型 ApplyPatchCreateFileOperationParam | ApplyPatchDeleteFileOperationParam | ApplyPatchUpdateFileOperationParam
说明 One of the create_file, delete_file, or update_file operations supplied to the apply_patch tool.
组合 oneOf
变体 类型 说明
1 ApplyPatchCreateFileOperationParam -
2 ApplyPatchDeleteFileOperationParam -
3 ApplyPatchUpdateFileOperationParam -

ApplyPatchToolCall

类型 object
说明 A tool call that applies file diffs by creating, deleting, or updating files.
字段 必填 类型 枚举/常量 说明
call_id string - The unique ID of the apply patch tool call generated by the model.
created_by string - The ID of the entity that created this tool call.
id string - The unique ID of the apply patch tool call. Populated when this item is returned via API.
operation ApplyPatchCreateFileOperation | ApplyPatchDeleteFileOperation | ApplyPatchUpdateFileOperation - One of the create_file, delete_file, or update_file operations applied via apply_patch.
status ApplyPatchCallStatus - The status of the apply patch tool call. One of in_progress or completed.
type string apply_patch_call The type of the item. Always apply_patch_call.

ApplyPatchToolCallItemParam

类型 object
说明 A tool call representing a request to create, delete, or update files using diff patches.
字段 必填 类型 枚举/常量 说明
call_id string - The unique ID of the apply patch tool call generated by the model.
id string | null - -
operation ApplyPatchOperationParam - The specific create, delete, or update instruction for the apply_patch tool call.
status ApplyPatchCallStatusParam - The status of the apply patch tool call. One of in_progress or completed.
type string apply_patch_call The type of the item. Always apply_patch_call.

ApplyPatchToolCallOutput

类型 object
说明 The output emitted by an apply patch tool call.
字段 必填 类型 枚举/常量 说明
call_id string - The unique ID of the apply patch tool call generated by the model.
created_by string - The ID of the entity that created this tool call output.
id string - The unique ID of the apply patch tool call output. Populated when this item is returned via API.
output string | null - -
status ApplyPatchCallOutputStatus - The status of the apply patch tool call output. One of completed or failed.
type string apply_patch_call_output The type of the item. Always apply_patch_call_output.

ApplyPatchToolCallOutputItemParam

类型 object
说明 The streamed output emitted by an apply patch tool call.
字段 必填 类型 枚举/常量 说明
call_id string - The unique ID of the apply patch tool call generated by the model.
id string | null - -
output string | null - -
status ApplyPatchCallOutputStatusParam - The status of the apply patch tool call output. One of completed or failed.
type string apply_patch_call_output The type of the item. Always apply_patch_call_output.

ApplyPatchToolParam

类型 object
说明 Allows the assistant to create, delete, or update files using unified diffs.
字段 必填 类型 枚举/常量 说明
type string apply_patch The type of the tool. Always apply_patch.

ApplyPatchUpdateFileOperation

类型 object
说明 Instruction describing how to update a file via the apply_patch tool.
字段 必填 类型 枚举/常量 说明
diff string - Diff to apply.
path string - Path of the file to update.
type string update_file Update an existing file with the provided diff.

ApplyPatchUpdateFileOperationParam

类型 object
说明 Instruction for updating an existing file via the apply_patch tool.
字段 必填 类型 枚举/常量 说明
diff string - Unified diff content to apply to the existing file.
path string - Path of the file to update relative to the workspace root.
type string update_file The operation type. Always update_file.

ApproximateLocation

类型 object
说明 -
字段 必填 类型 枚举/常量 说明
city string | null - -
country string | null - -
region string | null - -
timezone string | null - -
type string approximate The type of location approximation. Always approximate.

AutoCodeInterpreterToolParam

类型 object
说明 Configuration for a code interpreter container. Optionally specify the IDs of the files to run the code on.
字段 必填 类型 枚举/常量 说明
file_ids array<string> - An optional list of uploaded files to make available to your code.
memory_limit ContainerMemoryLimit | null - -
network_policy ContainerNetworkPolicyDisabledParam | ContainerNetworkPolicyAllowlistParam - Network access policy for the container.
type string auto Always auto.

ChatCompletionAllowedTools

类型 object
说明 Constrains the tools available to the model to a pre-defined set.
字段 必填 类型 枚举/常量 说明
mode string auto, required Constrains the tools available to the model to a pre-defined set. auto allows the model to pick from among the allowed tools and generate a message. required requires the model to…
tools array<object> - A list of tool definitions that the model should be allowed to call. For the Chat Completions API, the list of tool definitions might look like:

ChatCompletionAllowedToolsChoice

类型 object
说明 Constrains the tools available to the model to a pre-defined set.
字段 必填 类型 枚举/常量 说明
allowed_tools ChatCompletionAllowedTools - -
type string allowed_tools Allowed tool configuration type. Always allowed_tools.

ChatCompletionFunctionCallOption

类型 object
说明 Specifying a particular function via {"name": "my_function"} forces the model to call that function.
字段 必填 类型 枚举/常量 说明
name string - The name of the function to call.

ChatCompletionFunctions

类型 object
说明 -
字段 必填 类型 枚举/常量 说明
description string - A description of what the function does, used by the model to choose when and how to call the function.
name string - The name of the function to be called. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64.
parameters FunctionParameters - -

ChatCompletionMessageCustomToolCall

类型 object
说明 A call to a custom tool created by the model.
字段 必填 类型 枚举/常量 说明
custom object - The custom tool that the model called.
id string - The ID of the tool call.
type string custom The type of the tool. Always custom.

ChatCompletionMessageToolCall

类型 object
说明 A call to a function tool created by the model.
字段 必填 类型 枚举/常量 说明
function object - The function that the model called.
id string - The ID of the tool call.
type string function The type of the tool. Currently, only function is supported.

ChatCompletionMessageToolCallChunk

类型 object
说明 -
字段 必填 类型 枚举/常量 说明
function object - -
id string - The ID of the tool call.
index integer - -
type string function The type of the tool. Currently, only function is supported.

ChatCompletionMessageToolCalls

类型 array<ChatCompletionMessageToolCall | ChatCompletionMessageCustomToolCall>
说明 The tool calls generated by the model, such as function calls.

ChatCompletionNamedToolChoice

类型 object
说明 Specifies a tool the model should use. Use to force the model to call a specific function.
字段 必填 类型 枚举/常量 说明
function object - -
type string function For function calling, the type is always function.

ChatCompletionNamedToolChoiceCustom

类型 object
说明 Specifies a tool the model should use. Use to force the model to call a specific custom tool.
字段 必填 类型 枚举/常量 说明
custom object - -
type string custom For custom tool calling, the type is always custom.

ChatCompletionRequestAssistantMessage

类型 object
说明 Messages sent by the model in response to user messages.
字段 必填 类型 枚举/常量 说明
audio object | null - -
content string | array<ChatCompletionRequestAssistantMessageContentPart> | null - -
function_call object | null - -
name string - An optional name for the participant. Provides the model information to differentiate between participants of the same role.
refusal string | null - -
role string assistant The role of the messages author, in this case assistant.
tool_calls ChatCompletionMessageToolCalls - -

ChatCompletionRequestAssistantMessageContentPart

类型 ChatCompletionRequestMessageContentPartText | ChatCompletionRequestMessageContentPartRefusal
说明 -
组合 oneOf
变体 类型 说明
1 ChatCompletionRequestMessageContentPartText -
2 ChatCompletionRequestMessageContentPartRefusal -

ChatCompletionRequestDeveloperMessage

类型 object
说明 Developer-provided instructions that the model should follow, regardless of messages sent by the user. With o1 models and newer, developer messages replace the previous system mes…
字段 必填 类型 枚举/常量 说明
content string | array<ChatCompletionRequestMessageContentPartText> - The contents of the developer message.
name string - An optional name for the participant. Provides the model information to differentiate between participants of the same role.
role string developer The role of the messages author, in this case developer.

ChatCompletionRequestFunctionMessage

类型 object
说明 -
字段 必填 类型 枚举/常量 说明
content string | null - -
name string - The name of the function to call.
role string function The role of the messages author, in this case function.

ChatCompletionRequestMessage

类型 ChatCompletionRequestDeveloperMessage | ChatCompletionRequestSystemMessage | ChatCompletionRequestUserMessage | ChatCompletionRequestAssistantMessage | ChatCompletionRequestToolMessage | ChatCompletionRequestFunctionMessage
说明 -
组合 oneOf
变体 类型 说明
1 ChatCompletionRequestDeveloperMessage -
2 ChatCompletionRequestSystemMessage -
3 ChatCompletionRequestUserMessage -
4 ChatCompletionRequestAssistantMessage -
5 ChatCompletionRequestToolMessage -
6 ChatCompletionRequestFunctionMessage -

ChatCompletionRequestMessageContentPartAudio

类型 object
说明 Learn about audio inputs.
字段 必填 类型 枚举/常量 说明
input_audio object - -
type string input_audio The type of the content part. Always input_audio.

ChatCompletionRequestMessageContentPartFile

类型 object
说明 Learn about file inputs for text generation.
字段 必填 类型 枚举/常量 说明
file object - -
type string file The type of the content part. Always file.

ChatCompletionRequestMessageContentPartImage

类型 object
说明 Learn about image inputs.
字段 必填 类型 枚举/常量 说明
image_url object - -
type string image_url The type of the content part.

ChatCompletionRequestMessageContentPartRefusal

类型 object
说明 -
字段 必填 类型 枚举/常量 说明
refusal string - The refusal message generated by the model.
type string refusal The type of the content part.

ChatCompletionRequestMessageContentPartText

类型 object
说明 Learn about text inputs.
字段 必填 类型 枚举/常量 说明
text string - The text content.
type string text The type of the content part.

ChatCompletionRequestSystemMessage

类型 object
说明 Developer-provided instructions that the model should follow, regardless of messages sent by the user. With o1 models and newer, use developer messages for this purpose instead.
字段 必填 类型 枚举/常量 说明
content string | array<ChatCompletionRequestSystemMessageContentPart> - The contents of the system message.
name string - An optional name for the participant. Provides the model information to differentiate between participants of the same role.
role string system The role of the messages author, in this case system.

ChatCompletionRequestSystemMessageContentPart

类型 ChatCompletionRequestMessageContentPartText
说明 -
组合 oneOf
变体 类型 说明
1 ChatCompletionRequestMessageContentPartText -

ChatCompletionRequestToolMessage

类型 object
说明 -
字段 必填 类型 枚举/常量 说明
content string | array<ChatCompletionRequestToolMessageContentPart> - The contents of the tool message.
role string tool The role of the messages author, in this case tool.
tool_call_id string - Tool call that this message is responding to.

ChatCompletionRequestToolMessageContentPart

类型 ChatCompletionRequestMessageContentPartText
说明 -
组合 oneOf
变体 类型 说明
1 ChatCompletionRequestMessageContentPartText -

ChatCompletionRequestUserMessage

类型 object
说明 Messages sent by an end user, containing prompts or additional context information.
字段 必填 类型 枚举/常量 说明
content string | array<ChatCompletionRequestUserMessageContentPart> - The contents of the user message.
name string - An optional name for the participant. Provides the model information to differentiate between participants of the same role.
role string user The role of the messages author, in this case user.

ChatCompletionRequestUserMessageContentPart

类型 ChatCompletionRequestMessageContentPartText | ChatCompletionRequestMessageContentPartImage | ChatCompletionRequestMessageContentPartAudio | ChatCompletionRequestMessageContentPartFile
说明 -
组合 oneOf
变体 类型 说明
1 ChatCompletionRequestMessageContentPartText -
2 ChatCompletionRequestMessageContentPartImage -
3 ChatCompletionRequestMessageContentPartAudio -
4 ChatCompletionRequestMessageContentPartFile -

ChatCompletionResponseMessage

类型 object
说明 A chat completion message generated by the model.
字段 必填 类型 枚举/常量 说明
annotations array<object> - Annotations for the message, when applicable, as when using the web search tool.
audio object | null - -
content string | null - -
function_call object - Deprecated and replaced by tool_calls. The name and arguments of a function that should be called, as generated by the model.
refusal string | null - -
role string assistant The role of the author of this message.
tool_calls ChatCompletionMessageToolCalls - -

ChatCompletionStreamOptions

类型 object | null
说明 -
组合 anyOf
变体 类型 说明
1 object Options for streaming response. Only set this when you set stream: true.
2 null -

ChatCompletionStreamResponseDelta

类型 object
说明 A chat completion delta generated by streamed model responses.
字段 必填 类型 枚举/常量 说明
content string | null - -
function_call object - Deprecated and replaced by tool_calls. The name and arguments of a function that should be called, as generated by the model.
refusal string | null - -
role string developer, system, user, assistant, tool The role of the author of this message.
tool_calls array<ChatCompletionMessageToolCallChunk> - -

ChatCompletionTokenLogprob

类型 object
说明 -
字段 必填 类型 枚举/常量 说明
bytes array<integer> | null - -
logprob number - The log probability of this token, if it is within the top 20 most likely tokens. Otherwise, the value -9999.0 is used to signify that the token is very unlikely.
token string - The token.
top_logprobs array<object> - 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.

ChatCompletionTool

类型 object
说明 A function tool that can be used to generate a response.
字段 必填 类型 枚举/常量 说明
function FunctionObject - -
type string function The type of the tool. Currently, only function is supported.

ChatCompletionToolChoiceOption

类型 string | ChatCompletionAllowedToolsChoice | ChatCompletionNamedToolChoice | ChatCompletionNamedToolChoiceCustom
说明 Controls which (if any) tool is called by the model. none means the model will not call any tool and instead generates a message. auto means the model can pick between generating …
组合 oneOf
变体 类型 说明
1 string none means the model will not call any tool and instead generates a message. auto means the model can pick between generating a message or calling one or more tools. required mean…
2 ChatCompletionAllowedToolsChoice -
3 ChatCompletionNamedToolChoice -
4 ChatCompletionNamedToolChoiceCustom -

ClickButtonType

类型 string
说明 -

ClickParam

类型 object
说明 A click action.
字段 必填 类型 枚举/常量 说明
button ClickButtonType - Indicates which mouse button was pressed during the click. One of left, right, wheel, back, or forward.
keys array<string> | null - -
type string click Specifies the event type. For a click action, this property is always click.
x integer - The x-coordinate where the click occurred.
y integer - The y-coordinate where the click occurred.

CodeInterpreterOutputImage

类型 object
说明 The image output from the code interpreter.
字段 必填 类型 枚举/常量 说明
type string image The type of the output. Always image.
url string(uri) - The URL of the image output from the code interpreter.

CodeInterpreterOutputLogs

类型 object
说明 The logs output from the code interpreter.
字段 必填 类型 枚举/常量 说明
logs string - The logs output from the code interpreter.
type string logs The type of the output. Always logs.

CodeInterpreterTool

类型 object
说明 A tool that runs Python code to help generate a response to a prompt.
字段 必填 类型 枚举/常量 说明
container string | AutoCodeInterpreterToolParam - The code interpreter container. Can be a container ID or an object that specifies uploaded file IDs to make available to your code, along with an optional memory_limit setting.
type string code_interpreter The type of the code interpreter tool. Always code_interpreter.

CodeInterpreterToolCall

类型 object
说明 A tool call to run code.
字段 必填 类型 枚举/常量 说明
code string | null - -
container_id string - The ID of the container used to run the code.
id string - The unique ID of the code interpreter tool call.
outputs array<CodeInterpreterOutputLogs | CodeInterpreterOutputImage> | null - -
status string in_progress, completed, incomplete, interpreting, failed The status of the code interpreter tool call. Valid values are in_progress, completed, incomplete, interpreting, and failed.
type string code_interpreter_call The type of the code interpreter tool call. Always code_interpreter_call.

CompactResource

类型 object
说明 -
字段 必填 类型 枚举/常量 说明
created_at integer(unixtime) - Unix timestamp (in seconds) when the compacted conversation was created.
id string - The unique identifier for the compacted response.
object string response.compaction The object type. Always response.compaction.
output array<ItemField> - The compacted list of output items.
usage ResponseUsage - Token accounting for the compaction pass, including cached, reasoning, and total tokens.

CompactResponseMethodPublicBody

类型 object
说明 -
字段 必填 类型 枚举/常量 说明
input string | array<InputItem> | null - -
instructions string | null - -
model ModelIdsCompaction - -
previous_response_id string | null - -
prompt_cache_key string | null - -
prompt_cache_retention PromptCacheRetentionEnum | null - -
service_tier ServiceTierEnum | null - -

CompactionBody

类型 object
说明 A compaction item generated by the v1/responses/compact API.
字段 必填 类型 枚举/常量 说明
created_by string - The identifier of the actor that created the item.
encrypted_content string - The encrypted content that was produced by compaction.
id string - The unique ID of the compaction item.
type string compaction The type of the item. Always compaction.

CompactionSummaryItemParam

类型 object
说明 A compaction item generated by the v1/responses/compact API.
字段 必填 类型 枚举/常量 说明
encrypted_content string - The encrypted content of the compaction summary.
id string | null - -
type string compaction The type of the item. Always compaction.

CompactionTriggerItemParam

类型 object
说明 Compacts the current context. Must be the final input item.
字段 必填 类型 枚举/常量 说明
type string compaction_trigger The type of the item. Always compaction_trigger.

ComparisonFilter

类型 object
说明 A filter used to compare a specified attribute key to a given value using a defined comparison operation.
字段 必填 类型 枚举/常量 说明
key string - The key to compare against the value.
type string eq, ne, gt, gte, lt, lte, in, nin Specifies the comparison operator: eq, ne, gt, gte, lt, lte, in, nin. - eq: equals - ne: not equal - gt: greater than - gte: greater than or equal - lt: less than - lte: less than…
value string | number | boolean | array<string | number> - The value to compare against the attribute key; supports string, number, or boolean types.

CompletionUsage

类型 object
说明 Usage statistics for the completion request.
字段 必填 类型 枚举/常量 说明
completion_tokens integer - Number of tokens in the generated completion.
completion_tokens_details object - Breakdown of tokens used in a completion.
prompt_tokens integer - Number of tokens in the prompt.
prompt_tokens_details object - Breakdown of tokens used in the prompt.
total_tokens integer - Total number of tokens used in the request (prompt + completion).

CompoundFilter

类型 object
说明 Combine multiple filters using and or or.
字段 必填 类型 枚举/常量 说明
filters array<ComparisonFilter | object/value> - Array of filters to combine. Items can be ComparisonFilter or CompoundFilter.
type string and, or Type of operation: and or or.

ComputerAction

类型 ClickParam | DoubleClickAction | DragParam | KeyPressAction | MoveParam | ScreenshotParam | ScrollParam | TypeParam … (+1)
说明 -
组合 oneOf
变体 类型 说明
1 ClickParam -
2 DoubleClickAction -
3 DragParam -
4 KeyPressAction -
5 MoveParam -
6 ScreenshotParam -
7 ScrollParam -
8 TypeParam -
9 WaitParam -

ComputerActionList

类型 array<ComputerAction>
说明 Flattened batched actions for computer_use. Each action includes an type discriminator and action-specific fields.

ComputerCallOutputItemParam

类型 object
说明 The output of a computer tool call.
字段 必填 类型 枚举/常量 说明
acknowledged_safety_checks array<ComputerCallSafetyCheckParam> | null - -
call_id string - The ID of the computer tool call that produced the output.
id string | null - -
output ComputerScreenshotImage - -
status FunctionCallItemStatus | null - -
type string computer_call_output The type of the computer tool call output. Always computer_call_output.

ComputerCallOutputStatus

类型 string
说明 -

ComputerCallSafetyCheckParam

类型 object
说明 A pending safety check for the computer call.
字段 必填 类型 枚举/常量 说明
code string | null - -
id string - The ID of the pending safety check.
message string | null - -

ComputerEnvironment

类型 string
说明 -

ComputerScreenshotContent

类型 object
说明 A screenshot of a computer.
字段 必填 类型 枚举/常量 说明
detail ImageDetail - The detail level of the screenshot image to be sent to the model. One of high, low, auto, or original. Defaults to auto.
file_id string | null - -
image_url string(uri) | null - -
type string computer_screenshot Specifies the event type. For a computer screenshot, this property is always set to computer_screenshot.

ComputerScreenshotImage

类型 object
说明 A computer screenshot image used with the computer use tool.
字段 必填 类型 枚举/常量 说明
file_id string - The identifier of an uploaded file that contains the screenshot.
image_url string(uri) - The URL of the screenshot image.
type string computer_screenshot Specifies the event type. For a computer screenshot, this property is always set to computer_screenshot.

ComputerTool

类型 object
说明 A tool that controls a virtual computer. Learn more about the computer tool.
字段 必填 类型 枚举/常量 说明
type string computer The type of the computer tool. Always computer.

ComputerToolCall

类型 object
说明 A tool call to a computer use tool. See the computer use guide for more information.
字段 必填 类型 枚举/常量 说明
action ComputerAction - -
actions ComputerActionList - -
call_id string - An identifier used when responding to the tool call with output.
id string - The unique ID of the computer call.
pending_safety_checks array<ComputerCallSafetyCheckParam> - The pending safety checks for the computer call.
status string in_progress, completed, incomplete The status of the item. One of in_progress, completed, or incomplete. Populated when items are returned via API.
type string computer_call The type of the computer call. Always computer_call.

ComputerToolCallOutput

类型 object
说明 The output of a computer tool call.
字段 必填 类型 枚举/常量 说明
acknowledged_safety_checks array<ComputerCallSafetyCheckParam> - The safety checks reported by the API that have been acknowledged by the developer.
call_id string - The ID of the computer tool call that produced the output.
id string - The ID of the computer tool call output.
output ComputerScreenshotImage - -
status string in_progress, completed, incomplete The status of the message input. One of in_progress, completed, or incomplete. Populated when input items are returned via API.
type string computer_call_output The type of the computer tool call output. Always computer_call_output.

ComputerToolCallOutputResource

类型 ComputerToolCallOutput & object
说明 -
组合 allOf
变体 类型 说明
1 ComputerToolCallOutput -
2 object -

allOf 展开字段

字段 必填 类型 枚举/常量 来源 说明
acknowledged_safety_checks array<ComputerCallSafetyCheckParam> - ComputerToolCallOutput The safety checks reported by the API that have been acknowledged by the developer.
call_id string - ComputerToolCallOutput The ID of the computer tool call that produced the output.
created_by string - ComputerToolCallOutputResource.allOf[2] The identifier of the actor that created the item.
id string - ComputerToolCallOutput The ID of the computer tool call output.
output ComputerScreenshotImage - ComputerToolCallOutput -
status string in_progress, completed, incomplete ComputerToolCallOutput The status of the message input. One of in_progress, completed, or incomplete. Populated when input items are returned via API.
type string computer_call_output ComputerToolCallOutput The type of the computer tool call output. Always computer_call_output.

ComputerUsePreviewTool

类型 object
说明 A tool that controls a virtual computer. Learn more about the computer tool.
字段 必填 类型 枚举/常量 说明
display_height integer - The height of the computer display.
display_width integer - The width of the computer display.
environment ComputerEnvironment - The type of computer environment to control.
type string computer_use_preview The type of the computer use tool. Always computer_use_preview.

ContainerAutoParam

类型 object
说明 -
字段 必填 类型 枚举/常量 说明
file_ids array<string> - An optional list of uploaded files to make available to your code.
memory_limit ContainerMemoryLimit | null - -
network_policy ContainerNetworkPolicyDisabledParam | ContainerNetworkPolicyAllowlistParam - Network access policy for the container.
skills array<SkillReferenceParam | InlineSkillParam> - An optional list of skills referenced by id or inline data.
type string container_auto Automatically creates a container for this request

ContainerFileCitationBody

类型 object
说明 A citation for a container file used to generate a model response.
字段 必填 类型 枚举/常量 说明
container_id string - The ID of the container file.
end_index integer - The index of the last character of the container file citation in the message.
file_id string - The ID of the file.
filename string - The filename of the container file cited.
start_index integer - The index of the first character of the container file citation in the message.
type string container_file_citation The type of the container file citation. Always container_file_citation.

ContainerMemoryLimit

类型 string
说明 -

ContainerNetworkPolicyAllowlistParam

类型 object
说明 -
字段 必填 类型 枚举/常量 说明
allowed_domains array<string> - A list of allowed domains when type is allowlist.
domain_secrets array<ContainerNetworkPolicyDomainSecretParam> - Optional domain-scoped secrets for allowlisted domains.
type string allowlist Allow outbound network access only to specified domains. Always allowlist.

ContainerNetworkPolicyDisabledParam

类型 object
说明 -
字段 必填 类型 枚举/常量 说明
type string disabled Disable outbound network access. Always disabled.

ContainerNetworkPolicyDomainSecretParam

类型 object
说明 -
字段 必填 类型 枚举/常量 说明
domain string - The domain associated with the secret.
name string - The name of the secret to inject for the domain.
value string - The secret value to inject for the domain.

ContainerReferenceParam

类型 object
说明 -
字段 必填 类型 枚举/常量 说明
container_id string - The ID of the referenced container.
type string container_reference References a container created with the /v1/containers endpoint

ContainerReferenceResource

类型 object
说明 Represents a container created with /v1/containers.
字段 必填 类型 枚举/常量 说明
container_id string - -
type string container_reference The environment type. Always container_reference.

ContextManagementParam

类型 object
说明 -
字段 必填 类型 枚举/常量 说明
compact_threshold integer | null - -
type string - The context management entry type. Currently only 'compaction' is supported.

Conversation-2

类型 object
说明 The conversation that this response belonged to. Input items and output items from this response were automatically added to this conversation.
字段 必填 类型 枚举/常量 说明
id string - The unique ID of the conversation that this response was associated with.

ConversationParam

类型 string | ConversationParam-2
说明 The conversation that this response belongs to. Items from this conversation are prepended to input_items for this response request. Input items and output items from this respons…
组合 oneOf
变体 类型 说明
1 string The unique ID of the conversation.
2 ConversationParam-2 -

ConversationParam-2

类型 object
说明 The conversation that this response belongs to.
字段 必填 类型 枚举/常量 说明
id string - The unique ID of the conversation.

CoordParam

类型 object
说明 An x/y coordinate pair, e.g. { x: 100, y: 200 }.
字段 必填 类型 枚举/常量 说明
x integer - The x-coordinate.
y integer - The y-coordinate.

CreateChatCompletionRequest

类型 CreateModelResponseProperties & object
说明 -
组合 allOf
变体 类型 说明
1 CreateModelResponseProperties -
2 object -

allOf 展开字段

字段 必填 类型 枚举/常量 来源 说明
audio object - CreateChatCompletionRequest.allOf[2] Parameters for audio output. Required when audio output is requested with modalities: ["audio"]. Learn more.
frequency_penalty number - CreateChatCompletionRequest.allOf[2] Number between -2.0 and 2.0. Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model's likelihood to repeat the same line ve…
function_call string | ChatCompletionFunctionCallOption - CreateChatCompletionRequest.allOf[2] Deprecated in favor of tool_choice. Controls which (if any) function is called by the model. none means the model will not call a function and instead generates a message. auto me…
functions array<ChatCompletionFunctions> - CreateChatCompletionRequest.allOf[2] Deprecated in favor of tools. A list of functions the model may generate JSON inputs for.
logit_bias object/map<string, integer> - CreateChatCompletionRequest.allOf[2] Modify the likelihood of specified tokens appearing in the completion. Accepts a JSON object that maps tokens (specified by their token ID in the tokenizer) to an associated bias …
logprobs boolean - CreateChatCompletionRequest.allOf[2] Whether to return log probabilities of the output tokens or not. If true, returns the log probabilities of each output token returned in the content of message.
max_completion_tokens integer - CreateChatCompletionRequest.allOf[2] An upper bound for the number of tokens that can be generated for a completion, including visible output tokens and reasoning tokens.
max_tokens integer - CreateChatCompletionRequest.allOf[2] The maximum number of tokens that can be generated in the chat completion. This value can be used to control costs for text genera…
messages array<ChatCompletionRequestMessage> - CreateChatCompletionRequest.allOf[2] A list of messages comprising the conversation so far. Depending on the model you use, different message types (modalities) are supported, like [text](/docs/guides…
metadata Metadata - ModelResponseProperties -
modalities ResponseModalities - CreateChatCompletionRequest.allOf[2] -
model ModelIdsShared - CreateChatCompletionRequest.allOf[2] Model ID used to generate the response, like gpt-4o or o3. OpenAI offers a wide range of models with different capabilities, performance characteristics, and price points. Refer t…
n integer - CreateChatCompletionRequest.allOf[2] How many chat completion choices to generate for each input message. Note that you will be charged based on the number of generated tokens across all of the choices. Keep n as 1 t…
parallel_tool_calls ParallelToolCalls - CreateChatCompletionRequest.allOf[2] -
prediction PredictionContent - CreateChatCompletionRequest.allOf[2] Configuration for a Predicted Output, which can greatly improve response times when large parts of the model response are known ahead of time. Th…
presence_penalty number - CreateChatCompletionRequest.allOf[2] Number between -2.0 and 2.0. Positive values penalize new tokens based on whether they appear in the text so far, increasing the model's likelihood to talk about new topics.
prompt_cache_key string - ModelResponseProperties Used by OpenAI to cache responses for similar requests to optimize your cache hit rates. Replaces the user field. Learn more.
prompt_cache_retention string | null - ModelResponseProperties -
reasoning_effort ReasoningEffort - CreateChatCompletionRequest.allOf[2] -
response_format ResponseFormatText | ResponseFormatJsonSchema | ResponseFormatJsonObject - CreateChatCompletionRequest.allOf[2] An object specifying the format that the model must output. Setting to { "type": "json_schema", "json_schema": {...} } enables Structured Outputs which ensures the model will matc…
safety_identifier string - ModelResponseProperties A stable identifier used to help detect users of your application that may be violating OpenAI's usage policies. The IDs should be a string that uniquely identifies each user, wit…
seed integer - CreateChatCompletionRequest.allOf[2] This feature is in Beta. If specified, our system will make a best effort to sample deterministically, such that repeated requests with the same seed and parameters should return …
service_tier ServiceTier - ModelResponseProperties -
stop StopConfiguration - CreateChatCompletionRequest.allOf[2] -
store boolean - CreateChatCompletionRequest.allOf[2] Whether or not to store the output of this chat completion request for use in our model distillation or evals products. Supports…
stream boolean - CreateChatCompletionRequest.allOf[2] If set to true, the model response data will be streamed to the client as it is generated using [server-sent events](https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_e…
stream_options ChatCompletionStreamOptions - CreateChatCompletionRequest.allOf[2] -
temperature number | null - ModelResponseProperties -
tool_choice ChatCompletionToolChoiceOption - CreateChatCompletionRequest.allOf[2] -
tools array<ChatCompletionTool | CustomToolChatCompletions> - CreateChatCompletionRequest.allOf[2] A list of tools the model may call. You can provide either custom tools or function tools.
top_logprobs integer | null - ModelResponseProperties -
top_p number | null - ModelResponseProperties -
user string - ModelResponseProperties This field is being replaced by safety_identifier and prompt_cache_key. Use prompt_cache_key instead to maintain caching optimizations. A stable identifier for your end-users. Use…
verbosity Verbosity - CreateChatCompletionRequest.allOf[2] -
web_search_options object - CreateChatCompletionRequest.allOf[2] This tool searches the web for relevant results to use in a response. Learn more about the web search tool.

CreateChatCompletionResponse

类型 object
说明 Represents a chat completion response returned by model, based on the provided input.
字段 必填 类型 枚举/常量 说明
choices array<object> - A list of chat completion choices. Can be more than one if n is greater than 1.
created integer(unixtime) - The Unix timestamp (in seconds) of when the chat completion was created.
id string - A unique identifier for the chat completion.
model string - The model used for the chat completion.
object string chat.completion The object type, which is always chat.completion.
service_tier ServiceTier - -
system_fingerprint string - This fingerprint represents the backend configuration that the model runs with. Can be used in conjunction with the seed request parameter to understand when backend changes have …
usage CompletionUsage - -

CreateChatCompletionStreamResponse

类型 object
说明 Represents a streamed chunk of a chat completion response returned by the model, based on the provided input. Learn more.
字段 必填 类型 枚举/常量 说明
choices array<object> - A list of chat completion choices. Can contain more than one elements if n is greater than 1. Can also be empty for the last chunk if you set stream_options: {"include_usage": tru…
created integer(unixtime) - The Unix timestamp (in seconds) of when the chat completion was created. Each chunk has the same timestamp.
id string - A unique identifier for the chat completion. Each chunk has the same ID.
model string - The model to generate the completion.
object string chat.completion.chunk The object type, which is always chat.completion.chunk.
service_tier ServiceTier - -
system_fingerprint string - This fingerprint represents the backend configuration that the model runs with. Can be used in conjunction with the seed request parameter to understand when backend changes have …
usage CompletionUsage - An optional field that will only be present when you set stream_options: {"include_usage": true} in your request. When present, it contains a null value **except for the last chun…

CreateEmbeddingRequest

类型 object
说明 -
字段 必填 类型 枚举/常量 说明
dimensions integer - The number of dimensions the resulting output embeddings should have. Only supported in text-embedding-3 and later models.
encoding_format string float, base64 The format to return the embeddings in. Can be either float or base64.
input string | array<string> | array<integer> | array<array<integer>> - Input text to embed, encoded as a string or array of tokens. To embed multiple inputs in a single request, pass an array of strings or array of token arrays. The input must not ex…
model string | string - ID of the model to use. You can use the List models API to see all of your available models, or see our Model overview for descr…
user string - A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse. Learn more.

CreateEmbeddingResponse

类型 object
说明 -
字段 必填 类型 枚举/常量 说明
data array<Embedding> - The list of embeddings generated by the model.
model string - The name of the model used to generate the embedding.
object string list The object type, which is always "list".
usage object - The usage information for the request.

CreateImageEditRequest

类型 object
说明 -
字段 必填 类型 枚举/常量 说明
background string transparent, opaque, auto Allows to set transparency for the background of the generated image(s). This parameter is only supported for the GPT image models. Must be one of transparent, opaque or auto (def…
image string(binary) | array<string(binary)> - The image(s) to edit. Must be a supported image file or an array of images. For the GPT image models (gpt-image-1, gpt-image-1-mini, and gpt-image-1.5), each image should be a png…
input_fidelity InputFidelity | null - -
mask string(binary) - An additional image whose fully transparent areas (e.g. where alpha is zero) indicate where image should be edited. If there are multiple images provided, the mask will be applied…
model string | string - The model to use for image generation. Defaults to gpt-image-1.5.
n integer - The number of images to generate. Must be between 1 and 10.
output_compression integer - The compression level (0-100%) for the generated images. This parameter is only supported for the GPT image models with the webp or jpeg output formats, and defaults to 100.
output_format string png, jpeg, webp The format in which the generated images are returned. This parameter is only supported for the GPT image models. Must be one of png, jpeg, or webp. The default value is png.
partial_images PartialImages - -
prompt string - A text description of the desired image(s). The maximum length is 1000 characters for dall-e-2, and 32000 characters for the GPT image models.
quality string standard, low, medium, high, auto The quality of the image that will be generated for GPT image models. Defaults to auto.
response_format string url, b64_json The format in which the generated images are returned. Must be one of url or b64_json. URLs are only valid for 60 minutes after the image has been generated. This parameter is onl…
size string | string - 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 m…
stream boolean - Edit the image in streaming mode. Defaults to false. See the Image generation guide for more information.
user string - A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse. Learn more.

CreateImageRequest

类型 object
说明 -
字段 必填 类型 枚举/常量 说明
background string transparent, opaque, auto Allows to set transparency for the background of the generated image(s). This parameter is only supported for the GPT image models. Must be one of transparent, opaque or auto (def…
model string | string - The model to use for image generation. One of dall-e-2, dall-e-3, or a GPT image model (gpt-image-1, gpt-image-1-mini, gpt-image-1.5). Defaults to dall-e-2 unless a parameter spec…
moderation string low, auto Control the content-moderation level for images generated by the GPT image models. Must be either low for less restrictive filtering or auto (default value).
n integer - The number of images to generate. Must be between 1 and 10. For dall-e-3, only n=1 is supported.
output_compression integer - The compression level (0-100%) for the generated images. This parameter is only supported for the GPT image models with the webp or jpeg output formats, and defaults to 100.
output_format string png, jpeg, webp The format in which the generated images are returned. This parameter is only supported for the GPT image models. Must be one of png, jpeg, or webp.
partial_images PartialImages - -
prompt string - A text description of the desired image(s). The maximum length is 32000 characters for the GPT image models, 1000 characters for dall-e-2 and 4000 characters for dall-e-3.
quality string standard, hd, low, medium, high, auto The quality of the image that will be generated. - auto (default value) will automatically select the best quality for the given model. - high, medium and low are supported for th…
response_format string url, b64_json The format in which generated images with dall-e-2 and dall-e-3 are returned. Must be one of url or b64_json. URLs are only valid for 60 minutes after the image has been generated…
size string | string - 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 m…
stream boolean - Generate the image in streaming mode. Defaults to false. See the Image generation guide for more information. This parameter is only supported for…
style string vivid, natural The style of the generated images. This parameter is only supported for dall-e-3. Must be one of vivid or natural. Vivid causes the model to lean towards generating hyper-real and…
user string - A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse. Learn more.

CreateImageVariationRequest

类型 object
说明 -
字段 必填 类型 枚举/常量 说明
image string(binary) - The image to use as the basis for the variation(s). Must be a valid PNG file, less than 4MB, and square.
model string | string - The model to use for image generation. Only dall-e-2 is supported at this time.
n integer - The number of images to generate. Must be between 1 and 10.
response_format string url, b64_json The format in which the generated images are returned. Must be one of url or b64_json. URLs are only valid for 60 minutes after the image has been generated.
size string 256x256, 512x512, 1024x1024 The size of the generated images. Must be one of 256x256, 512x512, or 1024x1024.
user string - A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse. Learn more.

CreateModelResponseProperties

类型 ModelResponseProperties & object
说明 -
组合 allOf
变体 类型 说明
1 ModelResponseProperties -
2 object -

allOf 展开字段

字段 必填 类型 枚举/常量 来源 说明
metadata Metadata - ModelResponseProperties -
prompt_cache_key string - ModelResponseProperties Used by OpenAI to cache responses for similar requests to optimize your cache hit rates. Replaces the user field. Learn more.
prompt_cache_retention string | null - ModelResponseProperties -
safety_identifier string - ModelResponseProperties A stable identifier used to help detect users of your application that may be violating OpenAI's usage policies. The IDs should be a string that uniquely identifies each user, wit…
service_tier ServiceTier - ModelResponseProperties -
temperature number | null - ModelResponseProperties -
top_logprobs integer | null - ModelResponseProperties -
top_p number | null - ModelResponseProperties -
user string - ModelResponseProperties This field is being replaced by safety_identifier and prompt_cache_key. Use prompt_cache_key instead to maintain caching optimizations. A stable identifier for your end-users. Use…

CreateResponse

类型 CreateModelResponseProperties & ResponseProperties & object
说明 -
组合 allOf
变体 类型 说明
1 CreateModelResponseProperties -
2 ResponseProperties -
3 object -

allOf 展开字段

字段 必填 类型 枚举/常量 来源 说明
background boolean | null - ResponseProperties -
context_management array<ContextManagementParam> | null - CreateResponse.allOf[3] -
conversation ConversationParam | null - CreateResponse.allOf[3] -
include array<IncludeEnum> | null - CreateResponse.allOf[3] -
input InputParam - CreateResponse.allOf[3] -
instructions string | null - CreateResponse.allOf[3] -
max_output_tokens integer | null - CreateResponse.allOf[3] -
max_tool_calls integer | null - ResponseProperties -
metadata Metadata - ModelResponseProperties -
model ModelIdsResponses - ResponseProperties Model ID used to generate the response, like gpt-4o or o3. OpenAI offers a wide range of models with different capabilities, performance characteristics, and price points. Refer t…
parallel_tool_calls boolean | null - CreateResponse.allOf[3] -
previous_response_id string | null - ResponseProperties -
prompt Prompt - ResponseProperties -
prompt_cache_key string - ModelResponseProperties Used by OpenAI to cache responses for similar requests to optimize your cache hit rates. Replaces the user field. Learn more.
prompt_cache_retention string | null - ModelResponseProperties -
reasoning Reasoning | null - ResponseProperties -
safety_identifier string - ModelResponseProperties A stable identifier used to help detect users of your application that may be violating OpenAI's usage policies. The IDs should be a string that uniquely identifies each user, wit…
service_tier ServiceTier - ModelResponseProperties -
store boolean | null - CreateResponse.allOf[3] -
stream boolean | null - CreateResponse.allOf[3] -
stream_options ResponseStreamOptions - CreateResponse.allOf[3] -
temperature number | null - ModelResponseProperties -
text ResponseTextParam - ResponseProperties -
tool_choice ToolChoiceParam - ResponseProperties -
tools ToolsArray - ResponseProperties -
top_logprobs integer | null - ModelResponseProperties -
top_p number | null - ModelResponseProperties -
truncation string | null - ResponseProperties -
user string - ModelResponseProperties This field is being replaced by safety_identifier and prompt_cache_key. Use prompt_cache_key instead to maintain caching optimizations. A stable identifier for your end-users. Use…

CustomGrammarFormatParam

类型 object
说明 A grammar defined by the user.
字段 必填 类型 枚举/常量 说明
definition string - The grammar definition.
syntax GrammarSyntax1 - The syntax of the grammar definition. One of lark or regex.
type string grammar Grammar format. Always grammar.

CustomTextFormatParam

类型 object
说明 Unconstrained free-form text.
字段 必填 类型 枚举/常量 说明
type string text Unconstrained text format. Always text.

CustomToolCall

类型 object
说明 A call to a custom tool created by the model.
字段 必填 类型 枚举/常量 说明
call_id string - An identifier used to map this custom tool call to a tool call output.
id string - The unique ID of the custom tool call in the OpenAI platform.
input string - The input for the custom tool call generated by the model.
name string - The name of the custom tool being called.
namespace string - The namespace of the custom tool being called.
type string custom_tool_call The type of the custom tool call. Always custom_tool_call.

CustomToolCallOutput

类型 object
说明 The output of a custom tool call from your code, being sent back to the model.
字段 必填 类型 枚举/常量 说明
call_id string - The call ID, used to map this custom tool call output to a custom tool call.
id string - The unique ID of the custom tool call output in the OpenAI platform.
output string | array<FunctionAndCustomToolCallOutput> - The output from the custom tool call generated by your code. Can be a string or an list of output content.
type string custom_tool_call_output The type of the custom tool call output. Always custom_tool_call_output.

CustomToolCallOutputResource

类型 CustomToolCallOutput & object
说明 -
组合 allOf
变体 类型 说明
1 CustomToolCallOutput -
2 object -

allOf 展开字段

字段 必填 类型 枚举/常量 来源 说明
call_id string - CustomToolCallOutput The call ID, used to map this custom tool call output to a custom tool call.
created_by string - CustomToolCallOutputResource.allOf[2] The identifier of the actor that created the item.
id string - CustomToolCallOutput The unique ID of the custom tool call output in the OpenAI platform.
output string | array<FunctionAndCustomToolCallOutput> - CustomToolCallOutput The output from the custom tool call generated by your code. Can be a string or an list of output content.
status FunctionCallOutputStatusEnum - CustomToolCallOutputResource.allOf[2] The status of the item. One of in_progress, completed, or incomplete. Populated when items are returned via API.
type string custom_tool_call_output CustomToolCallOutput The type of the custom tool call output. Always custom_tool_call_output.

CustomToolChatCompletions

类型 object
说明 A custom tool that processes input using a specified format.
字段 必填 类型 枚举/常量 说明
custom object - Properties of the custom tool.
type string custom The type of the custom tool. Always custom.

CustomToolParam

类型 object
说明 A custom tool that processes input using a specified format. Learn more about custom tools
字段 必填 类型 枚举/常量 说明
defer_loading boolean - Whether this tool should be deferred and discovered via tool search.
description string - Optional description of the custom tool, used to provide more context.
format CustomTextFormatParam | CustomGrammarFormatParam - The input format for the custom tool. Default is unconstrained text.
name string - The name of the custom tool, used to identify it in tool calls.
type string custom The type of the custom tool. Always custom.

DetailEnum

类型 string
说明 -

DoubleClickAction

类型 object
说明 A double click action.
字段 必填 类型 枚举/常量 说明
keys array<string> | null - -
type string double_click Specifies the event type. For a double click action, this property is always set to double_click.
x integer - The x-coordinate where the double click occurred.
y integer - The y-coordinate where the double click occurred.

DragParam

类型 object
说明 A drag action.
字段 必填 类型 枚举/常量 说明
keys array<string> | null - -
path array<CoordParam> - An array of coordinates representing the path of the drag action. Coordinates will appear as an array of objects, eg
type string drag Specifies the event type. For a drag action, this property is always set to drag.

EasyInputMessage

类型 object
说明 A message input to the model with a role indicating instruction following hierarchy. Instructions given with the developer or system role take precedence over instructions given w…
字段 必填 类型 枚举/常量 说明
content string | InputMessageContentList - Text, image, or audio input to the model, used to generate a response. Can also contain previous assistant responses.
phase MessagePhase | null - -
role string user, assistant, system, developer The role of the message input. One of user, assistant, system, or developer.
type string message The type of the message input. Always message.

EditImageBodyJsonParam

类型 object
说明 JSON request body for image edits. Use images (array of ImageRefParam) instead of multipart image uploads. You can reference images via external URLs, data URLs, or uploaded file …
字段 必填 类型 枚举/常量 说明
background string | null - Background behavior for generated image output.
images array<ImageRefParam> - Input image references to edit. For GPT image models, you can provide up to 16 images.
input_fidelity string | null - Controls fidelity to the original input image(s).
mask ImageRefParam - -
model string | string | null - The model to use for image editing.
moderation string | null - Moderation level for GPT image models.
n integer | null - The number of edited images to generate.
output_compression integer | null - Compression level for jpeg or webp output.
output_format string | null - Output image format. Supported for GPT image models.
partial_images PartialImages - -
prompt string - A text description of the desired image edit.
quality string | null - Output quality for GPT image models.
size string | null - Requested output image size.
stream boolean | null - Stream partial image results as events.
user string - A unique identifier representing your end-user, which can help OpenAI monitor and detect abuse.

Embedding

类型 object
说明 Represents an embedding vector returned by embedding endpoint.
字段 必填 类型 枚举/常量 说明
embedding array<number(float)> - The embedding vector, which is a list of floats. The length of vector depends on the model as listed in the embedding guide.
index integer - The index of the embedding in the list of embeddings.
object string embedding The object type, which is always "embedding".

EmptyModelParam

类型 object
说明 -

FileCitationBody

类型 object
说明 A citation to a file.
字段 必填 类型 枚举/常量 说明
file_id string - The ID of the file.
filename string - The filename of the file cited.
index integer - The index of the file in the list of files.
type string file_citation The type of the file citation. Always file_citation.

FileDetailEnum

类型 string
说明 -

FileInputDetail

类型 string
说明 -

FilePath

类型 object
说明 A path to a file.
字段 必填 类型 枚举/常量 说明
file_id string - The ID of the file.
index integer - The index of the file in the list of files.
type string file_path The type of the file path. Always file_path.

FileSearchTool

类型 object
说明 A tool that searches for relevant content from uploaded files. Learn more about the file search tool.
字段 必填 类型 枚举/常量 说明
filters Filters | null - -
max_num_results integer - The maximum number of results to return. This number should be between 1 and 50 inclusive.
ranking_options RankingOptions - Ranking options for search.
type string file_search The type of the file search tool. Always file_search.
vector_store_ids array<string> - The IDs of the vector stores to search.

FileSearchToolCall

类型 object
说明 The results of a file search tool call. See the file search guide for more information.
字段 必填 类型 枚举/常量 说明
id string - The unique ID of the file search tool call.
queries array<string> - The queries used to search for files.
results array<object> | null - -
status string in_progress, searching, completed, incomplete, failed The status of the file search tool call. One of in_progress, searching, incomplete or failed,
type string file_search_call The type of the file search tool call. Always file_search_call.

Filters

类型 ComparisonFilter | CompoundFilter
说明 -
组合 anyOf
变体 类型 说明
1 ComparisonFilter -
2 CompoundFilter -

FunctionAndCustomToolCallOutput

类型 InputTextContent | InputImageContent | InputFileContent
说明 -
组合 oneOf
变体 类型 说明
1 InputTextContent -
2 InputImageContent -
3 InputFileContent -

FunctionCallItemStatus

类型 string
说明 -

FunctionCallOutputItemParam

类型 object
说明 The output of a function tool call.
字段 必填 类型 枚举/常量 说明
call_id string - The unique ID of the function tool call generated by the model.
id string | null - -
output string | array<InputTextContentParam | InputImageContentParamAutoParam | InputFileContentParam> - Text, image, or file output of the function tool call.
status FunctionCallItemStatus | null - -
type string function_call_output The type of the function tool call output. Always function_call_output.

FunctionCallOutputStatusEnum

类型 string
说明 -

FunctionCallStatus

类型 string
说明 -

FunctionObject

类型 object
说明 -
字段 必填 类型 枚举/常量 说明
description string - A description of what the function does, used by the model to choose when and how to call the function.
name string - The name of the function to be called. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64.
parameters FunctionParameters - -
strict boolean | null - -

FunctionParameters

类型 object
说明 The parameters the functions accepts, described as a JSON Schema object. See the guide for examples, and the [JSON Schema reference](https://json-…

Additional properties: 任意 JSON 值

FunctionShellAction

类型 object
说明 Execute a shell command.
字段 必填 类型 枚举/常量 说明
commands array<string> - -
max_output_length integer | null - -
timeout_ms integer | null - -

FunctionShellActionParam

类型 object
说明 Commands and limits describing how to run the shell tool call.
字段 必填 类型 枚举/常量 说明
commands array<string> - Ordered shell commands for the execution environment to run.
max_output_length integer | null - -
timeout_ms integer | null - -

FunctionShellCall

类型 object
说明 A tool call that executes one or more shell commands in a managed environment.
字段 必填 类型 枚举/常量 说明
action FunctionShellAction - The shell commands and limits that describe how to run the tool call.
call_id string - The unique ID of the shell tool call generated by the model.
created_by string - The ID of the entity that created this tool call.
environment LocalEnvironmentResource | ContainerReferenceResource | null - -
id string - The unique ID of the shell tool call. Populated when this item is returned via API.
status FunctionShellCallStatus - The status of the shell call. One of in_progress, completed, or incomplete.
type string shell_call The type of the item. Always shell_call.

FunctionShellCallItemParam

类型 object
说明 A tool representing a request to execute one or more shell commands.
字段 必填 类型 枚举/常量 说明
action FunctionShellActionParam - The shell commands and limits that describe how to run the tool call.
call_id string - The unique ID of the shell tool call generated by the model.
environment LocalEnvironmentParam | ContainerReferenceParam | null - -
id string | null - -
status FunctionShellCallItemStatus | null - -
type string shell_call The type of the item. Always shell_call.

FunctionShellCallItemStatus

类型 string
说明 Status values reported for shell tool calls.

FunctionShellCallOutput

类型 object
说明 The output of a shell tool call that was emitted.
字段 必填 类型 枚举/常量 说明
call_id string - The unique ID of the shell tool call generated by the model.
created_by string - The identifier of the actor that created the item.
id string - The unique ID of the shell call output. Populated when this item is returned via API.
max_output_length integer | null - -
output array<FunctionShellCallOutputContent> - An array of shell call output contents
status FunctionShellCallOutputStatusEnum - The status of the shell call output. One of in_progress, completed, or incomplete.
type string shell_call_output The type of the shell call output. Always shell_call_output.

FunctionShellCallOutputContent

类型 object
说明 The content of a shell tool call output that was emitted.
字段 必填 类型 枚举/常量 说明
created_by string - The identifier of the actor that created the item.
outcome FunctionShellCallOutputTimeoutOutcome | FunctionShellCallOutputExitOutcome - Represents either an exit outcome (with an exit code) or a timeout outcome for a shell call output chunk.
stderr string - The standard error output that was captured.
stdout string - The standard output that was captured.

FunctionShellCallOutputContentParam

类型 object
说明 Captured stdout and stderr for a portion of a shell tool call output.
字段 必填 类型 枚举/常量 说明
outcome FunctionShellCallOutputOutcomeParam - The exit or timeout outcome associated with this shell call.
stderr string - Captured stderr output for the shell call.
stdout string - Captured stdout output for the shell call.

FunctionShellCallOutputExitOutcome

类型 object
说明 Indicates that the shell commands finished and returned an exit code.
字段 必填 类型 枚举/常量 说明
exit_code integer - Exit code from the shell process.
type string exit The outcome type. Always exit.

FunctionShellCallOutputExitOutcomeParam

类型 object
说明 Indicates that the shell commands finished and returned an exit code.
字段 必填 类型 枚举/常量 说明
exit_code integer - The exit code returned by the shell process.
type string exit The outcome type. Always exit.

FunctionShellCallOutputItemParam

类型 object
说明 The streamed output items emitted by a shell tool call.
字段 必填 类型 枚举/常量 说明
call_id string - The unique ID of the shell tool call generated by the model.
id string | null - -
max_output_length integer | null - -
output array<FunctionShellCallOutputContentParam> - Captured chunks of stdout and stderr output, along with their associated outcomes.
status FunctionShellCallItemStatus | null - -
type string shell_call_output The type of the item. Always shell_call_output.

FunctionShellCallOutputOutcomeParam

类型 FunctionShellCallOutputTimeoutOutcomeParam | FunctionShellCallOutputExitOutcomeParam
说明 The exit or timeout outcome associated with this shell call.
组合 oneOf
变体 类型 说明
1 FunctionShellCallOutputTimeoutOutcomeParam -
2 FunctionShellCallOutputExitOutcomeParam -

FunctionShellCallOutputStatusEnum

类型 string
说明 -

FunctionShellCallOutputTimeoutOutcome

类型 object
说明 Indicates that the shell call exceeded its configured time limit.
字段 必填 类型 枚举/常量 说明
type string timeout The outcome type. Always timeout.

FunctionShellCallOutputTimeoutOutcomeParam

类型 object
说明 Indicates that the shell call exceeded its configured time limit.
字段 必填 类型 枚举/常量 说明
type string timeout The outcome type. Always timeout.

FunctionShellCallStatus

类型 string
说明 -

FunctionShellToolParam

类型 object
说明 A tool that allows the model to execute shell commands.
字段 必填 类型 枚举/常量 说明
environment ContainerAutoParam | LocalEnvironmentParam | ContainerReferenceParam | null - -
type string shell The type of the shell tool. Always shell.

FunctionTool

类型 object
说明 Defines a function in your own code the model can choose to call. Learn more about function calling.
字段 必填 类型 枚举/常量 说明
defer_loading boolean - Whether this function is deferred and loaded via tool search.
description string | null - -
name string - The name of the function to call.
parameters object/map<string, object/value> | null - -
strict boolean | null - -
type string function The type of the function tool. Always function.

FunctionToolCall

类型 object
说明 A tool call to run a function. See the function calling guide for more information.
字段 必填 类型 枚举/常量 说明
arguments string - A JSON string of the arguments to pass to the function.
call_id string - The unique ID of the function tool call generated by the model.
id string - The unique ID of the function tool call.
name string - The name of the function to run.
namespace string - The namespace of the function to run.
status string in_progress, completed, incomplete The status of the item. One of in_progress, completed, or incomplete. Populated when items are returned via API.
type string function_call The type of the function tool call. Always function_call.

FunctionToolCallOutput

类型 object
说明 The output of a function tool call.
字段 必填 类型 枚举/常量 说明
call_id string - The unique ID of the function tool call generated by the model.
id string - The unique ID of the function tool call output. Populated when this item is returned via API.
output string | array<FunctionAndCustomToolCallOutput> - The output from the function call generated by your code. Can be a string or an list of output content.
status string in_progress, completed, incomplete The status of the item. One of in_progress, completed, or incomplete. Populated when items are returned via API.
type string function_call_output The type of the function tool call output. Always function_call_output.

FunctionToolCallOutputResource

类型 FunctionToolCallOutput & object
说明 -
组合 allOf
变体 类型 说明
1 FunctionToolCallOutput -
2 object -

allOf 展开字段

字段 必填 类型 枚举/常量 来源 说明
call_id string - FunctionToolCallOutput The unique ID of the function tool call generated by the model.
created_by string - FunctionToolCallOutputResource.allOf[2] The identifier of the actor that created the item.
id string - FunctionToolCallOutput The unique ID of the function tool call output. Populated when this item is returned via API.
output string | array<FunctionAndCustomToolCallOutput> - FunctionToolCallOutput The output from the function call generated by your code. Can be a string or an list of output content.
status string in_progress, completed, incomplete FunctionToolCallOutput The status of the item. One of in_progress, completed, or incomplete. Populated when items are returned via API.
type string function_call_output FunctionToolCallOutput The type of the function tool call output. Always function_call_output.

FunctionToolParam

类型 object
说明 -
字段 必填 类型 枚举/常量 说明
defer_loading boolean - Whether this function should be deferred and discovered via tool search.
description string | null - -
name string - -
parameters EmptyModelParam | null - -
strict boolean | null - -
type string function -

GrammarSyntax1

类型 string
说明 -

HybridSearchOptions

类型 object
说明 -
字段 必填 类型 枚举/常量 说明
embedding_weight number - The weight of the embedding in the reciprocal ranking fusion.
text_weight number - The weight of the text in the reciprocal ranking fusion.

Image

类型 object
说明 Represents the content or the URL of an image generated by the OpenAI API.
字段 必填 类型 枚举/常量 说明
b64_json string - The base64-encoded JSON of the generated image. Returned by default for the GPT image models, and only present if response_format is set to b64_json for dall-e-2 and dall-e-3.
revised_prompt string - For dall-e-3 only, the revised prompt that was used to generate the image.
url string(uri) - When using dall-e-2 or dall-e-3, the URL of the generated image if response_format is set to url (default value). Unsupported for the GPT image models.

ImageDetail

类型 string
说明 -

ImageEditCompletedEvent

类型 object
说明 Emitted when image editing has completed and the final image is available.
字段 必填 类型 枚举/常量 说明
b64_json string - Base64-encoded final edited image data, suitable for rendering as an image.
background string transparent, opaque, auto The background setting for the edited image.
created_at integer(unixtime) - The Unix timestamp when the event was created.
output_format string png, webp, jpeg The output format for the edited image.
quality string low, medium, high, auto The quality setting for the edited image.
size string 1024x1024, 1024x1536, 1536x1024, auto The size of the edited image.
type string image_edit.completed The type of the event. Always image_edit.completed.
usage ImagesUsage - -

ImageEditPartialImageEvent

类型 object
说明 Emitted when a partial image is available during image editing streaming.
字段 必填 类型 枚举/常量 说明
b64_json string - Base64-encoded partial image data, suitable for rendering as an image.
background string transparent, opaque, auto The background setting for the requested edited image.
created_at integer(unixtime) - The Unix timestamp when the event was created.
output_format string png, webp, jpeg The output format for the requested edited image.
partial_image_index integer - 0-based index for the partial image (streaming).
quality string low, medium, high, auto The quality setting for the requested edited image.
size string 1024x1024, 1024x1536, 1536x1024, auto The size of the requested edited image.
type string image_edit.partial_image The type of the event. Always image_edit.partial_image.

ImageEditStreamEvent

类型 ImageEditPartialImageEvent | ImageEditCompletedEvent
说明 -
组合 anyOf
变体 类型 说明
1 ImageEditPartialImageEvent -
2 ImageEditCompletedEvent -

ImageGenActionEnum

类型 string
说明 -

ImageGenCompletedEvent

类型 object
说明 Emitted when image generation has completed and the final image is available.
字段 必填 类型 枚举/常量 说明
b64_json string - Base64-encoded image data, suitable for rendering as an image.
background string transparent, opaque, auto The background setting for the generated image.
created_at integer(unixtime) - The Unix timestamp when the event was created.
output_format string png, webp, jpeg The output format for the generated image.
quality string low, medium, high, auto The quality setting for the generated image.
size string 1024x1024, 1024x1536, 1536x1024, auto The size of the generated image.
type string image_generation.completed The type of the event. Always image_generation.completed.
usage ImagesUsage - -

ImageGenInputUsageDetails

类型 object
说明 The input tokens detailed information for the image generation.
字段 必填 类型 枚举/常量 说明
image_tokens integer - The number of image tokens in the input prompt.
text_tokens integer - The number of text tokens in the input prompt.

ImageGenOutputTokensDetails

类型 object
说明 The output token details for the image generation.
字段 必填 类型 枚举/常量 说明
image_tokens integer - The number of image output tokens generated by the model.
text_tokens integer - The number of text output tokens generated by the model.

ImageGenPartialImageEvent

类型 object
说明 Emitted when a partial image is available during image generation streaming.
字段 必填 类型 枚举/常量 说明
b64_json string - Base64-encoded partial image data, suitable for rendering as an image.
background string transparent, opaque, auto The background setting for the requested image.
created_at integer(unixtime) - The Unix timestamp when the event was created.
output_format string png, webp, jpeg The output format for the requested image.
partial_image_index integer - 0-based index for the partial image (streaming).
quality string low, medium, high, auto The quality setting for the requested image.
size string 1024x1024, 1024x1536, 1536x1024, auto The size of the requested image.
type string image_generation.partial_image The type of the event. Always image_generation.partial_image.

ImageGenStreamEvent

类型 ImageGenPartialImageEvent | ImageGenCompletedEvent
说明 -
组合 anyOf
变体 类型 说明
1 ImageGenPartialImageEvent -
2 ImageGenCompletedEvent -

ImageGenTool

类型 object
说明 A tool that generates images using the GPT image models.
字段 必填 类型 枚举/常量 说明
action ImageGenActionEnum - Whether to generate a new image or edit an existing image. Default: auto.
background string transparent, opaque, auto Background type for the generated image. One of transparent, opaque, or auto. Default: auto.
input_fidelity InputFidelity | null - -
input_image_mask object - Optional mask for inpainting. Contains image_url (string, optional) and file_id (string, optional).
model string | string - -
moderation string auto, low Moderation level for the generated image. Default: auto.
output_compression integer - Compression level for the output image. Default: 100.
output_format string png, webp, jpeg The output format of the generated image. One of png, webp, or jpeg. Default: png.
partial_images integer - Number of partial images to generate in streaming mode, from 0 (default value) to 3.
quality string low, medium, high, auto The quality of the generated image. One of low, medium, high, or auto. Default: auto.
size string | string - 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 m…
type string image_generation The type of the image generation tool. Always image_generation.

ImageGenToolCall

类型 object
说明 An image generation request made by the model.
字段 必填 类型 枚举/常量 说明
id string - The unique ID of the image generation call.
result string | null - -
status string in_progress, completed, generating, failed The status of the image generation call.
type string image_generation_call The type of the image generation call. Always image_generation_call.

ImageGenUsage

类型 object
说明 For gpt-image-1 only, the token usage information for the image generation.
字段 必填 类型 枚举/常量 说明
input_tokens integer - The number of tokens (images and text) in the input prompt.
input_tokens_details ImageGenInputUsageDetails - -
output_tokens integer - The number of output tokens generated by the model.
output_tokens_details ImageGenOutputTokensDetails - -
total_tokens integer - The total number of tokens (images and text) used for the image generation.

ImageRefParam

类型 object/value | object/value
说明 Reference an input image by either URL or uploaded file ID. Provide exactly one of image_url or file_id.
组合 anyOf
变体 类型 说明
1 object/value -
2 object/value -
字段 必填 类型 枚举/常量 说明
file_id string - The File API ID of an uploaded image to use as input.
image_url string(uri) - A fully qualified URL or base64-encoded data URL.

ImagesResponse

类型 object
说明 The response from the image generation endpoint.
字段 必填 类型 枚举/常量 说明
background string transparent, opaque The background parameter used for the image generation. Either transparent or opaque.
created integer(unixtime) - The Unix timestamp (in seconds) of when the image was created.
data array<Image> - The list of generated images.
output_format string png, webp, jpeg The output format of the image generation. Either png, webp, or jpeg.
quality string low, medium, high The quality of the image generated. Either low, medium, or high.
size string 1024x1024, 1024x1536, 1536x1024 The size of the image generated. Either 1024x1024, 1024x1536, or 1536x1024.
usage ImageGenUsage - -

ImagesUsage

类型 object
说明 For the GPT image models only, the token usage information for the image generation.
字段 必填 类型 枚举/常量 说明
input_tokens integer - The number of tokens (images and text) in the input prompt.
input_tokens_details object - The input tokens detailed information for the image generation.
output_tokens integer - The number of image tokens in the output image.
total_tokens integer - The total number of tokens (images and text) used for the image generation.

IncludeEnum

类型 string
说明 Specify additional output data to include in the model response. Currently supported values are: - web_search_call.results: Include the search results of the web search tool call.…

InlineSkillParam

类型 object
说明 -
字段 必填 类型 枚举/常量 说明
description string - The description of the skill.
name string - The name of the skill.
source InlineSkillSourceParam - Inline skill payload
type string inline Defines an inline skill for this request.

InlineSkillSourceParam

类型 object
说明 Inline skill payload
字段 必填 类型 枚举/常量 说明
data string - Base64-encoded skill zip bundle.
media_type string application/zip The media type of the inline skill payload. Must be application/zip.
type string base64 The type of the inline skill source. Must be base64.

InputContent

类型 InputTextContent | InputImageContent | InputFileContent
说明 -
组合 oneOf
变体 类型 说明
1 InputTextContent -
2 InputImageContent -
3 InputFileContent -

InputFidelity

类型 string
说明 Control how much effort the model will exert to match the style and features, especially facial features, of input images. This parameter is only supported for gpt-image-1 and gpt…

InputFileContent

类型 object
说明 A file input to the model.
字段 必填 类型 枚举/常量 说明
detail FileInputDetail - The detail level of the file to be sent to the model. Use low for the default rendering behavior, or high to render the file at higher quality. Defaults to low.
file_data string - The content of the file to be sent to the model.
file_id string | null - -
file_url string(uri) - The URL of the file to be sent to the model.
filename string - The name of the file to be sent to the model.
type string input_file The type of the input item. Always input_file.

InputFileContentParam

类型 object
说明 A file input to the model.
字段 必填 类型 枚举/常量 说明
detail FileDetailEnum - The detail level of the file to be sent to the model. Use low for the default rendering behavior, or high to render the file at higher quality. Defaults to low.
file_data string | null - -
file_id string | null - -
file_url string(uri) | null - -
filename string | null - -
type string input_file The type of the input item. Always input_file.

InputImageContent

类型 object
说明 An image input to the model. Learn about image inputs.
字段 必填 类型 枚举/常量 说明
detail ImageDetail - The detail level of the image to be sent to the model. One of high, low, auto, or original. Defaults to auto.
file_id string | null - -
image_url string(uri) | null - -
type string input_image The type of the input item. Always input_image.

InputImageContentParamAutoParam

类型 object
说明 An image input to the model. Learn about image inputs
字段 必填 类型 枚举/常量 说明
detail DetailEnum | null - -
file_id string | null - -
image_url string(uri) | null - -
type string input_image The type of the input item. Always input_image.

InputItem

类型 EasyInputMessage | Item | CompactionTriggerItemParam | ItemReferenceParam
说明 -
组合 oneOf
变体 类型 说明
1 EasyInputMessage -
2 Item An item representing part of the context for the response to be generated by the model. Can contain text, images, and audio inputs, as well as previous assistant responses and too…
3 CompactionTriggerItemParam -
4 ItemReferenceParam -

InputMessage

类型 object
说明 A message input to the model with a role indicating instruction following hierarchy. Instructions given with the developer or system role take precedence over instructions given w…
字段 必填 类型 枚举/常量 说明
content InputMessageContentList - -
role string user, system, developer The role of the message input. One of user, system, or developer.
status string in_progress, completed, incomplete The status of item. One of in_progress, completed, or incomplete. Populated when items are returned via API.
type string message The type of the message input. Always set to message.

InputMessageContentList

类型 array<InputContent>
说明 A list of one or many input items to the model, containing different content types.

InputParam

类型 string | array<InputItem>
说明 Text, image, or file inputs to the model, used to generate a response. Learn more: - Text inputs and outputs - Image inputs - [File inp…
组合 oneOf
变体 类型 说明
1 string A text input to the model, equivalent to a text input with the user role.
2 array<InputItem> A list of one or many input items to the model, containing different content types.

InputTextContent

类型 object
说明 A text input to the model.
字段 必填 类型 枚举/常量 说明
text string - The text input to the model.
type string input_text The type of the input item. Always input_text.

InputTextContentParam

类型 object
说明 A text input to the model.
字段 必填 类型 枚举/常量 说明
text string - The text input to the model.
type string input_text The type of the input item. Always input_text.

Item

类型 InputMessage | OutputMessage | FileSearchToolCall | ComputerToolCall | ComputerCallOutputItemParam | WebSearchToolCall | FunctionToolCall | FunctionCallOutputItemParam … (+19)
说明 Content item used to generate a response.
组合 oneOf
变体 类型 说明
1 InputMessage -
2 OutputMessage -
3 FileSearchToolCall -
4 ComputerToolCall -
5 ComputerCallOutputItemParam -
6 WebSearchToolCall -
7 FunctionToolCall -
8 FunctionCallOutputItemParam -
9 ToolSearchCallItemParam -
10 ToolSearchOutputItemParam -
11 AdditionalToolsItemParam -
12 ReasoningItem -
13 CompactionSummaryItemParam -
14 ImageGenToolCall -
15 CodeInterpreterToolCall -
16 LocalShellToolCall -
17 LocalShellToolCallOutput -
18 FunctionShellCallItemParam -
19 FunctionShellCallOutputItemParam -
20 ApplyPatchToolCallItemParam -
21 ApplyPatchToolCallOutputItemParam -
22 MCPListTools -
23 MCPApprovalRequest -
24 MCPApprovalResponse -
25 MCPToolCall -
26 CustomToolCallOutput -
27 CustomToolCall -

ItemField

类型 Message | FunctionToolCall | ToolSearchCall | ToolSearchOutput | AdditionalTools | FunctionToolCallOutput | FileSearchToolCall | WebSearchToolCall … (+18)
说明 An item representing a message, tool call, tool output, reasoning, or other response element.
组合 oneOf
变体 类型 说明
1 Message -
2 FunctionToolCall -
3 ToolSearchCall -
4 ToolSearchOutput -
5 AdditionalTools -
6 FunctionToolCallOutput -
7 FileSearchToolCall -
8 WebSearchToolCall -
9 ImageGenToolCall -
10 ComputerToolCall -
11 ComputerToolCallOutputResource -
12 ReasoningItem -
13 CompactionBody -
14 CodeInterpreterToolCall -
15 LocalShellToolCall -
16 LocalShellToolCallOutput -
17 FunctionShellCall -
18 FunctionShellCallOutput -
19 ApplyPatchToolCall -
20 ApplyPatchToolCallOutput -
21 MCPListTools -
22 MCPApprovalRequest -
23 MCPApprovalResponseResource -
24 MCPToolCall -
25 CustomToolCall -
26 CustomToolCallOutput -

ItemReferenceParam

类型 object
说明 An internal identifier for an item to reference.
字段 必填 类型 枚举/常量 说明
id string - The ID of the item to reference.
type string | null - -

KeyPressAction

类型 object
说明 A collection of keypresses the model would like to perform.
字段 必填 类型 枚举/常量 说明
keys array<string> - The combination of keys the model is requesting to be pressed. This is an array of strings, each representing a key.
type string keypress Specifies the event type. For a keypress action, this property is always set to keypress.

LocalEnvironmentParam

类型 object
说明 -
字段 必填 类型 枚举/常量 说明
skills array<LocalSkillParam> - An optional list of skills.
type string local Use a local computer environment.

LocalEnvironmentResource

类型 object
说明 Represents the use of a local environment to perform shell actions.
字段 必填 类型 枚举/常量 说明
type string local The environment type. Always local.

LocalShellExecAction

类型 object
说明 Execute a shell command on the server.
字段 必填 类型 枚举/常量 说明
command array<string> - The command to run.
env object/map<string, string> - Environment variables to set for the command.
timeout_ms integer | null - -
type string exec The type of the local shell action. Always exec.
user string | null - -
working_directory string | null - -

LocalShellToolCall

类型 object
说明 A tool call to run a command on the local shell.
字段 必填 类型 枚举/常量 说明
action LocalShellExecAction - -
call_id string - The unique ID of the local shell tool call generated by the model.
id string - The unique ID of the local shell call.
status string in_progress, completed, incomplete The status of the local shell call.
type string local_shell_call The type of the local shell call. Always local_shell_call.

LocalShellToolCallOutput

类型 object
说明 The output of a local shell tool call.
字段 必填 类型 枚举/常量 说明
id string - The unique ID of the local shell tool call generated by the model.
output string - A JSON string of the output of the local shell tool call.
status string | null - -
type string local_shell_call_output The type of the local shell tool call output. Always local_shell_call_output.

LocalShellToolParam

类型 object
说明 A tool that allows the model to execute shell commands in a local environment.
字段 必填 类型 枚举/常量 说明
type string local_shell The type of the local shell tool. Always local_shell.

LocalSkillParam

类型 object
说明 -
字段 必填 类型 枚举/常量 说明
description string - The description of the skill.
name string - The name of the skill.
path string - The path to the directory containing the skill.

LogProb

类型 object
说明 The log probability of a token.
字段 必填 类型 枚举/常量 说明
bytes array<integer> - -
logprob number - -
token string - -
top_logprobs array<TopLogProb> - -

MCPApprovalRequest

类型 object
说明 A request for human approval of a tool invocation.
字段 必填 类型 枚举/常量 说明
arguments string - A JSON string of arguments for the tool.
id string - The unique ID of the approval request.
name string - The name of the tool to run.
server_label string - The label of the MCP server making the request.
type string mcp_approval_request The type of the item. Always mcp_approval_request.

MCPApprovalResponse

类型 object
说明 A response to an MCP approval request.
字段 必填 类型 枚举/常量 说明
approval_request_id string - The ID of the approval request being answered.
approve boolean - Whether the request was approved.
id string | null - -
reason string | null - -
type string mcp_approval_response The type of the item. Always mcp_approval_response.

MCPApprovalResponseResource

类型 object
说明 A response to an MCP approval request.
字段 必填 类型 枚举/常量 说明
approval_request_id string - The ID of the approval request being answered.
approve boolean - Whether the request was approved.
id string - The unique ID of the approval response
reason string | null - -
type string mcp_approval_response The type of the item. Always mcp_approval_response.

MCPListTools

类型 object
说明 A list of tools available on an MCP server.
字段 必填 类型 枚举/常量 说明
error string | null - -
id string - The unique ID of the list.
server_label string - The label of the MCP server.
tools array<MCPListToolsTool> - The tools available on the server.
type string mcp_list_tools The type of the item. Always mcp_list_tools.

MCPListToolsTool

类型 object
说明 A tool available on an MCP server.
字段 必填 类型 枚举/常量 说明
annotations object | null - -
description string | null - -
input_schema object - The JSON schema describing the tool's input.
name string - The name of the tool.

MCPTool

类型 object
说明 Give the model access to additional tools via remote Model Context Protocol (MCP) servers. Learn more about MCP.
字段 必填 类型 枚举/常量 说明
allowed_tools array<string> | MCPToolFilter | null - -
authorization string - An OAuth access token that can be used with a remote MCP server, either with a custom MCP server URL or a service connector. Your application must handle the OAuth authorization f…
connector_id string connector_dropbox, connector_gmail, connector_googlecalendar, connector_googledrive, connector_microsoftteams, connector_outlookcalendar, connector_outlookemail, connector_sharepoint Identifier for service connectors, like those available in ChatGPT. One of server_url or connector_id must be provided. Learn more about service connectors [here](/docs/guides/too…
defer_loading boolean - Whether this MCP tool is deferred and discovered via tool search.
headers object/map<string, string> | null - -
require_approval object | string | null - -
server_description string - Optional description of the MCP server, used to provide more context.
server_label string - A label for this MCP server, used to identify it in tool calls.
server_url string(uri) - The URL for the MCP server. One of server_url or connector_id must be provided.
type string mcp The type of the MCP tool. Always mcp.

MCPToolCall

类型 object
说明 An invocation of a tool on an MCP server.
字段 必填 类型 枚举/常量 说明
approval_request_id string | null - -
arguments string - A JSON string of the arguments passed to the tool.
error string | null - -
id string - The unique ID of the tool call.
name string - The name of the tool that was run.
output string | null - -
server_label string - The label of the MCP server running the tool.
status MCPToolCallStatus - The status of the tool call. One of in_progress, completed, incomplete, calling, or failed.
type string mcp_call The type of the item. Always mcp_call.

MCPToolCallStatus

类型 string
说明 -

MCPToolFilter

类型 object
说明 A filter object to specify which tools are allowed.
字段 必填 类型 枚举/常量 说明
read_only boolean - Indicates whether or not a tool modifies data or is read-only. If an MCP server is [annotated with readOnlyHint](https://modelcontextprotocol.io/specification/2025-06-18/schema#to…
tool_names array<string> - List of allowed tool names.

Message

类型 object
说明 A message to or from the model.
字段 必填 类型 枚举/常量 说明
content array<InputTextContent | OutputTextContent | TextContent | SummaryTextContent | ReasoningTextContent | RefusalContent | InputImageContent | ComputerScreenshotContent … (+1)> - The content of the message
id string - The unique ID of the message.
phase MessagePhase-2 | null - -
role MessageRole - The role of the message. One of unknown, user, assistant, system, critic, discriminator, developer, or tool.
status MessageStatus - The status of item. One of in_progress, completed, or incomplete. Populated when items are returned via API.
type string message The type of the message. Always set to message.

MessagePhase

类型 string
说明 Labels an assistant message as intermediate commentary (commentary) or the final answer (final_answer). For models like gpt-5.3-codex and beyond, when sending follow-up requests, …

MessagePhase-2

类型 string
说明 -

MessageRole

类型 string
说明 -

MessageStatus

类型 string
说明 -

Metadata

类型 object/map<string, string> | null
说明 -
组合 anyOf
变体 类型 说明
1 object/map<string, string> Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format, and querying for object…
2 null -

ModelIdsCompaction

类型 ModelIdsResponses | string | null
说明 Model ID used to generate the response, like gpt-5 or o3. OpenAI offers a wide range of models with different capabilities, performance characteristics, and price points. Refer to…
组合 anyOf
变体 类型 说明
1 ModelIdsResponses -
2 string -
3 null -

ModelIdsResponses

类型 ModelIdsShared | string
说明 -
组合 anyOf
变体 类型 说明
1 ModelIdsShared -
2 string -

ModelIdsShared

类型 string | string
说明 -
组合 anyOf
变体 类型 说明
1 string -
2 string -

ModelResponseProperties

类型 object
说明 -
字段 必填 类型 枚举/常量 说明
metadata Metadata - -
prompt_cache_key string - Used by OpenAI to cache responses for similar requests to optimize your cache hit rates. Replaces the user field. Learn more.
prompt_cache_retention string | null - -
safety_identifier string - A stable identifier used to help detect users of your application that may be violating OpenAI's usage policies. The IDs should be a string that uniquely identifies each user, wit…
service_tier ServiceTier - -
temperature number | null - -
top_logprobs integer | null - -
top_p number | null - -
user string - This field is being replaced by safety_identifier and prompt_cache_key. Use prompt_cache_key instead to maintain caching optimizations. A stable identifier for your end-users. Use…

MoveParam

类型 object
说明 A mouse move action.
字段 必填 类型 枚举/常量 说明
keys array<string> | null - -
type string move Specifies the event type. For a move action, this property is always set to move.
x integer - The x-coordinate to move to.
y integer - The y-coordinate to move to.

NamespaceToolParam

类型 object
说明 Groups function/custom tools under a shared namespace.
字段 必填 类型 枚举/常量 说明
description string - A description of the namespace shown to the model.
name string - The namespace name used in tool calls (for example, crm).
tools array<FunctionToolParam | CustomToolParam> - The function/custom tools available inside this namespace.
type string namespace The type of the tool. Always namespace.

OutputContent

类型 OutputTextContent | RefusalContent | ReasoningTextContent
说明 -
组合 oneOf
变体 类型 说明
1 OutputTextContent -
2 RefusalContent -
3 ReasoningTextContent -

OutputItem

类型 OutputMessage | FileSearchToolCall | FunctionToolCall | FunctionToolCallOutputResource | WebSearchToolCall | ComputerToolCall | ComputerToolCallOutputResource | ReasoningItem … (+18)
说明 -
组合 oneOf
变体 类型 说明
1 OutputMessage -
2 FileSearchToolCall -
3 FunctionToolCall -
4 FunctionToolCallOutputResource -
5 WebSearchToolCall -
6 ComputerToolCall -
7 ComputerToolCallOutputResource -
8 ReasoningItem -
9 ToolSearchCall -
10 ToolSearchOutput -
11 AdditionalTools -
12 CompactionBody -
13 ImageGenToolCall -
14 CodeInterpreterToolCall -
15 LocalShellToolCall -
16 LocalShellToolCallOutput -
17 FunctionShellCall -
18 FunctionShellCallOutput -
19 ApplyPatchToolCall -
20 ApplyPatchToolCallOutput -
21 MCPToolCall -
22 MCPListTools -
23 MCPApprovalRequest -
24 MCPApprovalResponseResource -
25 CustomToolCall -
26 CustomToolCallOutputResource -

OutputMessage

类型 object
说明 An output message from the model.
字段 必填 类型 枚举/常量 说明
content array<OutputMessageContent> - The content of the output message.
id string - The unique ID of the output message.
phase MessagePhase | null - -
role string assistant The role of the output message. Always assistant.
status string in_progress, completed, incomplete The status of the message input. One of in_progress, completed, or incomplete. Populated when input items are returned via API.
type string message The type of the output message. Always message.

OutputMessageContent

类型 OutputTextContent | RefusalContent
说明 -
组合 oneOf
变体 类型 说明
1 OutputTextContent -
2 RefusalContent -

OutputTextContent

类型 object
说明 A text output from the model.
字段 必填 类型 枚举/常量 说明
annotations array<Annotation> - The annotations of the text output.
logprobs array<LogProb> - -
text string - The text output from the model.
type string output_text The type of the output text. Always output_text.

ParallelToolCalls

类型 boolean
说明 Whether to enable parallel function calling during tool use.

PartialImages

类型 integer | null
说明 -
组合 anyOf
变体 类型 说明
1 integer The number of partial images to generate. This parameter is used for streaming responses that return partial images. Value must be between 0 and 3. When set to 0, the response wil…
2 null -

PredictionContent

类型 object
说明 Static predicted output content, such as the content of a text file that is being regenerated.
字段 必填 类型 枚举/常量 说明
content string | array<ChatCompletionRequestMessageContentPartText> - The content that should be matched when generating a model response. If generated tokens would match this content, the entire model response can be returned much more quickly.
type string content The type of the predicted content you want to provide. This type is currently always content.

Prompt

类型 object | null
说明 -
组合 anyOf
变体 类型 说明
1 object Reference to a prompt template and its variables. Learn more.
2 null -

PromptCacheRetentionEnum

类型 string
说明 -

RankerVersionType

类型 string
说明 -

RankingOptions

类型 object
说明 -
字段 必填 类型 枚举/常量 说明
hybrid_search HybridSearchOptions - Weights that control how reciprocal rank fusion balances semantic embedding matches versus sparse keyword matches when hybrid search is enabled.
ranker RankerVersionType - The ranker to use for the file search.
score_threshold number - The score threshold for the file search, a number between 0 and 1. Numbers closer to 1 will attempt to return only the most relevant results, but may return fewer results.

Reasoning

类型 object
说明 gpt-5 and o-series models only Configuration options for reasoning models.
字段 必填 类型 枚举/常量 说明
effort ReasoningEffort - -
generate_summary string | null - -
summary string | null - -

ReasoningEffort

类型 string | null
说明 -
组合 anyOf
变体 类型 说明
1 string Constrains effort on reasoning for reasoning models. Currently supported values are none, minimal, low, medium, high, and xhig…
2 null -

ReasoningItem

类型 object
说明 A description of the chain of thought used by a reasoning model while generating a response. Be sure to include these items in your input to the Responses API for subsequent turns…
字段 必填 类型 枚举/常量 说明
content array<ReasoningTextContent> - Reasoning text content.
encrypted_content string | null - -
id string - The unique identifier of the reasoning content.
status string in_progress, completed, incomplete The status of the item. One of in_progress, completed, or incomplete. Populated when items are returned via API.
summary array<SummaryTextContent> - Reasoning summary content.
type string reasoning The type of the object. Always reasoning.

ReasoningTextContent

类型 object
说明 Reasoning text from the model.
字段 必填 类型 枚举/常量 说明
text string - The reasoning text from the model.
type string reasoning_text The type of the reasoning text. Always reasoning_text.

RefusalContent

类型 object
说明 A refusal from the model.
字段 必填 类型 枚举/常量 说明
refusal string - The refusal explanation from the model.
type string refusal The type of the refusal. Always refusal.

Response

类型 ModelResponseProperties & ResponseProperties & object
说明 -
组合 allOf
变体 类型 说明
1 ModelResponseProperties -
2 ResponseProperties -
3 object -

allOf 展开字段

字段 必填 类型 枚举/常量 来源 说明
background boolean | null - ResponseProperties -
completed_at number(unixtime) | null - Response.allOf[3] -
conversation Conversation-2 | null - Response.allOf[3] -
created_at number(unixtime) - Response.allOf[3] Unix timestamp (in seconds) of when this Response was created.
error ResponseError - Response.allOf[3] -
id string - Response.allOf[3] Unique identifier for this Response.
incomplete_details object | null - Response.allOf[3] -
instructions string | array<InputItem> | null - Response.allOf[3] -
max_output_tokens integer | null - Response.allOf[3] -
max_tool_calls integer | null - ResponseProperties -
metadata Metadata - ModelResponseProperties -
model ModelIdsResponses - ResponseProperties Model ID used to generate the response, like gpt-4o or o3. OpenAI offers a wide range of models with different capabilities, performance characteristics, and price points. Refer t…
object string response Response.allOf[3] The object type of this resource - always set to response.
output array<OutputItem> - Response.allOf[3] An array of content items generated by the model. - The length and order of items in the output array is dependent on the model's response. - Rather than accessing the first item …
output_text string | null - Response.allOf[3] -
parallel_tool_calls boolean - Response.allOf[3] Whether to allow the model to run tool calls in parallel.
previous_response_id string | null - ResponseProperties -
prompt Prompt - ResponseProperties -
prompt_cache_key string - ModelResponseProperties Used by OpenAI to cache responses for similar requests to optimize your cache hit rates. Replaces the user field. Learn more.
prompt_cache_retention string | null - ModelResponseProperties -
reasoning Reasoning | null - ResponseProperties -
safety_identifier string - ModelResponseProperties A stable identifier used to help detect users of your application that may be violating OpenAI's usage policies. The IDs should be a string that uniquely identifies each user, wit…
service_tier ServiceTier - ModelResponseProperties -
status string completed, failed, in_progress, cancelled, queued, incomplete Response.allOf[3] The status of the response generation. One of completed, failed, in_progress, cancelled, queued, or incomplete.
temperature number | null - ModelResponseProperties -
text ResponseTextParam - ResponseProperties -
tool_choice ToolChoiceParam - ResponseProperties -
tools ToolsArray - ResponseProperties -
top_logprobs integer | null - ModelResponseProperties -
top_p number | null - ModelResponseProperties -
truncation string | null - ResponseProperties -
usage ResponseUsage - Response.allOf[3] -
user string - ModelResponseProperties This field is being replaced by safety_identifier and prompt_cache_key. Use prompt_cache_key instead to maintain caching optimizations. A stable identifier for your end-users. Use…

ResponseAudioDeltaEvent

类型 object
说明 Emitted when there is a partial audio response.
字段 必填 类型 枚举/常量 说明
delta string - A chunk of Base64 encoded response audio bytes.
sequence_number integer - A sequence number for this chunk of the stream response.
type string response.audio.delta The type of the event. Always response.audio.delta.

ResponseAudioDoneEvent

类型 object
说明 Emitted when the audio response is complete.
字段 必填 类型 枚举/常量 说明
sequence_number integer - The sequence number of the delta.
type string response.audio.done The type of the event. Always response.audio.done.

ResponseAudioTranscriptDeltaEvent

类型 object
说明 Emitted when there is a partial transcript of audio.
字段 必填 类型 枚举/常量 说明
delta string - The partial transcript of the audio response.
sequence_number integer - The sequence number of this event.
type string response.audio.transcript.delta The type of the event. Always response.audio.transcript.delta.

ResponseAudioTranscriptDoneEvent

类型 object
说明 Emitted when the full audio transcript is completed.
字段 必填 类型 枚举/常量 说明
sequence_number integer - The sequence number of this event.
type string response.audio.transcript.done The type of the event. Always response.audio.transcript.done.

ResponseCodeInterpreterCallCodeDeltaEvent

类型 object
说明 Emitted when a partial code snippet is streamed by the code interpreter.
字段 必填 类型 枚举/常量 说明
delta string - The partial code snippet being streamed by the code interpreter.
item_id string - The unique identifier of the code interpreter tool call item.
output_index integer - The index of the output item in the response for which the code is being streamed.
sequence_number integer - The sequence number of this event, used to order streaming events.
type string response.code_interpreter_call_code.delta The type of the event. Always response.code_interpreter_call_code.delta.

ResponseCodeInterpreterCallCodeDoneEvent

类型 object
说明 Emitted when the code snippet is finalized by the code interpreter.
字段 必填 类型 枚举/常量 说明
code string - The final code snippet output by the code interpreter.
item_id string - The unique identifier of the code interpreter tool call item.
output_index integer - The index of the output item in the response for which the code is finalized.
sequence_number integer - The sequence number of this event, used to order streaming events.
type string response.code_interpreter_call_code.done The type of the event. Always response.code_interpreter_call_code.done.

ResponseCodeInterpreterCallCompletedEvent

类型 object
说明 Emitted when the code interpreter call is completed.
字段 必填 类型 枚举/常量 说明
item_id string - The unique identifier of the code interpreter tool call item.
output_index integer - The index of the output item in the response for which the code interpreter call is completed.
sequence_number integer - The sequence number of this event, used to order streaming events.
type string response.code_interpreter_call.completed The type of the event. Always response.code_interpreter_call.completed.

ResponseCodeInterpreterCallInProgressEvent

类型 object
说明 Emitted when a code interpreter call is in progress.
字段 必填 类型 枚举/常量 说明
item_id string - The unique identifier of the code interpreter tool call item.
output_index integer - The index of the output item in the response for which the code interpreter call is in progress.
sequence_number integer - The sequence number of this event, used to order streaming events.
type string response.code_interpreter_call.in_progress The type of the event. Always response.code_interpreter_call.in_progress.

ResponseCodeInterpreterCallInterpretingEvent

类型 object
说明 Emitted when the code interpreter is actively interpreting the code snippet.
字段 必填 类型 枚举/常量 说明
item_id string - The unique identifier of the code interpreter tool call item.
output_index integer - The index of the output item in the response for which the code interpreter is interpreting code.
sequence_number integer - The sequence number of this event, used to order streaming events.
type string response.code_interpreter_call.interpreting The type of the event. Always response.code_interpreter_call.interpreting.

ResponseCompletedEvent

类型 object
说明 Emitted when the model response is complete.
字段 必填 类型 枚举/常量 说明
response Response - Properties of the completed response.
sequence_number integer - The sequence number for this event.
type string response.completed The type of the event. Always response.completed.

ResponseContentPartAddedEvent

类型 object
说明 Emitted when a new content part is added.
字段 必填 类型 枚举/常量 说明
content_index integer - The index of the content part that was added.
item_id string - The ID of the output item that the content part was added to.
output_index integer - The index of the output item that the content part was added to.
part OutputContent - The content part that was added.
sequence_number integer - The sequence number of this event.
type string response.content_part.added The type of the event. Always response.content_part.added.

ResponseContentPartDoneEvent

类型 object
说明 Emitted when a content part is done.
字段 必填 类型 枚举/常量 说明
content_index integer - The index of the content part that is done.
item_id string - The ID of the output item that the content part was added to.
output_index integer - The index of the output item that the content part was added to.
part OutputContent - The content part that is done.
sequence_number integer - The sequence number of this event.
type string response.content_part.done The type of the event. Always response.content_part.done.

ResponseCreatedEvent

类型 object
说明 An event that is emitted when a response is created.
字段 必填 类型 枚举/常量 说明
response Response - The response that was created.
sequence_number integer - The sequence number for this event.
type string response.created The type of the event. Always response.created.

ResponseCustomToolCallInputDeltaEvent

类型 object
说明 Event representing a delta (partial update) to the input of a custom tool call.
字段 必填 类型 枚举/常量 说明
delta string - The incremental input data (delta) for the custom tool call.
item_id string - Unique identifier for the API item associated with this event.
output_index integer - The index of the output this delta applies to.
sequence_number integer - The sequence number of this event.
type string response.custom_tool_call_input.delta The event type identifier.

ResponseCustomToolCallInputDoneEvent

类型 object
说明 Event indicating that input for a custom tool call is complete.
字段 必填 类型 枚举/常量 说明
input string - The complete input data for the custom tool call.
item_id string - Unique identifier for the API item associated with this event.
output_index integer - The index of the output this event applies to.
sequence_number integer - The sequence number of this event.
type string response.custom_tool_call_input.done The event type identifier.

ResponseError

类型 object | null
说明 -
组合 anyOf
变体 类型 说明
1 object An error object returned when the model fails to generate a Response.
2 null -

ResponseErrorCode

类型 string
说明 The error code for the response.

ResponseErrorEvent

类型 object
说明 Emitted when an error occurs.
字段 必填 类型 枚举/常量 说明
code string | null - -
message string - The error message.
param string | null - -
sequence_number integer - The sequence number of this event.
type string error The type of the event. Always error.

ResponseFailedEvent

类型 object
说明 An event that is emitted when a response fails.
字段 必填 类型 枚举/常量 说明
response Response - The response that failed.
sequence_number integer - The sequence number of this event.
type string response.failed The type of the event. Always response.failed.

ResponseFileSearchCallCompletedEvent

类型 object
说明 Emitted when a file search call is completed (results found).
字段 必填 类型 枚举/常量 说明
item_id string - The ID of the output item that the file search call is initiated.
output_index integer - The index of the output item that the file search call is initiated.
sequence_number integer - The sequence number of this event.
type string response.file_search_call.completed The type of the event. Always response.file_search_call.completed.

ResponseFileSearchCallInProgressEvent

类型 object
说明 Emitted when a file search call is initiated.
字段 必填 类型 枚举/常量 说明
item_id string - The ID of the output item that the file search call is initiated.
output_index integer - The index of the output item that the file search call is initiated.
sequence_number integer - The sequence number of this event.
type string response.file_search_call.in_progress The type of the event. Always response.file_search_call.in_progress.

ResponseFileSearchCallSearchingEvent

类型 object
说明 Emitted when a file search is currently searching.
字段 必填 类型 枚举/常量 说明
item_id string - The ID of the output item that the file search call is initiated.
output_index integer - The index of the output item that the file search call is searching.
sequence_number integer - The sequence number of this event.
type string response.file_search_call.searching The type of the event. Always response.file_search_call.searching.

ResponseFormatJsonObject

类型 object
说明 JSON object response format. An older method of generating JSON responses. Using json_schema is recommended for models that support it. Note that the model will not generate JSON …
字段 必填 类型 枚举/常量 说明
type string json_object The type of response format being defined. Always json_object.

ResponseFormatJsonSchema

类型 object
说明 JSON Schema response format. Used to generate structured JSON responses. Learn more about Structured Outputs.
字段 必填 类型 枚举/常量 说明
json_schema object - Structured Outputs configuration options, including a JSON Schema.
type string json_schema The type of response format being defined. Always json_schema.

ResponseFormatJsonSchemaSchema

类型 object
说明 The schema for the response format, described as a JSON Schema object. Learn how to build JSON schemas here.

Additional properties: 任意 JSON 值

ResponseFormatText

类型 object
说明 Default response format. Used to generate text responses.
字段 必填 类型 枚举/常量 说明
type string text The type of response format being defined. Always text.

ResponseFunctionCallArgumentsDeltaEvent

类型 object
说明 Emitted when there is a partial function-call arguments delta.
字段 必填 类型 枚举/常量 说明
delta string - The function-call arguments delta that is added.
item_id string - The ID of the output item that the function-call arguments delta is added to.
output_index integer - The index of the output item that the function-call arguments delta is added to.
sequence_number integer - The sequence number of this event.
type string response.function_call_arguments.delta The type of the event. Always response.function_call_arguments.delta.

ResponseFunctionCallArgumentsDoneEvent

类型 object
说明 Emitted when function-call arguments are finalized.
字段 必填 类型 枚举/常量 说明
arguments string - The function-call arguments.
item_id string - The ID of the item.
name string - The name of the function that was called.
output_index integer - The index of the output item.
sequence_number integer - The sequence number of this event.
type string response.function_call_arguments.done -

ResponseImageGenCallCompletedEvent

类型 object
说明 Emitted when an image generation tool call has completed and the final image is available.
字段 必填 类型 枚举/常量 说明
item_id string - The unique identifier of the image generation item being processed.
output_index integer - The index of the output item in the response's output array.
sequence_number integer - The sequence number of this event.
type string response.image_generation_call.completed The type of the event. Always 'response.image_generation_call.completed'.

ResponseImageGenCallGeneratingEvent

类型 object
说明 Emitted when an image generation tool call is actively generating an image (intermediate state).
字段 必填 类型 枚举/常量 说明
item_id string - The unique identifier of the image generation item being processed.
output_index integer - The index of the output item in the response's output array.
sequence_number integer - The sequence number of the image generation item being processed.
type string response.image_generation_call.generating The type of the event. Always 'response.image_generation_call.generating'.

ResponseImageGenCallInProgressEvent

类型 object
说明 Emitted when an image generation tool call is in progress.
字段 必填 类型 枚举/常量 说明
item_id string - The unique identifier of the image generation item being processed.
output_index integer - The index of the output item in the response's output array.
sequence_number integer - The sequence number of the image generation item being processed.
type string response.image_generation_call.in_progress The type of the event. Always 'response.image_generation_call.in_progress'.

ResponseImageGenCallPartialImageEvent

类型 object
说明 Emitted when a partial image is available during image generation streaming.
字段 必填 类型 枚举/常量 说明
item_id string - The unique identifier of the image generation item being processed.
output_index integer - The index of the output item in the response's output array.
partial_image_b64 string - Base64-encoded partial image data, suitable for rendering as an image.
partial_image_index integer - 0-based index for the partial image (backend is 1-based, but this is 0-based for the user).
sequence_number integer - The sequence number of the image generation item being processed.
type string response.image_generation_call.partial_image The type of the event. Always 'response.image_generation_call.partial_image'.

ResponseInProgressEvent

类型 object
说明 Emitted when the response is in progress.
字段 必填 类型 枚举/常量 说明
response Response - The response that is in progress.
sequence_number integer - The sequence number of this event.
type string response.in_progress The type of the event. Always response.in_progress.

ResponseIncompleteEvent

类型 object
说明 An event that is emitted when a response finishes as incomplete.
字段 必填 类型 枚举/常量 说明
response Response - The response that was incomplete.
sequence_number integer - The sequence number of this event.
type string response.incomplete The type of the event. Always response.incomplete.

ResponseLogProb

类型 object
说明 A logprob is the logarithmic probability that the model assigns to producing a particular token at a given position in the sequence. Less-negative (higher) logprob values indicate…
字段 必填 类型 枚举/常量 说明
logprob number - The log probability of this token.
token string - A possible text token.
top_logprobs array<object> - The log probabilities of up to 20 of the most likely tokens.

ResponseMCPCallArgumentsDeltaEvent

类型 object
说明 Emitted when there is a delta (partial update) to the arguments of an MCP tool call.
字段 必填 类型 枚举/常量 说明
delta string - A JSON string containing the partial update to the arguments for the MCP tool call.
item_id string - The unique identifier of the MCP tool call item being processed.
output_index integer - The index of the output item in the response's output array.
sequence_number integer - The sequence number of this event.
type string response.mcp_call_arguments.delta The type of the event. Always 'response.mcp_call_arguments.delta'.

ResponseMCPCallArgumentsDoneEvent

类型 object
说明 Emitted when the arguments for an MCP tool call are finalized.
字段 必填 类型 枚举/常量 说明
arguments string - A JSON string containing the finalized arguments for the MCP tool call.
item_id string - The unique identifier of the MCP tool call item being processed.
output_index integer - The index of the output item in the response's output array.
sequence_number integer - The sequence number of this event.
type string response.mcp_call_arguments.done The type of the event. Always 'response.mcp_call_arguments.done'.

ResponseMCPCallCompletedEvent

类型 object
说明 Emitted when an MCP tool call has completed successfully.
字段 必填 类型 枚举/常量 说明
item_id string - The ID of the MCP tool call item that completed.
output_index integer - The index of the output item that completed.
sequence_number integer - The sequence number of this event.
type string response.mcp_call.completed The type of the event. Always 'response.mcp_call.completed'.

ResponseMCPCallFailedEvent

类型 object
说明 Emitted when an MCP tool call has failed.
字段 必填 类型 枚举/常量 说明
item_id string - The ID of the MCP tool call item that failed.
output_index integer - The index of the output item that failed.
sequence_number integer - The sequence number of this event.
type string response.mcp_call.failed The type of the event. Always 'response.mcp_call.failed'.

ResponseMCPCallInProgressEvent

类型 object
说明 Emitted when an MCP tool call is in progress.
字段 必填 类型 枚举/常量 说明
item_id string - The unique identifier of the MCP tool call item being processed.
output_index integer - The index of the output item in the response's output array.
sequence_number integer - The sequence number of this event.
type string response.mcp_call.in_progress The type of the event. Always 'response.mcp_call.in_progress'.

ResponseMCPListToolsCompletedEvent

类型 object
说明 Emitted when the list of available MCP tools has been successfully retrieved.
必填 类型 枚举/常量 说明
item_id string - The ID of the MCP tool call item that produced this output.
output_index integer - The index of the output item that was processed.
sequence_number integer - The sequence number of this event.
type string response.mcp_list_tools.completed The type of the event. Always 'response.mcp_list_tools.completed'.

ResponseMCPListToolsFailedEvent

类型 object
说明 Emitted when the attempt to list available MCP tools has failed.
字段 必填 类型 枚举/常量 说明
item_id string - The ID of the MCP tool call item that failed.
output_index integer - The index of the output item that failed.
sequence_number integer - The sequence number of this event.
type string response.mcp_list_tools.failed The type of the event. Always 'response.mcp_list_tools.failed'.

ResponseMCPListToolsInProgressEvent

类型 object
说明 Emitted when the system is in the process of retrieving the list of available MCP tools.
字段 必填 类型 枚举/常量 说明
item_id string - The ID of the MCP tool call item that is being processed.
output_index integer - The index of the output item that is being processed.
sequence_number integer - The sequence number of this event.
type string response.mcp_list_tools.in_progress The type of the event. Always 'response.mcp_list_tools.in_progress'.

ResponseModalities

类型 array<string> | null
说明 -
组合 anyOf
变体 类型 说明
1 array<string> Output types that you would like the model to generate. Most models are capable of generating text, which is the default: ["text"] The gpt-4o-audio-preview model can also be used …
2 null -

ResponseOutputItemAddedEvent

类型 object
说明 Emitted when a new output item is added.
字段 必填 类型 枚举/常量 说明
item OutputItem - The output item that was added.
output_index integer - The index of the output item that was added.
sequence_number integer - The sequence number of this event.
type string response.output_item.added The type of the event. Always response.output_item.added.

ResponseOutputItemDoneEvent

类型 object
说明 Emitted when an output item is marked done.
字段 必填 类型 枚举/常量 说明
item OutputItem - The output item that was marked done.
output_index integer - The index of the output item that was marked done.
sequence_number integer - The sequence number of this event.
type string response.output_item.done The type of the event. Always response.output_item.done.

ResponseOutputTextAnnotationAddedEvent

类型 object
说明 Emitted when an annotation is added to output text content.
字段 必填 类型 枚举/常量 说明
annotation object - The annotation object being added. (See annotation schema for details.)
annotation_index integer - The index of the annotation within the content part.
content_index integer - The index of the content part within the output item.
item_id string - The unique identifier of the item to which the annotation is being added.
output_index integer - The index of the output item in the response's output array.
sequence_number integer - The sequence number of this event.
type string response.output_text.annotation.added The type of the event. Always 'response.output_text.annotation.added'.

ResponsePromptVariables

类型 object/map<string, string | InputTextContent | InputImageContent | InputFileContent> | null
说明 -
组合 anyOf
变体 类型 说明
1 object/map<string, string | InputTextContent | InputImageContent | InputFileContent> Optional map of values to substitute in for variables in your prompt. The substitution values can either be strings, or other Response input types like images or files.
2 null -

ResponseProperties

类型 object
说明 -
字段 必填 类型 枚举/常量 说明
background boolean | null - -
max_tool_calls integer | null - -
model ModelIdsResponses - Model ID used to generate the response, like gpt-4o or o3. OpenAI offers a wide range of models with different capabilities, performance characteristics, and price points. Refer t…
previous_response_id string | null - -
prompt Prompt - -
reasoning Reasoning | null - -
text ResponseTextParam - -
tool_choice ToolChoiceParam - -
tools ToolsArray - -
truncation string | null - -

ResponseQueuedEvent

类型 object
说明 Emitted when a response is queued and waiting to be processed.
字段 必填 类型 枚举/常量 说明
response Response - The full response object that is queued.
sequence_number integer - The sequence number for this event.
type string response.queued The type of the event. Always 'response.queued'.

ResponseReasoningSummaryPartAddedEvent

类型 object
说明 Emitted when a new reasoning summary part is added.
字段 必填 类型 枚举/常量 说明
item_id string - The ID of the item this summary part is associated with.
output_index integer - The index of the output item this summary part is associated with.
part object - The summary part that was added.
sequence_number integer - The sequence number of this event.
summary_index integer - The index of the summary part within the reasoning summary.
type string response.reasoning_summary_part.added The type of the event. Always response.reasoning_summary_part.added.

ResponseReasoningSummaryPartDoneEvent

类型 object
说明 Emitted when a reasoning summary part is completed.
字段 必填 类型 枚举/常量 说明
item_id string - The ID of the item this summary part is associated with.
output_index integer - The index of the output item this summary part is associated with.
part object - The completed summary part.
sequence_number integer - The sequence number of this event.
summary_index integer - The index of the summary part within the reasoning summary.
type string response.reasoning_summary_part.done The type of the event. Always response.reasoning_summary_part.done.

ResponseReasoningSummaryTextDeltaEvent

类型 object
说明 Emitted when a delta is added to a reasoning summary text.
字段 必填 类型 枚举/常量 说明
delta string - The text delta that was added to the summary.
item_id string - The ID of the item this summary text delta is associated with.
output_index integer - The index of the output item this summary text delta is associated with.
sequence_number integer - The sequence number of this event.
summary_index integer - The index of the summary part within the reasoning summary.
type string response.reasoning_summary_text.delta The type of the event. Always response.reasoning_summary_text.delta.

ResponseReasoningSummaryTextDoneEvent

类型 object
说明 Emitted when a reasoning summary text is completed.
字段 必填 类型 枚举/常量 说明
item_id string - The ID of the item this summary text is associated with.
output_index integer - The index of the output item this summary text is associated with.
sequence_number integer - The sequence number of this event.
summary_index integer - The index of the summary part within the reasoning summary.
text string - The full text of the completed reasoning summary.
type string response.reasoning_summary_text.done The type of the event. Always response.reasoning_summary_text.done.

ResponseReasoningTextDeltaEvent

类型 object
说明 Emitted when a delta is added to a reasoning text.
字段 必填 类型 枚举/常量 说明
content_index integer - The index of the reasoning content part this delta is associated with.
delta string - The text delta that was added to the reasoning content.
item_id string - The ID of the item this reasoning text delta is associated with.
output_index integer - The index of the output item this reasoning text delta is associated with.
sequence_number integer - The sequence number of this event.
type string response.reasoning_text.delta The type of the event. Always response.reasoning_text.delta.

ResponseReasoningTextDoneEvent

类型 object
说明 Emitted when a reasoning text is completed.
字段 必填 类型 枚举/常量 说明
content_index integer - The index of the reasoning content part.
item_id string - The ID of the item this reasoning text is associated with.
output_index integer - The index of the output item this reasoning text is associated with.
sequence_number integer - The sequence number of this event.
text string - The full text of the completed reasoning content.
type string response.reasoning_text.done The type of the event. Always response.reasoning_text.done.

ResponseRefusalDeltaEvent

类型 object
说明 Emitted when there is a partial refusal text.
字段 必填 类型 枚举/常量 说明
content_index integer - The index of the content part that the refusal text is added to.
delta string - The refusal text that is added.
item_id string - The ID of the output item that the refusal text is added to.
output_index integer - The index of the output item that the refusal text is added to.
sequence_number integer - The sequence number of this event.
type string response.refusal.delta The type of the event. Always response.refusal.delta.

ResponseRefusalDoneEvent

类型 object
说明 Emitted when refusal text is finalized.
字段 必填 类型 枚举/常量 说明
content_index integer - The index of the content part that the refusal text is finalized.
item_id string - The ID of the output item that the refusal text is finalized.
output_index integer - The index of the output item that the refusal text is finalized.
refusal string - The refusal text that is finalized.
sequence_number integer - The sequence number of this event.
type string response.refusal.done The type of the event. Always response.refusal.done.

ResponseStreamEvent

类型 ResponseAudioDeltaEvent | ResponseAudioDoneEvent | ResponseAudioTranscriptDeltaEvent | ResponseAudioTranscriptDoneEvent | ResponseCodeInterpreterCallCodeDeltaEvent | ResponseCodeInterpreterCallCodeDoneEvent | ResponseCodeInterpreterCallCompletedEvent | ResponseCodeInterpreterCallInProgressEvent … (+45)
说明 -
组合 anyOf
变体 类型 说明
1 ResponseAudioDeltaEvent -
2 ResponseAudioDoneEvent -
3 ResponseAudioTranscriptDeltaEvent -
4 ResponseAudioTranscriptDoneEvent -
5 ResponseCodeInterpreterCallCodeDeltaEvent -
6 ResponseCodeInterpreterCallCodeDoneEvent -
7 ResponseCodeInterpreterCallCompletedEvent -
8 ResponseCodeInterpreterCallInProgressEvent -
9 ResponseCodeInterpreterCallInterpretingEvent -
10 ResponseCompletedEvent -
11 ResponseContentPartAddedEvent -
12 ResponseContentPartDoneEvent -
13 ResponseCreatedEvent -
14 ResponseErrorEvent -
15 ResponseFileSearchCallCompletedEvent -
16 ResponseFileSearchCallInProgressEvent -
17 ResponseFileSearchCallSearchingEvent -
18 ResponseFunctionCallArgumentsDeltaEvent -
19 ResponseFunctionCallArgumentsDoneEvent -
20 ResponseInProgressEvent -
21 ResponseFailedEvent -
22 ResponseIncompleteEvent -
23 ResponseOutputItemAddedEvent -
24 ResponseOutputItemDoneEvent -
25 ResponseReasoningSummaryPartAddedEvent -
26 ResponseReasoningSummaryPartDoneEvent -
27 ResponseReasoningSummaryTextDeltaEvent -
28 ResponseReasoningSummaryTextDoneEvent -
29 ResponseReasoningTextDeltaEvent -
30 ResponseReasoningTextDoneEvent -
31 ResponseRefusalDeltaEvent -
32 ResponseRefusalDoneEvent -
33 ResponseTextDeltaEvent -
34 ResponseTextDoneEvent -
35 ResponseWebSearchCallCompletedEvent -
36 ResponseWebSearchCallInProgressEvent -
37 ResponseWebSearchCallSearchingEvent -
38 ResponseImageGenCallCompletedEvent -
39 ResponseImageGenCallGeneratingEvent -
40 ResponseImageGenCallInProgressEvent -
41 ResponseImageGenCallPartialImageEvent -
42 ResponseMCPCallArgumentsDeltaEvent -
43 ResponseMCPCallArgumentsDoneEvent -
44 ResponseMCPCallCompletedEvent -
45 ResponseMCPCallFailedEvent -
46 ResponseMCPCallInProgressEvent -
47 ResponseMCPListToolsCompletedEvent -
48 ResponseMCPListToolsFailedEvent -
49 ResponseMCPListToolsInProgressEvent -
50 ResponseOutputTextAnnotationAddedEvent -
51 ResponseQueuedEvent -
52 ResponseCustomToolCallInputDeltaEvent -
53 ResponseCustomToolCallInputDoneEvent -

ResponseStreamOptions

类型 object | null
说明 -
组合 anyOf
变体 类型 说明
1 object Options for streaming responses. Only set this when you set stream: true.
2 null -

ResponseTextDeltaEvent

类型 object
说明 Emitted when there is an additional text delta.
字段 必填 类型 枚举/常量 说明
content_index integer - The index of the content part that the text delta was added to.
delta string - The text delta that was added.
item_id string - The ID of the output item that the text delta was added to.
logprobs array<ResponseLogProb> - The log probabilities of the tokens in the delta.
output_index integer - The index of the output item that the text delta was added to.
sequence_number integer - The sequence number for this event.
type string response.output_text.delta The type of the event. Always response.output_text.delta.

ResponseTextDoneEvent

类型 object
说明 Emitted when text content is finalized.
字段 必填 类型 枚举/常量 说明
content_index integer - The index of the content part that the text content is finalized.
item_id string - The ID of the output item that the text content is finalized.
logprobs array<ResponseLogProb> - The log probabilities of the tokens in the delta.
output_index integer - The index of the output item that the text content is finalized.
sequence_number integer - The sequence number for this event.
text string - The text content that is finalized.
type string response.output_text.done The type of the event. Always response.output_text.done.

ResponseTextParam

类型 object
说明 Configuration options for a text response from the model. Can be plain text or structured JSON data. Learn more: - Text inputs and outputs - [Structured Outpu…
字段 必填 类型 枚举/常量 说明
format TextResponseFormatConfiguration - -
verbosity Verbosity - -

ResponseUsage

类型 object
说明 Represents token usage details including input tokens, output tokens, a breakdown of output tokens, and the total tokens used.
字段 必填 类型 枚举/常量 说明
input_tokens integer - The number of input tokens.
input_tokens_details object - A detailed breakdown of the input tokens.
output_tokens integer - The number of output tokens.
output_tokens_details object - A detailed breakdown of the output tokens.
total_tokens integer - The total number of tokens used.

ResponseWebSearchCallCompletedEvent

类型 object
说明 Emitted when a web search call is completed.
字段 必填 类型 枚举/常量 说明
item_id string - Unique ID for the output item associated with the web search call.
output_index integer - The index of the output item that the web search call is associated with.
sequence_number integer - The sequence number of the web search call being processed.
type string response.web_search_call.completed The type of the event. Always response.web_search_call.completed.

ResponseWebSearchCallInProgressEvent

类型 object
说明 Emitted when a web search call is initiated.
字段 必填 类型 枚举/常量 说明
item_id string - Unique ID for the output item associated with the web search call.
output_index integer - The index of the output item that the web search call is associated with.
sequence_number integer - The sequence number of the web search call being processed.
type string response.web_search_call.in_progress The type of the event. Always response.web_search_call.in_progress.

ResponseWebSearchCallSearchingEvent

类型 object
说明 Emitted when a web search call is executing.
字段 必填 类型 枚举/常量 说明
item_id string - Unique ID for the output item associated with the web search call.
output_index integer - The index of the output item that the web search call is associated with.
sequence_number integer - The sequence number of the web search call being processed.
type string response.web_search_call.searching The type of the event. Always response.web_search_call.searching.

ScreenshotParam

类型 object
说明 A screenshot action.
字段 必填 类型 枚举/常量 说明
type string screenshot Specifies the event type. For a screenshot action, this property is always set to screenshot.

ScrollParam

类型 object
说明 A scroll action.
字段 必填 类型 枚举/常量 说明
keys array<string> | null - -
scroll_x integer - The horizontal scroll distance.
scroll_y integer - The vertical scroll distance.
type string scroll Specifies the event type. For a scroll action, this property is always set to scroll.
x integer - The x-coordinate where the scroll occurred.
y integer - The y-coordinate where the scroll occurred.

SearchContentType

类型 string
说明 -

SearchContextSize

类型 string
说明 -

ServiceTier

类型 string | null
说明 -
组合 anyOf
变体 类型 说明
1 string Specifies the processing type used for serving the request. - If set to 'auto', then the request will be processed with the service tier configured in the Project settings. Unless…
2 null -

ServiceTierEnum

类型 string
说明 -

SkillReferenceParam

类型 object
说明 -
字段 必填 类型 枚举/常量 说明
skill_id string - The ID of the referenced skill.
type string skill_reference References a skill created with the /v1/skills endpoint.
version string - Optional skill version. Use a positive integer or 'latest'. Omit for default.

SpecificApplyPatchParam

类型 object
说明 Forces the model to call the apply_patch tool when executing a tool call.
字段 必填 类型 枚举/常量 说明
type string apply_patch The tool to call. Always apply_patch.

SpecificFunctionShellParam

类型 object
说明 Forces the model to call the shell tool when a tool call is required.
字段 必填 类型 枚举/常量 说明
type string shell The tool to call. Always shell.

StopConfiguration

类型 string | array<string>
说明 Not supported with latest reasoning models o3 and o4-mini. Up to 4 sequences where the API will stop generating further tokens. The returned text will not contain the stop sequenc…
组合 oneOf
变体 类型 说明
1 string -
2 array<string> -

SummaryTextContent

类型 object
说明 A summary text from the model.
字段 必填 类型 枚举/常量 说明
text string - A summary of the reasoning output from the model so far.
type string summary_text The type of the object. Always summary_text.

TextContent

类型 object
说明 A text content.
字段 必填 类型 枚举/常量 说明
text string - -
type string text -

TextResponseFormatConfiguration

类型 ResponseFormatText | TextResponseFormatJsonSchema | ResponseFormatJsonObject
说明 An object specifying the format that the model must output. Configuring { "type": "json_schema" } enables Structured Outputs, which ensures the model will match your supplied JSON…
组合 oneOf
变体 类型 说明
1 ResponseFormatText -
2 TextResponseFormatJsonSchema -
3 ResponseFormatJsonObject -

TextResponseFormatJsonSchema

类型 object
说明 JSON Schema response format. Used to generate structured JSON responses. Learn more about Structured Outputs.
字段 必填 类型 枚举/常量 说明
description string - A description of what the response format is for, used by the model to determine how to respond in the format.
name string - The name of the response format. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64.
schema ResponseFormatJsonSchemaSchema - -
strict boolean | null - -
type string json_schema The type of response format being defined. Always json_schema.

Tool

类型 FunctionTool | FileSearchTool | ComputerTool | ComputerUsePreviewTool | WebSearchTool | MCPTool | CodeInterpreterTool | ImageGenTool … (+7)
说明 A tool that can be used to generate a response.
组合 oneOf
变体 类型 说明
1 FunctionTool -
2 FileSearchTool -
3 ComputerTool -
4 ComputerUsePreviewTool -
5 WebSearchTool -
6 MCPTool -
7 CodeInterpreterTool -
8 ImageGenTool -
9 LocalShellToolParam -
10 FunctionShellToolParam -
11 CustomToolParam -
12 NamespaceToolParam -
13 ToolSearchToolParam -
14 WebSearchPreviewTool -
15 ApplyPatchToolParam -

ToolChoiceAllowed

类型 object
说明 Constrains the tools available to the model to a pre-defined set.
字段 必填 类型 枚举/常量 说明
mode string auto, required Constrains the tools available to the model to a pre-defined set. auto allows the model to pick from among the allowed tools and generate a message. required requires the model to…
tools array<object> - A list of tool definitions that the model should be allowed to call. For the Responses API, the list of tool definitions might look like:
type string allowed_tools Allowed tool configuration type. Always allowed_tools.

ToolChoiceCustom

类型 object
说明 Use this option to force the model to call a specific custom tool.
字段 必填 类型 枚举/常量 说明
name string - The name of the custom tool to call.
type string custom For custom tool calling, the type is always custom.

ToolChoiceFunction

类型 object
说明 Use this option to force the model to call a specific function.
字段 必填 类型 枚举/常量 说明
name string - The name of the function to call.
type string function For function calling, the type is always function.

ToolChoiceMCP

类型 object
说明 Use this option to force the model to call a specific tool on a remote MCP server.
字段 必填 类型 枚举/常量 说明
name string | null - -
server_label string - The label of the MCP server to use.
type string mcp For MCP tools, the type is always mcp.

ToolChoiceOptions

类型 string
说明 Controls which (if any) tool is called by the model. none means the model will not call any tool and instead generates a message. auto means the model can pick between generating …

ToolChoiceParam

类型 ToolChoiceOptions | ToolChoiceAllowed | ToolChoiceTypes | ToolChoiceFunction | ToolChoiceMCP | ToolChoiceCustom | SpecificApplyPatchParam | SpecificFunctionShellParam
说明 How the model should select which tool (or tools) to use when generating a response. See the tools parameter to see how to specify which tools the model can call.
组合 oneOf
变体 类型 说明
1 ToolChoiceOptions -
2 ToolChoiceAllowed -
3 ToolChoiceTypes -
4 ToolChoiceFunction -
5 ToolChoiceMCP -
6 ToolChoiceCustom -
7 SpecificApplyPatchParam -
8 SpecificFunctionShellParam -

ToolChoiceTypes

类型 object
说明 Indicates that the model should use a built-in tool to generate a response. Learn more about built-in tools.
字段 必填 类型 枚举/常量 说明
type string file_search, web_search_preview, computer, computer_use_preview, computer_use, web_search_preview_2025_03_11, image_generation, code_interpreter The type of hosted tool the model should to use. Learn more about built-in tools. Allowed values are: - file_search - web_search_preview - computer - compute…

ToolSearchCall

类型 object
说明 -
字段 必填 类型 枚举/常量 说明
arguments object/value - Arguments used for the tool search call.
call_id string | null - -
created_by string - The identifier of the actor that created the item.
execution ToolSearchExecutionType - Whether tool search was executed by the server or by the client.
id string - The unique ID of the tool search call item.
status FunctionCallStatus - The status of the tool search call item that was recorded.
type string tool_search_call The type of the item. Always tool_search_call.

ToolSearchCallItemParam

类型 object
说明 -
字段 必填 类型 枚举/常量 说明
arguments EmptyModelParam - The arguments supplied to the tool search call.
call_id string | null - -
execution ToolSearchExecutionType - Whether tool search was executed by the server or by the client.
id string | null - -
status FunctionCallItemStatus | null - -
type string tool_search_call The item type. Always tool_search_call.

ToolSearchExecutionType

类型 string
说明 -

ToolSearchOutput

类型 object
说明 -
字段 必填 类型 枚举/常量 说明
call_id string | null - -
created_by string - The identifier of the actor that created the item.
execution ToolSearchExecutionType - Whether tool search was executed by the server or by the client.
id string - The unique ID of the tool search output item.
status FunctionCallOutputStatusEnum - The status of the tool search output item that was recorded.
tools array<Tool> - The loaded tool definitions returned by tool search.
type string tool_search_output The type of the item. Always tool_search_output.

ToolSearchOutputItemParam

类型 object
说明 -
字段 必填 类型 枚举/常量 说明
call_id string | null - -
execution ToolSearchExecutionType - Whether tool search was executed by the server or by the client.
id string | null - -
status FunctionCallItemStatus | null - -
tools array<Tool> - The loaded tool definitions returned by the tool search output.
type string tool_search_output The item type. Always tool_search_output.

ToolSearchToolParam

类型 object
说明 Hosted or BYOT tool search configuration for deferred tools.
字段 必填 类型 枚举/常量 说明
description string | null - -
execution ToolSearchExecutionType - Whether tool search is executed by the server or by the client.
parameters EmptyModelParam | null - -
type string tool_search The type of the tool. Always tool_search.

ToolsArray

类型 array<Tool>
说明 An array of tools the model may call while generating a response. You can specify which tool to use by setting the tool_choice parameter. We support the following categories of to…

TopLogProb

类型 object
说明 The top log probability of a token.
字段 必填 类型 枚举/常量 说明
bytes array<integer> - -
logprob number - -
token string - -

TypeParam

类型 object
说明 An action to type in text.
字段 必填 类型 枚举/常量 说明
text string - The text to type.
type string type Specifies the event type. For a type action, this property is always set to type.

UrlCitationBody

类型 object
说明 A citation for a web resource used to generate a model response.
字段 必填 类型 枚举/常量 说明
end_index integer - The index of the last character of the URL citation in the message.
start_index integer - The index of the first character of the URL citation in the message.
title string - The title of the web resource.
type string url_citation The type of the URL citation. Always url_citation.
url string(uri) - The URL of the web resource.

VectorStoreFileAttributes

类型 object/map<string, string | number | boolean> | null
说明 -
组合 anyOf
变体 类型 说明
1 object/map<string, string | number | boolean> Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format, and querying for object…
2 null -

Verbosity

类型 string | null
说明 -
组合 anyOf
变体 类型 说明
1 string Constrains the verbosity of the model's response. Lower values will result in more concise responses, while higher values will result in more verbose responses. Currently supporte…
2 null -

VoiceIdsOrCustomVoice

类型 VoiceIdsShared | object
说明 A built-in voice name or a custom voice reference.
组合 anyOf
变体 类型 说明
1 VoiceIdsShared -
2 object Custom voice reference.

VoiceIdsShared

类型 string | string
说明 -
组合 anyOf
变体 类型 说明
1 string -
2 string -

WaitParam

类型 object
说明 A wait action.
字段 必填 类型 枚举/常量 说明
type string wait Specifies the event type. For a wait action, this property is always set to wait.

WebSearchActionFind

类型 object
说明 Action type "find_in_page": Searches for a pattern within a loaded page.
字段 必填 类型 枚举/常量 说明
pattern string - The pattern or text to search for within the page.
type string find_in_page The action type.
url string(uri) - The URL of the page searched for the pattern.

WebSearchActionOpenPage

类型 object
说明 Action type "open_page" - Opens a specific URL from search results.
字段 必填 类型 枚举/常量 说明
type string open_page The action type.
url string(uri) | null - The URL opened by the model.

WebSearchActionSearch

类型 object
说明 Action type "search" - Performs a web search query.
字段 必填 类型 枚举/常量 说明
queries array<string> - The search queries.
query string - The search query.
sources array<object> - The sources used in the search.
type string search The action type.

WebSearchApproximateLocation

类型 object | null
说明 -
组合 anyOf
变体 类型 说明
1 object The approximate location of the user.
2 null -

WebSearchContextSize

类型 string
说明 High level guidance for the amount of context window space to use for the search. One of low, medium, or high. medium is the default.

WebSearchLocation

类型 object
说明 Approximate location parameters for the search.
字段 必填 类型 枚举/常量 说明
city string - Free text input for the city of the user, e.g. San Francisco.
country string - The two-letter ISO country code of the user, e.g. US.
region string - Free text input for the region of the user, e.g. California.
timezone string - The IANA timezone of the user, e.g. America/Los_Angeles.

WebSearchPreviewTool

类型 object
说明 This tool searches the web for relevant results to use in a response. Learn more about the web search tool.
字段 必填 类型 枚举/常量 说明
search_content_types array<SearchContentType> - -
search_context_size SearchContextSize - High level guidance for the amount of context window space to use for the search. One of low, medium, or high. medium is the default.
type string web_search_preview, web_search_preview_2025_03_11 The type of the web search tool. One of web_search_preview or web_search_preview_2025_03_11.
user_location ApproximateLocation | null - -

WebSearchTool

类型 object
说明 Search the Internet for sources related to the prompt. Learn more about the web search tool.
字段 必填 类型 枚举/常量 说明
filters object | null - -
search_context_size string low, medium, high High level guidance for the amount of context window space to use for the search. One of low, medium, or high. medium is the default.
type string web_search, web_search_2025_08_26 The type of the web search tool. One of web_search or web_search_2025_08_26.
user_location WebSearchApproximateLocation - -

WebSearchToolCall

类型 object
说明 The results of a web search tool call. See the web search guide for more information.
字段 必填 类型 枚举/常量 说明
action WebSearchActionSearch | WebSearchActionOpenPage | WebSearchActionFind - An object describing the specific action taken in this web search call. Includes details on how the model used the web (search, open_page, find_in_page).
id string - The unique ID of the web search tool call.
status string in_progress, searching, completed, failed The status of the web search tool call.
type string web_search_call The type of the web search tool call. Always web_search_call.

Claude / Anthropic Endpoints

Method Path Request schema Response schema 说明
POST /v1/messages MessageCreateParams MessageRawMessageStreamEvent 创建非流式或 SSE 流式消息
POST /v1/messages/count_tokens MessageCountTokensParams MessageTokensCount 仅计数,不生成消息

Claude / Anthropic TypeScript 字段表

以下类型从 Anthropic 官方 TypeScript SDK 的 Messages 资源类型递归引用得到,共 164 个。TypeScript union 中的 server tool 版本号是官方 SDK 暴露的字面量类型,实际可用性仍取决于 Anthropic 账号、模型和 beta 配置。

Base64ImageSource

字段 必填 类型
data string
media_type 'image/jpeg' | 'image/png' | 'image/gif' | 'image/webp'
type 'base64'

Base64PDFSource

字段 必填 类型
data string
media_type 'application/pdf'
type 'base64'

BashCodeExecutionOutputBlock

字段 必填 类型
file_id string
type 'bash_code_execution_output'

BashCodeExecutionOutputBlockParam

字段 必填 类型
file_id string
type 'bash_code_execution_output'

BashCodeExecutionResultBlock

字段 必填 类型
content Array<BashCodeExecutionOutputBlock>
return_code number
stderr string
stdout string
type 'bash_code_execution_result'

BashCodeExecutionResultBlockParam

字段 必填 类型
content Array<BashCodeExecutionOutputBlockParam>
return_code number
stderr string
stdout string
type 'bash_code_execution_result'

BashCodeExecutionToolResultBlock

字段 必填 类型
content BashCodeExecutionToolResultError | BashCodeExecutionResultBlock
tool_use_id string
type 'bash_code_execution_tool_result'

BashCodeExecutionToolResultBlockParam

字段 必填 类型
content BashCodeExecutionToolResultErrorParam | BashCodeExecutionResultBlockParam
tool_use_id string
type 'bash_code_execution_tool_result'
cache_control CacheControlEphemeral | null

BashCodeExecutionToolResultError

字段 必填 类型
error_code BashCodeExecutionToolResultErrorCode
type 'bash_code_execution_tool_result_error'

BashCodeExecutionToolResultErrorCode

类型别名:\| 'invalid_tool_input' \| 'unavailable' \| 'too_many_requests' \| 'execution_time_exceeded' \| 'output_file_too_large'

BashCodeExecutionToolResultErrorParam

字段 必填 类型
error_code BashCodeExecutionToolResultErrorCode
type 'bash_code_execution_tool_result_error'

CacheControlEphemeral

字段 必填 类型
type 'ephemeral'
ttl '5m' | '1h'

CacheCreation

字段 必填 类型
ephemeral_1h_input_tokens number
ephemeral_5m_input_tokens number

CitationCharLocation

字段 必填 类型
cited_text string
document_index number
document_title string | null
end_char_index number
file_id string | null
start_char_index number
type 'char_location'

CitationCharLocationParam

字段 必填 类型
cited_text string
document_index number
document_title string | null
end_char_index number
start_char_index number
type 'char_location'

CitationContentBlockLocation

字段 必填 类型
cited_text string
document_index number
document_title string | null
end_block_index number
file_id string | null
start_block_index number
type 'content_block_location'

CitationContentBlockLocationParam

字段 必填 类型
cited_text string
document_index number
document_title string | null
end_block_index number
start_block_index number
type 'content_block_location'

CitationPageLocation

字段 必填 类型
cited_text string
document_index number
document_title string | null
end_page_number number
file_id string | null
start_page_number number
type 'page_location'

CitationPageLocationParam

字段 必填 类型
cited_text string
document_index number
document_title string | null
end_page_number number
start_page_number number
type 'page_location'

CitationSearchResultLocationParam

字段 必填 类型
cited_text string
end_block_index number
search_result_index number
source string
start_block_index number
title string | null
type 'search_result_location'

CitationWebSearchResultLocationParam

字段 必填 类型
cited_text string
encrypted_index string
title string | null
type 'web_search_result_location'
url string

CitationsConfig

字段 必填 类型
enabled boolean

CitationsConfigParam

字段 必填 类型
enabled boolean

CitationsDelta

字段 必填 类型
citation | CitationCharLocation | CitationPageLocation | CitationContentBlockLocation | CitationsWebSearchResultLocation | CitationsSearchResultLocation
type 'citations_delta'

CitationsSearchResultLocation

字段 必填 类型
cited_text string
end_block_index number
search_result_index number
source string
start_block_index number
title string | null
type 'search_result_location'

CitationsWebSearchResultLocation

字段 必填 类型
cited_text string
encrypted_index string
title string | null
type 'web_search_result_location'
url string

CodeExecutionOutputBlock

字段 必填 类型
file_id string
type 'code_execution_output'

CodeExecutionOutputBlockParam

字段 必填 类型
file_id string
type 'code_execution_output'

CodeExecutionResultBlock

字段 必填 类型
content Array<CodeExecutionOutputBlock>
return_code number
stderr string
stdout string
type 'code_execution_result'

CodeExecutionResultBlockParam

字段 必填 类型
content Array<CodeExecutionOutputBlockParam>
return_code number
stderr string
stdout string
type 'code_execution_result'

CodeExecutionTool20250522

字段 必填 类型
name 'code_execution'
type 'code_execution_20250522'
allowed_callers Array<'direct' | 'code_execution_20250825' | 'code_execution_20260120'>
cache_control CacheControlEphemeral | null
defer_loading boolean
strict boolean

CodeExecutionTool20250825

字段 必填 类型
name 'code_execution'
type 'code_execution_20250825'
allowed_callers Array<'direct' | 'code_execution_20250825' | 'code_execution_20260120'>
cache_control CacheControlEphemeral | null
defer_loading boolean
strict boolean

CodeExecutionTool20260120

字段 必填 类型
name 'code_execution'
type 'code_execution_20260120'
allowed_callers Array<'direct' | 'code_execution_20250825' | 'code_execution_20260120'>
cache_control CacheControlEphemeral | null
defer_loading boolean
strict boolean

CodeExecutionToolResultBlock

字段 必填 类型
content CodeExecutionToolResultBlockContent
tool_use_id string
type 'code_execution_tool_result'

CodeExecutionToolResultBlockContent

类型别名:\| CodeExecutionToolResultError \| CodeExecutionResultBlock \| EncryptedCodeExecutionResultBlock

CodeExecutionToolResultBlockParam

字段 必填 类型
content CodeExecutionToolResultBlockParamContent
tool_use_id string
type 'code_execution_tool_result'
cache_control CacheControlEphemeral | null

CodeExecutionToolResultBlockParamContent

类型别名:\| CodeExecutionToolResultErrorParam \| CodeExecutionResultBlockParam \| EncryptedCodeExecutionResultBlockParam

CodeExecutionToolResultError

字段 必填 类型
error_code CodeExecutionToolResultErrorCode
type 'code_execution_tool_result_error'

CodeExecutionToolResultErrorCode

类型别名:\| 'invalid_tool_input' \| 'unavailable' \| 'too_many_requests' \| 'execution_time_exceeded'

CodeExecutionToolResultErrorParam

字段 必填 类型
error_code CodeExecutionToolResultErrorCode
type 'code_execution_tool_result_error'

Container

字段 必填 类型
id string
expires_at string

ContainerUploadBlock

字段 必填 类型
file_id string
type 'container_upload'

ContainerUploadBlockParam

字段 必填 类型
file_id string
type 'container_upload'
cache_control CacheControlEphemeral | null

ContentBlock

类型别名:\| TextBlock \| ThinkingBlock \| RedactedThinkingBlock \| ToolUseBlock \| ServerToolUseBlock \| WebSearchToolResultBlock \| WebFetchToolResultBlock \| CodeExecutionToolResultBlock \| BashCodeExecutionToolResultBlock \| TextEditorCodeExecutionToolResultBlock \| ToolSearchToolResultBlock \| ContainerUploadBlock

ContentBlockParam

类型别名:\| TextBlockParam \| ImageBlockParam \| DocumentBlockParam \| SearchResultBlockParam \| ThinkingBlockParam \| RedactedThinkingBlockParam \| ToolUseBlockParam \| ToolResultBlockParam \| ServerToolUseBlockParam \| WebSearchToolResultBlockParam \| WebFetchToolResultBlockParam \| CodeExecutionToolResultBlockParam \| BashCodeExecutionToolResultBlockParam \| TextEditorCodeExecutionToolResultBlockParam \| ToolSearchToolResultBlockParam \| ContainerUploadBlockParam \| MidConversationSystemBlockParam

ContentBlockSource

字段 必填 类型
content string | Array<ContentBlockSourceContent>
type 'content'

ContentBlockSourceContent

类型别名:TextBlockParam \| ImageBlockParam

DirectCaller

字段 必填 类型
type 'direct'

DocumentBlock

字段 必填 类型
citations CitationsConfig | null
source Base64PDFSource | PlainTextSource
title string | null
type 'document'

DocumentBlockParam

字段 必填 类型
source Base64PDFSource | PlainTextSource | ContentBlockSource | URLPDFSource
type 'document'
cache_control CacheControlEphemeral | null
citations CitationsConfigParam | null
context string | null
title string | null

EncryptedCodeExecutionResultBlock

字段 必填 类型
content Array<CodeExecutionOutputBlock>
encrypted_stdout string
return_code number
stderr string
type 'encrypted_code_execution_result'

EncryptedCodeExecutionResultBlockParam

字段 必填 类型
content Array<CodeExecutionOutputBlockParam>
encrypted_stdout string
return_code number
stderr string
type 'encrypted_code_execution_result'

ImageBlockParam

字段 必填 类型
source Base64ImageSource | URLImageSource
type 'image'
cache_control CacheControlEphemeral | null

InputJSONDelta

字段 必填 类型
partial_json string
type 'input_json_delta'

JSONOutputFormat

字段 必填 类型
schema { [key: string]: unknown }
type 'json_schema'

MemoryTool20250818

字段 必填 类型
name 'memory'
type 'memory_20250818'
allowed_callers Array<'direct' | 'code_execution_20250825' | 'code_execution_20260120'>
cache_control CacheControlEphemeral | null
defer_loading boolean
input_examples Array<{ [key: string]: unknown }>
strict boolean

Message

字段 必填 类型
id string
container Container | null
content Array<ContentBlock>
model Model
role 'assistant'
stop_details RefusalStopDetails | null
stop_reason StopReason | null
stop_sequence string | null
type 'message'
usage Usage

MessageCountTokensParams

字段 必填 类型
messages Array<MessageParam>
model Model
cache_control CacheControlEphemeral | null
output_config OutputConfig
system string | Array<TextBlockParam>
thinking ThinkingConfigParam
tool_choice ToolChoice
tools Array<MessageCountTokensTool>

MessageCountTokensTool

类型别名:\| Tool \| ToolBash20250124 \| CodeExecutionTool20250522 \| CodeExecutionTool20250825 \| CodeExecutionTool20260120 \| MemoryTool20250818 \| ToolTextEditor20250124 \| ToolTextEditor20250429 \| ToolTextEditor20250728 \| WebSearchTool20250305 \| WebFetchTool20250910 \| WebSearchTool20260209 \| WebFetchTool20260209 \| WebFetchTool20260309 \| ToolSearchToolBm25_20251119 \| ToolSearchToolRegex20251119

MessageCreateParams

类型别名:MessageCreateParamsNonStreaming \| MessageCreateParamsStreaming

MessageCreateParamsBase

字段 必填 类型
max_tokens number
messages Array<MessageParam>
model Model
cache_control CacheControlEphemeral | null
container string | null
inference_geo string | null
metadata Metadata
output_config OutputConfig
service_tier 'auto' | 'standard_only'
stop_sequences Array<string>
stream boolean
system string | Array<TextBlockParam>
temperature number
thinking ThinkingConfigParam
tool_choice ToolChoice
tools Array<ToolUnion>
top_k number
top_p number

MessageCreateParamsNonStreaming

字段 必填 类型
stream false

MessageCreateParamsStreaming

字段 必填 类型
stream true

MessageDeltaUsage

字段 必填 类型
cache_creation_input_tokens number | null
cache_read_input_tokens number | null
input_tokens number | null
output_tokens number
output_tokens_details OutputTokensDetails | null
server_tool_use ServerToolUsage | null

MessageParam

字段 必填 类型
content string | Array<ContentBlockParam>
role 'user' | 'assistant' | 'system'

MessageTokensCount

字段 必填 类型
input_tokens number

Metadata

字段 必填 类型
user_id string | null

MidConversationSystemBlockParam

字段 必填 类型
content Array<TextBlockParam>
type 'mid_conv_system'
cache_control CacheControlEphemeral | null

Model

类型别名:\| 'claude-opus-4-8' \| 'claude-opus-4-7' \| 'claude-mythos-preview' \| 'claude-opus-4-6' \| 'claude-sonnet-4-6' \| 'claude-haiku-4-5' \| 'claude-haiku-4-5-20251001' \| 'claude-opus-4-5' \| 'claude-opus-4-5-20251101' \| 'claude-sonnet-4-5' \| 'claude-sonnet-4-5-20250929' \| 'claude-opus-4-1' \| 'claude-opus-4-1-20250805' \| 'claude-opus-4-0' \| 'claude-opus-4-20250514' \| 'claude-sonnet-4-0' \| 'claude-sonnet-4-20250514' \| 'claude-3-haiku-20240307' \| (string & {})

OutputConfig

字段 必填 类型
effort 'low' | 'medium' | 'high' | 'xhigh' | 'max' | null
format JSONOutputFormat | null

OutputTokensDetails

字段 必填 类型
thinking_tokens number

PlainTextSource

字段 必填 类型
data string
media_type 'text/plain'
type 'text'

RawContentBlockDelta

类型别名:\| TextDelta \| InputJSONDelta \| CitationsDelta \| ThinkingDelta \| SignatureDelta

RawContentBlockDeltaEvent

字段 必填 类型
delta RawContentBlockDelta
index number
type 'content_block_delta'

RawContentBlockStartEvent

字段 必填 类型
content_block | TextBlock | ThinkingBlock | RedactedThinkingBlock | ToolUseBlock | ServerToolUseBlock | WebSearchToolResultBlock | WebFetchToolResultBlock | CodeExecutionToolResultBlock | BashCodeExecutionToolResultBlock | TextEditorCodeExecutionToolResultBlock | ToolSearchToolResultBlock | ContainerUploadBlock
index number
type 'content_block_start'

RawContentBlockStopEvent

字段 必填 类型
index number
type 'content_block_stop'

RawMessageDeltaEvent

字段 必填 类型
delta RawMessageDeltaEvent.Delta
type 'message_delta'
usage MessageDeltaUsage

RawMessageStartEvent

字段 必填 类型
message Message
type 'message_start'

RawMessageStopEvent

字段 必填 类型
type 'message_stop'

RawMessageStreamEvent

类型别名:\| RawMessageStartEvent \| RawMessageDeltaEvent \| RawMessageStopEvent \| RawContentBlockStartEvent \| RawContentBlockDeltaEvent \| RawContentBlockStopEvent

RedactedThinkingBlock

字段 必填 类型
data string
type 'redacted_thinking'

RedactedThinkingBlockParam

字段 必填 类型
data string
type 'redacted_thinking'

RefusalStopDetails

字段 必填 类型
category 'cyber' | 'bio' | null
explanation string | null
type 'refusal'

SearchResultBlockParam

字段 必填 类型
content Array<TextBlockParam>
source string
title string
type 'search_result'
cache_control CacheControlEphemeral | null
citations CitationsConfigParam

ServerToolCaller

字段 必填 类型
tool_id string
type 'code_execution_20250825'

ServerToolCaller20260120

字段 必填 类型
tool_id string
type 'code_execution_20260120'

ServerToolUsage

字段 必填 类型
web_fetch_requests number
web_search_requests number

ServerToolUseBlock

字段 必填 类型
id string
caller DirectCaller | ServerToolCaller | ServerToolCaller20260120
input unknown
name | 'web_search' | 'web_fetch' | 'code_execution' | 'bash_code_execution' | 'text_editor_code_execution' | 'tool_search_tool_regex' | 'tool_search_tool_bm25'
type 'server_tool_use'

ServerToolUseBlockParam

字段 必填 类型
id string
input unknown
name | 'web_search' | 'web_fetch' | 'code_execution' | 'bash_code_execution' | 'text_editor_code_execution' | 'tool_search_tool_regex' | 'tool_search_tool_bm25'
type 'server_tool_use'
cache_control CacheControlEphemeral | null
caller DirectCaller | ServerToolCaller | ServerToolCaller20260120

SignatureDelta

字段 必填 类型
signature string
type 'signature_delta'

StopReason

类型别名:'end_turn' \| 'max_tokens' \| 'stop_sequence' \| 'tool_use' \| 'pause_turn' \| 'refusal'

TextBlock

字段 必填 类型
citations Array<TextCitation> | null
text string
type 'text'

TextBlockParam

字段 必填 类型
text string
type 'text'
cache_control CacheControlEphemeral | null
citations Array<TextCitationParam> | null

TextCitation

类型别名:\| CitationCharLocation \| CitationPageLocation \| CitationContentBlockLocation \| CitationsWebSearchResultLocation \| CitationsSearchResultLocation

TextCitationParam

类型别名:\| CitationCharLocationParam \| CitationPageLocationParam \| CitationContentBlockLocationParam \| CitationWebSearchResultLocationParam \| CitationSearchResultLocationParam

TextDelta

字段 必填 类型
text string
type 'text_delta'

TextEditorCodeExecutionCreateResultBlock

字段 必填 类型
is_file_update boolean
type 'text_editor_code_execution_create_result'

TextEditorCodeExecutionCreateResultBlockParam

字段 必填 类型
is_file_update boolean
type 'text_editor_code_execution_create_result'

TextEditorCodeExecutionStrReplaceResultBlock

字段 必填 类型
lines Array<string> | null
new_lines number | null
new_start number | null
old_lines number | null
old_start number | null
type 'text_editor_code_execution_str_replace_result'

TextEditorCodeExecutionStrReplaceResultBlockParam

字段 必填 类型
type 'text_editor_code_execution_str_replace_result'
lines Array<string> | null
new_lines number | null
new_start number | null
old_lines number | null
old_start number | null

TextEditorCodeExecutionToolResultBlock

字段 必填 类型
content | TextEditorCodeExecutionToolResultError | TextEditorCodeExecutionViewResultBlock | TextEditorCodeExecutionCreateResultBlock | TextEditorCodeExecutionStrReplaceResultBlock
tool_use_id string
type 'text_editor_code_execution_tool_result'

TextEditorCodeExecutionToolResultBlockParam

字段 必填 类型
content | TextEditorCodeExecutionToolResultErrorParam | TextEditorCodeExecutionViewResultBlockParam | TextEditorCodeExecutionCreateResultBlockParam | TextEditorCodeExecutionStrReplaceResultBlockParam
tool_use_id string
type 'text_editor_code_execution_tool_result'
cache_control CacheControlEphemeral | null

TextEditorCodeExecutionToolResultError

字段 必填 类型
error_code TextEditorCodeExecutionToolResultErrorCode
error_message string | null
type 'text_editor_code_execution_tool_result_error'

TextEditorCodeExecutionToolResultErrorCode

类型别名:\| 'invalid_tool_input' \| 'unavailable' \| 'too_many_requests' \| 'execution_time_exceeded' \| 'file_not_found'

TextEditorCodeExecutionToolResultErrorParam

字段 必填 类型
error_code TextEditorCodeExecutionToolResultErrorCode
type 'text_editor_code_execution_tool_result_error'
error_message string | null

TextEditorCodeExecutionViewResultBlock

字段 必填 类型
content string
file_type 'text' | 'image' | 'pdf'
num_lines number | null
start_line number | null
total_lines number | null
type 'text_editor_code_execution_view_result'

TextEditorCodeExecutionViewResultBlockParam

字段 必填 类型
content string
file_type 'text' | 'image' | 'pdf'
type 'text_editor_code_execution_view_result'
num_lines number | null
start_line number | null
total_lines number | null

ThinkingBlock

字段 必填 类型
signature string
thinking string
type 'thinking'

ThinkingBlockParam

字段 必填 类型
signature string
thinking string
type 'thinking'

ThinkingConfigAdaptive

字段 必填 类型
type 'adaptive'
display 'summarized' | 'omitted' | null

ThinkingConfigDisabled

字段 必填 类型
type 'disabled'

ThinkingConfigEnabled

字段 必填 类型
budget_tokens number
type 'enabled'
display 'summarized' | 'omitted' | null

ThinkingConfigParam

类型别名:ThinkingConfigEnabled \| ThinkingConfigDisabled \| ThinkingConfigAdaptive

ThinkingDelta

字段 必填 类型
thinking string
type 'thinking_delta'

Tool

字段 必填 类型
input_schema Tool.InputSchema
name string
allowed_callers Array<'direct' | 'code_execution_20250825' | 'code_execution_20260120'>
cache_control CacheControlEphemeral | null
defer_loading boolean
description string
eager_input_streaming boolean | null
input_examples Array<{ [key: string]: unknown }>
strict boolean
type 'custom' | null

ToolBash20250124

字段 必填 类型
name 'bash'
type 'bash_20250124'
allowed_callers Array<'direct' | 'code_execution_20250825' | 'code_execution_20260120'>
cache_control CacheControlEphemeral | null
defer_loading boolean
input_examples Array<{ [key: string]: unknown }>
strict boolean

ToolChoice

类型别名:ToolChoiceAuto \| ToolChoiceAny \| ToolChoiceTool \| ToolChoiceNone

ToolChoiceAny

字段 必填 类型
type 'any'
disable_parallel_tool_use boolean

ToolChoiceAuto

字段 必填 类型
type 'auto'
disable_parallel_tool_use boolean

ToolChoiceNone

字段 必填 类型
type 'none'

ToolChoiceTool

字段 必填 类型
name string
type 'tool'
disable_parallel_tool_use boolean

ToolReferenceBlock

字段 必填 类型
tool_name string
type 'tool_reference'

ToolReferenceBlockParam

字段 必填 类型
tool_name string
type 'tool_reference'
cache_control CacheControlEphemeral | null

ToolResultBlockParam

字段 必填 类型
tool_use_id string
type 'tool_result'
cache_control CacheControlEphemeral | null
content | string | Array< | TextBlockParam | ImageBlockParam | SearchResultBlockParam | DocumentBlockParam | ToolReferenceBlockParam >
is_error boolean

ToolSearchToolBm25_20251119

字段 必填 类型
name 'tool_search_tool_bm25'
type 'tool_search_tool_bm25_20251119' | 'tool_search_tool_bm25'
allowed_callers Array<'direct' | 'code_execution_20250825' | 'code_execution_20260120'>
cache_control CacheControlEphemeral | null
defer_loading boolean
strict boolean

ToolSearchToolRegex20251119

字段 必填 类型
name 'tool_search_tool_regex'
type 'tool_search_tool_regex_20251119' | 'tool_search_tool_regex'
allowed_callers Array<'direct' | 'code_execution_20250825' | 'code_execution_20260120'>
cache_control CacheControlEphemeral | null
defer_loading boolean
strict boolean

ToolSearchToolResultBlock

字段 必填 类型
content ToolSearchToolResultError | ToolSearchToolSearchResultBlock
tool_use_id string
type 'tool_search_tool_result'

ToolSearchToolResultBlockParam

字段 必填 类型
content ToolSearchToolResultErrorParam | ToolSearchToolSearchResultBlockParam
tool_use_id string
type 'tool_search_tool_result'
cache_control CacheControlEphemeral | null

ToolSearchToolResultError

字段 必填 类型
error_code ToolSearchToolResultErrorCode
error_message string | null
type 'tool_search_tool_result_error'

ToolSearchToolResultErrorCode

类型别名:\| 'invalid_tool_input' \| 'unavailable' \| 'too_many_requests' \| 'execution_time_exceeded'

ToolSearchToolResultErrorParam

字段 必填 类型
error_code ToolSearchToolResultErrorCode
type 'tool_search_tool_result_error'

ToolSearchToolSearchResultBlock

字段 必填 类型
tool_references Array<ToolReferenceBlock>
type 'tool_search_tool_search_result'

ToolSearchToolSearchResultBlockParam

字段 必填 类型
tool_references Array<ToolReferenceBlockParam>
type 'tool_search_tool_search_result'

ToolTextEditor20250124

字段 必填 类型
name 'str_replace_editor'
type 'text_editor_20250124'
allowed_callers Array<'direct' | 'code_execution_20250825' | 'code_execution_20260120'>
cache_control CacheControlEphemeral | null
defer_loading boolean
input_examples Array<{ [key: string]: unknown }>
strict boolean

ToolTextEditor20250429

字段 必填 类型
name 'str_replace_based_edit_tool'
type 'text_editor_20250429'
allowed_callers Array<'direct' | 'code_execution_20250825' | 'code_execution_20260120'>
cache_control CacheControlEphemeral | null
defer_loading boolean
input_examples Array<{ [key: string]: unknown }>
strict boolean

ToolTextEditor20250728

字段 必填 类型
name 'str_replace_based_edit_tool'
type 'text_editor_20250728'
allowed_callers Array<'direct' | 'code_execution_20250825' | 'code_execution_20260120'>
cache_control CacheControlEphemeral | null
defer_loading boolean
input_examples Array<{ [key: string]: unknown }>
max_characters number | null
strict boolean

ToolUnion

类型别名:\| Tool \| ToolBash20250124 \| CodeExecutionTool20250522 \| CodeExecutionTool20250825 \| CodeExecutionTool20260120 \| MemoryTool20250818 \| ToolTextEditor20250124 \| ToolTextEditor20250429 \| ToolTextEditor20250728 \| WebSearchTool20250305 \| WebFetchTool20250910 \| WebSearchTool20260209 \| WebFetchTool20260209 \| WebFetchTool20260309 \| ToolSearchToolBm25_20251119 \| ToolSearchToolRegex20251119

ToolUseBlock

字段 必填 类型
id string
caller DirectCaller | ServerToolCaller | ServerToolCaller20260120
input unknown
name string
type 'tool_use'

ToolUseBlockParam

字段 必填 类型
id string
input unknown
name string
type 'tool_use'
cache_control CacheControlEphemeral | null
caller DirectCaller | ServerToolCaller | ServerToolCaller20260120

URLImageSource

字段 必填 类型
type 'url'
url string

URLPDFSource

字段 必填 类型
type 'url'
url string

Usage

字段 必填 类型
cache_creation CacheCreation | null
cache_creation_input_tokens number | null
cache_read_input_tokens number | null
inference_geo string | null
input_tokens number
output_tokens number
output_tokens_details OutputTokensDetails | null
server_tool_use ServerToolUsage | null
service_tier 'standard' | 'priority' | 'batch' | null

UserLocation

字段 必填 类型
type 'approximate'
city string | null
country string | null
region string | null
timezone string | null

WebFetchBlock

字段 必填 类型
content DocumentBlock
retrieved_at string | null
type 'web_fetch_result'
url string

WebFetchBlockParam

字段 必填 类型
content DocumentBlockParam
type 'web_fetch_result'
url string
retrieved_at string | null

WebFetchTool20250910

字段 必填 类型
name 'web_fetch'
type 'web_fetch_20250910'
allowed_callers Array<'direct' | 'code_execution_20250825' | 'code_execution_20260120'>
allowed_domains Array<string> | null
blocked_domains Array<string> | null
cache_control CacheControlEphemeral | null
citations CitationsConfigParam | null
defer_loading boolean
max_content_tokens number | null
max_uses number | null
strict boolean

WebFetchTool20260209

字段 必填 类型
name 'web_fetch'
type 'web_fetch_20260209'
allowed_callers Array<'direct' | 'code_execution_20250825' | 'code_execution_20260120'>
allowed_domains Array<string> | null
blocked_domains Array<string> | null
cache_control CacheControlEphemeral | null
citations CitationsConfigParam | null
defer_loading boolean
max_content_tokens number | null
max_uses number | null
strict boolean

WebFetchTool20260309

字段 必填 类型
name 'web_fetch'
type 'web_fetch_20260309'
allowed_callers Array<'direct' | 'code_execution_20250825' | 'code_execution_20260120'>
allowed_domains Array<string> | null
blocked_domains Array<string> | null
cache_control CacheControlEphemeral | null
citations CitationsConfigParam | null
defer_loading boolean
max_content_tokens number | null
max_uses number | null
strict boolean
use_cache boolean

WebFetchToolResultBlock

字段 必填 类型
caller DirectCaller | ServerToolCaller | ServerToolCaller20260120
content WebFetchToolResultErrorBlock | WebFetchBlock
tool_use_id string
type 'web_fetch_tool_result'

WebFetchToolResultBlockParam

字段 必填 类型
content WebFetchToolResultErrorBlockParam | WebFetchBlockParam
tool_use_id string
type 'web_fetch_tool_result'
cache_control CacheControlEphemeral | null
caller DirectCaller | ServerToolCaller | ServerToolCaller20260120

WebFetchToolResultErrorBlock

字段 必填 类型
error_code WebFetchToolResultErrorCode
type 'web_fetch_tool_result_error'

WebFetchToolResultErrorBlockParam

字段 必填 类型
error_code WebFetchToolResultErrorCode
type 'web_fetch_tool_result_error'

WebFetchToolResultErrorCode

类型别名:\| 'invalid_tool_input' \| 'url_too_long' \| 'url_not_allowed' \| 'url_not_in_prior_context' \| 'url_not_accessible' \| 'unsupported_content_type' \| 'too_many_requests' \| 'max_uses_exceeded' \| 'unavailable'

WebSearchResultBlock

字段 必填 类型
encrypted_content string
page_age string | null
title string
type 'web_search_result'
url string

WebSearchResultBlockParam

字段 必填 类型
encrypted_content string
title string
type 'web_search_result'
url string
page_age string | null

WebSearchTool20250305

字段 必填 类型
name 'web_search'
type 'web_search_20250305'
allowed_callers Array<'direct' | 'code_execution_20250825' | 'code_execution_20260120'>
allowed_domains Array<string> | null
blocked_domains Array<string> | null
cache_control CacheControlEphemeral | null
defer_loading boolean
max_uses number | null
strict boolean
user_location UserLocation | null

WebSearchTool20260209

字段 必填 类型
name 'web_search'
type 'web_search_20260209'
allowed_callers Array<'direct' | 'code_execution_20250825' | 'code_execution_20260120'>
allowed_domains Array<string> | null
blocked_domains Array<string> | null
cache_control CacheControlEphemeral | null
defer_loading boolean
max_uses number | null
strict boolean
user_location UserLocation | null

WebSearchToolRequestError

字段 必填 类型
error_code WebSearchToolResultErrorCode
type 'web_search_tool_result_error'

WebSearchToolResultBlock

字段 必填 类型
caller DirectCaller | ServerToolCaller | ServerToolCaller20260120
content WebSearchToolResultBlockContent
tool_use_id string
type 'web_search_tool_result'

WebSearchToolResultBlockContent

类型别名:WebSearchToolResultError \| Array<WebSearchResultBlock>

WebSearchToolResultBlockParam

字段 必填 类型
content WebSearchToolResultBlockParamContent
tool_use_id string
type 'web_search_tool_result'
cache_control CacheControlEphemeral | null
caller DirectCaller | ServerToolCaller | ServerToolCaller20260120

WebSearchToolResultBlockParamContent

类型别名:\| Array<WebSearchResultBlockParam> \| WebSearchToolRequestError

WebSearchToolResultError

字段 必填 类型
error_code WebSearchToolResultErrorCode
type 'web_search_tool_result_error'

WebSearchToolResultErrorCode

类型别名:\| 'invalid_tool_input' \| 'unavailable' \| 'max_uses_exceeded' \| 'too_many_requests' \| 'query_too_long' \| 'request_too_large'

Gemini Endpoints

Method Path Request schema Response schema Aether format
POST v1beta/{+model}:generateContent GenerateContentRequest GenerateContentResponse gemini:generate_content
POST v1beta/{+model}:streamGenerateContent GenerateContentRequest GenerateContentResponse (SSE) gemini:generate_content
POST v1beta/{+model}:embedContent EmbedContentRequest EmbedContentResponse gemini:embedding
POST v1beta/{+model}:batchEmbedContents BatchEmbedContentsRequest BatchEmbedContentsResponse gemini:embedding
POST v1beta/{+model}:countTokens CountTokensRequest CountTokensResponse gemini:generate_content
POST v1beta/files CreateFileRequest CreateFileResponse gemini files
GET v1beta/files - ListFilesResponse gemini files
GET v1beta/{+name} - File gemini files
DELETE v1beta/{+name} - Empty gemini files
POST v1beta/{+model}:predictLongRunning PredictLongRunningRequest Operation gemini video

Gemini Schema 字段表

以下 schema 从 Gemini native 接口根 schema 递归引用得到,共 97 个。

AttributionSourceId

类型 object
说明 Identifier for the source contributing to this attribution.
字段 必填 类型 枚举/常量 说明
groundingPassage GroundingPassageId - Identifier for an inline passage.
semanticRetrieverChunk SemanticRetrieverChunk - Identifier for a Chunk fetched via Semantic Retriever.

AudioResponseFormat

类型 object
说明 Configuration for audio output format.
字段 必填 类型 枚举/常量 说明
bitRate integer(int32) - Optional. Bit rate in bits per second (bps). Only applicable for compressed formats (MP3, Opus).
delivery string DELIVERY_UNSPECIFIED, INLINE, URI Optional. The delivery mode for the audio output.
mimeType string MIME_TYPE_UNSPECIFIED, AUDIO_MP3, AUDIO_OGG_OPUS, AUDIO_L16, AUDIO_WAV, AUDIO_ALAW, AUDIO_MULAW Optional. The MIME type of the audio output.
sampleRate integer(int32) - Optional. Sample rate in Hz.

BatchEmbedContentsRequest

类型 object
说明 Batch request to get embeddings from the model for a list of prompts.
字段 必填 类型 枚举/常量 说明
requests array<EmbedContentRequest> - Required. Embed requests for the batch. The model in each of these requests must match the model specified BatchEmbedContentsRequest.model.

BatchEmbedContentsResponse

类型 object
说明 The response to a BatchEmbedContentsRequest.
字段 必填 类型 枚举/常量 说明
embeddings array<ContentEmbedding> - Output only. The embeddings for each request, in the same order as provided in the batch request.
usageMetadata EmbeddingUsageMetadata - Output only. The usage metadata for the request.

Blob

类型 object
说明 Raw media bytes. Text should not be sent as raw bytes, use the 'text' field.
字段 必填 类型 枚举/常量 说明
data string(byte) - Raw bytes for media formats.
mimeType string - 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 …

Candidate

类型 object
说明 A response candidate generated from the model.
字段 必填 类型 枚举/常量 说明
avgLogprobs number(double) - Output only. Average log probability score of the candidate.
citationMetadata CitationMetadata - 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 t…
content Content - Output only. Generated content returned from the model.
finishMessage string - Optional. Output only. Details the reason why the model stopped generating tokens. This is populated only when finish_reason is set.
finishReason string 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, ESCALATION Optional. Output only. The reason why the model stopped generating tokens. If empty, the model has not stopped generating tokens.
groundingAttributions array<GroundingAttribution> - Output only. Attribution information for sources that contributed to a grounded answer. This field is populated for GenerateAnswer calls.
groundingMetadata GroundingMetadata - Output only. Grounding metadata for the candidate. This field is populated for GenerateContent calls.
index integer(int32) - Output only. Index of the candidate in the list of response candidates.
logprobsResult LogprobsResult - Output only. Log-likelihood scores for the response tokens and top tokens
safetyRatings array<SafetyRating> - List of ratings for the safety of a response candidate. There is at most one rating per category.
tokenCount integer(int32) - Output only. Token count for this candidate.
urlContextMetadata UrlContextMetadata - Output only. Metadata related to url context retrieval tool.

CitationMetadata

类型 object
说明 A collection of source attributions for a piece of content.
字段 必填 类型 枚举/常量 说明
citationSources array<CitationSource> - Citations to sources for a specific response.

CitationSource

类型 object
说明 A citation to a source for a portion of a specific response.
字段 必填 类型 枚举/常量 说明
endIndex integer(int32) - Optional. End of the attributed segment, exclusive.
license string - Optional. License for the GitHub project that is attributed as a source for segment. License info is required for code citations.
startIndex integer(int32) - Optional. Start of segment of the response that is attributed to this source. Index indicates the start of the segment, measured in bytes.
uri string - Optional. URI that is attributed as a source for a portion of the text.

CodeExecution

类型 object
说明 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 us…

CodeExecutionResult

类型 object
说明 Result of executing the ExecutableCode. Generated only when the CodeExecution tool is used.
字段 必填 类型 枚举/常量 说明
id string - Optional. The identifier of the ExecutableCode part this result is for. Only populated if the corresponding ExecutableCode has an id.
outcome string OUTCOME_UNSPECIFIED, OUTCOME_OK, OUTCOME_FAILED, OUTCOME_DEADLINE_EXCEEDED Required. Outcome of the code execution.
output string - Optional. Contains stdout when code execution is successful, stderr or other description otherwise.

ComputerUse

类型 object
说明 Computer Use tool type.
字段 必填 类型 枚举/常量 说明
environment string ENVIRONMENT_UNSPECIFIED, ENVIRONMENT_BROWSER Required. The environment being operated.
excludedPredefinedFunctions array<string> - 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 purp…

Content

类型 object
说明 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…
字段 必填 类型 枚举/常量 说明
parts array<Part> - Ordered Parts that constitute a single message. Parts may have different MIME types.
role string - 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.

ContentEmbedding

类型 object
说明 A list of floats representing an embedding.
字段 必填 类型 枚举/常量 说明
shape array<integer(int32)> - This field stores the soft tokens tensor frame shape (e.g. [1, 1, 256, 2048]).
values array<number(float)> - The embedding values. This is for 3P users only and will not be populated for 1P calls.

CountTokensRequest

类型 object
说明 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.
字段 必填 类型 枚举/常量 说明
contents array<Content> - Optional. The input given to the model as a prompt. This field is ignored when generate_content_request is set.
generateContentRequest GenerateContentRequest - 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/do…

CountTokensResponse

类型 object
说明 A response from CountTokens. It returns the model's token_count for the prompt.
字段 必填 类型 枚举/常量 说明
cacheTokensDetails array<ModalityTokenCount> - Output only. List of modalities that were processed in the cached content.
cachedContentTokenCount integer(int32) - Number of tokens in the cached part of the prompt (the cached content).
promptTokensDetails array<ModalityTokenCount> - Output only. List of modalities that were processed in the request input.
totalTokens integer(int32) - The number of tokens that the Model tokenizes the prompt into. Always non-negative.

CreateFileRequest

类型 object
说明 Request for CreateFile.
字段 必填 类型 枚举/常量 说明
file File - Optional. Metadata for the file to create.

CreateFileResponse

类型 object
说明 Response for CreateFile.
字段 必填 类型 枚举/常量 说明
file File - Metadata for the created file.

DynamicRetrievalConfig

类型 object
说明 Describes the options to customize dynamic retrieval.
字段 必填 类型 枚举/常量 说明
dynamicThreshold number(float) - The threshold to be used in dynamic retrieval. If not set, a system default value is used.
mode string MODE_UNSPECIFIED, MODE_DYNAMIC The mode of the predictor to be used in dynamic retrieval.

EmbedContentConfig

类型 object
说明 Configurations for the EmbedContent request.
字段 必填 类型 枚举/常量 说明
audioTrackExtraction boolean - Optional. Whether to extract audio from video content.
autoTruncate boolean - Optional. Whether to silently truncate the input content if it's longer than the maximum sequence length.
documentOcr boolean - Optional. Whether to enable OCR for document content.
outputDimensionality integer(int32) - Optional. Reduced dimension for the output embedding. If set, excessive values in the output embedding are truncated from the end.
taskType string TASK_TYPE_UNSPECIFIED, RETRIEVAL_QUERY, RETRIEVAL_DOCUMENT, SEMANTIC_SIMILARITY, CLASSIFICATION, CLUSTERING, QUESTION_ANSWERING, FACT_VERIFICATION, CODE_RETRIEVAL_QUERY Optional. The task type of the embedding.
title string - Optional. The title for the text.

EmbedContentRequest

类型 object
说明 Request containing the Content for the model to embed.
字段 必填 类型 枚举/常量 说明
content Content - Required. The content to embed. Only the parts.text fields will be counted.
embedContentConfig EmbedContentConfig - Optional. Configuration for the EmbedContent request.
model string - 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}
outputDimensionality integer(int32) - Optional. Deprecated: Please use EmbedContentConfig.output_dimensionality instead. Optional reduced dimension for the output embedding. If set, excessive values in the output embe…
taskType string TASK_TYPE_UNSPECIFIED, RETRIEVAL_QUERY, RETRIEVAL_DOCUMENT, SEMANTIC_SIMILARITY, CLASSIFICATION, CLUSTERING, QUESTION_ANSWERING, FACT_VERIFICATION, CODE_RETRIEVAL_QUERY 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-…
title string - Optional. Deprecated: Please use EmbedContentConfig.title instead. An optional title for the text. Only applicable when TaskType is RETRIEVAL_DOCUMENT. Note: Specifying a title fo…

EmbedContentResponse

类型 object
说明 The response to an EmbedContentRequest.
字段 必填 类型 枚举/常量 说明
embedding ContentEmbedding - Output only. The embedding generated from the input content.
usageMetadata EmbeddingUsageMetadata - Output only. The usage metadata for the request.

EmbeddingUsageMetadata

类型 object
说明 Metadata on the usage of the embedding request.
字段 必填 类型 枚举/常量 说明
promptTokenCount integer(int32) - Output only. Number of tokens in the prompt.
promptTokenDetails array<ModalityTokenCount> - Output only. List of modalities that were processed in the request input.

ExecutableCode

类型 object
说明 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 automat…
字段 必填 类型 枚举/常量 说明
code string - Required. The code to be executed.
id string - Optional. Unique identifier of the ExecutableCode part. The server returns the CodeExecutionResult with the matching id.
language string LANGUAGE_UNSPECIFIED, PYTHON Required. Programming language of the code.

File

类型 object
说明 A file uploaded to the API. Next ID: 15
字段 必填 类型 枚举/常量 说明
createTime string(google-datetime) - Output only. The timestamp of when the File was created.
displayName string - 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"
downloadUri string - Output only. The download uri of the File.
error Status - Output only. Error status if File processing failed.
expirationTime string(google-datetime) - Output only. The timestamp of when the File will be deleted. Only set if the File is scheduled to expire.
mimeType string - Output only. MIME type of the file.
name string - 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 ca…
sha256Hash string(byte) - Output only. SHA-256 hash of the uploaded bytes.
sizeBytes string(int64) - Output only. Size of the file in bytes.
source string SOURCE_UNSPECIFIED, UPLOADED, GENERATED, REGISTERED Source of the File.
state string STATE_UNSPECIFIED, PROCESSING, ACTIVE, FAILED Output only. Processing state of the File.
updateTime string(google-datetime) - Output only. The timestamp of when the File was last updated.
uri string - Output only. The uri of the File.
videoMetadata VideoFileMetadata - Output only. Metadata for a video.

FileData

类型 object
说明 URI based data.
字段 必填 类型 枚举/常量 说明
fileUri string - Required. URI.
mimeType string - Optional. The IANA standard MIME type of the source data.

FileSearch

类型 object
说明 The FileSearch tool that retrieves knowledge from Semantic Retrieval corpora. Files are imported to Semantic Retrieval corpora using the ImportFile API.
字段 必填 类型 枚举/常量 说明
fileSearchStoreNames array<string> - Required. The names of the file_search_stores to retrieve from. Example: fileSearchStores/my-file-search-store-123
metadataFilter string - Optional. Metadata filter to apply to the semantic retrieval documents and chunks.
topK integer(int32) - Optional. The number of semantic retrieval chunks to retrieve.

FunctionCall

类型 object
说明 A predicted FunctionCall returned from the model that contains a string representing the FunctionDeclaration.name with the arguments and their values.
字段 必填 类型 枚举/常量 说明
args object/map<string, any> - Optional. The function parameters and values in JSON object format.
id string - Optional. Unique identifier of the function call. If populated, the client to execute the function_call and return the response with the matching id.
name string - 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.

FunctionCallingConfig

类型 object
说明 Configuration for specifying function calling behavior.
字段 必填 类型 枚举/常量 说明
allowedFunctionNames array<string> - 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 m…
mode string MODE_UNSPECIFIED, AUTO, ANY, NONE, VALIDATED Optional. Specifies the mode in which function calling should execute. If unspecified, the default value will be set to AUTO.

FunctionDeclaration

类型 object
说明 Structured representation of a function declaration as defined by the OpenAPI 3.03 specification. Included in this declaration are the func…
字段 必填 类型 枚举/常量 说明
behavior string UNSPECIFIED, BLOCKING, NON_BLOCKING Optional. Specifies the function Behavior. Currently only supported by the BidiGenerateContent method.
description string - Required. A brief description of the function.
name string - 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.
parameters Schema - 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 …
parametersJsonSchema any - 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: …
response Schema - 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…
responseJsonSchema any - 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 …

FunctionResponse

类型 object
说明 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…
字段 必填 类型 枚举/常量 说明
id string - Optional. The identifier of the function call this response is for. Populated by the client to match the corresponding function call id.
name string - 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.
parts array<FunctionResponsePart> - Optional. Ordered Parts that constitute a function response. Parts may have different IANA MIME types.
response object/map<string, any> - 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", "resul…
scheduling string SCHEDULING_UNSPECIFIED, SILENT, WHEN_IDLE, INTERRUPT 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.
willContinue boolean - 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,…

FunctionResponseBlob

类型 object
说明 Raw media bytes for function response. Text should not be sent as raw bytes, use the 'FunctionResponse.response' field.
字段 必填 类型 枚举/常量 说明
data string(byte) - Raw bytes for media formats.
mimeType string - 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 suppo…

FunctionResponsePart

类型 object
说明 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 c…
字段 必填 类型 枚举/常量 说明
inlineData FunctionResponseBlob - Inline media bytes.

GenerateContentRequest

类型 object
说明 Request to generate a completion from the model.
字段 必填 类型 枚举/常量 说明
cachedContent string - Optional. The name of the content cached to use as context to serve the prediction. Format: cachedContents/{cachedContent}
contents array<Content> - 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/gemi…
generationConfig GenerationConfig - Optional. Configuration options for model generation and outputs.
model string - Required. The name of the Model to use for generating the completion. Format: models/{model}.
safetySettings array<SafetySetting> - Optional. A list of unique SafetySetting instances for blocking unsafe content. This will be enforced on the GenerateContentRequest.contents and GenerateContentResponse.candidates…
serviceTier string unspecified, standard, flex, priority Optional. The service tier of the request.
store boolean - Optional. Configures the logging behavior for a given request. If set, it takes precedence over the project-level logging config.
systemInstruction Content - Optional. Developer set system instruction(s). Currently, text only.
toolConfig ToolConfig - 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_m…
tools array<Tool> - 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…

GenerateContentResponse

类型 object
说明 Response from the model supporting multiple candidate responses. Safety ratings and content filtering are reported for both prompt in GenerateContentResponse.prompt_feedback and f…
字段 必填 类型 枚举/常量 说明
candidates array<Candidate> - Candidate responses from the model.
modelStatus ModelStatus - Output only. The current model status of this model.
modelVersion string - Output only. The model version used to generate the response.
promptFeedback PromptFeedback - Returns the prompt's feedback related to the content filters.
responseId string - Output only. response_id is used to identify each response.
usageMetadata UsageMetadata - Output only. Metadata on the generation requests' token usage.

GenerationConfig

类型 object
说明 Configuration options for model generation and outputs. Not all parameters are configurable for every model.
字段 必填 类型 枚举/常量 说明
_responseJsonSchema any - Optional. Output schema of the generated response. This is an alternative to response_schema that accepts JSON Schema. If set, response_schema must be …
candidateCount integer(int32) - 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)
enableEnhancedCivicAnswers boolean - Optional. Enables enhanced civic answers. It may not be available for all models.
frequencyPenalty number(float) - 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 disco…
imageConfig ImageConfig - Optional. Config for image generation. An error will be returned if this field is set for models that don't support these config options.
logprobs integer(int32) - 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_res…
maxOutputTokens integer(int32) - 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 returne…
mediaResolution string MEDIA_RESOLUTION_UNSPECIFIED, MEDIA_RESOLUTION_LOW, MEDIA_RESOLUTION_MEDIUM, MEDIA_RESOLUTION_HIGH Optional. If specified, the media resolution specified will be used.
presencePenalty number(float) - 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 o…
responseFormat ResponseFormatConfig - Optional. Configuration for the response output format. Allows specifying output configuration per modality (text, audio, image) in a flat structure.
responseJsonSchema any - Optional. An internal detail. Use responseJsonSchema rather than this field.
responseLogprobs boolean - Optional. If true, export the logprobs results in response.
responseMimeType string - 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/…
responseModalities array<string> - 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 t…
responseSchema Schema - Optional. Output schema of the generated candidate text. Schemas must be a subset of the OpenAPI schema and can be objects, primitiv…
seed integer(int32) - Optional. Seed used in decoding. If not set, the request uses a randomly generated seed.
speechConfig SpeechConfig - Optional. The speech generation config.
stopSequences array<string> - 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 …
temperature number(float) - 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. Val…
thinkingConfig ThinkingConfig - Optional. Config for thinking features. An error will be returned if this field is set for models that don't support thinking.
topK integer(int32) - 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 conside…
topP number(float) - 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 assi…

GoogleAiGenerativelanguageV1betaGroundingSupport

类型 object
说明 Grounding support.
字段 必填 类型 枚举/常量 说明
confidenceScores array<number(float)> - 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.
groundingChunkIndices array<integer(int32)> - 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 g…
renderedParts array<integer(int32)> - Output only. Indices into the parts field of the candidate's content. These indices specify which rendered parts are associated with this support source.
segment GoogleAiGenerativelanguageV1betaSegment - Segment of the content this support belongs to.

GoogleAiGenerativelanguageV1betaSegment

类型 object
说明 Segment of the content.
字段 必填 类型 枚举/常量 说明
endIndex integer(int32) - End index in the given Part, measured in bytes. Offset from the start of the Part, exclusive, starting at zero.
partIndex integer(int32) - The index of a Part object within its parent Content object.
startIndex integer(int32) - Start index in the given Part, measured in bytes. Offset from the start of the Part, inclusive, starting at zero.
text string - The text corresponding to the segment from the response.

GoogleMaps

类型 object
说明 The GoogleMaps Tool that provides geospatial context for the user's query.
字段 必填 类型 枚举/常量 说明
enableWidget boolean - 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 geospa…

GoogleSearch

类型 object
说明 GoogleSearch tool type. Tool to support Google Search in Model. Powered by Google.
字段 必填 类型 枚举/常量 说明
searchTypes SearchTypes - Optional. The set of search types to enable. If not set, web search is enabled by default.
timeRangeFilter Interval - Optional. Filter search results to a specific time range. If customers set a start time, they must set an end time (and vice versa).

GoogleSearchRetrieval

类型 object
说明 Tool to retrieve public web data for grounding, powered by Google.
字段 必填 类型 枚举/常量 说明
dynamicRetrievalConfig DynamicRetrievalConfig - Specifies the dynamic retrieval configuration for the given source.

GroundingAttribution

类型 object
说明 Attribution for a source that contributed to an answer.
字段 必填 类型 枚举/常量 说明
content Content - Grounding source content that makes up this attribution.
sourceId AttributionSourceId - Output only. Identifier for the source contributing to this attribution.

GroundingChunk

类型 object
说明 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 fro…
字段 必填 类型 枚举/常量 说明
image Image - Optional. Grounding chunk from image search.
maps Maps - Optional. Grounding chunk from Google Maps.
retrievedContext RetrievedContext - Optional. Grounding chunk from context retrieved by the file search tool.
web Web - Grounding chunk from the web.

GroundingChunkCustomMetadata

类型 object
说明 User provided metadata about the GroundingFact.
字段 必填 类型 枚举/常量 说明
key string - The key of the metadata.
numericValue number(float) - Optional. The numeric value of the metadata. The expected range for this value depends on the specific key used.
stringListValue GroundingChunkStringList - Optional. A list of string values for the metadata.
stringValue string - Optional. The string value of the metadata.

GroundingChunkStringList

类型 object
说明 A list of string values.
字段 必填 类型 枚举/常量 说明
values array<string> - The string values of the list.

GroundingMetadata

类型 object
说明 Metadata returned to client when grounding is enabled.
字段 必填 类型 枚举/常量 说明
googleMapsWidgetContextToken string - 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 cas…
groundingChunks array<GroundingChunk> - 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 metad…
groundingSupports array<GoogleAiGenerativelanguageV1betaGroundingSupport> - List of grounding support.
imageSearchQueries array<string> - Image search queries used for grounding.
retrievalMetadata RetrievalMetadata - Metadata related to retrieval in the grounding flow.
searchEntryPoint SearchEntryPoint - Optional. Google search entry for the following-up web searches.
webSearchQueries array<string> - Web search queries for the following-up web search.

GroundingPassageId

类型 object
说明 Identifier for a part within a GroundingPassage.
字段 必填 类型 枚举/常量 说明
partIndex integer(int32) - Output only. Index of the part within the GenerateAnswerRequest's GroundingPassage.content.
passageId string - Output only. ID of the passage matching the GenerateAnswerRequest's GroundingPassage.id.

Image

类型 object
说明 Chunk from image search.
字段 必填 类型 枚举/常量 说明
domain string - The root domain of the web page that the image is from, e.g. "example.com".
imageUri string - The image asset URL.
sourceUri string - The web page URI for attribution.
title string - The title of the web page that the image is from.

ImageConfig

类型 object
说明 Config for image generation features.
字段 必填 类型 枚举/常量 说明
aspectRatio string - 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 mod…
imageSize string - Optional. Specifies the size of generated images. Supported values are 512, 1K, 2K, 4K. If not specified, the model will use default value 1K.

ImageResponseFormat

类型 object
说明 Configuration for image output format.
字段 必填 类型 枚举/常量 说明
aspectRatio string 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 Optional. The aspect ratio for the image output.
delivery string DELIVERY_UNSPECIFIED, INLINE, URI Optional. The delivery mode for the image output.
imageSize string IMAGE_SIZE_UNSPECIFIED, IMAGE_SIZE_FIVE_TWELVE, IMAGE_SIZE_ONE_K, IMAGE_SIZE_TWO_K, IMAGE_SIZE_FOUR_K Optional. The size of the image output.
mimeType string MIME_TYPE_UNSPECIFIED, IMAGE_JPEG Optional. The MIME type of the image output.

ImageSearch

类型 object
说明 Image search for grounding and related configurations.

Interval

类型 object
说明 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 en…
字段 必填 类型 枚举/常量 说明
endTime string(google-datetime) - Optional. Exclusive end of the interval. If specified, a Timestamp matching this interval will have to be before the end.
startTime string(google-datetime) - Optional. Inclusive start of the interval. If specified, a Timestamp matching this interval will have to be the same or after the start.

LatLng

类型 object
说明 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 o…
字段 必填 类型 枚举/常量 说明
latitude number(double) - The latitude in degrees. It must be in the range [-90.0, +90.0].
longitude number(double) - The longitude in degrees. It must be in the range [-180.0, +180.0].

ListFilesResponse

类型 object
说明 Response for ListFiles.
字段 必填 类型 枚举/常量 说明
files array<File> - The list of Files.
nextPageToken string - A token that can be sent as a page_token into a subsequent ListFiles call.

LogprobsResult

类型 object
说明 Logprobs Result
字段 必填 类型 枚举/常量 说明
chosenCandidates array<LogprobsResultCandidate> - Length = total number of decoding steps. The chosen candidates may or may not be in top_candidates.
logProbabilitySum number(float) - Sum of log probabilities for all tokens.
topCandidates array<TopCandidates> - Length = total number of decoding steps.

LogprobsResultCandidate

类型 object
说明 Candidate for the logprobs token and score.
字段 必填 类型 枚举/常量 说明
logProbability number(float) - The candidate's log probability.
token string - The candidates token string value.
tokenId integer(int32) - The candidates token id value.

Maps

类型 object
说明 A grounding chunk from Google Maps. A Maps chunk corresponds to a single place.
字段 必填 类型 枚举/常量 说明
placeAnswerSources PlaceAnswerSources - Sources that provide answers about the features of a given place in Google Maps.
placeId string - The ID of the place, in places/{place_id} format. A user can use this ID to look up that place.
text string - Text description of the place answer.
title string - Title of the place.
uri string - URI reference of the place.

McpServer

类型 object
说明 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
字段 必填 类型 枚举/常量 说明
name string - The name of the MCPServer.
streamableHttpTransport StreamableHttpTransport - A transport that can stream HTTP requests and responses.

ModalityTokenCount

类型 object
说明 Represents token counting info for a single modality.
字段 必填 类型 枚举/常量 说明
modality string MODALITY_UNSPECIFIED, TEXT, IMAGE, VIDEO, AUDIO, DOCUMENT The modality associated with this token count.
tokenCount integer(int32) - Number of tokens.

ModelStatus

类型 object
说明 The status of the underlying model. This is used to indicate the stage of the underlying model and the retirement time if applicable.
字段 必填 类型 枚举/常量 说明
message string - A message explaining the model status.
modelStage string MODEL_STAGE_UNSPECIFIED, UNSTABLE_EXPERIMENTAL, EXPERIMENTAL, PREVIEW, STABLE, LEGACY, DEPRECATED, RETIRED The stage of the underlying model.
retirementTime string(google-datetime) - The time at which the model will be retired.

MultiSpeakerVoiceConfig

类型 object
说明 The configuration for the multi-speaker setup.
字段 必填 类型 枚举/常量 说明
speakerVoiceConfigs array<SpeakerVoiceConfig> - Required. All the enabled speaker voices.

Operation

类型 object
说明 This resource represents a long-running operation that is the result of a network API call.
字段 必填 类型 枚举/常量 说明
done boolean - 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.
error Status - The error result of the operation in case of failure or cancellation.
metadata object/map<string, any> - 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 m…
name string - 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 w…
response object/map<string, any> - 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 …

Part

类型 object
说明 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 typ…
字段 必填 类型 枚举/常量 说明
codeExecutionResult CodeExecutionResult - Result of executing the ExecutableCode.
executableCode ExecutableCode - Code generated by the model that is meant to be executed.
fileData FileData - URI based data.
functionCall FunctionCall - A predicted FunctionCall returned from the model that contains a string representing the FunctionDeclaration.name with the arguments and their values.
functionResponse FunctionResponse - 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 a…
inlineData Blob - Inline media bytes.
mediaResolution MediaResolution - Optional. Media resolution for the input media.
partMetadata object/map<string, any> - 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 f…
text string - Inline text.
thought boolean - Optional. Indicates if the part is thought from the model.
thoughtSignature string(byte) - Optional. An opaque signature for the thought so it can be reused in subsequent requests.
toolCall ToolCall - 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…
toolResponse ToolResponse - The output from a server-side ToolCall execution. This field is populated by the client with the results of executing the corresponding ToolCall.
videoMetadata VideoMetadata - Optional. Video metadata. The metadata should only be specified while the video data is presented in inline_data or file_data.

PlaceAnswerSources

类型 object
说明 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 …
字段 必填 类型 枚举/常量 说明
reviewSnippets array<ReviewSnippet> - Snippets of reviews that are used to generate answers about the features of a given place in Google Maps.

PrebuiltVoiceConfig

类型 object
说明 The configuration for the prebuilt speaker to use.
字段 必填 类型 枚举/常量 说明
voiceName string - The name of the preset voice to use.

PredictLongRunningRequest

类型 object
说明 Request message for [PredictionService.PredictLongRunning].
字段 必填 类型 枚举/常量 说明
instances array<any> - Required. The instances that are the input to the prediction call.
parameters any - Optional. The parameters that govern the prediction call.

PromptFeedback

类型 object
说明 A set of the feedback metadata the prompt specified in GenerateContentRequest.content.
字段 必填 类型 枚举/常量 说明
blockReason string BLOCK_REASON_UNSPECIFIED, SAFETY, OTHER, BLOCKLIST, PROHIBITED_CONTENT, IMAGE_SAFETY Optional. If set, the prompt was blocked and no candidates are returned. Rephrase the prompt.
safetyRatings array<SafetyRating> - Ratings for safety of the prompt. There is at most one rating per category.

ResponseFormatConfig

类型 object
说明 Configuration for the response output format. This is a flat object where each optional sub-field configures a specific output modality.
字段 必填 类型 枚举/常量 说明
audio AudioResponseFormat - Optional. Audio output format configuration.
image ImageResponseFormat - Optional. Image output format configuration.
text TextResponseFormat - Optional. Text output format configuration.

RetrievalConfig

类型 object
说明 Retrieval config.
字段 必填 类型 枚举/常量 说明
languageCode string - Optional. The language code of the user. Language code for content. Use language tags defined by BCP47.
latLng LatLng - Optional. The location of the user.

RetrievalMetadata

类型 object
说明 Metadata related to retrieval in the grounding flow.
字段 必填 类型 枚举/常量 说明
googleSearchDynamicRetrievalScore number(float) - 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 …

RetrievedContext

类型 object
说明 Chunk from context retrieved by the file search tool.
字段 必填 类型 枚举/常量 说明
customMetadata array<GroundingChunkCustomMetadata> - Optional. User-provided metadata about the retrieved context.
fileSearchStore string - Optional. Name of the FileSearchStore containing the document. Example: fileSearchStores/123
mediaId string - Optional. The media blob resource name for multimodal file search results. Format: fileSearchStores/{file_search_store_id}/media/{blob_id}
pageNumber integer(int32) - Optional. Page number of the retrieved context, if applicable.
text string - Optional. Text of the chunk.
title string - Optional. Title of the document.
uri string - Optional. URI reference of the semantic retrieval document.

ReviewSnippet

类型 object
说明 Encapsulates a snippet of a user review that answers a question about the features of a specific place in Google Maps.
字段 必填 类型 枚举/常量 说明
googleMapsUri string - A link that corresponds to the user review on Google Maps.
reviewId string - The ID of the review snippet.
title string - Title of the review.

SafetyRating

类型 object
说明 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…
字段 必填 类型 枚举/常量 说明
blocked boolean - Was this content blocked because of this rating?
category string 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 Required. The category for this rating.
probability string HARM_PROBABILITY_UNSPECIFIED, NEGLIGIBLE, LOW, MEDIUM, HIGH Required. The probability of harm for this content.

SafetySetting

类型 object
说明 Safety setting, affecting the safety-blocking behavior. Passing a safety setting for a category changes the allowed probability that content is blocked.
字段 必填 类型 枚举/常量 说明
category string 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 Required. The category for this setting.
threshold string HARM_BLOCK_THRESHOLD_UNSPECIFIED, BLOCK_LOW_AND_ABOVE, BLOCK_MEDIUM_AND_ABOVE, BLOCK_ONLY_HIGH, BLOCK_NONE, OFF Required. Controls the probability threshold at which harm is blocked.

Schema

类型 object
说明 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 s…
字段 必填 类型 枚举/常量 说明
anyOf array<Schema> - Optional. The value should be validated against any (one or more) of the subschemas in the list.
default any - 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 th…
description string - Optional. A brief description of the parameter. This could contain examples of use. Parameter description may be formatted as Markdown.
enum array<string> - 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"…
example any - Optional. Example of the object. Will only populated when the object is the root.
format string - Optional. The format of the data. Any value is allowed, but most do not trigger any special functionality.
items Schema - Optional. Schema of the elements of Type.ARRAY.
maxItems string(int64) - Optional. Maximum number of the elements for Type.ARRAY.
maxLength string(int64) - Optional. Maximum length of the Type.STRING
maxProperties string(int64) - Optional. Maximum number of the properties for Type.OBJECT.
maximum number(double) - Optional. Maximum value of the Type.INTEGER and Type.NUMBER
minItems string(int64) - Optional. Minimum number of the elements for Type.ARRAY.
minLength string(int64) - Optional. SCHEMA FIELDS FOR TYPE STRING Minimum length of the Type.STRING
minProperties string(int64) - Optional. Minimum number of the properties for Type.OBJECT.
minimum number(double) - Optional. SCHEMA FIELDS FOR TYPE INTEGER and NUMBER Minimum value of the Type.INTEGER and Type.NUMBER
nullable boolean - Optional. Indicates if the value may be null.
pattern string - Optional. Pattern of the Type.STRING to restrict a string to a regular expression.
properties object/map<string, Schema> - Optional. Properties of Type.OBJECT.
propertyOrdering array<string> - 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.
required array<string> - Optional. Required properties of Type.OBJECT.
title string - Optional. The title of the schema.
type string TYPE_UNSPECIFIED, STRING, NUMBER, INTEGER, BOOLEAN, ARRAY, OBJECT, NULL Required. Data type.

SearchEntryPoint

类型 object
说明 Google search entry point.
字段 必填 类型 枚举/常量 说明
renderedContent string - Optional. Web content snippet that can be embedded in a web page or an app webview.
sdkBlob string(byte) - Optional. Base64 encoded JSON representing array of tuple.

SearchTypes

类型 object
说明 Different types of search that can be enabled on the GoogleSearch tool.
字段 必填 类型 枚举/常量 说明
imageSearch ImageSearch - Optional. Enables image search. Image bytes are returned.
webSearch WebSearch - Optional. Enables web search. Only text results are returned.

SemanticRetrieverChunk

类型 object
说明 Identifier for a Chunk retrieved via Semantic Retriever specified in the GenerateAnswerRequest using SemanticRetrieverConfig.
字段 必填 类型 枚举/常量 说明
chunk string - Output only. Name of the Chunk containing the attributed text. Example: corpora/123/documents/abc/chunks/xyz
source string - Output only. Name of the source matching the request's SemanticRetrieverConfig.source. Example: corpora/123 or corpora/123/documents/abc

SpeakerVoiceConfig

类型 object
说明 The configuration for a single speaker in a multi speaker setup.
字段 必填 类型 枚举/常量 说明
speaker string - Required. The name of the speaker to use. Should be the same as in the prompt.
voiceConfig VoiceConfig - Required. The configuration for the voice to use.

SpeechConfig

类型 object
说明 Config for speech generation and transcription.
字段 必填 类型 枚举/常量 说明
languageCode string - Optional. The IETF BCP-47 language code that the user configured the app to use. Used for speech recognition and synthesis. Valid v…
multiSpeakerVoiceConfig MultiSpeakerVoiceConfig - Optional. The configuration for the multi-speaker setup. It is mutually exclusive with the voice_config field.
voiceConfig VoiceConfig - The configuration in case of single-voice output.

Status

类型 object
说明 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/gr…
字段 必填 类型 枚举/常量 说明
code integer(int32) - The status code, which should be an enum value of google.rpc.Code.
details array<object/map<string, any>> - A list of messages that carry the error details. There is a common set of message types for APIs to use.
message string - 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 th…

StreamableHttpTransport

类型 object
说明 A transport that can stream HTTP requests and responses. Next ID: 6
字段 必填 类型 枚举/常量 说明
headers object/map<string, string> - Optional: Fields for authentication headers, timeouts, etc., if needed.
sseReadTimeout string(google-duration) - Timeout for SSE read operations.
terminateOnClose boolean - Whether to close the client session when the transport closes.
timeout string(google-duration) - HTTP timeout for regular operations.
url string - The full URL for the MCPServer endpoint. Example: "https://api.example.com/mcp"

TextResponseFormat

类型 object
说明 Configuration for text output format.
字段 必填 类型 枚举/常量 说明
mimeType string MIME_TYPE_UNSPECIFIED, APPLICATION_JSON, TEXT_PLAIN Optional. The MIME type of the text output.
schema any - Optional. The JSON schema that the output should conform to. Only applicable when mime_type is APPLICATION_JSON.

ThinkingConfig

类型 object
说明 Config for thinking features.
字段 必填 类型 枚举/常量 说明
includeThoughts boolean - Indicates whether to include thoughts in the response. If true, thoughts are returned only when available.
thinkingBudget integer(int32) - The number of thoughts tokens that the model should generate.
thinkingLevel string THINKING_LEVEL_UNSPECIFIED, MINIMAL, LOW, MEDIUM, HIGH 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 g…

Tool

类型 object
说明 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 actio…
字段 必填 类型 枚举/常量 说明
codeExecution CodeExecution - Optional. Enables the model to execute code as part of generation.
computerUse ComputerUse - Optional. Tool to support the model interacting directly with the computer. If enabled, it automatically populates computer-use specific Function Declarations.
fileSearch FileSearch - Optional. FileSearch tool type. Tool to retrieve knowledge from Semantic Retrieval corpora.
functionDeclarations array<FunctionDeclaration> - 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 funct…
googleMaps GoogleMaps - Optional. Tool that allows grounding the model's response with geospatial context related to the user's query.
googleSearch GoogleSearch - Optional. GoogleSearch tool type. Tool to support Google Search in Model. Powered by Google.
googleSearchRetrieval GoogleSearchRetrieval - Optional. Retrieval tool that is powered by Google search.
mcpServers array<McpServer> - Optional. MCP Servers to connect to.
urlContext UrlContext - Optional. Tool to support URL context retrieval.

ToolCall

类型 object
说明 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…
字段 必填 类型 枚举/常量 说明
args object/map<string, any> - Optional. The tool call arguments. Example: {"arg1" : "value1", "arg2" : "value2" , ...}
id string - Optional. Unique identifier of the tool call. The server returns the tool response with the matching id.
toolType string TOOL_TYPE_UNSPECIFIED, GOOGLE_SEARCH_WEB, GOOGLE_SEARCH_IMAGE, URL_CONTEXT, GOOGLE_MAPS, FILE_SEARCH Required. The type of tool that was called.

ToolConfig

类型 object
说明 The Tool configuration containing parameters for specifying Tool use in the request.
字段 必填 类型 枚举/常量 说明
functionCallingConfig FunctionCallingConfig - Optional. Function calling config.
includeServerSideToolInvocations boolean - 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.
retrievalConfig RetrievalConfig - Optional. Retrieval config.

ToolResponse

类型 object
说明 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 th…
字段 必填 类型 枚举/常量 说明
id string - Optional. The identifier of the tool call this response is for.
response object/map<string, any> - Optional. The tool response.
toolType string TOOL_TYPE_UNSPECIFIED, GOOGLE_SEARCH_WEB, GOOGLE_SEARCH_IMAGE, URL_CONTEXT, GOOGLE_MAPS, FILE_SEARCH Required. The type of tool that was called, matching the tool_type in the corresponding ToolCall.

TopCandidates

类型 object
说明 Candidates with top log probabilities at each decoding step.
字段 必填 类型 枚举/常量 说明
candidates array<LogprobsResultCandidate> - Sorted by log probability in descending order.

UrlContext

类型 object
说明 Tool to support URL context retrieval.

UrlContextMetadata

类型 object
说明 Metadata related to url context retrieval tool.
字段 必填 类型 枚举/常量 说明
urlMetadata array<UrlMetadata> - List of url context.

UrlMetadata

类型 object
说明 Context of the a single url retrieval.
字段 必填 类型 枚举/常量 说明
retrievedUrl string - Retrieved url by the tool.
urlRetrievalStatus string URL_RETRIEVAL_STATUS_UNSPECIFIED, URL_RETRIEVAL_STATUS_SUCCESS, URL_RETRIEVAL_STATUS_ERROR, URL_RETRIEVAL_STATUS_PAYWALL, URL_RETRIEVAL_STATUS_UNSAFE Status of the url retrieval.

UsageMetadata

类型 object
说明 Metadata on the generation request's token usage.
字段 必填 类型 枚举/常量 说明
cacheTokensDetails array<ModalityTokenCount> - Output only. List of modalities of the cached content in the request input.
cachedContentTokenCount integer(int32) - Number of tokens in the cached part of the prompt (the cached content)
candidatesTokenCount integer(int32) - Total number of tokens across all the generated response candidates.
candidatesTokensDetails array<ModalityTokenCount> - Output only. List of modalities that were returned in the response.
promptTokenCount integer(int32) - 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.
promptTokensDetails array<ModalityTokenCount> - Output only. List of modalities that were processed in the request input.
serviceTier string unspecified, standard, flex, priority Output only. Service tier of the request.
thoughtsTokenCount integer(int32) - Output only. Number of tokens of thoughts for thinking models.
toolUsePromptTokenCount integer(int32) - Output only. Number of tokens present in tool-use prompt(s).
toolUsePromptTokensDetails array<ModalityTokenCount> - Output only. List of modalities that were processed for tool-use request inputs.
totalTokenCount integer(int32) - Total token count for the generation request (prompt + thoughts + response candidates).

VideoFileMetadata

类型 object
说明 Metadata for a video File.
字段 必填 类型 枚举/常量 说明
videoDuration string(google-duration) - Duration of the video.

VideoMetadata

类型 object
说明 Deprecated: Use GenerateContentRequest.processing_options instead. Metadata describes the input video content.
字段 必填 类型 枚举/常量 说明
endOffset string(google-duration) - Optional. The end offset of the video.
fps number(double) - 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].
startOffset string(google-duration) - Optional. The start offset of the video.

VoiceConfig

类型 object
说明 The configuration for the voice to use.
字段 必填 类型 枚举/常量 说明
prebuiltVoiceConfig PrebuiltVoiceConfig - The configuration for the prebuilt voice to use.

Web

类型 object
说明 Chunk from the web.
字段 必填 类型 枚举/常量 说明
title string - Output only. Title of the chunk.
uri string - Output only. URI reference of the chunk.

WebSearch

类型 object
说明 Standard web search for grounding and related configurations.