修改 API Key
curl --request PATCH \
--url https://api.omnirelay.ai/v1/manage/keys/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Acme production",
"defaultTags": {
"client": "acme"
}
}
'import requests
url = "https://api.omnirelay.ai/v1/manage/keys/{id}"
payload = {
"name": "Acme production",
"defaultTags": { "client": "acme" }
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({name: 'Acme production', defaultTags: {client: 'acme'}})
};
fetch('https://api.omnirelay.ai/v1/manage/keys/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"ok": true
}{
"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>"
}{
"error": {
"code": "model_unavailable",
"message": "The model does not exist or is disabled.",
"type": "not_found_error",
"param": "<string>"
},
"request_id": "<string>"
}管理 API
修改 API Key
修改所有者 Key 的指定字段,省略字段保持不变。预算使用单独的预算接口。
PATCH
/
v1
/
manage
/
keys
/
{id}
修改 API Key
curl --request PATCH \
--url https://api.omnirelay.ai/v1/manage/keys/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Acme production",
"defaultTags": {
"client": "acme"
}
}
'import requests
url = "https://api.omnirelay.ai/v1/manage/keys/{id}"
payload = {
"name": "Acme production",
"defaultTags": { "client": "acme" }
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({name: 'Acme production', defaultTags: {client: 'acme'}})
};
fetch('https://api.omnirelay.ai/v1/manage/keys/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"ok": true
}{
"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>"
}{
"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。
路径参数
Pattern:
^[A-Za-z0-9-]{1,80}$请求体
application/json
Required string length:
1 - 60Maximum string length:
80Maximum string length:
200未来的 Unix 毫秒时间戳;null 清除到期时间。
精确模型 ID 或 provider/* 规则;null 允许工作空间所有已开通模型,空数组无效。
Required array length:
1 - 50 elements响应
请求成功。