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.

Response

generateContent returns the Gemini GenerateContentResponse object directly, without a code / data wrapper. Text is in candidates[].content.parts[].text, and token counts are in usageMetadata. Thinking models can add parts with thought: true or thoughtSignature; skip parts that have no text.

Streaming

streamGenerateContent returns text/event-stream. Each event is a data: line with a partial GenerateContentResponse, and the stream ends with data: [DONE]. The alt=sse query parameter is accepted but not required.
  • Concatenate the text parts in order. The last event carries finishReason.

Errors

  • 401: missing or invalid API key.
  • 400: invalid request, or the model is not a Gemini model. The body uses the Google error shape: {"error": {"code": 400, "message": "...", "status": "INVALID_ARGUMENT"}}.
  • 404: unknown model id.
See Error Codes for example bodies, and LLM Models for which models support this format.

Authorizations

Authorization
string
header
required

All API endpoints require Bearer Token authentication.

Create an API key: sign in to PoYo, open Dashboard → API Key at poyo.ai/dashboard/api-key, and click to create a 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

Content generated

candidates
object[]
promptFeedback
object