Launch Week 02 wrapped — explore all five launches

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.

PUT/v1/organization/model-credentials
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"
}'
200
{
  "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_KEYstringRequired

    The organization API key for your Confident AI organization.

Request body

  • providerenumRequired

    The model provider whose credentials are being set. OPEN_AI, ANTHROPIC, GEMINI, X_AI, DEEPSEEK, MISTRAL, and PERPLEXITY authenticate with a single apiKey; the remaining providers take a modelConfig object instead.

    Show 15 enum valuesHide 15 enum values
    • OPEN_AI
    • ANTHROPIC
    • GEMINI
    • X_AI
    • DEEPSEEK
    • MISTRAL
    • PERPLEXITY
    • BEDROCK
    • VERTEX_AI
    • AZURE
    • PORTKEY
    • OPEN_ROUTER
    • TRUE_FOUNDRY
    • LITE_LLM
    • HUGGING_FACE
  • apiKeystring

    The provider's API key, for API-key providers only. Pass a string to set it or null to clear it. Always send the raw secret; redacted placeholder values are rejected.

  • modelConfigobject

    The provider's configuration object, for config providers only (for example azureApiBase, azureDeploymentName, azureApiVersion, and azureApiKey for AZURE). For BEDROCK, always pass regionName and modelId, then authenticate with either ACCESS_KEYS (awsAccessKeyId and awsSecretAccessKey) or, when calling the OpenAI-compatible Mantle API by setting api to MANTLE, an authType of API_KEY together with apiKey and an optional apiBase; 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; pass null to clear it. Must not be empty and must not contain redacted placeholder values.

Response

  • successboolean

    Indicates if the request was successful

  • dataobject

    Show 1 propertyHide 1 property
    • modelCredentialsobject

      The 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
      • idstring

        Unique identifier of the credentials record

      • openAiApiKeystring

        Redacted OpenAI API key

      • anthropicApiKeystring

        Redacted Anthropic API key

      • geminiApiKeystring

        Redacted Gemini API key

      • xAiApiKeystring

        Redacted xAI API key

      • deepSeekApiKeystring

        Redacted DeepSeek API key

      • mistralApiKeystring

        Redacted Mistral API key

      • perplexityApiKeystring

        Redacted Perplexity API key

      • bedrockModelConfigobject

        Amazon Bedrock configuration (access keys, an assumed IAM role, or a Mantle API key), with secret fields redacted

      • vertexAiModelConfigobject

        Vertex AI configuration, with secret fields redacted

      • azureModelConfigobject

        Azure OpenAI configuration, with secret fields redacted

      • portKeyConfigobject

        Portkey configuration, with secret fields redacted

      • openRouterConfigobject

        OpenRouter configuration, with secret fields redacted

      • trueFoundryConfigobject

        TrueFoundry configuration, with secret fields redacted

      • liteLlmConfigobject

        LiteLLM configuration, with secret fields redacted

      • huggingFaceConfigobject

        Hugging Face configuration, with secret fields redacted

      • organizationIdstring

        Set when the credentials belong to the organization; null when they belong to a single project

Built byConfident AI