ccapi
🇺🇸English
  • 🇨🇳简体中文
  • 🇺🇸English
Home
Home
🇺🇸English
  • 🇨🇳简体中文
  • 🇺🇸English
🇺🇸English
  • 🇨🇳简体中文
  • 🇺🇸English
  1. nano banana
  • OpenClaw + CCAPI LLM Integration Guide
  • claude code integration
  • codex cli integration
  • gemini cli integration
  • Chat
    • OpenAI
      • Create Chat Completion
      • Create Response
    • Google
      • Generate Content
      • Stream Generate Content
    • Anthropic
      • Create Message
    • DeepSeek
      • Create Chat Completion
    • MiniMax
      • Create Chat Completion
  • Image
    • nano banana
      • Generate Image
        POST
    • z-image-turbo
      • integration docs
    • seedream
      • integration doc
  • Video
    • seedance
    • vidu
  • Audio
    • Producer
      • Generate Music
      • Generate Lyrics
      • Extend Music
      • Create Cover
      • Create Variation
      • Replace Segment
      • Vocals Swap
      • Instrumentals Swap
      • Stem Separation
      • Download Audio
      • Upload Audio
      • Generate Video
      • Fetch Task Status
      • Batch Fetch Tasks
    • Suno
      • Generate Music
      • Fetch Task Status
      • Generate Lyrics
      • Extend Music
      • Create Cover
      • Extract Stems
      • Extract All Stems
      • Add Vocals
      • Add Instrumental
      • Replace Section
      • Remaster Song
      • Mashup
      • Sample Section
      • Generate Sounds
      • Generate MIDI
      • Upload Audio
      • Concatenate Music
      • Get Aligned Lyrics
      • Generate Music Video
      • Export as WAV
      • Create Voice Persona(unavailable)
      • Detect BPM
      • Extract Vocals
      • Upsample Tags
      • Batch Fetch Tasks
  1. nano banana

Generate Image

POST
https://api.ccapi.ai//v1/images/generations
Generate images using the Gemini per-call image model.
Supports text-to-image, image-to-image, and multi-image blending, all using the OpenAI Images-compatible request format.

Use Cases#

Want to call Gemini image capabilities directly using public model names
Don't want to construct Gemini native contents / parts manually
Want to receive URL results uniformly for easy frontend or business-side display

Model Selection Guide#

nano-banana: Basic version, fixed 1K
nano-banana-pro-*: Resolution (1K / 2K / 4K) distinguished by model name
nano-banana-2-*: Resolution (0.5K / 1K / 2K / 4K) distinguished by model name

Key Field Descriptions#

model#

The model field determines the underlying image capability, output resolution tier, and billing tier simultaneously.
For standard quality at the lowest cost: start with nano-banana
For higher quality while maintaining standard aspect ratios: use nano-banana-pro-*
For ultra-wide formats or Gen 2 capabilities: use nano-banana-2-*
Resolution is encoded in the model name, so no additional field is needed to select the tier.

image#

Not provided: text-to-image
Single string: single-image image-to-image
String array: multi-image blending
It is recommended to pass publicly accessible image URLs.
If your client uses Base64, wrap it as a data:image/png;base64,... string yourself; the platform will not automatically convert raw Base64 to an image reference format.

aspect_ratio#

This is a top-level field, not nested inside another object.
When omitted, the platform does not inject a default aspect ratio; the actual default follows the upstream model
nano-banana / nano-banana-pro-* are suitable for standard poster, landscape, and portrait ratios
nano-banana-2-* additionally supports ultra-wide formats like 1:4, 4:1, 1:8, 8:1
Adjusting aspect_ratio only changes the canvas ratio, not the model tier you selected

Response Description#

Response structure follows the OpenAI Images style
data[].url is the final accessible image URL
data[].revised_prompt is the normalized prompt from the platform

请求参数

Authorization
or
Body 参数application/json必填

示例
{
    "model": "nano-banana-2-2k",
    "prompt": "A cute cat sitting on a windowsill, watercolor style"
}

请求示例代码

Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
请求示例请求示例
Shell
JavaScript
Java
Swift
cURL
curl --location --request POST 'https://api.ccapi.ai//v1/images/generations' \
--header 'Content-Type: application/json' \
--data-raw '{
    "model": "nano-banana-2-2k",
    "prompt": "A cute cat sitting on a windowsill, watercolor style"
}'

返回响应

🟢200成功
application/json
Image generated successfully
Body

示例
{
    "created": 1773294301,
    "data": [
        {
            "url": "https://cdn.ccapi.ai/images/generated/nano-banana/1773294301681-0.png?token=example",
            "revised_prompt": "According my description, output image: A tiny banana astronaut sticker on a white background, flat vector style"
        }
    ]
}
🟠400请求有误
🟠401未认证
🟠403权限不足
🔴500服务器内部错误
修改于 2026-03-16 06:06:09
上一页
Create Chat Completion
下一页
integration docs
Built with