Api.Airforce
API REFERENCE

Bild-Generierung

Bilder erzeugen und bearbeiten über einen einzigen OpenAI-kompatiblen Endpoint. Dieselbe Anfrageform erreicht jedes Bildmodell im Katalog.

Ein OpenAI-kompatibler Image-endpoint verteilt an Flux, Nano-Banana, Wan und weitere Provider. Sende unabhängig vom Upstream dasselbe Request-Format; providerspezifische Optionen werden durchgereicht und gegen die Capabilities jedes Modells validiert.

Finde Image-Modelle, indem du den models endpoint auflistest und die behältst, deren Output-modalities image enthalten.

POST /v1/images/generations

Direkt kompatibel mit dem OpenAI images.generate SDK. Provider-spezifische Parameter laufen neben den Standard-Parametern — das Backend leitet weiter was jedes Modell versteht.

POSThttps://api.airforce/v1/images/generations

Bild-Modelle

…· live

Gemeinsame Parameter

ParameterTypeRequiredDescription
modelstringRequiredImage model ID. Find them on /v1/models: image models carry media_type: "image" and an image_caps block.
promptstringRequiredImage description.
nintegerOptionalNumber of variations to generate per request. Capped by the model's image_caps.max_n.
sizestringOptionalOpenAI-style WxH, e.g. "1024x1024". Provider-specific values pass through.
aspect_ratiostringOptionalAlternative to size. "16:9", "1:1", "9:16", … Validated against image_caps.aspect_ratios.
qualitystringOptional"standard" | "hd" (OpenAI) or model-specific labels. Validated.
response_formatstringOptional"url" (default) or "b64_json".
seedintegerOptionalReproducibility seed. Same prompt + same seed = same image (where the upstream supports it).
input_imagesarrayOptional[{ url? } | { b64_json? }] for image-to-image / reference / first-frame.
ssebooleanOptionalWhen true the response is sent as Server-Sent Events. The full JSON arrives in one event followed by [DONE]. Useful to keep long upstream renders from timing out at proxies.

Einfaches Beispiel

curl https://api.airforce/v1/images/generations \
  -H "Authorization: Bearer sk-air-YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "nano-banana-2",
    "prompt": "A cute baby sea otter floating on its back",
    "n": 1,
    "response_format": "url"
  }'

Response-Format

ParameterTypeRequiredDescription
createdintegerOptionalUnix timestamp.
dataarrayOptionalGenerated assets.
data[].urlstringOptionalImage URL when response_format is "url" (default). The image is re-hosted to a file host and the link ends in /image.jpeg; null if the re-host fails.
data[].b64_jsonstringOptionalBase64-encoded image bytes when response_format is "b64_json". The format follows the upstream provider (often JPEG), not necessarily PNG.
{
  "created": 1715000000,
  "data": [{
    "url": "https://.../image.jpeg"
  }]
}

Streaming-Variante

Übergib sse: true wenn du durch Middleware mit knappen Idle-Timeouts proxied. Die Response ist ein einzelnes SSE-Event mit dem kompletten JSON, dann [DONE].

data: {"created":1715000000,"data":[{"url":"https://.../image.jpeg"}]}

data: [DONE]

Bild-zu-Bild & Referenz

Modelle mit image_caps.max_input_images > 0 akzeptieren Referenz-Bilder. Übergib entweder URLs oder base64-codierte Daten.

curl https://api.airforce/v1/images/generations \
  -H "Authorization: Bearer sk-air-YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "nano-banana-2",
    "prompt": "Same character, now in a snowy forest",
    "aspect_ratio": "16:9",
    "input_images": [
      {"url": "https://example.com/character.jpg"}
    ]
  }'

Bildbearbeitung

Der OpenAI-kompatible Edit-Endpunkt. Sende das Ausgangsbild als Multipart-Datei, so wie es die OpenAI-SDKs für images.edit tun, oder den oben gezeigten JSON-Body mit input_images. Er läuft über denselben Weg wie /v1/images/generations: dieselben Modelle, Preise und dasselbe Antwortformat.

POSThttps://api.airforce/v1/images/edits
ParameterTypeRequiredDescription
modelstringRequiredAn image model with image_caps.max_input_images > 0 (see Discovering capabilities below).
promptstringRequiredWhat to change or create from the input image(s).
imagefileRequiredThe source image. Repeat as image[] for several references; images, images[] and input_images are accepted too, as files or as image URLs.
maskfileOptionalForwarded as is, but no listed model declares mask support, so the serving model may ignore it.
nintegerOptionalNumber of images to generate.
sizestringOptionalOutput size, e.g. "1024x1024", where the model supports it.
aspect_ratiostringOptionalOutput aspect ratio, e.g. "16:9", where the model supports it.
qualitystringOptionalModel-specific quality level.
response_formatstringOptional"url" or "b64_json", as on /v1/images/generations.
curl https://api.airforce/v1/images/edits \
  -H "Authorization: Bearer sk-air-YOUR_API_KEY" \
  -F "model=nano-banana-2" \
  -F "prompt=Same character, now in a snowy forest" \
  -F "[email protected]" \
  -F "aspect_ratio=16:9"
from openai import OpenAI

client = OpenAI(base_url="https://api.airforce/v1", api_key="sk-air-YOUR_API_KEY")

with open("character.png", "rb") as image:
    result = client.images.edit(
        model="nano-banana-2",
        image=image,
        prompt="Same character, now in a snowy forest",
    )
print(result.data[0].url)

Bis zu 16 Eingabebilder pro Anfrage, je 25 MB; das Limit des Modells steht in image_caps.max_input_images. Eine Anfrage ohne Eingabebild wird mit 400 abgelehnt, statt zu einem Text-zu-Bild-Aufruf zu werden. Jedes Eingabebild kann den Preis erhöhen, wie auf der Modellseite angegeben.


Modell-spezifische Parameter

Über die gemeinsamen Parameter oben hinaus akzeptieren einzelne Modell-Familien Extras. Unbekannte Parameter werden ungeprüft an den Upstream weitergeleitet, sodass auch zukünftige provider-spezifische Knöpfe ohne SDK-Update funktionieren.

Nano-Banana

nano-banana-2, nano-banana-pro

ParameterTypeRequiredDescription
aspect_ratiostringOptional"1:1", "16:9", "9:16", "4:3".
resolutionstringOptional"512", "1024", "2048".
image_urlsarrayOptionalReference images.

Suno (music)

suno-v4.5, suno-v5 und suno-v5.5 wurden auf diesem Endpoint früher akzeptiert. Sie gehören jetzt zur nativen Musik-API unter /v1/audio/music — Aufrufe hier werden mit `wrong_endpoint` abgewiesen.


Capabilities entdecken

Jedes Bild-Modell exponiert image_caps auf /v1/models damit Clients Inputs vor dem Senden validieren können:

ParameterTypeRequiredDescription
image_caps.max_nintegerOptionalMaximum n per request.
image_caps.aspect_ratiosarrayOptionalAllowed aspect_ratio values.
image_caps.qualitiesarrayOptionalAllowed quality values.
image_caps.max_input_imagesintegerOptional0 = text-only model. Higher = supports reference images.
image_caps.supports_url_inputbooleanOptionalWhether input_images may be passed as URLs (vs base64).
image_caps.supports_seedbooleanOptionalWhether the model honours a seed value (most scraping-proxy upstreams ignore it).

Die Bildpreise stehen nicht in image_caps — verwenden Sie die Preisfelder des Modells unter /v1/models für die Kosten.