docs: add improved sessions blog post#695
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
9129695 to
b84770a
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 9129695fc0
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| export async function handler(request: Request) { | ||
| // [!code hl:start] | ||
| const result = await mppx.session({ | ||
| amount: '25', |
There was a problem hiding this comment.
Keep the example price within the client cap
This server example charges 25 human-readable currency units per llm_token, but the paired client example below caps maxDeposit at 1, so copying the integration cannot authorize even one metered unit and paid requests will fail instead of demonstrating improved sessions. Use a realistic sub-dollar per-token amount or raise the client cap so the example can complete.
Useful? React with 👍 / 👎.
| <BlogPostList posts={[ | ||
| { | ||
| date: "Friday, June 12, 2026", | ||
| title: "Improved sessions", |
There was a problem hiding this comment.
an improved sessions experience
| { | ||
| date: "Friday, June 12, 2026", | ||
| title: "Improved sessions", | ||
| description: <>Improved sessions make pay-as-you-go API billing cheaper and easier to integrate.</>, |
There was a problem hiding this comment.
same as above
|
|
||
| Sessions are one of MPP's core primitives. They power the cost-efficient, high-throughput, usage-based billing that modern APIs and services depend on—metering payment at the granularity of a single LLM token, API call, or byte transferred. | ||
|
|
||
| Today we're shipping two improvements that make sessions the cheapest and easiest machine-payments primitive to integrate: |
There was a problem hiding this comment.
remove hyphen
| Today we're shipping two improvements that make sessions the cheapest and easiest machine-payments primitive to integrate: | ||
|
|
||
| 1. **The session intent is now a formal spec.** Sessions are standardized as an MPP intent (`session`), so extending them to new payment methods and networks is faster and more predictable. | ||
| 2. **Sessions on Tempo are faster and cheaper.** The new [TIP-1034](https://tips.sh/1034-1) precompile path cuts channel costs by as much as 72% and improves reliability. |
There was a problem hiding this comment.
| Today we're shipping two improvements that make sessions the cheapest and easiest machine-payments primitive to integrate: | ||
|
|
||
| 1. **The session intent is now a formal spec.** Sessions are standardized as an MPP intent (`session`), so extending them to new payment methods and networks is faster and more predictable. | ||
| 2. **Sessions on Tempo are faster and cheaper.** The new [TIP-1034](https://tips.sh/1034-1) precompile path cuts channel costs by as much as 72% and improves reliability. |
There was a problem hiding this comment.
greatly improves reliability
|
|
||
| ## Performance and improvements | ||
|
|
||
| Moving the channel lifecycle onto the [TIP-1034 reserve precompile](https://tips.sh/1034-1) makes the common operations dramatically cheaper. |
There was a problem hiding this comment.
makes session operations
| | Open, existing reserve balance | 1,055,229 | 294,425 | -72.1% | | ||
| | Open, first reserve balance | 1,302,429 | 791,625 | -39.2% | | ||
| | Settle, existing payee balance | 312,037 | 301,631 | -3.3% | | ||
| | Settle, new payee balance | 312,037 | 559,871 | +79.4% | |
|
|
||
| ## How to integrate | ||
|
|
||
| On the server, use an account from the local account store, register `tempo.session`, and call `mppx.session`: |
There was a problem hiding this comment.
just register tempo.session.. remove the "and call"
|
|
||
| - [Tempo session IETF Specification](https://paymentauth.org/draft-tempo-session-00) | ||
| - [Sessions guide](/payment-methods/tempo/session) | ||
| - [`tempo.session` server API](/sdk/typescript/server/Method.tempo.session) |
| - [Tempo session IETF Specification](https://paymentauth.org/draft-tempo-session-00) | ||
| - [Sessions guide](/payment-methods/tempo/session) | ||
| - [`tempo.session` server API](/sdk/typescript/server/Method.tempo.session) | ||
| - [`tempo.session` client API](/sdk/typescript/client/Method.tempo.session) |
This reverts commit 59120fb.
|
|
||
| A session lets a client authorize spending once, then incrementally increase the authorized amount as it consumes a service—paying exactly for what it uses. Instead of one payment per request, the client and server maintain a single running authorization that grows with usage. | ||
|
|
||
| By keeping payment verification close to instant, sessions make metering at the granularity of a single LLM token, API call, or byte transferred practical and remove credit risk, reconciliation complexity, and complex credit-based billing workflows. |
There was a problem hiding this comment.
By keeping payment verification close to instant, sessions make metering at the granularity of a single LLM token, API call, or byte transferred practical and remove credit risk, reconciliation complexity, and complex credit-based billing workflows.
| | Request close | 31,752 | 30,123 | -5.1% | | ||
| | Close after settlement | 85,118 | 62,913 | -26.1% | | ||
|
|
||
| In addition to lower costs, the new implementation makes channel operations payment-lane traffic on Tempo. Opens, top-ups, settlements, close requests, closes, and withdrawals get the same congestion treatment as payments, so providers can settle many channels while the network is busy. |
There was a problem hiding this comment.
...channel operations payment-lane traffic on Tempo...
It may not be immediately clear to the reader (i.e if not super familiar with Tempo semantics) the true benefits of this being on the payment-lane. Maybe worth another sentence?
Summary
Add blog post for sessions v2