- OpenAI兼容格式
- Gemini原生格式
- Anthropic原生格式
- 列出支持的模型GET
结构化输出
POST
https://api.juheai.top/v1beta/models/gemini-2.0-flash:generateContent
请求参数
Query 参数
key
string
可选
Header 参数
Content-Type
string
可选
示例值:
application/json
Body 参数application/json
object {0}
示例
{
"contents": [
{
"parts": [
{
"text": "List a few popular cookie recipes, and include the amounts of ingredients."
}
]
}
],
"generationConfig": {
"responseMimeType": "application/json",
"responseSchema": {
"type": "ARRAY",
"items": {
"type": "OBJECT",
"properties": {
"recipeName": {
"type": "STRING"
},
"ingredients": {
"type": "ARRAY",
"items": {
"type": "STRING"
}
}
},
"propertyOrdering": [
"recipeName",
"ingredients"
]
}
}
}
}
示例代码
Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
请求示例请求示例
Shell
JavaScript
Java
Swift
curl --location --request POST 'https://api.juheai.top/v1beta/models/gemini-2.0-flash:generateContent?key=' \
--header 'Content-Type: application/json' \
--data-raw '{
"contents": [
{
"parts": [
{
"text": "List a few popular cookie recipes, and include the amounts of ingredients."
}
]
}
],
"generationConfig": {
"responseMimeType": "application/json",
"responseSchema": {
"type": "ARRAY",
"items": {
"type": "OBJECT",
"properties": {
"recipeName": {
"type": "STRING"
},
"ingredients": {
"type": "ARRAY",
"items": {
"type": "STRING"
}
}
},
"propertyOrdering": [
"recipeName",
"ingredients"
]
}
}
}
}'
返回响应
🟢200成功
application/json
Body
object {0}
示例
{}
修改于 2025-06-16 09:36:39