官方文档:https://ai.google.dev/gemini-api/docs/text-generation?hl=zh-cn#multi-turn-conversations
POST
/v1beta/models/gemini-2.5-pro:generateContentEmbeddings
API Key application/json
请求示例
curl -X POST https://top.qingyuntop.ai/v1beta/models/gemini-2.5-pro:generateContent \
-H "Authorization: Bearer ${QINGYUN_TOP_API_KEY}" \
-H "Content-Type: application/json" \
-d '{
"systemInstruction": {
"parts": [
{
"text": "你是一直小猪.你会在回复开始的时候 加一个'哼哼'"
}
]
},
"contents": [
{
"role": "user",
"parts": [
{
"text": "你是谁?"
}
]
}
],
"generationConfig": {
"temperature": 1,
"topP": 1,
"thinkingConfig": {
"includeThoughts": true,
"thinkingBudget": 26240
}
}
}'请求参数
| 参数 | 位置 | 类型 | 必填 | 说明 | 示例 |
|---|---|---|---|---|---|
key | Query | string | 是 | - | {{YOUR_API_KEY}} |
Content-Type | Header | string | 是 | - | application/json |
x-goog-api-key | Header | string | 否 | - | {{YOUR_API_KEY}} |
contents | JSON body | array<object> | 是 | - | - |
contents[].parts | JSON body | array<object> | 否 | - | - |
contents[].parts[].text | JSON body | string | 否 | - | - |
返回响应 (200)
此部分没有定义参数。
来源原始接口定义(用于追溯)
以下内容来自 Apifox 快照,可能包含兼容层字段或旧示例;公开调用请以本页的协议说明和当前模型列表为准。
{
"id": 497673462,
"name": "Embeddings",
"type": "http",
"serverId": "",
"preProcessors": [],
"postProcessors": [],
"inheritPreProcessors": {},
"inheritPostProcessors": {},
"description": "官方文档:https://ai.google.dev/gemini-api/docs/text-generation?hl=zh-cn#multi-turn-conversations",
"operationId": "",
"sourceUrl": "",
"method": "post",
"path": "/v1beta/models/gemini-2.5-pro:generateContent",
"tags": [],
"status": 1,
"requestBody": {
"type": "application/json",
"parameters": [],
"jsonSchema": {
"type": "object",
"properties": {
"contents": {
"type": "array",
"items": {
"type": "object",
"properties": {
"parts": {
"type": "array",
"items": {
"type": "object",
"properties": {
"text": {
"type": "string"
}
},
"x-apifox-orders": [
"text"
]
}
}
},
"x-apifox-orders": [
"parts"
]
}
}
},
"required": [
"contents"
],
"x-apifox-orders": [
"contents"
]
},
"examples": [
{
"mediaType": "application/json",
"value": "{\n \"systemInstruction\": {\n \"parts\": [\n {\n \"text\": \"你是一直小猪.你会在回复开始的时候 加一个'哼哼'\"\n }\n ]\n },\n \"contents\": [\n {\n \"role\": \"user\",\n \"parts\": [\n {\n \"text\": \"你是谁?\"\n }\n ]\n }\n ],\n \"generationConfig\": {\n \"temperature\": 1,\n \"topP\": 1,\n \"thinkingConfig\": {\n \"includeThoughts\": true,\n \"thinkingBudget\": 26240\n }\n }\n}",
"name": "示例"
}
],
"mediaType": "",
"oasExtensions": "",
"required": false,
"additionalContentTypes": []
},
"parameters": {
"path": [],
"query": [
{
"id": "b4inb5ENt1",
"name": "key",
"required": true,
"enable": false,
"description": "",
"type": "string",
"sampleValue": "{{YOUR_API_KEY}}"
}
],
"cookie": [],
"header": [
{
"id": "fuFf2peRev",
"name": "Content-Type",
"required": true,
"enable": true,
"description": "",
"type": "string",
"sampleValue": "application/json"
},
{
"id": "Rewr7FIy5O",
"name": "x-goog-api-key",
"required": false,
"enable": true,
"description": "",
"type": "string",
"sampleValue": "{{YOUR_API_KEY}}"
}
]
},
"commonParameters": {
"query": [],
"body": [],
"cookie": [],
"header": []
},
"auth": {
"type": "noauth"
},
"responses": [
{
"id": 112477717,
"name": "成功",
"code": 200,
"contentType": "json",
"jsonSchema": {
"type": "object",
"properties": {},
"x-apifox-orders": []
},
"itemSchema": {},
"description": "",
"mediaType": "",
"headers": [],
"oasExtensions": ""
}
],
"responseExamples": [],
"codeSamples": [],
"projectId": 8662722,
"moduleId": 8310462,
"folderId": 92749360,
"ordering": 108,
"responsibleId": 0,
"commonResponseStatus": {},
"advancedSettings": {
"disabledSystemHeaders": {}
},
"customApiFields": {},
"oasExtensions": "",
"mockScript": {},
"createdAt": "2026-08-05T14:40:23.000Z",
"updatedAt": "2026-08-06T12:15:55.000Z",
"creatorId": 2863449,
"editorId": 2863449,
"creatorUserId": 2863449,
"editorUserId": 2863449,
"responseChildren": [],
"visibility": "INHERITED",
"securityScheme": {},
"callbacks": ""
}