身份要求
管理员. 会话/管理写操作不在公共 Playground 执行。
接口
curl --request GET 'https://api.oneaster.ai/core/v1/admin/metrics' \ --header 'Authorization: Bearer '"$ONEASTER_SESSION_TOKEN"
参数
—
响应
200
累计请求、待核账占款与年龄、时延 p95 与准入容量
{
"application/json": {
"schema": {
"type": "object",
"additionalProperties": false,
"properties": {
"success": {
"const": true
},
"data": {
"type": "object",
"additionalProperties": false,
"properties": {
"sampled_at": {
"type": "string",
"format": "date-time"
},
"requests": {
"type": "string",
"pattern": "^[0-9]+$"
},
"unknown": {
"type": "string",
"pattern": "^[0-9]+$"
},
"pending_billing": {
"type": "string",
"pattern": "^[0-9]+$"
},
"completed": {
"type": "string",
"pattern": "^[0-9]+$"
},
"held_micro": {
"type": "string",
"pattern": "^[0-9]+$",
"description": "整数账务单位;1 积分 = 10000 单位,1 USD = 100 积分。前端用 BigInt。"
},
"unknown_pending": {
"type": "string",
"pattern": "^[0-9]+$"
},
"unknown_held_micro": {
"type": "string",
"pattern": "^[0-9]+$",
"description": "整数账务单位;1 积分 = 10000 单位,1 USD = 100 积分。前端用 BigInt。"
},
"oldest_pending_at": {
"anyOf": [
{
"type": "string",
"format": "date-time"
},
{
"type": "null"
}
]
},
"oldest_pending_age_seconds": {
"anyOf": [
{
"type": "integer",
"minimum": 0
},
{
"type": "null"
}
]
},
"oldest_unknown_pending_at": {
"anyOf": [
{
"type": "string",
"format": "date-time"
},
{
"type": "null"
}
]
},
"oldest_unknown_pending_age_seconds": {
"anyOf": [
{
"type": "integer",
"minimum": 0
},
{
"type": "null"
}
]
},
"first_token_p95_ms": {
"anyOf": [
{
"type": "number"
},
{
"type": "null"
}
]
},
"duration_p95_ms": {
"anyOf": [
{
"type": "number"
},
{
"type": "null"
}
]
},
"version": {
"type": "string"
},
"scope": {
"const": "core_request_records"
},
"paid_probes": {
"const": false
},
"admission": {
"type": "object",
"additionalProperties": false,
"properties": {
"scope": {
"const": "single_execution_instance"
},
"active": {
"type": "integer",
"minimum": 0
},
"global_limit": {
"type": "integer",
"minimum": 0
},
"capacity_rejected": {
"type": "string",
"pattern": "^[0-9]+$"
}
},
"required": [
"scope",
"active",
"global_limit",
"capacity_rejected"
]
},
"requests_per_minute": {
"type": "integer",
"minimum": 0
},
"request_window_seconds": {
"const": 60
},
"stream_idle_timeout_seconds": {
"type": "number"
},
"stream_heartbeat_seconds": {
"type": "number"
},
"upstream_timeout_seconds": {
"type": "number"
}
},
"required": [
"sampled_at",
"requests",
"unknown",
"pending_billing",
"completed",
"held_micro",
"unknown_pending",
"unknown_held_micro",
"oldest_pending_at",
"oldest_pending_age_seconds",
"oldest_unknown_pending_at",
"oldest_unknown_pending_age_seconds",
"first_token_p95_ms",
"duration_p95_ms",
"version",
"scope",
"paid_probes",
"admission",
"requests_per_minute",
"request_window_seconds",
"stream_idle_timeout_seconds",
"stream_heartbeat_seconds",
"upstream_timeout_seconds"
]
}
},
"required": [
"success",
"data"
]
}
}
}
default
错误代码见 core-api.md;供应商/数据库错误已隐藏。
{
"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"
]
}
}
}