Skip to main content
The platform supports accessing Gemini models using both the OpenAI chat/completions protocol and the native Gemini protocol. All examples below use non-streaming mode. To use streaming mode, change the Path to /gemini/v1/models/:streamGenerateContent.

Quick Start

OpenAI Protocol Thinking Control

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

Default Settings by Model

⚠️ Thinking cannot be disabled for Gemini 2.5 Pro. reasoning_effort: none will be converted to the minimum thinkingBudget of 128. ⚠️ thinkingBudget is supported only 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 Use

With Google Search, Gemini models can be grounded in real-time web content and support all available languages. This allows Gemini to provide more accurate answers and cite verifiable sources beyond the knowledge cutoff date.
Example results are shown below. In 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 the code execution results until it produces the final output.
Example results are shown below. For the OpenAI protocol, the code and code execution results will appear in 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 its response quality.
An example response is shown below.