Overview
The DelphAI X402 API allows you to create prediction markets programmatically. Each API call costs 1 WLFI USD (World Liberty Financial USD) paid via the X402 protocol.Endpoint
Authentication
This endpoint requires a payment of 1 WLFI USD via X402 protocol for each call. The payment is handled automatically through the X402 SDK using ERC-2612 permit signatures. Payment Details:- Token: WLFI USD (World Liberty Financial USD)
- Symbol: USD1
- Amount: 1 WLFI (1000000000000000000 wei)
- Network: BSC (Binance Smart Chain)
- Token Address:
0x8d0D000Ee44948FC98c9B98A4FA4921476f08B0d
Request
Request Body
The main question for the prediction market
Detailed description of the market and resolution criteria
Array of possible outcomes (minimum 2 options)
Unix timestamp for when the market will be resolved (must be in the future)
Example Request
Response
Success Response
Indicates if the market was created successfully
The unique identifier for the created market
The blockchain transaction hash for the market creation
Success (200 OK)
Error Responses
Bad Request (400)
Internal Server Error (500)
Code Examples
The
x402fetch library automatically handles the X402 payment flow and permit signatures. Manual construction of payment headers is not recommended.Installation
Install the X402 SDK in your project:npm
yarn
pnpm
Important Notes
Next Steps
Prediction Markets
Learn more about how prediction markets work
Market Lifecycle
Understand the market lifecycle and resolution process
