Test a saved AI provider key
Send your saved key one one-token request and learn whether the provider accepts it. Never echoes the key or the reply. Beta.
Test a saved AI provider key
curl --request POST \
--url https://app.mithunai.com/mithunai/api/v1/model-keys/test \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"provider": "<string>"
}
'import requests
url = "https://app.mithunai.com/mithunai/api/v1/model-keys/test"
payload = { "provider": "<string>" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({provider: '<string>'})
};
fetch('https://app.mithunai.com/mithunai/api/v1/model-keys/test', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"provider": "<string>",
"ok": true,
"code": "<string>",
"message": "<string>"
}Sends your saved key one request for a single token, to the provider’s cheapest catalogued model, and says whether the provider accepted it. The call is billed by the provider to your own account, like any other use of the key. Beta.
Owner or admin only (
credential.manage), from a signed-in console session. No key saved for the provider returns 409 with the code model_key_missing.
string
required
openai, anthropic or google.Response
string
required
The provider tested.
boolean
required
true when the provider answered.string
When
ok is false: the error code, such as model_key_rejected when the provider refused the key.string
When
ok is false: a message that includes the provider’s HTTP status. Never the provider’s own
text and never the key.Last modified on November 12, 2026
Test a saved AI provider key
curl --request POST \
--url https://app.mithunai.com/mithunai/api/v1/model-keys/test \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"provider": "<string>"
}
'import requests
url = "https://app.mithunai.com/mithunai/api/v1/model-keys/test"
payload = { "provider": "<string>" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({provider: '<string>'})
};
fetch('https://app.mithunai.com/mithunai/api/v1/model-keys/test', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"provider": "<string>",
"ok": true,
"code": "<string>",
"message": "<string>"
}