gpt-6.2-astra 是 GPT-6.2 代最强的一款:Sol 是日常选择,Astra 面向科研、法律、金融和复杂工程。OpenAI 称它是其最强网络安全模型,高风险安全请求受更严限制。图文输入,105 万上下文,12.8 万输出,支持函数调用。
鉴权
- Base URL
https://api.dreamto.ai- Authorization
Authorization: Bearer YOUR_API_KEY- Content-Type
application/json- 模型名 (model)
gpt-6.2-astra
接入协议
为什么选这个协议
适合已有 OpenAI SDK、Chat Completions 代码或统一网关接入的用户。
接口地址
POST/v1/chat/completions
Authorization: Bearer YOUR_API_KEYContent-Type: application/json请求 / 响应 JSON
请求
{
"model": "gpt-6.2-astra",
"tools": [],
"stream": false,
"messages": [
{
"role": "user",
"content": "你好,世界"
}
],
"verbosity": "medium",
"max_tokens": 4096,
"temperature": 0.7,
"tool_choice": "auto",
"response_format": {
"type": "json_object"
},
"reasoning_effort": "medium",
"system_instruction": "你是一个严谨的助手。"
}响应
{
"id": "chatcmpl_example",
"model": "gpt-6.2-astra",
"usage": {
"total_tokens": 24,
"prompt_tokens": 8,
"completion_tokens": 16
},
"object": "chat.completion",
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": "你好,世界"
},
"finish_reason": "stop"
}
],
"created": 1710000000
}请求字段 / 响应字段
请求字段
| 字段 | 类型 | 必填 | 默认 | 可选值 / 范围 | 说明 | 示例 |
|---|---|---|---|---|---|---|
| messages | array | Y | - | - | OpenAI 兼容聊天消息数组。 | [{"role":"user","content":"你好,世界"}] |
| system_instruction | string | N | - | - | 用于约束角色、风格和回答边界。 | 你是一个严谨的助手。 |
| temperature | number | N | 1 | - | 控制随机性;越低越稳定。 | 0.7 |
| max_tokens | integer | N | - | - | 限制本次响应的最大输出长度。 | 4096 |
| stream | boolean | N | false | - | 是否使用流式响应。 | false |
| response_format | object | N | - | - | 结构化输出格式,例如 JSON object。 | {"type":"json_object"} |
| tools | array | N | - | - | OpenAI tools/function calling 定义。 | [] |
| tool_choice | string | N | - | - | auto、none 或指定工具。 | auto |
| reasoning_effort | enum | N | - | low, medium, high, xhigh | 推理模型消耗多少算力做思考。取值越高回答越深入、耗时与计费越高。本列表为该模型实测可接受的档位,未列出的档位上游会直接报错。 | medium |
| verbosity | enum | N | - | low, medium, high | 控制回答的详略程度。low 更简短,high 更详尽。该模型实测可用;官方同系列其他型号不保证生效。 | medium |
响应字段
| 字段 | 类型 | 必填 | 默认 | 可选值 / 范围 | 说明 | 示例 |
|---|---|---|---|---|---|---|
| id | string | N | - | - | 本次请求的响应标识。 | chatcmpl_example |
| model | string | N | - | - | 实际响应的模型名称。 | gpt-6.2-astra |
| choices[].message.content | string | N | - | - | 模型生成的主要文本内容。 | 你好,世界 |
| usage.prompt_tokens | integer | N | - | - | 请求输入消耗的 token 数。 | 8 |
| usage.completion_tokens | integer | N | - | - | 模型输出消耗的 token 数。 | 16 |
| usage.total_tokens | integer | N | - | - | 输入和输出合计 token 数。 | 24 |
| object | string | N | - | - | - | chat.completion |
| created | integer | N | - | - | - | 1710000000 |
| choices | array | N | - | - | - | [{"index":0,"message":{"role":"assistant","content":"你好,世界"},"finish_reason":"stop"}] |
| choices[] | object | N | - | - | - | {"index":0,"message":{"role":"assistant","content":"你好,世界"},"finish_reason":"stop"} |
| choices[].index | integer | N | - | - | - | 0 |
| choices[].message | object | N | - | - | - | {"role":"assistant","content":"你好,世界"} |
| choices[].message.role | string | N | - | - | - | assistant |
| choices[].finish_reason | string | N | - | - | - | stop |
| usage | object | N | - | - | - | {"total_tokens":24,"prompt_tokens":8,"completion_tokens":16} |
代码示例
cURLrequest.sh
curl -X POST "https://api.dreamto.ai/v1/chat/completions" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "gpt-6.2-astra",
"messages": [
{
"content": "你好,世界",
"role": "user"
}
],
"system_instruction": "你是一个严谨的助手。",
"temperature": 0.7,
"max_tokens": 4096,
"stream": false,
"response_format": {
"type": "json_object"
},
"tools": [],
"tool_choice": "auto",
"reasoning_effort": "medium",
"verbosity": "medium"
}'