Gemini Media Recognition
Gemini image, PDF, audio, and video recognition requests.
Only
inlineDatabase64 uploads are supported.fileData.fileUriand the File API are not supported.
Request Conventions
| Item | Value |
|---|---|
| Base URL | https://token.wdcloud.ai |
| Authentication header | Authorization: Bearer <API_KEY> |
Endpoint
POST /v1beta/models/{model}:generateContent
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
model | string | Yes | Model name |
contents | array<object> | No | Input contents |
generationConfig | object | No | Generation settings |
safetySettings | array<object> | No | Safety settings |
tools | array<object> | No | Tool list |
systemInstruction | object | No | System instruction |
Example
bash
curl -X POST "https://token.wdcloud.ai/v1beta/models/gemini-2.5-pro:generateContent" \
-H "Authorization: Bearer sk-xxxxxxxxxxxxxxxx" \
-H "Content-Type: application/json" \
-d '{
"contents": [
{
"role": "user",
"parts": [
{ "text": "Please describe the image." },
{ "inlineData": { "mimeType": "image/png", "data": "BASE64_IMAGE" } }
]
}
]
}'