Set Organization Model Credentials
(v2)PUT
Sets, replaces, or clears your organization's stored credential for a single model provider, which every project without credentials of its own then uses. TypeSafe credentials are project scoped and are rejected here. This is a write-only surface: there is no read endpoint, and the response returns every credential masked. For BEDROCK and AZURE it writes the provider's default credential and leaves any other credentials stored on the Confident AI platform in place. A provider your organization's model provider policy does not allow cannot have a credential set (403), though clearing one is always permitted.
curl -X PUT "https://api.confident-ai.com/v2/organization/model-credentials" \
-H "CONFIDENT_API_KEY: <ORGANIZATION-API-KEY>" \
-H "Content-Type: application/json" \
-d '{
"provider": "OPEN_AI",
"apiKey": "sk-proj-a1B2c3D4e5F6g7H8i9J0kLmN",
"modelConfig": {
"azureApiBase": "https://acme.openai.azure.com",
"azureDeploymentName": "gpt-4o",
"azureApiVersion": "2024-06-01",
"azureApiKey": "b7f3c9d1e5a24f8090c6d4b2a1e8f37c"
}
}'{
"success": true,
"data": {
"id": "<MODEL-CREDENTIALS-ID>",
"openAiApiKey": "***************Yz7Kq2",
"anthropicApiKey": null,
"geminiApiKey": null,
"xAiApiKey": null,
"deepSeekApiKey": null,
"mistralApiKey": null,
"perplexityApiKey": null,
"zAiApiKey": null,
"typeSafeApiKey": null,
"falApiKey": null,
"bedrockModelConfig": null,
"vertexAiModelConfig": null,
"azureModelConfig": {
"azureApiBase": "https://acme.openai.azure.com",
"azureDeploymentName": "gpt-4o",
"azureApiVersion": "2024-06-01",
"azureApiKey": "***************Yz7Kq2"
},
"portKeyConfig": null,
"openRouterConfig": null,
"trueFoundryConfig": null,
"liteLlmConfig": null,
"huggingFaceConfig": null,
"organizationId": "<ORGANIZATION-ID>"
},
"deprecated": false
}Headers
CONFIDENT_API_KEYstringRequiredThe organization API key for your Confident AI organization.
Request body
providerenumRequiredThis is the provider of the model.
Show 21 enum valuesHide 21 enum values
OPEN_AICUSTOMCONFIDENT_AIBEDROCKANTHROPICGEMINIX_AIDEEPSEEKMOONSHOT_AIVERTEX_AIAZUREMISTRALPERPLEXITYOPEN_ROUTERPORTKEYLITE_LLMTRUE_FOUNDRYHUGGING_FACETYPE_SAFEFALZ_AI
apiKeystring | nullThe provider's API key, for the API-key providers only. Send the raw secret to set it, or
nullto clear it; a masked value read back from a response is rejected. Sending it for a configuration provider is rejected.modelConfigobject | nullThe provider's configuration, for the configuration providers only — for example
azureApiBase,azureDeploymentName,azureApiVersionandazureApiKeyforAZURE. It replaces the stored configuration wholesale rather than merging into it, so send every key the provider needs; sendnullto clear it. It must not be empty and must not carry masked values read back from a response. Sending it for an API-key provider is rejected.For
BEDROCK, always sendregionNameandmodelId, then authenticate with eitherACCESS_KEYS(awsAccessKeyIdandawsSecretAccessKey) or, when calling the OpenAI-compatible Mantle API by settingapitoMANTLE, anauthTypeofAPI_KEYtogether withapiKey, an optionalapiBase, and an optionalprojectId(sent as theOpenAI-Projectheader so AWS attributes usage and cost to that Mantle project; letters, numbers, hyphens and underscores only). An API key only works with the Mantle API, and assume-role Bedrock configurations can only be managed on the Confident AI platform.
Response
Set Organization Model Credentials succeeded.
successbooleanIndicates if the request was successful.
dataobjectOne provider credential per field, for the whole organization or for a single project. Every secret comes back masked — fifteen asterisks followed by its last six characters, and the same treatment for the secret leaves inside a configuration object — so a stored credential can never be read back in full once it is set. A field is
nullwhen no credential is stored for that provider.Show 20 propertiesHide 20 properties
idstringThe id of the credentials record, generated by Confident AI. A project that inherits the organization's credentials shares this id with it.
openAiApiKeystring | nullThe stored OpenAI API key, masked, or
nullwhen none is stored.anthropicApiKeystring | nullThe stored Anthropic API key, masked, or
nullwhen none is stored.geminiApiKeystring | nullThe stored Gemini API key, masked, or
nullwhen none is stored.xAiApiKeystring | nullThe stored xAI API key, masked, or
nullwhen none is stored.deepSeekApiKeystring | nullThe stored DeepSeek API key, masked, or
nullwhen none is stored.mistralApiKeystring | nullThe stored Mistral API key, masked, or
nullwhen none is stored.perplexityApiKeystring | nullThe stored Perplexity API key, masked, or
nullwhen none is stored.zAiApiKeystring | nullThe stored Z.ai API key, masked, or
nullwhen none is stored. It authenticates GLM models.typeSafeApiKeystring | nullThe stored TypeSafe API key, masked, or
nullwhen none is stored.falApiKeystring | nullThe stored fal API key, masked, or
nullwhen none is stored. It powers the speech-to-speech simulated caller.bedrockModelConfigobject | nullvertexAiModelConfigobject | nullazureModelConfigobject | nullportKeyConfigobject | nullopenRouterConfigobject | nulltrueFoundryConfigobject | nullliteLlmConfigobject | nullhuggingFaceConfigobject | nullorganizationIdstring | nullThe id of the organization these credentials belong to, or
nullwhen they belong to a single project.
deprecatedbooleanIndicates if this endpoint is deprecated.