仅当前有效登录会话;无需创建或选择 API Key。复用账号分组、钱包预留、原价格与唯一结算。未知结果保留占款,查询原意图。已受理执行不因退出登录取消。
POST
/core/v1/playground/chat/completions身份验证
Authorizationstring必填使用账户会话;身份要求:账户会话。
Authorization: Bearer $ONEASTER_SESSION_TOKEN
参数
Idempotency-Keystring必填header · 一次用户意图的稳定标识;网络重试保持原键和输入。
请求正文 · application/json
modelstring必填messagesarray必填max_tokensintegermax_completion_tokensintegerstreambooleantemperaturenumbertop_pnumbertoolsarraytool_choiceobjectparallel_tool_callsbooleanresponse_formatobjectreasoning_effortstringnobjectJSON Schema
{
"type": "object",
"additionalProperties": true,
"required": [
"model",
"messages"
],
"description": "丰富Chat格式;纯文本旧格式仍要求max_tokens与Idempotency-Key。未列出字段须符合受支持目标协议。",
"properties": {
"model": {
"type": "string"
},
"messages": {
"type": "array",
"minItems": 1,
"maxItems": 128,
"items": {
"type": "object",
"additionalProperties": true,
"properties": {
"role": {
"enum": [
"system",
"developer",
"user",
"assistant",
"tool"
]
},
"content": {
"anyOf": [
{
"type": "string"
},
{
"type": "array",
"items": {
"type": "object",
"additionalProperties": true
}
},
{
"type": "null"
}
]
},
"tool_calls": {
"type": "array",
"items": {
"type": "object",
"additionalProperties": true
}
},
"tool_call_id": {
"type": "string"
}
}
}
},
"max_tokens": {
"type": "integer",
"minimum": 1,
"maximum": 65536
},
"max_completion_tokens": {
"type": "integer",
"minimum": 1,
"maximum": 65536
},
"stream": {
"type": "boolean"
},
"temperature": {
"type": "number",
"minimum": 0,
"maximum": 2
},
"top_p": {
"type": "number",
"minimum": 0,
"maximum": 1
},
"tools": {
"type": "array",
"items": {
"type": "object",
"additionalProperties": true
}
},
"tool_choice": {},
"parallel_tool_calls": {
"type": "boolean"
},
"response_format": {
"type": "object",
"additionalProperties": true
},
"reasoning_effort": {
"type": "string"
},
"n": {
"const": 1
}
}
}