LLM API Guide

How Do I Set Up Claude User Profiles for API Requests?

Create a customer with POST /v1/user_profiles, save its returned ID, and send that ID in the anthropic-user-profile-id header on subsequent Claude API requests.

A CRT-style routing machine splits API requests through individual user profile modules and a company passthrough module before reconnecting at one model endpoint.
Illustration, AI-generated

Summary

  1. Use application profiles for individual product users and passthrough profiles for companies buying API access.
  2. Profile creation is not idempotent; keep one stored profile ID per customer.
  3. Bedrock attribution uses a request-body field; Google Cloud uses the profile header.
On this page

1. Decide which customer the profile represents

Use profiles to attribute API traffic to customers so safety enforcement can apply to one customer. Anthropic announced the feature on October 20, 2026, with SDK and CLI support in its Platform release notes. To receive enforcement events, follow the steps for setting up organization webhooks.

These are API attribution records, not Claude chat personalization settings. Profiles contain no conversation content, according to the implementation guide.

Choose the entity before creating its record. The Create User Profile reference defines two access types:

What you provide Who gets a profile Value
A product built with Claude Each individual end user application, the default
Resold Claude API access Each customer company passthrough

2. Create the profile during customer onboarding

For the direct Claude API examples, have your Claude Console API key available as ANTHROPIC_API_KEY. An Admin API key is unnecessary. Keep internal traffic in a separate organization from customer traffic (implementation guide).

The following Bash request creates a company profile. It uses the beta version that the API reference documents for external_user_details:

bash
curl https://api.anthropic.com/v1/user_profiles \
  -H "x-api-key: $ANTHROPIC_API_KEY" \
  -H "anthropic-version: 2023-06-01" \
  -H "anthropic-beta: user-profiles-2026-09-04" \
  -H "content-type: application/json" \
  -d '{
    "name": "Acme Analytics, Inc.",
    "access_type": "passthrough",
    "external_user_details": {
      "reference_id": "cust-8f2a1c",
      "country": "US"
    }
  }'

Replace the company details with your customer's details. For an individual product user, omit access_type to use the default and supply that person's details. The fields are optional.

Expect HTTP 200 and a profile object containing an id. Save that returned value on your customer record.

Creation is not idempotent: repeating a request creates another profile even with the same reference_id (implementation guide). Serialize onboarding for each customer, and investigate an ambiguous timeout before submitting another creation request.

3. Send the saved ID with inference requests

Replace the example ID below with the one you saved. The Create User Profile reference documents attribution through the anthropic-user-profile-id header.

bash
curl https://api.anthropic.com/v1/messages \
  -H "x-api-key: $ANTHROPIC_API_KEY" \
  -H "anthropic-version: 2023-06-01" \
  -H "anthropic-user-profile-id: uprof_011CZkZCu8hGbp5mYRQgUmz9" \
  -H "content-type: application/json" \
  -d '{
    "model": "claude-opus-5-5",
    "max_tokens": 1024,
    "messages": [
      {"role": "user", "content": "Hello, Claude"}
    ]
  }'

Expect a normal Messages response. To inspect the stored customer mapping separately, use the Get User Profile endpoint:

bash
curl https://api.anthropic.com/v1/user_profiles/uprof_011CZkZCu8hGbp5mYRQgUmz9 \
  -H "x-api-key: $ANTHROPIC_API_KEY" \
  -H "anthropic-version: 2023-06-01" \
  -H "anthropic-beta: user-profiles-2026-09-04"

Check that the returned ID and customer details match your database record.

4. Adjust attribution for your hosting platform

Follow the platform-specific instructions:

  • Claude API, Claude Platform on AWS, and Anthropic-hosted Microsoft Foundry deployments support profile creation and the attribution header.
  • Google Cloud uses the header; create profiles through Claude API or Claude Platform on AWS.
  • Claude in Amazon Bedrock uses a top-level user_profile_id body field. The earlier InvokeModel and Converse integration is unsupported.

For Bedrock and Google Cloud, link the cloud account or project through Anthropic's Verification Portal. Both platforms validate ID format without looking up the profile, so inference success alone cannot verify attribution. If you call Claude through Google Cloud, see setting up Claude with Google credentials.

If a profile request fails

For a 400 invalid_request_error, check ID format and organization ownership. Message Batches can accept a well-formed ID initially, then fail individual requests for an organization mismatch (implementation guide).

For updates, omit unchanged fields. Sending null to clear a value in external_user_details is rejected. Profile metadata behaves differently: an empty string removes a metadata key (Update User Profile reference).

Not confirmed yet

The implementation guide uses non-beta SDK methods, while the API reference still requires beta headers. The October 20 release notes give no minimum SDK or CLI version. Keep the documented beta header in these HTTP examples; check your installed SDK before adopting the newer method names.

Sources and checks

  1. Claude Platform release notes
  2. User profiles for end-customer attribution
  3. Create User Profile - Claude API Reference
  4. Get User Profile - Claude API Reference
  5. Update User Profile - Claude API Reference