Choose a protocol
Use the OpenAI baseURL for existing OpenAI SDK apps; use the Anthropic endpoint for Claude-style tools.
/v1Anthropic/anthropicOpenAI および Anthropic 互換のエンドポイント、すぐに使える IDE 統合ガイド付き。
登録 → キー作成 → リクエストをコピー → 最初の返信を確認。この 4 ステップを順番に進めてください。
AI3306_API_KEY に作成したキーを設定し、いずれかを実行してください。OpenAI SDK と同じコードで、base_url を変えるだけです。
curl https://3306.ai/v1/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $AI3306_API_KEY" \
-d '{
"model": "lumart-chat",
"messages": [{"role":"user","content":"Hello 3306.AI!"}]
}'呼び出しが成功すると標準の chat completion オブジェクトが返り、返信は choices[0].message.content に入っています。
{
"id": "chatcmpl-abc123",
"object": "chat.completion",
"created": 1700000000,
"model": "lumart-chat",
"choices": [
{
"index": 0,
"message": { "role": "assistant", "content": "Hello! How can I help you today?" },
"finish_reason": "stop"
}
],
"usage": { "prompt_tokens": 9, "completion_tokens": 9, "total_tokens": 18 }
}トークン単位のストリーミングが必要ですか? "stream": true を追加し、レスポンスを Server-Sent Events として読み取ってください。
既存の OpenAI SDK プロジェクトがありますか? base_url を https://3306.ai/v1 に変えるだけで、既存コードをそのまま再利用できます。
OpenAI and Anthropic compatibility across text, images, audio, and embeddings with unified auth, routing, and Stars billing.
import OpenAI from "openai";
const client = new OpenAI({
apiKey: process.env.AI3306_API_KEY,
baseURL: "/v1",
});
const result = await client.chat.completions.create({
model: "gpt-4o",
messages: [{ role: "user", content: "Hello 3306.AI!" }],
});
console.log(result.choices[0].message.content);Use the OpenAI baseURL for existing OpenAI SDK apps; use the Anthropic endpoint for Claude-style tools.
Full keys are shown only once. Examples show prefixes; live requests need the full key pasted manually.
Examples use the current origin automatically while keeping native SDK conventions.
3306.AI は OpenAI と Anthropic に完全互換の統合 API を提供します — 既知の SDK を使って複数の上流モデルにアクセスし、1 つのキーで Stars 課金。
OpenAI API のドロップイン置き換え — コード変更不要
/v1ストリーミング含む Anthropic Messages API ネイティブサポート
/anthropicOrganized by developer task so you can pick a capability, then read parameters and examples.