Overview
This endpoint provides file analysis functionality (stream).
Authentication
This endpoint requires authentication using a Bearer token.
Authorization
string
default:"sk-***********"
required
Your API key in the format: sk-***********
Path Parameters
model
string
default:"gemini-2.0-flash"
required
The model to use for the file analysis. Available models: gemini-2.0-flash, etc.
Request Body Parameters
An array of content objects representing the conversation history and file data.Show Content Object Structure
The role of the message sender. Typically "user" or "model". Optional for single-turn requests.
An array of parts that make up the message content. Can include both text and file data.Show Parts Object Structure
Text content of the message or prompt for analyzing the file.
Reference to file data for analysis (PDF, images, etc.).
The MIME type of the file (e.g., "application/pdf", "image/jpeg", "image/png").
The URI of the file to analyze. Can be a public URL.
Inline data for images or other media (base64 encoded).
Response from a function call.
Metadata for video content.
Signature for thought content.
Thought content for reasoning models.
Request Example
curl -X POST "https://gptproto.com/v1beta/models/gemini-2.0-flash:streamGenerateContent" \
-H "Authorization: sk-***********" \
-H "Content-Type: application/json" \
-d '{
"contents": [
{
"parts": [
{
"text": "Please summarize the main content of this PDF"
},
{
"file_data": {
"mime_type": "application/pdf",
"file_uri": "https://oss.heyoos.com/ai-draw/material/Essential-English.pdf"
}
}
]
}
]
}'
Response
Error Responses
{
"error": {
"message": "Invalid signature",
"type": "401"
}
}