大模型 API
使用纯梦 API Key 调用下方「可用模型」中列出的全部模型。请求体按对应接口格式原样传入, 只需要把请求地址换成纯梦域名。
基础信息
| 项目 | 说明 |
|---|---|
| 鉴权 | Authorization: Bearer 你的纯梦APIKey |
| 请求格式 | Content-Type: application/json |
| 返回格式 | 非流式返回 JSON;stream: true 时返回 text/event-stream。 |
| 计费 | 请求成功后按实际输入、输出 token 计费;请求失败不扣费。 |
| 参数与额度 | 输入、输出预算与思考配置由所选模型支持范围决定。平台不截断文本、不压低调用方预算;未传的生成参数采用模型服务默认值。 |
可用模型
下表由服务端实时读取,与 GET /v1/models 返回一致;公开模型仅展示纯梦零售价,「—」表示暂不单独标价。
| model | 名称 | 输入价格 | 输出价格 | 缓存读取价格 | 缓存写入价格 | 建议接口 |
|---|---|---|---|---|---|---|
gpt-5-5 | GPT-5.5 | ¥0.6000 / 百万 tokens | ¥4.8000 / 百万 tokens | — | — | /v1/responses |
claude-opus-4-6-thinking | Claude Opus 4.6 Thinking | ¥2.1000 / 百万 tokens | ¥10.5000 / 百万 tokens | — | — | /v1/chat/completions |
claude-sonnet-4-6 | Claude Sonnet 4.6 | ¥1.2600 / 百万 tokens | ¥6.3000 / 百万 tokens | — | — | /v1/chat/completions |
gemini-3.8-flash | Gemini 3.8 Flash | ¥1.5000 / 百万 tokens | ¥5.0000 / 百万 tokens | — | — | /v1/chat/completions |
gemini-3.1-pro | Gemini 3.1 Pro | ¥4.0000 / 百万 tokens | ¥24.0000 / 百万 tokens | ¥0.4000 / 百万 tokens | — | /v1/chat/completions |
gemini-3.1-pro-high | Gemini 3.1 Pro High | ¥1.1200 / 百万 tokens | ¥6.7200 / 百万 tokens | ¥0.1120 / 百万 tokens | — | /v1/chat/completions |
gemini-3.1-pro-low | Gemini 3.1 Pro Low | ¥1.1200 / 百万 tokens | ¥6.7200 / 百万 tokens | ¥0.1120 / 百万 tokens | — | /v1/chat/completions |
Gemini 3.1 Pro 系列
标准版 gemini-3.1-pro、High 版 gemini-3.1-pro-high、Low 版 gemini-3.1-pro-low 均使用 /v1/chat/completions,支持普通 JSON 与 SSE 流式调用。三种型号独立选择,不会互相替换;当前不提供 Responses 或原生 Gemini 接口。
上表列出参考单价;实际费用确认后才扣款,不按本地估算 token 提前扣费。思考 token、缓存优惠按模型服务最终结算为准,最终金额向上取整到分。未传输出预算或思考配置时采用模型默认值,显式参数按原值传递。
普通响应返回 usage、charge_cents(分)、charge_yuan(元)、billing_status;流式响应在结束前通过 puream.billing 事件返回。charged 表示已结算;pending 表示仍在核对实际费用,此时金额为 null、尚未扣款,后台会继续核对。这里返回用量与总扣费,不拆分估算的输入、缓存或输出金额。
curl -X POST "https://puream.cn/v1/chat/completions" \
-H "Authorization: Bearer 你的纯梦APIKey" \
-H "Content-Type: application/json" \
-d '{"model":"gemini-3.1-pro","messages":[{"role":"user","content":"你好"}],"stream":false}'Responses 接口
POST https://puream.cn/v1/responses
适合 GPT-6 Astra、GPT-5.6 和 Gemini 3.8 Flash;Gemini 3.1 Pro 系列与 Claude Fable 5.1 请使用 Chat Completions。请求体按 Responses 格式传入,返回体保持 Responses 格式;模型扩展参数按其支持范围传递。
GPT-6 Astra 的函数/自定义工具调用需要 Responses;该模型不支持 temperature、top_p、top_logprobs,Chat Completions 还不支持 logprobs。思考强度支持 low、medium、high、xhigh、max。GPT-6 Astra 和 Claude Fable 5.1 当前只开放函数或自定义工具,不开放单独计费的内置工具。
| 字段 | 类型 | 必填 | 可填值 / 示例 | 作用 |
|---|---|---|---|---|
model | string | 是 | gpt-6-astra | 要调用的模型。 |
input | string | array | 是 | 字符串,或 role/content 数组 | 用户输入内容。支持纯文本,也支持多模态 content 数组。 |
instructions | string | 否 | 任意系统提示词 | 设置模型的整体角色、语气、规则。 |
max_output_tokens | number | 否 | 所选模型支持的预算 | 按传入值执行;不填时使用模型服务默认值。 |
temperature | number | 否 | 0 到 2 | 控制输出随机性,数值越高越发散。 |
top_p | number | 否 | 0 到 1 | 核采样参数,通常不要和 temperature 同时大幅调整。 |
text | object | 否 | format、verbosity | 控制文本输出格式。format 可用于 text 或 json_schema。 |
reasoning | object | 否 | 模型支持的 effort、summary 等字段 | 完整传递思考配置;可用值由所选模型校验。 |
tools | array | 否 | 函数、搜索等工具定义 | 让模型在回答中调用工具。 |
tool_choice | string | object | 否 | auto | required | none | 指定工具 | 控制是否使用工具以及使用哪个工具。 |
stream | boolean | 否 | true | false | 是否使用 SSE 流式返回。 |
store | boolean | 否 | true | false | 是否保存本次响应记录。 |
metadata | object | 否 | 自定义键值 | 给请求附加业务侧元数据。 |
curl -X POST "https://puream.cn/v1/responses" \
-H "Authorization: Bearer 你的纯梦APIKey" \
-H "Content-Type: application/json" \
-d '{
"model": "gpt-6-astra",
"instructions": "你是专业文案编辑。",
"input": [
{
"role": "user",
"content": [
{ "type": "input_text", "text": "把这段文案改得更自然:这里填写原文" }
]
}
],
"text": {
"format": { "type": "text" },
"verbosity": "medium"
},
"reasoning": {
"effort": "medium",
"summary": "auto"
},
"max_output_tokens": 1200,
"stream": false,
"store": true
}'Chat Completions 接口
POST https://puream.cn/v1/chat/completions
适合 Claude Fable 5.1,也兼容其他已开放的 Chat Completions 模型。请求体按 Chat Completions 格式传入,返回体保持 Chat Completions 格式。Claude Fable 5.1 使用自适应思考;传 thinking.type=adaptive 或省略 thinking,可用 effort 调整深度,不要传采样参数。
| 字段 | 类型 | 必填 | 可填值 / 示例 | 作用 |
|---|---|---|---|---|
model | string | 是 | claude-fable-5-1,也可填已开放模型 | 要调用的模型。 |
messages | array | 是 | role/content 数组 | 对话消息列表。role 常用 system、user、assistant。 |
max_tokens | number | 否 | 所选模型支持的预算 | 按传入值执行;不填时不附加固定输出上限。 |
max_completion_tokens | number | 否 | 所选模型支持的预算 | 支持此字段的模型可直接传入,不自动压低。 |
temperature | number | 否 | 0 到 2 | 控制输出随机性。 |
top_p | number | 否 | 0 到 1 | 核采样参数。 |
stream | boolean | 否 | true | false | 是否使用 SSE 流式返回。 |
stream_options | object | 否 | include_usage: true | 流式返回时可要求带 usage 信息。 |
tools | array | 否 | 函数工具定义 | 让模型调用外部工具。 |
tool_choice | string | object | 否 | auto | required | none | 指定工具 | 控制工具调用策略。 |
response_format | object | 否 | json_schema 等 | 控制结构化输出格式。 |
reasoning_effort | string | 否 | 所选模型支持的值 | 原样传递思考强度,不限定为固定的三个档位。 |
thinking | object | 否 | type | Claude Fable 5.1 可填 adaptive;也可省略并使用模型默认思考。 |
effort | string | 否 | low | medium | high | 设置 Claude Fable 5.1 的自适应思考深度。 |
stop | string | array | 否 | 停止词 | 遇到指定文本时停止生成。 |
metadata | object | 否 | 自定义键值 | 给请求附加业务侧元数据。 |
curl -X POST "https://puream.cn/v1/chat/completions" \
-H "Authorization: Bearer 你的纯梦APIKey" \
-H "Content-Type: application/json" \
-d '{
"model": "claude-fable-5-1",
"messages": [
{ "role": "system", "content": "你是专业文案编辑。" },
{ "role": "user", "content": "把这段文案改得更自然:这里填写原文" }
],
"max_tokens": 1200,
"thinking": {
"type": "adaptive"
},
"effort": "medium",
"stream": false
}'思考强度
| 接口 | 字段 | 推荐值 | 说明 |
|---|---|---|---|
/v1/responses | reasoning.effort | low、medium、high、xhigh、max | 控制 GPT-6 Astra 思考强度;GPT-5.6 使用其自身支持范围。 |
/v1/responses | reasoning.summary | auto | 需要思考摘要时填写。 |
/v1/chat/completions | thinking.type | adaptive | Claude Fable 5.1 默认启用自适应思考;可省略此字段。 |
/v1/chat/completions | effort | low、medium、high | 设置 Claude Fable 5.1 思考深度。 |
/v1/chat/completions | reasoning_effort | low、medium、high | 兼容部分推理模型的思考强度字段。 |
错误返回
| HTTP 状态码 | 含义 | 处理建议 |
|---|---|---|
| 401 | 缺少或错误的纯梦 API Key | 检查 Authorization 请求头。 |
| 402 | 余额不足 | 充值后重试。 |
| 400 | 模型未启用或配置异常 | 确认 model 是否填写正确。 |
| 500 | 模型调用失败 | 查看返回的 error.message,稍后重试或联系管理员。 |