API 文档AI 模型接口图像Gemini
Gemini原生格式
Gemini 图片生成
Gemini原生格式
Gemini 图片生成
Base URL
https://autorouter.top— Production
Authentication
BearerAuth: http (bearer)
使用 Bearer Token 认证。
格式: Authorization: Bearer sk-xxxxxx
Endpoints
POST /v1beta/models/{model}:generateContent/
Gemini原生格式
Gemini 图片生成
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
model | path | string | Yes | 模型名称 |
Request Body
Content-Type: application/json
Properties:
| Name | Type | Required | Description |
|---|---|---|---|
contents | array | Yes | - |
generationConfig | object | Yes | - |
Responses
200: 成功
Content-Type: application/json
请求示例
curl -X POST "https://autorouter.top/v1beta/models/gemini-3.1-flash-image-preview:generateContent/" \
-H "Content-Type: application/json" \
-d '{
"contents": [
{
"role": "user",
"parts": [
{
"text": "生成一张宇航员在奥宇宙中飘浮的图片"
}
]
}
],
"generationConfig": {
"responseModalities": [
"IMAGE",
"TEXT"
]
}
}'响应示例
{
"candidates": [
{
"content": {
"role": "string",
"parts": [
{}
]
},
"finishReason": "string",
"safetyRatings": [
{}
]
}
],
"usageMetadata": {
"promptTokenCount": 0,
"candidatesTokenCount": 0,
"totalTokenCount": 0
}
}