API Keys
Provision and rotate organization- and project-scoped API keys.
Overview
API keys authenticate requests to Confident AI, and come in two scopes:
- Organization API keys authenticate at the organization level. They’re used for account-wide administration — including every management method in this SDK.
- Project API keys are scoped to a single project. They’re the keys your application uses to send traces and run evaluations against that project.
Use the Admin SDK to list, create, enable, disable, and delete keys at either scope.
The full secret value of an API key is only returned when it is created. Subsequent reads return a masked value, so store the secret securely at creation time.
All methods on this page require an Organization API Key. See the Quickstart to create a client.
List API Keys
You can list every API key at the organization or project level, with secret values masked.
Python
TypeScript
Get an API Key
You can retrieve a single API key by its api_key_id, with its secret value masked.
Python
TypeScript
Create an API Key
You can create a new key at the organization or project level. The returned object’s value is the full secret, so store it securely when the key is created.
Python
TypeScript
Enable or Disable an API Key
You can set valid to false to revoke a key without deleting it, or back to true to re-enable it.
Python
TypeScript
Delete an API Key
You can permanently delete an API key by its api_key_id, which immediately revokes it.
Python
TypeScript
Next Steps
Use your keys to authenticate the rest of the platform and SDKs: