Skip to main content
The Gemini Native API lets you interact with Gemini models using Google’s native request format, including the contents and generationConfig structure. All Gemini models accessible through this endpoint support both image and video analysis, making it the right choice whenever you need multimodal capabilities with the full flexibility of the native Gemini protocol. Base URL: http://apillm.globalaiopc.com/gw_llm_power Endpoints:
  • POST /v1/models/{model}:generateContent — Standard (non-streaming) response
  • POST /v1/models/{model}:streamGenerateContent — Streaming response

Authentication

Authenticate every request using the Authorization header with your API key:

Supported Models

All Gemini models available through this endpoint support image and video analysis.

Model Suffix Reference

Request Parameters

array
required
The array of message content objects that make up the conversation. Each object typically contains a role and a parts array.
string
The role of the message author. Use user for human turns and model for prior model turns in multi-turn conversations.
array
required
An array of content parts for the message. Typically contains text objects for plain text input. The native Gemini multimodal structure (inline images, video, etc.) is also supported.
string
The text content of the part.
number
Controls the randomness of the model’s output. Lower values produce more focused, deterministic responses; higher values produce more creative output.
number
Nucleus sampling parameter. The model considers only the tokens comprising the top topP probability mass.
integer
The maximum number of tokens the model may generate in its response.
string
An optional system prompt that sets the context and behavior for the model. Provide this as a text part within the systemInstruction object.

Response Fields

string
The text content generated by the model.
string
The reason the model stopped generating. Common values include STOP (natural end) and MAX_TOKENS (token limit reached).
integer
The number of tokens in the input contents and system instruction.
integer
The number of tokens in the generated response candidates.
integer
The total number of tokens used in the request (prompt + candidates).

Code Examples

Example Response

To receive a streaming response, replace :generateContent with :streamGenerateContent in the request URL. The API will return a series of incremental response chunks in the native Gemini streaming format.
This endpoint follows the native Google Gemini protocol. For complete details on multimodal input, function calling, safety settings, and advanced generation configuration, refer to the Google Gemini generateContent documentation.