Launch Week 3: Five days of launches

Project

Every Project method in the Confident AI Python and TypeScript SDKs.

Overview

The Confident AI SDK exposes every Project method on the platform. This page documents how to call these methods in all supported languages. See the introduction to install the SDK and set your API key.

Project

client.project() returns a Project object that stands for one project. This object stores the fields listed below, and passes the project's id to every method called on it, so you don't need to pass the id nor the stored fields as arguments.

from confident_ai import ConfidentAI

client = ConfidentAI()

project = client.project(project_id="<PROJECT-ID>")

Properties

These are the fields a Project stores. A method that loads the project fills them in, and a method that saves it sends whichever of them you have set, so set them before you save and read them after you load.

ParameterTypeDescription
project_idOptional[str]The id of the project. It must belong to the organization your API key is scoped to.
idOptional[str]The id of the project, generated by Confident AI.
nameOptional[str]The name of the project, unique within the organization.
descriptionOptional[str]What the project covers, or null when it has no description.
organization_idOptional[str]The id of the organization the project belongs to.
created_atOptional[str]When the project was created.
governance_policyOptional[ProjectGovernancePolicy]The governance policy the project is enrolled in, or null when it is not enrolled. See ProjectGovernancePolicy.

Methods

Delete Project

Permanently deletes a project. This cannot be undone, and it cascades to everything held under it: API keys (including one an SDK may be configured with), members and role assignments, invitations, datasets, prompts, metrics, test runs, dashboards, annotation queues, red teaming frameworks, policies, alerts and export schedules. Ingested traces and spans stop being reachable. There is no confirmation step, so the safe way to retire a project is to deactivate its API keys first. Its name becomes available for reuse.

from confident_ai import ConfidentAI

client = ConfidentAI()

project = client.project(project_id="<PROJECT-ID>")
result = project.delete()

For async mode, call a_delete and await it as shown below:

result = await project.a_delete(...)

Returns

This method returns an object of type ProjectRef.

List Permissions

Lists every project permission a project policy can grant. Each is named resource:action — dataset:read, golden:create — and its id is what you send in a policy's permissionIds. This is Confident AI's whole project catalog, not only the permissions this project already uses, and it is the same catalog for every project in your organization. Organization permissions are a separate catalog with its own endpoint.

from confident_ai import ConfidentAI

client = ConfidentAI()

project = client.project(project_id="<PROJECT-ID>")
result = project.list_permissions()

For async mode, call a_list_permissions and await it as shown below:

result = await project.a_list_permissions(...)

Returns

This method returns an object of type PermissionList.

Update Model Credentials

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. A provider your organization's model provider policy does not allow cannot have a credential set (403), though clearing one is always permitted.

from confident_ai import ConfidentAI
from confident_ai.common import ModelProvider

client = ConfidentAI()

project = client.project(project_id="<PROJECT-ID>")
result = project.update_model_credentials(
    provider=ModelProvider.OPEN_AI,
    api_key="sk-proj-a1B2c3D4e5F6g7H8i9J0kLmN",
    model_config={
        "azureApiBase": "https://acme.openai.azure.com",
        "azureDeploymentName": "gpt-4o",
        "azureApiVersion": "2024-06-01",
        "azureApiKey": "b7f3c9d1e5a24f8090c6d4b2a1e8f37c"
    },
)

For async mode, call a_update_model_credentials and await it as shown below:

result = await project.a_update_model_credentials(...)

Parameters

ParameterTypeDescription
providerModelProviderRequired. See ModelProvider.
api_keyOptional[str]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.
model_configOptional[Dict[str, Any]]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.

Returns

This method returns an object of type ModelCredentials.

Get Project

Retrieves a single project by id, including the governance policy it is enrolled in. A project in another organization is reported as not found rather than as forbidden.

from confident_ai import ConfidentAI

client = ConfidentAI()

project = client.project(project_id="<PROJECT-ID>")
result = project.get()

For async mode, call a_get and await it as shown below:

result = await project.a_get(...)

Returns

This method returns an object of type Project.

Update Project

Renames a project or changes its description, and returns the project as stored. Send at least one field; a field you omit is left as it is.

