Gemini-style contents array that supports text-to-image, image-to-image, inpainting, and multi-image remix flows. Async providers return 202 with a poll_url while sync providers stream back data immediately.
Request
Authorization
Bearer Token
Provide your bearer token in the
Authorization
header when making requests to protected resources.
Example:
Authorization: Bearer ********************
or
Body Params application/jsonRequired
Example
{"model":"imaginepro/nano-banana","contents":[{"text":"A watercolor of CCAPI routing packets through a forest"}],"parameters":{"aspect_ratio":"16:9","quality":"hd","num_images":1}}
Request Code Samples
Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
Request Request Example
Shell
JavaScript
Java
Swift
curl--location--request POST 'http://prod-cn.your-api-server.com/images/generate' \
--header'Authorization: Bearer <token>' \
--header'Content-Type: application/json' \
--data-raw'{
"model": "imaginepro/nano-banana",
"contents": [
{
"text": "A watercolor of CCAPI routing packets through a forest"
}
],
"parameters": {
"aspect_ratio": "16:9",
"quality": "hd",
"num_images": 1
}
}'
Responses
🟢200OK
application/json
Synchronous completion
Body
Example
{"id":"string","created":0,"model":"string","status":"pending","execution":{"mode":"sync","operation":"text-to-image","provider":"string"},"data":[{"url":"http://example.com","b64_json":"string","revised_prompt":"string","seed":0}],"poll_url":"string","estimated_time":0,"error":{"message":"Missing or invalid Authorization header","type":"invalid_request_error","code":"unauthorized","details":{}}}