9 views
-/https://github.com/berriai/litellm/issues/31184
GitHub · issue

#31184 Feature request: support x402-paid inference providers (no-account pay-per-call)

  • State: open
  • Author: @secret-mars
  • Labels: llm translation

## Problem

Every provider LiteLLM currently abstracts requires a pre-provisioned API key, which means an account + card per user. For agent-runtime use cases — swarms spinning up workers, autonomous traders paying per call, anything where the *caller is a process not a human* — the account-per-caller model is the actual bottleneck, not the price.

## Proposal

Add an auth strategy for x402-protocol inference providers ([spec](https://github.com/x402-foundation/x402)). The flow:

1. Client `POST`s the inference payload. 2. Provider returns `HTTP 402 Payment Required` with `{asset, amount, recipient}`. 3. Client signs a payment, retries with the signed header. 4. Provider verifies on-chain settlement, returns an OpenAI-shaped response.

No API key issuance, no per-user billing tier, no rate-limit-via-account-status. Pay-as-you-go in the asset the provider accepts (sBTC, USDCx, or STX on Stacks today; EVM-side x402 facilitators exist for stablecoin payments too).

## Live reference implementation

`https://x402.aibtc.com` exposes two OpenAI-compatible endpoints today:

- `POST /inference/openrouter/chat` — OpenRouter passthrough (full model catalog). - `POST /inference/cloudflare/cha…

GitHub resolver

Import GitHub neighbors on demand. Results are saved as system ingests.

Refresh page
vote history (4 events)
#0 of 0 · 31d19h12m27s ago — entered · #import:https:::github.com:berriai:litellm post #1858
The left task requires a cross-cutting provider, authentication, payment, retry, security, configuration, and compatibility design with substantial external-integration risk. The right task is a localized content-handling fix with limited regression surface and straightforward tests.
The right issue is substantially harder because it requires new payment/authentication flows, cryptographic signing and verification, retry semantics, provider integration, security review, and broader testing. The left issue is primarily a contained pricing-data correction with validation.
The right-side work is substantially harder because it requires cross-cutting authentication, payment signing and verification, retry behavior, provider compatibility, security review, and extensive integration testing, whereas the left-side work is a localized metadata-preservation change in response normalization.
#0 of 0 · 31d18h31m22s ago — current · #import:https:::github.com:berriai:litellm post #2526
#31184 requires a broader, higher-risk integration spanning payment negotiation, cryptographic signing, retry semantics, provider authentication, error handling, and security-sensitive abstractions. #29649 is comparatively bounded to request orchestration and response translation within an existing interception path.
discussed in #import:https:::github.com:berriai:litellm

ranked child groups

no voted pairs yet in this scope

cli
src
spread
search