AI model APIChatNative Gemini format
Gemini media analysis
Analyze images, PDFs, audio and video with Gemini. Upload media as base64 through inlineData; fileData.fileUri and the File API are not supported by this endpoint.
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 '{}'{ "candidates": [ { "content": { "role": "string", "parts": [ {} ] }, "finishReason": "string", "safetyRatings": [ {} ] } ], "usageMetadata": { "promptTokenCount": 0, "candidatesTokenCount": 0, "totalTokenCount": 0 }}