> ## Documentation Index
> Fetch the complete documentation index at: https://torpedo.co.mz/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# SMS credits

> How SMS credits work, pricing tiers, and how to top up your balance

## How credits work

Every SMS you send deducts **one credit** from your workspace balance. Credits are deducted atomically before the message is dispatched — if the balance reaches zero, sends are blocked until you top up.

Credits never expire.

***

## Pricing tiers

Credits are priced in Mozambican Metical (MZN) via M-Pesa. The per-SMS rate decreases with volume:

| Tier       | Volume                    | Price per SMS |
| ---------- | ------------------------- | ------------- |
| Starter    | Up to 100 000 credits     | 1.30 MZN      |
| Growth     | 100 001 – 260 000 credits | 1.20 MZN      |
| Enterprise | Above 260 000 credits     | 1.00 MZN      |

The tier is selected automatically based on the quantity you purchase.

***

## Buying credits

Purchase credits from the **Billing** page in your dashboard. You will be redirected to an M-Pesa checkout. Once the payment is confirmed, credits are added to your balance immediately.

***

## Zero balance

When your balance reaches zero, sending returns `402`:

```json theme={null}
{
  "errors": [{ "message": "No SMS credits remaining. Contact support to top up." }]
}
```

The message is not queued and no charge is made.

***

## Check your balance

<CodeGroup>
  ```bash cURL theme={null}
  curl https://api.torpedo.co.mz/api/v1/workspace/usage \
    -H "X-API-Key: YOUR_API_KEY"
  ```

  ```js Node.js theme={null}
  const res = await fetch('https://api.torpedo.co.mz/api/v1/workspace/usage', {
    headers: { 'X-API-Key': process.env.TORPEDO_API_KEY },
  })
  const { data } = await res.json()
  console.log(data.usage.smsCreditsBalance)
  ```

  ```python Python theme={null}
  import httpx

  res = httpx.get(
      'https://api.torpedo.co.mz/api/v1/workspace/usage',
      headers={'X-API-Key': TORPEDO_API_KEY},
  )
  balance = res.json()['data']['usage']['smsCreditsBalance']
  print(balance)
  ```

  ```go Go theme={null}
  package main

  import (
  	"encoding/json"
  	"fmt"
  	"net/http"
  	"os"
  )

  func main() {
  	req, _ := http.NewRequest("GET", "https://api.torpedo.co.mz/api/v1/workspace/usage", nil)
  	req.Header.Set("X-API-Key", os.Getenv("TORPEDO_API_KEY"))

  	resp, _ := http.DefaultClient.Do(req)
  	defer resp.Body.Close()

  	var result map[string]any
  	json.NewDecoder(resp.Body).Decode(&result)
  	data := result["data"].(map[string]any)
  	usage := data["usage"].(map[string]any)
  	fmt.Println("Balance:", usage["smsCreditsBalance"])
  }
  ```

  ```java Java theme={null}
  import java.net.http.*;
  import java.net.URI;

  var request = HttpRequest.newBuilder()
      .uri(URI.create("https://api.torpedo.co.mz/api/v1/workspace/usage"))
      .header("X-API-Key", System.getenv("TORPEDO_API_KEY"))
      .GET()
      .build();

  var response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
  System.out.println(response.body());
  ```

  ```csharp C# theme={null}
  using var client = new HttpClient();
  client.DefaultRequestHeaders.Add("X-API-Key", Environment.GetEnvironmentVariable("TORPEDO_API_KEY"));

  var response = await client.GetAsync("https://api.torpedo.co.mz/api/v1/workspace/usage");
  var result = await response.Content.ReadAsStringAsync();
  Console.WriteLine(result);
  ```
</CodeGroup>

The response includes `data.usage.smsCreditsBalance` with your current credit count.

***

## Low balance notifications

Torpedo automatically notifies your workspace when credits drop below a threshold. You will receive an email reminder to top up before sending is blocked.
