POST
https://octopusx.ai
/
v1
/
images
/
edits
Jimeng Image Editing
curl --request POST \
  --url https://octopusx.ai/v1/images/edits \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "model": "<string>",
  "prompt": "<string>",
  "n": 123,
  "ratio": "<string>",
  "quality": "<string>",
  "response_format": "<string>",
  "resolution": "<string>"
}
'
{
  "created": 1735689600,
  "data": [
    {
      "url": "https://example.com/edited-image.png",
      "revised_prompt": "Generate a photorealistic image based on the reference image"
    }
  ]
}

Jimeng Image Editing

An OpenAI-compatible image editing interface, submitted using multipart/form-data, supports generating new images based on a reference image.
  • The route entry is POST /v1/images/edits.
  • Currently submitted using multipart/form-data.
  • A reference image file must be provided for editing.
  • Supports Jimeng model image editing capabilities.

Supported Models

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

Method and Path

POST /v1/images/edits

Request Example

curl -X POST https://octopusx.ai/v1/images/edits \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -F "model=jimeng-4.0" \
  -F "prompt=Generate a photorealistic image based on the reference image" \
  -F "image=@/path/to/image.png" \
  -F "n=1" \
  -F "ratio=16:9"

Response Example

{
  "created": 1735689600,
  "data": [
    {
      "url": "https://example.com/edited-image.png",
      "revised_prompt": "Generate a photorealistic image based on the reference image"
    }
  ]
}

Authentication

Authorization: Bearer YOUR_API_KEY

Body

model
string
Model name. For example, jimeng-4.0, jimeng-4.5.
prompt
string
required
Prompt. Text describing the editing content, supports Chinese and English.
image
file
required
The image to edit. Upload a single image file for editing. It must be a supported image file, supporting png, webp, and jpg formats, with each image no larger than 25MB.
n
integer
Number of images. The number of images to generate, defaults to 1.
ratio
string
Aspect ratio of the generated image. For example, 16:9, 1:1, 9:16, etc.
quality
string
Quality of the generated image. auto (default) will automatically select the best quality for the given model. gpt-image-l supports high, medium, and low; dall-e-3 supports hd and standard; dall-e-2 supports only standard.
response_format
string
Format of the returned generated image. Must be one of url or b64_json.
resolution
string
Resolution. Optional 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).