> For the complete documentation index, see [llms.txt](https://docs.sms4sats.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.sms4sats.com/api-reference/api-reference.md).

# Overview

All endpoints are served from the base URL:

```
https://api2.sms4sats.com
```

You can also GET the base URL to check for service availability.

### Authentication

Most endpoints require no authentication. For prepaid account operations (immediate deduction from balance), pass your API Key in the `X-API-Key` request header.

### Payment Model

sms4sats uses [hold invoices](https://bolt.fun/guide/invoices/hodl-invoice):

* Payment is **held** (not settled) when the invoice is paid.
* For **receive** orders — settled only when an activation code is delivered.
* For **send** orders — settled only when SMS status is `sent` or `delivered`.
* If no code arrives within **21 minutes**, the invoice is automatically **canceled** and funds returned.

### Endpoint Overview

| Method | Endpoint              | Description                           |
| ------ | --------------------- | ------------------------------------- |
| `GET`  | `/getCountries`       | List available countries              |
| `GET`  | `/getnumbersstatus`   | List available services for a country |
| `GET`  | `/getRentalCountries` | List countries with rental numbers    |
| `GET`  | `/price`              | Get price for a country/service       |
| `POST` | `/createorder`        | Create a receive SMS order            |
| `GET`  | `/orderstatus`        | Get order status and activation code  |
| `GET`  | `/cancelorder`        | Cancel a receive order                |
| `POST` | `/createsendorder`    | Create a send SMS order               |
| `POST` | `/fund`               | Fund a prepaid account                |
| `GET`  | `/balance`            | Get prepaid account balance           |
| `GET`  | `/history`            | Get prepaid account funding history   |


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.sms4sats.com/api-reference/api-reference.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
