ritual-dapp-x402

Enable pay-per-call API access via Ritual's HTTP precompile with TEE-encrypted credentials.

62|56|Updated Apr 24, 2026
One-click install
npx skills add https://github.com/ritual-foundation/ritual-dapp-skills --skill ritual-dapp-x402
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: ritual-dapp-x402
Source: https://github.com/ritual-foundation/ritual-dapp-skills/tree/main/skills/ritual-dapp-x402
Command: npx skills add https://github.com/ritual-foundation/ritual-dapp-skills --skill ritual-dapp-x402

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

X402 enables pay-per-call access to premium APIs through Ritual's HTTP precompile by encrypting credentials and decrypting inside a TEE to perform paid calls within a single on-chain transaction.

Core Features & Use Cases

  • Pay-per-call API access to premium APIs via the HTTP precompile, with on-chain auditability.
  • Encrypted credentials handled client-side and decrypted inside a TEE, enabling per-call billing and optional shared access via dKMS.
  • Budget tracking and per-call payments in consumer contracts, plus support for credential rotation and cost awareness.

Quick Start

Deploy an X402-enabled dApp that pays per API call and securely pass encrypted credentials to a paid API.

Frequently Asked Questions about ritual-dapp-x402

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I enable pay-per-call API access in a smart contract?

Pay-per-call API access in a smart contract is enabled by routing paid HTTP requests through Ritual's HTTP precompile, encrypting credentials client-side and decrypting them inside a TEE to execute billed calls within a single on-chain transaction.

What's the best way to handle encrypted API credentials in on-chain dApps?

Encrypted API credentials in on-chain dApps are handled by encrypting them client-side and decrypting inside a Trusted Execution Environment (TEE), ensuring per-call billing and optional shared access via dKMS across multiple executors.

Can I track API call budgets and costs on-chain for premium data access?

Yes, on-chain budget tracking and per-call payments are supported in consumer contracts, providing cost awareness and allowing you to set spending limits for premium API data access directly on-chain.

How do I rotate API credentials securely for paid on-chain API calls?

Credential rotation for paid on-chain API calls is supported natively, allowing you to update encrypted credentials securely while maintaining continuous access to premium APIs through the HTTP precompile without interrupting active dApp workflows.

Does the X402 precompile payload support shared credentials across multiple executors?

Yes, shared credentials across multiple executors are supported via dKMS (distributed Key Management System), enabling optional shared access to encrypted API credentials while maintaining secure per-call billing and on-chain auditability.

When should I use pay-per-call on-chain transactions instead of flat-rate API subscriptions?

Pay-per-call on-chain transactions are ideal when building dApps requiring automatic paid data access, granular per-call pricing, strict budget control, or shared credentials via dKMS, replacing flat-rate subscriptions with auditable, usage-based billing.