Define tools with the OpenAI-style tools parameter. Choose models that list tool-calling support on the model detail page; complex tools, multi-tool selection, and argument reliability vary by model.
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 the current weather for a city","parameters": {"type": "object","properties": {"city": {"type": "string", "description": "City name"},"unit": {"type": "string", "enum": ["c", "f"]},},"required": ["city"],},},}]resp = client.chat.completions.create(model="claude-opus-5-5", # Use a model with tool-calling support.messages=[{"role": "user", "content": "Weather in Bangkok in C?"}],tools=tools,tool_choice="auto",)call = resp.choices[0].message.tool_calls[0]print(call.function.name, call.function.arguments)# get_weather {"city": "Bangkok", "unit": "c"}
import OpenAI from "openai";const client = new OpenAI({baseURL: "https://api.sealink.io/v1",apiKey: process.env.SEALINK_API_KEY,});const tools = [{type: "function" as const,function: {name: "search_docs",description: "Search internal documentation",parameters: {type: "object",properties: {query: { type: "string" },top_k: { type: "integer", default: 3 },},required: ["query"],},},}];const resp = await client.chat.completions.create({model: "claude-opus-5-5",messages: [{ role: "user", content: "How do I refund a customer?" }],tools,tool_choice: "auto",});console.log(resp.choices[0].message.tool_calls);
| Model | Level | Note |
|---|---|---|
| Gemini 3.x family | Selected models | Use OpenAI-style tools and structured outputs on models such as Gemini 3.6 Flash. Current web grounding requires the explicit SeaLink web_search tool; ordinary chat does not auto-browse or silently enable Google grounding charges. |
| Claude family | Selected models | Use the model detail page to confirm Anthropic tool-use support. |
| GPT family | Selected models | OpenAI-style tools; behavior depends on the selected model. |
| Qwen family | Selected models | Use OpenAI-compatible request shape where tool calling is enabled. |
| Doubao / Kimi / DeepSeek / GLM | Model-dependent | Validate tool-call quality with your own schemas before production. |
Chat requests do not browse automatically. Pass web_search explicitly when you need current sources. Kimi-compatible clients may use $web_search.
import OpenAI from "openai";const client = new OpenAI({baseURL: "https://api.sealink.io/v1",apiKey: process.env.SEALINK_API_KEY,});const resp = await client.chat.completions.create({model: "claude-opus-5-5",messages: [{ role: "user", content: "Find today's source-backed AI policy news." }],tools: [{type: "function",function: {name: "web_search",description: "Search current public web results for the user request",parameters: {type: "object",properties: {query: { type: "string" },max_results: { type: "integer", default: 5 },},required: ["query"],},},}],tool_choice: { type: "function", function: { name: "web_search" } },});console.log(resp.id);
import OpenAI from "openai";const client = new OpenAI({baseURL: "https://api.sealink.io/v1",apiKey: process.env.SEALINK_API_KEY,});const resp = await client.chat.completions.create({model: "kimi-k3",messages: [{ role: "user", content: "Use web search to summarize today's market-moving AI news." }],tools: [{ type: "builtin_function", function: { name: "$web_search" } }],tool_choice: { type: "builtin_function", function: { name: "$web_search" } },});console.log(resp.id);
Tip