Skip to main content
POST
Gemini Native Format
  • Call Gemini models using Google Native API format
  • Supports synchronous and streaming generation methods
  • Minimal parameters for quick start

Usage Examples

Generate Content

Endpoint:
Request body:

Stream Generate Content

Endpoint:
Request body:

Multimodal Input

Notes

  • Use generateContent for complete JSON responses.
  • Use streamGenerateContent for streaming generation.
  • Put text instructions before multimodal parts when possible.

Authorizations

Authorization
string
header
required

All API endpoints require Bearer Token authentication.

Get your API Key:

Visit the API Key Management Page to get your API Key

Add it to the request header:

Path Parameters

model
string
required

Gemini model name. Example: gemini-3-flash-preview.

Example:

"gemini-3-flash-preview"

method
enum<string>
required

Request method. Use generateContent for complete JSON responses and streamGenerateContent for streaming generation.

Available options:
generateContent,
streamGenerateContent
Example:

"generateContent"

Body

application/json
contents
object[]
required

Conversation contents with roles and parts. Each content object may include a role (user or model) and a parts array containing text or inline data.

generationConfig
object

Generation configuration, including temperature, topP, topK, maxOutputTokens, and stopSequences.

safetySettings
object[]

Safety settings.

Response

200 - application/json

Content generated

code
integer
Example:

200

data
object
usageMetadata
object