Skip to main content
The platform supports accessing Gemini models using the OpenAI chat/completions protocol and the Gemini native protocol. The following examples all use non-Stream mode. For Stream mode, change the path to /gemini/v1/models/:streamGenerateContent.

Quick Start

OpenAI Protocol Thinking Control

The platform converts the reasoning_effort parameter from OpenAI chat/completions requests into Gemini thinking parameters. ⚠️ Non-standard OpenAI values disable/none can be used to turn off the thinking process.

Default Settings per Model

⚠️ Thinking cannot be disabled for Gemini 2.5 Pro; reasoning_effort: none will be converted to the minimum thinkingBudget of 128. ⚠️ thinkingBudget is only supported in Gemini 2.5 Flash, 2.5 Pro, and 2.5 Flash-Lite. Depending on the prompt, the model may exceed or fall below the token budget.

Server-Side Tool Usage

With Google Search, you can connect Gemini models to real-time web content, supporting all available languages. This allows Gemini to provide more accurate answers and cite verifiable sources beyond its knowledge cutoff date.
The result example is as follows. For the OpenAI protocol, grounding information can be obtained from the non-standard field gemini_grounding_metadata.

Code Execution

Gemini provides a code execution tool that allows the model to generate and run Python code. The model can then iteratively learn from code execution results until it produces the final output.
The result example is as follows. For the OpenAI protocol, the code and code execution results are included in the content. For the Gemini protocol, the code is in the executableCode field, the execution result is in the codeExecutionResult field, and the summary is in the text field.

URL context

With the URL context tool, you can provide additional context to the model in the form of URLs. By adding URLs to the request, the model will access the content of those web pages to inform and improve the quality of its responses.
Example response below: