API REFERENCE
범용 매개변수
모든 엔드포인트에 적용되는 헤더, 인증 체계, 오류 봉투 및 규칙.
입증
모든 엔드포인트에는 Airforce API 키가 필요합니다. 아래 대시보드에서 생성하세요. API 키. 키는 다음으로 시작합니다. sk-air-.
| Parameter | Type | Required | Description |
|---|---|---|---|
| Authorization | string | Required | Bearer sk-air-YOUR_API_KEY. Accepted on every endpoint. |
| x-api-key | string | Optional | Alternative auth header. Accepted on /v1/messages and /v1/responses for Anthropic SDK compatibility. |
| anthropic-version | string | Optional | Required when using /v1/messages with the @anthropic-ai/sdk. Use "2023-06-01". |
| Content-Type | string | Optional | application/json for body posts. multipart/form-data for endpoints that accept file uploads (transcriptions, voice cloning, etc.). |
예
# Standard
curl https://api.airforce/v1/chat/completions \
-H "Authorization: Bearer sk-air-YOUR_API_KEY" \
…
# Anthropic SDK style (only on /v1/messages, /v1/responses)
curl https://api.airforce/v1/messages \
-H "x-api-key: sk-air-YOUR_API_KEY" \
-H "anthropic-version: 2023-06-01" \
…
# Multipart upload (file endpoints)
curl https://api.airforce/v1/audio/transcriptions \
-H "Authorization: Bearer sk-air-YOUR_API_KEY" \
-F "[email protected]" \
-F "model=whisper-1"선택적 요청 헤더
| Parameter | Type | Required | Description |
|---|---|---|---|
| X-Request-ID | string | Optional | Echoed in the response. Send your own correlation ID and we forward it through to logs and intercept records. |
| User-Agent | string | Optional | Helpful for debugging. Logged with every request. |
응답 헤더
| Parameter | Type | Required | Description |
|---|---|---|---|
| X-Request-ID | string | Optional | Server-generated request ID. Quote this when filing a support ticket. |
| X-Cost-Cents | integer | Optional | Cost of the request in cents (4 decimals of precision). Present on completed billing-relevant calls. |
| X-Tokens-Prompt / X-Tokens-Completion | integer | Optional | Token counts for chat / messages calls. |
| X-Cache-Hit | string | Optional | "5m" / "1h" / "miss" on Anthropic-style cached calls. |
추론 및 사고(교차 엔드포인트)
다음을 갖춘 모델 supports_reasoning: true 나타나는 모든 곳에서 동일한 표준 매개변수를 허용합니다(현재 /v1/chat/completions 그리고 /v1/messages).
| Parameter | Type | Required | Description |
|---|---|---|---|
| reasoning_effort | string | Optional | "low" | "medium" | "high". OpenAI o-series / GPT-5 reasoning models only — has no effect on Claude. Use `thinking_budget` for Anthropic budget control. |
| thinking | string | object | Optional | "on" / "off" / "auto" for a quick toggle, or { type: "enabled", budget_tokens: N } Anthropic shape. Both forms accepted, both normalised to the upstream's native shape. |
| thinking_budget | integer | Optional | Maximum tokens spent reasoning before visible output starts. Maps to budget_tokens (Anthropic) and thinking_budget (Gemini). |
| ignore_defaults | boolean | Optional | Bypass your saved per-model defaults for this single request. Useful when a saved default (e.g. thinking on) is overriding the value you sent. |
추론을 지원하는 모델
…· live보다 채팅 완료 → 추론 전체 예를 보려면.
스트리밍 규칙
수락하는 엔드포인트 stream: true 응답하다 Content-Type: text/event-stream 서버에서 보낸 이벤트를 내보냅니다. 와이어 형식은 끝점에 따라 다릅니다.
| Parameter | Type | Required | Description |
|---|---|---|---|
| /v1/chat/completions | OpenAI SSE | Optional | data: {…JSON chunk…}, terminated by data: [DONE]. |
| /v1/messages | Anthropic SSE | Optional | Named events: message_start, content_block_start, content_block_delta, content_block_stop, message_delta, message_stop. |
| /v1/images/generations (sse: true) | OpenAI-shape SSE | Optional | Single data: event with the full response, then [DONE]. Useful for long-running image jobs to keep the connection alive. |
| /v1/video/tasks/:id/stream | progress SSE | Optional | Periodic { progress, status } events for in-flight video tasks. Stream closes once the task is done. |
오류 봉투
모든 오류 응답은 동일한 JSON 형태를 사용합니다. HTTP 상태 코드는 실패 클래스를 반영합니다.
| Parameter | Type | Required | Description |
|---|---|---|---|
| error.message | string | Optional | Human-readable message safe to display. |
| error.type | string | Optional | Machine-readable category. See table below. |
| error.code | string | Optional | Specific identifier when applicable, e.g. "model_not_found". |
| error.param | string | Optional | Field name that failed validation, when relevant. |
| Parameter | Type | Required | Description |
|---|---|---|---|
| 400 | invalid_request | Optional | Malformed JSON, unknown field, validation failed. |
| 401 | authentication_error | Optional | Missing or invalid API key. |
| 403 | permission_error | Optional | Plan or per-key restriction blocks this request. |
| 404 | not_found | Optional | Unknown resource (model, task ID, voice ID). |
| 413 | payload_too_large | Optional | Upload exceeds size limit (200 MB for voice samples, etc.). |
| 429 | rate_limit | Optional | Per-second throttle, daily token cap, or balance exhausted. |
| 500 | internal_error | Optional | Unexpected. Quote the X-Request-ID when reporting. |
| 503 | upstream_error | Optional | Every key for the requested provider is failing right now. Retry with a different model or wait. |
{
"error": {
"message": "Model 'gpt-99' not found.",
"type": "invalid_request",
"param": "model",
"code": "model_not_found"
}
}비율 제한 및 재시도
API 키별로 한도가 적용됩니다. 그 중 하나라도 초과하면 반환됩니다. 429:
- Per-second request throttle (plan-dependent).
- Daily token cap on free / pay-as-you-go plans.
- 대시보드에서 설정한 경우의 키별 크레딧 한도.
- Concurrent video tasks (typically 4 in flight).
Retry with exponential backoff on 429 and 503. Don't retry on 4xx other than 429.
멱등성
세대 엔드포인트(채팅, 이미지, 오디오, 비디오)는 멱등성이 없습니다. 각 호출은 새로운 응답을 생성하며 독립적으로 요금이 청구됩니다. 결정적인 결과를 얻으려면 지원되는 경우(이미지/오디오/일부 채팅 모델) 고정 시드를 설정하세요. 장기 실행 비동기 엔드포인트(/v1/video/세대)는 안전하게 다시 폴링할 수 있는 task_id를 반환합니다.
끝점 지도
모든 공개 엔드포인트를 한눈에 살펴보세요.
| Parameter | Type | Required | Description |
|---|---|---|---|
| POST /v1/chat/completions | chat | Optional | OpenAI Chat Completions. See /docs/api/chat. |
| POST /v1/messages | chat | Optional | Anthropic Messages. See /docs/api/chat. |
| POST /v1/responses | chat | Optional | Anthropic Responses (stateful). See /docs/api/chat. |
| GET /v1/models | models | Optional | List available models. See /docs/api/models. |
| POST /v1/images/generations | image | Optional | Generate / edit images. See /docs/api/media. |
| POST /v1/audio/speech | audio | Optional | Text-to-speech. See /docs/api/audio. |
| POST /v1/audio/music | audio | Optional | Music generation. |
| POST /v1/audio/sound-effects | audio | Optional | SFX generation. |
| POST /v1/audio/transcriptions | audio | Optional | Speech-to-text. |
| POST /v1/audio/audio-isolation | audio | Optional | Voice isolation / noise removal. |
| POST /v1/audio/voice-changer | audio | Optional | Speech-to-speech voice conversion. |
| POST /v1/audio/dubbing | audio | Optional | Async multi-language dubbing. |
| GET /v1/audio/voices | audio | Optional | Catalog of TTS voices. |
| POST /v1/voices/clone | voice | Optional | Clone a custom voice. See /docs/api/audio#voice-cloning. |
| GET /v1/voices/library | voice | Optional | List your cloned voices. |
| POST /v1/video/generations | video | Optional | Async video generation. See /docs/api/video. |
| GET /v1/video/tasks/:id | video | Optional | Poll a video task. |