Large Model Billing Shifts to "Customer Direct Pay": A Practical Guide to OAuth Linked Billing

    Traditional large model API billing is moving from developer fronting to customer direct pay. This article breaks down OAuth Linked Billing, including authorization, per-request payer selection, spending limits, data boundaries, and launch checklist.

    1. From Developer Fronting to Customer Direct Pay: Rebuilding the Billing Chain

    In the traditional large model API integration model, platforms or developers often purchase compute capacity and usage quotas from a model service provider, package the capabilities into their own products, and then resell access to customers based on usage or subscription.

    This approach lowers the barrier to entry in the early stages of a business, but it also concentrates funding pressure, key management risk, and cost allocation issues on the supply side.

    As large model applications evolve from “single calls” to agent scenarios with long chains, high frequency, and multi-tool coordination, usage often correlates closely with customer depth of use, amplifying cost and revenue mismatches:

    • The more a customer uses, the more the platform fronts, while collection cycles and payment terms create additional pressure.
    • If keys are leaked in third-party tools, outsourced collaboration, or debugging environments, losses from unauthorized use are largely borne by the platform itself.

    The recent “OAuth Linked Billing” test capability is a direct response to these billing chain pain points. After a user authorizes once within a third-party AI application, the user can link their organization on the model service platform to that application. Subsequent API calls triggered by the application are billed directly to the customer’s own account, with the customer bearing the cost instead of the developer fronting it centrally.

    It is important to clarify that this mechanism does not change the technical implementation of model calls themselves. Instead, it changes the settlement chain of who pays, how authorization works, how spending is controlled, and how costs are attributed. For developers, it is more like compressing the original two-stage accounting structure of “platform fronting first, then reselling” into a one-stage structure of “customer direct pay, platform capability delivery”.

    2. Core Mechanism Breakdown: Authorization, Binding, and Per-Request Payer Selection

    The key to this capability is using OAuth authorization as a trust anchor to establish a controlled binding between the “application” and the “customer’s organization on the model service platform” rather than simply sharing keys. The overall flow can be abstracted into three steps:

    1. Application Initiates Binding: The customer clicks an entry similar to “Link your model platform organization” within the application and enters the authorization flow.
    2. Complete Authorization Validation: The customer logs in to their model service platform account and must have the Admin or Billing role for that organization to complete organization-level authorization. This step essentially confirms the permission boundary of who can represent the organization to bear costs.
    3. Select Payer Per Request: After binding is complete, developers can choose whether each API call is borne by the customer or themselves, enabling differentiated billing for different businesses, different customers, and different stages within the same application.

    The “select payer per request” design is critical. It avoids the rigid binding of “once linked, all costs are borne by the customer” and allows the platform to flexibly handle multiple scenarios within the same codebase, such as:

    • Calls during free trials or onboarding are borne by the platform, reducing customer decision costs.
    • Calls during deep usage and formal business traffic are paid directly by the customer, ensuring cost transparency.
    • Calls for platform internal operations, quality inspection, stress testing, and other non-customer-benefit behaviors are borne by the platform itself, avoiding mixing into customer bills.

    Illustrative pseudocode (used only to explain the payer selection logic on the call side, not corresponding to any specific interface):

    1. auth_context = oauth_linked_binding(org_id, app_id) # Context after customer authorized binding
    2. for request in batch:
    3. payer = decide_payer(request) # Business policy decides who pays
    4. # payer value examples: CUSTOMER_ORG or PLATFORM_SELF
    5. call_model_api(request.payload, billing_subject=payer, trace_id=request.id)

    From an engineering perspective, this capability requires the application side to have two foundational abilities: “billing context passthrough” and “observable attribution”. Every call should clearly mark the payer, organization identifier, and trace ID for subsequent reconciliation, troubleshooting, and usage analysis.

    3. Permission, Quota, and Cost Governance: Controlling Risk at the Authorization Stage

    Linked billing transfers cost responsibility to customers, but this does not mean platforms can abandon governance responsibility. Instead, cost governance must be moved forward to the authorization and quota stages, otherwise two types of problems may occur:

    1. Customer organizations are mislinked or incorrectly linked, causing chaotic cost attribution.
    2. Abnormal calls or malicious volume inflation occur on the application side, with customers bearing the losses.

    According to the test phase rules, users have three key control measures:

    • Role Constraints: Only the Admin or Billing role of the organization can complete authorization, avoiding accidental operations by ordinary members leading to organization-level cost linkage.
    • Cost Visibility: Customers can view cost details generated by each application on the “Linked Platforms” page of the console.
    • Spending Limits and Unlinking: Customers can set a monthly spending cap and unlink at any time. Applications in the test phase must set a monthly limit not exceeding 50 USD (approximately 334 RMB, at current exchange rate).

    For developers, this means product design must build in “limit-friendly calling strategies”. For example, in high-consumption scenarios (long context, batch tasks, concurrent agents), mechanisms such as usage estimation, segmented execution, result caching, and retry limits should be provided to avoid a single task breaking through the customer’s monthly limit and causing experience interruption.

    At the same time, the platform side should establish application-level anomaly monitoring: alert on sudden call volume spikes, soaring error rates, and repeated request patterns for single customers, single applications, and single time periods, and support rapid rate reduction or binding suspension when necessary to reduce customer losses and trust risks.

    4. Data and Compliance Boundaries: Requests Still Run in the Developer’s Organization

    This mechanism transfers costs to customers in settlement, but does not change the execution entity of requests at the data and compliance level. The model service provider explicitly states that related requests actually run in the developer’s own organization, so the following configurations are effective based on the developer organization:

    • Developer’s rate limit;
    • Model access permissions;
    • Service tier;
    • Data retention policy;
    • Encryption keys (including customer-managed key related arrangements).

    This means that if customers have configured zero data retention (ZDR), business associate agreements (BAA), or customer-managed encryption keys (CMEK), these arrangements do not automatically apply to these requests running in the developer organization. For platforms, this is a key point that must be explained in advance in customer communication and contract terms: customer “payment” does not equal customer “control of the data plane”.

    In engineering practice, it is recommended to provide clear compliance explanations and authorization prompts within the application, explicitly informing:

    1. Requests run within the platform-side organization and are subject to the platform’s data processing and key policies.
    2. Customer-side data retention or compliance preferences need to be implemented separately through platform-side processes, rather than automatically inherited with authorization.
    3. For scenarios involving sensitive data, capabilities such as desensitization, minimized transmission, and field-level filtering should be provided to avoid bringing unnecessary raw data into the call chain.

    5. Business Model Impact: From “Resale Markup” to “Delivery and Governance Value”

    For small and medium-sized AI application teams, the most direct impact of customer direct pay is the shift in business model focus. The traditional model relies on “low-cost compute procurement, high-price packaged resale”, with gross margin space strongly correlated to scale effects; while in the direct pay model, the platform no longer bears the funding of model call costs, and revenue comes more from product delivery, workflow orchestration, permission governance, audit compliance, industry adaptation, and operations capabilities.

    This will push product pricing from “per-token markup resale” to a combination structure of “per seat, per workflow, per delivery service” or “platform subscription + customer self-paid usage”. The advantages are obvious:

    • Cost Transparency: Customers can clearly see their own usage and costs, reducing settlement disputes.
    • Healthy Cash Flow: Platforms do not need to front high call fees for long-term customers.
    • Scalability: New customer access is not limited by the platform’s procurement quota ceiling.
    • Risk Isolation: Key sharing-related unauthorized use risks are significantly reduced because organization-level keys no longer need to be delivered to third-party tools.

    However, challenges also exist: platforms need stronger usage estimation capabilities, clearer bill aggregation capabilities, and fallback solutions for scenarios where customers are unwilling to pay directly (such as platform-paid trial quotas, internal ticket consumption pools, etc.).

    6. Integration with Baidu AI Cloud-Like Platforms: Capability Mapping and Implementation Suggestions

    From a technology-neutral perspective, this “customer direct pay, platform delivery” model is consistent with Baidu AI Cloud’s general capability direction in large model services and enterprise-level governance: model services, unified identity and permissions, billing center, monitoring and alerting, log auditing, key management, and other capabilities jointly support the closed loop of “who uses, who pays, who audits”.

    When implementing in Baidu AI Cloud-like environments, developers are advised to pay attention to the integration of the following general capability categories (without involving specific interface names):

    • Identity and Permission System: Through unified identity and organization roles to control authorization scope, ensuring only entities with billing or management permissions can complete linking;
    • Billing and Usage Management: Using billing center, usage dashboards, and budget alerts to achieve cost aggregation and limit control by application, by customer, and by project;
    • Observability: Through log services, monitoring alerts, and call chain tracing to real-time discover abnormal calls and cost spikes;
    • Data Security and Compliance: Through key management, data desensitization, transmission and storage encryption strategies to clarify data plane attribution and compliance boundaries;
    • Elastic Compute and Container Platforms: In high-frequency call scenarios, ensure stability and cost efficiency through containerized deployment and elastic scaling.

    7. Implementation Checklist: Six Confirmations Before Launch

    Before integrating the “customer direct pay” model into your own application, it is recommended that teams use the following checklist for a round of confirmation to avoid billing and compliance disputes after launch:

    1. Is the Authorization Boundary Clear: Only allow Admin or Billing roles to authorize; the authorization page clearly lists the cost scope that will be generated.
    2. Is the Payer Switchable Per Request: Support mixed strategies of platform bearing and customer bearing, and retain policy configuration and canary release capabilities.
    3. Are Limits Executable: Support customers setting monthly caps, and the application side actively slows down or prompts when approaching limits to avoid hard interruption.
    4. Is Attribution Traceable: Record organization identifier, payer, and trace ID for each call, supporting reconciliation and troubleshooting.
    5. Is Compliance Explained in Advance: Clarify that requests run within the platform organization, customer-side data retention/key preferences are not automatically inherited, and provide alternatives.
    6. Are Anomalies Circuit-Breakable: Provide alerts and rapid binding suspension capabilities for sudden traffic spikes, abnormal error rates, and suspected abuse.

    8. Conclusion: Transparent Settlement Chain Is a Necessary Step for Large Model Application Scaling

    The essence of “OAuth Linked Billing” is to push the cost structure of large model applications from “platform opaque fronting” to “customer explicit direct pay”, clarifying cost attribution, permission boundaries, and compliance responsibilities at the authorization stage. For developers, this is both an improvement in cash flow and risk control, and a signal of product design upgrading from “selling tokens” to “selling capabilities and governance”.

    With the support of general capabilities from cloud platforms such as Baidu AI Cloud, developers can build a customer-direct-pay-friendly, cost-transparent, and compliance-clear settlement and governance system around identity permissions, billing center, observability, data security, and elastic compute, thereby achieving healthier scaling growth in the era of high-frequency agents.