from confident_ai import ConfidentAI

client = ConfidentAI()

project = client.project(project_id="<PROJECT-ID>")
result = project.update()

For async mode, call a_update and await it as shown below:

result = await project.a_update(...)

Returns

This method returns an object of type Project.

Methods (Stateless)

These methods take every argument themselves, so a caller reaches them through client.projects without opening a Project first.

List Projects

Lists every project in your organization, ordered by name. Each project is returned in full, including the governance policy it is enrolled in, so a caller building a project picker does not need a second call per row.

from confident_ai import ConfidentAI

client = ConfidentAI()

result = client.projects.list()

For async mode, call a_list and await it as shown below:

result = await client.projects.a_list(...)

Returns

This method returns an object of type ProjectList.

Create Project

Creates a project in your organization and provisions a project-scoped API key for it. The key's full value is returned once, in this response, and is redacted on every later read — so capture it here. The project is seeded with Confident AI's default classifiers, online metric and trace alert. How many projects you may hold depends on your plan, so this can be refused on entitlement grounds even when the name is free.

from confident_ai import ConfidentAI

client = ConfidentAI()

result = client.projects.create(
    name="Customer Support Agent",
    description="The support chatbot serving acme.com.",
    email="jane@acme.com",
)

For async mode, call a_create and await it as shown below:

result = await client.projects.a_create(...)

Parameters

ParameterTypeDescription
namestrRequired. The name of the project, which must not already be taken by another project in the organization.
descriptionOptional[str]What the project covers. Omit it to leave it unset.
emailOptional[str]The email of an existing member of your organization to assign as the project's Owner, which also attributes the provisioned API key to them. Omit it and the project has no

Returns

This method returns an object of type CreateProjectResult.

Get Project

Retrieves a single project by id, including the governance policy it is enrolled in. A project in another organization is reported as not found rather than as forbidden.

from confident_ai import ConfidentAI

client = ConfidentAI()

result = client.projects.get(project_id="<PROJECT-ID>")

For async mode, call a_get and await it as shown below:

result = await client.projects.a_get(...)

Parameters

ParameterTypeDescription
project_idstrRequired. The id of the project. It must belong to the organization your API key is scoped to.

Returns

This method returns an object of type Project.

Update Project

Renames a project or changes its description, and returns the project as stored. Send at least one field; a field you omit is left as it is.

from confident_ai import ConfidentAI

client = ConfidentAI()

result = client.projects.update(
    project_id="<PROJECT-ID>",
    name="Customer Support Agent",
    description="The support chatbot serving acme.com.",
)

For async mode, call a_update and await it as shown below:

result = await client.projects.a_update(...)

Parameters

ParameterTypeDescription
project_idstrRequired. The id of the project. It must belong to the organization your API key is scoped to.
nameOptional[str]The name of the project, which must not already be taken by another project in the organization.
descriptionOptional[str]What the project covers.

Returns

This method returns an object of type Project.

Delete Project

Permanently deletes a project. This cannot be undone, and it cascades to everything held under it: API keys (including one an SDK may be configured with), members and role assignments, invitations, datasets, prompts, metrics, test runs, dashboards, annotation queues, red teaming frameworks, policies, alerts and export schedules. Ingested traces and spans stop being reachable. There is no confirmation step, so the safe way to retire a project is to deactivate its API keys first. Its name becomes available for reuse.

from confident_ai import ConfidentAI

client = ConfidentAI()

result = client.projects.delete(project_id="<PROJECT-ID>")

For async mode, call a_delete and await it as shown below:

result = await client.projects.a_delete(...)

Parameters

ParameterTypeDescription
project_idstrRequired. The id of the project. It must belong to the organization your API key is scoped to.

Returns

This method returns an object of type ProjectRef.

Update Model Credentials

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. A provider your organization's model provider policy does not allow cannot have a credential set (403), though clearing one is always permitted.

from confident_ai import ConfidentAI
from confident_ai.common import ModelProvider

client = ConfidentAI()

