Manage workspaces and API keys
Organize your Mistral account with workspaces, API keys, and spending controls.
- Workspaces isolate API keys and usage metrics by team or environment
- API keys are scoped to a workspace for tracking and access control
- Spending limits prevent unexpected costs per workspace
Time to complete: ~10 minutes
Prerequisites
- Admin role in your Mistral organization
- Billing activated (API keys are inactive until a payment method is on file)
Step 1: Create a workspace
Workspaces isolate API keys, usage metrics, and billing. Use them to separate development from production, or to track usage by team.
- Open Admin›Manage › Workspaces ↗.
- Click Create workspace.
- Enter a name: for example,
ProductionorML Research. - Optionally add an icon and description for easy identification.
- Click Create.
Create at least two workspaces (development and production) so test traffic doesn't consume production quotas.
Step 2: Add members to the workspace
Control who has access to each workspace independently.
- Open the workspace you just created.
- Click Add members.
- Select team members from your organization.
- Assign their workspace role:
| Role | Permissions |
|---|---|
| Admin | Full workspace control: manage members, keys, settings |
| Member | Use API keys, view usage: no management access |
- Click Confirm.
Step 3: Generate API keys
Each workspace has its own API keys. We track and bill usage per workspace.
- Open Studio›API keys ↗.
- Select the target workspace from the workspace dropdown.
- Click Create new key.
- Name the key descriptively: for example,
prod-backendorstaging-chatbot. - Copy the key immediately. It's shown only once.
# Set the key as an environment variable
export MISTRAL_API_KEY="your-key-here"Never commit API keys to source control. Use environment variables or a secrets manager to store them.
Step 4: Set usage limits
Prevent unexpected costs by setting monthly spending limits per workspace.
- Open Admin›Subscriptions › Billing ↗.
- Under the workspace, click Set limit.
- Enter a monthly budget in USD: for example,
$500. - When the workspace hits the limit, API requests return
429 Too Many Requestsuntil the next billing cycle.
Monitor real-time usage from the billing dashboard to spot trends before hitting limits.
Verify
Your workspace setup is complete if:
- The workspace appears in the workspace dropdown in Studio ↗
- Team members added to the workspace can see it in their console
- API keys generated for the workspace return successful responses
- Usage appears under the correct workspace in the billing dashboard
Test a key with a quick API call:
curl https://api.mistral.ai/v1/models \
-H "Authorization: Bearer $MISTRAL_API_KEY"A successful response returns a JSON list of available models.