> ## Documentation Index
> Fetch the complete documentation index at: https://docs.aireserve.com/llms.txt
> Use this file to discover all available pages before exploring further.

# grok-imagine-image-edit

> Accepts up to 4 input images.

**Image editing** · xAI · served by fal

## Call it

Endpoint: `POST /v1/images/edits` — set `model` to `grok-imagine-image-edit`.

```bash cURL theme={"dark"}
# Submit — answers 202 with a job id, then poll GET /v1/images/edits/{id}
curl https://api.aireserve.com/v1/images/edits \
  -H "Authorization: Bearer $AIRESERVE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "grok-imagine-image-edit",
    "prompt": "Replace the sky with a dramatic sunset",
    "images": ["https://example.com/photo.png"]
  }'
```

```bash cURL (submit, poll, download) theme={"dark"}
# 1) Submit — returns 202 with the job id
JOB=$(curl -s https://api.aireserve.com/v1/images/edits \
  -H "Authorization: Bearer $AIRESERVE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "grok-imagine-image-edit",
    "prompt": "Replace the sky with a dramatic sunset",
    "images": ["https://example.com/photo.png"]
  }')
JOB_ID=$(echo "$JOB" | jq -r .id)

# 2) Poll every few seconds until the job is terminal
while :; do
  JOB=$(curl -s "https://api.aireserve.com/v1/images/edits/$JOB_ID" \
    -H "Authorization: Bearer $AIRESERVE_API_KEY")
  STATUS=$(echo "$JOB" | jq -r .status)
  echo "status: $STATUS"
  case "$STATUS" in succeeded|failed) break ;; esac
  sleep 3
done

# 3) Download the result
curl -o edited.png "$(echo "$JOB" | jq -r .result.images[0].url)"
```

Full request and response reference: [Image editing guide](/capabilities/image-generation#image-editing).

## IDs & aliases

| Send as `model` | What it is |
| - | - |
| `grok-imagine-image-edit` | Canonical gateway id |

## Specs

| Spec | Detail |
| - | - |
| Modality | Image — Image editing |
| Model maker | xAI |
| Served by | fal |
| Pricing | \$0.02 / image |
| Capabilities | Edits an input image |
| Hosting | United States |

Prices are public list rates at generation time and may lag the provider card; `GET /v1/models` and the portal's pricing page are authoritative for billing.

> **[Browse all models](/models)**
>
> Search and filter every model by modality, maker, capability and price.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.