result = client.projects.update_model_credentials(
    project_id="<PROJECT-ID>",
    provider=ModelProvider.OPEN_AI,
    api_key="sk-proj-a1B2c3D4e5F6g7H8i9J0kLmN",
    model_config={
        "azureApiBase": "https://acme.openai.azure.com",
        "azureDeploymentName": "gpt-4o",
        "azureApiVersion": "2024-06-01",
        "azureApiKey": "b7f3c9d1e5a24f8090c6d4b2a1e8f37c"
    },
)

For async mode, call a_update_model_credentials and await it as shown below:

result = await client.projects.a_update_model_credentials(...)

Parameters

ParameterTypeDescription
project_idstrRequired. The id of the project, which must belong to the organization your API key is scoped to.
providerModelProviderRequired. See ModelProvider.
api_keyOptional[str]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.
model_configOptional[Dict[str, Any]]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.

Returns

This method returns an object of type ModelCredentials.

List Permissions

Lists every project permission a project policy can grant. Each is named resource:action — dataset:read, golden:create — and its id is what you send in a policy's permissionIds. This is Confident AI's whole project catalog, not only the permissions this project already uses, and it is the same catalog for every project in your organization. Organization permissions are a separate catalog with its own endpoint.

from confident_ai import ConfidentAI

client = ConfidentAI()

result = client.projects.list_permissions(project_id="<PROJECT-ID>")

For async mode, call a_list_permissions and await it as shown below:

result = await client.projects.a_list_permissions(...)

Parameters

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

Returns

This method returns an object of type PermissionList.

Types

CreateProjectResult

The created project and the API key provisioned with it. The key's value is not retrievable afterwards, so read it out of this response.

class CreateProjectResult:
    project: ProjectSummary
    api_key: Optional[ProjectDefaultApiKey] = Field(alias="apiKey")

projectProjectSummaryRequired

api_keyOptional[ProjectDefaultApiKey]Required

The project-scoped API key provisioned with the project, carrying its full value for the only time. Null only if no key was provisioned.

See ProjectDefaultApiKey.

ModelCredentials

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.

class ModelCredentials:
    id: str
    open_ai_api_key: Optional[str] = Field(alias="openAiApiKey")
    anthropic_api_key: Optional[str] = Field(alias="anthropicApiKey")
    gemini_api_key: Optional[str] = Field(alias="geminiApiKey")
    x_ai_api_key: Optional[str] = Field(alias="xAiApiKey")
    deep_seek_api_key: Optional[str] = Field(alias="deepSeekApiKey")
    mistral_api_key: Optional[str] = Field(alias="mistralApiKey")
    perplexity_api_key: Optional[str] = Field(alias="perplexityApiKey")
    type_safe_api_key: Optional[str] = Field(alias="typeSafeApiKey")
    fal_api_key: Optional[str] = Field(alias="falApiKey")
    bedrock_model_config: Optional[Dict[str, Any]] = Field(alias="bedrockModelConfig")
    vertex_ai_model_config: Optional[Dict[str, Any]] = Field(alias="vertexAiModelConfig")
    azure_model_config: Optional[Dict[str, Any]] = Field(alias="azureModelConfig")
    port_key_config: Optional[Dict[str, Any]] = Field(alias="portKeyConfig")
    open_router_config: Optional[Dict[str, Any]] = Field(alias="openRouterConfig")
    true_foundry_config: Optional[Dict[str, Any]] = Field(alias="trueFoundryConfig")
    lite_llm_config: Optional[Dict[str, Any]] = Field(alias="liteLlmConfig")
    hugging_face_config: Optional[Dict[str, Any]] = Field(alias="huggingFaceConfig")
    organization_id: Optional[str] = Field(alias="organizationId")

idstrRequired

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

Example: "<MODEL-CREDENTIALS-ID>"

open_ai_api_keyOptional[str]Required

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

Example: "***************Yz7Kq2"

anthropic_api_keyOptional[str]Required

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

gemini_api_keyOptional[str]Required

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

x_ai_api_keyOptional[str]Required

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

deep_seek_api_keyOptional[str]Required

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

mistral_api_keyOptional[str]Required

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

