Skip to main content
POST
https://llm.ai-nebula.com
/
v1
/
images
/
generations
Image Generation
curl --request POST \
  --url https://llm.ai-nebula.com/v1/images/generations \
  --header 'Authorization: <authorization>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "model": "<string>",
  "prompt": "<string>",
  "response_format": "<string>",
  "contents": [
    {}
  ]
}
'
{
  "code": 200,
  "msg": "Success",
  "data": {
    "data": [
      {
        "url": "",
        "b64_json": "iVBORw0KGgoAAAANSUhEUgAABAAAAAQA...",
        "revised_prompt": ""
      }
    ],
    "created": 1757320007
  }
}

Authentication

Authorization
string
required
Bearer Token, e.g. Bearer sk-xxxxxxxxxx

Request Body

model
string
required
Model name, e.g. gemini-2.5-flash-image-preview
prompt
string
Text prompt for text-to-image generation
response_format
string
default:"url"
Response format: b64_json or url
contents
array
Multi-turn conversation for image-to-image or context-aware generation

Text-to-Image

curl -X POST "https://llm.ai-nebula.com/v1/images/generations" \
  -H "Authorization: Bearer sk-xxxxxxxxxx" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gemini-2.5-flash-image-preview",
    "prompt": "A cute orange kitten sitting in a garden, sunny day, high quality photography",
    "response_format": "b64_json"
  }'

Image-to-Image

curl -X POST "https://llm.ai-nebula.com/v1/images/generations" \
  -H "Authorization: Bearer sk-xxxxxxxxxx" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gemini-2.5-flash-image-preview",
    "response_format": "b64_json",
    "contents": [
      {
        "role": "user",
        "parts": [
          {"text": "Generate a bird eye view of Canton Tower based on this image"},
          {"image": "data:image/png;base64,iVBORw0KGgoAAxxxx..."}
        ]
      }
    ]
  }'

Multi-turn Conversation

curl -X POST "https://llm.ai-nebula.com/v1/images/generations" \
  -H "Authorization: Bearer sk-xxxxxxxxxx" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gemini-2.5-flash-image-preview",
    "response_format": "b64_json",
    "contents": [
      {
        "role": "user",
        "parts": [
          {"text": "Generate a bird eye view of Canton Tower based on this image"},
          {"image": "data:image/png;base64,iVBORw0KGgoAAxxxx..."}
        ]
      },
      {
        "role": "model",
        "parts": [
          {"text": "Generated 1 image for you"},
          {"image": "data:image/png;base64,iVBORw0KGgoAAxxxx..."}
        ]
      },
      {
        "role": "user",
        "parts": [
          {"text": "Change the scene to a snowy night"}
        ]
      }
    ]
  }'
{
  "code": 200,
  "msg": "Success",
  "data": {
    "data": [
      {
        "url": "",
        "b64_json": "iVBORw0KGgoAAAANSUhEUgAABAAAAAQA...",
        "revised_prompt": ""
      }
    ],
    "created": 1757320007
  }
}