Follow Discord
Sweep 20 Nov 2026 · 19:55Z Build v2.1.330 547 read Stable v2.1.323 Latest v2.1.330 Next v2.1.330 Feeds RSS JSON llms.txt llms-full.txt Unofficial
One capture · api

One read of Claude Developer Platformapi-20261117T173718Z

219 pages moved out of 921 read.

Pages moved 219 significant first
Pages read 921 in this capture
Captured 17:37 UTC
Corpus hash 7b37a8ef26e3 corpus-hash

What this read moved

1-25 of 219, page 1 of 9

This capture is too large to show at once. Changes 1-25 of 219 are below, significant first; the rest are on the following screens.

api/beta/messages/batches/create Changed · +16 / -0 lines

from line 119
119119 
120120 - `"experimental-claude-tag-2026-10-21"`
121121 
122 - `"user-profiles-billing-2026-10-01"`
123 
122124 - `"message-batches-2024-09-24"`
123125 
124126 **Deprecated**: This value is no longer needed. Remove it from your requests.
from line 3640
36383640 The model that will complete your prompt.
36393641 
36403642 See [models](https://docs.anthropic.com/en/docs/models-overview) for additional details and options.
3643 
3644 - `billing_policy: optional BetaBillingPolicy or null`
3645 
3646 Declares which organization is billed for this request. `{"type": "billing_policy", "bill_to": "user_profile"}` bills the customer behind the user profile named in the `anthropic-user-profile-id` header, instead of your organization. If that customer has not linked an Anthropic organization to the profile, or has not allowed your organization to bill it, the request is rejected rather than billed to you. Omit the field, or send `"bill_to": "self"` (the default), to be billed as usual.
3647 
3648 - `type: "billing_policy"`
3649 
3650 - `bill_to: optional BetaBillTo`
3651 
3652 Who is billed. `self`, the default, bills your organization, as if `billing_policy` were omitted. `user_profile` bills the customer behind the user profile the request names; if that customer has not linked an Anthropic organization to the profile, or has not allowed your organization to bill it, the request is rejected rather than billed to you.
3653 
3654 - `"self"`
3655 
3656 - `"user_profile"`
36413657 
36423658 - `cache_control: optional BetaCacheControlEphemeral or null`
36433659 

api/beta/messages/count_tokens Changed · +16 / -0 lines

from line 119
119119 
120120 - `"experimental-claude-tag-2026-10-21"`
121121 
122 - `"user-profiles-billing-2026-10-01"`
123 
122124 - `"message-batches-2024-09-24"`
123125 
124126 **Deprecated**: This value is no longer needed. Remove it from your requests.
from line 3608
36063608 The model that will complete your prompt.
36073609 
36083610 See [models](https://docs.anthropic.com/en/docs/models-overview) for additional details and options.
3611 
3612- `billing_policy: optional BetaBillingPolicy or null`
3613 
3614 Declares which organization is billed when this body is sent to `/v1/messages`. Accepted here so that you can count the tokens of the exact body you will send, and otherwise ignored: counting tokens bills nobody, so no user profile is required.
3615 
3616 - `type: "billing_policy"`
3617 
3618 - `bill_to: optional BetaBillTo`
3619 
3620 Who is billed. `self`, the default, bills your organization, as if `billing_policy` were omitted. `user_profile` bills the customer behind the user profile the request names; if that customer has not linked an Anthropic organization to the profile, or has not allowed your organization to bill it, the request is rejected rather than billed to you.
3621 
3622 - `"self"`
3623 
3624 - `"user_profile"`
36093625 
36103626- `cache_control: optional BetaCacheControlEphemeral or null`
36113627 

api/beta/messages/create Changed · +16 / -0 lines

This page is larger than the 256 KiB this site keeps, so one side of the diff below stops where the stored text does.

from line 119
119119 
120120 - `"experimental-claude-tag-2026-10-21"`
121121 
122 - `"user-profiles-billing-2026-10-01"`
123 
122124 - `"message-batches-2024-09-24"`
123125 
124126 **Deprecated**: This value is no longer needed. Remove it from your requests.
from line 3621
36193621 
36203622 See [models](https://docs.anthropic.com/en/docs/models-overview) for additional details and options.
36213623 
3624- `billing_policy: optional BetaBillingPolicy or null`
3625 
3626 Declares which organization is billed for this request. `{"type": "billing_policy", "bill_to": "user_profile"}` bills the customer behind the user profile named in the `anthropic-user-profile-id` header, instead of your organization. If that customer has not linked an Anthropic organization to the profile, or has not allowed your organization to bill it, the request is rejected rather than billed to you. Omit the field, or send `"bill_to": "self"` (the default), to be billed as usual.
3627 
3628 - `type: "billing_policy"`
3629 
3630 - `bill_to: optional BetaBillTo`
3631 
3632 Who is billed. `self`, the default, bills your organization, as if `billing_policy` were omitted. `user_profile` bills the customer behind the user profile the request names; if that customer has not linked an Anthropic organization to the profile, or has not allowed your organization to bill it, the request is rejected rather than billed to you.
3633 
3634 - `"self"`
3635 
3636 - `"user_profile"`
3637 
36223638- `cache_control: optional BetaCacheControlEphemeral or null`
36233639 
36243640 Top-level cache control automatically applies a cache_control marker to the last cacheable block in the request.
from line 6996
69806996 
69816997 - `max_uses: optional number or null`
69826998 
6983 Maximum number of times the tool can be used in the API request.
6984 
6985 minimum: 1
6986 
6987 - `response_inclusion: optional "full" or "excluded"`
6988 
6989 How this tool's result blocks appear in the API response when the result was consumed by a completed code_execution call in the same turn. 'full' returns the complete content (default). 'excluded' drops the nested server_tool_use and result block pair entirely. Results from direct calls, or from code_execution calls that paused before completing, are always returned in full so they can be sent back on the next turn.
6990 
6991 - `"full"`
6992 
6993 - `"excluded"`
6994 
6995 - `strict: optional boolean`
6996 
6997 When true, guarantees schema validation on tool names and inputs
6998 
6999 - `user_location: optional BetaUserLocation or null`
7000 
7001 Parameters for the user's location. Used to provide more relevant search results.
7002 
7003 - `BetaWebFetchTool20260318 object`
7004 
7005
6999 Maximu

manage-claude/oauth-apps/app-review New page · 175 lines, new page

## Before you begin ## Manage test users ### Add test users ### Link a test user’s organization ### Remove a test user ## Publish the app ### If you can’t prove the domain ### Domain rules ## The review ### If the app isn’t approved ## Change a live app ### When the Console asks you to prove a domain ### Until Anthropic approves the change ### When the review of the change ends ## Change an app that isn’t live ## Invoiced billing

A whole new page. There's nothing to diff it against, so here is what it says.

---
title: App testing and review
url: https://platform.claude.com/docs/en/manage-claude/oauth-apps/app-review
description: How a new Linked billing app moves out of testing and opens to your customers, and what happens when you change a live app.
---

<Warning>
  Claude Platform OAuth is a Beta Service: prerelease software provided under your agreement with Anthropic, such as the [Commercial Terms of Service](https://www.anthropic.com/legal/commercial-terms), and the [Service Specific Terms](https://www.anthropic.com/legal/service-specific-terms). Endpoints, parameters, and behavior can change during the beta. It might not be suitable for production use.
</Warning>

With [Linked billing](https://platform.claude.com/docs/en/manage-claude/oauth-apps/organization-billing-connections), a customer links their Claude organization to your OAuth app. A new Linked billing app starts in testing, where only the test users that you name can link their organizations to it. To open the app to your customers, you publish it, and Anthropic reviews it.

If your organization has invoiced billing, Anthropic doesn’t review your app. See [Invoiced billing](https://platform.claude.com/docs/en/manage-claude/oauth-apps/app-review#invoiced-billing).

An app is live when Anthropic has approved it or when you have published it with invoiced billing. Any [eligible customer](https://platform.claude.com/docs/en/manage-claude/oauth-apps/organization-billing-connections#eligible-customers-and-endpoints) can link their organization to a live app, and the links that its test users made stay. On the OAuth apps page in the Claude Console, a live app’s status reads **Active**.

Until the app is live, the Console shows one of these statuses for it:

| Status           | What it means                                                               |
| ---------------- | --------------------------------------------------------------------------- |
| **Testing**      | You haven’t published the app.                                              |
| **In review**    | Anthropic is reviewing the app or a change that you made while it was live. |
| **Not approved** | Anthropic reviewed the app or the change and didn’t approve it.             |

An app that goes back to review after a change isn’t live again until Anthropic approves the change. Each Linked billing app has its own status and its own test users. See the note in [Step 1: Create the app](https://platform.claude.com/docs/en/manage-claude/oauth-apps/organization-billing-connections#step-1-create-the-app) in the Linked billing guide.

## Before you begin

Complete the [Setup process](https://platform.claude.com/docs/en/manage-claude/oauth-apps/organization-billing-connections#setup-process) in the Linked billing guide.

## Manage test users

### Add test users

1. Open the app’s page from the [OAuth apps page](https://platform.claude.com/settings/oauth-apps) in the Console.
2. On the **Settings** tab, go to the **Test users** list under **Who can link**.
3. Enter the email address of a test user’s Claude account and click **Add**. Repeat for each test user.
4. Click **Save changes**.

After you save, the people on the list can link their organizations to your app. Until your app is live, the Claude approval page, where a person approves the link, refuses anyone else. For what your app then receives, see [Your redirect URI receives `error=access_denied`](https://platform.claude.com/docs/en/manage-claude/oauth-apps/organization-billing-connections#access-denied) in the Linked billing guide.

**Who can link** stays on **Test users only** while the app isn’t live, and you can’t change it. The list holds up to 10 test users. Each address has to match the account’s address exactly, but letter case doesn’t matter. An address with a plus tag, such as `[email protected]`, counts as a different address from `[email protected]`.

### Link a test user’s organization

A test user links their organization from your app and approves the link on the page that your customers use. They need the Admin or Billing role in that organization. The steps are Steps 4 to 8 of the Linked billing guide. [Test as a customer](https://platform.claude.com/docs/en/manage-claude/oauth-apps/organization-billing-connections#test-as-a-customer) in that guide takes you through them and says how to check that the link was made.

To test the app yourself, add your own email address to the list. The organization that owns the app can’t link to it, so use a second Claude organization of yours.

After a test user has linked their organization, [send requests that you bill to it](https://platform.claude.com/docs/en/manage-claude/oauth-apps/organization-billing-connections#step-3-update-calls-to-claude) to try your app. Testing uses real money. Anthropic charges each test user’s organization for the requests that you bill to it, as it does for any customer.

Until your app is live, each new link needs a monthly spend cap of $50 USD or less. For the cap’s rules, see [While your app is in testing](https://platform.claude.com/docs/en/manage-claude/oauth-apps/organization-billing-connections#while-your-app-is-in-testing) in the guide.

### Remove a test user

Removing a test user takes effect at once. It ends each link to your app that the person approved. After a link ends, the Claude API refuses the requests that you bill to that organization. See [Expected errors](https://platform.claude.com/docs/en/manage-claude/oauth-apps/organization-billing-connections#expected-errors).

1. If the **Settings** tab has unsaved changes, click **Save changes** or **Discard**. Until you do, the Console doesn’t let you remove a saved test user.
2. Remove the test user’s address from the **Test users** list.
3. When the Console asks, click **Remove** to confirm. You don’t need to click **Save changes**.

## Publish the app

Publishing can ask you to prove that you control your app’s domain by adding a DNS record. Anthropic then reviews the app. A DNS change takes time, so start before you need customers to link.

Before you publish, check these things:

* Client authentication is set up. You can’t publish the app until it is.
* Your app has a homepage, which you set on the **Appearance** tab.
* You can change the DNS records of the homepage’s domain.
* Each redirect URI is on the homepage’s domain or on one of its subdomains.

For what counts as the homepage’s domain and for the exceptions, see [Domain rules](https://platform.claude.com/docs/en/manage-claude/oauth-apps/app-review#domain-rules).

Follow these steps to publish the app:

1. On the app’s page in the Console, click **Publish app**. A dialog box opens.
2. If the dialog box shows **Prove your domain**, add the DNS TXT record that it gives you where you manage DNS for your domain. Otherwise, go to step 5.
3. Click **Check**. If the domain still shows **Not proven yet**, see [If you can’t prove the domain](https://platform.claude.com/docs/en/manage-claude/oauth-apps/app-review#if-you-cant-prove-the-domain).
4. When the domain shows **Proven**, click **Continue**.
5. If the dialog box shows a checkbox to accept the Linked Billing Terms, select it. Then, click **Publish app** in the dialog box to confirm.

While Anthropic reviews the app, its status is **In review**. For the outcomes, see [The review](https://platform.claude.com/docs/en/manage-claude/oauth-apps/app-review#the-review).

### If you can’t prove the domain

* **The domain still shows Not proven yet:** A DNS change can take up to 48 hours to take effect. You can close the dialog box and come back later. If you were publishing, click **Publish app** again. If you were changing a live app, make the same edit again, and the Console gives you the same record until it expires.
* **Check says that the record has expired:** The DNS record works for 30 days from when the Console first shows it. After that, click **Get a new record** and add the new record. A domain that shows **Proven** stays proven.
* **The dialog box shows a message in place of a record:** For example, the message can say that your organization already has 20 domain names. You can’t continue until that is resolved. If you need help, [contact support](https://support.claude.com/en/articles/9015913-how-to-get-support).

### Domain rules

A domain is a hostname without a leading `www.`, and your domain is your homepage’s. For example, the domain of a homepage at `https://www.example.com` is `example.com`. A proven domain covers itself and its subdomains.

* **Shared domains:** A hosting service’s shared domain doesn’t qualify, so use a domain of your own.
* **Local redirect URIs:** Redirect URIs on `localhost`, `127.0.0.1`, or `[::1]` don’t have to be on the homepage’s domain.
* **Sibling subdomains:** If your homepage is on `app.example.com`, your domain is that subdomain, and it doesn’t cover a redirect URI on `auth.example.com`. One way to use both is to put your homepage on `example.com`, which covers them.
* **A domain that your organization has already proven:** Your organization might have proven a domain earlier, for example for another app. If it covers your homepage and every redirect URI that isn’t local, the dialog box skips **Prove your domain**. The redirect URIs then don’t have to be on the homepage’s domain. For example, with `example.com` proven, the homepage and a redirect URI can be on different subdomains of it.

## The review

When the review ends, the app’s page in the Console shows the result:

* **Anthropic approves the app:** The app is live. **Who can link** then shows **Any Claude user** without any action from you, and the Console hides the **Test users** list.
* **Anthropic doesn’t approve the app:** The app’s status changes to **Not approved**.

During the review and after a **Not approved** result, your test users keep their links, and you can still add and remove test users.

### If the app isn’t approved

You can’t publish the app again yourself. To ask about the decision, [contact support](https://support.claude.com/en/articles/9015913-how-to-get-support). You can still [change the app](https://platform.claude.com/docs/en/manage-claude/oauth-apps/app-review#change-an-app-that-isnt-live), but a change doesn’t start a new review.

## Change a live app

A change to a live app’s name, logo, homepage, or redirect URIs sends the app back to review. Until Anthropic approves the change, only your test users can link their organizations to the app. See [Until Anthropic approves the change](https://platform.claude.com/docs/en/manage-claude/oauth-apps/app-review#until-anthropic-approves-the-change). Other changes, such as permissions or client authentication, don’t send the app back to review.

Follow these steps to change the name, homepage, or redirect URIs:

1. Change the app on its **Appearance** tab (name and homepage) or its **Settings** tab (redirect URIs).

2. Click **Save changes**. A dialog box opens before anything is saved.

3. If the dialog box shows **Prove your domain**, prove each domain that it names:

   1. Add the DNS TXT record for the domain. Then, click **Check**. If the domain still shows **Not proven yet**, see [If you can’t prove the domain](https://platform.claude.com/docs/en/manage-claude/oauth-apps/app-review#if-you-cant-prove-the-domain).
   2. When the domain shows **Proven**, click **Next domain** if another domain is left. Otherwise, click **Continue**.

4. Click **Save and send to review**.

The Console then saves the change, and the change takes effect without waiting for the review. While Anthropic reviews the change, the app’s status is **In review**.

To change the logo, choose or remove it on the **Appearance** tab. The dialog box opens at once. Click **Send to review**. If you cancel, the logo doesn’t change.

To change the app again while its status is **In review** or **Not approved**, see [Change an app that isn’t live](https://platform.claude.com/docs/en/manage-claude/oauth-apps/app-review#change-an-app-that-isnt-live).

### When the Console asks you to prove a domain

The Console asks only if you changed the homepage or a redirect URI. It also checks the homepage and the redirect URIs that you didn’t change, so the dialog box can name their domains too. It names only domains that no proven domain of your organization covers. It doesn’t check local redirect URIs, but a change to one still sends the app back to review.

After a change, the redirect URIs can be on domains other than the homepage’s if your organization proves each one.

### Until Anthropic approves the change

These rules apply from when you send the change to review:

* **Customers who have already linked:** Their organizations stay linked, and the requests that you bill to them keep working. A customer who unlinks can’t link again unless the person who links is on the **Test users** list.
* **New links:** The **Who can link** setting goes back to **Test users only**. The Console shows the **Test users** list again with the people who were on it before.
* **Test users:** You can add and remove people on the list. Removing a person also ends a link that they made to a customer’s organization while the app was live. See [Remove a test user](https://platform.claude.com/docs/en/manage-claude/oauth-apps/app-review#remove-a-test-user).
* **Spend caps of linked organizations:** A linked organization keeps its current [spend cap](https://platform.claude.com/docs/en/manage-claude/oauth-apps/organization-billing-connections#spend-caps) setting even if its cap is above $50 USD or it has no cap. A setting that it changes has to follow the rules in [While your app is in testing](https://platform.claude.com/docs/en/manage-claude/oauth-apps/organization-billing-connections#while-your-app-is-in-testing).

### When the review of the change ends

The review ends in one of two ways:

* **Anthropic approves the change:** The app is live again. Any eligible customer can link, the Console hides the **Test users** list, and the cap rules for an app that isn’t live no longer apply.
* **Anthropic doesn’t approve the change:** The app’s status changes to **Not approved**. The change stays in effect, and the rules in [Until Anthropic approves the change](https://platform.claude.com/docs/en/manage-claude/oauth-apps/app-review#until-anthropic-approves-the-change) still apply. See [If the app isn’t approved](https://platform.claude.com/docs/en/manage-claude/oauth-apps/app-review#if-the-app-isnt-approved).

## Change an app that isn’t live

Follow these steps while the app’s status is **Testing**, **In review**, or **Not approved**:

1. Change the app on its **Appearance** tab (name, logo, and homepage) or its **Settings** tab (redirect URIs).
2. Click **Save changes**. A logo change saves when you choose or remove the logo.

No dialog box asks you to confirm, and the change doesn’t alter the app’s status.

When you save a change to the homepage or a redirect URI, the Console checks domains only while the status is **In review**. An app in testing meets the domain check when you publish. During a review, the changed app’s homepage and every redirect URI that isn’t local have to be on proven domains of your organization. Otherwise, the Console refuses the change, and it doesn’t ask you to prove a domain. To move to a domain that isn’t proven, wait until the review ends.

## Invoiced billing

With invoiced billing, Anthropic invoices the organization that owns your app for its API usage, and that organization doesn’t buy prepaid credits. Your app still starts in testing, and the rules for test users and the spend cap still apply. After that, three things differ:

* **[Publish the app](https://platform.claude.com/docs/en/manage-claude/oauth-apps/app-review#publish-the-app):** On the app’s page, click **Publish app**. Then, click **Publish app** in the dialog box to confirm. Anthropic doesn’t review the app, so it is live as soon as you publish it.
* **Homepage and domain:** You prove no domain, so the dialog box skips **Prove your domain**. Your app needs no homepage to publish, and the rule for redirect URIs under [Publish the app](https://platform.claude.com/docs/en/manage-claude/oauth-apps/app-review#publish-the-app) doesn’t apply. Client authentication still has to be set up first.
* **[Change a live app](https://platform.claude.com/docs/en/manage-claude/oauth-apps/app-review#change-a-live-app):** The Console saves a change when you click **Save changes** or when you choose or remove a logo. It doesn’t ask you to prove a domain or to confirm, and no review follows.

manage-claude/oauth-apps/branding-samples New page · 174 lines, new page

## The buttons ### Copy the button’s HTML ### Colors ### Download the logo

A whole new page. There's nothing to diff it against, so here is what it says.

---
title: Branding samples
url: https://platform.claude.com/docs/en/manage-claude/oauth-apps/branding-samples
description: "A Link your Claude organization button for Linked billing: its HTML and CSS, colors, and the Claude logo."
---

<Warning>
  Claude Platform OAuth is a Beta Service: prerelease software provided under your agreement with Anthropic, such as the [Commercial Terms of Service](https://www.anthropic.com/legal/commercial-terms), and the [Service Specific Terms](https://www.anthropic.com/legal/service-specific-terms). Endpoints, parameters, and behavior can change during the beta. It might not be suitable for production use.
</Warning>

This page has branding samples for products that use [Linked billing](https://platform.claude.com/docs/en/manage-claude/oauth-apps/organization-billing-connections): the Link your Claude organization button.

## The buttons

Put a **Link your Claude organization** button where your customers manage billing or integrations. When someone clicks it, your back end [starts the billing connection](https://platform.claude.com/docs/en/manage-claude/oauth-apps/organization-billing-connections#runtime-step-2).

<Frame caption="The button in light and dark">
  ![Link your Claude organization button, light and dark, with the Claude logo before its words](https://platform.claude.com/docs/images/claude-link-button.svg)
</Frame>

### Copy the button’s HTML

Open **Button CSS** and put its `<style>` block in your page’s `<head>`, or move the rules inside it to your style sheet. Then open **Sample HTML for the Link your Claude organization button** and put the link where you want the button. Change `/claude/billing/link` to the address on your back end that starts the connection.

Together, the CSS and the HTML contain the logo and all of the button’s styles, so if your site has a Content Security Policy, you don’t need to add an Anthropic host to it.

<Accordion title="Button CSS">
  ```html claude-button.html
  <style>
    /* Each size is written as calc(Nem / 14), where N is its size in pixels
       when the text is 14 pixels. To make the button larger, change only font-size. */
    .claude-button {
      --claude-button-fill: #FFFFFF;
      --claude-button-fill-hover: #F5F4ED;
      --claude-button-text: #141413;
      --claude-button-border: #87867F;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: calc(10em / 14);
      box-sizing: border-box;
      min-height: calc(40em / 14);
      padding: calc(8em / 14) calc(12em / 14);
      border: 1px solid var(--claude-button-border);
      border-radius: calc(8em / 14);
      background: var(--claude-button-fill);
      font: 500 0.875rem/1.4286 ui-sans-serif, system-ui, -apple-system, "Segoe UI",
        Roboto, "Helvetica Neue", Arial, sans-serif;
      font-size: 0.875rem;
      letter-spacing: normal;
      text-transform: none;
      cursor: pointer;
    }
    .claude-button-dark {
      --claude-button-fill: #141413;
      --claude-button-fill-hover: #262624;
      --claude-button-text: #FAF9F5;
      --claude-button-border: #73726C;
    }
    .claude-button,
    .claude-button:link,
    .claude-button:visited,
    .claude-button:hover,
    .claude-button:focus,
    .claude-button:active {
      color: var(--claude-button-text);
      text-decoration: none;
    }
    .claude-button:hover {
      background: var(--claude-button-fill-hover);
    }
    .claude-button:focus-visible {
      outline: 2px solid var(--claude-button-text);
      outline-offset: 2px;
      box-shadow: 0 0 0 2px var(--claude-button-fill);
    }
    .claude-button svg {
      flex: none;
      width: calc(20em / 14);
      height: calc(20em / 14);
    }
    .claude-button path {
      fill: #D97757;
      stroke: none;
    }
  </style>
  ```
</Accordion>

<Accordion title="Sample HTML for the Link your Claude organization button">
  ```html link-your-claude-organization.html
  <a class="claude-button" href="/claude/billing/link">
    <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="20" height="20" aria-hidden="true">
      <path fill="#D97757" d="M11.376 24L10.776 23.544L10.44 22.8L10.776 21.312L11.16 19.392L11.472 17.856L11.76 15.96
        L11.928 15.336L11.904 15.288L11.784 15.312L10.344 17.28L8.16 20.232L6.432 22.056
        L6.024 22.224L5.304 21.864L5.376 21.192L5.784 20.616L8.16 17.568L9.6 15.672L10.536 14.592
        L10.512 14.448H10.464L4.128 18.576L3 18.72L2.496 18.264L2.568 17.52L2.808 17.28L4.704 15.96
        L9.432 13.32L9.504 13.08L9.432 12.96H9.192L8.4 12.912L5.712 12.84L3.384 12.744L1.104 12.624
        L0.528 12.504L0 11.784L0.048 11.424L0.528 11.112L1.224 11.16L2.736 11.28L5.016 11.424
        L6.672 11.52L9.12 11.784H9.504L9.552 11.616L9.432 11.52L9.336 11.424L6.96 9.84L4.416 8.16
        L3.072 7.176L2.352 6.672L1.992 6.216L1.848 5.208L2.496 4.488L3.384 4.56L3.6 4.608
        L4.488 5.304L6.384 6.768L8.88 8.616L9.24 8.904L9.408 8.808V8.736L9.24 8.472L7.896 6.024
        L6.456 3.528L5.808 2.496L5.64 1.872C5.576 1.656 5.544 1.416 5.544 1.152L6.288 0.144001
        L6.696 0L7.704 0.144001L8.112 0.504001L8.736 1.92L9.72 4.152L11.28 7.176L11.736 8.088
        L11.976 8.904L12.072 9.168H12.24V9.024L12.36 7.296L12.6 5.208L12.84 2.52L12.912 1.752
        L13.296 0.840001L14.04 0.360001L14.616 0.624001L15.096 1.32L15.024 1.752L14.76 3.6
        L14.184 6.504L13.824 8.472H14.04L14.28 8.208L15.264 6.912L16.92 4.848L17.64 4.032
        L18.504 3.12L19.056 2.688H20.088L20.832 3.816L20.496 4.992L19.44 6.336L18.552 7.464
        L17.28 9.168L16.512 10.536L16.584 10.632H16.752L19.608 10.008L21.168 9.744L22.992 9.432
        L23.832 9.816L23.928 10.2L23.592 11.016L21.624 11.496L19.32 11.952L15.888 12.768
        L15.84 12.792L15.888 12.864L17.424 13.008L18.096 13.056H19.728L22.752 13.272L23.544 13.8
        L24 14.424L23.928 14.928L22.704 15.528L21.072 15.144L17.232 14.232L15.936 13.92H15.744
        V14.016L16.848 15.096L18.84 16.896L21.36 19.224L21.48 19.8L21.168 20.28L20.832 20.232
        L18.624 18.552L17.76 17.808L15.84 16.2H15.72V16.368L16.152 17.016L18.504 20.544
        L18.624 21.624L18.456 21.96L17.832 22.176L17.184 22.056L15.792 20.136L14.376 17.952
        L13.224 16.008L13.104 16.104L12.408 23.352L12.096 23.712L11.376 24Z"/>
    </svg>
    Link your Claude organization
  </a>
  ```

  For the dark button, add the `claude-button-dark` class to the link.
</Accordion>

<Note>
  If your page starts the connection by submitting a form, use `<button type="submit" class="claude-button">` in place of the link. The same styles apply. A rule in your style sheet that styles every button inside a container can still restyle it. Compare the result with the picture.
</Note>

### Colors

| Part                                            | Light button | Dark button |
| ----------------------------------------------- | ------------ | ----------- |
| Background                                      | `#FFFFFF`    | `#141413`   |
| Text                                            | `#141413`    | `#FAF9F5`   |
| Border                                          | `#87867F`    | `#73726C`   |
| Background while the pointer is over the button | `#F5F4ED`    | `#262624`   |
| Logo                                            | `#D97757`    | `#D97757`   |

### Download the logo

To build the same button without HTML, for example in a mobile or desktop app, save the following file as `claude-logo.svg`. Use the colors in [Colors](https://platform.claude.com/docs/en/manage-claude/oauth-apps/branding-samples#button-colors), and hide the logo from screen readers, because the words already name the button.

<Accordion title="claude-logo.svg">
  <File filename="claude-logo.svg" size="sm">
    ```xml
    <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24">
      <path fill="#D97757"
        d="M11.376 24L10.776 23.544L10.44 22.8L10.776 21.312L11.16 19.392L11.472 17.856L11.76 15.96
          L11.928 15.336L11.904 15.288L11.784 15.312L10.344 17.28L8.16 20.232L6.432 22.056
          L6.024 22.224L5.304 21.864L5.376 21.192L5.784 20.616L8.16 17.568L9.6 15.672L10.536 14.592
          L10.512 14.448H10.464L4.128 18.576L3 18.72L2.496 18.264L2.568 17.52L2.808 17.28L4.704 15.96
          L9.432 13.32L9.504 13.08L9.432 12.96H9.192L8.4 12.912L5.712 12.84L3.384 12.744L1.104 12.624
          L0.528 12.504L0 11.784L0.048 11.424L0.528 11.112L1.224 11.16L2.736 11.28L5.016 11.424
          L6.672 11.52L9.12 11.784H9.504L9.552 11.616L9.432 11.52L9.336 11.424L6.96 9.84L4.416 8.16
          L3.072 7.176L2.352 6.672L1.992 6.216L1.848 5.208L2.496 4.488L3.384 4.56L3.6 4.608
          L4.488 5.304L6.384 6.768L8.88 8.616L9.24 8.904L9.408 8.808V8.736L9.24 8.472L7.896 6.024
          L6.456 3.528L5.808 2.496L5.64 1.872C5.576 1.656 5.544 1.416 5.544 1.152L6.288 0.144001
          L6.696 0L7.704 0.144001L8.112 0.504001L8.736 1.92L9.72 4.152L11.28 7.176L11.736 8.088
          L11.976 8.904L12.072 9.168H12.24V9.024L12.36 7.296L12.6 5.208L12.84 2.52L12.912 1.752
          L13.296 0.840001L14.04 0.360001L14.616 0.624001L15.096 1.32L15.024 1.752L14.76 3.6
          L14.184 6.504L13.824 8.472H14.04L14.28 8.208L15.264 6.912L16.92 4.848L17.64 4.032
          L18.504 3.12L19.056 2.688H20.088L20.832 3.816L20.496 4.992L19.44 6.336L18.552 7.464
          L17.28 9.168L16.512 10.536L16.584 10.632H16.752L19.608 10.008L21.168 9.744L22.992 9.432
          L23.832 9.816L23.928 10.2L23.592 11.016L21.624 11.496L19.32 11.952L15.888 12.768
          L15.84 12.792L15.888 12.864L17.424 13.008L18.096 13.056H19.728L22.752 13.272L23.544 13.8
          L24 14.424L23.928 14.928L22.704 15.528L21.072 15.144L17.232 14.232L15.936 13.92H15.744
          V14.016L16.848 15.096L18.84 16.896L21.36 19.224L21.48 19.8L21.168 20.28L20.832 20.232
          L18.624 18.552L17.76 17.808L15.84 16.2H15.72V16.368L16.152 17.016L18.504 20.544
          L18.624 21.624L18.456 21.96L17.832 22.176L17.184 22.056L15.792 20.136L14.376 17.952
          L13.224 16.008L13.104 16.104L12.408 23.352L12.096 23.712L11.376 24Z"/>
    </svg>
    ```
  </File>
</Accordion>

manage-claude/oauth-apps/oauth-reference New page · 301 lines, new page

## Endpoints ## Discovery document values ## Client authentication ### Client assertion claims ## Authorization request parameters ## Scopes ## Token request and response ## OAuth tokens for a billing connection ## Revocation ## Lifetimes ## Redirect URI rules ## Errors ### Errors on the redirect ### Errors from the PAR and token endpoints ### Errors from the revocation endpoint ### Billing errors ## Standards ## Terms used on these pages

A whole new page. There's nothing to diff it against, so here is what it says.

---
title: OAuth reference
url: https://platform.claude.com/docs/en/manage-claude/oauth-apps/oauth-reference
description: Endpoints, client authentication, request parameters, scopes, token responses, revocation, lifetimes, redirect URI rules, and errors.
---

<Warning>
  Claude Platform OAuth is a Beta Service: prerelease software provided under your agreement with Anthropic, such as the [Commercial Terms of Service](https://www.anthropic.com/legal/commercial-terms), and the [Service Specific Terms](https://www.anthropic.com/legal/service-specific-terms). Endpoints, parameters, and behavior can change during the beta. It might not be suitable for production use.
</Warning>

This page collects the endpoints, parameters, validation rules, and error mappings for [Claude Platform OAuth](https://platform.claude.com/docs/en/manage-claude/oauth-apps/overview). For a walkthrough, see [Linked billing](https://platform.claude.com/docs/en/manage-claude/oauth-apps/organization-billing-connections).

## Endpoints

| Endpoint                                                     | URL                                                                          |
| ------------------------------------------------------------ | ---------------------------------------------------------------------------- |
| Issuer                                                       | `https://identity.anthropic.com/users`                                       |
| Discovery document                                           | `https://identity.anthropic.com/users/.well-known/openid-configuration`      |
| Signing keys (JWKS)                                          | The `jwks_uri` in the discovery document, hosted on `identity.anthropic.com` |
| Authorization endpoint (sign-in and consent page)            | `https://auth.claude.com/oauth/authorize`                                    |
| Pushed authorization request (PAR) endpoint                  | `https://auth.claude.com/v1/oauth/par`                                       |
| Token endpoint                                               | `https://auth.claude.com/v1/oauth/token`                                     |
| Revocation endpoint                                          | `https://auth.claude.com/v1/oauth/revoke`                                    |
| Claude API (user profiles and requests that bill a customer) | `https://api.anthropic.com`                                                  |

Read the signing keys from the discovery document rather than hardcoding them. The discovery document does not list the PAR endpoint or the revocation endpoint, so use the URLs in this table.

## Discovery document values

| Field                                   | Value                                            |
| --------------------------------------- | ------------------------------------------------ |
| `issuer`                                | `https://identity.anthropic.com/users`           |
| `authorization_endpoint`                | `https://auth.claude.com/oauth/authorize`        |
| `token_endpoint`                        | `https://auth.claude.com/v1/oauth/token`         |
| `jwks_uri`                              | `https://identity.anthropic.com/users/jwks.json` |
| `response_types_supported`              | `code`                                           |
| `grant_types_supported`                 | `authorization_code`, `refresh_token`            |
| `code_challenge_methods_supported`      | `S256`                                           |
| `token_endpoint_auth_methods_supported` | `private_key_jwt`                                |
| `id_token_signing_alg_values_supported` | `ES256`                                          |
| `scopes_supported`                      | `openid`, `email`                                |
| `subject_types_supported`               | `public`, `pairwise`                             |

`auth.claude.com` returns a refresh token for Linked billing only when the customer approved `offline_access` together with `billing:attribution`: see [OAuth tokens for a billing connection](https://platform.claude.com/docs/en/manage-claude/oauth-apps/oauth-reference#oauth-tokens-for-a-billing-connection).

## Client authentication

`auth.claude.com` authenticates a confidential client with the `private_key_jwt` method ([RFC 7523](https://www.rfc-editor.org/rfc/rfc7523)). Send these parameters on every request to the PAR endpoint, the token endpoint, and the revocation endpoint. Never send credentials in a URL query string: `auth.claude.com` rejects them.

| Parameter               | Value                                                                                                                                                                                |
| ----------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `client_id`             | Your OAuth app’s client ID                                                                                                                                                           |
| `client_assertion_type` | `urn:ietf:params:oauth:client-assertion-type:jwt-bearer`                                                                                                                             |
| `client_assertion`      | A JWT from your identity provider with the claims in [Client assertion claims](https://platform.claude.com/docs/en/manage-claude/oauth-apps/oauth-reference#client-assertion-claims) |

### Client assertion claims

A client assertion must contain all of the following claims, and its header must contain the `kid` of a key in your JWKS.

| Claim | Requirement                                                                                                                                                                       |
| ----- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `iss` | Your identity provider’s issuer URL, exactly as registered through [Workload Identity Federation](https://platform.claude.com/docs/en/manage-claude/workload-identity-federation) |
| `sub` | A value that matches the subject pattern in your app’s client authentication settings, if you set one                                                                             |
| `aud` | Exactly one audience: the value in your app’s client authentication settings. `auth.claude.com` rejects an assertion that lists more than one audience.                           |
| `iat` | The time your identity provider issued the JWT                                                                                                                                    |
| `exp` | The expiry time, no more than 1 hour after `iat`. Use a shorter lifetime where you can: anyone who intercepts an assertion can use it until it expires.                           |

Example assertion payload:

```json
{
  "iss": "https://idp.example.com",
  "sub": "workload:prod:claude-integration-backend",
  "aud": "YOUR_CONFIGURED_AUDIENCE",
  "iat": 1791230000,
  "exp": 1791230300
}
```

Make the subject pattern and claim conditions as narrow as your back end allows. `auth.claude.com` accepts any JWT from your identity provider that matches them as authentication for your app.

## Authorization request parameters

Send these parameters, except `request_uri`, in the JSON body of a pushed authorization request.

| Parameter                | Linked billing | Description                                                                                                                                                                                 |
| ------------------------ | -------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `response_type`          | Required       | The value `code`                                                                                                                                                                            |
| `client_id`              | Required       | Your OAuth app’s client ID                                                                                                                                                                  |
| `redirect_uri`           | Required       | A URI that exactly matches a registered redirect URI, up to 2,048 characters                                                                                                                |
| `scope`                  | Required       | For a billing connection, `billing:attribution` or `billing:attribution offline_access`. See [Scopes](https://platform.claude.com/docs/en/manage-claude/oauth-apps/oauth-reference#scopes). |
| `state`                  | Required       | A random, single-use value, up to 2,048 characters, that you check on the callback                                                                                                          |
| `code_challenge`         | Required       | `BASE64URL(SHA256(code_verifier))`, where the `code_verifier` is 43 to 128 characters                                                                                                       |
| `code_challenge_method`  | Required       | The value `S256`                                                                                                                                                                            |
| `connection_type`        | Required       | The value `organization_shared`. This value requests an organization connection for billing.                                                                                                |
| `connection_auth_target` | Required       | Which organization the connection’s requests route to. For Linked billing, send `platform` (the owner of the OAuth app).                                                                    |
| `user_profile_id`        | Required       | The ID of an active user profile in your organization that represents the customer                                                                                                          |
| `request_uri`            | Required       | The value that the PAR endpoint returned. Send it to the authorization endpoint with `client_id` and no other parameters.                                                                   |

The PAR endpoint returns HTTP 201 with `request_uri` and `expires_in` (600 seconds).

## Scopes

| Category | Scope                     | Description                                                                                                                                                                                                                                                                                                                                                                        | Connection type       | Client type  |
| -------- | ------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------- | ------------ |
| General  | `offline_access`          | Gives the app a refresh token representing the other requested scopes. On an `organization_shared` connection, send it only together with `billing:attribution`.                                                                                                                                                                                                                   | `organization_shared` | Confidential |
| Billing  | `billing:attribution`     | A connection that lets you bill a customer’s Claude organization for the Claude API requests that the customer directs you to make. Send it alone, or together with `offline_access` to also get a refresh token. See [OAuth tokens for a billing connection](https://platform.claude.com/docs/en/manage-claude/oauth-apps/oauth-reference#oauth-tokens-for-a-billing-connection). | `organization_shared` | Confidential |
| Billing  | `org:billing_attribution` | Deprecated: use `billing:attribution`.                                                                                                                                                                                                                                                                                                                                             | `organization_shared` | Confidential |

## Token request and response

Send token requests to `https://auth.claude.com/v1/oauth/token` with a JSON body.

| Parameter                                                | Value                                                                                                                             |
| -------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------- |
| `grant_type`                                             | `authorization_code`                                                                                                              |
| `code`                                                   | The code from the callback                                                                                                        |
| `redirect_uri`                                           | The same `redirect_uri` you sent in the authorization request                                                                     |
| `code_verifier`                                          | The PKCE code verifier                                                                                                            |
| `client_id`, `client_assertion_type`, `client_assertion` | As in [Client authentication](https://platform.claude.com/docs/en/manage-claude/oauth-apps/oauth-reference#client-authentication) |

The token response contains these fields:

| Response field             | Linked billing                                                                                                                                      |
| -------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------- |
| `access_token`             | [The connection’s access token](https://platform.claude.com/docs/en/manage-claude/oauth-apps/oauth-reference#oauth-tokens-for-a-billing-connection) |
| `token_type`               | `Bearer`                                                                                                                                            |
| `expires_in`               | At most `3600`                                                                                                                                      |
| `scope`                    | `workspace:inference`                                                                                                                               |
| `connection_id`            | The connection ID, for example `ocon_EXAMPLE`. Store it.                                                                                            |
| `refresh_token`            | Returned only when the customer approved `offline_access`                                                                                           |
| `refresh_token_expires_in` | Seconds until `refresh_token` expires. Absent when there is no `refresh_token`.                                                                     |

To refresh, send `grant_type` set to `refresh_token`, your `refresh_token`, and the parameters in [Client authentication](https://platform.claude.com/docs/en/manage-claude/oauth-apps/oauth-reference#client-authentication). A refresh of a billing connection follows the rules in [OAuth tokens for a billing connection](https://platform.claude.com/docs/en/manage-claude/oauth-apps/oauth-reference#oauth-tokens-for-a-billing-connection).

## OAuth tokens for a billing connection

For a billing connection, the token endpoint returns the connection’s access token. The token authenticates as your app’s [operator service account](https://platform.claude.com/docs/en/manage-claude/oauth-apps/oauth-reference#terms), in the workspace that the app’s `connection_token_workspace_id` setting names. On `/v1/messages` and `/v1/chat/completions`, a request with it is billed to that connection’s customer and to no other. When the customer also approved `offline_access`, the token endpoint returns a refresh token too, and the `refresh_token` grant renews both tokens. For the setup and the walkthrough, see [OAuth tokens for each connection](https://platform.claude.com/docs/en/manage-claude/oauth-apps/organization-billing-connections#oauth-tokens-for-each-connection) on the Linked billing page.

Both grants take the parameters in [Token request and response](https://platform.claude.com/docs/en/manage-claude/oauth-apps/oauth-reference#token-request-and-response), with [Client authentication](https://platform.claude.com/docs/en/manage-claude/oauth-apps/oauth-reference#client-authentication). A refresh must not send a `scope` parameter. The token response contains these fields:

| Response field             | Value                                                                                          |
| -------------------------- | ---------------------------------------------------------------------------------------------- |
| `access_token`             | The connection’s access token                                                                  |
| `token_type`               | `Bearer`                                                                                       |
| `expires_in`               | Seconds until the access token expires, at most `3600`                                         |
| `scope`                    | Always `workspace:inference`                                                                   |
| `connection_id`            | The connection ID, for example `ocon_EXAMPLE`. Only the `authorization_code` grant returns it. |
| `refresh_token`            | The connection’s refresh token. Returned only when the customer approved `offline_access`.     |
| `refresh_token_expires_in` | Seconds until `refresh_token` expires                                                          |

Each refresh returns a new `access_token` and a new `refresh_token`. The refresh token that you sent is replaced, and the earlier access token stops working within a few minutes. You can send the replaced refresh token one more time, within 30 seconds of the refresh that replaced it, to repeat a request whose response you lost. That second request returns another new pair and revokes the pair from the lost response: use the newest pair only. A third request with the replaced token gets `invalid_grant`, and so does a second request that arrives after the 30 seconds. Inside the 30 seconds, such a request revokes nothing. After the 30 seconds, it revokes every token of the connection and ends the connection. [Refresh the tokens](https://platform.claude.com/docs/en/manage-claude/oauth-apps/organization-billing-connections#refresh-the-connection) has the rules and the errors of a refresh.

Each of these events revokes the connection’s tokens, the current access token included:

* The customer or you unlink.
* The customer approves a new authorization request with different scopes for the same user profile, and you exchange that approval’s code. The new connection takes the place of the earlier one.
* The workspace that the tokens run in is archived.

For how the Claude API bills a request with a connection’s access token, see [Call Claude with a connection’s access token](https://platform.claude.com/docs/en/manage-claude/oauth-apps/organization-billing-connections#call-claude-with-a-connections-access-token).

## Revocation

Send revocation requests to `https://auth.claude.com/v1/oauth/revoke` with a JSON or form-encoded body. The endpoint follows [RFC 7009](https://www.rfc-editor.org/rfc/rfc7009) and also accepts connection and user profile IDs.

Send the parameters in [Client authentication](https://platform.claude.com/docs/en/manage-claude/oauth-apps/oauth-reference#client-authentication) and exactly one of the parameters in this table. The client assertion’s `aud` is the value in your app’s client authentication settings, not the revocation URL.

| Parameter         | What it ends                                                                                                                 |
| ----------------- | ---------------------------------------------------------------------------------------------------------------------------- |
| `connection_id`   | One of your app’s connections, given as an `ocon_` ID                                                                        |
| `user_profile_id` | All of your app’s connections on one user profile, given as a `uprof_` ID                                                    |
| `token`           | For Linked billing, send `connection_id` or `user_profile_id` instead: sending an access token might not end the connection. |

`auth.claude.com` accepts `token_type_hint` and ignores it.

The endpoint returns HTTP 200 and the IDs of the connections that the request ended:

```json
{
  "revoked_connection_ids": ["ocon_EXAMPLE"]
}
```

The list is empty if the token or ID is unknown or belongs to another app, if the connection has already ended, or if the request ended a token but no connection. The response does not say which.

After a billing connection ends, the Claude API refuses requests that bill that customer, with `user_profile_not_billable`, and the connection’s OAuth tokens stop working. Do not rely after that on an access token from a connection approved with the deprecated `org:billing_attribution` scope: it might stop working at once, or work until it expires.

## Lifetimes

| Item                                | Lifetime                                                          |
| ----------------------------------- | ----------------------------------------------------------------- |
| `request_uri` from the PAR endpoint | 10 minutes, single use                                            |
| Authorization code                  | 5 minutes, single use                                             |
| `access_token`                      | Up to 1 hour                                                      |
| `refresh_token`                     | Up to 1 year from the code exchange. A refresh doesn’t extend it. |

These are the current values. Read `expires_in` and `refresh_token_expires_in` from each response rather than relying on fixed values.

## Redirect URI rules

* Each `redirect_uri` must exactly match a URI registered on your app. `auth.claude.com` does not use wildcard or prefix matching.
* Every redirect URI must use HTTPS and must not contain a fragment. Local-development URIs on `localhost`, `127.0.0.1`, or `[::1]` may use HTTP.
* A local-development URI registered with an asterisk as the port, such as `http://localhost:*/callback`, matches any port.
* You can register up to 10 redirect URIs for each app.
* `auth.claude.com` sends errors to your redirect URI only when the `redirect_uri` matches a registered URI. For any other `redirect_uri`, `auth.claude.com` does not redirect the browser.

## Errors

### Errors on the redirect

`auth.claude.com` returns errors as `error`, `error_description`, and `state` query parameters on your redirect URI. They are standard OAuth 2.0 errors ([RFC 6749](https://www.rfc-editor.org/rfc/rfc6749)), except `user_profile_already_linked`, which is specific to Anthropic.

| Error                         | When                                                                                                                                                                                                                                                   | What to show your user                                                                                                                                                                                                                                                                                                                                                                                                |
| ----------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `access_denied`               | The person declined or cannot approve this request. For a billing connection, the person must be an administrator of a Claude organization.                                                                                                            | Explain that the connection did not complete, and do not assume that the person declined. For a billing connection, follow [Your redirect URI receives `error=access_denied`](https://platform.claude.com/docs/en/manage-claude/oauth-apps/organization-billing-connections#access-denied) in the Linked billing guide, which lists the causes and what to tell the person. Otherwise, ask the person to contact you. |
| `server_error`                | `auth.claude.com` failed to process the request.                                                                                                                                                                                                       | Ask the user to try again.                                                                                                                                                                                                                                                                                                                                                                                            |
| `user_profile_already_linked` | Linked billing only. The customer’s organization is already linked to your app through a different user profile. Each customer organization can have one connection to your app. `auth.claude.com` has already asked the administrator to contact you. | Explain that their organization is already linked to your app.                                                                                                                                                                                                                                                                                                                                                        |

If the `request_uri` has expired or you already used it, `auth.claude.com` shows an error page and does not redirect the browser back to your app. Start the flow again with a new pushed authorization request.

### Errors from the PAR and token endpoints

These endpoints return a JSON body with `error` and `error_description`.

| Error                         | When                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| ----------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `invalid_request`             | A required parameter is missing or invalid, for example a missing `state` or PKCE challenge, or a `user_profile_id` that is not the ID of an active user profile in your organization.                                                                                                                                                                                                                                                                                                                                                                                                                           |
| `invalid_client`              | `auth.claude.com` could not authenticate your app: the client ID is unknown, or the client assertion failed verification. Check the assertion’s `iss`, `sub`, and `aud` against your app’s client authentication settings, and check that your identity provider signed it with a key in your JWKS.                                                                                                                                                                                                                                                                                                              |
| `invalid_scope`               | The requested scope is not allowed for this app or this connection type. For a [billing connection’s tokens](https://platform.claude.com/docs/en/manage-claude/oauth-apps/oauth-reference#oauth-tokens-for-a-billing-connection), this also means that a refresh sent a `scope` parameter, which it doesn’t accept, or that `billing:attribution` is no longer registered for your app. At the code exchange, that second cause uses up the code.                                                                                                                                                                |
| `invalid_grant`               | The code has expired, you already used it, or it does not match the `redirect_uri` or `code_verifier`. For a refresh, the refresh token has expired or is no longer valid: follow [Refresh the tokens](https://platform.claude.com/docs/en/manage-claude/oauth-apps/organization-billing-connections#refresh-the-connection).                                                                                                                                                                                                                                                                                    |
| `unauthorized_client`         | Your app is not set up for this request. For Linked billing, first check the app’s operator service account and its workspace: see [The code exchange returns `unauthorized_client`](https://platform.claude.com/docs/en/manage-claude/oauth-apps/organization-billing-connections#code-exchange-unauthorized-client). For a [billing connection’s tokens](https://platform.claude.com/docs/en/manage-claude/oauth-apps/oauth-reference#oauth-tokens-for-a-billing-connection), `error_description` gives the cause, for example a missing workspace. This refusal uses up no code and revokes no refresh token. |
| `user_profile_already_linked` | Linked billing only, from the token endpoint. Between the approval and this request, the user profile was linked to your app through a different customer organization, or the customer’s organization was linked through a different user profile.                                                                                                                                                                                                                                                                                                                                                              |

If `auth.claude.com` rate-limits a request, has an outage, or receives an unknown `grant_type` or a parameter longer than its limit, it returns an error in a different format, which might not be JSON. Retry only on HTTP 429 and 5xx responses, with backoff. Treat any other status as a fault in the request. For a refresh of a billing connection, follow [Refresh the tokens](https://platform.claude.com/docs/en/manage-claude/oauth-apps/organization-billing-connections#refresh-the-connection) instead of a general backoff. If the response has a `retry-after` header, wait at least that long. Send the next request from your own code, and don’t rely on an HTTP client library’s automatic retries: they might not run for such a response. [Refresh the tokens](https://platform.claude.com/docs/en/manage-claude/oauth-apps/organization-billing-connections#refresh-the-connection) also says when a retry is safe, because a refresh token that was already used can end the connection when you send it again.

### Errors from the revocation endpoint

For most requests that `auth.claude.com` refuses, the revocation endpoint returns HTTP 400 and a JSON body with `error` and `error_description`.

| Error                 | When                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| --------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `invalid_request`     | A required parameter is missing or invalid, for example a missing `client_id`. The request sends none of `token`, `connection_id`, and `user_profile_id`, or more than one of them. An ID is malformed, for example it has the wrong prefix. A credential or `token` is in the URL query string. The user profile has too many connections for one request: the request might have ended some of them, so end the rest with `connection_id`. |
| `invalid_client`      | `auth.claude.com` could not authenticate your app. For what to check, see `invalid_client` in [Errors from the PAR and token endpoints](https://platform.claude.com/docs/en/manage-claude/oauth-apps/oauth-reference#errors-from-the-par-and-token-endpoints).                                                                                                                                                                               |
| `unauthorized_client` | Your app is not set up for this request. Contact your Anthropic account team.                                                                                                                                                                                                                                                                                                                                                                |

The responses in the next table use a different format, which might not be JSON. When the body is JSON, `error` is an object, not a string.

| Status | When                                                           | What to do                                                                                                                                                                                                                                                                                                                                                  |
| ------ | -------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| 400    | A parameter is longer than its limit.                          | Correct the request. Do not retry.                                                                                                                                                                                                                                                                                                                          |
| 429    | Too many failed requests came from your IP address.            | Retry with backoff.                                                                                                                                                                                                                                                                                                                                         |
| 500    | `auth.claude.com` failed to process the request.               | Retry with backoff. If it keeps happening, contact your Anthropic account team.                                                                                                                                                                                                                                                                             |
| 501    | Anthropic has not enabled this endpoint for your organization. | Do not retry. Contact your Anthropic account team.                                                                                                                                                                                                                                                                                                          |
| 503    | The request did not finish. Anything it ended stays ended.     | Retry with backoff, with the same parameters and a new client assertion. The retry finishes the rest, and its list leaves out connections that the earlier request ended. If you sent `user_profile_id`, retry within a day: after that, a retry can return 200 with an empty list and finish nothing. A retry with each `connection_id` works at any time. |

### Billing errors

These apply to Claude API requests that set `billing_policy.bill_to` to `"user_profile"` or that authenticate with [a billing connection’s access token](https://platform.claude.com/docs/en/manage-claude/oauth-apps/oauth-reference#oauth-tokens-for-a-billing-connection). The Claude API does not bill either organization for a refused request. None of the 402 and 403 responses is retryable, except a `user_profile_not_billable` refusal in the first 10 seconds after a new connection.

| Status | Error type and code                                        | When                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| ------ | ---------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| 400    | `invalid_request_error`                                    | The request sends `billing_policy` without the `user-profiles-billing-2026-10-01` beta header. Or the `billing_policy` object has a missing or invalid field. With a billing connection’s access token, `bill_to` can be left out. Or the request uses code execution outside the allowed combination.                                                                                                                                                                                                                                                                                                                               |
| 400    | `invalid_request_error`, `user_profile_required`           | `bill_to` is `"user_profile"`, the request does not include a user profile ID, and it does not authenticate with a billing connection’s access token.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| 400    | `invalid_request_error`, with no error code                | The request authenticates with a billing connection’s access token, and either sets `bill_to` to `"self"` or names a user profile other than the one the token is limited to. Each of these two refusals says what is wrong in `error.message`.                                                                                                                                                                                                                                                                                                                                                                                      |
| 401    | `authentication_error`                                     | The request authenticates with a billing connection’s access token that has expired, that a refresh has replaced, or whose connection has ended. The message says whether the token has expired or has been revoked. Send the request again with the current access token, or link the customer again if the connection has ended. After a connection ends, each new request with its access token can get this 401 or a 403 `user_profile_not_billable`, in no fixed order.                                                                                                                                                         |
| 402    | `billing_error`, `linked_organization_spend_limit_reached` | The customer organization has reached a spend limit it set for your OAuth app or for the whole organization. The Claude API sends the same code when the organization has no credit that can pay for the request. The response does not say which. Ask the customer to check both limits and its credit balance. [Expected errors](https://platform.claude.com/docs/en/manage-claude/oauth-apps/organization-billing-connections#expected-errors) for Linked billing says where each is set and what to change.                                                                                                                      |
| 402    | `billing_error`, `linked_organization_billing_unavailable` | Anthropic cannot currently bill the customer organization because of a problem with that organization’s own Anthropic account. The same code ends a reply that Claude has started when the organization’s credit runs out. Ask the customer to check its billing status with Anthropic.                                                                                                                                                                                                                                                                                                                                              |
| 403    | `permission_error`, with no error code                     | Anthropic does not bill your organization directly, so it cannot bill customers on your behalf.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| 403    | `permission_error`, `user_profile_not_billable`            | The user profile has no connection to a customer organization, an administrator or your back end ended the connection, the customer organization does not pay Anthropic directly for its API usage (prepaid credits and invoiced billing both count), or the request does not authenticate as your app’s service account. The response does not say which. A connection’s access token can also get it after the connection has ended. [Causes of `user_profile_not_billable`](https://platform.claude.com/docs/en/manage-claude/oauth-apps/organization-billing-connections#user-profile-not-billable) says what to check for each. |
| 503    | `overloaded_error`                                         | The Claude API temporarily cannot confirm whether it can bill the customer. Retry the request. If the response includes a `retry-after` header, wait that long before you retry.                                                                                                                                                                                                                                                                                                                                                                                                                                                     |

On `/v1/messages`, the error code is in `error.details.error_code`. On `/v1/chat/completions`, `error.type` is always `invalid_request_error`, `error.code` contains the Anthropic error type (for example `permission_error` or `billing_error`), and the response has no error code, so match on the HTTP status and `error.code`.

## Standards

| Standard                                                                           | Where it applies                                                                                                                                                  |
| ---------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [OAuth 2.0 (RFC 6749)](https://www.rfc-editor.org/rfc/rfc6749)                     | Authorization code flow, token endpoint, and error responses                                                                                                      |
| [PKCE (RFC 7636)](https://www.rfc-editor.org/rfc/rfc7636)                          | Required with `S256` on every authorization request                                                                                                               |
| [Pushed authorization requests (RFC 9126)](https://www.rfc-editor.org/rfc/rfc9126) | Required for Linked billing.                                                                                                                                      |
| [Token revocation (RFC 7009)](https://www.rfc-editor.org/rfc/rfc7009)              | The revocation endpoint, which also accepts connection and user profile IDs and returns the IDs of the connections it ended                                       |
| [JWT client authentication (RFC 7523)](https://www.rfc-editor.org/rfc/rfc7523)     | The `private_key_jwt` client authentication at the PAR, token, and revocation endpoints, and the service account token exchange for requests that bill a customer |

## Terms used on these pages

The following meanings apply only to Claude Platform OAuth.

| Term                               | Meaning                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| ---------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Claude organization                | An organization account with Anthropic. Your company has one, and so does each customer that links its organization for billing.                                                                                                                                                                                                                                                                                                                    |
| Administrator                      | A member of a Claude organization with the Admin or Billing role.                                                                                                                                                                                                                                                                                                                                                                                   |
| OAuth app                          | The registration in your Claude organization that identifies your product to `auth.claude.com`. It has a client ID, a name, a logo, a homepage URL, redirect URIs, and the connection types it supports.                                                                                                                                                                                                                                            |
| Connection type                    | Who approves a connection: an administrator on behalf of a whole organization (`organization_shared`, for Linked billing).                                                                                                                                                                                                                                                                                                                          |
| Identity provider                  | The service in your own infrastructure that signs short-lived JWTs for your back end and publishes its public keys as a JSON Web Key Set (JWKS), such as your cloud provider’s workload identity service or your own OIDC-compliant issuer. On these pages, “your identity provider” always means this service, not Anthropic.                                                                                                                      |
| Client assertion                   | A short-lived JWT that your identity provider signs and your back end sends to authenticate your OAuth app. This is the `private_key_jwt` client authentication method (RFC 7523).                                                                                                                                                                                                                                                                  |
| Pushed authorization request (PAR) | A request in which your back end sends the authorization parameters directly to `auth.claude.com` and receives a `request_uri` to use in the browser redirect (RFC 9126).                                                                                                                                                                                                                                                                           |
| Workload Identity Federation       | The Claude Console feature through which your organization registers your identity provider, so that Anthropic accepts JWTs signed with the keys in your JWKS.                                                                                                                                                                                                                                                                                      |
| Discovery document                 | The OIDC document that lists Anthropic’s issuer, endpoints, and signing keys.                                                                                                                                                                                                                                                                                                                                                                       |
| User profile                       | A record that you create in your own Claude organization to represent one of your customers. A billing connection links a user profile to the customer’s Claude organization.                                                                                                                                                                                                                                                                       |
| Service account                    | A non-human account in your Claude organization. For Linked billing, your OAuth app is linked to one service account, its operator service account, and your back end authenticates as that service account when it sends a request that bills a customer.                                                                                                                                                                                          |

Cut at 300 lines. The page has the rest.

manage-claude/oauth-apps/organization-billing-connections New page · 1839 lines, new page

## Eligible customers and endpoints ### Which credits can pay ## Setup process ### Step 1: Create the app ### Step 2: Set up client authentication ### Step 3: Set up your back end’s identity ### Which user profile to link #### A user profile for each person ## Link each customer ### Step 4: Create a user profile for the customer ### Step 5: Create a pushed authorization request URL ### Step 6: Send your user to the Claude approval page ### Step 7: The user approves ### Step 8: Handle the callback and save the connection ### Test as a customer ### If linking doesn’t complete #### Your redirect URI receives `error=access_denied` #### Your app receives `user_profile_already_linked` #### Your redirect URI receives nothing #### The code exchange returns `unauthorized_client` ### Publish your app ## Update calls to Claude ### Your customer pays ### You pay ## OAuth tokens for each connection ### Set up your app ### Scopes for a billing connection ### Store the tokens ### Call Claude with a connection’s access token ### Refresh the tokens ### Run an agent in a sandbox ### Link a customer again ### Turn off operator-only authentication ### OAuth token snippet initialization ## Managing your connections ### Viewing customers in Console ### Monitoring each customer’s usage ### Unlinking a customer ### Linking a customer to a different Claude organization ## Expected errors ### Causes of `user_profile_not_billable` ## Your customer’s view ### Linking ### After linking ### Emails about linking and unlinking ### Spend caps #### While your app is in testing ### Supporting your customers ## Code snippet initialization

A whole new page. There's nothing to diff it against, so here is what it says.

---
title: Linked billing
url: https://platform.claude.com/docs/en/manage-claude/oauth-apps/organization-billing-connections
description: Let your customers link their Claude Platform organization to your app with OAuth, and bill Claude usage to the customer's organization.
---

<Warning>
  Claude Platform OAuth is a Beta Service: prerelease software provided under your agreement with Anthropic, such as the [Commercial Terms of Service](https://www.anthropic.com/legal/commercial-terms), and the [Service Specific Terms](https://www.anthropic.com/legal/service-specific-terms). Endpoints, parameters, and behavior can change during the beta. It might not be suitable for production use.
</Warning>

Linked billing lets your customers pay for the Claude usage in your app through their own Claude organization. A customer links their Claude organization to your app once. The API calls this link a connection. After the customer has linked, you choose on each Claude API request whether the customer or you pays. The customer can unlink your app at any time. If a request you mark for the customer can’t be billed to them, the Claude API refuses it rather than billing you.

This guide is for developers whose app users are primarily Claude Platform customers. You add a “Link your Claude organization” button to your app. Your user clicks it, signs in to Claude, and approves your app to bill their Claude organization for the Claude API requests the customer directs you to make. Your app then adds a [`billing_policy`](https://platform.claude.com/docs/en/manage-claude/oauth-apps/organization-billing-connections#step-3-update-calls-to-claude) field to the requests that the customer pays for.

## Eligible customers and endpoints

**Eligible customers:** A customer can be billed this way only if their Claude Platform organization pays Anthropic directly for its API usage. Prepaid credits and invoiced billing both count. Organizations billed through a cloud marketplace (AWS, Google Cloud, or Azure) can’t be billed through this integration. The same is true of organizations that have only a Claude subscription plan. Requests for them are refused with 403 `user_profile_not_billable`.

Requests run in your organization, so your rate limits, model access, service tier, data retention, and encryption keys apply. Your customer’s own data arrangements don’t apply to these requests, including [zero data retention (ZDR)](https://platform.claude.com/docs/en/manage-claude/api-and-data-retention#zero-data-retention-zdr-scope), a business associate agreement (BAA), and customer-managed encryption keys (CMEK). Don’t link customers that need HIPAA, FERPA, or CMEK coverage for this usage.

**Supported endpoints:** `billing_policy` is supported on:

* `/v1/messages`
  * Known limitation: a request that bills your customer (`bill_to: "user_profile"`) can’t use [billable code execution features](https://platform.claude.com/docs/en/about-claude/pricing#code-execution-tool) (the API returns a 400), so send those requests with `bill_to: "self"` or without `billing_policy`.
* `/v1/chat/completions`
* `/v1/messages/count_tokens` accepts the `billing_policy` field and ignores it, so you can count tokens on the exact body you’re about to send.

[Message Batches](https://platform.claude.com/docs/en/build-with-claude/batch-processing) (`/v1/messages/batches`) doesn’t currently support billing your customer. Send the requests in a batch with `bill_to: "self"` or without `billing_policy`, and they’re billed to you as usual. A request in a batch that sets `bill_to: "user_profile"` is refused: its result is `errored` with an `invalid_request_error`, neither you nor your customer is billed for it, and the batch’s other requests run as usual.

To ask for support on another endpoint, contact your Anthropic account team.

### Which credits can pay

Not all credit can pay for a request that a platform bills to a customer. What can pay depends on the organization that’s billed: the customer if you bill a customer, or your organization if a platform bills you.

Credit bought in the Claude Console for that organization can pay for these requests. If that organization has invoiced billing, it’s invoiced for these requests.

Some promotional credits from Anthropic can’t pay for these requests. These include the monthly API credits that come with Claude Max, Ultra, and Team plans. Credits from Anthropic’s partner, VC, and startup programs aren’t eligible to pay for these requests.

When nothing on that organization’s account can pay for a request, the Claude API can refuse it with a 402. The response doesn’t say whether a lack of credit or a spend limit caused the refusal. See [Expected errors](https://platform.claude.com/docs/en/manage-claude/oauth-apps/organization-billing-connections#expected-errors).

## Setup process

You do these three steps once. They register your app with Anthropic. After them, [Which user profile to link](https://platform.claude.com/docs/en/manage-claude/oauth-apps/organization-billing-connections#which-user-profile-to-link) explains a rule that you need before you create user profiles.

### Step 1: Create the app

Create the OAuth app in the Claude Console. It is the registration that identifies your product to Anthropic: it ties your redirect URI to a client ID, and its name is what your user sees on the approval page.

A member of your organization with the Admin role opens the [OAuth apps](https://platform.claude.com/settings/oauth-apps) page in the Console and clicks **Create**. Enter your app’s name and redirect URI (the address in your app that the browser returns to after the approval). Under **What the app can do**, select **Bill and link to organizations**.

The new app’s page opens. Copy the client ID that the Console shows for the app. Your app sends it in Step 5 when it requests an approval page, in Step 6 when it redirects the browser, and in Step 8 when it exchanges the code, so that Anthropic knows which app is asking. The client ID is public. On the **Appearance** tab, set your app’s name, homepage, and logo URL.

On the **Settings** tab, **Who can link** reads **Test users only** for a new app, which starts in testing. After you [publish your app](https://platform.claude.com/docs/en/manage-claude/oauth-apps/organization-billing-connections#publish-your-app) and it is live, the setting reads **Any Claude user**.

<Note>
  An organization can register several OAuth apps, for example one for production and one for testing. Each app has its own connections: a customer who links your test app is not linked to your production app. Keep Linked billing on one production app for the life of your integration.
</Note>

### Step 2: Set up client authentication

Set up how your back end proves to `auth.claude.com` that its requests come from your app. This takes the place of a client secret: Anthropic does not issue client secrets for OAuth apps.

On the app’s **Client authentication** tab, select your **Identity provider** (the issuer that signs your back end’s tokens). To add one, click **Register a new issuer**. Then set a **Subject pattern**, or claim conditions under **Advanced match options**, that those tokens must match. After you save, the tab shows the expected audience. Your client assertion’s `aud` claim must be exactly that value.

<Note>
  Your app authenticates to the PAR, token, and revocation endpoints with a variation of the `private_key_jwt` method (RFC 7523): with each request, your back end sends a client assertion, a JWT that your identity provider issues. `auth.claude.com` checks the token’s signature with the keys registered for that issuer, and checks it against the subject or claim conditions you set here. For the claims a client assertion must contain, see [Client assertion claims](https://platform.claude.com/docs/en/manage-claude/oauth-apps/oauth-reference#client-assertion-claims).
</Note>

### Step 3: Set up your back end’s identity

Your back end needs an identity of its own to call the Claude API. Create two things:

* **A service account.** This is a non-human account in your Claude organization. Your back end authenticates as this account when it calls the Claude API.
* **A second federation rule.** Like the rule for the app’s client authentication in Step 2, it lets your back end authenticate with tokens from your own identity provider.

To set them up in the Claude Console, follow the [Workload Identity Federation](https://platform.claude.com/docs/en/manage-claude/workload-identity-federation) guide.

Then, on the app’s **Client authentication** tab, select that service account as the app’s operator service account. Only that service account is authorized to send inference requests and attribute billing to the linked user profiles. A service account can be the operator of only one OAuth app.

By default, any authenticated request as that service account can bill every linked customer, by setting the user profile header and `bill_to` in the Messages API. To obtain authentication tokens constrained only to a specific connection, see [OAuth tokens for each connection](https://platform.claude.com/docs/en/manage-claude/oauth-apps/organization-billing-connections#oauth-tokens-for-each-connection). Before you link customers, [set a workspace](https://platform.claude.com/docs/en/manage-claude/oauth-apps/organization-billing-connections#settings-for-a-connections-oauth-tokens) for your app. Step 8 returns such a token for each customer, and requires the app to specify a default workspace in your organization against which inference runs. If you want refresh tokens for each connection, also turn on **Offline access** for your app. Then request `offline_access` in the authorization flow, in Step 5, before you link customers.

### Which user profile to link

A user profile is a record in your own Claude organization that represents one of your customers. Each request that bills the customer includes the profile’s ID, so that Anthropic knows which customer to bill. For the rest of what profiles do, see [User profiles for end-customer attribution](https://platform.claude.com/docs/en/manage-claude/user-profiles).

Settle which user profile stands for each customer before you link your first customer. Within one app, connections are one to one:

* A customer’s Claude organization can be linked to only one of your user profiles.
* A user profile can be linked to only one Claude organization.

The customer’s Claude organization is the one that the user selects when they approve your app. To learn how a customer’s teams use Claude organizations, ask the customer. To apply the one-to-one rule to your customer records:

* **Several teams of one customer share a Claude organization:** Use one user profile for all of the teams.
* **Each team has its own Claude organization:** Create a user profile for each organization.

Any active user profile in your organization can be linked, as long as the one-to-one rule holds. Linking doesn’t change the profile, its ID, or its usage history. If you link a second user profile to a Claude organization that is already linked, the approval is refused: see [`user_profile_already_linked`](https://platform.claude.com/docs/en/manage-claude/oauth-apps/organization-billing-connections#user-profile-already-linked).

#### A user profile for each person

You might already have a user profile for each person who uses your product. Several of those people might work for the same customer. In that case, Anthropic recommends that you create one more user profile for the customer’s Claude organization and link that profile.

The profile ID to send depends on who pays for the request:

* **Requests that you bill to the customer:** Send the ID of the customer’s profile. To also identify the person on a `/v1/messages` request, set [`metadata.user_id`](https://platform.claude.com/docs/en/api/messages/create) to an identifier for that person. This identifier is optional and helps Anthropic detect misuse by one person. Use an opaque value, not a name, an email address, or a phone number.
* **Requests that you pay for:** You can keep sending the person’s own profile ID.

## Link each customer

You do Steps 4 to 8 for each customer that links their organization. The following Python code snippets require the Anthropic SDK and some standard imports; see [Code snippet initialization](https://platform.claude.com/docs/en/manage-claude/oauth-apps/organization-billing-connections#code-snippet-initialization). The examples in other languages and the CLI take their credentials from the environment. Ensure `ANTHROPIC_API_KEY` is not set, because your app needs to authenticate with Workload Identity Federation.

Add a “Link your Claude organization” button where your customers manage billing or integrations in your product (for the button’s HTML, colors, and logo, see [Branding samples](https://platform.claude.com/docs/en/manage-claude/oauth-apps/branding-samples#buttons)). Tell them that to link, they must have the Admin or Billing role in their Claude organization.

To go through the steps yourself first, see [Test as a customer](https://platform.claude.com/docs/en/manage-claude/oauth-apps/organization-billing-connections#test-as-a-customer).

<Frame>
  ![Sequence diagram of Steps 5 to 8: the approval request, the user's approval, and the exchange for a connection ID](https://platform.claude.com/docs/images/oauth-apps-billing-connection-flow.svg)
</Frame>

### Step 4: Create a user profile for the customer

Create one user profile for each customer’s Claude organization, and store the profile’s ID against the customer’s record in your product.

If you already have a user profile for this customer’s Claude organization, skip this step and use that profile’s ID. To decide which profile that is, see [Which user profile to link](https://platform.claude.com/docs/en/manage-claude/oauth-apps/organization-billing-connections#which-user-profile-to-link).

<CodeGroup>
  ```bash cURL
  curl https://api.anthropic.com/v1/user_profiles \
    -H "Authorization: Bearer $ACCESS_TOKEN" \
    -H "anthropic-version: 2026-10-21" \
    -H "content-type: application/json" \
    -d '{
      "name": "Example Customer Inc.",
      "external_user_details": {"reference_id": "your-customer-id-123"}
    }'
  ```

  ```bash CLI
  ant user-profiles create \
    --name "Example Customer Inc." \
    --external-user-details.reference-id your-customer-id-123
  ```

  ```python Python
  def create_user_profile(name: str, customer_id: str) -> str:
      profile = client.user_profiles.create(
          name=name,
          external_user_details={"reference_id": customer_id},
      )
      return profile.id  # "uprof_..."


  user_profile_id = create_user_profile("Example Customer Inc.", "your-customer-id-123")
  ```

  ```typescript TypeScript
  const client = new Anthropic();

  const profile = await client.userProfiles.create({
    name: "Example Customer Inc.",
    external_user_details: { reference_id: "your-customer-id-123" }
  });

  console.log(profile.id); // "uprof_..."
  ```

  ```csharp C#
  AnthropicClient client = new();

  var profile = await client.UserProfiles.Create(
      new()
      {
          Name = "Example Customer Inc.",
          ExternalUserDetails = new() { ReferenceID = "your-customer-id-123" },
      }
  );

  Console.WriteLine(profile.ID);
  ```

  ```go Go
  client := anthropic.NewClient()

  profile, err := client.UserProfiles.New(context.Background(), anthropic.UserProfileNewParams{
  	Name: anthropic.String("Example Customer Inc."),
  	ExternalUserDetails: anthropic.UserProfileExternalUserDetailsParams{
  		ReferenceID: anthropic.String("your-customer-id-123"),
  	},
  })
  if err != nil {
  	log.Fatal(err)
  }

  fmt.Println(profile.ID)
  ```

  ```java Java
  import com.anthropic.models.userprofiles.UserProfileCreateParams;
  import com.anthropic.models.userprofiles.UserProfileExternalUserDetailsParams;

  void main() {
      AnthropicClient client = AnthropicOkHttpClient.fromEnv();

      var params = UserProfileCreateParams.builder()
          .name("Example Customer Inc.")
          .externalUserDetails(UserProfileExternalUserDetailsParams.builder()
              .referenceId("your-customer-id-123")
              .build())
          .build();
      var profile = client.userProfiles().create(params);

      IO.println(profile.id());
  }
  ```

  ```php PHP
  $client = new Client();

  $profile = $client->userProfiles->create(
      name: 'Example Customer Inc.',
      externalUserDetails: ['referenceID' => 'your-customer-id-123'],
  );

  echo $profile->id, PHP_EOL;
  ```

  ```ruby Ruby
  client = Anthropic::Client.new

  profile = client.user_profiles.create(
    name: "Example Customer Inc.",
    external_user_details: { reference_id: "your-customer-id-123" }
  )

  puts(profile.id)
  ```
</CodeGroup>

If your organization resells API access, also send `"access_type": "passthrough"` when you create this profile. These samples leave `access_type` out, which creates an `application` profile. For the two types, see [Decide who gets a profile](https://platform.claude.com/docs/en/manage-claude/user-profiles#decide-who-gets-a-profile).

The response contains the profile’s `id`, for example `uprof_01HV9Z`.

<Note>
  Every create request makes a new profile, even with the same `reference_id` (your own ID for the customer), so reuse the stored ID instead of creating a profile on every connection attempt.
</Note>

### Step 5: Create a pushed authorization request URL

Create a pushed authorization request that references the customer’s user profile from Step 4. The response gives you a `request_uri`. In the next step, you use it to redirect your user to the approval page.

Before it sends the request, your back end creates two random values and stores them against the browser session and the customer record. It uses both again in Step 8:

* A `state` value, which lets you check that the browser that comes back to your app is the one that started this request.
* A PKCE code verifier, a secret that only your back end knows. The request carries a hash of it (the code challenge), and Step 8 sends the verifier itself, so that only your back end can use the code that comes back.

<CodeGroup exclude="shell:CLI, typescript, csharp, go, java, php, ruby">
  ```bash cURL
  curl https://auth.claude.com/v1/oauth/par \
    -H "content-type: application/json" \
    -d '{
      "response_type": "code",
      "client_id": "YOUR_CLIENT_ID",
      "redirect_uri": "https://app.example.com/claude/billing/callback",
      "scope": "billing:attribution",
      "connection_type": "organization_shared",
      "connection_auth_target": "platform",
      "user_profile_id": "uprof_01HV9Z",
      "state": "RANDOM_STATE",
      "code_challenge": "BASE64URL_SHA256_OF_VERIFIER",
      "code_challenge_method": "S256",
      "client_assertion_type": "urn:ietf:params:oauth:client-assertion-type:jwt-bearer",
      "client_assertion": "YOUR_CLIENT_ASSERTION_JWT"
    }'
  ```

  ```python Python
  def push_authorization_request(user_profile_id: str) -> dict:
      state = secrets.token_urlsafe(32)
      code_verifier = secrets.token_urlsafe(64)
      code_challenge = create_s256_code_challenge(code_verifier)

      response = httpx.post(
          f"{AUTH}/v1/oauth/par",
          json={
              "response_type": "code",
              "client_id": CLIENT_ID,
              "redirect_uri": REDIRECT_URI,
              "scope": "billing:attribution",
              "connection_type": "organization_shared",
              "connection_auth_target": "platform",
              "user_profile_id": user_profile_id,
              "state": state,
              "code_challenge": code_challenge,
              "code_challenge_method": "S256",
              "client_assertion_type": JWT_BEARER,
              "client_assertion": client_assertion(),
          },
      )
      response.raise_for_status()  # on an error, do not redirect the browser

Cut at 300 lines. The page has the rest.

manage-claude/oauth-apps/overview New page · 64 lines, new page

## What you can build ### Let customers pay for their own Claude usage ## How it works ## One-time OAuth app setup ## Next steps

A whole new page. There's nothing to diff it against, so here is what it says.

---
title: Claude Platform OAuth
url: https://platform.claude.com/docs/en/manage-claude/oauth-apps/overview
description: Let your customers pay for the Claude usage in your product from their own Claude organization.
---

<Warning>
  Claude Platform OAuth is a Beta Service: prerelease software provided under your agreement with Anthropic, such as the [Commercial Terms of Service](https://www.anthropic.com/legal/commercial-terms), and the [Service Specific Terms](https://www.anthropic.com/legal/service-specific-terms). Endpoints, parameters, and behavior can change during the beta. It might not be suitable for production use.
</Warning>

Claude Platform OAuth lets your users bill their Claude organization for usage within your app.

## What you can build

### Let customers pay for their own Claude usage

When your product calls Claude, the usage can be billed to your customers’ own Claude organization. Your users click a **Link your Claude organization** button, sign in to Claude, and approve your app. For Linked billing, the user must have the Admin or Billing role in their Claude organization.

After that:

* You choose on each Claude API request whether the customer pays or you pay.
* If a request you mark for the customer can’t be billed to them, the Claude API rejects it rather than billing you.
* The customer can unlink your app at any time.
* You may bill a customer only for the requests they direct you to make, never for your own usage.

You support your customers: Anthropic provides the approval page and the Claude Console page where they set a spend cap or unlink your app, and all other questions about your app come to you.

Linked billing works for customers whose Claude organization pays Anthropic directly for its API usage. It doesn’t work for organizations billed through a cloud marketplace. See [Linked billing](https://platform.claude.com/docs/en/manage-claude/oauth-apps/organization-billing-connections).

## How it works

Linked billing follows a short round trip. The person leaves your product for Claude’s approval page once, approves your app there, and comes back:

<Frame>
  ![Sequence diagram: the person approves your app at auth.claude.com, then your back end exchanges the one-time code](https://platform.claude.com/docs/images/oauth-apps-billing-round-trip.svg)
</Frame>

The approval page shows your app’s name and what your app is asking for, so the person knows what they’re approving.

<Note>
  If you’ve worked with OAuth before: Claude Platform OAuth uses the OAuth 2.0 authorization code flow with PKCE, with Anthropic as the authorization server.
</Note>

## One-time OAuth app setup

Linked billing starts with these one-time setup steps in the Claude Console. The [Linked billing](https://platform.claude.com/docs/en/manage-claude/oauth-apps/organization-billing-connections#setup-process) guide walks you through them.

1. **Create the app.** A member of your Claude organization with the Admin role creates an OAuth app in the Claude Console and copies its client ID. The app holds the name that people see on the approval page, and the address in your product that they return to.
2. **Set up client authentication.** Instead of a client secret, your back end proves that a request comes from your app with a short-lived token from your own identity provider, such as AWS, Google Cloud, Microsoft Entra ID, or Kubernetes. You select the identity provider, and which of its tokens to accept, on the app’s **Client authentication** tab.
3. **Set up your back end’s identity.** Create a service account and a second federation rule with [Workload Identity Federation](https://platform.claude.com/docs/en/manage-claude/workload-identity-federation), and select the service account as the app’s operator service account.

## Next steps

The Linked billing guide walks you through setup and your first linked customer.

<CardGroup cols={3}>
  <Card title="Linked billing" icon="coins" href="https://platform.claude.com/docs/en/manage-claude/oauth-apps/organization-billing-connections">
    Let your customers pay for the Claude usage in your product from their own Claude organization
  </Card>

  <Card title="OAuth reference" icon="book" href="https://platform.claude.com/docs/en/manage-claude/oauth-apps/oauth-reference">
    Endpoints, parameters, token responses, lifetimes, and errors
  </Card>
</CardGroup>

release-notes/overview Changed · +4 / -0 lines

### November 17, 2026

from line 12
1212 For updates to Claude Code, see the [complete CHANGELOG.md](https://github.com/anthropics/claude-code/blob/main/CHANGELOG.md) in the `claude-code` repository.
1313</Tip>
1414 
15### November 17, 2026
16 
17* We’ve launched [Linked billing](https://platform.claude.com/docs/en/manage-claude/oauth-apps/organization-billing-connections) in beta with the `user-profiles-billing-2026-10-01` beta header. Your customers can now pay for the Claude usage in your app through their own Claude organization. Once a customer links their organization, set `billing_policy` on each `/v1/messages` or `/v1/chat/completions` request to choose who pays. In the Claude Console, customers can set a spend cap for your app or unlink your app. Linked billing works for customers whose organization pays Anthropic directly for API usage.
18 
1519### November 16, 2026
1620 
1721* Text generated by Claude Opus 4.6, Claude Opus 4.5, Claude Sonnet 4.5, and Claude Haiku 4.5 carries Anthropic’s text watermark on supported platforms. [How Claude marks AI-generated content](https://support.claude.com/en/articles/16266773-how-claude-marks-ai-generated-content) lists those platforms. If a request to one of these models sets `temperature`, `top_p`, or `top_k` to a non-default value, the text might not carry the watermark. See [Text watermark](https://platform.claude.com/docs/en/build-with-claude/text-watermark).

api/beta/agents/archive Changed · +2 / -0 lines

from line 121
121121 
122122 - `"experimental-claude-tag-2026-10-21"`
123123 
124 - `"user-profiles-billing-2026-10-01"`
125 
124126 - `"message-batches-2024-09-24"`
125127 
126128 **Deprecated**: This value is no longer needed. Remove it from your requests.

api/beta/agents/create Changed · +2 / -0 lines

from line 115
115115 
116116 - `"experimental-claude-tag-2026-10-21"`
117117 
118 - `"user-profiles-billing-2026-10-01"`
119 
118120 - `"message-batches-2024-09-24"`
119121 
120122 **Deprecated**: This value is no longer needed. Remove it from your requests.

api/beta/agents/list Changed · +2 / -0 lines

from line 143
143143 
144144 - `"experimental-claude-tag-2026-10-21"`
145145 
146 - `"user-profiles-billing-2026-10-01"`
147 
146148 - `"message-batches-2024-09-24"`
147149 
148150 **Deprecated**: This value is no longer needed. Remove it from your requests.

api/beta/agents/retrieve Changed · +2 / -0 lines

from line 129
129129 
130130 - `"experimental-claude-tag-2026-10-21"`
131131 
132 - `"user-profiles-billing-2026-10-01"`
133 
132134 - `"message-batches-2024-09-24"`
133135 
134136 **Deprecated**: This value is no longer needed. Remove it from your requests.

api/beta/agents/update Changed · +2 / -0 lines

from line 121
121121 
122122 - `"experimental-claude-tag-2026-10-21"`
123123 
124 - `"user-profiles-billing-2026-10-01"`
125 
124126 - `"message-batches-2024-09-24"`
125127 
126128 **Deprecated**: This value is no longer needed. Remove it from your requests.

api/beta/agents/versions/list Changed · +2 / -0 lines

from line 133
133133 
134134 - `"experimental-claude-tag-2026-10-21"`
135135 
136 - `"user-profiles-billing-2026-10-01"`
137 
136138 - `"message-batches-2024-09-24"`
137139 
138140 **Deprecated**: This value is no longer needed. Remove it from your requests.

api/beta/deployment_runs/list Changed · +2 / -0 lines

from line 171
171171 
172172 - `"experimental-claude-tag-2026-10-21"`
173173 
174 - `"user-profiles-billing-2026-10-01"`
175 
174176 - `"message-batches-2024-09-24"`
175177 
176178 **Deprecated**: This value is no longer needed. Remove it from your requests.

api/beta/deployment_runs/retrieve Changed · +2 / -0 lines

from line 121
121121 
122122 - `"experimental-claude-tag-2026-10-21"`
123123 
124 - `"user-profiles-billing-2026-10-01"`
125 
124126 - `"message-batches-2024-09-24"`
125127 
126128 **Deprecated**: This value is no longer needed. Remove it from your requests.

api/beta/deployments/archive Changed · +2 / -0 lines

from line 121
121121 
122122 - `"experimental-claude-tag-2026-10-21"`
123123 
124 - `"user-profiles-billing-2026-10-01"`
125 
124126 - `"message-batches-2024-09-24"`
125127 
126128 **Deprecated**: This value is no longer needed. Remove it from your requests.

api/beta/deployments/create Changed · +2 / -0 lines

from line 115
115115 
116116 - `"experimental-claude-tag-2026-10-21"`
117117 
118 - `"user-profiles-billing-2026-10-01"`
119 
118120 - `"message-batches-2024-09-24"`
119121 
120122 **Deprecated**: This value is no longer needed. Remove it from your requests.

api/beta/deployments/list Changed · +2 / -0 lines

from line 159
159159 
160160 - `"experimental-claude-tag-2026-10-21"`
161161 
162 - `"user-profiles-billing-2026-10-01"`
163 
162164 - `"message-batches-2024-09-24"`
163165 
164166 **Deprecated**: This value is no longer needed. Remove it from your requests.

api/beta/deployments/pause Changed · +2 / -0 lines

from line 121
121121 
122122 - `"experimental-claude-tag-2026-10-21"`
123123 
124 - `"user-profiles-billing-2026-10-01"`
125 
124126 - `"message-batches-2024-09-24"`
125127 
126128 **Deprecated**: This value is no longer needed. Remove it from your requests.

api/beta/deployments/retrieve Changed · +2 / -0 lines

from line 121
121121 
122122 - `"experimental-claude-tag-2026-10-21"`
123123 
124 - `"user-profiles-billing-2026-10-01"`
125 
124126 - `"message-batches-2024-09-24"`
125127 
126128 **Deprecated**: This value is no longer needed. Remove it from your requests.

api/beta/deployments/run Changed · +2 / -0 lines

from line 121
121121 
122122 - `"experimental-claude-tag-2026-10-21"`
123123 
124 - `"user-profiles-billing-2026-10-01"`
125 
124126 - `"message-batches-2024-09-24"`
125127 
126128 **Deprecated**: This value is no longer needed. Remove it from your requests.

api/beta/deployments/unpause Changed · +2 / -0 lines

from line 121
121121 
122122 - `"experimental-claude-tag-2026-10-21"`
123123 
124 - `"user-profiles-billing-2026-10-01"`
125 
124126 - `"message-batches-2024-09-24"`
125127 
126128 **Deprecated**: This value is no longer needed. Remove it from your requests.

api/beta/deployments/update Changed · +2 / -0 lines

from line 121
121121 
122122 - `"experimental-claude-tag-2026-10-21"`
123123 
124 - `"user-profiles-billing-2026-10-01"`
125 
124126 - `"message-batches-2024-09-24"`
125127 
126128 **Deprecated**: This value is no longer needed. Remove it from your requests.
Feedback