POST
https://octopusx.ai
/
v1
/
images
/
generations
Jimeng Image Generation
curl --request POST \
  --url https://octopusx.ai/v1/images/generations \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "model": "<string>",
  "prompt": "<string>",
  "n": 123,
  "size": "<string>",
  "image": [
    {}
  ],
  "ratio": "<string>",
  "resolution": "<string>"
}
'
{
  "created": 1735689600,
  "data": [
    {
      "url": "https://example.com/generated-image.png",
      "revised_prompt": "A close-up depiction of a domestic cat in a relaxed state..."
    }
  ]
}

Jimeng Image Generation

An image generation API in OpenAI-compatible format, supporting the image generation capabilities of the Jimeng model.
  • The route entry is POST /v1/images/generations.
  • Currently submitted using application/json.
  • Supports Jimeng models (jimeng-4.0, jimeng-4.5).
  • Supports image-to-image generation by passing a reference image through the image field.

Supported Models

  • jimeng-4.0: Jimeng 4.0 model
  • jimeng-4.5: Jimeng 4.5 model

Method and Path

POST /v1/images/generations

Request Example

curl -X POST https://octopusx.ai/v1/images/generations \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Accept: application/json" \
  -d '{
    "model": "jimeng-4.0",
    "prompt": "A close-up depiction of a domestic cat in a relaxed state. The cat features vibrant orange fur, with striking white markings around its eyes that extend down to its soft, pink nose.",
    "n": 1,
    "size": "1024*1024"
  }'

Example with Reference Image

curl -X POST https://octopusx.ai/v1/images/generations \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Accept: application/json" \
  -d '{
    "model": "jimeng-4.0",
    "prompt": "Generate a photorealistic image based on the reference image",
    "n": 1,
    "image": ["https://example.com/reference.png"],
    "ratio": "16:9",
    "resolution": "2k"
  }'

Response Example

{
  "created": 1735689600,
  "data": [
    {
      "url": "https://example.com/generated-image.png",
      "revised_prompt": "A close-up depiction of a domestic cat in a relaxed state..."
    }
  ]
}

Authentication

Authorization: Bearer YOUR_API_KEY

Body

model
string
required
Model name. Supports jimeng-4.0 and jimeng-4.5.
prompt
string
required
Prompt. The text description for image generation, supporting both Chinese and English.
n
integer
required
Number of images. The number of images to generate.
size
string
Image size. Resolution settings, such as 1024*1024.
image
array
Reference image. An array of reference image URLs, used for image-to-image scenarios.
ratio
string
Image ratio. For example, 1:1, 16:9, 9:16, 4:3, 3:4, and so on.
resolution
string
Resolution. Available values: 1k, 2k, 4k.

Response

created
integer
Generation timestamp (Unix timestamp).
data
array
Array of generation results.
data[].url
string
URL of the generated image.
data[].revised_prompt
string
Rewritten prompt (returned by some upstream services).