Skip to main content
POST
/
v1
/
images
/
edits
curl --request POST \
  --url https://toapis.com/v1/images/edits \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
    "model": "grok-imagine-1.0-edit",
    "prompt": "Change the background to a starry sky, keep the main subject",
    "image_urls": ["https://example.com/original.png"],
    "n": 1
  }'
{
  "id": "task_01JNXXXXXXXXXXXXXXXXXX",
  "object": "generation.task",
  "model": "grok-imagine-1.0-edit",
  "status": "queued",
  "progress": 0,
  "created_at": 1768380224,
  "metadata": {}
}
  • Unified image editing endpoint
  • Async task mode, returns a task ID
  • Set model to grok-imagine-1.0-edit

Authorizations

Authorization
string
required
All endpoints require Bearer Token authenticationGet API Key from API Key ManagementHeader example:
Authorization: Bearer YOUR_API_KEY

Body

model
string
required
Model name, use:
  • grok-imagine-1.0-edit
prompt
string
required
Prompt for image editing, multilingual supported
image_urls
string[]
required
Source image URL array, at least one imageExample:
  • ["https://example.com/original.png"]
You can upload first via Upload Image API
n
integer
default:1
Number of images, recommended range 1-10

Response

id
string
Unique task ID
object
string
Always generation.task
status
string
Task status: queued / in_progress / completed / failed
curl --request POST \
  --url https://toapis.com/v1/images/edits \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
    "model": "grok-imagine-1.0-edit",
    "prompt": "Change the background to a starry sky, keep the main subject",
    "image_urls": ["https://example.com/original.png"],
    "n": 1
  }'
{
  "id": "task_01JNXXXXXXXXXXXXXXXXXX",
  "object": "generation.task",
  "model": "grok-imagine-1.0-edit",
  "status": "queued",
  "progress": 0,
  "created_at": 1768380224,
  "metadata": {}
}