Zum Hauptinhalt springen
POST
/
v1
/
images
/
edits
curl --request POST \
  --url https://api.apimart.ai/v1/images/edits \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
    "model": "grok-imagine-1.0-edit-apimart",
    "prompt": "Change the background to a starry sky, keep the main subject",
    "image_urls": ["https://example.com/original.png"],
    "n": 1
  }'
{
  "code": 200,
  "data": [
    {
      "status": "submitted",
      "task_id": "task_01JNXXXXXXXXXXXXXXXXXX"
    }
  ]
}

Documentation Index

Fetch the complete documentation index at: https://docs.apimart.ai/llms.txt

Use this file to discover all available pages before exploring further.

curl --request POST \
  --url https://api.apimart.ai/v1/images/edits \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
    "model": "grok-imagine-1.0-edit-apimart",
    "prompt": "Change the background to a starry sky, keep the main subject",
    "image_urls": ["https://example.com/original.png"],
    "n": 1
  }'
{
  "code": 200,
  "data": [
    {
      "status": "submitted",
      "task_id": "task_01JNXXXXXXXXXXXXXXXXXX"
    }
  ]
}

Autorisierung

Authorization
string
erforderlich
Alle APIs erfordern eine Bearer-Token-AuthentifizierungAPI-Key abrufen:Besuchen Sie die API-Key-Verwaltungsseite, um Ihren API-Key zu erhaltenFügen Sie ihn dem Request-Header hinzu:
Authorization: Bearer YOUR_API_KEY

Body

model
string
Standard:"grok-imagine-1.0-edit-apimart"
erforderlich
Name des BildbearbeitungsmodellsUnterstützte Modelle:
  • grok-imagine-1.0-edit-apimart – Grok-Bildbearbeitung
Beispiel: "grok-imagine-1.0-edit-apimart"
prompt
string
erforderlich
Textbeschreibung für die Bildbearbeitung, unterstützt mehrere Sprachen
image_urls
string[]
erforderlich
Array von Quellbild-URLs. Das System verwendet das erste Bild im Array als Bearbeitungsreferenz.Unterstützt https://-Links oder das Format data:image/...;base64,....
n
integer
Standard:1
Anzahl der zu generierenden BilderBereich: 1–10 (Minimum 1, Maximum 10)

Response

code
integer
Antwort-Statuscode
data
array
Antwortdaten-Array

Anwendungsfälle

Fall 1: Hintergrundbearbeitung

{
  "model": "grok-imagine-1.0-edit-apimart",
  "prompt": "Change the background to a starry sky, keep the main subject",
  "image_urls": ["https://example.com/original.png"]
}

Fall 2: Stilübertragung

{
  "model": "grok-imagine-1.0-edit-apimart",
  "prompt": "Convert the image to cyberpunk style",
  "image_urls": ["https://example.com/original.png"],
  "n": 2
}