Api.Airforce
API REFERENCE

Bild-Generierung

Generiere und editiere Bilder mit einem einheitlichen, OpenAI-kompatiblen Endpoint der zu Flux, Nano-Banana, Dirtberry, Wan und mehr fan-out.

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. Filter /v1/models by output_modalities.includes("image").
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": "flux-2-dev",
    "prompt": "A cute baby sea otter floating on its back",
    "n": 1,
    "response_format": "url"
  }'

Response-Format

ParameterTypeRequiredDescription
createdintegerOptionalUnix timestamp.
dataarrayOptionalGenerated assets.
data[].urlstringOptionalPre-signed CDN URL when response_format is "url".
data[].b64_jsonstringOptionalBase64-encoded PNG when response_format is "b64_json".
data[].revised_promptstringOptionalSome models rewrite the prompt before generating; the rewritten version is returned here.
{
  "created": 1715000000,
  "data": [{
    "url": "https://cdn.api.airforce/images/abc123.png"
  }]
}

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://cdn.api.airforce/images/abc123.png"}]}

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": "flux-2-dev",
    "prompt": "Same character, now in a snowy forest",
    "aspect_ratio": "16:9",
    "input_images": [
      {"url": "https://example.com/character.jpg"}
    ]
  }'

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.

Flux

flux-2-klein-4b, flux-2-klein-9b, flux-2-dev

ParameterTypeRequiredDescription
aspect_ratiostringOptional"1:1", "16:9", "9:16", "4:3", "3:4", "21:9", "9:21".
image_urlsarrayOptionalReference images for img2img mode.

Nano-Banana

nano-banana-2, nano-banana-2-search, nano-banana-pro

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

Suno (music via /v1/images/generations)

suno-v4.5, suno-v5 — Suno historically routes through this endpoint. Native music API at /v1/audio/music is preferred for new code.

ParameterTypeRequiredDescription
custombooleanOptionalSwitch from "auto" to fully custom mode.
instrumentalbooleanOptionalSuppress vocals.
stylestringOptionalGenre tag list, e.g. "EDM, Bass".

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.sizesarrayOptionalAllowed size values when applicable.
image_caps.max_input_imagesintegerOptional0 = text-only model. Higher = supports reference images.
image_caps.price_per_image_centsintegerOptionalCost per generated image. Multiply by n for the total request cost.