Send SMS
Send text messages worldwide via x402 or credits.
Send SMS
Send text messages to any phone number worldwide.
POST /api/v1/messages/send
Auth: x402 payment ($0.10 USDC)
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
to | string | Yes | Recipient phone number (E.164 format, e.g. +1234567890) |
body | string | Yes | Message body |
from | string | No | Sender ID or phone number |
Example Request (cURL)
curl -X POST https://x402.dial.wtf/api/v1/messages/send \
-H "Content-Type: application/json" \
-H "Payment-Signature: BASE64_ENCODED_PAYMENT" \
-d '{
"to": "+1234567890",
"body": "Hello from an AI agent!",
"from": "Dial"
}'Example Request (JavaScript)
const response = await paidFetch("https://x402.dial.wtf/api/v1/messages/send", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
to: "+1234567890",
body: "Hello from an AI agent!",
}),
});
const data = await response.json();Response
{
"success": true,
"message": "SMS sent",
"provider": "dial",
"messageIds": [12345678],
"balance": 42.5,
"totalPrice": 0.0075,
"input": {
"to": "+1234567890",
"body": "Hello from an AI agent!"
}
}POST /api/v1/messages/send-with-credits
Auth: Bearer token (1 credit)
Same parameters and response format. Uses prepaid credits instead of x402 payment.
curl -X POST https://x402.dial.wtf/api/v1/messages/send-with-credits \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_PRIVY_ACCESS_TOKEN" \
-d '{
"to": "+1234567890",
"body": "Hello from credits!"
}'Credit Refunds
If the SMS provider fails after credits are deducted, the credit is automatically refunded. The response will include refunded: true.