{"contents":[{"role":"user","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-g--request POST '/v1beta/models/gemini-2.5-flash-image-preview:generateContent?key={{YOUR_API_KEY}}' \
--header'Authorization: Bearer <token>' \
--header'Content-Type: application/json' \
--data-raw'{
"contents": [
{
"role": "user",
"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"
]
}
}'