> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.mitu.ai/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.mitu.ai/_mcp/server.

# Customer keys

A customer key is a private credential issued to a single customer. The customer adds it to their AI app together with your MCP address, and the app presents it with every request, so each request is attributed to that customer before it reaches your API. Customer keys are always available, whether or not you also offer [OAuth](/platform/your-agent-service/integration/authentication/oauth), and they suit businesses that provision access themselves, serve other businesses, or prefer not to route agents through a consumer sign in page.

A customer key grants access only to your agent service, and only as that customer. It cannot call the Mitu API or access your account, which is what makes it safe to hand to a customer, whereas your own [API keys](/platform/security/keys-and-secrets) must never leave your servers.

## What customer keys provide

1. **Access you control**\
   You decide who receives a key and when, by creating customers from your own systems.
2. **A link to your own records**\
   Each customer carries the reference your system already uses for them, so every request maps directly to an account you know.
3. **Independent credentials**\
   Each customer has their own key, so one can be rotated without affecting any other.

## Issuing a customer key

#### Create the customer

Create the customer from your server with your API key, including the identifier your own system uses for them as the client reference, as described in [Create customer](/api-reference/customers/create-customer). A customer who already exists with the same reference is returned rather than duplicated.

```bash
curl --request POST \
  --url https://api.mitu.ai/v1/customers \
  --header "x-api-key: $MITU_API_KEY" \
  --header "Content-Type: application/json" \
  --data '{
    "client_reference_id": "user_8841",
    "email": "ada@example.com"
  }'
```

#### Issue a key

Issue a key for the customer with a name that helps them recognise it, such as the app they will use it in, and an optional expiry date, as described in [Create key](/api-reference/agent-access/create-customer-key). The response contains the full key and the MCP address the customer connects to, and a customer can hold up to five active keys at once.

```bash
curl --request POST \
  --url https://api.mitu.ai/v1/customers/cus_ds9hazr8jd3l/keys \
  --header "x-api-key: $MITU_API_KEY" \
  --header "Content-Type: application/json" \
  --header "Idempotency-Key: user_8841-claude-key" \
  --data '{ "name": "Claude desktop" }'
```

```json
{
  "message": "Key created successfully",
  "data": {
    "id": "cwk_4m8q2v7x1c9z",
    "name": "Claude desktop",
    "status": "active",
    "key": "<customer_key>",
    "mcp_url": "https://mcp.yourcompany.com"
  }
}
```

#### Deliver the key securely

The key is returned only once and cannot be retrieved later. Deliver it to the customer immediately, through the same secure channel you use for any other credential, such as the account area of your product.

#### Connect from the AI app

The customer adds your MCP address to their AI app together with their key. From then on, the app presents the key in the x-api-key header of every request it sends to your agent service.

#### Identify the customer in your API

Requests forwarded to your API include the customer's Mitu identifier and the client reference you supplied when you created them. After you [verify the request](/platform/security/request-verification), use the client reference to locate the customer in your own system and apply your usual rules.

## Managing keys

A key that is lost or may have been exposed cannot be recovered, and should be replaced. [Rotating a key](/api-reference/agent-access/rotate-customer-key) issues a new key and stops the previous one working in the same request, while [revoking a key](/api-reference/agent-access/revoke-customer-key) stops it without a replacement, and [revoking all keys](/api-reference/agent-access/revoke-all-customer-keys) closes every key a customer holds at once when you cannot tell which one was exposed. Each key also records when it was last used, which you can see by [listing the customer's keys](/api-reference/agent-access/list-customer-keys), and its name or expiry can be changed at any time without replacing it.

## Security considerations

1. **Treat keys as credentials**\
   Never send a key by email in plain text, display it after it has been delivered or record it in logs.
2. **Rotate on any doubt**\
   Rotate a key whenever a customer reports a lost device or you suspect exposure. Rotation affects only that customer.
3. **Never issue your API key instead**\
   A customer must only ever receive their own customer key. Your API key carries the full authority of your account.

Customer keys give every customer a precise, independent route to your business through their agents. Each request is tied to the right account before it reaches your API, and access can be granted or rotated one customer at a time, entirely under your control.