Images
Generate
Section titled “Generate”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.
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"Image operations
Section titled “Image operations”| Endpoint | Purpose |
|---|---|
POST /v1/images/upscale | Upscale an image |
POST /v1/images/bg-remove | Remove an image background |
Async polling
Section titled “Async polling”import timeimport 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)