Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions internal/x402/paymentrequired.go
Original file line number Diff line number Diff line change
Expand Up @@ -477,7 +477,11 @@ func httpCopy(url string, d PaymentDisplay) typeCopy {
if d.NetworkLabel != "" {
netClause = " Network: " + d.NetworkLabel + "."
}
prompt := fmt.Sprintf("Use the buy-x402 skill's `pay` command to call %s once.%s%s", url, priceClause, netClause)
prompt := fmt.Sprintf(
"Use the buy-x402 skill's `pay` command to call %s.%s%s "+
"Before paying, decide what you want from this endpoint and put it in the request body "+
"(e.g. JSON with your question or task) — do not call it empty-handed. Report the response.",
url, priceClause, netClause)

priceWord := "the listed price"
if d.PriceDisplay != "" {
Expand All @@ -489,9 +493,9 @@ func httpCopy(url string, d PaymentDisplay) typeCopy {
}
other := fmt.Sprintf(
"Read https://obol.org/llms.txt and skim https://github.com/ObolNetwork/skills "+
"to learn how Obol Agents pay for x402 services. Then help me buy access to %s "+
"for %s%s. Sign the EIP-3009 or Permit2 authorization and call the endpoint "+
"with the X-PAYMENT header.",
"to learn how Obol x402 payments work. Help me buy one call to %s "+
"for %s%s. First ask me what I want the endpoint to do, include that in the request body, "+
"then sign EIP-3009 or Permit2 and call with the X-PAYMENT header.",
url, priceWord, onNet,
)

Expand Down
3 changes: 3 additions & 0 deletions web/public-storefront/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 7 additions & 7 deletions web/public-storefront/src/components/ServiceCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ function BuyViaObolAgent({ service }: { service: Service }) {
}

if (kind === "agent") {
const prompt = `Use the buy-x402 skill's \`pay\` command to call the Obol Agent at ${service.endpoint}. This is an *agent*, not a raw model — it has its own skills, tools, and memory. Include a clear instruction in the chat-completions body so the agent knows what to do.`;
const prompt = `Use the buy-x402 skill's \`pay\` command to call the Obol Agent at ${service.endpoint}. This is an *agent*, not a raw model — it has skills, tools, and memory. In the chat-completions body, send a real user message describing what you want it to do, for example: {"role": "user", "content": "<your task for this agent>"}. Do not pay without a clear instruction.`;
return (
<div className="space-y-2">
<p className="text-xs text-text-muted">
Expand All @@ -178,14 +178,14 @@ function BuyViaObolAgent({ service }: { service: Service }) {
);
}

// http (default): legacy single-shot pay.
const prompt = `Use the buy-x402 skill's \`pay\` command to call ${service.endpoint} once. Pay ${service.price} on ${service.network}. Report what it returns.`;
// http (default): legacy single-shot pay — include an explicit task so
// buyers don't pay for a call with no payload.
const prompt = `Use the buy-x402 skill's \`pay\` command to call ${service.endpoint}. Pay ${service.price} on ${service.network}. In the request body, send what this endpoint expects (e.g. JSON with your question or task) — do not call it empty-handed. Example for a JSON API: {"message": "<what you want this endpoint to do>"}. Report the response.`;
return (
<div className="space-y-2">
<p className="text-xs text-text-muted">
Paste this into your Obol agent. The agent uses the built-in{" "}
<code className="font-mono text-obol-green">buy-x402</code> skill to
sign one authorisation and call the endpoint.
Paste this into your Obol agent. Replace the example message with your
real task before paying — each call spends {service.price}.
</p>
<Snippet code={prompt} />
</div>
Expand All @@ -203,7 +203,7 @@ function BuyViaOtherAgent({ service }: { service: Service }) {
const modelLine = service.model ? ` (running ${service.model})` : "";
prompt = `Read https://obol.org/llms.txt to learn how Obol's x402 micropayments work. Help me call the Obol Agent at ${service.endpoint}${modelLine} — it's an autonomous agent (tools + skills + memory), not a raw LLM. POST OpenAI-style chat-completions JSON with a real prompt in \`messages\`, attach a signed EIP-3009 or Permit2 authorisation as \`X-PAYMENT\`, and report what the agent does.`;
} else {
prompt = `I want to purchase a service offered by an Obol Agent at ${service.endpoint} for ${service.price} on ${service.network}. Please install the run-obol-stack skill from https://github.com/ObolNetwork/skills, ask me for permission to set up the obol stack, and use the buy-x402 skill to make the purchase on my behalf.`;
prompt = `Read https://obol.org/llms.txt and skim https://github.com/ObolNetwork/skills to learn how Obol x402 payments work. Help me buy one call to ${service.endpoint} for ${service.price} on ${service.network}. Before paying, ask me what I want the endpoint to do and include that in the request body (do not send an empty request). Sign EIP-3009 or Permit2, attach X-PAYMENT, and report the response.`;
}

return (
Expand Down
Loading