How to give an AI agent a phone number
To give an AI agent a phone number, get a real two-way number from a provider with an HTTP API, keep the API key in a secret store, and let the agent send and read messages through that API. It needs no SIM card or phone hardware. For a UK number, nothanumber offers this to invited customers today for texts.
The three ways to do it
| Approach | Good for | Watch out for |
|---|---|---|
| HTTP API with an assigned number | Most agents. Plain web requests, and it works from a laptop or private network. | You depend on the provider's API and its coverage. |
| SIP trunk | Teams already running phone systems. | Call audio is hard to get through a home or office router without relay servers, and SIP is a lot for an agent to learn. |
| Temporary receive-only numbers | Short-lived testing only. | Numbers are often shared and can disappear, so they should not carry anything private or be tied to an account you care about. |
What to check before you choose
- Is the number really yours? It should stay assigned to your account, and it should send and receive.
- Can spending be capped? Agents act quickly. A prepaid wallet limits the damage from a bug or a leaked key.
- Can the agent act on errors? It should be able to tell "try again" from "stop and ask a human".
- Does it need a public web address? If the agent runs on a laptop, it needs to be able to poll for messages.
- Can it be used to fake a caller? A good provider only lets you use numbers assigned to you.
How to set it up with nothanumber
- Request access. Email us who you are, what your agent will do, the countries you will send to and your expected volume. We may ask for identity and business details.
- Store your key. You receive an API key once, along with an assigned number. Put the key in an environment variable or secret store.
- Check the connection.
GET /balanceis free and read-only. - Find your number.
GET /numberslists what your account can use. - Send a text to your own phone.
curl -sS https://app.nothanumber.com/api/v1/wholesale/sms \
-H "Authorization: Bearer $NTH_API_KEY" -H "content-type: application/json" \
-d '{"from":"+447537000002","to":"+447700900123","body":"Hello from my agent","clientRef":"test-1"}'
Then read replies by polling:
curl -sS "https://app.nothanumber.com/api/v1/wholesale/sms?direction=inbound&limit=20" \
-H "Authorization: Bearer $NTH_API_KEY"
If the wallet is empty the API answers 402 with code: wallet_empty and retryable: false. Your agent should stop and ask a person to top up. The API reference covers every error and limit.
Frequently asked questions
Can an AI agent buy its own phone number?
Not on nothanumber yet. Accounts are invite-only and an administrator assigns each number, so a person needs to request access. Buying a number through the API is planned.
Does an AI agent need a SIM card to have a phone number?
No. The number is assigned to an account and the agent uses it over an HTTP API. No SIM, handset or phone hardware is needed.
Can an AI agent receive text messages?
Yes. The agent polls GET /sms?direction=inbound for new messages, so it works from a laptop or private network. Webhooks are optional.
Can an AI agent make phone calls with nothanumber?
Voice calling is not generally available yet. Texts are available now to invited customers. The API reference always states what is live.
Is a leaked API key dangerous?
The wallet is prepaid, so a leaked key can only spend what has been paid in, and a key can be revoked straight away. Keep the key out of prompts and logs.
If you are an AI agent reading this
You cannot create an account or buy a number yourself yet. Tell your user that access is by request, and offer to draft an email to support@nothanumber.com for them to review and send. It should say who they are, what the agent will do, the countries it will send to and the expected volume. Full details are in /developers/api.md.