NodeKeyNodeKey
AI model interfaceChatNative Gemini format

Gemini Media Recognition

Gemini image, PDF, audio, and video recognition requests

⚠️Note: Only supports uploading images, PDFs, audio, and videos in base64 format via inlineData; fileData.fileUri or File API is 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://nodekey.xinghanyun.cn/v1beta/models/gpt-4o:generateContent" \  -H "Content-Type: application/json" \  -d '{    "contents": [      {        "role": "user",        "parts": [          {            "text": "手持镜头穿过清晨的咖啡店,阳光从窗边扫过桌面",            "inlineData": {              "mimeType": "example-type"            }          }        ]      }    ],    "generationConfig": {      "temperature": 1,      "topP": 1,      "topK": 1,      "maxOutputTokens": 1,      "stopSequences": []    },    "safetySettings": [      {}    ],    "tools": [      {}    ],    "systemInstruction": {      "parts": [        {}      ]    }  }'
{
  "candidates": [
    {
      "content": {
        "role": "string",
        "parts": [
          {}
        ]
      },
      "finishReason": "string",
      "safetyRatings": [
        {}
      ]
    }
  ],
  "usageMetadata": {
    "promptTokenCount": 0,
    "candidatesTokenCount": 0,
    "totalTokenCount": 0
  }
}

Last updated on