API console
POST/v1/images/edits
Bash
curl https://spro.hridaai.com/v1/images/edits \ -H "Content-Type: application/json" \ -H "Authorization: Bearer spro-xxxxxxxxxxxxxxxx" \ -d '{ "model": "openai/gpt-image-1", "prompt": "Make the background a sunset beach", "images": [ {"image_url": "https://example.com/cat.png"} ], "input_fidelity": "high" }'JSON
{ "created": 1756968000, "data": [ { "url": "https://..." } ], "usage": { "input_tokens": 1240, "output_tokens": 1056, "total_tokens": 2296, "input_tokens_details": { "image_tokens": 1180 } }}Edit an image
POST https://spro.hridaai.com/v1/images/edits
Edits one or more source images given a prompt. Accepts the JSON body format — reference source images by file_id or image_url, with an optional mask. Streaming is not supported yet.
Request body
| Parameter | Type | Required | Description |
|---|---|---|---|
model | string | Required | Image model ID, provider-prefixed. |
prompt | string | Required | Text describing the edit. |
images | array | Required | Source images — each as { "file_id": "..." } or { "image_url": "..." }. |
mask | object | Optional | Mask indicating the area to edit (same reference format). |
input_fidelity | string | Optional | low or high — how closely the output preserves the source image details. |
n | integer | Optional | Number of edited images to generate. |
quality | string | Optional | Quality tier. |
size | string | Optional | Image dimensions. |
user | string | Optional | A unique identifier representing your end user. |
Sampling parameters (temperature, top_p, penalties) are stripped before the upstream call.
Guardrails
The edit prompt goes through input guardrails — a violation with a block action returns 403 Forbidden before the upstream call. Edited images are binary, so output guardrails cannot read them yet; the output pass logs usage only. Usage is billed with a separate image_tokens rate for the image portion of the prompt (see input_tokens_details.image_tokens).
{ "error": { "message": "Request blocked by guardrail: sensitive_information_disclosure", "type": "guardrail_block", "code": "GUARDRAIL_BLOCKED" }}