Skip to main content

Images

Generate, edit and vary images with the OpenAI Images format. Billed per image produced.

Endpoint Body Price
POST /v1/images/generationsJSONPer image
POST /v1/images/editsmultipart/form-dataPer image edit
POST /v1/images/variationsmultipart/form-dataPer 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"  }'
  • model and prompt are required.
  • n is between 1 and 10 (default 1). Funds for n images are held before the request runs.
  • size, quality, style and response_format are 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=1

Cost

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.

Start with any balance,
however small.

Create a free accountSign in AI API · pay as you go