> For the complete documentation index, see [llms.txt](https://docs.meganova.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.meganova.ai/api-reference/platform-api/get-credit-balance/model-coupons.md). Agents can also search and read this documentation through its [MCP server](https://docs.meganova.ai/~gitbook/mcp).

# Model Coupons

List model-specific coupons granted to your account and inspect per-coupon usage.

Model Coupons are per-model credit grants (promotional or negotiated) that apply before your general balance. They have an expiration date and a consumption cap. This page covers the endpoints behind the **Model Coupons** sidebar in the console.

## List My Model Coupons

### HTTP Request

`GET` `{API_URL}/payment/model-coupons`

### Query Parameters

| Parameter       | Type   | Default | Description                                                   |
| --------------- | ------ | ------- | ------------------------------------------------------------- |
| `coupon_status` | string | —       | Filter by status: `active`, `inactive`, `expired`, `depleted` |
| `page`          | int    | `1`     | Page number (≥1)                                              |
| `page_size`     | int    | `20`    | Items per page (1–100)                                        |

> **Lazy expiry.** Calling this endpoint also flips any coupons past their expiration date to `expired` before returning — no separate cron call is needed.

### Response

```json
{
  "data": {
    "results": [
      {
        "id": 42,
        "model_name": "anthropic/claude-opus-4-7",
        "status": "active",
        "granted_credit": 50.00,
        "remaining_credit": 37.12,
        "expires_at": "2026-06-30T23:59:59Z",
        "created_at": "2026-04-01T12:00:00Z"
      }
    ],
    "pagination": {
      "total": 1,
      "page": 1,
      "page_size": 20,
      "has_more": false
    }
  },
  "message": "Model coupons retrieved successfully",
  "status": "success"
}
```

### Example

```bash
# All active coupons
curl -X GET '{API_URL}/payment/model-coupons?coupon_status=active' \
  -H 'Authorization: Bearer {TOKEN/KEY}'
```

## Get Coupon Usage

Per-request usage history for a single coupon. Use this to understand which inference calls consumed the grant.

### HTTP Request

`GET` `{API_URL}/payment/model-coupons/{coupon_id}/usage`

### Path & Query Parameters

| Parameter   | Type       | Description                              |
| ----------- | ---------- | ---------------------------------------- |
| `coupon_id` | int (path) | Coupon identifier from the list endpoint |
| `page`      | int        | Page number (≥1), default `1`            |
| `page_size` | int        | Items per page (1–100), default `20`     |

### Response

```json
{
  "data": {
    "results": [
      {
        "request_id": "req_01HXY…",
        "timestamp": "2026-04-21T18:37:21Z",
        "model": "anthropic/claude-opus-4-7",
        "spend_covered": 0.0412,
        "tokens": 2048
      }
    ],
    "pagination": {
      "total": 128,
      "page": 1,
      "page_size": 20,
      "has_more": true
    }
  },
  "message": "Coupon usage retrieved successfully",
  "status": "success"
}
```

### Errors

| Status | Reason                        |
| ------ | ----------------------------- |
| `403`  | Coupon does not belong to you |
| `404`  | Coupon not found              |

### Example

```bash
curl -X GET '{API_URL}/payment/model-coupons/42/usage?page=1&page_size=50' \
  -H 'Authorization: Bearer {TOKEN/KEY}'
```

## Redeem a Promo Code

Promo codes grant either a fixed credit amount or a percentage discount on an order.

### HTTP Request

`POST` `{API_URL}/payment/promo-codes/redeem`

### Body Parameters

| Parameter    | Required | Type   | Description                                |
| ------------ | -------- | ------ | ------------------------------------------ |
| `promo_code` | Yes      | string | Code provided by MegaNova (case-sensitive) |
| `order_id`   | Optional | int    | Order to apply a percent discount against  |
| `order_type` | Optional | string | Order category (e.g. `cloud_product`)      |

### Response

```json
{
  "data": [],
  "message": "Promo code redeemed successfully",
  "status": "success"
}
```

On failure, `status` is `failed` and `message` explains why (expired, already used, etc.).

### Example

```bash
curl -X POST '{API_URL}/payment/promo-codes/redeem' \
  -H 'Authorization: Bearer {TOKEN/KEY}' \
  -H 'Content-Type: application/json' \
  -d '{"promo_code": "LAUNCH25"}'
```

## Related

* [User Credit Balance](https://docs.meganova.ai/api-reference/platform-api/get-credit-balance.md)
* [Refunds](https://docs.meganova.ai/api-reference/platform-api/get-credit-balance/refunds.md)
