# Billing & Usage

## Get current account billing plan

<mark style="color:blue;">`GET`</mark> `https://api.smtpd.dev/api/v1/account/billing/plan/current`

#### Path Parameters

| Name           | Type   | Description             |
| -------------- | ------ | ----------------------- |
| Authentication | string | `Bearer {access_token}` |

{% tabs %}
{% tab title="200 " %}

```
{
  "plan_id": "dbef0751-42b7-424e-8d1f-4ad67c478a2d",
  "plan_name": "Free - Forever!",
  "price_usd_per_month": "0.00",
  "max_emails_per_month": 5000,
  "enforce_plan_limit": true,
  "extra_thousand_emails_cost": "",
  "max_sending_profiles": 1,
  "max_retention_days": 7,
  "feature_email_validation": false,
  "feature_basic_reporting": false,
  "feature_advance_reporting": false
}
```

{% endtab %}
{% endtabs %}

## Get account usage (Last 30 days)

<mark style="color:blue;">`GET`</mark> `https://api.smtpd.dev/api/v1/account/billing/usage`

#### Path Parameters

| Name           | Type   | Description             |
| -------------- | ------ | ----------------------- |
| Authentication | string | `Bearer {access_token}` |

{% tabs %}
{% tab title="200 " %}

```
{
  "total": 4087,
  "total_by_category": {
    "unknown": 40,
    "accepted": 6,
    "proccessed": 0,
    "sent": 2,
    "delivered":4003,
    "bounced": 1,
    "complaint": 0,
    "rejected": 35,
  }
```

{% endtab %}
{% endtabs %}

## Get available billing plans

<mark style="color:blue;">`GET`</mark> `https://api.smtpd.dev/api/v1/billing/plan`

This endpoint returns all current billing plans for SMTPD, along with their limits and features

{% tabs %}
{% tab title="200: OK " %}

```json
[
  {
    "plan_id": "dbef0751-42b7-424e-8d1f-4ad67c478a2d",
    "name": "free",
    "description": "Free - Forever! Gives you 5k free emails to send every month, perfect for developer projects OR testing",
    "price_usd_per_month": "0.00",
    "max_emails_per_month": 5000,
    "enforce_plan_limit": true,
    "extra_thousand_emails_cost": "",
    "max_sending_profiles": 1,
    "max_retention_days": 7,
    "feature_email_validation": false,
    "feature_basic_reporting": false,
    "feature_advance_reporting": false
  },
  {
    "plan_id": "10e5dba8-903d-4623-afc6-0d4a17852931",
    "name": "startup",
    "description": "Startup - Gives you 200k emails every month, perfect for small to medium projects",
    "price_usd_per_month": "90.00",
    "max_emails_per_month": 200000,
    "enforce_plan_limit": false,
    "extra_thousand_emails_cost": "0.80",
    "max_sending_profiles": 2,
    "max_retention_days": 30,
    "feature_email_validation": true,
    "feature_basic_reporting": true,
    "feature_advance_reporting": false
  },
  {
    "plan_id": "0cd5639c-c493-4d84-a95a-716ffb7fdabb",
    "name": "enterprise",
    "description": "Enterprise - Gives you 1 million emails every month & advanced reporting, perfect for medium to large projects",
    "price_usd_per_month": "450.00",
    "max_emails_per_month": 1000000,
    "enforce_plan_limit": false,
    "extra_thousand_emails_cost": "0.60",
    "max_sending_profiles": 10,
    "max_retention_days": 730,
    "feature_email_validation": true,
    "feature_basic_reporting": true,
    "feature_advance_reporting": true
  }]json
```

{% endtab %}
{% endtabs %}

## Get billing plan by ID

<mark style="color:blue;">`GET`</mark> `https://api.smtpd.dev/api/v1/billing/plan/:id`

This endpoint returns a billing plan by ID

{% tabs %}
{% tab title="200 " %}

```json
{
    "plan_id": "dbef0751-42b7-424e-8d1f-4ad67c478a2d",
    "name": "free",
    "description": "Free - Forever! Gives you 5k free emails to send every month, perfect for developer projects OR testing",
    "price_usd_per_month": "0.00",
    "max_emails_per_month": 5000,
    "enforce_plan_limit": true,
    "extra_thousand_emails_cost": "",
    "max_sending_profiles": 1,
    "max_retention_days": 7,
    "feature_email_validation": false,
    "feature_basic_reporting": false,
    "feature_advance_reporting": false
 }
```

{% endtab %}
{% endtabs %}


---

# Agent Instructions: 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.smtpd.dev/api/account/billing-and-usage.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.
