Documentation renewed! For old docs, visit doc.newapi.pro
New APINew API
User GuideInstallationAPI ReferenceAI ApplicationsHelp & SupportBusiness Cooperation
AI Model APIChatGemini

Gemini Media Recognition

Gemini Image, PDF, Audio, Video Recognition Request

⚠️Note: Only supports uploading images, PDFs, audio, and video via inlineData in base64 format. fileData.fileUri or File API are not supported.

POST
/v1beta/models/{model}:generateContent

Authorization

BearerAuth

AuthorizationBearer <token>

使用 Bearer Token 认证。 格式: Authorization: Bearer sk-xxxxxx

In: header

Path Parameters

model*string

模型名称

Request Body

application/json

contents?
generationConfig?
safetySettings?
tools?
systemInstruction?

Response Body

application/json

curl -X POST "https://loading/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
  }
}

How is this guide?

Last updated on