perplexity_api_keyOptional[str]Required

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

type_safe_api_keyOptional[str]Required

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

fal_api_keyOptional[str]Required

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

bedrock_model_configOptional[Dict[str, Any]]Required

The stored Amazon Bedrock configuration — access keys, an assumed IAM role, or a Mantle API key — with its secret fields masked, or null when none is stored.

vertex_ai_model_configOptional[Dict[str, Any]]Required

The stored Vertex AI configuration, with its secret fields masked, or null when none is stored.

azure_model_configOptional[Dict[str, Any]]Required

The stored Azure OpenAI configuration, with its secret fields masked, or null when none is stored.

Example: {"azureApiBase":"https://acme.openai.azure.com","azureDeploymentName":"gpt-4o","azureApiVersion":"2024-06-01","azureApiKey":"***************Yz7Kq2"}

port_key_configOptional[Dict[str, Any]]Required

The stored Portkey configuration, with its secret fields masked, or null when none is stored.

open_router_configOptional[Dict[str, Any]]Required

The stored OpenRouter configuration, with its secret fields masked, or null when none is stored.

true_foundry_configOptional[Dict[str, Any]]Required

The stored TrueFoundry configuration, with its secret fields masked, or null when none is stored.

lite_llm_configOptional[Dict[str, Any]]Required

The stored LiteLLM configuration, with its secret fields masked, or null when none is stored.

hugging_face_configOptional[Dict[str, Any]]Required

The stored Hugging Face configuration, with its secret fields masked, or null when none is stored.

organization_idOptional[str]Required

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

Example: "<ORGANIZATION-ID>"

ModelProvider

This is the provider of the model.

class ModelProvider(Enum):
    OPEN_AI = "OPEN_AI"
    CUSTOM = "CUSTOM"
    CONFIDENT_AI = "CONFIDENT_AI"
    BEDROCK = "BEDROCK"
    ANTHROPIC = "ANTHROPIC"
    GEMINI = "GEMINI"
    X_AI = "X_AI"
    DEEPSEEK = "DEEPSEEK"
    MOONSHOT_AI = "MOONSHOT_AI"
    VERTEX_AI = "VERTEX_AI"
    AZURE = "AZURE"
    MISTRAL = "MISTRAL"
    PERPLEXITY = "PERPLEXITY"
    OPEN_ROUTER = "OPEN_ROUTER"
    PORTKEY = "PORTKEY"
    LITE_LLM = "LITE_LLM"
    TRUE_FOUNDRY = "TRUE_FOUNDRY"
    HUGGING_FACE = "HUGGING_FACE"
    TYPE_SAFE = "TYPE_SAFE"
    FAL = "FAL"

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

Permission

One thing a policy can allow. Permissions are never granted to a member directly: a policy names a set of them, a role holds policies, and a member holds roles.

class Permission:
    id: str
    name: str
    description: Optional[str]

idstrRequired

The id of the permission, generated by Confident AI. This is what a policy references in its permissionIds.

Example: "<PERMISSION-ID>"

namestrRequired

The permission, written as resource:action — the resource it applies to, then what it allows on it. read grants viewing, manage grants creating and updating, and create, update and delete appear where a resource distinguishes them.

Example: "user:read"

descriptionOptional[str]Required

What the permission allows, in prose, or null when it has none. Confident AI creates these permissions from its own catalog and does not describe them, so this is null unless someone has filled it in.

PermissionList

The complete set of permissions a policy in this scope can grant, taken from Confident AI's own catalog rather than from what your organization happens to use already.

class PermissionList:
    permissions: List[Permission]

permissionsList[Permission]Required

Every permission in the catalog for this scope, in no particular order.

See Permission.

Project

A workspace inside your organization. A project owns its own API keys, members, datasets, prompts, metrics and traces, and every project-scoped endpoint reads and writes within exactly one of them.

class Project:
    id: str
    name: str
    description: Optional[str]
    organization_id: str = Field(alias="organizationId")
    created_at: str
    governance_policy: Optional[ProjectGovernancePolicy] = Field(alias="governancePolicy")

idstrRequired

The id of the project, generated by Confident AI.

