{
  "openapi": "3.0.3",
  "info": {
    "title": "Gemini API",
    "description": "The Gemini Interactions API is an experimental API that allows developers to build generative AI applications using Gemini models. Gemini is our most capable model, built from the ground up to be multimodal. It can generalize and seamlessly understand, operate across, and combine different types of information including language, images, audio, video, and code. You can use the Gemini API for use cases like reasoning across text and images, content generation, dialogue agents, summarization and classification systems, and more.",
    "version": "v1beta",
    "x-google-revision": "0"
  },
  "servers": [
    {
      "url": "https://generativelanguage.googleapis.com",
      "description": "Global Endpoint"
    }
  ],
  "paths": {
    "/{api_version}/agents": {
      "parameters": [
        {
          "$ref": "#/components/parameters/api_version"
        }
      ],
      "post": {
        "operationId": "CreateAgent",
        "description": "Creates a new Agent (Typed version for SDK).",
        "security": [],
        "parameters": [],
        "requestBody": {
          "description": "The request body.",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Agent"
              }
            }
          }
        },
        "responses": {
          "default": {
            "description": "Successful operation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Agent"
                },
                "examples": {
                  "create": {
                    "summary": "Create Agent",
                    "value": {
                      "id": "ag_abc123",
                      "display_name": "My Research Agent",
                      "system_instruction": "You are a helpful research assistant.",
                      "tools": [
                        {
                          "type": "google_search"
                        }
                      ],
                      "object": "agent",
                      "created": "2025-11-26T12:25:15Z",
                      "updated": "2025-11-26T12:25:15Z"
                    }
                  }
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "sh",
            "label": "create",
            "source": "curl -X POST https://generativelanguage.googleapis.com/v1beta/agents \\\\\n  -H \"x-goog-api-key: $GEMINI_API_KEY\" \\\\\n  -H \"Content-Type: application/json\" \\\\\n  -H \"Api-Revision: 2026-05-20\" \\\\\n  -d '{\n    \"id\": \"research-assistant-abc123\",\n    \"base_agent\": \"waverunner\",\n    \"description\": \"A helpful research assistant.\",\n    \"system_instruction\": \"You are a helpful research assistant.\",\n    \"base_environment\": \"remote\",\n    \"tools\": [{\"type\": \"google_search\"}]\n  }'\n"
          },
          {
            "lang": "python",
            "label": "create",
            "source": "import uuid\nfrom google import genai\n\nclient = genai.Client()\nagent = client.agents.create(\n    id=f\"research-assistant-{uuid.uuid4().hex[:8]}\",\n    base_agent=\"waverunner\",\n    description=\"A helpful research assistant.\",\n    system_instruction=\"You are a helpful research assistant.\",\n    base_environment=\"remote\",\n    tools=[{\"type\": \"google_search\"}],\n)\nprint(agent.id)\n\n# [cleanup]\nclient.agents.delete(agent.id)\n# [/cleanup]\n"
          },
          {
            "lang": "javascript",
            "label": "create",
            "source": "import {GoogleGenAI} from '@google/genai';\n\nconst ai = new GoogleGenAI({});\nconst agentId = `research-assistant-${crypto.randomUUID().slice(0, 8)}`;\nconst agent = await ai.agents.create({\n    id: agentId,\n    base_agent: 'waverunner',\n    description: 'A helpful research assistant.',\n    system_instruction: 'You are a helpful research assistant.',\n    base_environment: 'remote',\n    tools: [{ type: 'google_search' }],\n});\nif (!agent.id) {\n    throw new Error('Agent creation failed: ID is undefined');\n}\nconsole.log(agent.id);\n\n// [cleanup]\nawait ai.agents.delete(agent.id);\n// [/cleanup]\n"
          }
        ]
      },
      "get": {
        "operationId": "ListAgents",
        "description": "Lists all Agents.",
        "security": [],
        "parameters": [
          {
            "name": "page_size",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "page_token",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "parent",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "default": {
            "description": "Successful operation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListAgentsResponse"
                },
                "examples": {
                  "list": {
                    "summary": "List Agents",
                    "value": {
                      "object": "list",
                      "data": [
                        {
                          "id": "ag_abc123",
                          "display_name": "My Research Agent",
                          "system_instruction": "You are a helpful research assistant.",
                          "object": "agent",
                          "created": "2025-11-26T12:25:15Z",
                          "updated": "2025-11-26T12:25:15Z"
                        }
                      ]
                    }
                  }
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "sh",
            "label": "list",
            "source": "curl -X GET https://generativelanguage.googleapis.com/v1beta/agents \\\\\n  -H \"x-goog-api-key: $GEMINI_API_KEY\" \\\\\n  -H \"Api-Revision: 2026-05-20\"\n"
          },
          {
            "lang": "python",
            "label": "list",
            "source": "from google import genai\n\nclient = genai.Client()\nresponse = client.agents.list()\nfor agent in response.agents or []:\n    print(agent.id)\n"
          },
          {
            "lang": "javascript",
            "label": "list",
            "source": "import {GoogleGenAI} from '@google/genai';\n\nconst ai = new GoogleGenAI({});\nconst agents = await ai.agents.list();\nfor (const agent of (agents.agents ?? [])) {\n    console.log(agent.id);\n}\n"
          }
        ]
      }
    },
    "/{api_version}/agents/{id}": {
      "parameters": [
        {
          "$ref": "#/components/parameters/api_version"
        },
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "operationId": "GetAgent",
        "description": "Gets a specific Agent.",
        "security": [],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "default": {
            "description": "Successful operation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Agent"
                },
                "examples": {
                  "get": {
                    "summary": "Get Agent",
                    "value": {
                      "id": "ag_abc123",
                      "display_name": "My Research Agent",
                      "system_instruction": "You are a helpful research assistant.",
                      "tools": [
                        {
                          "type": "google_search"
                        }
                      ],
                      "object": "agent",
                      "created": "2025-11-26T12:25:15Z",
                      "updated": "2025-11-26T12:25:15Z"
                    }
                  }
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "sh",
            "label": "get",
            "source": "curl -X GET https://generativelanguage.googleapis.com/v1beta/agents/ag_abc123 \\\\\n  -H \"x-goog-api-key: $GEMINI_API_KEY\" \\\\\n  -H \"Api-Revision: 2026-05-20\"\n"
          },
          {
            "lang": "python",
            "label": "get",
            "source": "import uuid\nfrom google import genai\n\nclient = genai.Client()\n\n# Create an agent so we have a valid ID to retrieve.\nagent_id = f\"test-agent-{uuid.uuid4().hex[:8]}\"\nclient.agents.create(\n    id=agent_id,\n    base_agent=\"waverunner\",\n    description=\"A test agent.\",\n    base_environment=\"remote\",\n)\n\nagent = client.agents.get(agent_id)\nprint(agent.id)\n\n# [cleanup]\nclient.agents.delete(agent.id)\n# [/cleanup]\n"
          },
          {
            "lang": "javascript",
            "label": "get",
            "source": "import {GoogleGenAI} from '@google/genai';\n\nconst ai = new GoogleGenAI({});\n\n// Create an agent so we have a valid ID to retrieve.\nconst agentId = `test-agent-${crypto.randomUUID().slice(0, 8)}`;\nawait ai.agents.create({\n    id: agentId,\n    base_agent: 'waverunner',\n    description: 'A test agent.',\n    base_environment: 'remote',\n});\n\nconst agent = await ai.agents.get(agentId);\nconsole.log(agent.id);\n\n// Clean up.\nawait ai.agents.delete(agent.id);\n"
          }
        ]
      },
      "delete": {
        "operationId": "DeleteAgent",
        "description": "Deletes an Agent.",
        "security": [],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "default": {
            "description": "Successful operation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Empty"
                },
                "examples": {
                  "delete": {
                    "summary": "Delete Agent",
                    "value": {}
                  }
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "sh",
            "label": "delete",
            "source": "curl -X DELETE https://generativelanguage.googleapis.com/v1beta/agents/ag_abc123 \\\\\n  -H \"x-goog-api-key: $GEMINI_API_KEY\" \\\\\n  -H \"Api-Revision: 2026-05-20\"\n"
          },
          {
            "lang": "python",
            "label": "delete",
            "source": "import uuid\nfrom google import genai\n\nclient = genai.Client()\n\n# Create an agent so we have a valid ID to delete.\nagent_id = f\"delete-test-{uuid.uuid4().hex[:8]}\"\nclient.agents.create(\n    id=agent_id,\n    base_agent=\"waverunner\",\n    description=\"Temporary agent for deletion.\",\n    base_environment=\"remote\",\n)\n\nclient.agents.delete(agent_id)\nprint(\"Agent deleted successfully.\")\n"
          },
          {
            "lang": "javascript",
            "label": "delete",
            "source": "import {GoogleGenAI} from '@google/genai';\n\nconst ai = new GoogleGenAI({});\n\n// Create an agent so we have a valid ID to delete.\nconst agentId = `delete-test-${crypto.randomUUID().slice(0, 8)}`;\nawait ai.agents.create({\n    id: agentId,\n    base_agent: 'waverunner',\n    description: 'Temporary agent for deletion.',\n    base_environment: 'remote',\n});\n\nawait ai.agents.delete(agentId);\nconsole.log('Agent deleted successfully.');\n"
          }
        ]
      }
    },
    "/{api_version}/interactions": {
      "parameters": [
        {
          "$ref": "#/components/parameters/api_version"
        }
      ],
      "post": {
        "operationId": "CreateInteraction",
        "description": "Creates a new interaction.",
        "security": [],
        "parameters": [
          {
            "$ref": "#/components/parameters/api_version"
          }
        ],
        "requestBody": {
          "description": "The request body.",
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "oneOf": [
                  {
                    "$ref": "#/components/schemas/CreateAgentInteractionParams"
                  },
                  {
                    "$ref": "#/components/schemas/CreateModelInteractionParams"
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful operation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Interaction"
                },
                "examples": {
                  "simple": {
                    "summary": "Simple Request",
                    "value": {
                      "created": "2025-11-26T12:25:15Z",
                      "id": "v1_ChdPU0F4YWFtNkFwS2kxZThQZ05lbXdROBIXT1NBeGFhbTZBcEtpMWU4UGdOZW13UTg",
                      "model": "gemini-3.5-flash",
                      "object": "interaction",
                      "steps": [
                        {
                          "type": "model_output",
                          "content": [
                            {
                              "type": "text",
                              "text": "Hello! I'm functioning perfectly and ready to assist you.\n\nHow are you doing today?"
                            }
                          ]
                        }
                      ],
                      "status": "completed",
                      "updated": "2025-11-26T12:25:15Z",
                      "usage": {
                        "input_tokens_by_modality": [
                          {
                            "modality": "text",
                            "tokens": 7
                          }
                        ],
                        "total_cached_tokens": 0,
                        "total_input_tokens": 7,
                        "total_output_tokens": 20,
                        "total_thought_tokens": 22,
                        "total_tokens": 49,
                        "total_tool_use_tokens": 0
                      }
                    }
                  },
                  "multi_turn": {
                    "summary": "Multi-turn",
                    "value": {
                      "id": "v1_ChdPU0F4YWFtNkFwS2kxZThQZ05lbXdROBIXT1NBeGFhbTZBcEtpMWU4UGdOZW13UTg",
                      "model": "gemini-3.5-flash",
                      "status": "completed",
                      "object": "interaction",
                      "created": "2025-11-26T12:22:47Z",
                      "updated": "2025-11-26T12:22:47Z",
                      "steps": [
                        {
                          "type": "model_output",
                          "content": [
                            {
                              "type": "text",
                              "text": "The capital of France is Paris."
                            }
                          ]
                        }
                      ],
                      "usage": {
                        "input_tokens_by_modality": [
                          {
                            "modality": "text",
                            "tokens": 50
                          }
                        ],
                        "total_cached_tokens": 0,
                        "total_input_tokens": 50,
                        "total_output_tokens": 10,
                        "total_thought_tokens": 0,
                        "total_tokens": 60,
                        "total_tool_use_tokens": 0
                      }
                    }
                  },
                  "multimodal_image": {
                    "summary": "Image Input",
                    "value": {
                      "id": "v1_ChdPU0F4YWFtNkFwS2kxZThQZ05lbXdROBIXT1NBeGFhbTZBcEtpMWU4UGdOZW13UTg",
                      "model": "gemini-3.5-flash",
                      "status": "completed",
                      "object": "interaction",
                      "created": "2025-11-26T12:22:47Z",
                      "updated": "2025-11-26T12:22:47Z",
                      "steps": [
                        {
                          "type": "model_output",
                          "content": [
                            {
                              "type": "text",
                              "text": "A white humanoid robot with glowing blue eyes stands holding a red skateboard."
                            }
                          ]
                        }
                      ],
                      "usage": {
                        "input_tokens_by_modality": [
                          {
                            "modality": "text",
                            "tokens": 10
                          },
                          {
                            "modality": "image",
                            "tokens": 258
                          }
                        ],
                        "total_cached_tokens": 0,
                        "total_input_tokens": 268,
                        "total_output_tokens": 20,
                        "total_thought_tokens": 0,
                        "total_tokens": 288,
                        "total_tool_use_tokens": 0
                      }
                    }
                  },
                  "function_calling": {
                    "summary": "Function Calling",
                    "value": {
                      "id": "v1_ChdPU0F4YWFtNkFwS2kxZThQZ05lbXdROBIXT1NBeGFhbTZBcEtpMWU4UGdOZW13UTg",
                      "model": "gemini-3.5-flash",
                      "status": "requires_action",
                      "object": "interaction",
                      "created": "2025-11-26T12:22:47Z",
                      "updated": "2025-11-26T12:22:47Z",
                      "steps": [
                        {
                          "type": "function_call",
                          "id": "gth23981",
                          "name": "get_weather",
                          "arguments": {
                            "location": "Boston, MA"
                          }
                        }
                      ],
                      "usage": {
                        "input_tokens_by_modality": [
                          {
                            "modality": "text",
                            "tokens": 100
                          }
                        ],
                        "total_cached_tokens": 0,
                        "total_input_tokens": 100,
                        "total_output_tokens": 25,
                        "total_thought_tokens": 0,
                        "total_tokens": 125,
                        "total_tool_use_tokens": 50
                      }
                    }
                  },
                  "deep_research": {
                    "summary": "Deep Research",
                    "value": {
                      "id": "v1_ChdPU0F4YWFtNkFwS2kxZThQZ05lbXdROBIXT1NBeGFhbTZBcEtpMWU4UGdOZW13UTg",
                      "agent": "deep-research-pro-preview-12-2025",
                      "status": "completed",
                      "object": "interaction",
                      "created": "2025-11-26T12:22:47Z",
                      "updated": "2025-11-26T12:22:47Z",
                      "steps": [
                        {
                          "type": "model_output",
                          "content": [
                            {
                              "type": "text",
                              "text": "Here is a comprehensive research report on the current state of cancer research..."
                            }
                          ]
                        }
                      ],
                      "usage": {
                        "input_tokens_by_modality": [
                          {
                            "modality": "text",
                            "tokens": 20
                          }
                        ],
                        "total_cached_tokens": 0,
                        "total_input_tokens": 20,
                        "total_output_tokens": 1000,
                        "total_thought_tokens": 500,
                        "total_tokens": 1520,
                        "total_tool_use_tokens": 0
                      }
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Error creating interaction",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          }
        },
        "summary": "Creating an interaction",
        "x-codeSamples": [
          {
            "lang": "sh",
            "label": "simple",
            "source": "curl -X POST https://generativelanguage.googleapis.com/v1beta/interactions \\\n  -H \"x-goog-api-key: $GEMINI_API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -H \"Api-Revision: 2026-05-20\" \\\n  -d '{\n    \"model\": \"gemini-3.5-flash\",\n    \"input\": \"Hello, how are you?\"\n  }'\n"
          },
          {
            "lang": "python",
            "label": "simple",
            "source": "from google import genai\n\nclient = genai.Client()\ninteraction = client.interactions.create(\n    model=\"gemini-3.5-flash\",\n    input=\"Hello, how are you?\",\n)\nprint(interaction.output_text)\n"
          },
          {
            "lang": "javascript",
            "label": "simple",
            "source": "import {GoogleGenAI} from '@google/genai';\n\nconst ai = new GoogleGenAI({});\nconst interaction = await ai.interactions.create({\n    model: 'gemini-3.5-flash',\n    input: 'Hello, how are you?',\n});\nconsole.log(interaction.output_text);\n"
          },
          {
            "lang": "sh",
            "label": "multi_turn",
            "source": "curl -X POST https://generativelanguage.googleapis.com/v1beta/interactions \\\n  -H \"x-goog-api-key: $GEMINI_API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -H \"Api-Revision: 2026-05-20\" \\\n  -d '{\n    \"model\": \"gemini-3.5-flash\",\n    \"input\": [\n      { \"type\": \"user_input\", \"content\": [{ \"type\": \"text\", \"text\": \"Hello!\" }] },\n      { \"type\": \"model_output\", \"content\": [{ \"type\": \"text\", \"text\": \"Hi there! How can I help you today?\" }] },\n      { \"type\": \"user_input\", \"content\": [{ \"type\": \"text\", \"text\": \"What is the capital of France?\" }] }\n    ]\n  }'\n"
          },
          {
            "lang": "python",
            "label": "multi_turn",
            "source": "from google import genai\n\nclient = genai.Client()\nresponse = client.interactions.create(\n    model=\"gemini-3.5-flash\",\n    input=[\n        { \"type\": \"user_input\", \"content\": [{ \"type\": \"text\", \"text\": \"Hello!\" }] },\n        { \"type\": \"model_output\", \"content\": [{ \"type\": \"text\", \"text\": \"Hi there! How can I help you today?\" }] },\n        { \"type\": \"user_input\", \"content\": [{ \"type\": \"text\", \"text\": \"What is the capital of France?\" }] }\n    ]\n)\nprint(response.output_text)\n"
          },
          {
            "lang": "javascript",
            "label": "multi_turn",
            "source": "import {GoogleGenAI} from '@google/genai';\n\nconst ai = new GoogleGenAI({});\nconst interaction = await ai.interactions.create({\n    model: 'gemini-3.5-flash',\n    input: [\n        { type: 'user_input', content: [{ type: 'text', text: 'Hello' }] },\n        { type: 'model_output', content: [{ type: 'text', text: 'Hi there! How can I help you today?' }] },\n        { type: 'user_input', content: [{ type: 'text', text: 'What is the capital of France?' }] }\n    ]\n});\nconsole.log(interaction.output_text);\n"
          },
          {
            "lang": "sh",
            "label": "multimodal_image",
            "source": "curl -X POST https://generativelanguage.googleapis.com/v1beta/interactions \\\n  -H \"x-goog-api-key: $GEMINI_API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -H \"Api-Revision: 2026-05-20\" \\\n  -d '{\n    \"model\": \"gemini-3.5-flash\",\n    \"input\": [\n      {\n        \"type\": \"text\",\n        \"text\": \"What is in this picture?\"\n      },\n      {\n        \"type\": \"image\",\n        \"data\": \"BASE64_ENCODED_IMAGE\",\n        \"mime_type\": \"image/png\"\n      }\n    ]\n  }'\n"
          },
          {
            "lang": "python",
            "label": "multimodal_image",
            "source": "from google import genai\n\nclient = genai.Client()\nresponse = client.interactions.create(\n    model=\"gemini-3.5-flash\",\n    input=[\n      { \"type\": \"text\", \"text\": \"What is in this picture?\" },\n      { \"type\": \"image\", \"data\": \"BASE64_ENCODED_IMAGE\", \"mime_type\": \"image/png\" }\n    ]\n)\nprint(response.output_text)\n"
          },
          {
            "lang": "javascript",
            "label": "multimodal_image",
            "source": "import {GoogleGenAI} from '@google/genai';\n\nconst ai = new GoogleGenAI({});\nconst interaction = await ai.interactions.create({\n    model: 'gemini-3.5-flash',\n    input: [\n      { type: 'text', text: 'What is in this picture?' },\n      { type: 'image', data: 'BASE64_ENCODED_IMAGE', mime_type: 'image/png' }\n    ]\n});\nconsole.log(interaction.output_text);\n"
          },
          {
            "lang": "sh",
            "label": "function_calling",
            "source": "curl -X POST https://generativelanguage.googleapis.com/v1beta/interactions \\\n  -H \"x-goog-api-key: $GEMINI_API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -H \"Api-Revision: 2026-05-20\" \\\n  -d '{\n    \"model\": \"gemini-3.5-flash\",\n    \"tools\": [\n      {\n        \"type\": \"function\",\n        \"name\": \"get_weather\",\n        \"description\": \"Get the current weather in a given location\",\n        \"parameters\": {\n          \"type\": \"object\",\n          \"properties\": {\n            \"location\": {\n              \"type\": \"string\",\n              \"description\": \"The city and state, e.g. San Francisco, CA\"\n            }\n          },\n          \"required\": [\n            \"location\"\n          ]\n        }\n      }\n    ],\n    \"input\": \"What is the weather like in Boston, MA?\"\n  }'\n"
          },
          {
            "lang": "python",
            "label": "function_calling",
            "source": "from google import genai\n\nclient = genai.Client()\nresponse = client.interactions.create(\n    model=\"gemini-3.5-flash\",\n    tools=[{\n        \"type\": \"function\",\n        \"name\": \"get_weather\",\n        \"description\": \"Get the current weather in a given location\",\n        \"parameters\": {\n            \"type\": \"object\",\n            \"properties\": {\n                \"location\": {\n                    \"type\": \"string\",\n                    \"description\": \"The city and state, e.g. San Francisco, CA\"\n                }\n            },\n            \"required\": [\"location\"]\n        }\n    }],\n    input=\"What is the weather like in Boston, MA?\"\n)\nprint(response.steps[-1])\n"
          },
          {
            "lang": "javascript",
            "label": "function_calling",
            "source": "import {GoogleGenAI} from '@google/genai';\n\nconst ai = new GoogleGenAI({});\nconst interaction = await ai.interactions.create({\n    model: 'gemini-3.5-flash',\n    tools: [{\n        type: 'function',\n        name: 'get_weather',\n        description: 'Get the current weather in a given location',\n        parameters: {\n            type: 'object',\n            properties: {\n                location: {\n                    type: 'string',\n                    description: 'The city and state, e.g. San Francisco, CA'\n                }\n            },\n            required: ['location']\n        }\n    }],\n    input: 'What is the weather like in Boston, MA?'\n});\nconsole.log(interaction.steps.at(-1));\n"
          },
          {
            "lang": "sh",
            "label": "deep_research",
            "source": "curl -X POST https://generativelanguage.googleapis.com/v1beta/interactions \\\n  -H \"x-goog-api-key: $GEMINI_API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -H \"Api-Revision: 2026-05-20\" \\\n  -d '{\n    \"agent\": \"deep-research-pro-preview-12-2025\",\n    \"input\": \"Find a cure to cancer\",\n    \"background\": true\n  }'\n"
          },
          {
            "lang": "python",
            "label": "deep_research",
            "source": "from google import genai\n\nclient = genai.Client()\ninteraction = client.interactions.create(\n    agent=\"deep-research-pro-preview-12-2025\",\n    input=\"find a cure to cancer\",\n    background=True,\n)\nprint(interaction.status)\n"
          },
          {
            "lang": "javascript",
            "label": "deep_research",
            "source": "import {GoogleGenAI} from '@google/genai';\n\nconst ai = new GoogleGenAI({});\nconst interaction = await ai.interactions.create({\n    agent: 'deep-research-pro-preview-12-2025',\n    input: 'find a cure to cancer',\n    background: true,\n});\nconsole.log(interaction.status);\n"
          }
        ]
      }
    },
    "/{api_version}/interactions/{id}": {
      "get": {
        "operationId": "getInteractionById",
        "description": "Retrieves the full details of a single interaction based on its `Interaction.id`.",
        "security": [],
        "parameters": [
          {
            "$ref": "#/components/parameters/api_version"
          },
          {
            "name": "id",
            "in": "path",
            "description": "The unique identifier of the interaction to retrieve.",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "include_input",
            "in": "query",
            "deprecated": true,
            "schema": {
              "type": "boolean",
              "default": false
            },
            "description": "If set to true, includes the input in the response."
          },
          {
            "name": "last_event_id",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "Optional. If set, resumes the interaction stream from the next chunk after the event marked by the event id. Can only be used if `stream` is true."
          },
          {
            "name": "stream",
            "in": "query",
            "schema": {
              "type": "boolean",
              "default": false
            },
            "description": "If set to true, the generated content will be streamed incrementally."
          }
        ],
        "responses": {
          "200": {
            "description": "Successful retrieval of the interaction.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Interaction"
                },
                "examples": {
                  "get": {
                    "summary": "Get Interaction",
                    "value": {
                      "id": "v1_ChdPU0F4YWFtNkFwS2kxZThQZ05lbXdROBIXT1NBeGFhbTZBcEtpMWU4UGdOZW13UTg",
                      "model": "gemini-3.5-flash",
                      "status": "completed",
                      "object": "interaction",
                      "created": "2025-11-26T12:25:15Z",
                      "updated": "2025-11-26T12:25:15Z",
                      "steps": [
                        {
                          "type": "model_output",
                          "content": [
                            {
                              "type": "text",
                              "text": "I'm doing great, thank you for asking! How can I help you today?"
                            }
                          ]
                        }
                      ]
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Error getting interaction",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          }
        },
        "summary": "Retrieving an interaction",
        "x-codeSamples": [
          {
            "lang": "sh",
            "label": "get",
            "source": "# [setup]\nINTERACTION_ID=$(curl -s -X POST https://generativelanguage.googleapis.com/v1beta/interactions \\\n  -H \"x-goog-api-key: $GEMINI_API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -H \"Api-Revision: 2026-05-20\" \\\n  -d '{\"model\": \"gemini-3.5-flash\", \"input\": \"Say hello.\"}' \\\n  | python3 -c \"import sys,json; print(json.load(sys.stdin)['id'])\")\n# [/setup]\n\ncurl -X GET \"https://generativelanguage.googleapis.com/v1beta/interactions/$INTERACTION_ID\" \\\n  -H \"x-goog-api-key: $GEMINI_API_KEY\" \\\n  -H \"Api-Revision: 2026-05-20\"\n"
          },
          {
            "lang": "python",
            "label": "get",
            "source": "from google import genai\n\nclient = genai.Client()\n\n# [setup]\ncreated = client.interactions.create(\n    model=\"gemini-3.5-flash\",\n    input=\"Say hello.\"\n)\n# [/setup]\n\ninteraction = client.interactions.get(id=created.id)\nprint(interaction.status)\n"
          },
          {
            "lang": "javascript",
            "label": "get",
            "source": "import {GoogleGenAI} from '@google/genai';\n\nconst ai = new GoogleGenAI({});\n\n// [setup]\nconst created = await ai.interactions.create({\n    model: 'gemini-3.5-flash',\n    input: 'Say hello.'\n});\n// [/setup]\n\nconst interaction = await ai.interactions.get(created.id);\nconsole.log(interaction.status);\n"
          }
        ]
      },
      "delete": {
        "operationId": "deleteInteraction",
        "description": "Deletes the interaction by id.",
        "summary": "Deleting an interaction",
        "security": [],
        "parameters": [
          {
            "$ref": "#/components/parameters/api_version"
          },
          {
            "name": "id",
            "in": "path",
            "description": "The unique identifier of the interaction to delete.",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful deletion of the interaction.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                },
                "examples": {
                  "delete": {
                    "summary": "Delete Interaction",
                    "value": {}
                  }
                }
              }
            }
          },
          "default": {
            "description": "Error deleting interaction",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "sh",
            "label": "delete",
            "source": "# [setup]\nINTERACTION_ID=$(curl -s -X POST https://generativelanguage.googleapis.com/v1beta/interactions \\\n  -H \"x-goog-api-key: $GEMINI_API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -H \"Api-Revision: 2026-05-20\" \\\n  -d '{\"model\": \"gemini-3.5-flash\", \"input\": \"Hello\"}' \\\n  | python3 -c \"import sys,json; print(json.load(sys.stdin)['id'])\")\n# [/setup]\n\ncurl -X DELETE \"https://generativelanguage.googleapis.com/v1beta/interactions/$INTERACTION_ID\" \\\n  -H \"x-goog-api-key: $GEMINI_API_KEY\" \\\n  -H \"Api-Revision: 2026-05-20\"\n"
          },
          {
            "lang": "python",
            "label": "delete",
            "source": "from google import genai\n\nclient = genai.Client()\n\n# [setup]\ncreated = client.interactions.create(\n    model=\"gemini-3.5-flash\",\n    input=\"Hello\",\n)\n# [/setup]\n\nclient.interactions.delete(id=created.id)\nprint(\"Interaction deleted successfully.\")\n"
          },
          {
            "lang": "javascript",
            "label": "delete",
            "source": "import {GoogleGenAI} from '@google/genai';\n\nconst ai = new GoogleGenAI({});\n\n// [setup]\nconst created = await ai.interactions.create({\n    model: 'gemini-3.5-flash',\n    input: 'Hello',\n});\n// [/setup]\n\nawait ai.interactions.delete(created.id);\nconsole.log('Interaction deleted successfully.');\n"
          }
        ]
      }
    },
    "/{api_version}/interactions/{id}/cancel": {
      "post": {
        "operationId": "cancelInteractionById",
        "description": "Cancels an interaction by id. This only applies to background interactions that are still running.",
        "security": [],
        "parameters": [
          {
            "$ref": "#/components/parameters/api_version"
          },
          {
            "name": "id",
            "in": "path",
            "description": "The unique identifier of the interaction to cancel.",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful cancellation of the interaction.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Interaction"
                },
                "examples": {
                  "cancel": {
                    "summary": "Cancel Interaction",
                    "value": {
                      "id": "v1_ChdPU0F4YWFtNkFwS2kxZThQZ05lbXdROBIXT1NBeGFhbTZBcEtpMWU4UGdOZW13UTg",
                      "agent": "deep-research-pro-preview-12-2025",
                      "status": "cancelled",
                      "object": "interaction",
                      "created": "2025-11-26T12:25:15Z",
                      "updated": "2025-11-26T12:25:15Z"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Error cancelling interaction",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          }
        },
        "summary": "Canceling an interaction",
        "x-codeSamples": [
          {
            "lang": "sh",
            "label": "cancel",
            "source": "# [setup]\nINTERACTION_ID=$(curl -s -X POST https://generativelanguage.googleapis.com/v1beta/interactions \\\n  -H \"x-goog-api-key: $GEMINI_API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -H \"Api-Revision: 2026-05-20\" \\\n  -d '{\"model\": \"gemini-3.5-flash\", \"input\": \"Write a long essay about the history of computing.\", \"background\": true}' \\\n  | python3 -c \"import sys,json; print(json.load(sys.stdin)['id'])\")\n# [/setup]\n\ncurl -X POST \"https://generativelanguage.googleapis.com/v1beta/interactions/$INTERACTION_ID/cancel\" \\\n  -H \"x-goog-api-key: $GEMINI_API_KEY\" \\\n  -H \"Api-Revision: 2026-05-20\"\n"
          },
          {
            "lang": "python",
            "label": "cancel",
            "source": "from google import genai\n\nclient = genai.Client()\n\n# Start a background interaction so it stays in-progress.\ncreated = client.interactions.create(\n    model=\"gemini-3.5-flash\",\n    input=\"Write a long essay about the history of computing.\",\n    tools=[{\"type\": \"computer_use\"}],\n    background=True,\n)\n\n# Cancel the in-progress interaction.\ninteraction = client.interactions.cancel(id=created.id)\nprint(interaction.status)\n"
          },
          {
            "lang": "javascript",
            "label": "cancel",
            "source": "import {GoogleGenAI} from '@google/genai';\n\nconst ai = new GoogleGenAI({});\n\n// Start a background interaction so it stays in-progress.\nconst created = await ai.interactions.create({\n    model: 'gemini-3.5-flash',\n    input: 'Write a long essay about the history of computing.',\n    tools: [{ type: 'computer_use' }],\n    background: true,\n});\n\n// Cancel the in-progress interaction.\nconst interaction = await ai.interactions.cancel(created.id);\nconsole.log(interaction.status);\n"
          }
        ]
      }
    },
    "/{api_version}/interactions?agent": {
      "parameters": [
        {
          "$ref": "#/components/parameters/api_version"
        }
      ],
      "post": {
        "operationId": "CreateInteraction",
        "description": "Creates a new interaction.",
        "security": [],
        "parameters": [
          {
            "$ref": "#/components/parameters/api_version"
          }
        ],
        "requestBody": {
          "description": "The request body.",
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateAgentInteractionParams"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful operation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Interaction"
                }
              }
            }
          },
          "default": {
            "description": "Error creating interaction",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          }
        },
        "summary": "Creating an interaction",
        "x-internal": true
      }
    },
    "/{api_version}/interactions?model": {
      "parameters": [
        {
          "$ref": "#/components/parameters/api_version"
        }
      ],
      "post": {
        "operationId": "CreateInteraction",
        "description": "Creates a new interaction.",
        "security": [],
        "parameters": [
          {
            "$ref": "#/components/parameters/api_version"
          }
        ],
        "requestBody": {
          "description": "The request body.",
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateModelInteractionParams"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful operation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Interaction"
                }
              }
            }
          },
          "default": {
            "description": "Error creating interaction",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          }
        },
        "summary": "Creating an interaction",
        "x-internal": true
      }
    },
    "/{api_version}/webhooks": {
      "parameters": [
        {
          "$ref": "#/components/parameters/api_version"
        }
      ],
      "post": {
        "operationId": "CreateWebhook",
        "description": "Creates a new Webhook.",
        "security": [],
        "parameters": [],
        "requestBody": {
          "description": "Required. The webhook to create.",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Webhook"
              }
            }
          }
        },
        "responses": {
          "default": {
            "description": "Successful operation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Webhook"
                }
              }
            }
          }
        }
      },
      "get": {
        "operationId": "ListWebhooks",
        "description": "Lists all Webhooks.",
        "security": [],
        "parameters": [
          {
            "name": "page_size",
            "description": "Optional. The maximum number of webhooks to return. The service may return fewer than\nthis value. If unspecified, at most 50 webhooks will be returned.\nThe maximum value is 1000.",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "page_token",
            "description": "Optional. A page token, received from a previous `ListWebhooks` call.\nProvide this to retrieve the subsequent page.",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "default": {
            "description": "Successful operation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListWebhooksResponse"
                }
              }
            }
          }
        }
      }
    },
    "/{api_version}/webhooks/{id}": {
      "parameters": [
        {
          "$ref": "#/components/parameters/api_version"
        },
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "operationId": "GetWebhook",
        "description": "Gets a specific Webhook.",
        "security": [],
        "parameters": [
          {
            "name": "id",
            "description": "Required. The ID of the webhook to retrieve.",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "default": {
            "description": "Successful operation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Webhook"
                }
              }
            }
          }
        }
      },
      "patch": {
        "operationId": "UpdateWebhook",
        "description": "Updates an existing Webhook.",
        "security": [],
        "parameters": [
          {
            "name": "id",
            "description": "Required. The ID of the webhook to update.",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "update_mask",
            "description": "Optional. The list of fields to update.",
            "in": "query",
            "schema": {
              "type": "string",
              "pattern": "^(\\s*[^,\\s.]+(\\s*[,.]\\s*[^,\\s.]+)*)?$",
              "format": "google-fieldmask"
            }
          }
        ],
        "requestBody": {
          "description": "Required. The webhook to update.",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookUpdate"
              }
            }
          }
        },
        "responses": {
          "default": {
            "description": "Successful operation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Webhook"
                }
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "DeleteWebhook",
        "description": "Deletes a Webhook.",
        "security": [],
        "parameters": [
          {
            "name": "id",
            "description": "Required. The ID of the webhook to delete.\nFormat: `{webhook_id}`",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "default": {
            "description": "Successful operation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Empty"
                }
              }
            }
          }
        }
      }
    },
    "/{api_version}/webhooks/{id}:ping": {
      "parameters": [
        {
          "$ref": "#/components/parameters/api_version"
        },
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "post": {
        "operationId": "PingWebhook",
        "description": "Sends a ping event to a Webhook.",
        "security": [],
        "parameters": [
          {
            "name": "id",
            "description": "Required. The ID of the webhook to ping.\nFormat: `{webhook_id}`",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "description": "The request body.",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PingWebhookRequest"
              }
            }
          }
        },
        "responses": {
          "default": {
            "description": "Successful operation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PingWebhookResponse"
                }
              }
            }
          }
        }
      }
    },
    "/{api_version}/webhooks/{id}:rotateSigningSecret": {
      "parameters": [
        {
          "$ref": "#/components/parameters/api_version"
        },
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "post": {
        "operationId": "RotateSigningSecret",
        "description": "Generates a new signing secret for a Webhook.",
        "security": [],
        "parameters": [
          {
            "name": "id",
            "description": "Required. The ID of the webhook for which to generate a signing secret.\nFormat: `{webhook_id}`",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "description": "The request body.",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RotateSigningSecretRequest"
              }
            }
          }
        },
        "responses": {
          "default": {
            "description": "Successful operation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RotateSigningSecretResponse"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "parameters": {
      "api_version": {
        "name": "api_version",
        "description": "Which version of the API to use.",
        "schema": {
          "type": "string"
        },
        "in": "path"
      }
    },
    "securitySchemes": {},
    "schemas": {
      "Agent": {
        "description": "An agent definition for the CreateAgent API.\nThis message is the target for annotation-parser-based JSON parsing.\nNew format:\n  {\n    \"id\": \"customer-sentinel\",\n    \"base_agent\": \"\",\n    \"system_instruction\": \"...\",\n    \"base_environment\": { \"type\": \"remote\", \"sources\": [...] },\n    \"tools\": [ {\"type\": \"code_execution\"} ]\n  }",
        "type": "object",
        "properties": {
          "id": {
            "description": "The unique identifier for the agent.",
            "type": "string"
          },
          "base_agent": {
            "description": "The base agent to extend.",
            "type": "string"
          },
          "system_instruction": {
            "description": "System instruction for the agent.",
            "type": "string"
          },
          "description": {
            "description": "Agent description for developers to quickly read and understand.",
            "type": "string"
          },
          "tools": {
            "description": "The tools available to the agent.",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AgentTool"
            }
          },
          "base_environment": {
            "description": "The environment configuration for the agent.",
            "oneOf": [
              {
                "$ref": "#/components/schemas/EnvironmentConfig"
              },
              {
                "type": "string"
              }
            ],
            "discriminator": {
              "propertyName": "type"
            }
          }
        }
      },
      "AgentOption": {
        "title": "Agent",
        "description": "The agent to interact with.",
        "anyOf": [
          {
            "type": "string"
          },
          {
            "description": "Gemini Deep Research Agent",
            "const": "deep-research-preview-04-2026",
            "x-stainless-nominal": false
          },
          {
            "description": "Gemini Deep Research Agent",
            "const": "deep-research-pro-preview-12-2025",
            "x-stainless-nominal": false
          },
          {
            "description": "Gemini Deep Research Max Agent",
            "const": "deep-research-max-preview-04-2026",
            "x-stainless-nominal": false
          },
          {
            "description": "Use the Antigravity managed agent to perform multi-step tasks that require reasoning, file operations, and tool use.",
            "const": "antigravity-preview-05-2026",
            "x-stainless-nominal": false
          }
        ]
      },
      "AgentTool": {
        "description": "A tool that the agent can use.",
        "type": "object",
        "oneOf": [
          {
            "$ref": "#/components/schemas/CodeExecution"
          },
          {
            "$ref": "#/components/schemas/GoogleSearch"
          },
          {
            "$ref": "#/components/schemas/McpServer"
          },
          {
            "$ref": "#/components/schemas/UrlContext"
          }
        ],
        "discriminator": {
          "propertyName": "type"
        }
      },
      "AllowedTools": {
        "description": "The configuration for allowed tools.",
        "type": "object",
        "properties": {
          "mode": {
            "description": "The mode of the tool choice.",
            "$ref": "#/components/schemas/ToolChoiceType"
          },
          "tools": {
            "description": "The names of the allowed tools.",
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "AllowlistEntry": {
        "type": "object",
        "description": "A single domain allowlist rule with optional header injection.",
        "required": [
          "domain"
        ],
        "properties": {
          "domain": {
            "type": "string",
            "description": "Domain to allow outbound requests to. Supports wildcards (e.g. '*.googleapis.com'). Use '*' to allow all domains."
          },
          "transform": {
            "type": "array",
            "description": "Headers to inject on all outbound requests matching this domain. Each entry is a flat {header_name: header_value} object. The egress proxy injects these automatically.",
            "items": {
              "type": "object",
              "additionalProperties": {
                "type": "string"
              },
              "description": "A single header to inject, e.g. {'Authorization': 'Bearer token'} or {'x-goog-api-key': 'key'}."
            }
          }
        }
      },
      "Annotation": {
        "description": "Citation information for model-generated content.",
        "type": "object",
        "oneOf": [
          {
            "$ref": "#/components/schemas/FileCitation"
          },
          {
            "$ref": "#/components/schemas/PlaceCitation"
          },
          {
            "$ref": "#/components/schemas/UrlCitation"
          }
        ],
        "discriminator": {
          "propertyName": "type"
        }
      },
      "ArgumentsDelta": {
        "type": "object",
        "properties": {
          "type": {
            "const": "arguments_delta"
          },
          "arguments": {
            "type": "string"
          }
        },
        "required": [
          "type"
        ]
      },
      "AudioContent": {
        "description": "An audio content block.",
        "type": "object",
        "properties": {
          "type": {
            "const": "audio"
          },
          "data": {
            "description": "The audio content.",
            "type": "string",
            "format": "byte"
          },
          "uri": {
            "description": "The URI of the audio.",
            "type": "string"
          },
          "mime_type": {
            "description": "The mime type of the audio.",
            "type": "string",
            "x-google-enum-descriptions": [
              "WAV audio format",
              "MP3 audio format",
              "AIFF audio format",
              "AAC audio format",
              "OGG audio format",
              "FLAC audio format",
              "MPEG audio format",
              "M4A audio format",
              "L16 audio format",
              "OPUS audio format",
              "ALAW audio format",
              "MULAW audio format"
            ],
            "enum": [
              "audio/wav",
              "audio/mp3",
              "audio/aiff",
              "audio/aac",
              "audio/ogg",
              "audio/flac",
              "audio/mpeg",
              "audio/m4a",
              "audio/l16",
              "audio/opus",
              "audio/alaw",
              "audio/mulaw"
            ]
          },
          "channels": {
            "description": "The number of audio channels.",
            "type": "integer",
            "format": "int32"
          },
          "sample_rate": {
            "description": "The sample rate of the audio.",
            "type": "integer",
            "format": "int32"
          }
        },
        "required": [
          "type"
        ],
        "examples": [
          {
            "audio": {
              "summary": "Audio",
              "value": {
                "type": "audio",
                "data": "BASE64_ENCODED_AUDIO",
                "mime_type": "audio/wav"
              }
            }
          }
        ]
      },
      "AudioDelta": {
        "type": "object",
        "properties": {
          "type": {
            "const": "audio"
          },
          "data": {
            "type": "string",
            "format": "byte"
          },
          "uri": {
            "type": "string"
          },
          "mime_type": {
            "type": "string",
            "x-google-enum-descriptions": [
              "WAV audio format",
              "MP3 audio format",
              "AIFF audio format",
              "AAC audio format",
              "OGG audio format",
              "FLAC audio format",
              "MPEG audio format",
              "M4A audio format",
              "L16 audio format",
              "OPUS audio format",
              "ALAW audio format",
              "MULAW audio format"
            ],
            "enum": [
              "audio/wav",
              "audio/mp3",
              "audio/aiff",
              "audio/aac",
              "audio/ogg",
              "audio/flac",
              "audio/mpeg",
              "audio/m4a",
              "audio/l16",
              "audio/opus",
              "audio/alaw",
              "audio/mulaw"
            ]
          },
          "rate": {
            "description": "Deprecated. Use sample_rate instead. The value is ignored.",
            "deprecated": true,
            "type": "integer",
            "format": "int32"
          },
          "sample_rate": {
            "description": "The sample rate of the audio.",
            "type": "integer",
            "format": "int32"
          },
          "channels": {
            "description": "The number of audio channels.",
            "type": "integer",
            "format": "int32"
          }
        },
        "required": [
          "type"
        ]
      },
      "AudioResponseFormat": {
        "description": "Configuration for audio output format.",
        "type": "object",
        "properties": {
          "type": {
            "const": "audio"
          },
          "mime_type": {
            "description": "The MIME type of the audio output.",
            "type": "string",
            "x-google-enum-descriptions": [
              "MP3 audio format.",
              "OGG Opus audio format.",
              "Raw PCM (L16) audio format.",
              "WAV audio format.",
              "A-law audio format.",
              "Mu-law audio format."
            ],
            "enum": [
              "audio/mp3",
              "audio/ogg_opus",
              "audio/l16",
              "audio/wav",
              "audio/alaw",
              "audio/mulaw"
            ]
          },
          "delivery": {
            "description": "The delivery mode for the audio output.",
            "type": "string",
            "x-google-enum-descriptions": [
              "Audio data is returned inline in the response.",
              "Audio data is returned as a URI."
            ],
            "enum": [
              "inline",
              "uri"
            ]
          },
          "sample_rate": {
            "description": "Sample rate in Hz.",
            "type": "integer",
            "format": "int32"
          },
          "bit_rate": {
            "description": "Bit rate in bits per second (bps). Only applicable for compressed formats\n(MP3, Opus).",
            "type": "integer",
            "format": "int32"
          }
        },
        "required": [
          "type"
        ],
        "examples": [
          {
            "audio_response_format": {
              "summary": "Audio Output",
              "value": {
                "type": "audio",
                "sample_rate": 24000
              }
            }
          }
        ]
      },
      "CodeExecution": {
        "description": "A tool that can be used by the model to execute code.",
        "type": "object",
        "properties": {
          "type": {
            "const": "code_execution"
          }
        },
        "required": [
          "type"
        ],
        "x-codeSamples": [
          {
            "lang": "sh",
            "label": "code_execution",
            "source": "curl -X POST https://generativelanguage.googleapis.com/v1beta/interactions \\\n  -H \"x-goog-api-key: $GEMINI_API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -H \"Api-Revision: 2026-05-20\" \\\n  -d '{\n    \"model\": \"gemini-3.5-flash\",\n    \"tools\": [{\n      \"type\": \"code_execution\"\n    }],\n    \"input\": \"Calculate the first 10 Fibonacci numbers\"\n  }'\n"
          },
          {
            "lang": "python",
            "label": "code_execution",
            "source": "from google import genai\n\nclient = genai.Client()\nresponse = client.interactions.create(\n    model=\"gemini-3.5-flash\",\n    tools=[{\"type\": \"code_execution\"}],\n    input=\"Calculate the first 10 Fibonacci numbers\"\n)\nprint(response.output_text)\n"
          },
          {
            "lang": "javascript",
            "label": "code_execution",
            "source": "import {GoogleGenAI} from '@google/genai';\n\nconst ai = new GoogleGenAI({});\nconst interaction = await ai.interactions.create({\n    model: 'gemini-3.5-flash',\n    tools: [{ type: 'code_execution' }],\n    input: 'Calculate the first 10 Fibonacci numbers'\n});\nconsole.log(interaction.output_text);\n"
          }
        ]
      },
      "CodeExecutionCallArguments": {
        "description": "The arguments to pass to the code execution.",
        "type": "object",
        "properties": {
          "language": {
            "description": "Programming language of the `code`.",
            "type": "string",
            "x-google-enum-descriptions": [
              "Python >= 3.10, with numpy and simpy available."
            ],
            "enum": [
              "python"
            ]
          },
          "code": {
            "description": "The code to be executed.",
            "type": "string"
          }
        }
      },
      "CodeExecutionCallDelta": {
        "type": "object",
        "properties": {
          "type": {
            "const": "code_execution_call"
          },
          "arguments": {
            "$ref": "#/components/schemas/CodeExecutionCallArguments"
          },
          "signature": {
            "description": "A signature hash for backend validation.",
            "type": "string",
            "format": "byte"
          }
        },
        "required": [
          "arguments",
          "type"
        ]
      },
      "CodeExecutionCallStep": {
        "description": "Code execution call step.",
        "type": "object",
        "properties": {
          "type": {
            "const": "code_execution_call"
          },
          "arguments": {
            "description": "Required. The arguments to pass to the code execution.",
            "$ref": "#/components/schemas/CodeExecutionCallStepArguments"
          },
          "id": {
            "description": "Required. A unique ID for this specific tool call.",
            "type": "string"
          },
          "signature": {
            "description": "A signature hash for backend validation.",
            "type": "string",
            "format": "byte"
          }
        },
        "required": [
          "arguments",
          "id",
          "type"
        ],
        "examples": [
          {
            "code_execution_call": {
              "summary": "CodeExecutionCallStep",
              "value": {
                "type": "code_execution_call",
                "id": "code_call_71021",
                "arguments": {
                  "code": "print(sum(range(1, 11)))"
                }
              }
            }
          }
        ]
      },
      "CodeExecutionCallStepArguments": {
        "description": "The arguments to pass to the code execution.",
        "type": "object",
        "properties": {
          "language": {
            "description": "Programming language of the `code`.",
            "type": "string",
            "x-google-enum-descriptions": [
              "Python >= 3.10, with numpy and simpy available."
            ],
            "enum": [
              "python"
            ]
          },
          "code": {
            "description": "The code to be executed.",
            "type": "string"
          }
        }
      },
      "CodeExecutionResultDelta": {
        "type": "object",
        "properties": {
          "type": {
            "const": "code_execution_result"
          },
          "result": {
            "type": "string"
          },
          "is_error": {
            "type": "boolean"
          },
          "signature": {
            "description": "A signature hash for backend validation.",
            "type": "string",
            "format": "byte"
          }
        },
        "required": [
          "result",
          "type"
        ]
      },
      "CodeExecutionResultStep": {
        "description": "Code execution result step.",
        "type": "object",
        "properties": {
          "type": {
            "const": "code_execution_result"
          },
          "result": {
            "description": "Required. The output of the code execution.",
            "type": "string"
          },
          "is_error": {
            "description": "Whether the code execution resulted in an error.",
            "type": "boolean"
          },
          "call_id": {
            "description": "Required. ID to match the ID from the function call block.",
            "type": "string"
          },
          "signature": {
            "description": "A signature hash for backend validation.",
            "type": "string",
            "format": "byte"
          }
        },
        "required": [
          "call_id",
          "result",
          "type"
        ],
        "examples": [
          {
            "code_execution_result": {
              "summary": "CodeExecutionResultStep",
              "value": {
                "type": "code_execution_result",
                "call_id": "code_call_71021",
                "result": "55\n"
              }
            }
          }
        ]
      },
      "ComputerUse": {
        "description": "A tool that can be used by the model to interact with the computer.",
        "type": "object",
        "properties": {
          "type": {
            "const": "computer_use"
          },
          "environment": {
            "description": "The environment being operated.",
            "type": "string",
            "x-google-enum-descriptions": [
              "Operates in a web browser."
            ],
            "enum": [
              "browser"
            ]
          },
          "excluded_predefined_functions": {
            "description": "The list of predefined functions that are excluded from the model call.",
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        },
        "required": [
          "type"
        ],
        "x-codeSamples": [
          {
            "lang": "sh",
            "label": "computer_use",
            "source": "curl -X POST https://generativelanguage.googleapis.com/v1beta/interactions \\\n  -H \"x-goog-api-key: $GEMINI_API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -H \"Api-Revision: 2026-05-20\" \\\n  -d '{\n    \"model\": \"gemini-2.5-computer-use-preview-10-2025\",\n    \"tools\": [{\n      \"type\": \"computer_use\"\n    }],\n    \"input\": \"Find a flight to Tokyo\"\n  }'\n"
          },
          {
            "lang": "python",
            "label": "computer_use",
            "source": "from google import genai\n\nclient = genai.Client()\nresponse = client.interactions.create(\n    model=\"gemini-2.5-computer-use-preview-10-2025\",\n    tools=[{\"type\": \"computer_use\"}],\n    input=\"Find a flight to Tokyo\"\n)\nprint(response.output_text)\n"
          },
          {
            "lang": "javascript",
            "label": "computer_use",
            "source": "import {GoogleGenAI} from '@google/genai';\n\nconst ai = new GoogleGenAI({});\nconst interaction = await ai.interactions.create({\n    model: 'gemini-2.5-computer-use-preview-10-2025',\n    tools: [{ type: 'computer_use'}],\n    input: 'Find a flight to Tokyo'\n});\nconsole.log(interaction.output_text);\n"
          }
        ]
      },
      "Content": {
        "description": "The content of the response.",
        "type": "object",
        "oneOf": [
          {
            "$ref": "#/components/schemas/AudioContent"
          },
          {
            "$ref": "#/components/schemas/DocumentContent"
          },
          {
            "$ref": "#/components/schemas/ImageContent"
          },
          {
            "$ref": "#/components/schemas/TextContent"
          },
          {
            "$ref": "#/components/schemas/VideoContent"
          }
        ],
        "discriminator": {
          "propertyName": "type"
        }
      },
      "ContentDelta": {
        "type": "object",
        "properties": {
          "event_type": {
            "const": "content.delta"
          },
          "index": {
            "type": "integer",
            "format": "int32"
          },
          "delta": {
            "$ref": "#/components/schemas/ContentDeltaData"
          },
          "event_id": {
            "description": "The event_id token to be used to resume the interaction stream, from\nthis event.",
            "type": "string"
          },
          "metadata": {
            "description": "Optional metadata accompanying ANY streamed event.",
            "$ref": "#/components/schemas/StreamMetadata"
          }
        },
        "required": [
          "delta",
          "event_type",
          "index"
        ],
        "examples": [
          {
            "content_delta": {
              "summary": "Content Delta",
              "value": {
                "event_type": "content.delta",
                "delta": {
                  "type": "text",
                  "text": "Elara\u2019s life was a symphony of quiet moments. A librarian, she found solace in the hushed aisles, the scent of aged paper, and the predictable rhythm of her days. Her small apartment, meticulously ordered, reflected this internal calm, save"
                },
                "index": 1
              }
            }
          }
        ]
      },
      "ContentDeltaData": {
        "description": "The delta content data for a content block.",
        "type": "object",
        "oneOf": [
          {
            "$ref": "#/components/schemas/AudioDelta"
          },
          {
            "$ref": "#/components/schemas/CodeExecutionCallDelta"
          },
          {
            "$ref": "#/components/schemas/CodeExecutionResultDelta"
          },
          {
            "$ref": "#/components/schemas/DocumentDelta"
          },
          {
            "$ref": "#/components/schemas/FileSearchCallDelta"
          },
          {
            "$ref": "#/components/schemas/FileSearchResultDelta"
          },
          {
            "$ref": "#/components/schemas/FunctionCallDelta"
          },
          {
            "$ref": "#/components/schemas/FunctionResultDelta"
          },
          {
            "$ref": "#/components/schemas/GoogleMapsCallDelta"
          },
          {
            "$ref": "#/components/schemas/GoogleMapsResultDelta"
          },
          {
            "$ref": "#/components/schemas/GoogleSearchCallDelta"
          },
          {
            "$ref": "#/components/schemas/GoogleSearchResultDelta"
          },
          {
            "$ref": "#/components/schemas/ImageDelta"
          },
          {
            "$ref": "#/components/schemas/McpServerToolCallDelta"
          },
          {
            "$ref": "#/components/schemas/McpServerToolResultDelta"
          },
          {
            "$ref": "#/components/schemas/TextAnnotationDelta"
          },
          {
            "$ref": "#/components/schemas/TextDelta"
          },
          {
            "$ref": "#/components/schemas/ThoughtSignatureDelta"
          },
          {
            "$ref": "#/components/schemas/ThoughtSummaryDelta"
          },
          {
            "$ref": "#/components/schemas/UrlContextCallDelta"
          },
          {
            "$ref": "#/components/schemas/UrlContextResultDelta"
          },
          {
            "$ref": "#/components/schemas/VideoDelta"
          }
        ],
        "discriminator": {
          "propertyName": "type"
        }
      },
      "ContentStart": {
        "type": "object",
        "properties": {
          "event_type": {
            "const": "content.start"
          },
          "index": {
            "type": "integer",
            "format": "int32"
          },
          "content": {
            "$ref": "#/components/schemas/Content"
          },
          "event_id": {
            "description": "The event_id token to be used to resume the interaction stream, from\nthis event.",
            "type": "string"
          },
          "metadata": {
            "description": "Optional metadata accompanying ANY streamed event.",
            "$ref": "#/components/schemas/StreamMetadata"
          }
        },
        "required": [
          "content",
          "event_type",
          "index"
        ],
        "examples": [
          {
            "content_start": {
              "summary": "Content Start",
              "value": {
                "event_type": "content.start",
                "content": {
                  "type": "text"
                },
                "index": 1
              }
            }
          }
        ]
      },
      "ContentStop": {
        "type": "object",
        "properties": {
          "event_type": {
            "const": "content.stop"
          },
          "index": {
            "type": "integer",
            "format": "int32"
          },
          "event_id": {
            "description": "The event_id token to be used to resume the interaction stream, from\nthis event.",
            "type": "string"
          },
          "metadata": {
            "description": "Optional metadata accompanying ANY streamed event.",
            "$ref": "#/components/schemas/StreamMetadata"
          }
        },
        "required": [
          "event_type",
          "index"
        ],
        "examples": [
          {
            "content_stop": {
              "summary": "Content Stop",
              "value": {
                "event_type": "content.stop",
                "index": 1
              }
            }
          }
        ]
      },
      "CreateAgentInteractionParams": {
        "description": "Parameters for creating agent interactions",
        "properties": {
          "agent": {
            "$ref": "#/components/schemas/AgentOption",
            "description": "The name of the `Agent` used for generating the interaction."
          },
          "stream": {
            "description": "Input only. Whether the interaction will be streamed.",
            "writeOnly": true,
            "type": "boolean"
          },
          "store": {
            "description": "Input only. Whether to store the response and request for later retrieval.",
            "writeOnly": true,
            "type": "boolean"
          },
          "background": {
            "description": "Input only. Whether to run the model interaction in the background.",
            "writeOnly": true,
            "type": "boolean"
          },
          "id": {
            "description": "Required. Output only. A unique identifier for the interaction completion.",
            "readOnly": true,
            "type": "string"
          },
          "status": {
            "description": "Required. Output only. The status of the interaction.",
            "readOnly": true,
            "type": "string",
            "x-google-enum-descriptions": [
              "The interaction is in progress.",
              "The interaction requires action/input from the user.",
              "The interaction is completed.",
              "The interaction failed.",
              "The interaction was cancelled.",
              "The interaction is completed, but contains incomplete results (e.g.\nhitting max_tokens).",
              "The interaction was halted because the token budget was exceeded."
            ],
            "enum": [
              "in_progress",
              "requires_action",
              "completed",
              "failed",
              "cancelled",
              "incomplete",
              "budget_exceeded"
            ]
          },
          "created": {
            "description": "Required. Output only. The time at which the response was created in ISO 8601 format\n(YYYY-MM-DDThh:mm:ssZ).",
            "readOnly": true,
            "type": "string",
            "format": "date-time"
          },
          "updated": {
            "description": "Required. Output only. The time at which the response was last updated in ISO 8601 format\n(YYYY-MM-DDThh:mm:ssZ).",
            "readOnly": true,
            "type": "string",
            "format": "date-time"
          },
          "role": {
            "description": "Output only. The role of the interaction.",
            "readOnly": true,
            "deprecated": true,
            "type": "string"
          },
          "system_instruction": {
            "description": "System instruction for the interaction.",
            "type": "string"
          },
          "tools": {
            "description": "A list of tool declarations the model may call during interaction.",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Tool"
            }
          },
          "usage": {
            "description": "Output only. Statistics on the interaction request's token usage.",
            "readOnly": true,
            "$ref": "#/components/schemas/Usage"
          },
          "response_modalities": {
            "description": "The requested modalities of the response (TEXT, IMAGE, AUDIO).",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ResponseModality"
            }
          },
          "response_mime_type": {
            "description": "The mime type of the response. This is required if response_format is set.",
            "deprecated": true,
            "type": "string"
          },
          "previous_interaction_id": {
            "description": "The ID of the previous interaction, if any.",
            "type": "string"
          },
          "environment_id": {
            "description": "Output only. The environment ID for the interaction. Only populated if environment\nconfig is set in the request.",
            "readOnly": true,
            "type": "string"
          },
          "service_tier": {
            "description": "The service tier for the interaction.",
            "$ref": "#/components/schemas/ServiceTier"
          },
          "webhook_config": {
            "description": "Optional. Webhook configuration for receiving notifications when the\ninteraction completes.",
            "$ref": "#/components/schemas/WebhookConfig"
          },
          "input": {
            "$ref": "#/components/schemas/InteractionsInput"
          },
          "response_format": {
            "description": "Enforces that the generated response is a JSON object that complies with the JSON schema specified in this field.",
            "oneOf": [
              {
                "$ref": "#/components/schemas/ResponseFormat"
              },
              {
                "$ref": "#/components/schemas/ResponseFormatList"
              }
            ]
          },
          "environment": {
            "description": "The environment configuration for the interaction. Can be an object specifying remote environment sources or a string referencing an existing environment ID.",
            "oneOf": [
              {
                "$ref": "#/components/schemas/EnvironmentConfig"
              },
              {
                "type": "string"
              }
            ]
          },
          "agent_config": {
            "description": "Configuration parameters for the agent interaction.",
            "oneOf": [
              {
                "$ref": "#/components/schemas/DeepResearchAgentConfig"
              },
              {
                "$ref": "#/components/schemas/DynamicAgentConfig"
              }
            ],
            "discriminator": {
              "propertyName": "type"
            }
          }
        },
        "required": [
          "agent",
          "input"
        ]
      },
      "CreateModelInteractionParams": {
        "description": "Parameters for creating model interactions",
        "properties": {
          "model": {
            "$ref": "#/components/schemas/ModelOption",
            "description": "The name of the `Model` used for generating the interaction."
          },
          "stream": {
            "description": "Input only. Whether the interaction will be streamed.",
            "writeOnly": true,
            "type": "boolean"
          },
          "store": {
            "description": "Input only. Whether to store the response and request for later retrieval.",
            "writeOnly": true,
            "type": "boolean"
          },
          "background": {
            "description": "Input only. Whether to run the model interaction in the background.",
            "writeOnly": true,
            "type": "boolean"
          },
          "id": {
            "description": "Required. Output only. A unique identifier for the interaction completion.",
            "readOnly": true,
            "type": "string"
          },
          "status": {
            "description": "Required. Output only. The status of the interaction.",
            "readOnly": true,
            "type": "string",
            "x-google-enum-descriptions": [
              "The interaction is in progress.",
              "The interaction requires action/input from the user.",
              "The interaction is completed.",
              "The interaction failed.",
              "The interaction was cancelled.",
              "The interaction is completed, but contains incomplete results (e.g.\nhitting max_tokens).",
              "The interaction was halted because the token budget was exceeded."
            ],
            "enum": [
              "in_progress",
              "requires_action",
              "completed",
              "failed",
              "cancelled",
              "incomplete",
              "budget_exceeded"
            ]
          },
          "created": {
            "description": "Required. Output only. The time at which the response was created in ISO 8601 format\n(YYYY-MM-DDThh:mm:ssZ).",
            "readOnly": true,
            "type": "string",
            "format": "date-time"
          },
          "updated": {
            "description": "Required. Output only. The time at which the response was last updated in ISO 8601 format\n(YYYY-MM-DDThh:mm:ssZ).",
            "readOnly": true,
            "type": "string",
            "format": "date-time"
          },
          "role": {
            "description": "Output only. The role of the interaction.",
            "readOnly": true,
            "deprecated": true,
            "type": "string"
          },
          "system_instruction": {
            "description": "System instruction for the interaction.",
            "type": "string"
          },
          "tools": {
            "description": "A list of tool declarations the model may call during interaction.",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Tool"
            }
          },
          "usage": {
            "description": "Output only. Statistics on the interaction request's token usage.",
            "readOnly": true,
            "$ref": "#/components/schemas/Usage"
          },
          "response_modalities": {
            "description": "The requested modalities of the response (TEXT, IMAGE, AUDIO).",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ResponseModality"
            }
          },
          "response_mime_type": {
            "description": "The mime type of the response. This is required if response_format is set.",
            "deprecated": true,
            "type": "string"
          },
          "previous_interaction_id": {
            "description": "The ID of the previous interaction, if any.",
            "type": "string"
          },
          "environment_id": {
            "description": "Output only. The environment ID for the interaction. Only populated if environment\nconfig is set in the request.",
            "readOnly": true,
            "type": "string"
          },
          "service_tier": {
            "description": "The service tier for the interaction.",
            "$ref": "#/components/schemas/ServiceTier"
          },
          "webhook_config": {
            "description": "Optional. Webhook configuration for receiving notifications when the\ninteraction completes.",
            "$ref": "#/components/schemas/WebhookConfig"
          },
          "input": {
            "$ref": "#/components/schemas/InteractionsInput"
          },
          "response_format": {
            "description": "Enforces that the generated response is a JSON object that complies with the JSON schema specified in this field.",
            "oneOf": [
              {
                "$ref": "#/components/schemas/ResponseFormat"
              },
              {
                "$ref": "#/components/schemas/ResponseFormatList"
              }
            ]
          },
          "environment": {
            "description": "The environment configuration for the interaction. Can be an object specifying remote environment sources or a string referencing an existing environment ID.",
            "oneOf": [
              {
                "$ref": "#/components/schemas/EnvironmentConfig"
              },
              {
                "type": "string"
              }
            ]
          },
          "generation_config": {
            "description": "Input only. Configuration parameters for the model interaction.",
            "writeOnly": true,
            "$ref": "#/components/schemas/GenerationConfig"
          }
        },
        "required": [
          "input",
          "model"
        ]
      },
      "DeepResearchAgentConfig": {
        "description": "Configuration for the Deep Research agent.",
        "type": "object",
        "properties": {
          "type": {
            "const": "deep-research"
          },
          "thinking_summaries": {
            "description": "Whether to include thought summaries in the response.",
            "$ref": "#/components/schemas/ThinkingSummaries"
          },
          "visualization": {
            "description": "Whether to include visualizations in the response.",
            "type": "string",
            "x-google-enum-descriptions": [
              "Do not include visualizations.",
              "Automatically include visualizations."
            ],
            "enum": [
              "off",
              "auto"
            ]
          },
          "collaborative_planning": {
            "description": "Enables human-in-the-loop planning for the Deep Research agent. If set to\ntrue, the Deep Research agent will provide a research plan in its response.\nThe agent will then proceed only if the user confirms the plan in the next\nturn.",
            "type": "boolean"
          },
          "enable_bigquery_tool": {
            "description": "Enables bigquery tool for the Deep Research agent.",
            "type": "boolean"
          }
        },
        "required": [
          "type"
        ]
      },
      "DeleteInteractionResponse": {
        "description": "Response for InteractionService.DeleteInteraction.",
        "type": "object"
      },
      "DocumentContent": {
        "description": "A document content block.",
        "type": "object",
        "properties": {
          "type": {
            "const": "document"
          },
          "data": {
            "description": "The document content.",
            "type": "string",
            "format": "byte"
          },
          "uri": {
            "description": "The URI of the document.",
            "type": "string"
          },
          "mime_type": {
            "description": "The mime type of the document.",
            "type": "string",
            "x-google-enum-descriptions": [
              "PDF document format",
              "CSV document format"
            ],
            "enum": [
              "application/pdf",
              "text/csv"
            ]
          }
        },
        "required": [
          "type"
        ],
        "examples": [
          {
            "document": {
              "summary": "Document",
              "value": {
                "type": "document",
                "data": "BASE64_ENCODED_DOCUMENT",
                "mime_type": "application/pdf"
              }
            }
          }
        ]
      },
      "DocumentDelta": {
        "type": "object",
        "properties": {
          "type": {
            "const": "document"
          },
          "data": {
            "type": "string",
            "format": "byte"
          },
          "uri": {
            "type": "string"
          },
          "mime_type": {
            "type": "string",
            "x-google-enum-descriptions": [
              "PDF document format",
              "CSV document format"
            ],
            "enum": [
              "application/pdf",
              "text/csv"
            ]
          }
        },
        "required": [
          "type"
        ]
      },
      "DynamicAgentConfig": {
        "description": "Configuration for dynamic agents.",
        "type": "object",
        "properties": {
          "type": {
            "const": "dynamic"
          }
        },
        "additionalProperties": {
          "description": "For agents that are not supported statically in the API definition."
        },
        "required": [
          "type"
        ]
      },
      "Empty": {
        "description": "A generic empty message that you can re-use to avoid defining duplicated\nempty messages in your APIs. A typical example is to use it as the request\nor the response type of an API method. For instance:\n\n    service Foo {\n      rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty);\n    }",
        "type": "object",
        "x-stainless-empty-object": true
      },
      "EnvironmentConfig": {
        "description": "Configuration for a custom environment.",
        "type": "object",
        "properties": {
          "type": {
            "const": "remote"
          },
          "sources": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Source"
            }
          },
          "network": {
            "description": "Network configuration for the environment.",
            "oneOf": [
              {
                "$ref": "#/components/schemas/EnvironmentNetworkEgressAllowlist"
              },
              {
                "type": "string",
                "x-google-enum-descriptions": [
                  "All network egress is blocked."
                ],
                "enum": [
                  "disabled"
                ]
              }
            ]
          }
        },
        "required": [
          "type"
        ],
        "examples": [
          {
            "inline_sources": {
              "summary": "Inline Sources",
              "value": {
                "type": "remote",
                "sources": [
                  {
                    "type": "inline",
                    "target": ".agents/AGENTS.md",
                    "content": "You are a data analyst. Always include visualizations and export results as PDF."
                  },
                  {
                    "type": "inline",
                    "target": ".agents/skills/slide-maker/SKILL.md",
                    "content": "---\nname: slide-maker\ndescription: Create HTML slide decks\n---\n# Slide Maker\n\nWhen asked to create a presentation:\n1. Analyze the input data\n2. Create an HTML slide deck with reveal.js\n3. Save to /workspace/output/slides.html"
                  }
                ]
              }
            }
          },
          {
            "external_sources": {
              "summary": "External Sources",
              "value": {
                "type": "remote",
                "sources": [
                  {
                    "type": "repository",
                    "source": "https://github.com/my-org/my-skills.git",
                    "target": ".agents/skills"
                  },
                  {
                    "type": "gcs",
                    "source": "gs://my-bucket/my-folder",
                    "target": "/workspace/data"
                  }
                ]
              }
            }
          },
          {
            "network_allowlist": {
              "summary": "Network Allowlist",
              "value": {
                "type": "remote",
                "network": {
                  "allowlist": [
                    {
                      "domain": "pypi.org"
                    },
                    {
                      "domain": "*.github.com"
                    }
                  ]
                }
              }
            }
          },
          {
            "proxy_credentials": {
              "summary": "Proxy Credentials",
              "value": {
                "type": "remote",
                "network": {
                  "allowlist": [
                    {
                      "domain": "api.github.com",
                      "transform": {
                        "Authorization": "Bearer YOUR_GITHUB_TOKEN"
                      }
                    }
                  ]
                }
              }
            }
          }
        ]
      },
      "EnvironmentNetworkEgressAllowlist": {
        "oneOf": [
          {
            "title": "Allowlist",
            "type": "object",
            "description": "Outbound networking configuration for the sandbox. When specified, restricts which external domains the sandbox can reach. Omit entirely to allow all outbound traffic with no header injection.",
            "properties": {
              "allowlist": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/AllowlistEntry"
                },
                "description": "List of allowed outbound domains. Only requests to listed domains are permitted. Use [{'domain': '*'}] to allow all domains while still injecting headers on specific ones."
              }
            },
            "example": {
              "allowlist": [
                {
                  "domain": "pypi.org"
                },
                {
                  "domain": "*.github.com"
                }
              ]
            }
          },
          {
            "title": "Disabled",
            "type": "string",
            "enum": [
              "disabled"
            ],
            "description": "Turns all network off.",
            "example": "disabled"
          }
        ],
        "description": "Outbound networking configuration for the sandbox. Accepts an object with an 'allowlist' array to restrict traffic, or the string 'disabled' to turn off all network access. Omit entirely to allow all outbound traffic with no header injection."
      },
      "Error": {
        "description": "Error message from an interaction.",
        "type": "object",
        "properties": {
          "code": {
            "description": "A URI that identifies the error type.",
            "type": "string"
          },
          "message": {
            "description": "A human-readable error message.",
            "type": "string"
          }
        }
      },
      "ErrorEvent": {
        "type": "object",
        "properties": {
          "event_type": {
            "const": "error"
          },
          "error": {
            "$ref": "#/components/schemas/Error"
          },
          "event_id": {
            "description": "The event_id token to be used to resume the interaction stream, from\nthis event.",
            "type": "string"
          },
          "metadata": {
            "description": "Optional metadata accompanying ANY streamed event.",
            "$ref": "#/components/schemas/StreamMetadata"
          }
        },
        "required": [
          "event_type"
        ],
        "examples": [
          {
            "error_event": {
              "summary": "Error Event",
              "value": {
                "event_type": "error",
                "error": {
                  "message": "Failed to get completed interaction: Result not found.",
                  "code": "not_found"
                }
              }
            }
          }
        ]
      },
      "ExaAISearchConfig": {
        "description": "Used to specify configuration for ExaAISearch.",
        "type": "object",
        "properties": {
          "api_key": {
            "description": "Required. The API key for ExaAiSearch.",
            "type": "string"
          },
          "custom_config": {
            "description": "Optional. This field can be used to pass any parameter from the Exa.ai Search API.",
            "type": "object",
            "additionalProperties": {
              "description": "Properties of the object."
            }
          }
        },
        "required": [
          "api_key"
        ]
      },
      "FileCitation": {
        "description": "A file citation annotation.",
        "type": "object",
        "properties": {
          "type": {
            "const": "file_citation"
          },
          "document_uri": {
            "description": "The URI of the file.",
            "type": "string"
          },
          "file_name": {
            "description": "The name of the file.",
            "type": "string"
          },
          "source": {
            "description": "Source attributed for a portion of the text.",
            "type": "string"
          },
          "custom_metadata": {
            "description": "User provided metadata about the retrieved context.",
            "type": "object",
            "additionalProperties": {
              "description": "Properties of the object."
            }
          },
          "page_number": {
            "description": "Page number of the cited document, if applicable.",
            "type": "integer",
            "format": "int32"
          },
          "media_id": {
            "description": "Media ID in-case of image citations, if applicable.",
            "type": "string"
          },
          "start_index": {
            "description": "Start of segment of the response that is attributed to this source.\n\nIndex indicates the start of the segment, measured in bytes.",
            "type": "integer",
            "format": "int32"
          },
          "end_index": {
            "description": "End of the attributed segment, exclusive.",
            "type": "integer",
            "format": "int32"
          }
        },
        "required": [
          "type"
        ]
      },
      "FileSearch": {
        "description": "A tool that can be used by the model to search files.",
        "type": "object",
        "properties": {
          "type": {
            "const": "file_search"
          },
          "file_search_store_names": {
            "description": "The file search store names to search.",
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "top_k": {
            "description": "The number of semantic retrieval chunks to retrieve.",
            "type": "integer",
            "format": "int32"
          },
          "metadata_filter": {
            "description": "Metadata filter to apply to the semantic retrieval documents and chunks.",
            "type": "string"
          }
        },
        "required": [
          "type"
        ],
        "x-codeSamples": [
          {
            "lang": "sh",
            "label": "file_search",
            "source": "curl -X POST https://generativelanguage.googleapis.com/v1beta/interactions \\\n  -H \"x-goog-api-key: $GEMINI_API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -H \"Api-Revision: 2026-05-20\" \\\n  -d '{\n    \"model\": \"gemini-3.5-flash\",\n    \"tools\": [{\n      \"type\": \"file_search\",\n      \"file_search_store_names\": [\"fileSearchStores/m64d1sevsr4y-xfyawui3fxqg\"]\n    }],\n    \"input\": \"Who is the author of the book?\"\n  }'\n"
          },
          {
            "lang": "python",
            "label": "file_search",
            "source": "from google import genai\n\nclient = genai.Client()\n\n# Create a file search store so we have a valid one to use.\nstore = client.file_search_stores.create()\n\nresponse = client.interactions.create(\n    model=\"gemini-3.5-flash\",\n    tools=[{\n        \"type\": \"file_search\",\n        \"file_search_store_names\": [store.name]\n    }],\n    input=\"What documents are available?\"\n)\nprint(response.output_text)\n\n# [cleanup]\nclient.file_search_stores.delete(name=store.name)\n# [/cleanup]\n"
          },
          {
            "lang": "javascript",
            "label": "file_search",
            "source": "import {GoogleGenAI} from '@google/genai';\n\nconst ai = new GoogleGenAI({});\n\n// Create a file search store so we have a valid one to use.\nconst store = await ai.fileSearchStores.create({});\nif (!store.name) {\n    throw new Error('Store creation failed: Name is undefined');\n}\n\nconst interaction = await ai.interactions.create({\n    model: 'gemini-3.5-flash',\n    tools: [{\n        type: 'file_search',\n        file_search_store_names: [store.name]\n    }],\n    input: 'What documents are available?'\n});\nconsole.log(interaction.output_text);\n\n// [cleanup]\nawait ai.fileSearchStores.delete({name: store.name});\n// [/cleanup]\n"
          }
        ]
      },
      "FileSearchCallDelta": {
        "type": "object",
        "properties": {
          "type": {
            "const": "file_search_call"
          },
          "signature": {
            "description": "A signature hash for backend validation.",
            "type": "string",
            "format": "byte"
          }
        },
        "required": [
          "type"
        ]
      },
      "FileSearchCallStep": {
        "description": "File Search call step.",
        "type": "object",
        "properties": {
          "type": {
            "const": "file_search_call"
          },
          "id": {
            "description": "Required. A unique ID for this specific tool call.",
            "type": "string"
          },
          "signature": {
            "description": "A signature hash for backend validation.",
            "type": "string",
            "format": "byte"
          }
        },
        "required": [
          "id",
          "type"
        ],
        "examples": [
          {
            "file_search_call": {
              "summary": "FileSearchCallStep",
              "value": {
                "type": "file_search_call",
                "id": "file_call_88192"
              }
            }
          }
        ]
      },
      "FileSearchResult": {
        "description": "The result of the File Search.",
        "type": "object"
      },
      "FileSearchResultDelta": {
        "type": "object",
        "properties": {
          "type": {
            "const": "file_search_result"
          },
          "result": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/FileSearchResult"
            }
          },
          "signature": {
            "description": "A signature hash for backend validation.",
            "type": "string",
            "format": "byte"
          }
        },
        "required": [
          "result",
          "type"
        ]
      },
      "FileSearchResultStep": {
        "description": "File Search result step.",
        "type": "object",
        "properties": {
          "type": {
            "const": "file_search_result"
          },
          "call_id": {
            "description": "Required. ID to match the ID from the function call block.",
            "type": "string"
          },
          "signature": {
            "description": "A signature hash for backend validation.",
            "type": "string",
            "format": "byte"
          }
        },
        "required": [
          "call_id",
          "type"
        ],
        "examples": [
          {
            "file_search_result": {
              "summary": "FileSearchResultStep",
              "value": {
                "type": "file_search_result",
                "call_id": "file_call_88192"
              }
            }
          }
        ]
      },
      "Filter": {
        "description": "Config for filters.",
        "type": "object",
        "properties": {
          "vector_distance_threshold": {
            "description": "Optional. Only returns contexts with vector distance smaller than the\nthreshold.",
            "type": "number",
            "format": "double"
          },
          "vector_similarity_threshold": {
            "description": "Optional. Only returns contexts with vector similarity larger than the\nthreshold.",
            "type": "number",
            "format": "double"
          },
          "metadata_filter": {
            "description": "Optional. String for metadata filtering.",
            "type": "string"
          }
        }
      },
      "Function": {
        "description": "A tool that can be used by the model.",
        "type": "object",
        "properties": {
          "type": {
            "const": "function"
          },
          "name": {
            "description": "The name of the function.",
            "type": "string"
          },
          "description": {
            "description": "A description of the function.",
            "type": "string"
          },
          "parameters": {
            "description": "The JSON Schema for the function's parameters."
          }
        },
        "required": [
          "type"
        ],
        "x-codeSamples": [
          {
            "lang": "sh",
            "label": "function_calling",
            "source": "curl -X POST https://generativelanguage.googleapis.com/v1beta/interactions \\\n  -H \"x-goog-api-key: $GEMINI_API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -H \"Api-Revision: 2026-05-20\" \\\n  -d '{\n    \"model\": \"gemini-3.5-flash\",\n    \"tools\": [{\n      \"type\": \"function\",\n      \"name\": \"get_weather\",\n      \"description\": \"Get the current weather in a given location\",\n      \"parameters\": {\n        \"type\": \"object\",\n        \"properties\": {\n          \"location\": {\n            \"type\": \"string\",\n            \"description\": \"The city and state, e.g. San Francisco, CA\"\n          }\n        },\n        \"required\": [\"location\"]\n      }\n    }],\n    \"input\": \"What is the weather like in Boston, MA?\"\n  }'\n"
          },
          {
            "lang": "python",
            "label": "function_calling",
            "source": "from google import genai\n\nclient = genai.Client()\nresponse = client.interactions.create(\n    model=\"gemini-3.5-flash\",\n    tools=[{\n        \"type\": \"function\",\n        \"name\": \"get_weather\",\n        \"description\": \"Get the current weather in a given location\",\n        \"parameters\": {\n            \"type\": \"object\",\n            \"properties\": {\n                \"location\": {\n                    \"type\": \"string\",\n                    \"description\": \"The city and state, e.g. San Francisco, CA\"\n                }\n            },\n            \"required\": [\"location\"]\n        }\n    }],\n    input=\"What is the weather like in Boston?\"\n)\nprint(response.steps[-1])\n"
          },
          {
            "lang": "javascript",
            "label": "function_calling",
            "source": "import {GoogleGenAI} from '@google/genai';\n\nconst ai = new GoogleGenAI({});\nconst interaction = await ai.interactions.create({\n    model: 'gemini-3.5-flash',\n    tools: [{\n        type: 'function',\n        name: 'get_weather',\n        description: 'Get the current weather in a given location',\n        parameters: {\n            type: 'object',\n            properties: {\n                location: {\n                    type: 'string',\n                    description: 'The city and state, e.g. San Francisco, CA'\n                }\n            },\n            required: ['location']\n        }\n    }],\n    input: 'What is the weather like in Boston?'\n});\nconsole.log(interaction.steps.at(-1));\n"
          }
        ]
      },
      "FunctionCallDelta": {
        "type": "object",
        "properties": {
          "type": {
            "const": "function_call"
          },
          "name": {
            "type": "string"
          },
          "arguments": {
            "type": "object",
            "additionalProperties": {
              "description": "Properties of the object."
            }
          },
          "id": {
            "description": "Required. A unique ID for this specific tool call.",
            "type": "string"
          }
        },
        "required": [
          "arguments",
          "id",
          "name",
          "type"
        ]
      },
      "FunctionCallStep": {
        "description": "A function tool call step.",
        "type": "object",
        "properties": {
          "type": {
            "const": "function_call"
          },
          "name": {
            "description": "Required. The name of the tool to call.",
            "type": "string"
          },
          "arguments": {
            "description": "Required. The arguments to pass to the function.",
            "type": "object",
            "additionalProperties": {
              "description": "Properties of the object."
            }
          },
          "id": {
            "description": "Required. A unique ID for this specific tool call.",
            "type": "string"
          }
        },
        "required": [
          "arguments",
          "id",
          "name",
          "type"
        ],
        "examples": [
          {
            "function_call": {
              "summary": "FunctionCallStep",
              "value": {
                "type": "function_call",
                "id": "call_98231",
                "name": "get_weather",
                "arguments": {
                  "location": "Boston, MA"
                }
              }
            }
          }
        ]
      },
      "FunctionResultDelta": {
        "type": "object",
        "properties": {
          "type": {
            "const": "function_result"
          },
          "name": {
            "type": "string"
          },
          "is_error": {
            "type": "boolean"
          },
          "call_id": {
            "description": "Required. ID to match the ID from the function call block.",
            "type": "string"
          },
          "result": {
            "oneOf": [
              {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/Content"
                },
                "title": "ContentList"
              },
              {
                "items": {
                  "$ref": "#/components/schemas/FunctionResultSubcontent"
                },
                "title": "FunctionResultSubcontentList",
                "type": "array"
              },
              {
                "type": "string"
              }
            ]
          }
        },
        "required": [
          "call_id",
          "result",
          "type"
        ]
      },
      "FunctionResultStep": {
        "description": "Result of a function tool call.",
        "type": "object",
        "properties": {
          "type": {
            "const": "function_result"
          },
          "name": {
            "description": "The name of the tool that was called.",
            "type": "string"
          },
          "is_error": {
            "description": "Whether the tool call resulted in an error.",
            "type": "boolean"
          },
          "call_id": {
            "description": "Required. ID to match the ID from the function call block.",
            "type": "string"
          },
          "result": {
            "description": "The result of the tool call.",
            "oneOf": [
              {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/Content"
                },
                "title": "ContentList"
              },
              {
                "items": {
                  "$ref": "#/components/schemas/FunctionResultSubcontent"
                },
                "title": "FunctionResultSubcontentList",
                "type": "array"
              },
              {
                "type": "string"
              }
            ]
          }
        },
        "required": [
          "call_id",
          "result",
          "type"
        ],
        "examples": [
          {
            "function_result": {
              "summary": "FunctionResultStep",
              "value": {
                "type": "function_result",
                "call_id": "call_98231",
                "name": "get_weather",
                "result": [
                  {
                    "type": "text",
                    "text": "{\"weather\":\"sunny\"}"
                  }
                ]
              }
            }
          }
        ]
      },
      "FunctionResultSubcontent": {
        "type": "object",
        "oneOf": [
          {
            "$ref": "#/components/schemas/ImageContent"
          },
          {
            "$ref": "#/components/schemas/TextContent"
          }
        ],
        "discriminator": {
          "propertyName": "type"
        }
      },
      "GenerationConfig": {
        "description": "Configuration parameters for model interactions.",
        "type": "object",
        "properties": {
          "temperature": {
            "description": "Controls the randomness of the output.",
            "type": "number",
            "format": "float"
          },
          "top_p": {
            "description": "The maximum cumulative probability of tokens to consider when sampling.",
            "type": "number",
            "format": "float"
          },
          "seed": {
            "description": "Seed used in decoding for reproducibility.",
            "type": "integer",
            "format": "int32"
          },
          "stop_sequences": {
            "description": "A list of character sequences that will stop output interaction.",
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "thinking_level": {
            "description": "The level of thought tokens that the model should generate.",
            "$ref": "#/components/schemas/ThinkingLevel"
          },
          "thinking_summaries": {
            "description": "Whether to include thought summaries in the response.",
            "$ref": "#/components/schemas/ThinkingSummaries"
          },
          "max_output_tokens": {
            "description": "The maximum number of tokens to include in the response.",
            "type": "integer",
            "format": "int32"
          },
          "speech_config": {
            "description": "Configuration for speech interaction.",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SpeechConfig"
            }
          },
          "image_config": {
            "description": "Configuration for image interaction.",
            "deprecated": true,
            "$ref": "#/components/schemas/ImageConfig"
          },
          "tool_choice": {
            "description": "The tool choice configuration.",
            "oneOf": [
              {
                "$ref": "#/components/schemas/ToolChoiceConfig"
              },
              {
                "$ref": "#/components/schemas/ToolChoiceType"
              }
            ]
          }
        }
      },
      "GoogleMaps": {
        "description": "A tool that can be used by the model to call Google Maps.",
        "type": "object",
        "properties": {
          "type": {
            "const": "google_maps"
          },
          "enable_widget": {
            "description": "Whether to return a widget context token in the tool call result of the\nresponse.",
            "type": "boolean"
          },
          "latitude": {
            "description": "The latitude of the user's location.",
            "type": "number",
            "format": "double"
          },
          "longitude": {
            "description": "The longitude of the user's location.",
            "type": "number",
            "format": "double"
          }
        },
        "required": [
          "type"
        ],
        "x-codeSamples": [
          {
            "lang": "sh",
            "label": "google_maps",
            "source": "curl -X POST https://generativelanguage.googleapis.com/v1beta/interactions \\\n  -H \"x-goog-api-key: $GEMINI_API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -H \"Api-Revision: 2026-05-20\" \\\n  -d '{\n    \"model\": \"gemini-3.5-flash\",\n    \"tools\": [{\n      \"type\": \"google_maps\",\n      \"latitude\": 37.7749,\n      \"longitude\": -122.4194\n    }],\n    \"input\": \"What is the best food near me?\"\n  }'\n"
          },
          {
            "lang": "python",
            "label": "google_maps",
            "source": "from google import genai\n\nclient = genai.Client()\nresponse = client.interactions.create(\n    model=\"gemini-3.5-flash\",\n    tools=[{\n        \"type\": \"google_maps\",\n        \"latitude\": 37.7749,\n        \"longitude\": -122.4194\n    }],\n    input=\"What is the best food near me?\"\n)\nprint(response.output_text)\n"
          },
          {
            "lang": "javascript",
            "label": "google_maps",
            "source": "import {GoogleGenAI} from '@google/genai';\n\nconst ai = new GoogleGenAI({});\nconst interaction = await ai.interactions.create({\n    model: 'gemini-3.5-flash',\n    tools: [{\n        type: 'google_maps',\n        latitude: 37.7749,\n        longitude: -122.4194\n    }],\n    input: 'What is the best food near me?'\n});\nconsole.log(interaction.output_text);\n"
          }
        ]
      },
      "GoogleMapsCallArguments": {
        "description": "The arguments to pass to the Google Maps tool.",
        "type": "object",
        "properties": {
          "queries": {
            "description": "The queries to be executed.",
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "GoogleMapsCallDelta": {
        "type": "object",
        "properties": {
          "type": {
            "const": "google_maps_call"
          },
          "arguments": {
            "description": "The arguments to pass to the Google Maps tool.",
            "$ref": "#/components/schemas/GoogleMapsCallArguments"
          },
          "signature": {
            "description": "A signature hash for backend validation.",
            "type": "string",
            "format": "byte"
          }
        },
        "required": [
          "type"
        ]
      },
      "GoogleMapsCallStep": {
        "description": "Google Maps call step.",
        "type": "object",
        "properties": {
          "type": {
            "const": "google_maps_call"
          },
          "arguments": {
            "description": "The arguments to pass to the Google Maps tool.",
            "$ref": "#/components/schemas/GoogleMapsCallStepArguments"
          },
          "id": {
            "description": "Required. A unique ID for this specific tool call.",
            "type": "string"
          },
          "signature": {
            "description": "A signature hash for backend validation.",
            "type": "string",
            "format": "byte"
          }
        },
        "required": [
          "id",
          "type"
        ],
        "examples": [
          {
            "google_maps_call": {
              "summary": "GoogleMapsCallStep",
              "value": {
                "type": "google_maps_call",
                "id": "maps_call_39201",
                "arguments": {
                  "latitude": 37.7749,
                  "longitude": -122.4194
                }
              }
            }
          }
        ]
      },
      "GoogleMapsCallStepArguments": {
        "description": "The arguments to pass to the Google Maps tool.",
        "type": "object",
        "properties": {
          "queries": {
            "description": "The queries to be executed.",
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "GoogleMapsResult": {
        "description": "The result of the Google Maps.",
        "type": "object",
        "properties": {
          "places": {
            "description": "The places that were found.",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Places"
            }
          },
          "widget_context_token": {
            "description": "Resource name of the Google Maps widget context token.",
            "type": "string"
          }
        }
      },
      "GoogleMapsResultDelta": {
        "type": "object",
        "properties": {
          "type": {
            "const": "google_maps_result"
          },
          "result": {
            "description": "The results of the Google Maps.",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/GoogleMapsResult"
            }
          },
          "signature": {
            "description": "A signature hash for backend validation.",
            "type": "string",
            "format": "byte"
          }
        },
        "required": [
          "type"
        ]
      },
      "GoogleMapsResultItem": {
        "description": "The result of the Google Maps.",
        "type": "object",
        "properties": {
          "places": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/GoogleMapsResultPlaces"
            }
          },
          "widget_context_token": {
            "type": "string"
          }
        }
      },
      "GoogleMapsResultPlaces": {
        "type": "object",
        "properties": {
          "place_id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "url": {
            "type": "string"
          },
          "review_snippets": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ReviewSnippet"
            }
          }
        }
      },
      "GoogleMapsResultStep": {
        "description": "Google Maps result step.",
        "type": "object",
        "properties": {
          "type": {
            "const": "google_maps_result"
          },
          "result": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/GoogleMapsResultItem"
            }
          },
          "call_id": {
            "description": "Required. ID to match the ID from the function call block.",
            "type": "string"
          },
          "signature": {
            "description": "A signature hash for backend validation.",
            "type": "string",
            "format": "byte"
          }
        },
        "required": [
          "call_id",
          "result",
          "type"
        ],
        "examples": [
          {
            "google_maps_result": {
              "summary": "GoogleMapsResultStep",
              "value": {
                "type": "google_maps_result",
                "call_id": "maps_call_39201",
                "result": [
                  {
                    "place_id": "ChIJIQBpAG2ahYAR9R7bNdTLg8M",
                    "name": "Golden Gate Park",
                    "rating": 4.8
                  }
                ]
              }
            }
          }
        ]
      },
      "GoogleSearch": {
        "description": "A tool that can be used by the model to search Google.",
        "type": "object",
        "properties": {
          "type": {
            "const": "google_search"
          },
          "search_types": {
            "description": "The types of search grounding to enable.",
            "type": "array",
            "items": {
              "type": "string",
              "x-google-enum-descriptions": [
                "Setting this field enables web search. Only text results are returned.",
                "Setting this field enables image search. Image bytes are returned.",
                "Setting this field enables enterprise web search."
              ],
              "enum": [
                "web_search",
                "image_search",
                "enterprise_web_search"
              ]
            }
          }
        },
        "required": [
          "type"
        ],
        "x-codeSamples": [
          {
            "lang": "sh",
            "label": "google_search",
            "source": "curl -X POST https://generativelanguage.googleapis.com/v1beta/interactions \\\n  -H \"x-goog-api-key: $GEMINI_API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -H \"Api-Revision: 2026-05-20\" \\\n  -d '{\n    \"model\": \"gemini-3.5-flash\",\n    \"tools\": [{\n      \"type\": \"google_search\"\n    }],\n    \"input\": \"Who is the current president of France?\"\n  }'\n"
          },
          {
            "lang": "python",
            "label": "google_search",
            "source": "from google import genai\n\nclient = genai.Client()\nresponse = client.interactions.create(\n    model=\"gemini-3.5-flash\",\n    tools=[{\"type\": \"google_search\"}],\n    input=\"Who is the current president of France?\"\n)\nprint(response.output_text)\n"
          },
          {
            "lang": "javascript",
            "label": "google_search",
            "source": "import {GoogleGenAI} from '@google/genai';\n\nconst ai = new GoogleGenAI({});\nconst interaction = await ai.interactions.create({\n    model: 'gemini-3.5-flash',\n    tools: [{ type: 'google_search' }],\n    input: 'Who is the current president of France?'\n});\nconsole.log(interaction.output_text);\n"
          }
        ]
      },
      "GoogleSearchCallArguments": {
        "description": "The arguments to pass to Google Search.",
        "type": "object",
        "properties": {
          "queries": {
            "description": "Web search queries for the following-up web search.",
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "GoogleSearchCallDelta": {
        "type": "object",
        "properties": {
          "type": {
            "const": "google_search_call"
          },
          "arguments": {
            "$ref": "#/components/schemas/GoogleSearchCallArguments"
          },
          "signature": {
            "description": "A signature hash for backend validation.",
            "type": "string",
            "format": "byte"
          }
        },
        "required": [
          "arguments",
          "type"
        ]
      },
      "GoogleSearchCallStep": {
        "description": "Google Search call step.",
        "type": "object",
        "properties": {
          "type": {
            "const": "google_search_call"
          },
          "arguments": {
            "description": "Required. The arguments to pass to Google Search.",
            "$ref": "#/components/schemas/GoogleSearchCallStepArguments"
          },
          "search_type": {
            "description": "The type of search grounding enabled.",
            "type": "string",
            "x-google-enum-descriptions": [
              "Setting this field enables web search. Only text results are returned.",
              "Setting this field enables image search. Image bytes are returned.",
              "Setting this field enables enterprise web search."
            ],
            "enum": [
              "web_search",
              "image_search",
              "enterprise_web_search"
            ]
          },
          "id": {
            "description": "Required. A unique ID for this specific tool call.",
            "type": "string"
          },
          "signature": {
            "description": "A signature hash for backend validation.",
            "type": "string",
            "format": "byte"
          }
        },
        "required": [
          "arguments",
          "id",
          "type"
        ],
        "examples": [
          {
            "google_search_call": {
              "summary": "GoogleSearchCallStep",
              "value": {
                "type": "google_search_call",
                "id": "search_call_19201",
                "arguments": {
                  "query": "Who won the men's 100m in Paris 2024?"
                }
              }
            }
          }
        ]
      },
      "GoogleSearchCallStepArguments": {
        "description": "The arguments to pass to Google Search.",
        "type": "object",
        "properties": {
          "queries": {
            "description": "Web search queries for the following-up web search.",
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "GoogleSearchResult": {
        "description": "The result of the Google Search.",
        "type": "object",
        "properties": {
          "search_suggestions": {
            "description": "Web content snippet that can be embedded in a web page or an app webview.",
            "type": "string"
          }
        }
      },
      "GoogleSearchResultDelta": {
        "type": "object",
        "properties": {
          "type": {
            "const": "google_search_result"
          },
          "result": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/GoogleSearchResult"
            }
          },
          "is_error": {
            "type": "boolean"
          },
          "signature": {
            "description": "A signature hash for backend validation.",
            "type": "string",
            "format": "byte"
          }
        },
        "required": [
          "result",
          "type"
        ]
      },
      "GoogleSearchResultItem": {
        "description": "The result of the Google Search.",
        "type": "object",
        "properties": {
          "search_suggestions": {
            "description": "Web content snippet that can be embedded in a web page or an app webview.",
            "type": "string"
          }
        }
      },
      "GoogleSearchResultStep": {
        "description": "Google Search result step.",
        "type": "object",
        "properties": {
          "type": {
            "const": "google_search_result"
          },
          "result": {
            "description": "Required. The results of the Google Search.",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/GoogleSearchResultItem"
            }
          },
          "is_error": {
            "description": "Whether the Google Search resulted in an error.",
            "type": "boolean"
          },
          "call_id": {
            "description": "Required. ID to match the ID from the function call block.",
            "type": "string"
          },
          "signature": {
            "description": "A signature hash for backend validation.",
            "type": "string",
            "format": "byte"
          }
        },
        "required": [
          "call_id",
          "result",
          "type"
        ],
        "examples": [
          {
            "google_search_result": {
              "summary": "GoogleSearchResultStep",
              "value": {
                "type": "google_search_result",
                "call_id": "search_call_19201",
                "result": [
                  {
                    "title": "Paris 2024 Olympics: Noah Lyles wins men's 100m gold",
                    "url": "https://olympics.com/en/news/paris-2024-noah-lyles-wins-mens-100m-gold",
                    "snippet": "American Noah Lyles won the Olympic men's 100m gold medal in a photo finish."
                  }
                ]
              }
            }
          }
        ]
      },
      "GroundingToolCount": {
        "description": "The number of grounding tool counts.",
        "type": "object",
        "properties": {
          "type": {
            "description": "The grounding tool type associated with the count.",
            "type": "string",
            "x-google-enum-descriptions": [
              "Grounding with Google Web Search and Image Search, & Web Grounding\nfor Enterprise.",
              "Grounding with Google Maps.",
              "Grounding with customer's data, for example, VertexAISearch."
            ],
            "enum": [
              "google_search",
              "google_maps",
              "retrieval"
            ]
          },
          "count": {
            "description": "The number of grounding tool counts.",
            "type": "integer",
            "format": "int32"
          }
        }
      },
      "HybridSearch": {
        "description": "Config for Hybrid Search.",
        "type": "object",
        "properties": {
          "alpha": {
            "description": "Optional. Alpha value controls the weight between dense and sparse vector search\nresults.",
            "type": "number",
            "format": "float"
          }
        }
      },
      "ImageConfig": {
        "description": "The configuration for image interaction.",
        "type": "object",
        "properties": {
          "aspect_ratio": {
            "enum": [
              "1:1",
              "2:3",
              "3:2",
              "3:4",
              "4:3",
              "4:5",
              "5:4",
              "9:16",
              "16:9",
              "21:9",
              "1:8",
              "8:1",
              "1:4",
              "4:1"
            ],
            "x-google-enum-descriptions": [
              "1:1 aspect ratio.",
              "2:3 aspect ratio.",
              "3:2 aspect ratio.",
              "3:4 aspect ratio.",
              "4:3 aspect ratio.",
              "4:5 aspect ratio.",
              "5:4 aspect ratio.",
              "9:16 aspect ratio.",
              "16:9 aspect ratio.",
              "21:9 aspect ratio.",
              "1:8 aspect ratio.",
              "8:1 aspect ratio.",
              "1:4 aspect ratio.",
              "4:1 aspect ratio."
            ]
          },
          "image_size": {
            "enum": [
              "1K",
              "2K",
              "4K",
              "512"
            ],
            "x-google-enum-descriptions": [
              "1K image size.",
              "2K image size.",
              "4K image size.",
              "512 image size."
            ]
          }
        }
      },
      "ImageContent": {
        "description": "An image content block.",
        "type": "object",
        "properties": {
          "type": {
            "const": "image"
          },
          "data": {
            "description": "The image content.",
            "type": "string",
            "format": "byte"
          },
          "uri": {
            "description": "The URI of the image.",
            "type": "string"
          },
          "mime_type": {
            "description": "The mime type of the image.",
            "type": "string",
            "x-google-enum-descriptions": [
              "PNG image format",
              "JPEG image format",
              "WebP image format",
              "HEIC image format",
              "HEIF image format",
              "GIF image format",
              "BMP image format",
              "TIFF image format"
            ],
            "enum": [
              "image/png",
              "image/jpeg",
              "image/webp",
              "image/heic",
              "image/heif",
              "image/gif",
              "image/bmp",
              "image/tiff"
            ]
          },
          "resolution": {
            "description": "The resolution of the media.",
            "$ref": "#/components/schemas/MediaResolution"
          }
        },
        "required": [
          "type"
        ],
        "examples": [
          {
            "image": {
              "summary": "Image",
              "value": {
                "type": "image",
                "data": "BASE64_ENCODED_IMAGE",
                "mime_type": "image/png"
              }
            }
          }
        ]
      },
      "ImageDelta": {
        "type": "object",
        "properties": {
          "type": {
            "const": "image"
          },
          "data": {
            "type": "string",
            "format": "byte"
          },
          "uri": {
            "type": "string"
          },
          "mime_type": {
            "type": "string",
            "x-google-enum-descriptions": [
              "PNG image format",
              "JPEG image format",
              "WebP image format",
              "HEIC image format",
              "HEIF image format",
              "GIF image format",
              "BMP image format",
              "TIFF image format"
            ],
            "enum": [
              "image/png",
              "image/jpeg",
              "image/webp",
              "image/heic",
              "image/heif",
              "image/gif",
              "image/bmp",
              "image/tiff"
            ]
          },
          "resolution": {
            "description": "The resolution of the media.",
            "$ref": "#/components/schemas/MediaResolution"
          }
        },
        "required": [
          "type"
        ]
      },
      "ImageResponseFormat": {
        "description": "Configuration for image output format.",
        "type": "object",
        "properties": {
          "type": {
            "const": "image"
          },
          "mime_type": {
            "description": "The MIME type of the image output.",
            "type": "string",
            "x-google-enum-descriptions": [
              "JPEG image format."
            ],
            "enum": [
              "image/jpeg"
            ]
          },
          "delivery": {
            "description": "The delivery mode for the image output.",
            "type": "string",
            "x-google-enum-descriptions": [
              "Image data is returned inline in the response.",
              "Image data is returned as a URI."
            ],
            "enum": [
              "inline",
              "uri"
            ]
          },
          "aspect_ratio": {
            "description": "The aspect ratio for the image output.",
            "type": "string",
            "x-google-enum-descriptions": [
              "1:1 aspect ratio.",
              "2:3 aspect ratio.",
              "3:2 aspect ratio.",
              "3:4 aspect ratio.",
              "4:3 aspect ratio.",
              "4:5 aspect ratio.",
              "5:4 aspect ratio.",
              "9:16 aspect ratio.",
              "16:9 aspect ratio.",
              "21:9 aspect ratio.",
              "1:8 aspect ratio.",
              "8:1 aspect ratio.",
              "1:4 aspect ratio.",
              "4:1 aspect ratio."
            ],
            "enum": [
              "1:1",
              "2:3",
              "3:2",
              "3:4",
              "4:3",
              "4:5",
              "5:4",
              "9:16",
              "16:9",
              "21:9",
              "1:8",
              "8:1",
              "1:4",
              "4:1"
            ]
          },
          "image_size": {
            "description": "The size of the image output.",
            "type": "string",
            "x-google-enum-descriptions": [
              "512px image size.",
              "1K image size.",
              "2K image size.",
              "4K image size."
            ],
            "enum": [
              "512",
              "1K",
              "2K",
              "4K"
            ]
          }
        },
        "required": [
          "type"
        ],
        "examples": [
          {
            "image_response_format": {
              "summary": "Image Output",
              "value": {
                "type": "image",
                "mime_type": "image/jpeg",
                "aspect_ratio": "16:9",
                "image_size": "1K"
              }
            }
          }
        ]
      },
      "Interaction": {
        "description": "The Interaction resource.",
        "properties": {
          "model": {
            "$ref": "#/components/schemas/ModelOption",
            "description": "The name of the `Model` used for generating the interaction."
          },
          "agent": {
            "$ref": "#/components/schemas/AgentOption",
            "description": "The name of the `Agent` used for generating the interaction."
          },
          "id": {
            "description": "Required. Output only. A unique identifier for the interaction completion.",
            "readOnly": true,
            "type": "string"
          },
          "status": {
            "description": "Required. Output only. The status of the interaction.",
            "readOnly": true,
            "type": "string",
            "x-google-enum-descriptions": [
              "The interaction is in progress.",
              "The interaction requires action/input from the user.",
              "The interaction is completed.",
              "The interaction failed.",
              "The interaction was cancelled.",
              "The interaction is completed, but contains incomplete results (e.g.\nhitting max_tokens).",
              "The interaction was halted because the token budget was exceeded."
            ],
            "enum": [
              "in_progress",
              "requires_action",
              "completed",
              "failed",
              "cancelled",
              "incomplete",
              "budget_exceeded"
            ]
          },
          "created": {
            "description": "Required. Output only. The time at which the response was created in ISO 8601 format\n(YYYY-MM-DDThh:mm:ssZ).",
            "readOnly": true,
            "type": "string",
            "format": "date-time"
          },
          "updated": {
            "description": "Required. Output only. The time at which the response was last updated in ISO 8601 format\n(YYYY-MM-DDThh:mm:ssZ).",
            "readOnly": true,
            "type": "string",
            "format": "date-time"
          },
          "role": {
            "description": "Output only. The role of the interaction.",
            "readOnly": true,
            "deprecated": true,
            "type": "string"
          },
          "system_instruction": {
            "description": "System instruction for the interaction.",
            "type": "string"
          },
          "tools": {
            "description": "A list of tool declarations the model may call during interaction.",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Tool"
            }
          },
          "usage": {
            "description": "Output only. Statistics on the interaction request's token usage.",
            "readOnly": true,
            "$ref": "#/components/schemas/Usage"
          },
          "response_modalities": {
            "description": "The requested modalities of the response (TEXT, IMAGE, AUDIO).",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ResponseModality"
            }
          },
          "response_mime_type": {
            "description": "The mime type of the response. This is required if response_format is set.",
            "deprecated": true,
            "type": "string"
          },
          "previous_interaction_id": {
            "description": "The ID of the previous interaction, if any.",
            "type": "string"
          },
          "environment_id": {
            "description": "Output only. The environment ID for the interaction. Only populated if environment\nconfig is set in the request.",
            "readOnly": true,
            "type": "string"
          },
          "service_tier": {
            "description": "The service tier for the interaction.",
            "$ref": "#/components/schemas/ServiceTier"
          },
          "webhook_config": {
            "description": "Optional. Webhook configuration for receiving notifications when the\ninteraction completes.",
            "$ref": "#/components/schemas/WebhookConfig"
          },
          "steps": {
            "description": "Required. Output only. The steps that make up the interaction.",
            "readOnly": true,
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Step"
            }
          },
          "input": {
            "$ref": "#/components/schemas/InteractionsInput"
          },
          "response_format": {
            "description": "Enforces that the generated response is a JSON object that complies with the JSON schema specified in this field.",
            "oneOf": [
              {
                "$ref": "#/components/schemas/ResponseFormat"
              },
              {
                "$ref": "#/components/schemas/ResponseFormatList"
              }
            ]
          },
          "environment": {
            "description": "The environment configuration for the interaction. Can be an object specifying remote environment sources or a string referencing an existing environment ID.",
            "oneOf": [
              {
                "$ref": "#/components/schemas/EnvironmentConfig"
              },
              {
                "type": "string"
              }
            ]
          },
          "generation_config": {
            "description": "Input only. Configuration parameters for the model interaction.",
            "writeOnly": true,
            "$ref": "#/components/schemas/GenerationConfig"
          },
          "agent_config": {
            "description": "Configuration parameters for the agent interaction.",
            "oneOf": [
              {
                "$ref": "#/components/schemas/DeepResearchAgentConfig"
              },
              {
                "$ref": "#/components/schemas/DynamicAgentConfig"
              }
            ],
            "discriminator": {
              "propertyName": "type"
            }
          }
        },
        "required": [
          "created",
          "id",
          "status",
          "steps",
          "updated"
        ],
        "example": {
          "created": "2025-12-04T15:01:45Z",
          "id": "v1_ChdXS0l4YWZXTk9xbk0xZThQczhEcmlROBIXV0tJeGFmV05PcW5NMWU4UHM4RHJpUTg",
          "model": "gemini-3.5-flash",
          "object": "interaction",
          "steps": [
            {
              "type": "model_output",
              "content": [
                {
                  "type": "text",
                  "text": "Hello! I'm doing well, functioning as expected. Thank you for asking! How are you doing today?"
                }
              ]
            }
          ],
          "status": "completed",
          "updated": "2025-12-04T15:01:45Z",
          "usage": {
            "input_tokens_by_modality": [
              {
                "modality": "text",
                "tokens": 7
              }
            ],
            "total_cached_tokens": 0,
            "total_input_tokens": 7,
            "total_output_tokens": 23,
            "total_thought_tokens": 49,
            "total_tokens": 79,
            "total_tool_use_tokens": 0
          }
        }
      },
      "InteractionCompletedEvent": {
        "type": "object",
        "properties": {
          "event_type": {
            "const": "interaction.completed"
          },
          "interaction": {
            "description": "Required. The completed interaction with empty outputs to reduce the payload size.\nUse the preceding ContentDelta events for the actual output.",
            "$ref": "#/components/schemas/Interaction"
          },
          "event_id": {
            "description": "The event_id token to be used to resume the interaction stream, from\nthis event.",
            "type": "string"
          },
          "metadata": {
            "description": "Optional metadata accompanying ANY streamed event.",
            "$ref": "#/components/schemas/StreamMetadata"
          }
        },
        "required": [
          "event_type",
          "interaction"
        ],
        "examples": [
          {
            "interaction_completed": {
              "summary": "Interaction Completed",
              "value": {
                "event_type": "interaction.completed",
                "interaction": {
                  "id": "v1_ChdXS0l4YWZXTk9xbk0xZThQczhEcmlROBIXV0tJeGFmV05PcW5NMWU4UHM4RHJpUTg",
                  "model": "gemini-3.5-flash",
                  "status": "completed",
                  "created": "2025-12-04T15:01:45Z",
                  "updated": "2025-12-04T15:01:45Z"
                },
                "event_id": "evt_123"
              }
            }
          }
        ]
      },
      "InteractionCreatedEvent": {
        "type": "object",
        "properties": {
          "event_type": {
            "const": "interaction.created"
          },
          "interaction": {
            "$ref": "#/components/schemas/Interaction"
          },
          "event_id": {
            "description": "The event_id token to be used to resume the interaction stream, from\nthis event.",
            "type": "string"
          },
          "metadata": {
            "description": "Optional metadata accompanying ANY streamed event.",
            "$ref": "#/components/schemas/StreamMetadata"
          }
        },
        "required": [
          "event_type",
          "interaction"
        ],
        "examples": [
          {
            "interaction_created": {
              "summary": "Interaction Created",
              "value": {
                "event_type": "interaction.created",
                "interaction": {
                  "id": "v1_ChdXS0l4YWZXTk9xbk0xZThQczhEcmlROBIXV0tJeGFmV05PcW5NMWU4UHM4RHJpUTg",
                  "model": "gemini-3.5-flash",
                  "status": "in_progress",
                  "created": "2025-12-04T15:01:45Z",
                  "updated": "2025-12-04T15:01:45Z"
                },
                "event_id": "evt_123"
              }
            }
          }
        ]
      },
      "InteractionSseEvent": {
        "type": "object",
        "oneOf": [
          {
            "$ref": "#/components/schemas/ErrorEvent"
          },
          {
            "$ref": "#/components/schemas/InteractionCompletedEvent"
          },
          {
            "$ref": "#/components/schemas/InteractionCreatedEvent"
          },
          {
            "$ref": "#/components/schemas/InteractionStatusUpdate"
          },
          {
            "$ref": "#/components/schemas/StepDelta"
          },
          {
            "$ref": "#/components/schemas/StepStart"
          },
          {
            "$ref": "#/components/schemas/StepStop"
          }
        ],
        "discriminator": {
          "propertyName": "event_type"
        }
      },
      "InteractionStatusUpdate": {
        "type": "object",
        "properties": {
          "event_type": {
            "const": "interaction.status_update"
          },
          "interaction_id": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "x-google-enum-descriptions": [
              "The interaction is in progress.",
              "The interaction requires action/input from the user.",
              "The interaction is completed.",
              "The interaction failed.",
              "The interaction was cancelled.",
              "The interaction is completed, but contains incomplete results (e.g.\nhitting max_tokens).",
              "The interaction was halted because the token budget was exceeded."
            ],
            "enum": [
              "in_progress",
              "requires_action",
              "completed",
              "failed",
              "cancelled",
              "incomplete",
              "budget_exceeded"
            ]
          },
          "event_id": {
            "description": "The event_id token to be used to resume the interaction stream, from\nthis event.",
            "type": "string"
          },
          "metadata": {
            "description": "Optional metadata accompanying ANY streamed event.",
            "$ref": "#/components/schemas/StreamMetadata"
          }
        },
        "required": [
          "event_type",
          "interaction_id",
          "status"
        ],
        "examples": [
          {
            "interaction_status_update": {
              "summary": "Interaction Status Update",
              "value": {
                "event_type": "interaction.status_update",
                "interaction_id": "v1_ChdTMjQ0YWJ5TUF1TzcxZThQdjRpcnFRcxIXUzI0NGFieU1BdU83MWU4UHY0aXJxUXM",
                "status": "in_progress"
              }
            }
          }
        ]
      },
      "InteractionsInput": {
        "description": "The input for the interaction.",
        "oneOf": [
          {
            "$ref": "#/components/schemas/Content"
          },
          {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Step"
            },
            "title": "StepList"
          },
          {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Content"
            },
            "title": "ContentList"
          },
          {
            "type": "string"
          }
        ]
      },
      "ListAgentsResponse": {
        "type": "object",
        "properties": {
          "agents": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Agent"
            }
          },
          "next_page_token": {
            "type": "string"
          }
        }
      },
      "ListWebhooksResponse": {
        "description": "Response message for WebhookService.ListWebhooks.",
        "type": "object",
        "properties": {
          "webhooks": {
            "description": "The webhooks.",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Webhook"
            }
          },
          "next_page_token": {
            "description": "A token, which can be sent as `page_token` to retrieve the next page.\nIf this field is omitted, there are no subsequent pages.",
            "type": "string"
          }
        }
      },
      "McpServer": {
        "description": "A MCPServer is a server that can be called by the model to perform actions.",
        "type": "object",
        "properties": {
          "type": {
            "const": "mcp_server"
          },
          "name": {
            "description": "The name of the MCPServer.",
            "type": "string"
          },
          "url": {
            "description": "The full URL for the MCPServer endpoint.\nExample: \"https://api.example.com/mcp\"",
            "type": "string"
          },
          "headers": {
            "description": "Optional: Fields for authentication headers, timeouts, etc., if needed.",
            "type": "object",
            "additionalProperties": {
              "type": "string"
            }
          },
          "allowed_tools": {
            "description": "The allowed tools.",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AllowedTools"
            }
          }
        },
        "required": [
          "type"
        ],
        "x-codeSamples": [
          {
            "lang": "sh",
            "label": "mcp_server",
            "source": "curl -X POST https://generativelanguage.googleapis.com/v1beta/interactions \\\n  -H \"x-goog-api-key: $GEMINI_API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -H \"Api-Revision: 2026-05-20\" \\\n  -d '{\n    \"model\": \"gemini-3.5-flash\",\n    \"tools\": [{\n      \"type\": \"mcp_server\",\n      \"name\": \"weather_service\",\n      \"url\": \"https://gemini-api-demos.uc.r.appspot.com/mcp\"\n    }],\n    \"input\": \"Today is 12-05-2025, what is the temperature today in London?\"\n  }'\n"
          },
          {
            "lang": "python",
            "label": "mcp_server",
            "source": "from google import genai\n\nclient = genai.Client()\nresponse = client.interactions.create(\n    model=\"gemini-3.5-flash\",\n    tools=[{\n        \"type\": \"mcp_server\",\n        \"name\": \"weather_service\",\n        \"url\": \"https://gemini-api-demos.uc.r.appspot.com/mcp\"\n    }],\n    input=\"Today is 12-05-2025, what is the temperature today in London?\"\n)\nprint(response.output_text)\n"
          },
          {
            "lang": "javascript",
            "label": "mcp_server",
            "source": "import {GoogleGenAI} from '@google/genai';\n\nconst ai = new GoogleGenAI({});\nconst interaction = await ai.interactions.create({\n    model: 'gemini-3.5-flash',\n    tools: [{\n        type: 'mcp_server',\n        name: 'weather_service',\n        url: 'https://gemini-api-demos.uc.r.appspot.com/mcp'\n    }],\n    input: 'Today is 12-05-2025, what is the temperature today in London?'\n});\nconsole.log(interaction.output_text);\n"
          }
        ]
      },
      "McpServerToolCallDelta": {
        "type": "object",
        "properties": {
          "type": {
            "const": "mcp_server_tool_call"
          },
          "name": {
            "type": "string"
          },
          "server_name": {
            "type": "string"
          },
          "arguments": {
            "type": "object",
            "additionalProperties": {
              "description": "Properties of the object."
            }
          }
        },
        "required": [
          "arguments",
          "name",
          "server_name",
          "type"
        ]
      },
      "McpServerToolCallStep": {
        "description": "MCPServer tool call step.",
        "type": "object",
        "properties": {
          "type": {
            "const": "mcp_server_tool_call"
          },
          "name": {
            "description": "Required. The name of the tool which was called.",
            "type": "string"
          },
          "server_name": {
            "description": "Required. The name of the used MCP server.",
            "type": "string"
          },
          "arguments": {
            "description": "Required. The JSON object of arguments for the function.",
            "type": "object",
            "additionalProperties": {
              "description": "Properties of the object."
            }
          },
          "id": {
            "description": "Required. A unique ID for this specific tool call.",
            "type": "string"
          }
        },
        "required": [
          "arguments",
          "id",
          "name",
          "server_name",
          "type"
        ],
        "examples": [
          {
            "mcp_server_tool_call": {
              "summary": "McpServerToolCallStep",
              "value": {
                "type": "mcp_server_tool_call",
                "id": "mcp_call_29012",
                "name": "calculate_tax",
                "server_name": "financial_mcp_server",
                "arguments": {
                  "income": 120000,
                  "state": "CA"
                }
              }
            }
          }
        ]
      },
      "McpServerToolResultDelta": {
        "type": "object",
        "properties": {
          "type": {
            "const": "mcp_server_tool_result"
          },
          "name": {
            "type": "string"
          },
          "server_name": {
            "type": "string"
          },
          "result": {
            "oneOf": [
              {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/Content"
                },
                "title": "ContentList"
              },
              {
                "items": {
                  "$ref": "#/components/schemas/FunctionResultSubcontent"
                },
                "title": "FunctionResultSubcontentList",
                "type": "array"
              },
              {
                "type": "string"
              }
            ]
          }
        },
        "required": [
          "result",
          "type"
        ]
      },
      "McpServerToolResultStep": {
        "description": "MCPServer tool result step.",
        "type": "object",
        "properties": {
          "type": {
            "const": "mcp_server_tool_result"
          },
          "name": {
            "description": "Name of the tool which is called for this specific tool call.",
            "type": "string"
          },
          "server_name": {
            "description": "The name of the used MCP server.",
            "type": "string"
          },
          "call_id": {
            "description": "Required. ID to match the ID from the function call block.",
            "type": "string"
          },
          "result": {
            "description": "The output from the MCP server call. Can be simple text or rich content.",
            "oneOf": [
              {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/Content"
                },
                "title": "ContentList"
              },
              {
                "items": {
                  "$ref": "#/components/schemas/FunctionResultSubcontent"
                },
                "title": "FunctionResultSubcontentList",
                "type": "array"
              },
              {
                "type": "object"
              }
            ]
          }
        },
        "required": [
          "call_id",
          "result",
          "type"
        ],
        "examples": [
          {
            "mcp_server_tool_result": {
              "summary": "McpServerToolResultStep",
              "value": {
                "type": "mcp_server_tool_result",
                "call_id": "mcp_call_29012",
                "result": {
                  "tax_due": 32400
                }
              }
            }
          }
        ]
      },
      "MediaResolution": {
        "type": "string",
        "x-google-enum-descriptions": [
          "Low resolution.",
          "Medium resolution.",
          "High resolution.",
          "Ultra high resolution."
        ],
        "enum": [
          "low",
          "medium",
          "high",
          "ultra_high"
        ]
      },
      "ModalityTokens": {
        "description": "The token count for a single response modality.",
        "type": "object",
        "properties": {
          "modality": {
            "description": "The modality associated with the token count.",
            "$ref": "#/components/schemas/ResponseModality"
          },
          "tokens": {
            "description": "Number of tokens for the modality.",
            "type": "integer",
            "format": "int32"
          }
        }
      },
      "ModelOption": {
        "title": "Model",
        "description": "The model that will complete your prompt.\\n\\nSee [models](https://ai.google.dev/gemini-api/docs/models) for additional details.",
        "anyOf": [
          {
            "type": "string"
          },
          {
            "description": "An agentic capability model designed for direct interface interaction, allowing Gemini to perceive and navigate digital environments.",
            "const": "gemini-2.5-computer-use-preview-10-2025",
            "x-stainless-nominal": false
          },
          {
            "description": "Gemini 3.1 Flash TTS: Powerful, low-latency speech generation. Enjoy natural outputs, steerable prompts, and new expressive audio tags for precise narration control.",
            "const": "gemini-3.1-flash-tts-preview",
            "x-stainless-nominal": false
          },
          {
            "description": "Our 2.5 Flash text-to-speech model optimized for powerful, low-latency controllable speech generation.",
            "const": "gemini-2.5-flash-preview-tts",
            "x-stainless-nominal": false
          },
          {
            "description": "Our 2.5 Pro text-to-speech audio model optimized for powerful, low-latency speech generation for more natural outputs and easier to steer prompts.",
            "const": "gemini-2.5-pro-preview-tts",
            "x-stainless-nominal": false
          },
          {
            "description": "Our advanced, full-song generative model with deep compositional understanding, optimized for precise structural control and complex transitions across diverse musical styles.",
            "const": "lyria-3-pro-preview",
            "x-stainless-nominal": false
          },
          {
            "description": "Our first hybrid reasoning model which supports a 1M token context window and has thinking budgets.",
            "const": "gemini-2.5-flash",
            "x-stainless-nominal": false
          },
          {
            "description": "Our latest SOTA reasoning model with unprecedented depth and nuance, and powerful multimodal understanding and coding capabilities.",
            "const": "gemini-3.1-pro-preview",
            "x-stainless-nominal": false
          },
          {
            "description": "Our low-latency, music generation model optimized for high-fidelity audio clips and precise rhythmic control.",
            "const": "lyria-3-clip-preview",
            "x-stainless-nominal": false
          },
          {
            "description": "Our most cost-efficient model, optimized for high-volume agentic tasks, translation, and simple data processing.",
            "const": "gemini-3.1-flash-lite",
            "x-stainless-nominal": false
          },
          {
            "description": "Our most cost-efficient model, optimized for high-volume agentic tasks, translation, and simple data processing.",
            "const": "gemini-3.1-flash-lite-preview",
            "x-stainless-nominal": false
          },
          {
            "description": "Our most intelligent model built for speed, combining frontier intelligence with superior search and grounding.",
            "const": "gemini-3-flash-preview",
            "x-stainless-nominal": false
          },
          {
            "description": "Our most intelligent model for sustained frontier performance in agentic and coding tasks.",
            "const": "gemini-3.5-flash",
            "x-stainless-nominal": false
          },
          {
            "description": "Our most intelligent model with SOTA reasoning and multimodal understanding, and powerful agentic and vibe coding capabilities.",
            "const": "gemini-3-pro-preview",
            "x-stainless-nominal": false
          },
          {
            "description": "Our native audio models optimized for higher quality audio outputs with better pacing, voice naturalness, verbosity, and mood.",
            "const": "gemini-2.5-flash-native-audio-preview-12-2025",
            "x-stainless-nominal": false
          },
          {
            "description": "Our native image generation model, optimized for speed, flexibility, and contextual understanding. Text input and output is priced the same as 2.5 Flash.",
            "const": "gemini-2.5-flash-image",
            "x-stainless-nominal": false
          },
          {
            "description": "Our smallest and most cost effective model, built for at scale usage.",
            "const": "gemini-2.5-flash-lite",
            "x-stainless-nominal": false
          },
          {
            "description": "Our state-of-the-art multipurpose model, which excels at coding and complex reasoning tasks.",
            "const": "gemini-2.5-pro",
            "x-stainless-nominal": false
          },
          {
            "description": "Pro-level visual intelligence with Flash-speed efficiency and reality-grounded generation capabilities.",
            "const": "gemini-3.1-flash-image-preview",
            "x-stainless-nominal": false
          },
          {
            "description": "State-of-the-art image generation and editing model.",
            "const": "gemini-3-pro-image-preview",
            "x-stainless-nominal": "false`"
          },
          {
            "description": "The latest model based on Gemini 2.5 Flash lite optimized for cost-efficiency, high throughput and high quality.",
            "const": "gemini-2.5-flash-lite-preview-09-2025",
            "x-stainless-nominal": false
          },
          {
            "description": "The latest model based on the 2.5 Flash model. 2.5 Flash Preview is best for large scale processing, low-latency, high volume tasks that require thinking, and agentic use cases.",
            "const": "gemini-2.5-flash-preview-09-2025",
            "x-stainless-nominal": false
          }
        ]
      },
      "ModelOutputStep": {
        "description": "Output generated by the model.",
        "type": "object",
        "properties": {
          "type": {
            "const": "model_output"
          },
          "content": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Content"
            }
          }
        },
        "required": [
          "type"
        ],
        "examples": [
          {
            "model_output": {
              "summary": "ModelOutputStep",
              "value": {
                "type": "model_output",
                "content": [
                  {
                    "type": "text",
                    "text": "The capital of France is Paris."
                  }
                ]
              }
            }
          }
        ]
      },
      "ParallelAISearchConfig": {
        "description": "Used to specify configuration for ParallelAISearch.",
        "type": "object",
        "properties": {
          "api_key": {
            "description": "Optional. The API key for ParallelAiSearch.",
            "type": "string"
          },
          "custom_config": {
            "description": "Optional. Custom configs for ParallelAiSearch.",
            "type": "object",
            "additionalProperties": {
              "description": "Properties of the object."
            }
          }
        }
      },
      "PingWebhookRequest": {
        "description": "Request message for WebhookService.PingWebhook.",
        "type": "object",
        "x-stainless-empty-object": true
      },
      "PingWebhookResponse": {
        "description": "Response message for WebhookService.PingWebhook.",
        "type": "object",
        "x-stainless-empty-object": true
      },
      "PlaceCitation": {
        "description": "A place citation annotation.",
        "type": "object",
        "properties": {
          "type": {
            "const": "place_citation"
          },
          "place_id": {
            "description": "The ID of the place, in `places/{place_id}` format.",
            "type": "string"
          },
          "name": {
            "description": "Title of the place.",
            "type": "string"
          },
          "url": {
            "description": "URI reference of the place.",
            "type": "string"
          },
          "review_snippets": {
            "description": "Snippets of reviews that are used to generate answers about the\nfeatures of a given place in Google Maps.",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ReviewSnippet"
            }
          },
          "start_index": {
            "description": "Start of segment of the response that is attributed to this source.\n\nIndex indicates the start of the segment, measured in bytes.",
            "type": "integer",
            "format": "int32"
          },
          "end_index": {
            "description": "End of the attributed segment, exclusive.",
            "type": "integer",
            "format": "int32"
          }
        },
        "required": [
          "type"
        ]
      },
      "Places": {
        "type": "object",
        "properties": {
          "place_id": {
            "description": "The ID of the place, in `places/{place_id}` format.",
            "type": "string"
          },
          "name": {
            "description": "Title of the place.",
            "type": "string"
          },
          "url": {
            "description": "URI reference of the place.",
            "type": "string"
          },
          "review_snippets": {
            "description": "Snippets of reviews that are used to generate answers about the\nfeatures of a given place in Google Maps.",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ReviewSnippet"
            }
          }
        }
      },
      "RagResource": {
        "description": "The definition of the Rag resource.",
        "type": "object",
        "properties": {
          "rag_corpus": {
            "description": "Optional. RagCorpora resource name.",
            "type": "string"
          },
          "rag_file_ids": {
            "description": "Optional. rag_file_id. The files should be in the same rag_corpus set in\nrag_corpus field.",
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "RagRetrievalConfig": {
        "description": "Specifies the context retrieval config.",
        "type": "object",
        "properties": {
          "top_k": {
            "description": "Optional. The number of contexts to retrieve.",
            "type": "integer",
            "format": "int32"
          },
          "hybrid_search": {
            "description": "Optional. Config for Hybrid Search.",
            "$ref": "#/components/schemas/HybridSearch"
          },
          "filter": {
            "description": "Optional. Config for filters.",
            "$ref": "#/components/schemas/Filter"
          },
          "ranking": {
            "description": "Optional. Config for ranking and reranking.",
            "$ref": "#/components/schemas/Ranking"
          }
        }
      },
      "RagStoreConfig": {
        "description": "Use to specify configuration for RAG Store.",
        "type": "object",
        "properties": {
          "rag_resources": {
            "description": "Optional. The representation of the rag source.",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/RagResource"
            }
          },
          "similarity_top_k": {
            "description": "Optional. Number of top k results to return from the selected corpora.",
            "deprecated": true,
            "type": "integer",
            "format": "int32"
          },
          "vector_distance_threshold": {
            "description": "Optional. Only return results with vector distance smaller than the threshold.",
            "deprecated": true,
            "type": "number",
            "format": "double"
          },
          "rag_retrieval_config": {
            "description": "Optional. The retrieval config for the Rag query.",
            "$ref": "#/components/schemas/RagRetrievalConfig"
          }
        }
      },
      "RankService": {
        "description": "Config for Rank Service.",
        "type": "object",
        "properties": {
          "ranking_config": {
            "const": "rank_service"
          },
          "model_name": {
            "description": "Optional. The model name of the rank service.",
            "type": "string"
          }
        },
        "required": [
          "ranking_config"
        ]
      },
      "Ranking": {
        "description": "Config for ranking and reranking.",
        "type": "object",
        "discriminator": {
          "propertyName": "type"
        },
        "$ref": "#/components/schemas/RankService"
      },
      "ResponseFormat": {
        "type": "object",
        "oneOf": [
          {
            "$ref": "#/components/schemas/AudioResponseFormat"
          },
          {
            "$ref": "#/components/schemas/ImageResponseFormat"
          },
          {
            "$ref": "#/components/schemas/TextResponseFormat"
          },
          {
            "type": "object"
          }
        ]
      },
      "ResponseFormatList": {
        "type": "array",
        "items": {
          "$ref": "#/components/schemas/ResponseFormat"
        },
        "example": [
          {
            "type": "text",
            "mime_type": "application/json"
          }
        ]
      },
      "ResponseModality": {
        "type": "string",
        "x-google-enum-descriptions": [
          "Indicates the model should return text.",
          "Indicates the model should return images.",
          "Indicates the model should return audio.",
          "Indicates the model should return video.",
          "Indicates the model should return documents."
        ],
        "enum": [
          "text",
          "image",
          "audio",
          "video",
          "document"
        ]
      },
      "Retrieval": {
        "description": "A tool that can be used by the model to retrieve files.",
        "type": "object",
        "properties": {
          "type": {
            "const": "retrieval"
          },
          "retrieval_types": {
            "description": "The types of file retrieval to enable.",
            "type": "array",
            "items": {
              "type": "string",
              "x-google-enum-descriptions": [
                "",
                "",
                "",
                ""
              ],
              "enum": [
                "vertex_ai_search",
                "rag_store",
                "exa_ai_search",
                "parallel_ai_search"
              ]
            }
          },
          "vertex_ai_search_config": {
            "description": "Used to specify configuration for VertexAISearch.",
            "$ref": "#/components/schemas/VertexAISearchConfig"
          },
          "exa_ai_search_config": {
            "description": "Used to specify configuration for ExaAISearch.",
            "$ref": "#/components/schemas/ExaAISearchConfig"
          },
          "parallel_ai_search_config": {
            "description": "Used to specify configuration for ParallelAISearch.",
            "$ref": "#/components/schemas/ParallelAISearchConfig"
          },
          "rag_store_config": {
            "description": "Used to specify configuration for RagStore.",
            "$ref": "#/components/schemas/RagStoreConfig"
          }
        },
        "required": [
          "type"
        ]
      },
      "ReviewSnippet": {
        "description": "Encapsulates a snippet of a user review that answers a question about\nthe features of a specific place in Google Maps.",
        "type": "object",
        "properties": {
          "title": {
            "description": "Title of the review.",
            "type": "string"
          },
          "url": {
            "description": "A link that corresponds to the user review on Google Maps.",
            "type": "string"
          },
          "review_id": {
            "description": "The ID of the review snippet.",
            "type": "string"
          }
        }
      },
      "RotateSigningSecretRequest": {
        "description": "Request message for WebhookService.RotateSigningSecret.",
        "type": "object",
        "properties": {
          "revocation_behavior": {
            "description": "Optional. The revocation behavior for previous signing secrets.",
            "type": "string",
            "x-google-enum-descriptions": [
              "Generate a new signing secret and revoke all previous secrets after 24\nhours. Default and safest option for migrations.",
              "Revoke all previous secrets immediately. Use with caution as this can\ninterrupt ongoing notifications."
            ],
            "enum": [
              "revoke_previous_secrets_after_h24",
              "revoke_previous_secrets_immediately"
            ]
          }
        }
      },
      "RotateSigningSecretResponse": {
        "description": "Response message for WebhookService.RotateSigningSecret.",
        "type": "object",
        "properties": {
          "secret": {
            "description": "Output only. The newly generated signing secret.",
            "readOnly": true,
            "type": "string"
          }
        }
      },
      "ServiceTier": {
        "type": "string",
        "x-google-enum-descriptions": [
          "Flex service tier.",
          "Standard service tier.",
          "Priority service tier."
        ],
        "enum": [
          "flex",
          "standard",
          "priority"
        ]
      },
      "SigningSecret": {
        "description": "Represents a signing secret used to verify webhook payloads.",
        "type": "object",
        "properties": {
          "truncated_secret": {
            "description": "Output only. The truncated version of the signing secret.",
            "readOnly": true,
            "type": "string"
          },
          "expire_time": {
            "description": "Output only. The expiration date of the signing secret.",
            "readOnly": true,
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "Source": {
        "description": "A source to be mounted into the environment.",
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "x-google-enum-descriptions": [
              "A GCS bucket.",
              "Inline content.",
              "A generic repository. The protocol prefix in the source URL\nidentifies the provider (e.g., github://, gcs://).",
              "A skill resource from the Skill Registry Service.\nSkill: projects/{project}/locations/{location}/skills/{skill}\nSkillRevision:\nprojects/{project}/locations/{location}/skills/{skill}/revisions/{revision}\nSupport mounting all skills under a project:\nprojects/{project}/locations/{location}/skills."
            ],
            "enum": [
              "gcs",
              "inline",
              "repository",
              "skill_registry"
            ]
          },
          "source": {
            "description": "The source of the environment.\nFor GCS, this is the GCS path.\nFor GitHub, this is the GitHub path.",
            "type": "string"
          },
          "target": {
            "description": "Where the source should appear in the environment.",
            "type": "string"
          },
          "content": {
            "description": "The inline content if `type` is `INLINE`.",
            "type": "string"
          },
          "encoding": {
            "description": "Optional encoding for inline content (e.g. `base64`).",
            "type": "string"
          }
        }
      },
      "SpeechConfig": {
        "description": "The configuration for speech interaction.",
        "type": "object",
        "properties": {
          "voice": {
            "description": "The voice of the speaker.",
            "type": "string"
          },
          "language": {
            "description": "The language of the speech.",
            "type": "string"
          },
          "speaker": {
            "description": "The speaker's name, it should match the speaker name given in the prompt.",
            "type": "string"
          }
        }
      },
      "Step": {
        "description": "A step in the interaction.",
        "type": "object",
        "oneOf": [
          {
            "$ref": "#/components/schemas/CodeExecutionCallStep"
          },
          {
            "$ref": "#/components/schemas/CodeExecutionResultStep"
          },
          {
            "$ref": "#/components/schemas/FileSearchCallStep"
          },
          {
            "$ref": "#/components/schemas/FileSearchResultStep"
          },
          {
            "$ref": "#/components/schemas/FunctionCallStep"
          },
          {
            "$ref": "#/components/schemas/FunctionResultStep"
          },
          {
            "$ref": "#/components/schemas/GoogleMapsCallStep"
          },
          {
            "$ref": "#/components/schemas/GoogleMapsResultStep"
          },
          {
            "$ref": "#/components/schemas/GoogleSearchCallStep"
          },
          {
            "$ref": "#/components/schemas/GoogleSearchResultStep"
          },
          {
            "$ref": "#/components/schemas/McpServerToolCallStep"
          },
          {
            "$ref": "#/components/schemas/McpServerToolResultStep"
          },
          {
            "$ref": "#/components/schemas/ModelOutputStep"
          },
          {
            "$ref": "#/components/schemas/ThoughtStep"
          },
          {
            "$ref": "#/components/schemas/UrlContextCallStep"
          },
          {
            "$ref": "#/components/schemas/UrlContextResultStep"
          },
          {
            "$ref": "#/components/schemas/UserInputStep"
          }
        ],
        "discriminator": {
          "propertyName": "type"
        }
      },
      "StepDelta": {
        "type": "object",
        "properties": {
          "event_type": {
            "const": "step.delta"
          },
          "index": {
            "type": "integer",
            "format": "int32"
          },
          "delta": {
            "$ref": "#/components/schemas/StepDeltaData"
          },
          "event_id": {
            "description": "The event_id token to be used to resume the interaction stream, from\nthis event.",
            "type": "string"
          },
          "metadata": {
            "description": "Optional metadata accompanying ANY streamed event.",
            "$ref": "#/components/schemas/StreamMetadata"
          }
        },
        "required": [
          "delta",
          "event_type",
          "index"
        ],
        "examples": [
          {
            "step_delta": {
              "summary": "Step Delta",
              "value": {
                "event_type": "step.delta",
                "index": 0,
                "delta": {
                  "type": "text",
                  "text": "Hello"
                }
              }
            }
          }
        ]
      },
      "StepDeltaData": {
        "type": "object",
        "oneOf": [
          {
            "$ref": "#/components/schemas/ArgumentsDelta"
          },
          {
            "$ref": "#/components/schemas/AudioDelta"
          },
          {
            "$ref": "#/components/schemas/CodeExecutionCallDelta"
          },
          {
            "$ref": "#/components/schemas/CodeExecutionResultDelta"
          },
          {
            "$ref": "#/components/schemas/DocumentDelta"
          },
          {
            "$ref": "#/components/schemas/FileSearchCallDelta"
          },
          {
            "$ref": "#/components/schemas/FileSearchResultDelta"
          },
          {
            "$ref": "#/components/schemas/FunctionResultDelta"
          },
          {
            "$ref": "#/components/schemas/GoogleMapsCallDelta"
          },
          {
            "$ref": "#/components/schemas/GoogleMapsResultDelta"
          },
          {
            "$ref": "#/components/schemas/GoogleSearchCallDelta"
          },
          {
            "$ref": "#/components/schemas/GoogleSearchResultDelta"
          },
          {
            "$ref": "#/components/schemas/ImageDelta"
          },
          {
            "$ref": "#/components/schemas/McpServerToolCallDelta"
          },
          {
            "$ref": "#/components/schemas/McpServerToolResultDelta"
          },
          {
            "$ref": "#/components/schemas/TextAnnotationDelta"
          },
          {
            "$ref": "#/components/schemas/TextDelta"
          },
          {
            "$ref": "#/components/schemas/ThoughtSignatureDelta"
          },
          {
            "$ref": "#/components/schemas/ThoughtSummaryDelta"
          },
          {
            "$ref": "#/components/schemas/UrlContextCallDelta"
          },
          {
            "$ref": "#/components/schemas/UrlContextResultDelta"
          },
          {
            "$ref": "#/components/schemas/VideoDelta"
          }
        ],
        "discriminator": {
          "propertyName": "type"
        }
      },
      "StepStart": {
        "type": "object",
        "properties": {
          "event_type": {
            "const": "step.start"
          },
          "index": {
            "type": "integer",
            "format": "int32"
          },
          "step": {
            "$ref": "#/components/schemas/Step"
          },
          "event_id": {
            "description": "The event_id token to be used to resume the interaction stream, from\nthis event.",
            "type": "string"
          },
          "metadata": {
            "description": "Optional metadata accompanying ANY streamed event.",
            "$ref": "#/components/schemas/StreamMetadata"
          }
        },
        "required": [
          "event_type",
          "index",
          "step"
        ],
        "examples": [
          {
            "step_start": {
              "summary": "Step Start",
              "value": {
                "event_type": "step.start",
                "index": 0,
                "step": {
                  "type": "model_output"
                }
              }
            }
          }
        ]
      },
      "StepStop": {
        "type": "object",
        "properties": {
          "event_type": {
            "const": "step.stop"
          },
          "index": {
            "type": "integer",
            "format": "int32"
          },
          "event_id": {
            "description": "The event_id token to be used to resume the interaction stream, from\nthis event.",
            "type": "string"
          },
          "metadata": {
            "description": "Optional metadata accompanying ANY streamed event.",
            "$ref": "#/components/schemas/StreamMetadata"
          }
        },
        "required": [
          "event_type",
          "index"
        ],
        "examples": [
          {
            "step_stop": {
              "summary": "Step Stop",
              "value": {
                "event_type": "step.stop",
                "index": 0
              }
            }
          }
        ]
      },
      "StreamMetadata": {
        "type": "object",
        "properties": {
          "usage": {
            "$ref": "#/components/schemas/Usage"
          }
        }
      },
      "TextAnnotationDelta": {
        "type": "object",
        "properties": {
          "type": {
            "const": "text_annotation_delta"
          },
          "annotations": {
            "description": "Citation information for model-generated content.",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Annotation"
            }
          }
        },
        "required": [
          "type"
        ]
      },
      "TextContent": {
        "description": "A text content block.",
        "type": "object",
        "properties": {
          "type": {
            "const": "text"
          },
          "text": {
            "description": "Required. The text content.",
            "type": "string"
          },
          "annotations": {
            "description": "Citation information for model-generated content.",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Annotation"
            }
          }
        },
        "required": [
          "text",
          "type"
        ],
        "examples": [
          {
            "text": {
              "summary": "Text",
              "value": {
                "type": "text",
                "text": "Hello, how are you?"
              }
            }
          }
        ]
      },
      "TextDelta": {
        "type": "object",
        "properties": {
          "type": {
            "const": "text"
          },
          "text": {
            "type": "string"
          }
        },
        "required": [
          "text",
          "type"
        ]
      },
      "TextResponseFormat": {
        "description": "Configuration for text output format.",
        "type": "object",
        "properties": {
          "type": {
            "const": "text"
          },
          "mime_type": {
            "description": "The MIME type of the text output.",
            "type": "string",
            "x-google-enum-descriptions": [
              "JSON output format.",
              "Plain text output format."
            ],
            "enum": [
              "application/json",
              "text/plain"
            ]
          },
          "schema": {
            "description": "The JSON schema that the output should conform to. Only applicable when\nmime_type is application/json.",
            "type": "object",
            "additionalProperties": {
              "description": "Properties of the object."
            }
          }
        },
        "required": [
          "type"
        ],
        "examples": [
          {
            "text_response_format": {
              "summary": "Text Output (JSON Schema)",
              "value": {
                "type": "text",
                "mime_type": "application/json",
                "schema": {
                  "type": "object",
                  "properties": {
                    "recipe_name": {
                      "type": "string"
                    },
                    "ingredients": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    }
                  },
                  "required": [
                    "ingredients",
                    "recipe_name"
                  ]
                }
              }
            }
          }
        ]
      },
      "ThinkingLevel": {
        "type": "string",
        "x-google-enum-descriptions": [
          "Little to no thinking.",
          "Low thinking level.",
          "Medium thinking level.",
          "High thinking level."
        ],
        "enum": [
          "minimal",
          "low",
          "medium",
          "high"
        ]
      },
      "ThinkingSummaries": {
        "type": "string",
        "x-google-enum-descriptions": [
          "Auto thinking summaries.",
          "No thinking summaries."
        ],
        "enum": [
          "auto",
          "none"
        ]
      },
      "ThoughtContent": {
        "description": "A thought content block.",
        "type": "object",
        "properties": {
          "type": {
            "const": "thought"
          },
          "signature": {
            "description": "Signature to match the backend source to be part of the generation.",
            "type": "string",
            "format": "byte"
          },
          "summary": {
            "description": "A summary of the thought.",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ThoughtSummaryContent"
            }
          }
        },
        "required": [
          "type"
        ],
        "examples": [
          {
            "thought": {
              "summary": "Thought",
              "value": {
                "type": "thought",
                "summary": [
                  {
                    "type": "text",
                    "text": "The user is asking about the weather. I should use the get_weather tool."
                  }
                ],
                "signature": "CoMDAXLI2nynRYojJIy6B1Jh9os2crpWLfB0+19xcLsGG46bd8wjkF/6RNlRUdvHrXyjsHkG0BZFcuO/bPOyA6Xh5jANNgx82wPHjGExN8A4ZQn56FlMwyZoqFVQz0QyY1lfibFJ2zU3J87uw26OewzcuVX0KEcs+GIsZa3EA6WwqhbsOd3wtZB3Ua2Qf98VAWZTS5y/tWpql7jnU3/CU7pouxQr/Bwft3hwnJNesQ9/dDJTuaQ8Zprh9VRWf1aFFjpIueOjBRrlT3oW6/y/eRl/Gt9BQXCYTqg/38vHFUU4Wo/d9dUpvfCe/a3o97t2Jgxp34oFKcsVb4S5WJrykIkw+14DzVnTpCpbQNFckqvFLuqnJCkL0EQFtunBXI03FJpPu3T1XU6id8S7ojoJQZSauGUCgmaLqUGdMrd08oo81ecoJSLs51Re9N/lISGmjWFPGpqJLoGq6uo4FHz58hmeyXCgHG742BHz2P3MiH1CXHUT2J8mF6zLhf3SR9Qb3lkrobAh"
              }
            }
          }
        ]
      },
      "ThoughtSignatureDelta": {
        "type": "object",
        "properties": {
          "type": {
            "const": "thought_signature"
          },
          "signature": {
            "description": "Signature to match the backend source to be part of the generation.",
            "type": "string",
            "format": "byte"
          }
        },
        "required": [
          "type"
        ]
      },
      "ThoughtStep": {
        "description": "A thought step.",
        "type": "object",
        "properties": {
          "type": {
            "const": "thought"
          },
          "signature": {
            "description": "A signature hash for backend validation.",
            "type": "string",
            "format": "byte"
          },
          "summary": {
            "description": "A summary of the thought.",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ThoughtSummaryContent"
            }
          }
        },
        "required": [
          "type"
        ],
        "examples": [
          {
            "thought": {
              "summary": "ThoughtStep",
              "value": {
                "type": "thought",
                "signature": "thought_sig_abcd1234",
                "summary": [
                  {
                    "type": "text",
                    "text": "The model is searching Google for the capital of France."
                  }
                ]
              }
            }
          }
        ]
      },
      "ThoughtSummaryContent": {
        "type": "object",
        "oneOf": [
          {
            "$ref": "#/components/schemas/ImageContent"
          },
          {
            "$ref": "#/components/schemas/TextContent"
          }
        ],
        "discriminator": {
          "propertyName": "type"
        }
      },
      "ThoughtSummaryDelta": {
        "type": "object",
        "properties": {
          "type": {
            "const": "thought_summary"
          },
          "content": {
            "description": "A new summary item to be added to the thought.",
            "$ref": "#/components/schemas/Content"
          }
        },
        "required": [
          "type"
        ]
      },
      "Tool": {
        "description": "A tool that can be used by the model.",
        "type": "object",
        "oneOf": [
          {
            "$ref": "#/components/schemas/CodeExecution"
          },
          {
            "$ref": "#/components/schemas/ComputerUse"
          },
          {
            "$ref": "#/components/schemas/FileSearch"
          },
          {
            "$ref": "#/components/schemas/Function"
          },
          {
            "$ref": "#/components/schemas/GoogleMaps"
          },
          {
            "$ref": "#/components/schemas/GoogleSearch"
          },
          {
            "$ref": "#/components/schemas/McpServer"
          },
          {
            "$ref": "#/components/schemas/Retrieval"
          },
          {
            "$ref": "#/components/schemas/UrlContext"
          }
        ],
        "discriminator": {
          "propertyName": "type"
        }
      },
      "ToolChoiceConfig": {
        "description": "The tool choice configuration containing allowed tools.",
        "type": "object",
        "properties": {
          "allowed_tools": {
            "description": "The allowed tools.",
            "$ref": "#/components/schemas/AllowedTools"
          }
        }
      },
      "ToolChoiceType": {
        "type": "string",
        "x-google-enum-descriptions": [
          "Auto tool choice.",
          "Any tool choice.",
          "No tool choice.",
          "Validated tool choice."
        ],
        "enum": [
          "auto",
          "any",
          "none",
          "validated"
        ]
      },
      "Turn": {
        "deprecated": true,
        "type": "object",
        "properties": {
          "role": {
            "description": "The originator of this turn. Must be user for input or model for\nmodel output.",
            "type": "string"
          },
          "content": {
            "oneOf": [
              {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/Content"
                },
                "title": "ContentList"
              },
              {
                "type": "string"
              }
            ]
          }
        }
      },
      "UrlCitation": {
        "description": "A URL citation annotation.",
        "type": "object",
        "properties": {
          "type": {
            "const": "url_citation"
          },
          "url": {
            "description": "The URL.",
            "type": "string"
          },
          "title": {
            "description": "The title of the URL.",
            "type": "string"
          },
          "start_index": {
            "description": "Start of segment of the response that is attributed to this source.\n\nIndex indicates the start of the segment, measured in bytes.",
            "type": "integer",
            "format": "int32"
          },
          "end_index": {
            "description": "End of the attributed segment, exclusive.",
            "type": "integer",
            "format": "int32"
          }
        },
        "required": [
          "type"
        ]
      },
      "UrlContext": {
        "description": "A tool that can be used by the model to fetch URL context.",
        "type": "object",
        "properties": {
          "type": {
            "const": "url_context"
          }
        },
        "required": [
          "type"
        ],
        "x-codeSamples": [
          {
            "lang": "sh",
            "label": "url_context",
            "source": "curl -X POST https://generativelanguage.googleapis.com/v1beta/interactions \\\n  -H \"x-goog-api-key: $GEMINI_API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -H \"Api-Revision: 2026-05-20\" \\\n  -d '{\n    \"model\": \"gemini-3.5-flash\",\n    \"tools\": [{\n      \"type\": \"url_context\"\n    }],\n    \"input\": \"Summarize https://www.example.com\"\n  }'\n"
          },
          {
            "lang": "python",
            "label": "url_context",
            "source": "from google import genai\n\nclient = genai.Client()\nresponse = client.interactions.create(\n    model=\"gemini-3.5-flash\",\n    tools=[{\"type\": \"url_context\"}],\n    input=\"Summarize https://www.example.com\"\n)\nprint(response.output_text)\n"
          },
          {
            "lang": "javascript",
            "label": "url_context",
            "source": "import {GoogleGenAI} from '@google/genai';\n\nconst ai = new GoogleGenAI({});\nconst interaction = await ai.interactions.create({\n    model: 'gemini-3.5-flash',\n    tools: [{ type: 'url_context' }],\n    input: 'Summarize https://www.example.com'\n});\nconsole.log(interaction.output_text);\n"
          }
        ]
      },
      "UrlContextCallArguments": {
        "description": "The arguments to pass to the URL context.",
        "type": "object",
        "properties": {
          "urls": {
            "description": "The URLs to fetch.",
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "UrlContextCallDelta": {
        "type": "object",
        "properties": {
          "type": {
            "const": "url_context_call"
          },
          "arguments": {
            "$ref": "#/components/schemas/UrlContextCallArguments"
          },
          "signature": {
            "description": "A signature hash for backend validation.",
            "type": "string",
            "format": "byte"
          }
        },
        "required": [
          "arguments",
          "type"
        ]
      },
      "UrlContextCallStep": {
        "description": "URL context call step.",
        "type": "object",
        "properties": {
          "type": {
            "const": "url_context_call"
          },
          "arguments": {
            "description": "Required. The arguments to pass to the URL context.",
            "$ref": "#/components/schemas/UrlContextCallStepArguments"
          },
          "id": {
            "description": "Required. A unique ID for this specific tool call.",
            "type": "string"
          },
          "signature": {
            "description": "A signature hash for backend validation.",
            "type": "string",
            "format": "byte"
          }
        },
        "required": [
          "arguments",
          "id",
          "type"
        ],
        "examples": [
          {
            "url_context_call": {
              "summary": "UrlContextCallStep",
              "value": {
                "type": "url_context_call",
                "id": "url_call_10219",
                "arguments": {
                  "urls": [
                    "https://www.example.com"
                  ]
                }
              }
            }
          }
        ]
      },
      "UrlContextCallStepArguments": {
        "description": "The arguments to pass to the URL context.",
        "type": "object",
        "properties": {
          "urls": {
            "description": "The URLs to fetch.",
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "UrlContextResult": {
        "description": "The result of the URL context.",
        "type": "object",
        "properties": {
          "url": {
            "description": "The URL that was fetched.",
            "type": "string"
          },
          "status": {
            "description": "The status of the URL retrieval.",
            "type": "string",
            "x-google-enum-descriptions": [
              "Url retrieval is successful.",
              "Url retrieval is failed due to error.",
              "Url retrieval is failed because the content is behind paywall.",
              "Url retrieval is failed because the content is unsafe."
            ],
            "enum": [
              "success",
              "error",
              "paywall",
              "unsafe"
            ]
          }
        }
      },
      "UrlContextResultDelta": {
        "type": "object",
        "properties": {
          "type": {
            "const": "url_context_result"
          },
          "result": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/UrlContextResult"
            }
          },
          "is_error": {
            "type": "boolean"
          },
          "signature": {
            "description": "A signature hash for backend validation.",
            "type": "string",
            "format": "byte"
          }
        },
        "required": [
          "result",
          "type"
        ]
      },
      "UrlContextResultItem": {
        "description": "The result of the URL context.",
        "type": "object",
        "properties": {
          "url": {
            "description": "The URL that was fetched.",
            "type": "string"
          },
          "status": {
            "description": "The status of the URL retrieval.",
            "type": "string",
            "x-google-enum-descriptions": [
              "",
              "",
              "",
              ""
            ],
            "enum": [
              "success",
              "error",
              "paywall",
              "unsafe"
            ]
          }
        }
      },
      "UrlContextResultStep": {
        "description": "URL context result step.",
        "type": "object",
        "properties": {
          "type": {
            "const": "url_context_result"
          },
          "result": {
            "description": "Required. The results of the URL context.",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/UrlContextResultItem"
            }
          },
          "is_error": {
            "description": "Whether the URL context resulted in an error.",
            "type": "boolean"
          },
          "call_id": {
            "description": "Required. ID to match the ID from the function call block.",
            "type": "string"
          },
          "signature": {
            "description": "A signature hash for backend validation.",
            "type": "string",
            "format": "byte"
          }
        },
        "required": [
          "call_id",
          "result",
          "type"
        ],
        "examples": [
          {
            "url_context_result": {
              "summary": "UrlContextResultStep",
              "value": {
                "type": "url_context_result",
                "call_id": "url_call_10219",
                "result": [
                  {
                    "url": "https://www.example.com",
                    "title": "Example Domain",
                    "snippet": "This domain is for use in illustrative examples in documents."
                  }
                ]
              }
            }
          }
        ]
      },
      "Usage": {
        "description": "Statistics on the interaction request's token usage.",
        "type": "object",
        "properties": {
          "total_input_tokens": {
            "description": "Number of tokens in the prompt (context).",
            "type": "integer",
            "format": "int32"
          },
          "input_tokens_by_modality": {
            "description": "A breakdown of input token usage by modality.",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ModalityTokens"
            }
          },
          "total_cached_tokens": {
            "description": "Number of tokens in the cached part of the prompt (the cached content).",
            "type": "integer",
            "format": "int32"
          },
          "cached_tokens_by_modality": {
            "description": "A breakdown of cached token usage by modality.",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ModalityTokens"
            }
          },
          "total_output_tokens": {
            "description": "Total number of tokens across all the generated responses.",
            "type": "integer",
            "format": "int32"
          },
          "output_tokens_by_modality": {
            "description": "A breakdown of output token usage by modality.",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ModalityTokens"
            }
          },
          "total_tool_use_tokens": {
            "description": "Number of tokens present in tool-use prompt(s).",
            "type": "integer",
            "format": "int32"
          },
          "tool_use_tokens_by_modality": {
            "description": "A breakdown of tool-use token usage by modality.",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ModalityTokens"
            }
          },
          "total_thought_tokens": {
            "description": "Number of tokens of thoughts for thinking models.",
            "type": "integer",
            "format": "int32"
          },
          "total_tokens": {
            "description": "Total token count for the interaction request (prompt + responses + other\ninternal tokens).",
            "type": "integer",
            "format": "int32"
          },
          "grounding_tool_count": {
            "description": "Grounding tool count.",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/GroundingToolCount"
            }
          }
        }
      },
      "UserInputStep": {
        "description": "Input provided by the user.",
        "type": "object",
        "required": [
          "type"
        ],
        "properties": {
          "content": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Content"
            },
            "title": "ContentList"
          },
          "type": {
            "const": "user_input"
          }
        },
        "examples": [
          {
            "user_input": {
              "summary": "UserInputStep",
              "value": {
                "type": "user_input",
                "content": [
                  {
                    "type": "text",
                    "text": "What is the capital of France?"
                  }
                ]
              }
            }
          }
        ]
      },
      "VertexAISearchConfig": {
        "description": "Used to specify configuration for VertexAISearch.",
        "type": "object",
        "properties": {
          "engine": {
            "description": "Optional. Used to specify Vertex AI Search engine.",
            "type": "string"
          },
          "datastores": {
            "description": "Optional. Used to specify Vertex AI Search datastores.",
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "VideoContent": {
        "description": "A video content block.",
        "type": "object",
        "properties": {
          "type": {
            "const": "video"
          },
          "data": {
            "description": "The video content.",
            "type": "string",
            "format": "byte"
          },
          "uri": {
            "description": "The URI of the video.",
            "type": "string"
          },
          "mime_type": {
            "description": "The mime type of the video.",
            "type": "string",
            "x-google-enum-descriptions": [
              "MP4 video format",
              "MPEG video format",
              "MPG video format",
              "MOV video format",
              "AVI video format",
              "FLV video format",
              "WebM video format",
              "WMV video format",
              "3GPP video format"
            ],
            "enum": [
              "video/mp4",
              "video/mpeg",
              "video/mpg",
              "video/mov",
              "video/avi",
              "video/x-flv",
              "video/webm",
              "video/wmv",
              "video/3gpp"
            ]
          },
          "resolution": {
            "description": "The resolution of the media.",
            "$ref": "#/components/schemas/MediaResolution"
          }
        },
        "required": [
          "type"
        ],
        "examples": [
          {
            "video": {
              "summary": "Video",
              "value": {
                "type": "video",
                "uri": "https://www.youtube.com/watch?v=9hE5-98ZeCg"
              }
            }
          }
        ]
      },
      "VideoDelta": {
        "type": "object",
        "properties": {
          "type": {
            "const": "video"
          },
          "data": {
            "type": "string",
            "format": "byte"
          },
          "uri": {
            "type": "string"
          },
          "mime_type": {
            "type": "string",
            "x-google-enum-descriptions": [
              "MP4 video format",
              "MPEG video format",
              "MPG video format",
              "MOV video format",
              "AVI video format",
              "FLV video format",
              "WebM video format",
              "WMV video format",
              "3GPP video format"
            ],
            "enum": [
              "video/mp4",
              "video/mpeg",
              "video/mpg",
              "video/mov",
              "video/avi",
              "video/x-flv",
              "video/webm",
              "video/wmv",
              "video/3gpp"
            ]
          },
          "resolution": {
            "description": "The resolution of the media.",
            "$ref": "#/components/schemas/MediaResolution"
          }
        },
        "required": [
          "type"
        ]
      },
      "Webhook": {
        "description": "A Webhook resource.",
        "type": "object",
        "properties": {
          "name": {
            "description": "Optional. The user-provided name of the webhook.",
            "type": "string"
          },
          "uri": {
            "description": "Required. The URI to which webhook events will be sent.",
            "type": "string"
          },
          "subscribed_events": {
            "description": "Required. The events that the webhook is subscribed to.\nAvailable events:\n- batch.succeeded\n- batch.expired\n- batch.failed\n- interaction.requires_action\n- interaction.completed\n- interaction.failed\n- video.generated",
            "type": "array",
            "items": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "const": "batch.expired",
                  "description": "Batch has not been processed within the 48h timeframe.",
                  "x-stainless-nominal": false
                },
                {
                  "const": "batch.failed",
                  "description": "Batch job failed.",
                  "x-stainless-nominal": false
                },
                {
                  "const": "batch.succeeded",
                  "description": "Batch processing finished successfully.",
                  "x-stainless-nominal": false
                },
                {
                  "const": "interaction.completed",
                  "description": "Interaction completed successfully.",
                  "x-stainless-nominal": false
                },
                {
                  "const": "interaction.failed",
                  "description": "Interaction failed.",
                  "x-stainless-nominal": false
                },
                {
                  "const": "interaction.requires_action",
                  "description": "Interaction requires action (e.g., function calling).",
                  "x-stainless-nominal": false
                },
                {
                  "const": "video.generated",
                  "description": "Video generation completed.",
                  "x-stainless-nominal": false
                }
              ]
            }
          },
          "create_time": {
            "description": "Output only. The timestamp when the webhook was created.",
            "readOnly": true,
            "type": "string",
            "format": "date-time"
          },
          "update_time": {
            "description": "Output only. The timestamp when the webhook was last updated.",
            "readOnly": true,
            "type": "string",
            "format": "date-time"
          },
          "signing_secrets": {
            "description": "Output only. The signing secrets associated with this webhook.",
            "readOnly": true,
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SigningSecret"
            }
          },
          "state": {
            "description": "Output only. The state of the webhook.",
            "readOnly": true,
            "type": "string",
            "x-google-enum-descriptions": [
              "The webhook is enabled.",
              "The webhook is disabled by the user.",
              "The webhook is disabled due to failed deliveries."
            ],
            "enum": [
              "enabled",
              "disabled",
              "disabled_due_to_failed_deliveries"
            ]
          },
          "new_signing_secret": {
            "description": "Output only. The new signing secret for the webhook. Only populated on create.",
            "readOnly": true,
            "type": "string"
          },
          "id": {
            "description": "Output only. The ID of the webhook.",
            "readOnly": true,
            "type": "string"
          }
        },
        "required": [
          "subscribed_events",
          "uri"
        ]
      },
      "WebhookConfig": {
        "description": "Message for configuring webhook events for a request.",
        "type": "object",
        "properties": {
          "uris": {
            "description": "Optional. If set, these webhook URIs will be used for webhook events instead of the\nregistered webhooks.",
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "user_metadata": {
            "description": "Optional. The user metadata that will be returned on each event emission to the\nwebhooks.",
            "type": "object",
            "additionalProperties": {
              "description": "Properties of the object."
            }
          }
        }
      },
      "WebhookUpdate": {
        "type": "object",
        "properties": {
          "name": {
            "description": "Optional. The user-provided name of the webhook.",
            "type": "string"
          },
          "uri": {
            "description": "Optional. The URI to which webhook events will be sent.",
            "type": "string"
          },
          "subscribed_events": {
            "description": "Optional. The events that the webhook is subscribed to.\nAvailable events:\n- batch.succeeded\n- batch.expired\n- batch.failed\n- interaction.requires_action\n- interaction.completed\n- interaction.failed\n- video.generated",
            "type": "array",
            "items": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "const": "batch.expired",
                  "description": "Batch has not been processed within the 48h timeframe.",
                  "x-stainless-nominal": false
                },
                {
                  "const": "batch.failed",
                  "description": "Batch job failed.",
                  "x-stainless-nominal": false
                },
                {
                  "const": "batch.succeeded",
                  "description": "Batch processing finished successfully.",
                  "x-stainless-nominal": false
                },
                {
                  "const": "interaction.completed",
                  "description": "Interaction completed successfully.",
                  "x-stainless-nominal": false
                },
                {
                  "const": "interaction.failed",
                  "description": "Interaction failed.",
                  "x-stainless-nominal": false
                },
                {
                  "const": "interaction.requires_action",
                  "description": "Interaction requires action (e.g., function calling).",
                  "x-stainless-nominal": false
                },
                {
                  "const": "video.generated",
                  "description": "Video generation completed.",
                  "x-stainless-nominal": false
                }
              ]
            }
          },
          "state": {
            "description": "Optional. The state of the webhook.",
            "type": "string",
            "x-google-enum-descriptions": [
              "The webhook is enabled.",
              "The webhook is disabled by the user.",
              "The webhook is disabled due to failed deliveries."
            ],
            "enum": [
              "enabled",
              "disabled",
              "disabled_due_to_failed_deliveries"
            ]
          }
        }
      }
    }
  }
}
