이미지 생성
OpenAI 호환 단일 엔드포인트로 이미지를 생성하고 편집하세요. 동일한 요청 형식이 카탈로그의 모든 이미지 모델에 전달됩니다.
OpenAI 호환 이미지 endpoint 하나가 Flux, Nano-Banana, Wan을 비롯한 여러 provider로 분기됩니다. upstream에 관계없이 동일한 request 형태를 보내세요; provider별 옵션은 그대로 전달되며 각 모델의 capability에 따라 검증됩니다.
models endpoint를 조회하고 output modalities에 image가 포함된 모델만 추려서 이미지 모델을 찾으세요.
POST /v1/images/generations
OpenAI와 호환되는 드롭인 images.generate SDK. 공급자별 매개변수는 표준 매개변수와 함께 존재합니다. 즉, 백엔드는 각 모델이 이해하는 내용을 전달합니다.
https://api.airforce/v1/images/generations이미지 모델
…· live공통 매개변수
| Parameter | Type | Required | Description |
|---|---|---|---|
| model | string | Required | Image model ID. Find them on /v1/models: image models carry media_type: "image" and an image_caps block. |
| prompt | string | Required | Image description. |
| n | integer | Optional | Number of variations to generate per request. Capped by the model's image_caps.max_n. |
| size | string | Optional | OpenAI-style WxH, e.g. "1024x1024". Provider-specific values pass through. |
| aspect_ratio | string | Optional | Alternative to size. "16:9", "1:1", "9:16", … Validated against image_caps.aspect_ratios. |
| quality | string | Optional | "standard" | "hd" (OpenAI) or model-specific labels. Validated. |
| response_format | string | Optional | "url" (default) or "b64_json". |
| seed | integer | Optional | Reproducibility seed. Same prompt + same seed = same image (where the upstream supports it). |
| input_images | array | Optional | [{ url? } | { b64_json? }] for image-to-image / reference / first-frame. |
| sse | boolean | Optional | When 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": "nano-banana-2",
"prompt": "A cute baby sea otter floating on its back",
"n": 1,
"response_format": "url"
}'응답 형태
| Parameter | Type | Required | Description |
|---|---|---|---|
| created | integer | Optional | Unix timestamp. |
| data | array | Optional | Generated assets. |
| data[].url | string | Optional | Image 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_json | string | Optional | Base64-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 참조 이미지를 수락합니다. URL 또는 base64로 인코딩된 데이터를 전달하세요.
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"}
]
}'이미지 편집
OpenAI 호환 편집 엔드포인트입니다. 원본 이미지를 멀티파트 파일로 보내거나(OpenAI SDK의 images.edit 방식), 위의 JSON 본문에 input_images를 넣어 보내세요. /v1/images/generations와 같은 경로로 처리되며 모델, 가격, 응답 형식도 같습니다.
https://api.airforce/v1/images/edits| Parameter | Type | Required | Description |
|---|---|---|---|
| model | string | Required | An image model with image_caps.max_input_images > 0 (see Discovering capabilities below). |
| prompt | string | Required | What to change or create from the input image(s). |
| image | file | Required | The source image. Repeat as image[] for several references; images, images[] and input_images are accepted too, as files or as image URLs. |
| mask | file | Optional | Forwarded as is, but no listed model declares mask support, so the serving model may ignore it. |
| n | integer | Optional | Number of images to generate. |
| size | string | Optional | Output size, e.g. "1024x1024", where the model supports it. |
| aspect_ratio | string | Optional | Output aspect ratio, e.g. "16:9", where the model supports it. |
| quality | string | Optional | Model-specific quality level. |
| response_format | string | Optional | "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)요청당 입력 이미지는 최대 16장, 각 25MB까지이며 모델 자체 한도는 image_caps.max_input_images입니다. 입력 이미지가 없는 요청은 텍스트-이미지 호출로 바뀌지 않고 400으로 거부됩니다. 입력 이미지마다 가격이 추가될 수 있으며 모델 페이지에 표시됩니다.
모델별 매개변수
위의 공통 매개변수 외에도 개별 모델 제품군은 추가 항목을 허용합니다. 알 수 없는 매개변수는 있는 그대로 업스트림에 전달되므로 향후 제공자별 노브도 SDK 업데이트 없이 작동합니다.
Nano-Banana
nano-banana-2, nano-banana-pro
| Parameter | Type | Required | Description |
|---|---|---|---|
| aspect_ratio | string | Optional | "1:1", "16:9", "9:16", "4:3". |
| resolution | string | Optional | "512", "1024", "2048". |
| image_urls | array | Optional | Reference images. |
Suno (music)
suno-v4.5, suno-v5, suno-v5.5는 과거에는 이 엔드포인트에서 허용됐습니다. 이제는 네이티브 음악 API에 속합니다: /v1/audio/music — 여기로의 호출은 `wrong_endpoint`로 거부됩니다.
역량 발견
각 이미지 모델은 image_caps ~에 /v1/models 클라이언트가 보내기 전에 입력을 확인할 수 있도록:
| Parameter | Type | Required | Description |
|---|---|---|---|
| image_caps.max_n | integer | Optional | Maximum n per request. |
| image_caps.aspect_ratios | array | Optional | Allowed aspect_ratio values. |
| image_caps.qualities | array | Optional | Allowed quality values. |
| image_caps.max_input_images | integer | Optional | 0 = text-only model. Higher = supports reference images. |
| image_caps.supports_url_input | boolean | Optional | Whether input_images may be passed as URLs (vs base64). |
| image_caps.supports_seed | boolean | Optional | Whether the model honours a seed value (most scraping-proxy upstreams ignore it). |
이미지 가격은 image_caps에 없습니다 — 비용은 /v1/models의 모델 가격 필드를 사용하세요.