All image endpoints return raw binary image data directly in the response body, not JSON objects. The image format and provider metadata are included in the response headers.
Image endpoints return:
- Body: Raw binary image data (PNG, JPEG, or WebP)
- Content-Type: Image MIME type (
image/png,image/jpeg,image/webp) - Headers: Provider metadata and request tracking information
All image endpoints include these standard headers:
Content-Type string
The MIME type of the returned image:
image/png- PNG format (most common)image/jpeg- JPEG format (Clipdrop upscale, uncrop)image/webp- WebP format (optional for some operations)
X-Provider string
The provider that processed the request:
openai- OpenAI image generation/editingclipdrop- Clipdrop image manipulation
X-Provider-Request-Id string (optional)
The provider's unique request identifier for tracking and debugging.
X-Provider-Credits-Consumed integer (optional)
Number of credits consumed by the operation (Clipdrop only).
HTTP/1.1 200 OK
Content-Type: image/png
X-Provider: openai
X-Provider-Request-Id: req_abc123xyz
[Binary PNG image data]HTTP/1.1 200 OK
Content-Type: image/png
X-Provider: clipdrop
X-Provider-Request-Id: req_def456
X-Provider-Credits-Consumed: 1
[Binary PNG image data]Since responses contain raw binary data, save them directly to files:
Bash/cURL:
curl -X POST "https://api.aitronos.com/v1/images/generate" \
-H "X-API-Key: $FREDDY_API_KEY" \
-H "Content-Type: application/json" \
-d '{"provider":"openai","organization_id":"org_abc","prompt":"sunset"}' \
--output image.pngPython:
response = requests.post(url, headers=headers, json=data)
with open("image.png", "wb") as f:
f.write(response.content)JavaScript:
const response = await fetch(url, {method: "POST", headers, body});
const buffer = Buffer.from(await response.arrayBuffer());
fs.writeFileSync("image.png", buffer);- Generate Image - Create new images from text
- Upscale Image - Increase image resolution
- Remove Background - Remove image backgrounds
- Replace Background - Replace image backgrounds
- Cleanup Image - Remove unwanted elements
- Remove Text - Remove text overlays
- Uncrop/Outpaint - Extend image boundaries