Images
Generate, edit and vary images with the OpenAI Images format. Billed per image produced.
| Endpoint | Body | Price |
|---|---|---|
POST /v1/images/generations | JSON | Per image |
POST /v1/images/edits | multipart/form-data | Per image edit |
POST /v1/images/variations | multipart/form-data | Per image |
Generating images
curl https://octalabs.id/v1/images/generations \ -H "Authorization: Bearer $API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "IMAGE_MODEL_ID", "prompt": "Illustration of kopi tubruk on a wooden table, morning light", "n": 1, "size": "1024x1024" }'modelandpromptare required.nis between 1 and 10 (default 1). Funds fornimages are held before the request runs.size,quality,styleandresponse_formatare passed to the model if it supports them.
Editing images
/v1/images/edits and /v1/images/variations accept multipart/form-data, like the OpenAI API.
Images · edits (cURL)
curl https://octalabs.id/v1/images/edits \ -H "Authorization: Bearer $API_KEY" \ -F model="IMAGE_MODEL_ID" \ -F prompt="Replace the background with rice terraces" \ -F image="@photo.png" \ -F n=1Cost
The charge is the number of images actually returned times the model’s per-image (or per-edit) price. See the Image tab on Models & Pricing.