图像生成
POST
https://api.gptacg.top/v1beta/models/gemini-2.0-flash-preview-image-generation:generateContent
请求参数
Query 参数
key
string
可选
Header 参数
Content-Type
string
可选
示例值:
application/json
Body 参数application/json
object {0}
示例
{
"contents": [
{
"parts": [
{
"text": "Hi, can you create a 3d rendered image of a pig with wings and a top hat flying over a happy futuristic scifi city with lots of greenery?"
}
]
}
],
"generationConfig": {
"responseModalities": [
"TEXT",
"IMAGE"
]
}
}
示例代码
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.gptacg.top/v1beta/models/gemini-2.0-flash-preview-image-generation:generateContent?key=' \
--header 'Content-Type: application/json' \
--data-raw '{
"contents": [
{
"parts": [
{
"text": "Hi, can you create a 3d rendered image of a pig with wings and a top hat flying over a happy futuristic scifi city with lots of greenery?"
}
]
}
],
"generationConfig": {
"responseModalities": [
"TEXT",
"IMAGE"
]
}
}'
返回响应
🟢200成功
application/json
Body
object {0}
示例
{}
修改于 2025-07-03 06:40:01