Skip to main content
POST
/
v1beta
/
models
/
{model}
:streamGenerateContent
File Analysis (Stream)
curl --request POST \
  --url https://gptproto.com/v1beta/models/{model}:streamGenerateContent \
  --header 'Authorization: <authorization>' \
  --header 'Content-Type: application/json' \
  --data '{
  "contents": [
    {
      "role": "<string>",
      "parts": [
        {
          "text": "<string>",
          "file_data": {
            "mime_type": "<string>",
            "file_uri": "<string>"
          },
          "inlineData": {},
          "functionResponse": {},
          "videoMetadata": {},
          "functionCall": {},
          "functionCalls": [
            {}
          ],
          "thoughtSignature": "<string>",
          "thought": "<string>"
        }
      ]
    }
  ]
}'
{
  "error": {
    "message": "Invalid signature",
    "type": "401"
  }
}

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

contents
array
required
An array of content objects representing the conversation history and file data.

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

Success
200
Successful response
{
  "status": "success"
}

Error Responses

{
  "error": {
    "message": "Invalid signature",
    "type": "401"
  }
}