支持 OpenAI Chat/Responses、KIE GPT 和 Anthropic 原生或兼容转换。previous_response_id 只接受 Core 本地本人Key历史;store默认true,GET/DELETE管理响应。付费托管工具、供应商文件ID和后台执行关闭;不支持字段发送前拒绝。最终用量不确定时保留预留。
身份要求
API Key 接口. 会话/管理写操作不在公共 Playground 执行。 model 必须是当前目录的公开名称;文本占位符先准备正文并等用户核对,图片/视频请按当前型号规格手动替换占位符。
接口
curl --request POST 'https://api.oneaster.ai/v1/messages' \
--header 'Authorization: Bearer '"$ONEASTER_API_KEY" \
--header 'Idempotency-Key: '"$ONEASTER_INTENT" \
--header 'Content-Type: application/json' \
--data '{
"model": "YOUR_TEXT_MODEL_NAME",
"messages": [
{
"role": "user",
"content": "Hello"
}
],
"max_tokens": 64,
"stream": false
}'
参数
- Idempotency-Key (header, 可选): {"type":"string","minLength":1,"maxLength":100} 可选;提供后 JSON 成功请求可以按原请求重放。
请求 JSON Schema
application/json
{
"schema": {
"type": "object",
"additionalProperties": true,
"required": [
"model",
"messages"
],
"properties": {
"model": {
"type": "string"
},
"messages": {
"type": "array",
"items": {
"type": "object",
"additionalProperties": true
}
},
"system": {},
"tools": {
"type": "array",
"items": {
"type": "object",
"additionalProperties": true
}
},
"tool_choice": {},
"thinking": {
"type": "object",
"additionalProperties": true
},
"output_config": {
"type": "object",
"additionalProperties": true
},
"stop_sequences": {
"type": "array",
"items": {
"type": "string"
}
},
"top_k": {
"type": "integer",
"minimum": 0
},
"max_tokens": {
"type": "integer",
"minimum": 1,
"maximum": 65536
},
"stream": {
"type": "boolean"
}
}
}
}
响应
200
Messages:原生与跨协议 JSON/SSE;工具、图片、推理,托管工具关闭
{
"content": {
"application/json": {
"schema": {}
},
"text/event-stream": {
"schema": {
"type": "string",
"description": "与客户端接口一致的具名SSE;最终用量验证并结算后发送结束事件,失败保留预留。"
}
}
},
"headers": {}
}
503
错误代码见 core-api.md;供应商/数据库错误已隐藏。
{
"content": {
"application/json": {
"schema": {
"type": "object",
"additionalProperties": false,
"properties": {
"success": {
"const": false
},
"error": {
"type": "object",
"additionalProperties": false,
"properties": {
"code": {
"type": "string"
},
"message": {
"type": "string"
},
"type": {
"const": "oneaster_error"
}
},
"required": [
"code",
"message",
"type"
]
},
"data": {
"type": "null"
}
},
"required": [
"success",
"error",
"data"
]
}
}
},
"headers": {}
}
default
错误代码见 core-api.md;供应商/数据库错误已隐藏。
{
"content": {
"application/json": {
"schema": {
"type": "object",
"additionalProperties": false,
"properties": {
"success": {
"const": false
},
"error": {
"type": "object",
"additionalProperties": false,
"properties": {
"code": {
"type": "string"
},
"message": {
"type": "string"
},
"type": {
"const": "oneaster_error"
}
},
"required": [
"code",
"message",
"type"
]
},
"data": {
"type": "null"
}
},
"required": [
"success",
"error",
"data"
]
}
}
},
"headers": {}
}