API Reference
Image Generation and Editing
Generate or edit images with OpenAI-compatible image APIs.
Image APIs support generation and editing. Exact sizes, quality values, formats and streaming support depend on the model and upstream channel.
Endpoints
| Method | Path | Description |
|---|---|---|
POST | /v1/images/generations | Generate images |
POST | /v1/images/edits | Edit images, with JSON or multipart form input |
POST | /v1/edits | Compatibility path. Prefer /v1/images/edits |
Request Fields
| Field | Type | Required | Description |
|---|---|---|---|
model | string | Yes | Image model ID |
prompt | string | Required for generation | Image prompt |
n | integer | No | Number of images, default 1 |
size | string | No | Image size such as 1024x1024. Do not use the multiplication sign × |
quality | string | No | Quality such as standard, hd or auto |
response_format | string | No | Response format such as url or b64_json, depending on model |
style | any | No | OpenAI image extension field |
background, moderation | any | No | Newer image model extension fields |
output_format, output_compression | any | No | Output format and compression options |
partial_images, stream | any | No | Used by image models that support streaming |
image, images | file/string/array | Required for edits | Images to edit. Multipart accepts image, image[] or image[n] |
mask | file/string | No | Edit mask |
input_fidelity | any | No | Input fidelity, depending on model |
watermark | boolean | No | Watermark switch, depending on channel support |
Generate an Image
curl https://api.tensoraxis.ai/v1/images/generations \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $TENSORAXIS_API_KEY" \
-d '{
"model": "gpt-image-1",
"prompt": "A minimalist poster of a futuristic city",
"size": "1024x1024"
}'Edit an Image
Use multipart form data when uploading local files:
curl https://api.tensoraxis.ai/v1/images/edits \
-H "Authorization: Bearer $TENSORAXIS_API_KEY" \
-F model="gpt-image-1" \
-F prompt="Change the background to a night city" \
-F image="@input.png"When the selected model supports it, JSON image URLs can also be used:
{
"model": "gpt-image-1",
"prompt": "Change the background to a night city",
"image": "https://example.com/input.png"
}Response Shape
{
"created": 1710000000,
"data": [
{
"url": "https://example.com/result.png",
"b64_json": "",
"revised_prompt": "..."
}
]
}Video generation is not an image API. For Seedance / Doubao video models, use the async task body in Video Generation.