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

# Get Current Quota

> Retrieve the current usage and limits for the four core quota types on your subscription

## Overview

Retrieve a real-time snapshot of the quotas associated with your Pictory subscription. The response shows how much of each quota you have used so far in the current billing term and how much is allowed by your plan.

The endpoint reports the following four metrics:

* **Video minutes** rendered through Pictory's video generation pipeline
* **Transcription minutes** consumed by transcription jobs
* **ElevenLabs VoiceOver minutes** used for AI text-to-speech
* **AI credits** consumed by generative AI features such as AI avatars, text-to-image, and AI video generation

Use this endpoint when you need to display a usage summary in your application, gate a feature based on remaining quota, or verify that a subscription has capacity before launching a long-running job.

<Note>
  You need a valid API key to use this endpoint. Get your API key from the [API Access page](https://app.pictory.ai/api-access) in your Pictory dashboard.
</Note>

***

## API Endpoint

```http theme={null}
GET https://api.pictory.ai/pictoryapis/v1/quota
```

***

## Request Parameters

### Headers

<ParamField header="Authorization" type="string" required>
  API key for authentication (starts with `pictai_`)

  ```
  Authorization: YOUR_API_KEY
  ```
</ParamField>

This endpoint does not accept any path, query, or body parameters. The subscription is identified from the API key.

***

## Response

Returns an object containing four usage entries. Every entry has the same shape: `used` reports the amount consumed in the current billing term and `limit` reports the maximum allowed by the plan.

<ResponseField name="videoMinutes" type="object" required>
  Video minutes rendered in the current billing term.

  <Expandable title="properties">
    <ResponseField name="used" type="integer">
      Number of video minutes already consumed in the current billing term.
    </ResponseField>

    <ResponseField name="limit" type="integer">
      Maximum number of video minutes allowed by your plan in one billing term.
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="transcriptionMinutes" type="object" required>
  Transcription minutes consumed in the current billing term.

  <Expandable title="properties">
    <ResponseField name="used" type="integer">
      Number of transcription minutes already consumed.
    </ResponseField>

    <ResponseField name="limit" type="integer">
      Maximum number of transcription minutes allowed by your plan.
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="elevenLabsVoiceOverMinutes" type="object" required>
  ElevenLabs AI voice-over minutes consumed in the current billing term.

  <Expandable title="properties">
    <ResponseField name="used" type="integer">
      Number of ElevenLabs voice-over minutes already consumed.
    </ResponseField>

    <ResponseField name="limit" type="integer">
      Maximum number of ElevenLabs voice-over minutes allowed by your plan.
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="aiCredits" type="object" required>
  AI credits consumed in the current billing term. AI credits power generative features such as AI avatars, text-to-image, and AI video generation.

  <Expandable title="properties">
    <ResponseField name="used" type="integer">
      Number of AI credits already consumed.
    </ResponseField>

    <ResponseField name="limit" type="integer">
      Total AI credit allowance for your subscription, including any add-on or promotional credits.
    </ResponseField>
  </Expandable>
</ResponseField>

### Response Examples

<ResponseExample>
  ```json 200 - Success theme={null}
  {
    "videoMinutes":               { "used": 98,  "limit": 14400 },
    "transcriptionMinutes":       { "used": 0,   "limit": 14400 },
    "elevenLabsVoiceOverMinutes": { "used": 33,  "limit": 480 },
    "aiCredits":                  { "used": 690, "limit": 22000 }
  }
  ```

  ```json 400 - Bad Request theme={null}
  {
    "code": "UNAUTHORIZED",
    "message": "Missing subscription identity."
  }
  ```

  ```json 401 - Unauthorized theme={null}
  {
    "message": "Unauthorized"
  }
  ```

  ```text 404 - Subscription Not Found theme={null}
  (empty response body)
  ```

  ```json 500 - Internal Server Error theme={null}
  {
    "code": "BAD_CONFIGURATION",
    "message": "An unexpected error occurred while processing the request"
  }
  ```
</ResponseExample>

***

## Code Examples

<Tip>
  Replace `YOUR_API_KEY` with your actual API key that starts with `pictai_`
</Tip>

<CodeGroup>
  ```bash cURL theme={null}
  curl --request GET \
    --url 'https://api.pictory.ai/pictoryapis/v1/quota' \
    --header 'Authorization: YOUR_API_KEY' \
    --header 'accept: application/json' | python -m json.tool
  ```

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

  url = "https://api.pictory.ai/pictoryapis/v1/quota"
  headers = {
      "Authorization": "YOUR_API_KEY",
      "accept": "application/json"
  }

  response = requests.get(url, headers=headers)
  quota = response.json()

  print(f"Video Minutes: {quota['videoMinutes']['used']}/{quota['videoMinutes']['limit']}")
  print(f"Transcription: {quota['transcriptionMinutes']['used']}/{quota['transcriptionMinutes']['limit']}")
  print(f"ElevenLabs VO: {quota['elevenLabsVoiceOverMinutes']['used']}/{quota['elevenLabsVoiceOverMinutes']['limit']}")
  print(f"AI Credits:    {quota['aiCredits']['used']}/{quota['aiCredits']['limit']}")
  ```

  ```javascript JavaScript / Node.js theme={null}
  const response = await fetch(
    "https://api.pictory.ai/pictoryapis/v1/quota",
    {
      method: "GET",
      headers: {
        Authorization: "YOUR_API_KEY",
        accept: "application/json",
      },
    }
  );

  const quota = await response.json();

  console.log(`Video Minutes: ${quota.videoMinutes.used}/${quota.videoMinutes.limit}`);
  console.log(`Transcription: ${quota.transcriptionMinutes.used}/${quota.transcriptionMinutes.limit}`);
  console.log(`ElevenLabs VO: ${quota.elevenLabsVoiceOverMinutes.used}/${quota.elevenLabsVoiceOverMinutes.limit}`);
  console.log(`AI Credits:    ${quota.aiCredits.used}/${quota.aiCredits.limit}`);
  ```

  ```php PHP theme={null}
  <?php

  $url = 'https://api.pictory.ai/pictoryapis/v1/quota';

  $ch = curl_init($url);
  curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
  curl_setopt($ch, CURLOPT_HTTPHEADER, [
      'Authorization: YOUR_API_KEY',
      'accept: application/json'
  ]);

  $response = curl_exec($ch);
  $httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
  curl_close($ch);

  if ($httpCode !== 200) {
      throw new Exception('Request failed with status ' . $httpCode);
  }

  $quota = json_decode($response, true);

  echo "Video Minutes: {$quota['videoMinutes']['used']}/{$quota['videoMinutes']['limit']}\n";
  echo "Transcription: {$quota['transcriptionMinutes']['used']}/{$quota['transcriptionMinutes']['limit']}\n";
  echo "ElevenLabs VO: {$quota['elevenLabsVoiceOverMinutes']['used']}/{$quota['elevenLabsVoiceOverMinutes']['limit']}\n";
  echo "AI Credits:    {$quota['aiCredits']['used']}/{$quota['aiCredits']['limit']}\n";
  ?>
  ```

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

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

  type QuotaEntry struct {
      Used  int `json:"used"`
      Limit int `json:"limit"`
  }

  type Quota struct {
      VideoMinutes               QuotaEntry `json:"videoMinutes"`
      TranscriptionMinutes       QuotaEntry `json:"transcriptionMinutes"`
      ElevenLabsVoiceOverMinutes QuotaEntry `json:"elevenLabsVoiceOverMinutes"`
      AICredits                  QuotaEntry `json:"aiCredits"`
  }

  func main() {
      req, _ := http.NewRequest("GET", "https://api.pictory.ai/pictoryapis/v1/quota", nil)
      req.Header.Set("Authorization", "YOUR_API_KEY")
      req.Header.Set("accept", "application/json")

      resp, err := http.DefaultClient.Do(req)
      if err != nil {
          panic(err)
      }
      defer resp.Body.Close()

      body, _ := io.ReadAll(resp.Body)
      var quota Quota
      json.Unmarshal(body, &quota)

      fmt.Printf("Video Minutes: %d/%d\n", quota.VideoMinutes.Used, quota.VideoMinutes.Limit)
      fmt.Printf("Transcription: %d/%d\n", quota.TranscriptionMinutes.Used, quota.TranscriptionMinutes.Limit)
      fmt.Printf("ElevenLabs VO: %d/%d\n", quota.ElevenLabsVoiceOverMinutes.Used, quota.ElevenLabsVoiceOverMinutes.Limit)
      fmt.Printf("AI Credits:    %d/%d\n", quota.AICredits.Used, quota.AICredits.Limit)
  }
  ```
</CodeGroup>
