Zum Inhalt springen

Bildgenerierung

POST /v1/images/generations für OpenAI-kompatible Text-zu-Bild-Anfragen.

http
POST https://api.webway.sh/v1/images/generations

Übergib die exakte Routing-ID eines Bildmodells aus dem Live-Katalog. Setze WEBWAY_IMAGE_MODEL auf diese ID, bevor du das Beispiel ausführst.

Anfrage

bash
curl https://api.webway.sh/v1/images/generations \
  -H "Authorization: Bearer $WEBWAY_API_KEY" \
  -H "Content-Type: application/json" \
  -d "{
    \"model\": \"$WEBWAY_IMAGE_MODEL\",
    \"prompt\": \"A paper map of an imaginary coastal city, editorial illustration\",
    \"size\": \"1024x1024\",
    \"n\": 1
  }"
Feld Typ Hinweise
model string Erforderliche ID des Bildmodells
prompt string Erforderliche Bildbeschreibung
size string Unterstützte Ausgabegröße; modellabhängig
n integer Anzahl der Bilder
quality string Qualitätsstufe; modellabhängig
response_format string url oder b64_json

Antwort

json
{
  "created": 1787700000,
  "data": [
    {"url": "https://…/generated-image.png"}
  ]
}

URLs sind temporär. Lade generierte Dateien zeitnah herunter, wenn du sie behalten möchtest.