读取用量汇总
curl --request GET \
--url https://api.omnirelay.ai/v1/manage/usage \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.omnirelay.ai/v1/manage/usage"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.omnirelay.ai/v1/manage/usage', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"range": "<string>",
"step": "<string>",
"since": "<string>",
"until": "<string>",
"scope": "user",
"timezone": "<string>",
"totals": {
"attempts": 123,
"errors": 123,
"input": 123,
"output": 123,
"cost": 123
},
"previous": {
"attempts": 123,
"errors": 123,
"input": 123,
"output": 123,
"cost": 123
},
"series": [
{}
],
"groups": {},
"performance": [
{}
],
"options": {},
"tag_group": "<string>"
}{
"error": {
"code": "model_unavailable",
"message": "The model does not exist or is disabled.",
"type": "not_found_error",
"param": "<string>"
},
"request_id": "<string>"
}{
"error": {
"code": "model_unavailable",
"message": "The model does not exist or is disabled.",
"type": "not_found_error",
"param": "<string>"
},
"request_id": "<string>"
}{
"error": {
"code": "model_unavailable",
"message": "The model does not exist or is disabled.",
"type": "not_found_error",
"param": "<string>"
},
"request_id": "<string>"
}{
"error": {
"code": "model_unavailable",
"message": "The model does not exist or is disabled.",
"type": "not_found_error",
"param": "<string>"
},
"request_id": "<string>"
}{
"error": {
"code": "model_unavailable",
"message": "The model does not exist or is disabled.",
"type": "not_found_error",
"param": "<string>"
},
"request_id": "<string>"
}管理 API
读取用量汇总
返回按 UTC 统计的用量和分组。所有者具有 members.read 权限时 scope 为 workspace,否则为 user。监控读取另受每个所有者每分钟共 240 次限制。
GET
/
v1
/
manage
/
usage
读取用量汇总
curl --request GET \
--url https://api.omnirelay.ai/v1/manage/usage \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.omnirelay.ai/v1/manage/usage"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.omnirelay.ai/v1/manage/usage', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"range": "<string>",
"step": "<string>",
"since": "<string>",
"until": "<string>",
"scope": "user",
"timezone": "<string>",
"totals": {
"attempts": 123,
"errors": 123,
"input": 123,
"output": 123,
"cost": 123
},
"previous": {
"attempts": 123,
"errors": 123,
"input": 123,
"output": 123,
"cost": 123
},
"series": [
{}
],
"groups": {},
"performance": [
{}
],
"options": {},
"tag_group": "<string>"
}{
"error": {
"code": "model_unavailable",
"message": "The model does not exist or is disabled.",
"type": "not_found_error",
"param": "<string>"
},
"request_id": "<string>"
}{
"error": {
"code": "model_unavailable",
"message": "The model does not exist or is disabled.",
"type": "not_found_error",
"param": "<string>"
},
"request_id": "<string>"
}{
"error": {
"code": "model_unavailable",
"message": "The model does not exist or is disabled.",
"type": "not_found_error",
"param": "<string>"
},
"request_id": "<string>"
}{
"error": {
"code": "model_unavailable",
"message": "The model does not exist or is disabled.",
"type": "not_found_error",
"param": "<string>"
},
"request_id": "<string>"
}{
"error": {
"code": "model_unavailable",
"message": "The model does not exist or is disabled.",
"type": "not_found_error",
"param": "<string>"
},
"request_id": "<string>"
}授权
在控制台创建的管理密钥;read 可读取,write 还可修改 API Key。不接受推理 API Key。
查询参数
可用选项:
24h, 7d, 30d, 90d hour 仅适用于 range=24h 或 7d。
可用选项:
hour, day API Key 的 ID,不是密钥正文。
成员 ID,要求管理密钥所有者具有 members.read 权限。
可用选项:
ok, error