Api.Airforce
API REFERENCE

Người mẫu

Liệt kê mọi mô hình có sẵn trên khóa API của bạn, kèm theo cờ khả năng, giới hạn ngữ cảnh và giá mỗi mã thông báo.

Mọi thứ mà phần còn lại của API phụ thuộc vào đều có thể khám phá từ một lệnh gọi: model nào chấp nhận hình ảnh, tools, reasoning hay caching, context window của chúng, và giá theo từng token. Hãy truy vấn endpoint models và lọc theo các cờ khả năng bên dưới thay vì hard-code danh sách model trong ứng dụng của bạn.

Lưu ý rằng trường created là thời gian server hiện tại của danh sách, không phải ngày phát hành riêng của từng model, và trường status phản ánh tình trạng trực tiếp — hãy fetch lại nó thay vì cache trong thời gian dài.

GET /v1/models

Trả về danh sách các mô hình bạn có thể sử dụng ngay bây giờ. Yêu cầu được xác thực bao gồm mọi mô hình theo người dùng mà bạn đã bật trong trang tổng quan. Hình dạng phản ánh OpenAI GET /v1/models với các trường năng lực bổ sung của Airforce.

GEThttps://api.airforce/v1/models

Ví dụ

curl https://api.airforce/v1/models \
  -H "Authorization: Bearer sk-air-YOUR_API_KEY"

Hình dạng phản hồi

Phong bì cấp cao nhất là { object: "list", data: Model[] }. Mỗi Model có các trường bên dưới - các trường được đánh dấu tùy chọn có thể bị bỏ qua khi không xác định.

ParameterTypeRequiredDescription
idstringOptionalPublic model identifier you pass as the "model" field on every other endpoint, e.g. "claude-sonnet-4.6" or "gpt-5.1-chat".
objectstringOptionalAlways "model".
createdintegerOptionalUnix timestamp at which this listing was generated (current server time) — not a stable per-model creation date.
owned_bystringOptionalVendor name: "openai", "anthropic", "google", "deepseek", …
catalog_idstringOptionalCanonical vendor identifier for the underlying model family (e.g. "anthropic/claude-sonnet-4-6"). Stable across Airforce ID changes.
context_lengthintegerOptionalTotal context window in tokens (input + output).
max_output_tokensintegerOptionalHard cap on a single response. Use this as the upper bound when picking max_tokens.
input_modalitiesarrayOptionalSubset of ["text", "image", "audio", "document", "video"] the model accepts as input.
output_modalitiesarrayOptionalSubset of ["text", "image", "audio", "video"] the model can produce.
supports_chatbooleanOptionalAvailable on /v1/chat/completions and /v1/messages.
supports_streamingbooleanOptionalHonors stream: true.
supports_visionbooleanOptionalAccepts image_url content blocks.
supports_toolsbooleanOptionalAccepts the tools / tool_choice parameters.
supports_reasoningbooleanOptionalHonors reasoning_effort / thinking / thinking_budget.
supports_documentsbooleanOptionalAccepts document content blocks (PDF, etc.).
supports_cachingbooleanOptionalHonors cache_control on Anthropic-style system prompts.
supports_audio_inputbooleanOptionalAccepts audio content blocks (multimodal STT-in-chat).
supports_video_inputbooleanOptionalAccepts video content blocks.
knowledge_cutoffstringOptionalVendor-published knowledge cutoff month, e.g. "2025-09".
statusstringOptionalLive health: "operational" | "degraded" | "partial_outage" | "major_outage" (legacy "stable" / "down" / "offline" may also appear).
pricepermilliontokensintegerOptionalInput cost in cents per 1M tokens. Output side has output_pricepermilliontokens.
cache_read_pricepermilliontokensintegerOptionalDiscounted rate for cache-hit input tokens (Anthropic-style caching).

Phản hồi mẫu

{
  "object": "list",
  "data": [
    {
      "id": "claude-sonnet-4.6",
      "object": "model",
      "created": 1740000000,
      "owned_by": "anthropic",
      "catalog_id": "anthropic/claude-sonnet-4-6",
      "context_length": 200000,
      "max_output_tokens": 64000,
      "input_modalities": ["text", "image", "document"],
      "output_modalities": ["text"],
      "supports_chat": true,
      "supports_streaming": true,
      "supports_vision": true,
      "supports_tools": true,
      "supports_reasoning": true,
      "supports_documents": true,
      "supports_caching": true,
      "knowledge_cutoff": "2025-08",
      "status": "operational",
      "pricepermilliontokens": 300,
      "output_pricepermilliontokens": 1500,
      "cache_read_pricepermilliontokens": 30
    }
    // … more models
  ]
}

Lọc theo khả năng

Việc lọc theo khả năng được thực hiện ở phía client bằng các cờ bên dưới. Các bộ lọc phổ biến nhất:

const res = await fetch('https://api.airforce/v1/models', {
  headers: { Authorization: `Bearer ${API_KEY}` },
});
const { data } = await res.json();

// Vision-capable chat models
const visionModels = data.filter(m => m.supports_chat && m.supports_vision);

// Cheapest reasoning model with at least 100k context
const reasoning = data
  .filter(m => m.supports_reasoning && (m.context_length ?? 0) >= 100_000)
  .sort((a, b) => (a.pricepermilliontokens ?? 0) - (b.pricepermilliontokens ?? 0))[0];

// All models from one vendor, by canonical catalog family
const allClaude = data.filter(m => m.catalog_id?.startsWith('anthropic/'));

Có một tham số truy vấn phía server tùy chọn: GET /v1/models?channels=1 bổ sung trả về các mục alias theo từng channel (dành cho các client nhận biết định tuyến); nếu không có nó, các alias đó bị lược bỏ.


Trường giá

Tất cả *pricepermilliontokens các trường là số xu trên 1 000 000 mã thông báo. Chia cho 100 để được một triệu USD.

ParameterTypeRequiredDescription
pricepermilliontokensintegerOptionalInput tokens, cents per 1M.
output_pricepermilliontokensintegerOptionalOutput tokens, cents per 1M.
cache_write_5m_pricepermilliontokensintegerOptionalCache-write rate for 5-minute TTL caches (Anthropic).
cache_write_1h_pricepermilliontokensintegerOptionalCache-write rate for 1-hour TTL caches (Anthropic).
cache_read_pricepermilliontokensintegerOptionalCache-read rate (typically 10× cheaper than uncached input).

Trạng thái mô hình và ngừng sử dụng

ParameterTypeRequiredDescription
operationalstatusOptionalHealthy — recent calls are succeeding. The usual value for an available model.
degradedstatusOptionalCallable, but with elevated errors or latency.
partial_outagestatusOptionalA subset of upstream channels is failing.
major_outagestatusOptionalMost or all calls are currently failing.
stable / down / offlinestatusOptionalLegacy or admin-set values that may also appear.

Các model bị vô hiệu hóa cứng không phải là một giá trị trạng thái — chúng bị loại trừ hoàn toàn khỏi /v1/models (đối với mọi caller, kể cả admin) và chỉ được gọi bằng tên chính xác thông qua công cụ admin.

Muốn có một chế độ xem có thể duyệt?

các /trang mô hình hiển thị cùng dữ liệu này với các so sánh nhóm, tìm kiếm và giá cả.