Skip to content

Images

POST /v1/images/generations

{
"model": "flux-schnell",
"prompt": "a clean product photo of a matte black coffee mug",
"n": 1,
"size": "1024x1024"
}

Some providers return immediately with HTTP 200. Async providers return HTTP 202 with a task_id.

POST /v1/images/edits

Use multipart/form-data with an image file and a text prompt.

Terminal window
curl https://api.parel.cloud/v1/images/edits \
-H "Authorization: Bearer pk-dev-YOUR_KEY" \
-F model="gpt-image-1.5" \
-F prompt="Change the mug color to white" \
-F image="@mug.png"
EndpointPurpose
POST /v1/images/upscaleUpscale an image
POST /v1/images/bg-removeRemove an image background
import time
import httpx
headers = {"Authorization": "Bearer pk-dev-YOUR_KEY"}
resp = httpx.post(
"https://api.parel.cloud/v1/images/generations",
headers=headers,
json={"model": "flux-schnell", "prompt": "a cat in space"},
)
if resp.status_code == 202:
task_id = resp.json()["task_id"]
while True:
task = httpx.get(f"https://api.parel.cloud/v1/tasks/{task_id}", headers=headers).json()
if task["status"] == "completed":
print(task["result"]["data"][0]["url"])
break
if task["status"] == "failed":
raise RuntimeError(task["error"]["message"])
time.sleep(3)