Api.Airforce
API REFERENCE

छवि निर्माण

एक एकीकृत, OpenAI-संगत एंडपॉइंट के साथ छवियां बनाएं और संपादित करें जो फ्लक्स, नैनो-बनाना, वान और बहुत कुछ को पसंद करता है।

एक ही OpenAI-compatible image endpoint Flux, Nano-Banana, Wan और अन्य providers तक फैल जाता है। upstream चाहे जो भी हो, वही request shape भेजें; provider-विशिष्ट options pass through होते हैं और हर मॉडल की capabilities के विरुद्ध validate किए जाते हैं।

models endpoint को list करके और उन मॉडलों को रखकर image मॉडल खोजें जिनकी output modalities में image शामिल है।

POST /v1/images/generations

OpenAI के साथ ड्रॉप-इन संगत images.generate एसडीके. प्रदाता-विशिष्ट पैरामीटर मानक मानकों के साथ रहते हैं - बैकएंड आगे बढ़ता है जो प्रत्येक मॉडल समझता है।

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

छवि मॉडल

· live

सामान्य पैरामीटर

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.

मूल उदाहरण

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"
  }'

प्रतिक्रिया स्वरूप

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

स्ट्रीमिंग संस्करण

उत्तीर्ण sse: true जब मिडलवेयर के माध्यम से प्रॉक्सी किया जाता है जिसमें टाइट निष्क्रिय-टाइमआउट होता है। तो फिर, प्रतिक्रिया संपूर्ण JSON के साथ एक SSE ईवेंट है [DONE].

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

data: [DONE]

छवि-से-छवि और संदर्भ

के साथ मॉडल image_caps.max_input_images > 0 संदर्भ छवियाँ स्वीकार करें. या तो यूआरएल या बेस64-एन्कोडेड डेटा पास करें।

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

मॉडल-विशिष्ट पैरामीटर

उपरोक्त सामान्य मापदंडों से परे, व्यक्तिगत मॉडल परिवार अतिरिक्त स्वीकार करते हैं। अज्ञात मापदंडों को यथावत अपस्ट्रीम पर अग्रेषित किया जाता है, इसलिए भविष्य का कोई भी प्रदाता-विशिष्ट नॉब एसडीके अपडेट के बिना भी काम करता है।

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".

क्षमताओं की खोज

प्रत्येक छवि मॉडल उजागर होता है image_caps पर /v1/models ताकि ग्राहक भेजने से पहले इनपुट सत्यापित कर सकें:

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).

इमेज प्राइसिंग image_caps पर नहीं होती — लागत के लिए /v1/models पर मॉडल के price फ़ील्ड्स का उपयोग करें।