直连通道
官方直连链路,适合需要原生体验与完整上下文的请求。
| 输入上下文 | 输入 | 输出 |
|---|---|---|
| ≤ 32K | 0.12/M | 1.18/M |
| 32K – 200K | 0.18/M | 2.35/M |
| > 200K | 0.35/M | 3.53/M |
Doubao-Seed-1.6全新多模态深度思考模型,同时支持minimal/low/medium/high 四种reasoning effort。 更强模型效果,服务复杂任务和有挑战场景。支持 256k 上下文窗口,输出长度支持最大 32k tokens。
同一模型能力,多条服务通道;按延迟、稳定性与成本灵活选择。
价格单位:$ / 1M tokensprovider 字段,例如 "provider": { "channel": "direct" }。可选 direct / stable / economical;不传则使用默认通道。官方直连链路,适合需要原生体验与完整上下文的请求。
| 输入上下文 | 输入 | 输出 |
|---|---|---|
| ≤ 32K | 0.12/M | 1.18/M |
| 32K – 200K | 0.18/M | 2.35/M |
| > 200K | 0.35/M | 3.53/M |
Doubao-Seed-1.6https://api.haijingai.com/v2/"provider": { "channel": "direct" }海鲸AI 兼容 OpenAI 接口协议,可直接使用 OpenAI SDK 或 HTTP 请求接入,默认开启流式输出。
curl https://api.haijingai.com/v2/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer <API_KEY>" \
-d '{
"model": "Doubao-Seed-1.6",
"messages": [
{"role": "system", "content": "你是一个有帮助的助手。"},
{"role": "user", "content": "你好!"}
],
"provider": { "channel": "direct" },
"stream": true
}'
# provider 为可选字段,删除该行即使用默认通道from openai import OpenAI
client = OpenAI(
base_url="https://api.haijingai.com/v2",
api_key="<API_KEY>",
)
stream = client.chat.completions.create(
model="Doubao-Seed-1.6",
messages=[
{"role": "system", "content": "你是一个有帮助的助手。"},
{"role": "user", "content": "你好!"},
],
stream=True,
# 可选:指定服务通道,不传则使用默认通道
extra_body={"provider": {"channel": "direct"}},
)
for chunk in stream:
if chunk.choices[0].delta.content:
print(chunk.choices[0].delta.content, end="", flush=True)import OpenAI from 'openai'
const client = new OpenAI({
baseURL: 'https://api.haijingai.com/v2',
apiKey: '<API_KEY>',
})
const stream = await client.chat.completions.create({
model: 'Doubao-Seed-1.6',
messages: [
{ role: 'system', content: '你是一个有帮助的助手。' },
{ role: 'user', content: '你好!' },
],
stream: true,
// 可选:指定服务通道,不传则使用默认通道
// @ts-expect-error provider 为海鲸AI 扩展字段,不在 OpenAI SDK 类型定义内
provider: { channel: 'direct' },
})
for await (const chunk of stream) {
process.stdout.write(chunk.choices[0]?.delta?.content ?? '')
}