OTPIXA developer reference
Email REST API documentation
Authentication, funding, request pricing, safe retries and account history. No subscription or activation fee.
Open API dashboardQuick start
- Sign in and create a product-specific key in the API dashboard. Save the key when it is shown.
- Add at least $10 using an available payment method. Wait for payment confirmation.
- Use the same origin as the website. The deployed base path is
/api/public/v1, on the website itself. - Send the key in the Authorization header. Send a unique Idempotency-Key for every POST.
curl "https://payment-flux-pro.lovable.app/api/public/v1/account/balance" -H "Authorization: Bearer $OTPIXA_KEY"Authentication
Every endpoint needs Authorization: Bearer YOUR_KEY. Numbers keys cannot use email endpoints and email keys cannot use numbers endpoints. Keys are hashed in storage and the full key is shown once. Revoke a compromised key immediately and create a replacement. Website session tokens are not API keys.
Funding & pricing
API wallets are isolated from website funds and from each other. There is no API activation or monthly fee. Every dollar buys 1,200 base credits. Create aliases: 1 credit. Create originals: 3 credits. Poll inbox: 3 credits. Read message: 3 credits. Account balance and usage: free. The bonus tier is based on each deposit amount, not accumulated deposits, and is credited once with confirmed payment. Failed or pending payments receive no credits. Available gateways and their maximum amounts are shown in the dashboard; a $5,000 tier does not raise a local gateway's limit. API balances cannot be transferred to website wallets.
$10: 12,000 credits; $50: 66,000; $100: 138,000; $250: 360,000; $500: 750,000; $1,000: 1,560,000 (totals include bonuses).
Endpoints
Replace /v1 with /api/public/v1 on your deployed origin.
POST /v1/inboxes
Create a Gmail or Outlook alias (1 credit) or original (3 credits). Each inbox lasts 5 minutes. No account password is supplied.
{"domain":"gmail","kind":"alias"}GET /v1/inboxes/{id}/messages
Poll an active inbox: 3 credits per successful request, including empty or cached results. Respect checkedAt and the configured polling interval (default 15 seconds).
GET /v1/messages/{id}?inbox_id={inbox_id}
Read one message from your active API inbox: 3 credits. Encode the message ID as a URL segment. Sanitized HTML and text are returned.
GET /v1/account/balance
API product balance and unit (USD or credits). No charge.
GET /v1/account/usage
Latest 100 request records for this API product. No charge.
GET /v1/account/transactions
Latest 100 deposits, bonuses, charges and refunds. No charge.
Response envelope
{"data": {...}, "request_id": "uuid", "cost": 1, "unit": "credits"}Inbox creation returns id, address, domain, kind, expiresAt and status. Order creation returns id; fetch that order to read the number and SMS. No outbound webhooks are offered by this version; poll the read endpoints.
Retries & refunds
Use an 8–120 character Idempotency-Key for POST requests. Reuse exactly the same key, URL and JSON body only when retrying the same action. The same request returns its stored result without a second charge. Different input with the same key returns 409. GET calls are separate billable requests unless you explicitly reuse an Idempotency-Key; replay returns the stored result, not fresh mail. A pending request returns 202: retry with the same key, never issue a new purchase blindly. Provider failures refund the reserved request cost. Expired inboxes are unavailable; an existing allocation is not refunded merely because its five-minute lifetime ended. Contact support with request_id for a request stuck pending after interruption.
Errors & security
- 400
- invalid_request — invalid body, ID or missing idempotency key
- 401
- unauthorized — invalid, missing or revoked key
- 402
- insufficient_balance — fund this API product
- 403
- account_disabled — contact support
- 404
- not_found — wrong product, private resource or expired inbox
- 409
- conflict — idempotency key reused for different input
- 503
- service_unavailable — retry safely or contact support
Never expose keys in browser code, URLs or logs. Keep HTML messages isolated in a sandboxed iframe without scripts or same-origin permission. Only use inboxes and numbers for lawful activity you are entitled to perform. OTPIXA is independent of Google and Microsoft. Current responses do not advertise rate-limit headers. Avoid rapid polling and retry provider errors with backoff.
Contact supportIn-depth integration guide
Pricing examples, funding bonuses, mailbox types, safe retries and production checklists.
Read the complete email API guide