Api.Airforce
API REFERENCE

型號

列出 API 金鑰上可用的每個模型,包括功能標誌、上下文限制和每個令牌的定價。

API 其餘部分所依賴的一切,都能透過單次呼叫探索得知:哪些模型接受圖片、tools、reasoning 或 caching、它們的 context window,以及每個 token 的價格。查詢 models endpoint 並依下方的能力旗標篩選,而不要在應用程式中寫死模型清單。

請注意,created 欄位是列出當下的伺服器時間,並非各模型的發布日期;而 status 欄位反映即時健康狀態 — 請重新取得它,不要長時間快取。

GET /v1/models

返回您現在可以使用的模型清單。已通過身分驗證的請求會包含您在儀表板中啟用的任何個別使用者模型。其結構對應 OpenAI 的 GET /v1/models 具有額外的 Airforce 能力欄位。

GEThttps://api.airforce/v1/models

例子

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

回應形狀

頂層信封是 { object: "list", data: Model[] }. 每個 Model 具有以下欄位 - 標記為可選的欄位在未知時可以省略。

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

回應範例

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

按能力過濾

能力篩選在用戶端使用下方的旗標完成。最常見的篩選:

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/'));

有一個可選的伺服器端查詢參數:GET /v1/models?channels=1 會額外回傳各 channel 的別名項目(供具路由感知能力的用戶端使用);不帶此參數時,那些別名將被省略。


定價字段

全部 *pricepermilliontokens 字段是每 1 000 000 個代幣的整數美分。除以 100 即可得到每百萬美元。

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

模型狀態與棄用

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.

硬性停用的模型並非一種狀態值——它們會完全從 /v1/models 中排除(對每個呼叫者皆然,包括管理員),且只能透過管理工具以精確名稱呼叫。

想要可瀏覽的視圖嗎?

/模型頁面 透過分組、搜尋和定價比較來呈現相同的數據。