Tool configuration
Set SeaLink's base URL and API Key in your existing OpenAI SDK code to call supported models.
OpenAI SDKs support custom base_url settings. For standard chat, streaming, and tool-calling requests, you usually only need to set SeaLink's base_url and api_key; before production, test real requests with your target model to verify parameter compatibility.
import osfrom openai import OpenAIclient = OpenAI(base_url="https://api.sealink.io/v1",api_key=os.environ["SEALINK_API_KEY"],)response = client.chat.completions.create(model="claude-opus-5-5",messages=[{"role": "user", "content": "Hello, SeaLink."}],)print(response.choices[0].message.content)
import osfrom openai import OpenAIclient = OpenAI(base_url="https://api.sealink.io/v1",api_key=os.environ["SEALINK_API_KEY"],)stream = client.chat.completions.create(model="claude-opus-5-5",messages=[{"role": "user", "content": "Write a haiku."}],stream=True,)for chunk in stream:if chunk.choices[0].delta.content:print(chunk.choices[0].delta.content, end="")
import osfrom openai import OpenAIclient = OpenAI(base_url="https://api.sealink.io/v1",api_key=os.environ["SEALINK_API_KEY"],)tools = [{"type": "function","function": {"name": "get_weather","description": "Get current weather for a city","parameters": {"type": "object","properties": {"city": {"type": "string"}},"required": ["city"]}}}]response = client.chat.completions.create(model="claude-opus-5-5",messages=[{"role": "user", "content": "What's the weather in Bangkok?"}],tools=tools,)print(response.choices[0].message.tool_calls)
import OpenAI from "openai";const client = new OpenAI({baseURL: "https://api.sealink.io/v1",apiKey: process.env.SEALINK_API_KEY,});const response = await client.chat.completions.create({model: "claude-opus-5-5",messages: [{ role: "user", content: "Hello, SeaLink." }],});console.log(response.choices[0].message.content);
curl https://api.sealink.io/v1/chat/completions \-H "Authorization: Bearer $SEALINK_API_KEY" \-H "Content-Type: application/json" \-d '{"model": "claude-opus-5-5","messages": [{"role": "user", "content": "Hello"}]}'
pip install openaiRequires Python ≥ 3.8.
npm install openaiRequires Node.js ≥ 18.
Never hardcode the API Key. Use environment variables: Windows: set SEALINK_API_KEY=sk-sealink-... macOS/Linux: export SEALINK_API_KEY=sk-sealink-... Or use a .env file with python-dotenv / dotenv.
Env vars: $env:SEALINK_API_KEY="sk-sealink-..." in PowerShell (temporary), or [Environment]::SetEnvironmentVariable for permanent. Python path: %LOCALAPPDATA%/Programs/Python/. Add to PATH if pip is not found.
Env vars: add export SEALINK_API_KEY=... to ~/.zshrc. Python: system Python is often old — brew install python for a newer version. Node.js: brew install node.
Env vars: add export SEALINK_API_KEY=... to ~/.bashrc. Python: sudo apt install python3-pip (Debian/Ubuntu) or sudo dnf install python3-pip (Fedora). Node.js: use nvm to install — avoid apt's old version.