Set Organization Model Credentials
PUThttps://api.confident-ai.com/v1/organization/model-credentials
Sets, replaces, or clears the organization's stored credential for a single model provider. Projects that inherit from the organization use these credentials for their evaluation and platform models.
This is a write-only surface: there is no read endpoint, and every response returns the credentials redacted. For API-key providers pass apiKey; for config providers pass modelConfig, which replaces the stored configuration wholesale. Pass null in either field to clear the stored credential. Providers blocked by the organization's model provider policy cannot have credentials set (403); clearing is always allowed.
curl -X PUT "https://api.confident-ai.com/v1/organization/model-credentials" \
-H "CONFIDENT_API_KEY: <ORGANIZATION-API-KEY>" \
-H "Content-Type: application/json" \
-d '{
"provider": "OPEN_AI",
"apiKey": "sk-proj-f7e6d5c4b3a2918273645a1b2c3"
}'{
"success": true,
"data": {
"modelCredentials": {
"id": "0b2e6d3f-9c1a-4e5b-8d7f-a1b2c3d4e5f6",
"openAiApiKey": "***************a1b2c3",
"anthropicApiKey": null,
"geminiApiKey": null,
"xAiApiKey": null,
"deepSeekApiKey": null,
"mistralApiKey": null,
"perplexityApiKey": null,
"bedrockModelConfig": null,
"vertexAiModelConfig": null,
"azureModelConfig": null,
"portKeyConfig": null,
"openRouterConfig": null,
"trueFoundryConfig": null,
"liteLlmConfig": null,
"huggingFaceConfig": null,
"organizationId": "c290fdd8-6a02-4056-b4d9-3459a4dcbd9e"
}
}
}Headers
CONFIDENT_API_KEYstringRequiredThe organization API key for your Confident AI organization.
Request body
providerenumRequiredThe model provider whose credentials are being set.
OPEN_AI,ANTHROPIC,GEMINI,X_AI,DEEPSEEK,MISTRAL, andPERPLEXITYauthenticate with a singleapiKey; the remaining providers take amodelConfigobject instead.Show 15 enum valuesHide 15 enum values
OPEN_AIANTHROPICGEMINIX_AIDEEPSEEKMISTRALPERPLEXITYBEDROCKVERTEX_AIAZUREPORTKEYOPEN_ROUTERTRUE_FOUNDRYLITE_LLMHUGGING_FACE
apiKeystringThe provider's API key, for API-key providers only. Pass a string to set it or
nullto clear it. Always send the raw secret; redacted placeholder values are rejected.modelConfigobjectThe provider's configuration object, for config providers only (for example
azureApiBase,azureDeploymentName,azureApiVersion, andazureApiKeyforAZURE). ForBEDROCK, always passregionNameandmodelId, then authenticate with eitherACCESS_KEYS(awsAccessKeyIdandawsSecretAccessKey) or, when calling the OpenAI-compatible Mantle API by settingapitoMANTLE, anauthTypeofAPI_KEYtogether withapiKeyand an optionalapiBase; an API key only works with the Mantle API, and assume-role Bedrock configurations can only be managed in the app. Replaces the stored configuration entirely; passnullto clear it. Must not be empty and must not contain redacted placeholder values.
Response
successbooleanIndicates if the request was successful
dataobjectShow 1 propertyHide 1 property
modelCredentialsobjectThe stored credentials for the organization or project. Secrets are always redacted in responses; API keys and secret config fields are masked down to their last 6 characters, and full values can never be retrieved once set.
Show 17 propertiesHide 17 properties
idstringUnique identifier of the credentials record
openAiApiKeystringRedacted OpenAI API key
anthropicApiKeystringRedacted Anthropic API key
geminiApiKeystringRedacted Gemini API key
xAiApiKeystringRedacted xAI API key
deepSeekApiKeystringRedacted DeepSeek API key
mistralApiKeystringRedacted Mistral API key
perplexityApiKeystringRedacted Perplexity API key
bedrockModelConfigobjectAmazon Bedrock configuration (access keys, an assumed IAM role, or a Mantle API key), with secret fields redacted
vertexAiModelConfigobjectVertex AI configuration, with secret fields redacted
azureModelConfigobjectAzure OpenAI configuration, with secret fields redacted
portKeyConfigobjectPortkey configuration, with secret fields redacted
openRouterConfigobjectOpenRouter configuration, with secret fields redacted
trueFoundryConfigobjectTrueFoundry configuration, with secret fields redacted
liteLlmConfigobjectLiteLLM configuration, with secret fields redacted
huggingFaceConfigobjectHugging Face configuration, with secret fields redacted
organizationIdstringSet when the credentials belong to the organization;
nullwhen they belong to a single project