import requests
url = "https://platform.ankra.app/api/v1/org/account/ai-keys/{key_id}"
payload = { "label": "<string>" }
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({label: '<string>'})
};
fetch('https://platform.ankra.app/api/v1/org/account/ai-keys/{key_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request PATCH \
--url https://platform.ankra.app/api/v1/org/account/ai-keys/{key_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"label": "<string>"
}
'{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"provider": "anthropic",
"label": "<string>",
"key_preview": "<string>",
"position": 1,
"status": "active",
"retry_after": "2023-11-07T05:31:56Z",
"last_used_at": "2023-11-07T05:31:56Z",
"created_at": "2023-11-07T05:31:56Z"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Rename an AI key
Changes the label shown beside the key. Requires your own personal access token: a service account’s token and an MCP-scoped token are refused, and so is a token whose scopes allow no changes.
import requests
url = "https://platform.ankra.app/api/v1/org/account/ai-keys/{key_id}"
payload = { "label": "<string>" }
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({label: '<string>'})
};
fetch('https://platform.ankra.app/api/v1/org/account/ai-keys/{key_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request PATCH \
--url https://platform.ankra.app/api/v1/org/account/ai-keys/{key_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"label": "<string>"
}
'{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"provider": "anthropic",
"label": "<string>",
"key_preview": "<string>",
"position": 1,
"status": "active",
"retry_after": "2023-11-07T05:31:56Z",
"last_used_at": "2023-11-07T05:31:56Z",
"created_at": "2023-11-07T05:31:56Z"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Headers
Path Parameters
Body
Surrounding spaces are trimmed; an empty label clears it.
100Response
The renamed key
One AI provider key on your profile. The key itself is never returned.
anthropic, openrouter Your name for the key; empty when you gave none.
100The key's provider prefix and last four characters, such as sk-ant-...1234.
Where the key sits in the order your work tries keys, starting at 0.
x >= 0active keys are used. out_of_credit keys ran out of balance and are tried again after retry_after. rejected keys were refused by their provider and stay unused until a test passes.
active, out_of_credit, rejected When an out_of_credit key is next tried; null otherwise.
When the key last served a request, to the minute; null if never.