Anthropic launched linked billing in beta on November 17, 2026. Customers can pay for Claude usage inside another company's app without handing over their API keys. That app now needs a reliable way to end the billing connection, including when an unlink request only partly succeeds.
Consider a delayed retry: a customer disconnects, later approves a new connection, and an old cleanup job runs again. Anthropic warns that a retry scoped to the whole user profile can end the new connection too. Preserve the connection IDs from the original operation so recovery targets the approval you intended to remove.
This guide is for providers integrating the Claude API into their apps. It proposes an offboarding procedure based on Anthropic's current API contracts. General Analysis has not linked customer organizations or tested these calls. Use it alongside the broader AI spending controls; unlinking is one part of stopping an unattended workflow.
Decide what the customer is stopping#
Separate a request to stop customer billing from a request to stop the application processing the customer's data. The provider can enforce the former while your application continues the latter at its own expense.
Anthropic's customer guide says new calls usually stop within about 10 seconds after unlinking. Calls already running finish and remain billed to the customer. That is not an immediate cancellation guarantee.
For a full disconnect, we recommend closing your application's admission gate before calling the provider: stop dispatching queued inference, stop token-refresh workers for the affected connection, and stop scheduling new tool actions. Record requests already dispatched and reconcile their outcomes. A billing revocation cannot retract an external action that already happened.
Do not automatically resend a rejected customer-funded call as platform-funded. Anthropic refuses an unbillable customer request rather than charging your app. Continuing at your expense is an application decision. Require a separate, explicit policy for it, especially after a disconnect.
The processing boundary also stays with the app. The launch announcement says the customer's IP allowlists, encryption keys, and retention settings do not apply to these requests. Paying from a customer organization does not move the request there.
See how your AI systems hold up under real attacks
General Analysis maps AI applications and agents, red teams prompts, retrieval, tools, MCP servers, browser actions, permissions, and business workflows, then turns findings into evidence your team can reproduce and retest.
Keep the connection identity before cleanup starts#
Store the OAuth app ID, your authenticated customer identifier, the corresponding user profile ID, and each returned connection ID when linking. Keep tokens in a secret store, separate from the operational record. The OAuth reference returns connection_id on the authorization-code exchange, not on refresh.
Give that record a revision number in your application, and advance it when a new approval replaces the old one. Save the IDs and revision the offboarding job is removing before it starts; a later callback must not overwrite them.
For example, a cleanup job for connection A should continue to name A after the customer creates connection B. Do not resolve "the customer's current connection" afresh on every retry. That turns a retry of an old decision into a new revocation decision.
Serialize linking, unlinking, and refresh-state updates for that customer in your own system. Check the stored revision again before publishing a refreshed credential or changing the local access state. This is our concurrency recommendation, not an atomicity guarantee from Anthropic.
Choose a revocation target deliberately#
The OAuth revocation endpoint accepts app client authentication and exactly one target. Its scope matters more than the choice of HTTP client.
| Target | Provider scope | Operational use |
|---|---|---|
connection_id | One connection belonging to your app | Recover an earlier disconnect without selecting a newer approval. |
user_profile_id | Your app's connections on that profile | Disconnect the profile's current connections when that broader action is intended. |
token | Normally its connection and that connection's tokens | Check the original scope: a legacy org:billing_attribution access token is an exception and revokes only that token. |
Prefer the stored connection ID for the recovery job. This adapted request body goes to POST https://auth.claude.com/v1/oauth/revoke. Replace the placeholders through your approved credential loader; the assertion's audience is the configured app audience, not the endpoint URL.
Code source: Anthropic OAuth reference, adapted with illustrative placeholders.
{
"connection_id": "ocon_ORIGINAL_CONNECTION",
"client_id": "YOUR_OAUTH_APP_CLIENT_ID",
"client_assertion_type": "urn:ietf:params:oauth:client-assertion-type:jwt-bearer",
"client_assertion": "JWT_FROM_YOUR_IDENTITY_PROVIDER"
}
A 200 response contains revoked_connection_ids. An empty list is ambiguous: it can describe an already-ended connection, an unknown or wrong-app identifier, or a request that ended only a token. Match the response to your saved target and original linking record before treating cleanup as complete.
Recover a partial unlink without selecting a new approval#
The Claude API also supports POST /v1/user_profiles/{id}/unlink with oauth_app_id, authenticated as the app's operator service account. It requires user-profiles-search-2026-08-30. Anthropic's unlink procedure documents a specific recovery rule:
- A 503 can mean that only some connections ended. Within one day of the first request, retry with backoff until a 200 response, provided the customer has not linked again.
- After one day, revoke each original stored
connection_idindividually. A late profile-level retry can return 200 with an empty list while leaving residual tokens or billing access. - Use the original connection IDs if the customer may have linked again, even within that first day. Repeating the profile-wide unlink can revoke the new connection.
Save the first-attempt time and retry state before sending the request. A timer that resets after a crash can make a late retry look safe. Preserve the original IDs even when the provider marks a connection ended; they are still the recovery targets.
If those IDs are missing, keep the operation unresolved and investigate the original linking records. An empty response from a broader retry cannot recover that evidence. For authentication failures or an unavailable revocation endpoint, follow the documented error handling instead of retrying every status. OAuth revocation retries keep the same target parameters but need a fresh client assertion.
Verify billing, credentials, and application state separately#
Token expiry alone does not unlink a customer. By default, the operator service account can still bill linked customers after a connection access token expires. If you adopt connection-only billing, migrate and verify every customer's token path before enabling disable_operator_only_auth.
The OAuth reference also distinguishes modern and legacy scopes. A billing:attribution connection's tokens stop working when it ends. An access token from a deprecated org:billing_attribution connection may remain usable until expiry even though customer billing is refused. Keep that credential out of your execution environment during offboarding.
Use synthetic fixtures first for these acceptance cases. Any live integration check needs a permitted test organization and non-sensitive work; these are proposed checks, not measured results.
| Case | Evidence required before closing the operation |
|---|---|
| A queued job wakes after local disconnect | It makes no inference or tool request under the retired connection. |
| Unlink returns 503 and the worker restarts | The original timestamp and connection IDs survive; the local hold remains. |
| A new approval arrives before retry | Recovery names only the original IDs; it does not revoke the replacement. |
| Revocation returns 200 with an empty list | The target matches a retained linking record; ambiguity is investigated rather than counted as proof. |
| An old token fails but operator credentials remain | The billing path is checked separately; token failure alone cannot close the case. |
| The customer-billed request is refused | No hidden platform-funded retry or new tool action occurs. |
Read the profile's link status with your app ID using the documented status lookup, and retain the observation time. An Unlinked status, revocation response, credential result, and local queue state answer different questions. Keep them together in the offboarding record, including any requests that were already running.
Provider enforcement status is another separate signal. The user-profile enforcement guide covers restrictions and local suspensions; neither a new billing approval nor a successful cleanup should clear an independent security hold.
Frequently asked questions
- Does unlinking Claude billing stop an agent's work?
Unlinking stops new customer-billed calls after propagation, usually about 10 seconds. Calls already running finish and are billed to the customer. Your application must separately stop queued work, tool actions, and any platform-funded continuation when the customer's intent is to stop the workflow.
- Does an empty revoked_connection_ids list prove revocation?
No. It can mean that a connection already ended, the identifier is unknown or belongs to another app, or only a token ended. Preserve the original connection ID and request context, follow the endpoint's recovery contract, and verify the resulting state.
- Do the customer's retention and encryption settings follow linked billing?
No. Requests run in the app provider's Claude organization. The customer's IP allowlists, encryption keys, and data retention settings do not apply to those requests. Review the processing arrangement before linking.

