Skip to content

Images API

SDKMAX exposes an OpenAI-compatible image generation/editing API. The actual rendering is done by whichever image channel is configured on the backend (DALL·E, Jimeng, Minimax, etc.) — callers don't need to know which.

Generate an image

POST /v1/images/generations
bash
curl https://api.sdkmax.com/v1/images/generations \
  -H "Authorization: Bearer sk-your-key" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "dall-e-3",
    "prompt": "A cat riding a motorcycle through a cyberpunk city",
    "size": "1024x1024",
    "n": 1
  }'

Common parameters:

ParameterTypeDescription
modelstringTarget model, e.g. dall-e-3 — see the console's model page or /v1/models for what's available
promptstringImage description
sizestringe.g. 1024x1024; valid values depend on the chosen model
nintegerNumber of images to generate; some models only support n=1
response_formatstringurl (default) or b64_json

Example response:

json
{
  "created": 1717000000,
  "data": [{ "url": "https://.../generated-image.png" }]
}

Edit an image

POST /v1/images/edits

For inpainting/local edits, upload the original image and (optionally) a mask via multipart/form-data:

bash
curl https://api.sdkmax.com/v1/images/edits \
  -H "Authorization: Bearer sk-your-key" \
  -F image="@original.png" \
  -F mask="@mask.png" \
  -F prompt="Replace the background with a starry sky" \
  -F model="dall-e-2"

Not yet supported

  • POST /v1/images/variations is not implemented today. If your workflow depends on it, use the edits endpoint with a descriptive prompt instead, or watch for a future release.

Via SDK

python
resp = client.images.generate(
    model="dall-e-3",
    prompt="A cat riding a motorcycle through a cyberpunk city",
    size="1024x1024",
)
print(resp.data[0].url)

See Python · Node.js · Java · Go for other languages.

Error handling

Common failures include unsupported size/parameters for the chosen model (400), an unavailable model (model_not_found), and content blocked by safety filters (sensitive_words_detected) — full list in Error Codes.

SDKMAX — Enterprise AI Gateway, Aggregating Global AI Resources