Example: "<PROJECT-ID>"

namestrRequired

The name of the project, unique within the organization.

Example: "Customer Support Agent"

descriptionOptional[str]Required

What the project covers, or null when it has no description.

Example: "The support chatbot serving acme.com."

organization_idstrRequired

The id of the organization the project belongs to.

Example: "<ORGANIZATION-ID>"

created_atstrRequired

When the project was created.

Example: "2025-01-14T09:30:00+00:00"

governance_policyOptional[ProjectGovernancePolicy]Required

The governance policy the project is enrolled in, or null when it is not enrolled.

See ProjectGovernancePolicy.

ProjectDefaultApiKey

The project-scoped API key provisioned alongside a new project, returned with its full value exactly once. This is the key an SDK config gets, and it is the credential the project's own data endpoints authenticate with — the organization key you created the project with cannot reach them.

class ProjectDefaultApiKey:
    id: int
    name: Optional[str]
    valid: bool
    value: str
    shadow_value: Optional[str] = Field(alias="shadowValue")
    rotates_at: Optional[str] = Field(alias="rotatesAt")
    created_at: str
    last_used: Optional[str] = Field(alias="lastUsed")
    expires_at: Optional[str] = Field(alias="expiresAt")

idintRequired

The id of the API key, generated by Confident AI. Pass it as apiKeyId when deactivating or rotating the key.

Example: 1041

nameOptional[str]Required

The label the key is listed under.

Example: "Default Key"

validboolRequired

Whether the key is active. A deactivated key is rejected on authentication.

Example: true

valuestrRequired

The full, unmasked key. This is the only response that ever carries it — every later read of this key redacts it to its last six characters — so store it now.

Example: "confident_us_proj_KZ0m8vQ2sVxT1bR4dYnJ6hLpA3wUcE9f"

shadow_valueOptional[str]Required

The replacement value while a rotation's grace period is running. Always null on a freshly provisioned key, since nothing has been rotated yet.

rotates_atOptional[str]Required

When a pending rotation completes and shadowValue replaces value, or null when no rotation is pending.

created_atstrRequired

When the key was created.

Example: "2025-01-14T09:30:00+00:00"

last_usedOptional[str]Required

When the key was last used to authenticate, or null if it has never been used.

expires_atOptional[str]Required

When the key expires, or null if it never expires. A provisioned key never expires; create your own key with expiresInDays if you want one that does.

ProjectGovernancePolicy

The governance policy a project is enrolled in, named rather than resolved. Retrieve the policy itself to see the controls it enforces.

class ProjectGovernancePolicy:
    id: str
    name: str

idstrRequired

The id of the governance policy, generated by Confident AI.

Example: "<GOVERNANCE-POLICY-ID>"

namestrRequired

The name of the governance policy.

Example: "EU AI Act"

ProjectList

The organization's projects. The list is not paginated: every project is returned.

class ProjectList:
    projects: List[Project]

projectsList[Project]Required

Every project in the organization, ordered by name.

See Project.

ProjectRef

Confirmation that the project was deleted.

class ProjectRef:
    id: str

idstrRequired

The id of the project that was deleted.

Example: "<PROJECT-ID>"

ProjectSummary

A project's own fields, without its governance enrollment. This is the shape create returns, where the project cannot yet be enrolled in a policy.

class ProjectSummary:
    id: str
    name: str
    description: Optional[str]
    organization_id: str = Field(alias="organizationId")
    created_at: str

idstrRequired

The id of the project, generated by Confident AI.

Example: "<PROJECT-ID>"

namestrRequired

The name of the project, unique within the organization.

Example: "Customer Support Agent"

descriptionOptional[str]Required

What the project covers, or null when it has no description.

Example: "The support chatbot serving acme.com."

organization_idstrRequired

The id of the organization the project belongs to.

Example: "<ORGANIZATION-ID>"

created_atstrRequired

When the project was created.

Example: "2025-01-14T09:30:00+00:00"

Building a production pipeline?Design a scalable API workflow for evals, datasets, traces, and promptsTalk to an engineer

Last updated on

Built byConfident AI