Creating Endpoints
Endpoints are the core of x402 Studio. They turn your APIs into paid services that accept crypto payments automatically.Endpoint Types
Pay-Per-Request
Charge a fixed price for each API call. Best for:
- High-value API responses
- Compute-intensive operations
- Premium data access
Credit-Based
Sell credit packs upfront. Best for:
- High-volume APIs
- Subscription-like access
- Lighter per-call pricing
Pricing Limits
All prices must be at least 0.01 USDC. This applies to:
- Pay-per-request pricing
- Credit package prices
- Agentic access pricing
Creating a New Endpoint
Step 1: Navigate to Endpoints
Go to Dashboard → Endpoints and click New Endpoint.Step 2: Basic Information
| Field | Description |
|---|---|
| Name | A descriptive name for your endpoint |
| Description | What this endpoint does (shown to users) |
| Origin URL | Your actual API endpoint URL |
Step 3: Set Your Payout Address
Enter the wallet address where you want to receive payments:⚠️ Double-check this address. Payments are irreversible once sent.
Origin Protection (API Key Security)
Important: When you create an endpoint, x402 Studio generates an Origin Protection Key (API Key). This key is used by the x402 Gateway to authenticate requests to your origin server. Without proper API key validation, your endpoint will not accept payments. The gateway performs a health check before allowing payments, and if your origin returns a 401/403 error, the payment button will be disabled.
How It Works
- When you create an endpoint, an API key is generated and shown once
- Add this key to your server’s environment variables (e.g.,
X402_API_KEY) - Your server must validate incoming requests using this key
- The x402 Gateway sends the key in the
X-API-Keyheader
Server-Side Validation Examples
Public Endpoints: If you don’t want to require API key validation (e.g., your API is already public), you can disable the “Require API Key” toggle when creating the endpoint. However, this means anyone who discovers your origin URL can access it without payment.
Testing Your Endpoint
After creation, test that everything works:Managing Endpoints
From the Dashboard, you can:- Edit – Update pricing, origin URL, or settings
- Pause – Temporarily disable the endpoint
- Delete – Permanently remove the endpoint
- View Analytics – See payment history and usage stats
🤖 AI Integration Helper
Don’t know how to use your API key? After creating an endpoint, you’ll see a purple card with a “Copy AI Integration Prompt” button. Click it to copy a pre-written prompt, then paste it into any AI assistant:💡 This is the easiest way to integrate x402 payments into your project with zero coding knowledge!
- Cursor – Paste in chat to generate integration code
- ChatGPT / Claude – Get step-by-step integration help
- GitHub Copilot – Use as context for code suggestions
