Test an AI key
import requests
url = "https://platform.ankra.app/api/v1/org/account/ai-keys/{key_id}/test"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://platform.ankra.app/api/v1/org/account/ai-keys/{key_id}/test', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request POST \
--url https://platform.ankra.app/api/v1/org/account/ai-keys/{key_id}/test \
--header 'Authorization: Bearer <token>'{
"key": {
"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"
},
"is_valid": true,
"message": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Account
Test an AI key
Asks the provider about the stored key and records the answer: a refused key becomes rejected, an empty balance out_of_credit for an hour, and a passing key active again. An unreachable or rate-limited provider leaves the key as it was. A key the provider refuses still answers 200, with is_valid false. Recording the answer counts as a change. 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.
POST
/
api
/
v1
/
org
/
account
/
ai-keys
/
{key_id}
/
test
Test an AI key
import requests
url = "https://platform.ankra.app/api/v1/org/account/ai-keys/{key_id}/test"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://platform.ankra.app/api/v1/org/account/ai-keys/{key_id}/test', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request POST \
--url https://platform.ankra.app/api/v1/org/account/ai-keys/{key_id}/test \
--header 'Authorization: Bearer <token>'{
"key": {
"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"
},
"is_valid": true,
"message": "<string>"
}{
"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
Response
What the provider said, and the key's recorded state