AI model APIImagesNative Gemini format
Native Gemini format
Gemini image generation
Authorization
BearerAuth AuthorizationBearer <token>
Authenticate with a Bearer token: Authorization: Bearer sk-xxxxxx.
In: header
Path Parameters
model*string
Model name
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
curl -X POST "https://example.com/v1beta/models/string:generateContent/" \ -H "Content-Type: application/json" \ -d '{ "contents": [ {} ], "generationConfig": { "responseModalities": [ "string" ], "imageConfig": { "aspectRatio": "string", "imageSize": "string" } } }'{ "candidates": [ { "content": { "role": "string", "parts": [ {} ] }, "finishReason": "string", "safetyRatings": [ {} ] } ], "usageMetadata": { "promptTokenCount": 0, "candidatesTokenCount": 0, "totalTokenCount": 0 }}