Save or replace an AI provider key
Store your own OpenAI, Anthropic or Google API key, encrypted for your organisation and never returned. Saving again replaces it. Beta.
Save or replace an AI provider key
curl --request POST \
--url https://app.mithunai.com/mithunai/api/v1/model-keys \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"provider": "<string>",
"api_key": "<string>"
}
'import requests
url = "https://app.mithunai.com/mithunai/api/v1/model-keys"
payload = {
"provider": "<string>",
"api_key": "<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>', api_key: '<string>'})
};
fetch('https://app.mithunai.com/mithunai/api/v1/model-keys', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));Saves your organisation’s own API key for one provider, or replaces the one already saved. The key is encrypted for your organisation and never returned, by this response or any other. It is sent only to that provider’s own API. Beta. See Your own AI provider keys.
Owner or admin only (
credential.manage), from a signed-in console session: an API key is refused with 403. Saving and replacing are recorded in the audit log, without the key. Answers use the key only when your plan is on your own keys.
string
required
openai, anthropic or google. Azure OpenAI is not supported.string
required
The key exactly as the provider showed it, up to 4096 characters. A value that is not a key is
refused with
400, and the message never repeats it.Response
The saved key’sprovider, created_at, updated_at, rotated_at and last_used_at. Never the key.Last modified on November 12, 2026
Save or replace an AI provider key
curl --request POST \
--url https://app.mithunai.com/mithunai/api/v1/model-keys \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"provider": "<string>",
"api_key": "<string>"
}
'import requests
url = "https://app.mithunai.com/mithunai/api/v1/model-keys"
payload = {
"provider": "<string>",
"api_key": "<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>', api_key: '<string>'})
};
fetch('https://app.mithunai.com/mithunai/api/v1/model-keys', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));