AnonymSMS is now asms.ai:Read
asms.ai
MCP for AI agents

Use asms with OpenAI API

Give your own OpenAI-powered agent asms as a remote MCP tool in the Responses API: verification codes and rented numbers in a few lines.

One API key Codes from $0.50, refunded if none arrives Asks before it spends
OpenAI API

> Get me a US number for Telegram and give me the code when it arrives.

● asms.get_pricing({ "country": "us", "service": "telegram" }) → in stock

US Telegram numbers are in stock at the listed price, and you're only charged if a code arrives. Order one?

> Yes, go ahead.

● asms.create_otp_order({ "country": "us", "service": "telegram" }) → +1 347 •••-••18

● asms.poll_sms({ "orderId": "…" }) → code received

Your number is +1 347 •••-••18 and the Telegram code is 504913.

What you can ask OpenAI API

Once asms is connected, OpenAI API can order numbers, read the SMS they receive and check your account, all paid from your asms wallet.

Get a verification code

“Order a UK number for WhatsApp and wait for the code.”

Rent a number you keep

“Rent a US number for a month for our app's SMS login tests, and show me any texts it gets.”

Check the account

“What's my asms balance, and which orders are still waiting for a code?”

Setup

You need an asms API key: create one in your dashboard and keep it in the ASMS_API_KEY environment variable.

The quick way: paste a prompt

Paste this into OpenAI API. It reads this page and follows the steps for agents below.

prompt
Connect the asms MCP server to OpenAI API by following the steps for AI agents at https://asms.ai/agents/openai-api. My asms API key is in the ASMS_API_KEY environment variable; don't print it.

Or step by step

  1. 1

    Add asms as a tool

    OpenAI doesn't store the key, so send it with every request. "always" makes the API return an approval request before each call; you approve it in your code.

    python
    import os
    from openai import OpenAI
    
    client = OpenAI()
    resp = client.responses.create(
        model="gpt-5",
        tools=[{
            "type": "mcp",
            "server_label": "asms",
            "server_url": "https://asms.ai/mcp",
            "authorization": os.environ["ASMS_API_KEY"],
            "require_approval": "always",
        }],
        input="What's my asms balance, and what does a US Telegram code cost?",
    )
    print(resp.output_text)
  2. 2

    Skip approvals for read-only tools

    Let the model check prices and read codes freely, and approve only what spends.

    require_approval
    "require_approval": {"never": {"tool_names": ["get_balance", "get_pricing", "get_inventory", "poll_sms", "list_active_orders", "get_rental_offers", "list_rentals", "read_rental_sms"]}}

For AI agents reading this page

If a user asked you to connect asms to OpenAI API, follow these steps in order.

  1. Check whether the ASMS_API_KEY environment variable is set, without printing its value. If it is not set, ask the user to create a key at https://asms.ai/dashboard#api-keys and set ASMS_API_KEY, then stop until they confirm.
  2. Register the server: add the tool { "type": "mcp", "server_label": "asms", "server_url": "https://asms.ai/mcp", "authorization": <ASMS_API_KEY>, "require_approval": "always" } to the Responses API request.
  3. Check it worked: send a request asking for the asms balance and check the response calls get_balance.
  4. Start read-only: call get_balance, then get_pricing or get_rental_offers, and report what you found.
  5. Before any tool that spends from the wallet (create_otp_order, rent_number), tell the user the price and wait for their OK.
  6. Never create an asms account or API key, top up the wallet, or approve a sign-in on the user's behalf, and never print the key.

Reference

MCP endpointhttps://asms.ai/mcp
TransportStreamable HTTP (stateless)
AuthOAuth sign-in with asms, or the header Authorization: Bearer <ASMS_API_KEY>
REST APIhttps://asms.ai/api-docs
For LLMshttps://asms.ai/llms.txt

Tools

ToolWhat it doesNeeds your OK?
get_balanceWallet balanceNo
get_pricingVerification code pricesNo
get_inventoryVerification number stockNo
create_otp_orderOrder a verification numberYes
poll_smsCheck for the verification codeNo
list_active_ordersList verification ordersNo
cancel_orderCancel a verification orderYes
get_rental_offersNumber rental pricesNo
rent_numberRent a phone numberYes
list_rentalsList rented numbersNo
read_rental_smsRead a rented number's SMSNo
cancel_rentalCancel a rental for a refundYes

Questions

What does it cost?+

Connecting is free. You pay from your asms wallet: verification codes from $0.50, charged only when a code arrives and refunded automatically when none does, and rented numbers priced by country and period. Top up by card, PayPal or crypto.

Will OpenAI API spend money without asking?+

Ordering a code and renting a number are marked as spending tools, so clients that support it ask for your approval first, and asms tells the agent to confirm the price with you before buying. Reading prices, balances and messages never spends anything.

What's the difference between a code and a rented number?+

A verification code order gives you a number for one code, for one service, and refunds itself if nothing arrives. A rented number is yours for a set period, from a day to a year, and receives every SMS sent to it: useful for testing your own app's SMS login or for an account you'll need to verify again later.

How do I disconnect it?+

Delete the API key in your asms dashboard, or remove asms under Connected apps if you signed in. Either one cuts off access straight away.

Give OpenAI API a phone number

Create an account, top up from a few dollars, and connect. Codes from $0.50, refunded automatically when none arrives.