Zum Hauptinhalt springen
POST
/
v1
/
images
/
generations
curl --request POST \
  --url https://api.apimart.ai/v1/images/generations \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
    "model": "imagen-4.0-apimart",
    "prompt": "A corgi wearing an astronaut helmet, standing on the lunar surface, Earth in the background, cinematic lighting, 8k",
    "size": "16:9"
  }'
{
  "code": 200,
  "data": [
    {
      "status": "submitted",
      "task_id": "task_01K8AYYM6R03TGZ3Q2P0TZVNPX"
    }
  ]
}

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/generations \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
    "model": "imagen-4.0-apimart",
    "prompt": "A corgi wearing an astronaut helmet, standing on the lunar surface, Earth in the background, cinematic lighting, 8k",
    "size": "16:9"
  }'
{
  "code": 200,
  "data": [
    {
      "status": "submitted",
      "task_id": "task_01K8AYYM6R03TGZ3Q2P0TZVNPX"
    }
  ]
}

Autorisierung

Authorization
string
erforderlich
Alle APIs erfordern eine Authentifizierung per Bearer TokenAPI-Schlüssel erhalten:Besuchen Sie die Seite zur Verwaltung von API-Schlüsseln, um Ihren API-Schlüssel zu erhaltenFügen Sie Folgendes Ihrem Anfrage-Header hinzu:
Authorization: Bearer YOUR_API_KEY

Body

model
string
Standard:"imagen-4.0-apimart"
erforderlich
Name des BildgenerierungsmodellsFester Wert: imagen-4.0-apimart
prompt
string
erforderlich
Textbeschreibung für die BildgenerierungSowohl englische als auch chinesische Beschreibungen werden unterstützt
n
integer
Standard:"1"
Anzahl der zu generierenden BilderWertebereich: 1
size
string
Standard:"16:9"
Seitenverhältnis des generierten BildesUnterstützte Formate:
  • 1:1 – Quadrat
  • 4:3 – Querformat
  • 3:4 – Hochformat
  • 16:9 – Querformat (Standard)
  • 9:16 – Hochformat
Seitenverhältnisse, die nicht in der Liste der unterstützten Werte enthalten sind (z. B. 21:9), werden automatisch auf den Standardwert 16:9 zurückgesetzt, ohne dass ein Fehler ausgelöst wird.
Nicht unterstützte Felder: image, image_urls, mask, quality usw. werden ignoriert. Wird image_urls / image übergeben, tritt direkt ein Fehler auf: google_imagen4 currently supports text-to-image only.

Response

code
integer
Statuscode der Antwort
data
array
Array mit Antwortdaten