Skip to content
  1. Otpforyou
  2. API docs

REST API

REST API documentation

Tool endpoints use GET and return JSON shaped like { "status": "success", "data": … }. Authenticate with the ?api_key= parameter from the API Docs page after signing in.

Base URLllms.txt for AI and tools

Endpoints

GET/api/v1/services

No auth

Services — price & stock

Without ?service= it returns the whole list. With ?service= it returns the price and stock of one service. No API key needed.

Parameters · query

serviceoptional
Leave empty for the whole list; a code returns one service (bare codes like facebook are accepted)
Success · 200 · JSON
GET https://otpforyou.com/api/v1/services?service=otp_gmail_facebook

{ "status": "success", "data": { "services": [
    { "code": "otp_gmail_facebook", "name": "Facebook", "price": 0.0493, "stock": 42 }
  ] } }

GET/api/v1/me

API key required

Account info

ID, email and balance of the API key making the call.

Parameters · query

No parameters.

Success · 200 · JSON
GET https://otpforyou.com/api/v1/me?api_key=…

{ "status": "success", "data": { "id": "b7e5...-uuid", "email": "demo@example.com", "balance": 12.5, "created_at": "2026-01-15T08:30:00Z" } }

GET/api/v1/orders

API key required

Create order

One endpoint for both: a Gmail OTP code (otp_gmail_*) issues one OTP mailbox; a stock product code (hotmail_*…) buys by quantity. The balance is charged at the listed price.

Parameters · query

service
OTP service code (otp_gmail_*) or stock product code (e.g. hotmail_oauth2_graph)
quantityoptional
Only for one-off sold emails — quantity (default 1)
unique_keyoptional
Self-generated UUID — resending will not create or charge twice
Success · 200 · JSON
GET https://otpforyou.com/api/v1/orders?service=otp_gmail_facebook&api_key=…

{ "status": "success", "data": {
    "id": "b7e5a1c2-3d4e-4f60-8a91-2c3d4e5f6a7b", "email": "zurhansuzu@gmail.com",
    "service": "otp_gmail_facebook", "amount": 0.0493
  } }

GET/api/v1/orders/otp

No auth

Get OTP by order

Reads the OTP of one order. No API key needed — the order code (order_id) is the capability key.

Parameters · query

order_id
Order code (returned when the order is created)
unique_keyoptional
A fresh self-generated UUID for each call
fromoptional
Unix seconds — otp/received_at are omitted unless a newer code exists
Success · 200 · JSON
GET https://otpforyou.com/api/v1/orders/otp?order_id=<order_id>

{ "status": "success", "data": {
    "otp": "481253", "amount": 0.0493, "received_at": 1732000000,
    "from": "security@facebookmail.com", "otp_history": [
      { "value": "481253", "received_at": 1732000000 }
    ] } }

GET/api/v1/otp/orders

API key required

OTP order list

Rented Gmail OTP orders, paginated, with the latest OTP of each order.

Parameters · query

pageoptional
Page (default 1)
page_sizeoptional
Rows per page (default 20, max 200)
Success · 200 · JSON
GET https://otpforyou.com/api/v1/otp/orders?page=1&page_size=20&api_key=…

{ "status": "success", "data": { "orders": [
    { "id": "b7e5a1c2-3d4e-4f60-8a91-2c3d4e5f6a7b", "email": "...", "service": "otp_gmail_facebook",
      "latest_otp": "481253", "latest_link": null, "tier": "normal", "charged": 0.0493,
      "received_at": "2026-11-01T14:39:02Z" }
  ], "page": 1, "page_size": 20, "total": 137 } }

GET/api/v1/mail

API key required

Read all messages

All messages of one mailbox, with the extracted OTP/link.

Parameters · query

order_id
Order code
Success · 200 · JSON
GET https://otpforyou.com/api/v1/mail?order_id=<order_id>&api_key=…

{ "status": "success", "data": { "count": 1, "messages": [
    { "id": 88, "from": "...", "subject": "...", "otp": "481253", "received_at": "..." }
  ] } }

Common error codes

Error response
{ "status": "error", "message": "out_of_stock", "retryable": true }
Common error codes
messageHTTPMeaningretryable
unauthorized401API key is invalid or missingfalse
invalid_request400Invalid request parametersfalse
not_found404Service, order or endpoint not foundfalse
insufficient_balance402Insufficient balancefalse
out_of_stock409Out of stock — Gmail OTP: retryable, retry in a few seconds; outright-sale email: wait for restocktrue
service_unavailable503Server could not finish the order right now — retry with the same unique_keytrue
in_progress409Order is being finalized or may already exist at the provider — retry with the same unique_keytrue
forbidden403No permission for the resourcefalse
idempotency_mismatch422unique_key was used for a different request — use a new unique_keyfalse
order_cancelled409Order was released before it was charged, nothing charged — retrytrue
too_many_requests429Too many requests — wait and retrytrue
auth_unavailable503API key couldn't be checked right now, the key is fine — retrytrue
shutting_down503Server is restarting — retry in a few secondstrue
payload_too_large413Request body too largefalse
internal_server_error500Server error, please try again laterfalse

Docs for AI and tools

The full documentation in Markdown lives at https://otpforyou.com/llms.txt — paste it into Cursor, Claude or ChatGPT to generate integration code.

Safe retries with unique_key

Send a unique_key (a self-generated UUID) with every order. If the network drops, retry with the same unique_key: you get the same order back, with no new order and no second charge.

Error format

On error the response contains only status, message (a snake_case error code) and retryable, which tells you whether to try again.

Get started with Otpforyou

Sign up for free, top up your wallet and rent your first mail in minutes.

Create account