CCAPI
  1. Images
CCAPI
  • Chat
    • Create chat completion
      POST
  • Audio
    • Convert text to speech
      POST
  • Images
    • Generate images (OpenAI-compatible)
      POST
    • Generate images (multimodal contents API)
      POST
    • Get job status
      GET
  • Catalog
    • List available models
      GET
    • List providers
      GET
    • Get provider details
      GET
  • Schemas
    • Schemas
      • ErrorObject
      • ErrorResponse
      • ChatMessage
      • ChatToolFunction
      • ChatTool
      • ChatCompletionRequest
      • ChatCompletionResponse
      • AudioSpeechRequest
      • AudioSpeechResponse
      • LegacyImageGenerationRequest
      • LegacyImageGenerationResponse
      • MultimodalInputContent
      • MultimodalImageParameters
      • MultimodalImageGenerationRequest
      • ImageDatum
      • MultimodalImageGenerationResponse
      • ModelSummary
      • ModelListResponse
      • ProviderSummary
      • ProviderListResponse
      • ProviderDetailResponse
    • Response
      • BadRequest
      • Unauthorized
      • BillingError
      • RateLimit
      • InternalError
  1. Images

Generate images (multimodal contents API)

POST
/images/generate
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": {}
    }
}
🟢202Accepted
🟠400Bad Request
🟠401Unauthorized
🟠402Payment Required
🔴500Internal Server Error
Modified at 2025-11-12 07:09:16
Previous
Generate images (OpenAI-compatible)
Next
Get job status
Built with