Passer au contenu principal
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"
    }
  ]
}

Autorisations

Authorization
string
requis
Toutes les API nécessitent une authentification Bearer TokenObtenez votre clé API :Visitez la page de gestion des clés API pour obtenir votre clé APIAjoutez-la à l’en-tête de la requête :
Authorization: Bearer YOUR_API_KEY

Body

model
string
défaut:"grok-imagine-1.0-edit-apimart"
requis
Nom du modèle d’édition d’imagesModèles pris en charge :
  • grok-imagine-1.0-edit-apimart — édition d’images Grok
Exemple : "grok-imagine-1.0-edit-apimart"
prompt
string
requis
Description textuelle pour l’édition d’image, prend en charge plusieurs langues
image_urls
string[]
requis
Tableau d’URL d’images sources. Le système utilisera la première image du tableau comme référence d’édition.Prend en charge les liens https:// ou le format data:image/...;base64,....
n
integer
défaut:1
Nombre d’images à générerPlage : 1–10 (minimum 1, maximum 10)

Response

code
integer
Code de statut de la réponse
data
array
Tableau de données de la réponse

Cas d’utilisation

Cas 1 : édition d’arrière-plan

{
  "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"]
}

Cas 2 : transfert de style

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