Gemini原生格式
Gemini 图片生成
POST
https://api.xiexus.cn/v1beta/models/{model}:generateContent/
请求体:可选
接口信息
方法
POST路径
/v1beta/models/{model}:generateContent/完整地址
https://api.xiexus.cn/v1beta/models/{model}:generateContent/请求体
可选
标签
图像(Images)/原生Gemini格式
响应码
200
静态文件
当前接口页内已嵌入 OpenAPI JSON;如果需要查看总文件,可直接打开固定静态文件
relay.json。当前 JSON
../../../openapi/generated/ai-model/图像(Images)/原生Gemini格式/post-v1beta-models-model-generatecontent-geminirelayv1beta-383837589-383837589.json总文件
../../../openapi/relay.jsonOpenAPI JSON
已将服务地址固定为
https://api.xiexus.cn,其余结构保持和源文档一致。{
"openapi": "3.1.0",
"info": {
"title": "Gemini原生格式",
"version": "1.0.0",
"description": "Gemini 图片生成"
},
"tags": [
{
"name": "图像(Images)/原生Gemini格式"
}
],
"components": {
"securitySchemes": {
"BearerAuth": {
"type": "http",
"scheme": "bearer",
"description": "使用 Bearer Token 认证。\n格式: `Authorization: Bearer sk-xxxxxx`\n"
}
}
},
"paths": {
"/v1beta/models/{model}:generateContent/": {
"post": {
"tags": [
"图像(Images)/原生Gemini格式"
],
"summary": "Gemini原生格式",
"description": "Gemini 图片生成",
"operationId": "geminirelayv1beta-383837589",
"parameters": [
{
"name": "model",
"in": "path",
"required": true,
"description": "模型名称",
"schema": {
"type": "string"
}
}
],
"requestBody": {
"required": false,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"contents": {
"type": "array",
"items": {
"type": "object",
"properties": {
"role": {
"type": "string"
},
"parts": {
"type": "array",
"items": {
"type": "object",
"properties": {
"text": {
"type": "string"
}
},
"x-apifox-orders": [
"text"
]
}
}
},
"x-apifox-orders": [
"role",
"parts"
]
}
},
"generationConfig": {
"type": "object",
"properties": {
"thinkingConfig": {
"type": "object",
"properties": {
"includeThoughts": {
"type": "boolean",
"description": "是否返回思考内容"
}
},
"required": [
"includeThoughts"
],
"x-apifox-orders": [
"includeThoughts"
]
},
"responseModalities": {
"type": "array",
"items": {
"type": "string"
}
},
"imageConfig": {
"type": "object",
"properties": {
"aspectRatio": {
"type": "string"
},
"imageSize": {
"type": "string"
}
},
"required": [
"aspectRatio",
"imageSize"
],
"x-apifox-orders": [
"aspectRatio",
"imageSize"
]
}
},
"required": [
"responseModalities",
"imageConfig"
],
"x-apifox-orders": [
"thinkingConfig",
"responseModalities",
"imageConfig"
]
}
},
"required": [
"contents",
"generationConfig"
],
"x-apifox-orders": [
"contents",
"generationConfig"
]
}
}
}
},
"security": [
{
"BearerAuth": []
}
],
"responses": {
"200": {
"description": "成功",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"candidates": {
"type": "array",
"items": {
"type": "object",
"properties": {
"content": {
"type": "object",
"properties": {
"role": {
"type": "string"
},
"parts": {
"type": "array",
"items": {
"type": "object",
"properties": {},
"x-apifox-orders": []
}
}
},
"x-apifox-orders": [
"role",
"parts"
]
},
"finishReason": {
"type": "string"
},
"safetyRatings": {
"type": "array",
"items": {
"type": "object",
"properties": {},
"x-apifox-orders": []
}
}
},
"x-apifox-orders": [
"content",
"finishReason",
"safetyRatings"
]
}
},
"usageMetadata": {
"type": "object",
"properties": {
"promptTokenCount": {
"type": "integer"
},
"candidatesTokenCount": {
"type": "integer"
},
"totalTokenCount": {
"type": "integer"
}
},
"x-apifox-orders": [
"promptTokenCount",
"candidatesTokenCount",
"totalTokenCount"
]
}
},
"x-apifox-orders": [
"candidates",
"usageMetadata"
]
}
}
}
}
}
}
}
},
"servers": [
{
"url": "https://api.xiexus.cn",
"description": "固定生产地址"
}
]
}