Launch Week 3: Five days of launches

Set Project Model Credentials

(v2)

PUT

Sets, replaces, or clears a project's stored credential for a single model provider. While the project is still inheriting your organization's credentials, the first write creates a standalone set for the project and severs that inheritance — so the project then holds only the provider you just sent, and any other provider it relied on has to be set again 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.

PUT/v2/projects/{projectId}/model-credentials
curl -X PUT "https://api.confident-ai.com/v2/projects/{projectId}/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"
  }
}'
200
{
  "success": true,
  "data": {
    "id": "<MODEL-CREDENTIALS-ID>",
    "openAiApiKey": "***************Yz7Kq2",
    "anthropicApiKey": null,
    "geminiApiKey": null,
    "xAiApiKey": null,
    "deepSeekApiKey": null,
    "mistralApiKey": null,
    "perplexityApiKey": 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_KEYstringRequired

    The organization API key for your Confident AI organization.

Path parameters

  • projectIdstringRequired

    The id of the project, which must belong to the organization your API key is scoped to.

Request body

  • providerenumRequired

    This is the provider of the model.

    Show 20 enum valuesHide 20 enum values
    • OPEN_AI
    • CUSTOM
    • CONFIDENT_AI
    • BEDROCK
    • ANTHROPIC
    • GEMINI
    • X_AI
    • DEEPSEEK
    • MOONSHOT_AI
    • VERTEX_AI
    • AZURE
    • MISTRAL
    • PERPLEXITY
    • OPEN_ROUTER
    • PORTKEY
    • LITE_LLM
    • TRUE_FOUNDRY
    • HUGGING_FACE
    • TYPE_SAFE
    • FAL
  • apiKeystring | null

    The provider's API key, for the API-key providers only. Send the raw secret to set it, or null to clear it; a masked value read back from a response is rejected. Sending it for a configuration provider is rejected.

  • modelConfigobject | null

    The provider's configuration, for the configuration providers only — for example azureApiBase, azureDeploymentName, azureApiVersion and azureApiKey for AZURE. It replaces the stored configuration wholesale rather than merging into it, so send every key the provider needs; send null to 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 send 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, an optional apiBase, and an optional projectId (sent as the OpenAI-Project header 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 Project Model Credentials succeeded.

  • successboolean

    Indicates if the request was successful.

  • dataobject

    One 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 null when no credential is stored for that provider.

    Show 19 propertiesHide 19 properties
    • idstring

      The id of the credentials record, generated by Confident AI. A project that inherits the organization's credentials shares this id with it.

    • openAiApiKeystring | null

      The stored OpenAI API key, masked, or null when none is stored.

    • anthropicApiKeystring | null

      The stored Anthropic API key, masked, or null when none is stored.

    • geminiApiKeystring | null

      The stored Gemini API key, masked, or null when none is stored.

    • xAiApiKeystring | null

      The stored xAI API key, masked, or null when none is stored.

    • deepSeekApiKeystring | null

      The stored DeepSeek API key, masked, or null when none is stored.

    • mistralApiKeystring | null

      The stored Mistral API key, masked, or null when none is stored.

    • perplexityApiKeystring | null

      The stored Perplexity API key, masked, or null when none is stored.

    • typeSafeApiKeystring | null

      The stored TypeSafe API key, masked, or null when none is stored.

    • falApiKeystring | null

      The stored fal API key, masked, or null when none is stored. It powers the speech-to-speech simulated caller.

    • bedrockModelConfigobject | null

    • vertexAiModelConfigobject | null

    • azureModelConfigobject | null

    • portKeyConfigobject | null

    • openRouterConfigobject | null

    • trueFoundryConfigobject | null

    • liteLlmConfigobject | null

    • huggingFaceConfigobject | null

    • organizationIdstring | null

      The id of the organization these credentials belong to, or null when they belong to a single project.

  • deprecatedboolean

    Indicates if this endpoint is deprecated.

Built byConfident AI