DEV Community

BridgeXAPI
BridgeXAPI

Posted on

You don’t know which route your SMS is using: compare SMS routes in Python

You send an SMS. It gets delivered (or not).

But you don’t know which route was used.

That means you can’t explain why delivery changes.


Most SMS APIs don’t expose routing.

You send a message → it gets accepted → and that’s it.

What you don’t see:

  • which delivery path was used
  • why delivery speed changes
  • why pricing differs per message
  • why one message arrives and another doesn’t

Routing is hidden.

You’re debugging blind.


The problem

When routing is abstracted away:

  • you cannot test delivery paths
  • you cannot compare behavior between routes
  • you cannot optimize for cost vs delivery
  • you cannot reproduce results

Everything becomes guesswork.


What this example does

This example shows how to send the same message through different routes using BridgeXAPI.

Routing is explicit.

You choose the route.


Python example

import requests

API_KEY = "YOUR_API_KEY"
BASE_URL = "https://hi.bridgexapi.io"

def send(route_id):
    payload = {
        "route_id": route_id,
        "caller_id": "BRIDGEXAPI",
        "numbers": ["31612345678"],
        "message": f"Route test via {route_id}"
    }

    response = requests.post(
        f"{BASE_URL}/api/v1/send_sms",
        json=payload,
        headers={"X-API-KEY": API_KEY}
    )

    return response.json()

# test multiple routes
for route in [1, 2, 3]:
    result = send(route)
    print(f"Route {route}", result)
Enter fullscreen mode Exit fullscreen mode

Example output

Running this across multiple routes returns:

Route 1  status: success, cost: 0.088, bx_message_id: BX-...
Route 2  status: success, cost: 0.088, bx_message_id: BX-...
Route 3  status: success, cost: 0.091, bx_message_id: BX-...
Enter fullscreen mode Exit fullscreen mode

Even when sending the same message:

  • cost can differ per route
  • each message has its own bx_message_id
  • execution follows the selected route

This is observable, not abstracted.


What routes actually represent

A route is not just an ID.

Each route maps to a routing profile with its own:

  • delivery behavior
  • pricing model
  • sender ID policy
  • access level

For example:

  • routes 1–4 → general SMS traffic
  • routes 5 and 7 → iGaming traffic (restricted)
  • route 8 → OTP / platform traffic (whitelisted sender IDs)

Different traffic types do not share the same infrastructure.

Routes separate them.


What to do next

Run the same request across multiple routes.

Change only:

route_id = 1
Enter fullscreen mode Exit fullscreen mode

Then:

route_id = 2
route_id = 3
Enter fullscreen mode Exit fullscreen mode

Compare behavior.


What this exposes

  • different delivery paths
  • different pricing per route
  • different delivery behavior

You are no longer guessing.

You are testing execution.


Deterministic execution

BridgeXAPI does not automatically switch routes behind the scenes.

The route you select is the route that is used.

  • predictable behavior
  • consistent pricing
  • reproducible results

No hidden routing.


Why this matters

In most systems:

You program the message.

The provider controls the route.

Here:

You control both.

A route is not just a path.

It is a contract for how your message is executed.


Closing

Most SMS APIs let you send messages.

This lets you choose how they are delivered.

This is not about sending.

This is about controlling execution.


Next

→ track delivery

→ estimate cost

→ debug failed SMS

Top comments (0)