Skip to main content

llama-index tools voidly-pay integration — pay for HTTP 402 endpoints via x402

Project description

Voidly Pay Tool

Voidly Pay is an x402 payment rail for AI agents — let your LlamaIndex agent autonomously pay for HTTP 402 endpoints, no API keys, no Stripe customer object. Identity is an Ed25519 keypair on disk.

Settlement happens off-chain in Voidly Pay credits (Stage 1) or on-chain USDC on Base mainnet (Stage 2). The vault is Sourcify-verified at 0xd25d...4DF5 with public reserves at voidly.ai/pay/proof.

Installation

pip install llama-index-tools-voidly-pay

Provision a wallet (10 free credits, no install)

Visit voidly.ai/pay/claim — generates an Ed25519 keypair in your browser and grants 10 credits via the public faucet. Save the keypair to ~/.voidly-pay-keypair.json and you're ready to call paid endpoints.

Usage

from llama_index.tools.voidly_pay import VoidlyPayToolSpec
from llama_index.core.agent.workflow import FunctionAgent
from llama_index.llms.openai import OpenAI

voidly_tool = VoidlyPayToolSpec()  # uses ~/.voidly-pay-keypair.json by default

agent = FunctionAgent(
    tools=voidly_tool.to_tool_list(),
    llm=OpenAI(model="gpt-4o"),
)

await agent.run(
    "Browse the Voidly Pay marketplace, find a Wikipedia summary endpoint, "
    "and pay 1¢ to fetch the summary for 'Alan Turing'."
)

Available Functions

  • pay_for_url(url, method, params, body) — call any URL; auto-pays a 402 Payment Required response by signing a transfer envelope, retries with X-Payment, and returns the body plus the signed receipt.
  • discover_paid_endpoints() — list all paid endpoints currently advertised on the facilitator.
  • marketplace_browse(category) — browse the open Voidly Pay marketplace (api.voidly.ai/v1/pay/marketplace).
  • health_check() — run the 6-check trust report (facilitator reachability, vault verification, wallet balance, keypair validity, settlement health). Useful before a long-running paid task.
  • list_listing(name, endpoint_url, price_usdc, description, category) — list your own paid endpoint on the marketplace.

How x402 works

  1. Agent calls a tool that hits a 402 Payment Required endpoint
  2. Endpoint returns a signed quote (price, recipient, expiry)
  3. SDK signs a transfer envelope with the agent's Ed25519 keypair
  4. Endpoint verifies and returns the actual response

One round-trip after the first 402. Sub-200ms typical settlement on the live facilitator.

List your own paid endpoint

Visit voidly.ai/pay/list-your-service — browser-only Ed25519 keypair, no install. Once listed, every Voidly-aware agent (LlamaIndex, LangChain, Vercel AI, MCP) can find and call your URL. Voidly takes zero platform cut on Stage 1.

Resources

This loader is designed to be used as a way to load Voidly Pay primitives as Tools in an Agent.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

llama_index_tools_voidly_pay-0.1.2.tar.gz (6.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

llama_index_tools_voidly_pay-0.1.2-py3-none-any.whl (6.0 kB view details)

Uploaded Python 3

File details

Details for the file llama_index_tools_voidly_pay-0.1.2.tar.gz.

File metadata

File hashes

Hashes for llama_index_tools_voidly_pay-0.1.2.tar.gz
Algorithm Hash digest
SHA256 ae881569b6d873d42dcaa24bdc2a869169cf18a5aa19569a4b01ef2906c2062c
MD5 1835b5c3b9309110e58a74a0d5134c71
BLAKE2b-256 c8977d7a40cf120e67f0b579be027e6c9824df8c43ecf5e4d8ab32f668cbe440

See more details on using hashes here.

File details

Details for the file llama_index_tools_voidly_pay-0.1.2-py3-none-any.whl.

File metadata

File hashes

Hashes for llama_index_tools_voidly_pay-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 97bba16c86e0cca0ba694f8f893c3cc13e7d3226e9d38f67cd72bd2284c2db1c
MD5 4c6463f196ebe7d524f492546d9a1fcb
BLAKE2b-256 03ce8ed6f0ff94d3f0a790f90eed88e14ca3a60b972f96afb091d3b389a953f7

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page