Apigator

文件

API 參考文件

Apigator 相容 OpenAI。把任何 OpenAI SDK 指向 base URL、帶上你的 Apigator 金鑰,即可透過單一端點呼叫數百個模型——聊天、圖片、語音、嵌入、決策。

想找任務範例與工具整合(LangChain、Vercel AI SDK、Cursor、Cline)?請看Cookbook

免費快速開始

無須信用卡——全新金鑰即可執行免費模型。

控制台取得金鑰,馬上用免費模型發出第一個呼叫——它計費為 $0,不需儲值。每個新帳號另外還有 $0.042 額度(約 100 萬 Jev 決策模型 token)。加值後即可解鎖付費模型。

curl https://api.apigator.ai/v1/chat/completions \
  -H "Authorization: Bearer sk-YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model":"free/nemotron-nano-30b","messages":[{"role":"user","content":"Hello from Apigator!"}]}'
from openai import OpenAI

client = OpenAI(base_url="https://api.apigator.ai/v1", api_key="sk-YOUR_KEY")

resp = client.chat.completions.create(
    model="free/nemotron-nano-30b",  # free — no balance needed
    messages=[{"role": "user", "content": "Hello from Apigator!"}],
)
print(resp.choices[0].message.content)
import OpenAI from "openai";

const client = new OpenAI({ baseURL: "https://api.apigator.ai/v1", apiKey: "sk-YOUR_KEY" });

const r = await client.chat.completions.create({
  model: "free/nemotron-nano-30b", // free — no balance needed
  messages: [{ role: "user", content: "Hello from Apigator!" }],
});
console.log(r.choices[0].message.content);
free/nemotron-nano-30bfree/nemotron-super-120bfree/gemma-4-31b

快速開始

換掉 base URL——整個串接就這樣。選擇你的語言:

curl https://api.apigator.ai/v1/chat/completions \
  -H "Authorization: Bearer sk-..." \
  -H "Content-Type: application/json" \
  -d '{"model":"gpt-4o","messages":[{"role":"user","content":"Hello!"}]}'
from openai import OpenAI

client = OpenAI(base_url="https://api.apigator.ai/v1", api_key="sk-...")

resp = client.chat.completions.create(
    model="gpt-4o",
    messages=[{"role": "user", "content": "Hello!"}],
)
print(resp.choices[0].message.content)
import OpenAI from "openai";

const client = new OpenAI({ baseURL: "https://api.apigator.ai/v1", apiKey: "sk-..." });

const r = await client.chat.completions.create({
  model: "gpt-4o",
  messages: [{ role: "user", content: "Hello!" }],
});
console.log(r.choices[0].message.content);

Base URL https://api.apigator.ai/v1 · 驗證 Authorization: Bearer sk-YOUR_KEY (在控制台取得金鑰)。

各模態端點

不是所有東西都是聊天。/models 上每個模型都會標示它使用的端點——挑對的那個。相同 base URL、相同金鑰。

模態 端點 模型 id 範例
聊天 POST /v1/chat/completions gpt-4o
圖片生成 POST /v1/images/generations openai/gpt-image-1, fal_ai/fal-ai/flux/schnell
文字轉語音 POST /v1/audio/speech elevenlabs-tts
語音轉文字 POST /v1/audio/transcriptions groq/whisper-large-v3
嵌入 POST /v1/embeddings openai/text-embedding-3-small
影片生成(非同步) POST /v1/videos gemini/veo-3.1-fast-generate-preview
決策模型(Jev) POST /typesafe/v1/systemone jev-latest

範例

Python 範例沿用「快速開始」的 client

圖片生成

curl https://api.apigator.ai/v1/images/generations \
  -H "Authorization: Bearer sk-..." \
  -d '{"model":"openai/gpt-image-1","prompt":"a red crocodile mascot","n":1}'
client.images.generate(model="openai/gpt-image-1", prompt="a red crocodile mascot", n=1)
const img = await client.images.generate({
  model: "openai/gpt-image-1",
  prompt: "a red crocodile mascot",
  n: 1,
});

