Skip to main content
POST
https://ai-nebula.com
/
prod-api
/
nebula
/
v4
/
api
/
text2imageSubmit
AI Image - Text to Image
curl --request POST \
  --url https://ai-nebula.com/prod-api/nebula/v4/api/text2imageSubmit \
  --header 'Authorization: <authorization>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "volcEngineReqDTO.req.prompt": "<string>",
  "volcEngineReqDTO.req.size": "<string>"
}
'
{
  "code": 200,
  "msg": "Operation successful",
  "data": {
    "images": [{
      "url": "https://example.com/image.jpg"
    }]
  }
}

Introduction

Submit text-to-image task, used to generate new images based on text description.

Authentication

Authorization
string
required
Bearer Token, e.g., Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9... How to get: Obtain via the POST interface in the Authentication module at the top left, https://docs.openai-nebula.com/en/nebula-lab-v4/endpoint/get-token

Request Parameters

volcEngineReqDTO.req.prompt
string
required
Image description prompt
volcEngineReqDTO.req.size
string
Image size, e.g., 512x512, 1024x1024

Example Code

curl -X POST "https://ai-nebula.com/prod-api/nebula/v4/api/text2imageSubmit" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer sk-xxxxxxxxxx" \
  -d '{
    "req": {
      "prompt": "A cute little cat playing on the grass",
      "size": "1024x1024"
    }
  }'

Response Example

{
  "code": 200,
  "msg": "Operation successful",
  "data": {
    "images": [{
      "url": "https://example.com/image.jpg"
    }]
  }
}