> ## Documentation Index
> Fetch the complete documentation index at: https://docs.mithunai.com/llms.txt
> Use this file to discover all available pages before exploring further.

# 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.

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](https://docs.mithunai.com/administration/model-keys.md).

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.

**provider** `string` *required*

`openai`, `anthropic` or `google`. Azure OpenAI is not supported.

**api\_key** `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's `provider`, `created_at`, `updated_at`, `rotated_at` and `last_used_at`. Never the key.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.