VirtualSMS
    VirtualSMS
    Ask AI:
    ← Back to Blog
    Technical

    Published: April 30, 2026 | 11 min read

    Discord drops VoIP-backed signups at the carrier-prefix check before the SMS even leaves the queue — your agent stalls on a code that was never sent. This guide ships the real-SIM API path: install the MCP server in one command or wire three REST endpoints into LangChain / OpenAI / CrewAI / Claude tool-use. ~95% delivery, $0.05 per activation, auto-refund on failures.

    Discord Verification With a Real-SIM API for AI Agents (2026)

    Discord verification real SIM API for AI agents — MCP server and REST API

    Why Discord Rejects VoIP — And Why Your Agent Stalls

    Build any AI agent that signs up for Discord — moderation bot operator, multi-server outreach, regional community manager, even a one-off QA harness — and you hit the same wall: the SMS gate. Discord runs a deterministic carrier-prefix check at the moment of signup. If the prefix belongs to a known VoIP range — Twilio, Bandwidth, Plivo, Vonage, or any of the cheap aggregators that appear on the front page when you Google “cheap SMS API” — the request is dropped before it leaves the platform’s queue. The agent waits forever for an SMS that was never sent.

    That failure mode is uniquely bad for autonomous agents. The HTTP response from the verification provider looks fine (number purchased, no error). The Discord signup form looks fine (“we’ve sent you a code”). The agent dutifully polls for an SMS that does not exist, the timeout fires, and the agent retries with another number from the same VoIP pool. Same wall. Same wasted credit. Add it up across a multi-account pipeline and you have an agent that burns budget infinitely on dead activations.

    The mechanism is unpacked in the VoIP vs physical SIM deep-dive. The short version is that Discord — like WhatsApp, Telegram, Tinder, and most major consumer platforms — has zero appetite for the throwaway-VoIP signup pattern, and the carrier-prefix check is the cheapest way for them to enforce it. The fix is upstream: the agent needs a verification backend that delivers numbers from real mobile carriers, not VoIP aggregators.

    The Real-SIM API Fix — VirtualSMS for Discord Agents

    VirtualSMS supplies real-SIM phone numbers across 145+ countries and 2,500+ services — Discord, WhatsApp, Telegram, Tinder, Google, X, Bumble, Snapchat, the long tail. From an agent’s perspective, the integration shape is identical to any other verification API: buy a number, wait for the SMS, get the code. What changes is that the SMS actually arrives, because the underlying number sits in a real mobile carrier’s prefix range — not a VoIP aggregator.

    Two surfaces are available, both expose the same backend, and both are designed for autonomous agents:

    • MCP server — install once with one command, and the agent gains 18 SMS-verification tools natively. Best for Claude Desktop, Claude Code, or any other MCP-compatible agent runtime. See the Claude MCP setup guide.
    • REST API — three endpoints (buy, poll, cancel) with Bearer-token auth. Best for LangChain, OpenAI Assistants, CrewAI, or any custom orchestration outside the MCP ecosystem. Full spec at the API docs.

    Discovery endpoints are unauthenticated. list_services, list_countries, check_price, and find_cheapest don’t require an API key and don’t consume budget — let the agent plan country/service combos before committing spend.

    Path A — Install the VirtualSMS MCP Server (Claude / MCP runtimes)

    If your agent runs inside Claude Desktop, Claude Code, or any MCP-compatible client (Cursor, Continue, Cline, etc.) the integration is one command:

    claude mcp add --scope user virtualsms \
      -- npx -y virtualsms-mcp \
      -e VIRTUALSMS_API_KEY=vsms_your_api_key_here

    Restart the agent runtime and the VirtualSMS tools light up. The agent can now respond to a prompt like:

    Buy the cheapest Discord activation number from the UK,
    wait up to 5 minutes for the verification SMS, and return the
    six-digit code. If the SMS doesn't arrive, swap_number once
    before giving up.

    Behind the scenes the agent calls buy_number(service="discord", country="uk"), wait_for_code(order_id=…), and swap_number(order_id=…) as needed — no wrapper code required. For the full 18-tool catalog and three production workflow patterns, read the Claude + VirtualSMS MCP workflow guide.

    The MCP server also runs as a hosted endpoint at https://mcp.virtualsms.io/mcp for zero-install adoption — pass your key in the x-api-key header and you’re live. Pick stdio for local-first sandboxes, hosted HTTP for serverless agent runtimes.

    Path B — Three REST Calls (LangChain / OpenAI / CrewAI / custom)

    For agents outside the MCP ecosystem, the REST API is three endpoints. Bearer-token auth in the Authorization header. Get a key in 30 seconds at the API docs — no KYC, no platform fee, no minimum spend.

    1. Discover the cheapest country (optional, unauthenticated)

    # 1. (Optional) Discover the cheapest Discord country — unauthenticated
    curl https://api.virtualsms.io/v1/services/discord/cheapest

    2. Buy a real-SIM number for Discord

    # 2. Buy a real-SIM number for Discord (UK in this example)
    curl -X POST https://api.virtualsms.io/v1/orders \
      -H "Authorization: Bearer $VIRTUALSMS_API_KEY" \
      -H "Content-Type: application/json" \
      -d '{"service": "discord", "country": "uk"}'
    
    # Response:
    # { "id": "ord_8FQ...", "phone": "+447700900123", "price": 0.05, "status": "waiting" }

    3. Poll for the SMS code

    # 3. Poll for the SMS code (or use the wait-for-code WebSocket)
    curl -H "Authorization: Bearer $VIRTUALSMS_API_KEY" \
      https://api.virtualsms.io/v1/orders/ord_8FQ...
    
    # Response when the SMS lands:
    # { "id": "ord_8FQ...", "phone": "+447700900123",
    #   "code": "374912", "sms": "Your Discord code is 374912.",
    #   "status": "completed" }

    For higher throughput (5-figure activations/month), swap the polling loop for the WebSocket-backed wait_for_code endpoint — same wrapper shape, no wasted HTTP. The same pattern works for any of the 2,500+ supported services — see the full service list.

    4. Cancel-on-timeout (auto-refunds)

    # 4. Cancel-on-timeout — auto-refund if no SMS arrived
    curl -X POST -H "Authorization: Bearer $VIRTUALSMS_API_KEY" \
      https://api.virtualsms.io/v1/orders/ord_8FQ.../cancel

    The cancel call is the safety net. Failed activations auto-refund — the agent loop never consumes budget on a number that never received an SMS.

    Reference Python Script — Drop Into Any Agent

    The full integration in ~25 lines of Python. Works as a LangChain @tool body, an OpenAI Assistants function handler, or a Claude tool-use dispatcher — wrap as needed:

    import os, time, requests
    
    API = "https://api.virtualsms.io/v1"
    KEY = os.environ["VIRTUALSMS_API_KEY"]
    H   = {"Authorization": f"Bearer {KEY}"}
    
    def verify_discord(country: str = "uk", timeout_s: int = 300) -> dict:
        """Buy a real-SIM number for Discord, wait for the SMS code, return it.
        Auto-cancels (and auto-refunds) on timeout."""
        order = requests.post(
            f"{API}/orders", headers=H,
            json={"service": "discord", "country": country},
        ).json()
        oid, phone = order["id"], order["phone"]
    
        deadline = time.time() + timeout_s
        while time.time() < deadline:
            sms = requests.get(f"{API}/orders/{oid}", headers=H).json()
            if sms.get("code"):
                return {"phone": phone, "code": sms["code"]}
            time.sleep(3)
    
        requests.post(f"{API}/orders/{oid}/cancel", headers=H)
        return {"error": "timeout — order auto-cancelled and refunded",
                "phone": phone}
    
    if __name__ == "__main__":
        print(verify_discord("uk"))

    Drop this into your agent and it can sign up for Discord on demand. For the full multi-framework wrapping examples (LangChain decorator, OpenAI JSON schema, CrewAI agent role, Claude tool-use), see the AI agent phone verification guide. For the broader strategic context — why agents need this primitive at all — read the post on why AI agents need real phone numbers.

    Pricing + Rate Limits — Built For Agent Throughput

    • Activations from $0.05 per SMS code. Exact price per service+country is visible on the live pricing page and via the API.
    • Auto-refund on no-SMS. Failed activations cost zero. The agent loop can retry without cost paranoia.
    • 120 requests/min per API key default rate limit. Production accounts can be lifted higher — email [email protected] with expected throughput.
    • Multi-chain crypto deposits. Top up via USDC on Base, Tron, Polygon, Arbitrum, Solana, or BNB Chain. Crypto deposit fees are cents, not dollars. No KYC, no monthly minimum, unused balance never expires.
    • Discovery endpoints are free. The agent can plan before committing spend.

    For a deposit-first, pay-per-call model where the agent settles its own balance via HTTP 402, see the companion guide on x402 SMS verification.

    Comparison — VoIP API vs Real-SIM API for Discord

    BackendDiscord deliveryPrice floorRefund on fail
    Twilio / Bandwidth / generic VoIPRejected at carrier-prefix checkPer-month + per-messageManual support ticket
    Free public receive-SMS sitesRange-blocked by DiscordFree (in theory)n/a — no payment
    Pool-rotated bulk SIMsRange-flagged after first abuse signalVariableProvider-dependent
    VirtualSMS real-SIM API~95% delivery on first attemptFrom $0.05/codeAuto-refund

    The economics flip the moment you account for failed activations. A VoIP API that’s “cheaper” per-message but rejected by Discord costs infinity per successful verification. A real-SIM API at $0.05/code with ~95% delivery and auto-refund on the failures costs roughly $0.05 per successful verification. The decision is structural, not price-shopping.

    Troubleshooting — When The SMS Doesn’t Arrive

    Symptom: order completes, no code after 5 minutes

    Cancel the order (auto-refund), then call list_countries and pick a different country with stock. UK / Germany / Netherlands are the highest-trust ranges for Discord — default to one of these and only fall back to mid-tier countries when stock runs thin.

    Symptom: Discord rejects “invalid phone number”

    Country mismatch — the agent picked a country whose mobile prefix Discord soft-blocks for new accounts. Swap to UK / Germany / Netherlands and retry. The discovery endpoint find_cheapest already filters by service compatibility.

    Symptom: agent loops on the same failure

    Almost always the agent is wired to a VoIP backend, not a real-SIM API — confirm the verification provider. The reference Python on this page is wired to VirtualSMS by default; if you see this symptom, double-check the API base URL hasn’t been swapped.

    Pre-launch checklist: hit /v1/balance (auth wired), call /v1/services (server reachable), run a single low-cost POST /v1/orders to validate end-to-end before turning the agent loose on production traffic.

    Ask AI about this article

    Get a summary or follow-up answer in your favourite AI assistant.

    Frequently Asked Questions

    Why does Discord reject so many virtual numbers?

    Discord runs a carrier-prefix lookup at the moment you submit the number. If the prefix belongs to a known VoIP range (Twilio, Bandwidth, Plivo, Vonage, the long tail of cheap aggregators) the SMS request is dropped before it leaves the queue — you never even see a failed delivery. The same applies to public free-receive-SMS sites because Discord crawls and blocks those number pools. Real-SIM virtual numbers from a carrier-grade API look identical to a personal phone at the prefix level, which is why the discord verification real sim api path is the one that actually works.

    How do I add Discord verification to my AI agent?

    Two ways. (1) Install the VirtualSMS MCP server with one command and the agent gains 18 SMS-verification tools natively — your prompt becomes "buy a Discord number, wait for the SMS, return the code". (2) Wrap three REST endpoints (POST /v1/orders, GET /v1/orders/{id}, POST /v1/orders/{id}/cancel) in a single Python function and register it as a LangChain @tool, an OpenAI Assistants function, or a Claude tool-use schema. Either path is ~5-30 lines of code and ships in under 10 minutes.

    What's the cheapest country for Discord SMS verification?

    Activations on VirtualSMS start from $0.05 per SMS code. The exact cheapest country fluctuates with stock — call /v1/services/discord/cheapest (unauthenticated) to read it live before committing spend. UK, Germany, and Netherlands are the usual top performers for Discord because they sit in high-trust mobile-carrier ranges and rarely trigger the "country mismatch" soft-block that Discord applies to a few mid-tier ranges.

    Does VirtualSMS work for bulk Discord account creation?

    Yes — the API has a 120 req/min default rate limit per key, and production accounts can lift that on request. For agent-driven bulk pipelines, the right pattern is fan-out: queue N orders in parallel, await each via the wait-for-code WebSocket, and call cancel on any that time out. Each activation is independent and auto-refunds on no-SMS, so the agent loop runs without cost paranoia.

    What happens if Discord doesn't send the SMS?

    The agent calls POST /v1/orders/{id}/cancel and the activation auto-refunds — you're not charged for SMS codes that never arrived. The reference Python script on this page bounds the wait to 5 minutes, which covers ~99% of legit Discord deliveries. If the cancel-and-retry pattern fires repeatedly on the same country, swap to a different country (call list_countries to discover stock) rather than retrying the same combo.

    Can I use the same number for multiple Discord accounts?

    No — each Discord account needs its own fresh number to avoid the cluster-flag heuristics that Discord applies at signup. The other two halves of the recipe are a fresh browser fingerprint and a clean residential IP per account; reusing any one of those three across accounts is what trips the heuristic, not the number alone. For multi-account ops, treat each (number, fingerprint, IP) as a single-use bundle.

    Published:
    VirtualSMS
    Engineering

    VirtualSMS

    Maintained by the VirtualSMS team. We've been shipping real-SIM SMS verification infrastructure since 2025 — 2500+ services across 145+ countries, MCP server v1.2.0 listed on Smithery and the official MCP registry. Open source, MIT licensed.

    Last updated:

    Related Articles

    Get an API Key in 30 Seconds

    Real-SIM verification API · 2500+ services · 145+ countries · 120 rpm/key · Activations from $0.05 · Auto-refund on no-SMS