快速開始
入門
幾分鐘內開始傳送API請求所需的一切。
基礎URL
所有API請求應傳送到以下基礎URL:
BASE URL
https://api.airforce可用端點
POST
/v1/chat/completionsOpenAI相容聊天POST
/v1/messagesAnthropic相容訊息POST
/v1/images/generations影象和媒體生成GET
/v1/models列出可用模型速率限制
速率限制按計劃等級應用。以每分鐘請求數(RPM)和每日請求數(RPD)衡量。
| 計劃 | RPM | RPD |
|---|---|---|
| Free | 1 RPM | 1,000 RPD |
| Premium | 5 RPM | 5,000 RPD |
| Master | 10 RPM | 無限 RPD |
注意: 餘額為正的按量付費使用者完全不受這些分級速率限制。
快速示例
cURL
curl https://api.airforce/v1/chat/completions \
-H "Authorization: Bearer sk-air-YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "gpt-4.1-mini",
"messages": [{"role": "user", "content": "Say hello!"}],
"max_tokens": 100
}'Python
from openai import OpenAI
client = OpenAI(
base_url="https://api.airforce/v1",
api_key="sk-air-YOUR_API_KEY"
)
response = client.chat.completions.create(
model="gpt-4.1-mini",
messages=[{"role": "user", "content": "Say hello!"}],
max_tokens=100
)
print(response.choices[0].message.content)Node.js
import OpenAI from 'openai';
const client = new OpenAI({
baseURL: 'https://api.airforce/v1',
apiKey: 'sk-air-YOUR_API_KEY',
});
const response = await client.chat.completions.create({
model: 'gpt-4.1-mini',
messages: [{ role: 'user', content: 'Say hello!' }],
max_tokens: 100,
});
console.log(response.choices[0].message.content);模型發現
使用/v1/models端點獲取所有可用模型及其功能和價格的列表。
curl https://api.airforce/v1/models -H "Authorization: Bearer sk-air-YOUR_API_KEY"提示: 你也可以在模型頁面上視覺化瀏覽模型,該頁面顯示實時狀態、定價和上下文視窗。