嵌入

curl https://api.apigator.ai/v1/embeddings \
  -H "Authorization: Bearer sk-..." \
  -d '{"model":"openai/text-embedding-3-small","input":"hello world"}'
client.embeddings.create(model="openai/text-embedding-3-small", input="hello world")
const e = await client.embeddings.create({
  model: "openai/text-embedding-3-small",
  input: "hello world",
});

文字轉語音

curl https://api.apigator.ai/v1/audio/speech \
  -H "Authorization: Bearer sk-..." \
  -d '{"model":"elevenlabs-tts","input":"Hello","voice":"21m00Tcm4TlvDq8ikWAM"}' \
  --output speech.mp3
with client.audio.speech.with_streaming_response.create(
    model="elevenlabs-tts", voice="21m00Tcm4TlvDq8ikWAM", input="Hello",
) as r:
    r.stream_to_file("speech.mp3")
import fs from "fs";
const mp3 = await client.audio.speech.create({
  model: "elevenlabs-tts", voice: "21m00Tcm4TlvDq8ikWAM", input: "Hello",
});
fs.writeFileSync("speech.mp3", Buffer.from(await mp3.arrayBuffer()));

voice 必須是 ElevenLabs 的 voice id,而非名稱。完整語音指南:/audio.md

決策模型(TypeSafe Jev)

curl https://api.apigator.ai/typesafe/v1/systemone \
  -H "Authorization: Bearer sk-..." \
  -H "Content-Type: application/json" \
  -d '{"model":"jev-latest","state":"Help! My payouts have been failing for 3 days.",
       "questions":{"is_urgent":{"type":"noul","instructions":"Does this convey urgency?"},
                    "department":{"type":"choice","instructions":"Which team should handle this?",
                                  "criteria":{"billing":"Payments","technical":"Bugs","sales":"Pricing"}}}}'
# -> {"answers":{"is_urgent":{"type":"noul","noul":0.95},
#     "department":{"type":"choice","choice":"billing","probabilities":{...},"confidence":0.81}}, ...}
import requests

r = requests.post(
    "https://api.apigator.ai/typesafe/v1/systemone",
    headers={"Authorization": "Bearer sk-..."},
    json={"model": "jev-latest",
          "state": "Help! My payouts have been failing for 3 days.",
          "questions": {"is_urgent": {"type": "noul", "instructions": "Does this convey urgency?"}}},
)
print(r.json()["answers"]["is_urgent"]["noul"])  # 0.95 = P(yes)
const r = await fetch("https://api.apigator.ai/typesafe/v1/systemone", {
  method: "POST",
  headers: { Authorization: "Bearer sk-...", "Content-Type": "application/json" },
  body: JSON.stringify({
    model: "jev-latest",
    state: "Help! My payouts have been failing for 3 days.",
    questions: { is_urgent: { type: "noul", instructions: "Does this convey urgency?" } },
  }),
});
console.log((await r.json()).answers.is_urgent.noul); // 0.95 = P(yes)

OpenAI 相容參數

我們遵循 OpenAI Chat Completions 規格。以下為 GPT-5 系列實測結果(2026 年 9 月):

所有模型也都可以透過 POST https://api.apigator.ai/v1/responses 以 OpenAI Responses 格式呼叫。GPT-5、GPT-6 系列在 chat/completions 直接帶 function tools 即可,gateway 會自動轉成 Responses API;若某個模型在 chat/completions 拒絕 tools,請把同一組 tools 改送到 /v1/responses。

模型與 Claude

apigator.ai/models瀏覽每個可呼叫的模型(含定價與各自使用的端點),或呼叫 GET https://api.apigator.ai/v1/models。除 Claude 外,所有模型預設對每把金鑰開放;Claude 需加入允許清單,並在獨立的 Anthropic 相容端點上執行——請見Claude Code CLI

給 AI 代理

正在為你的使用者串接用戶端?抓取這些原始 markdown 檔並照著逐字執行。

錯誤