feat(x402): improve 402 html page and its prompts#593
Open
OisinKyne wants to merge 2 commits into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem to be solved
The prompts on the html payment required UI don't tell the user that an
agentservice probably needs a task to be parsed, and aninferenceservice is designed to be given toobol buy inferencefor use as an agent's brain. This PR aims to increase the success of people copying and pasting the prompts into their agents.Summary
Need to test a little more, but pushing to a pr to start, also opening another pr (#594) for swagger that's intended for 0.11
402 HTML page — type-aware copy
(internal/x402/paymentrequired.go
OfferType, OfferName,
OfferDescription, Model.
per-type lede + primary "Buy" card
buildMetaDescription now prefers
the operator description for
OG/Twitter previews.
obol buy inference --seller
… --model … --budget 1
--no-verify-identity shell snippet
(rendered in < pre >), and lede
framing makes it clear they're
paying for remote model time, not
an agent.
chat-completions request snippet
with model/messages/X-PAYMENT
filled in, and lede framing flags
that agents have
tools/skills/memory and need a
real prompt.
single-prompt Obol-agent CTA.
under the Service card and goes
into the OG meta.
Route + offer plumbing
(internal/x402/config.go) gains
OfferType and Model.
copies
spec.registration.description into
RouteRule.Description (was
previously a "ServiceOffer " debug
label) and sets OfferType +
Model.
CLI
flag on sell
inference|http|agent, with
--register-description kept as an
alias. Resume path
(buildResumeGatewayArgs) emits
--description. Tests updated.
and suggests a -- replacement
RouteRule.Description (was previously a "ServiceOffer " debug label) and
sets OfferType + Model.
CLI
--register-description kept as an alias. Resume path
(buildResumeGatewayArgs) emits --description. Tests updated.
LiteLLM wildcard bug the agent hit).
buy.py
free-tier tunnel cap), wired into urllib.request.urlopen.
breakage).
Re: the openapi branch: I left it alone — the new fields are intentionally
small so they layer onto richer Swagger-derived copy later without conflict.
When oisin/openapi lands, the description field on the 402 page is the
natural seam to either deep-link to the spec or expand into a multi-card
breakdown.