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/generationsbash
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:
| Parameter | Type | Description |
|---|---|---|
model | string | Target model, e.g. dall-e-3 — see the console's model page or /v1/models for what's available |
prompt | string | Image description |
size | string | e.g. 1024x1024; valid values depend on the chosen model |
n | integer | Number of images to generate; some models only support n=1 |
response_format | string | url (default) or b64_json |
Example response:
json
{
"created": 1717000000,
"data": [{ "url": "https://.../generated-image.png" }]
}Edit an image
POST /v1/images/editsFor 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/variationsis 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.
