Skip to content
此頁面尚未提供您使用的語言,因此目前以英文顯示。

SDKs & base URLs

Configure the OpenAI, Anthropic and Google GenAI SDKs, LangChain, LlamaIndex, the Vercel AI SDK and coding tools to use APISea.

← 所有文件

APISea speaks three native API dialects. Pick the base URL that matches your SDK:

SDK / protocolBase URLEndpoints
OpenAI-compatiblehttps://api.apisea.ai/v1/chat/completions, /responses, /embeddings, /images/generations, /videos/generations, /audio/transcriptions, /tasks/{id}
Anthropic Messageshttps://api.apisea.ai/v1/messages
Google Geminihttps://api.apisea.ai/v1beta/models/{model}:generateContent, :streamGenerateContent

OpenAI SDK

Python
from openai import OpenAI
client = OpenAI(api_key="sk-sea-...", base_url="https://api.apisea.ai/v1")
Node.js
import OpenAI from "openai";
const client = new OpenAI({ apiKey: process.env.APISEA_API_KEY, baseURL: "https://api.apisea.ai/v1" });

Every chat model in the directory — including Claude, Gemini, DeepSeek, Qwen and Grok — works through the OpenAI SDK.

Anthropic SDK

Use the Anthropic SDK when you need Claude-specific features such as extended thinking blocks or fine-grained prompt caching.

Python
import anthropic
client = anthropic.Anthropic(api_key="sk-sea-...", base_url="https://api.apisea.ai")

msg = client.messages.create(
    model="claude-sonnet-4-6",
    max_tokens=1024,
    messages=[{"role": "user", "content": "Summarize the benefits of prompt caching."}],
)
print(msg.content[0].text)

Google GenAI SDK

Python
from google import genai
from google.genai import types

client = genai.Client(api_key="sk-sea-...", http_options=types.HttpOptions(base_url="https://api.apisea.ai"))
resp = client.models.generate_content(model="gemini-3.5-flash", contents="Write a tagline for a sailing school.")
print(resp.text)

LangChain

Python
from langchain_openai import ChatOpenAI
llm = ChatOpenAI(model="gpt-5.5", api_key="sk-sea-...", base_url="https://api.apisea.ai/v1")
print(llm.invoke("Hello!").content)

Vercel AI SDK

TypeScript
import { createOpenAI } from "@ai-sdk/openai";
import { generateText } from "ai";

const apisea = createOpenAI({ apiKey: process.env.APISEA_API_KEY, baseURL: "https://api.apisea.ai/v1" });
const { text } = await generateText({ model: apisea.chat("claude-sonnet-4-6"), prompt: "Hello!" });

Coding tools and agents

Most coding assistants accept a custom OpenAI-compatible provider. Use these values:

  • Base URL: https://api.apisea.ai/v1
  • API key: your sk-sea- key
  • Model: any chat model id, for example claude-opus-4-8, gpt-5.5 or deepseek-v4-pro

For tools that use the Anthropic protocol (for example Claude Code), set ANTHROPIC_BASE_URL=https://api.apisea.ai and ANTHROPIC_API_KEY=sk-sea-....

Listing models from code

GET /v1/models returns every model id in the OpenAI list format and does not require a key. Add ?category=image to filter.

cURL
curl https://api.apisea.ai/v1/models?category=video

發現文件有問題嗎?請寄信至 support@apisea.ai。