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 / protocol | Base URL | Endpoints |
|---|---|---|
| OpenAI-compatible | https://api.apisea.ai/v1 | /chat/completions, /responses, /embeddings, /images/generations, /videos/generations, /audio/transcriptions, /tasks/{id} |
| Anthropic Messages | https://api.apisea.ai | /v1/messages |
| Google Gemini | https://api.apisea.ai | /v1beta/models/{model}:generateContent, :streamGenerateContent |
OpenAI SDK
from openai import OpenAI
client = OpenAI(api_key="sk-sea-...", base_url="https://api.apisea.ai/v1")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.
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
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
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
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.5ordeepseek-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 https://api.apisea.ai/v1/models?category=video发现文档中的问题?请发送邮件至 support@apisea.ai。