# Send an SMS with Python

Send one message to a simulated recipient, then keep its ID for delivery tracking.

## 1. Prepare the workspace

Prepare an owned US-eligible SMS number, enable the US destination, complete its required registration and fund the workspace. The test recipient `+15005550006` simulates delivery and is billed at the normal destination rate; it does not reach a handset. Follow [workspace setup](/docs/get-started/send-your-first-sms) before running this sample.

## 2. Install and configure

Use Python 3.10 or later. In a new project directory:

```bash
python3 -m venv .venv
source .venv/bin/activate
python -m pip install messagebird-sdk
export BIRD_API_KEY="YOUR_API_KEY"
export BIRD_SMS_FROM="YOUR_ELIGIBLE_US_NUMBER"
```

Replace the environment values with your workspace key and eligible sender number. The SDK selects the API region from the key. Run this example on your server or development machine.

## 3. Run the example

Save as `sms.py`:

```python
import os

from bird import Bird

with Bird(api_key=os.environ["BIRD_API_KEY"]) as client:
    message = client.sms.send(
        from_=os.environ["BIRD_SMS_FROM"],
        to="+15005550006",
        text="Your studio visit is tomorrow at 14:00.",
        category="transactional",
        metadata={"booking": "FN-1042"},
    )
    print(message.id, message.status.value)
```

```bash
python sms.py
```

## 4. Inspect the outcome

The response prints a message ID and the accepted status. Processing and delivery happen afterward. Inspect the ID in the [SMS log](/docs/guides/sms/sms-log) or use the read example in [your first SMS](/docs/get-started/send-your-first-sms#4-read-the-outcome). The simulated destination progresses through its delivery outcome without contacting a handset.

Running this script again creates another logical send. If the result of a request is uncertain, follow [idempotency guidance](/docs/guides/idempotency) before sending again.

## Next steps

- [SMS API reference](/docs/api/reference/create-sms-message)
- [Delivery events and replies](/docs/guides/sms/events)
- [Migration guides](/docs/guides/sms/migrate)
- [SMS resources](/sms/resources)

Use this operation in [FastAPI](/docs/get-started/quickstarts/python/fastapi/sms) or [Django](/docs/get-started/quickstarts/python/django/sms) to send and inspect messages through an application route.

## Related resources

- [One-way and two-way SMS](/explained/sms/what-is-the-difference-between-one-way-and-two-way-sms) (answer)
- [Check your message segments](/tools/sms-segment-calculator) (tool)
- [Two-way SMS](/products/sms/two-way) (product)
- [Build your first integration](/learn/paths/integration) (course)

[Get an implementation brief](/learn/workspace?topic=sms-replies)
