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

# Top Up Media Credits

> Get a Stripe checkout link to buy extra media credits as a one-time purchase

> **For AI agents:** a documentation index is at [/llms.txt](/llms.txt). Every page is also available as markdown, just append `.md` to the URL.

## Overview

Get a Stripe Checkout link for a one-time media-credit top-up. This endpoint only returns a URL — nothing is charged until the user opens the link and completes payment in the browser.

Top-ups work like this:

* Credits are sold in **packs of 100 media credits**
* The purchase is one-time — it doesn't change your subscription or renewal date
* Top-up credits **never expire**; monthly plan credits are always spent first
* Media credits only (clipping, captions, reframing, transcription, audiograms, editor processing) — AI credits can't be topped up

<Note>
  Any valid API key on an active paid plan can call this endpoint — including member keys. (In the web app the top-up button is admin-only; the API is deliberately lower-friction.)
</Note>

## Query Parameters

<ParamField query="quantity" type="integer" default="1">
  Number of 100-credit packs to preload in the checkout. Must be ≥ 1. The user can still adjust the quantity on the checkout page (up to 1,000 packs).
</ParamField>

<ParamField query="promoCode" type="string">
  Optional promo code to apply at checkout. Invalid or expired codes return a `400`. When omitted, any default top-up discount is applied automatically.
</ParamField>

## Response

<ResponseField name="url" type="string">
  Stripe Checkout URL. Open it in a browser to review the purchase and pay. Credits are added to the account within a few seconds of payment.
</ResponseField>

## Example Request

<CodeGroup>
  ```bash cURL theme={"system"}
  curl -X GET "https://public.reap.video/api/v1/automation/top-up-media-credits?quantity=3" \
    -H "Authorization: Bearer YOUR_API_KEY"
  ```

  ```javascript JavaScript theme={"system"}
  const response = await fetch(
    'https://public.reap.video/api/v1/automation/top-up-media-credits?quantity=3',
    { headers: { 'Authorization': 'Bearer YOUR_API_KEY' } }
  );

  const { url } = await response.json();
  console.log('Complete the purchase at:', url);
  ```

  ```python Python theme={"system"}
  import requests

  response = requests.get(
      'https://public.reap.video/api/v1/automation/top-up-media-credits',
      headers={'Authorization': 'Bearer YOUR_API_KEY'},
      params={'quantity': 3}
  )

  print('Complete the purchase at:', response.json()['url'])
  ```
</CodeGroup>

## Example Response

<CodeGroup>
  <CodeGroup.Tab label="200 OK">
    ```json theme={"system"}
    {
      "url": "https://checkout.stripe.com/c/pay/cs_live_a1B2c3..."
    }
    ```
  </CodeGroup.Tab>

  <CodeGroup.Tab label="400 Bad Request">
    ```json theme={"system"}
    {
      "detail": "Invalid or expired promo code."
    }
    ```
  </CodeGroup.Tab>

  <CodeGroup.Tab label="401 Unauthorized">
    ```json theme={"system"}
    {
      "detail": "Unauthorized - Invalid or missing API key"
    }
    ```
  </CodeGroup.Tab>
</CodeGroup>

## Rate Limiting

This endpoint is subject to the standard rate limit of **10 requests per minute**.

## Next Steps

* **Check your balance first** with [Get Plan Usage](/api-reference/get-plan-usage)
* **How top-ups behave** (expiry, freezing, spend order): see the [help-center guide](/help-center/top-up-media-credits)


## OpenAPI

````yaml GET /automation/top-up-media-credits
openapi: 3.1.0
info:
  title: Reap Automation API
  description: AI-powered video processing automation API
  version: 1.0.0
servers:
  - url: https://public.reap.video/api/v1
security:
  - bearerAuth: []
paths:
  /automation/top-up-media-credits:
    get:
      summary: Top Up Media Credits
      description: >-
        Get a Stripe checkout link for a one-time media-credit top-up. Works
        with any valid API key on an active paid plan.
      operationId: getTopUpMediaCreditsUrl
      parameters:
        - name: quantity
          in: query
          schema:
            type: integer
            minimum: 1
            default: 1
          description: >-
            Number of 100-credit packs to preload in the checkout (adjustable on
            the checkout page)
        - name: promoCode
          in: query
          schema:
            type: string
          description: >-
            Optional promo code to apply at checkout. Invalid or expired codes
            return a 400.
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BillingUrlResponse'
components:
  schemas:
    BillingUrlResponse:
      type: object
      properties:
        url:
          type: string
          description: Stripe URL to open in a browser
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````