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

# Quiz Video

> Create a trivia video from your questions: each one is narrated, the answers appear, and the correct one is revealed

## Overview

A quiz video plays your questions one after another. For each question a voice reads it, the answer options appear, a countdown runs, and the correct option turns green. You send the finished questions; nothing is generated from a topic on this endpoint.

The background is a gameplay clip by default. It can also be AI images, AI video clips or your own media.

<Note>
  The voice reads each question exactly as you wrote it. Write the questions in the language you want them read in and pick a voice that speaks it.
</Note>

The request returns a `projectId` right away. The video is generated and rendered in the background.

```
POST https://api.hooked.so/v1/project/create/quiz-video
```

***

Only `questions` and `voiceId` are required. Each question has 2 to 4 `options` and a zero-based `correctIndex` (`correct_index` is accepted too). The background defaults to the `subway-s-1` gameplay clip; `gameplaySettings` applies to gameplay only, `presetSettings` to `ai-images` / `ai-videos` only, and `media` to `media` only.

***

<RequestExample>
  ```bash cURL theme={null}
  curl -X POST "https://api.hooked.so/v1/project/create/quiz-video" \
    -H "x-api-key: your_api_key_here" \
    -H "Content-Type: application/json" \
    -d '{
      "title": "Geography quiz",
      "voiceId": "1004",
      "questions": [
        { "question": "What is the capital of Australia?", "options": ["Sydney", "Canberra", "Melbourne"], "correctIndex": 1 },
        { "question": "Which river is the longest?", "options": ["Amazon", "Nile", "Yangtze", "Mississippi"], "correctIndex": 1 }
      ],
      "answerSeconds": 4,
      "webhook": "https://example.com/hooked/webhook?token=YOUR_SECRET"
    }'
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch("https://api.hooked.so/v1/project/create/quiz-video", {
    method: "POST",
    headers: {
      "x-api-key": "your_api_key_here",
      "Content-Type": "application/json",
    },
    body: JSON.stringify({
      title: "Geography quiz",
      voiceId: "1004",
      questions: [
        { question: "What is the capital of Australia?", options: ["Sydney", "Canberra", "Melbourne"], correctIndex: 1 },
        {
          question: "Which river is the longest?",
          options: ["Amazon", "Nile", "Yangtze", "Mississippi"],
          correctIndex: 1,
        },
      ],
      answerSeconds: 4,
      webhook: "https://example.com/hooked/webhook?token=YOUR_SECRET",
    }),
  });

  const { data } = await response.json();
  console.log(data.projectId);
  ```

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

  response = requests.post(
      "https://api.hooked.so/v1/project/create/quiz-video",
      headers={"x-api-key": "your_api_key_here"},
      json={
          "title": "Geography quiz",
          "voiceId": "1004",
          "questions": [
              {"question": "What is the capital of Australia?", "options": ["Sydney", "Canberra", "Melbourne"], "correctIndex": 1},
              {
                  "question": "Which river is the longest?",
                  "options": ["Amazon", "Nile", "Yangtze", "Mississippi"],
                  "correctIndex": 1,
              },
          ],
          "answerSeconds": 4,
          "webhook": "https://example.com/hooked/webhook?token=YOUR_SECRET",
      },
  )

  print(response.json()["data"]["projectId"])
  ```
</RequestExample>

***

<ResponseExample>
  ```json 200 theme={null}
  {
    "success": true,
    "data": {
      "projectId": "cm4x9k2p10001ab12cd34ef56",
      "status": "processing"
    },
    "message": "Quiz Video successfully created"
  }
  ```

  ```json 400 theme={null}
  {
    "success": false,
    "message": "questions.1.correctIndex: correctIndex 3 is out of range for 3 options"
  }
  ```

  ```json 401 theme={null}
  {
    "code": "not_authenticated",
    "message": "Not authenticated",
    "errorCode": "NOT_AUTHENTICATED",
    "details": { "x-api-key": "Header not provided or API Key invalid" }
  }
  ```

  ```json 402 missing keys theme={null}
  {
    "success": false,
    "code": "missing_credentials",
    "errorCode": "MISSING_CREDENTIALS",
    "missingProviders": ["openrouter", "elevenlabs"],
    "message": "Your team uses its own provider keys (BYOK) and these are missing or invalid: OpenRouter, ElevenLabs. Add them in Settings → AI keys."
  }
  ```

  ```json 402 subscription theme={null}
  {
    "success": false,
    "code": "subscription_required",
    "errorCode": "SUBSCRIPTION_REQUIRED",
    "message": "Your team generates with Hooked's keys, which are paid by your plan. Subscribe to keep generating."
  }
  ```

  ```json 402 credits theme={null}
  {
    "success": false,
    "errorCode": "INSUFFICIENT_CREDITS",
    "message": "Not enough credits for Quiz Video. Needed: 40, Available: 12",
    "creditsNeeded": 40,
    "creditsAvailable": 12
  }
  ```

  ```json 403 theme={null}
  {
    "code": "entitlement_required",
    "error": "entitlement_required",
    "message": "This endpoint requires the \"app\" product.",
    "product": "app"
  }
  ```
</ResponseExample>

***

## What happens next

1. Keep the `projectId`.
2. Either poll [`GET /v1/project/{projectId}`](/api-reference/project/details) until `video.status` is `COMPLETED` (or the project `status` is `failed`), or pass a `webhook` and wait for the call.
3. Download the file from `video.url` (or `data.url` in the webhook).

The webhook receives `{ "status": "COMPLETED", "message": "Video completed", "data": { "videoId", "projectId", "status": "COMPLETED", "url", "metadata" } }`. A project that fails before it has a video sends `"status": "FAILED"` with `videoId: null`. See [Webhooks](/guides/webhooks).

***

## Credits and your own keys

**Teams on Hooked's keys (managed):** the project is priced from the number of questions, the answer and reveal times, and the background (media type, quality or model). The credits are taken up front; if the balance is short, the request answers `402 INSUFFICIENT_CREDITS` and nothing is created. If the project fails later, the credits are refunded automatically.

**Teams on their own keys (BYOK):** no credits are charged. The team needs these keys in **Settings → AI keys**:

* **OpenRouter**: always.
* **ElevenLabs**: for the narration.
* **Gemini**: when `presetSettings.aiModel` is `gemini_omni_flash`.

A missing key answers `402 missing_credentials` with the list in `missingProviders`, before anything is created.

***

## Errors

| Status | Body | When |
| - | - | - |
| `400` | `{ "success": false, "message": "<field>: <reason>" }` | Validation failed. Examples: `Invalid JSON body`, `questions: At least 2 questions are required`, `questions: Cannot have more than 10 questions`, `questions.0.options: A question needs at least 2 answers`, `questions.1.correctIndex: correctIndex 3 is out of range for 3 options`, `voiceId: Voice "…" not found.`, `musicId: Music "…" not found.`, `media: Media is required for media type: media`, `media: Media "…" not found`, `presetSettings.preset: Invalid preset "…". Allowed values are: …` (or `Custom style "custom-…" not found` for a custom style that is not your team's), `caption.preset: Invalid caption preset "…". Allowed values are: …`, `gameplaySettings.selectedGame: Invalid game "…". Allowed values are: …`, `gameplaySettings.selectedVideo: Video "…" not found in your library` (with `selectedGame: "custom"`), `mediaType: "motion-graphics" is not available for this format …`, `presetSettings.aiModel: "…" does not generate ai-images`, `webhook: Must be a valid HTTPS URL`. |
| `401` | `not_authenticated` | Missing or invalid `x-api-key`. |
| `402` | `missing_credentials` | BYOK team without the keys listed above. |
| `402` | `subscription_required` | Managed team without an active plan. |
| `402` | `INSUFFICIENT_CREDITS` | Managed team without enough credits. |
| `403` | `entitlement_required` | The team does not have the product this endpoint needs. |
| `500` | `{ "success": false, "message": "..." }` | Unexpected error. Credits taken for this request are refunded. |

<Warning>
  Send an [`Idempotency-Key`](/guides/idempotency) header to retry safely: if a request times out or answers 5xx, sending it again with the same key and body returns the first answer instead of creating (and charging) the project twice.
</Warning>

***

## Next Steps

<CardGroup cols={2}>
  <Card title="Get Project" icon="circle-info" href="/api-reference/project/details">
    Follow the project until the video is ready
  </Card>

  <Card title="Webhooks" icon="webhook" href="/guides/webhooks">
    Payloads and delivery rules
  </Card>

  <Card title="List Voices" icon="microphone" href="/api-reference/voice/list">
    Pick a voice
  </Card>

  <Card title="Reddit Story" icon="reddit" href="/api-reference/video/reddit-story">
    Another background-video format
  </Card>
</CardGroup>


## OpenAPI

````yaml POST /v1/project/create/quiz-video
openapi: 3.0.0
info:
  title: Hooked API
  version: 1.0.0
  description: AI Video Generation API
servers:
  - url: https://api.hooked.so
security:
  - ApiKeyAuth: []
tags:
  - name: Videos
    description: Create projects, follow them and render videos
  - name: Account Analysis
    description: Analyze TikTok and YouTube accounts
  - name: Channels
    description: Connected social accounts you publish to
  - name: Publish
    description: Schedule videos to your connected accounts
  - name: Images
    description: 'Image editing: background removal and expansion'
  - name: Media
    description: 'Your media library: list, import from a URL, upload a file'
  - name: Avatars
    description: Your team's own avatars (Actors) and their Hook + Demo reactions
paths:
  /v1/project/create/quiz-video:
    post:
      tags:
        - Videos
      summary: Create Quiz Video
      description: >-
        A narrated multiple-choice quiz over gameplay or generated visuals.
        BYOK: needs OpenRouter and ElevenLabs; the gemini_omni_flash model needs
        Gemini.


        Create endpoints are not idempotent: do not retry a POST on a timeout or
        5xx without first checking your projects, or you may create (and pay
        for) the video twice.
      operationId: createQuizVideo
      parameters:
        - $ref: '#/components/parameters/IdempotencyKey'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - questions
                - voiceId
              properties:
                questions:
                  type: array
                  minItems: 2
                  maxItems: 10
                  description: >-
                    Between 2 and 10 finished questions, in the order they are
                    played. Nothing is generated from a topic: each question is
                    read by the voice exactly as written, so write them in the
                    language you want them read in.
                  items:
                    type: object
                    required:
                      - question
                      - options
                    properties:
                      question:
                        type: string
                        minLength: 1
                        description: >-
                          The question. The voice reads it and it is shown on
                          screen.
                      options:
                        type: array
                        minItems: 2
                        maxItems: 4
                        items:
                          type: string
                          minLength: 1
                        description: 2 to 4 answers; none can be empty.
                      correctIndex:
                        type: integer
                        minimum: 0
                        maximum: 3
                        description: >-
                          Zero-based index of the correct answer in `options`;
                          it must point inside `options`. `correct_index` is
                          accepted too. When omitted, the first option is taken
                          as correct.
                        default: 0
                voiceId:
                  type: string
                  minLength: 1
                  maxLength: 30
                  description: >-
                    Narrator voice: a library voice ID from /v1/voice/list or
                    one of your team's custom voices. An unknown ID answers 400.
                name:
                  type: string
                  maxLength: 100
                  description: Project name (max 100 characters). Defaults to `title`.
                title:
                  type: string
                  maxLength: 120
                  description: >-
                    Quiz title, shown at the top for the whole video (max 120
                    characters). Also the project name when `name` is not set.
                answerSeconds:
                  type: number
                  minimum: 1
                  maximum: 15
                  default: 5
                  description: Seconds the options stay on screen before the reveal (1-15).
                revealSeconds:
                  type: number
                  minimum: 0.5
                  maximum: 6
                  default: 2
                  description: Seconds the revealed answer stays on screen (0.5-6).
                showOutro:
                  type: boolean
                  default: true
                  description: End with an outro card.
                outroText:
                  type: string
                  maxLength: 160
                  description: >-
                    Text of the outro card (max 160 characters). Only with
                    showOutro: true.
                  default: Great job! Share your score in the comments!
                optionsStyle:
                  type: object
                  description: Look of the quiz text and answer rows.
                  properties:
                    fontFamily:
                      type: string
                      default: font-opensans
                      description: >-
                        Font class for the title, question, answers and outro,
                        e.g. `font-opensans`
                    optionBackgroundColor:
                      type: string
                      default: rgba(9, 10, 12, 0.92)
                      description: Answer row background (CSS color)
                    optionTextColor:
                      type: string
                      default: '#FFFFFF'
                      description: Answer and question text color (CSS color)
                    correctBackgroundColor:
                      type: string
                      default: '#22C55E'
                      description: >-
                        Background of the correct answer once revealed; also the
                        color of the word being read in the question
                    showLetters:
                      type: boolean
                      default: false
                      description: Show A/B/C/D before each answer
                mediaType:
                  type: string
                  enum:
                    - gameplay
                    - ai-images
                    - ai-videos
                    - media
                  default: gameplay
                  description: >-
                    Background visuals: a gameplay clip (default), AI images, AI
                    video clips or your own library media. `motion-graphics` is
                    not offered for this format and answers 400.
                presetSettings:
                  type: object
                  description: >-
                    mediaType `ai-images` / `ai-videos` only: the generated
                    background. `preset` and `aiModel` apply to both; `quality`
                    and `isContinuous` to `ai-videos` only.
                  properties:
                    preset:
                      type: string
                      default: realistic
                      description: >-
                        `ai-images` / `ai-videos`: visual style preset ID, e.g.
                        `realistic`, `cinematic`, `anime`, `pixar`, `cartoon`,
                        `comic-book` (same list as Script to Video), or
                        `custom-<id>` for one of your team's custom styles. Any
                        other value answers 400.
                    quality:
                      type: string
                      enum:
                        - base
                        - pro
                        - ultra
                      default: base
                      description: >-
                        ai-videos only: quality tier, used when no aiModel is
                        given.
                    aiModel:
                      type: string
                      enum:
                        - nano_banana
                        - nano_banana_2
                        - nano_banana_pro
                        - seedream_4_5
                        - seedream_5_0
                        - gpt_image_2
                        - grok_imagine_image
                        - seedance_1_5_pro
                        - seedance_2_0
                        - seedance_2_0_mini
                        - seedance_2_0_fast
                        - kling_3_0
                        - veo_3_fast
                        - veo_3
                        - veo_3_1_lite
                        - wan_2_7_i2v
                        - grok_imagine_video
                        - gemini_omni_flash
                      description: >-
                        Model that generates the background. Use an image model
                        (`nano_banana`, `nano_banana_2`, `nano_banana_pro`,
                        `seedream_4_5`, `seedream_5_0`, `gpt_image_2`,
                        `grok_imagine_image`) with ai-images and a video model
                        with ai-videos (400 otherwise). BYOK: gemini_omni_flash
                        needs the Gemini key.
                    isContinuous:
                      type: boolean
                      description: >-
                        ai-videos only: chain the clips frame to frame. Default
                        true.
                      default: true
                gameplaySettings:
                  type: object
                  description: >-
                    mediaType `gameplay` only: the background clip. Games and
                    their clips: `minecraft` (minecraft-1 … minecraft-9),
                    `subway-s` (subway-s-1 … subway-s-11), `temple-run`
                    (temple-run-1 … temple-run-8), `gta` (gta-1 … gta-12),
                    `fortnite` (fortnite-1 … fortnite-5), `roblox` (roblox-1),
                    `free-fire` (free-fire-1). A clip that does not exist plays
                    the game's first clip. Use `custom` as selectedGame to play
                    one of your own library videos: selectedVideo is then its
                    media ID, and an ID that is not a video in your library
                    answers 400.
                  properties:
                    selectedGame:
                      type: string
                      default: subway-s
                      enum:
                        - minecraft
                        - subway-s
                        - temple-run
                        - gta
                        - fortnite
                        - roblox
                        - free-fire
                        - custom
                      description: >-
                        The game, or `custom` for a video from your media
                        library. Any other value answers 400.
                    selectedVideo:
                      type: string
                      default: subway-s-1
                      description: >-
                        The clip ID (e.g. `minecraft-2`), or your library
                        video's media ID with selectedGame `custom`.
                media:
                  type: array
                  description: >-
                    mediaType `media` only, and required there: IDs of images or
                    videos in your team's media library (max 50). An ID that is
                    not in your library answers 400 (`media: Media "<id>" not
                    found`). A media that is not `COMPLETED` yet (an import or
                    upload in progress) answers `400 media: Media "<id>" is not
                    ready (status PROCESSING)`.
                  maxItems: 50
                  items:
                    type: string
                    description: Media ID from your library
                aspectRatio:
                  type: string
                  enum:
                    - ratio_9_16
                    - ratio_16_9
                    - ratio_1_1
                  default: ratio_9_16
                caption:
                  type: object
                  description: >-
                    The question text on screen. The quiz draws it in its own
                    style, so only `disabled` applies.
                  properties:
                    disabled:
                      type: boolean
                      default: false
                      description: true hides the question text (the voice still reads it)
                audio:
                  type: object
                  description: >-
                    Narrator voice settings (ElevenLabs). Omitted fields keep
                    their defaults.
                  properties:
                    speed:
                      type: number
                      minimum: 0.7
                      maximum: 1.2
                      default: 1
                      description: Speaking speed
                    stability:
                      type: number
                      minimum: 0
                      maximum: 1
                      default: 0.5
                      description: Higher is steadier, lower is more expressive
                    similarityBoost:
                      type: number
                      minimum: 0
                      maximum: 1
                      default: 0.75
                      description: How closely the output sticks to the original voice
                content:
                  type: object
                  description: Branding.
                  properties:
                    brandingLogo:
                      type: object
                      description: >-
                        Your logo over the video. Drawn only with `enabled:
                        true` and a `url`.
                      properties:
                        enabled:
                          type: boolean
                          default: false
                        url:
                          type: string
                          description: >-
                            Public https image URL of the logo (PNG with
                            transparency works best)
                        position:
                          type: string
                          enum:
                            - top-left
                            - top-right
                            - bottom-left
                            - bottom-right
                          default: bottom-right
                        size:
                          type: number
                          minimum: 20
                          maximum: 200
                          default: 100
                          description: Logo size (20-200)
                musicId:
                  type: string
                  maxLength: 30
                  description: >-
                    Background music: a track ID from /v1/music/list or your
                    team's own uploaded music. An unknown ID answers 400.
                webhook:
                  type: string
                  maxLength: 500
                  format: uri
                  description: >-
                    HTTPS URL on a public host, called when the video is ready
                    or the project fails (max 500 characters). Requests are
                    signed: verify the Hooked-Signature header (HMAC-SHA256 of
                    "<t>.<raw body>") with the signing secret from Settings →
                    Webhooks; Hooked-Event and Hooked-Delivery headers name the
                    event and the delivery. No redirects are followed; 10 s
                    timeout; 3 immediate attempts. See the Webhooks guide for
                    the payload.
                metadata:
                  type: object
                  additionalProperties: true
                  description: >-
                    Any JSON object of your own (max 5 KB). Sent back in the
                    webhook payload. The key `automationId` is reserved for
                    dashboard automations and is removed.
            example:
              title: Guess the capital
              questions:
                - question: What is the capital of Australia?
                  options:
                    - Sydney
                    - Canberra
                    - Melbourne
                  correctIndex: 1
                - question: What is the capital of Canada?
                  options:
                    - Toronto
                    - Vancouver
                    - Ottawa
                  correctIndex: 2
              voiceId: '1'
              mediaType: gameplay
              gameplaySettings:
                selectedGame: subway-s
                selectedVideo: subway-s-3
              webhook: https://yoursite.com/webhook?token=YOUR_SECRET
      responses:
        '200':
          description: >-
            Project created. Follow it with GET /v1/project/{projectId} or wait
            for the webhook.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProjectCreateResponse'
              example:
                success: true
                data:
                  projectId: clx9p2k4m0001abcd1234efgh
                  status: processing
                message: Quiz Video successfully created
        '400':
          $ref: '#/components/responses/ValidationError'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '402':
          $ref: '#/components/responses/PaymentRequired'
        '403':
          $ref: '#/components/responses/EntitlementRequired'
        '409':
          $ref: '#/components/responses/IdempotencyInProgress'
        '422':
          $ref: '#/components/responses/IdempotencyMismatch'
        '429':
          $ref: '#/components/responses/RateLimited429'
        '500':
          $ref: '#/components/responses/InternalError'
      security:
        - ApiKeyAuth: []
components:
  parameters:
    IdempotencyKey:
      name: Idempotency-Key
      in: header
      required: false
      description: >-
        Makes the request safe to retry. 1-255 printable ASCII characters, one
        per operation (your job id, or a UUID you store), reused on every retry.
        Within 24 hours the same key with the same body answers with the first
        response and the header `Idempotent-Replayed: true`, without running or
        charging again. Keys are scoped to your team and the endpoint. 5xx
        answers and refusals before anything ran (401, 402, 403, 409, 429) are
        not kept. See [Idempotency](/guides/idempotency).
      schema:
        type: string
        minLength: 1
        maxLength: 255
        pattern: ^[\x20-\x7E]+$
      example: order-1042-video
  schemas:
    ProjectCreateResponse:
      type: object
      properties:
        success:
          type: boolean
          enum:
            - true
        data:
          type: object
          properties:
            projectId:
              type: string
              description: Follow it with GET /v1/project/{projectId}
            status:
              type: string
              enum:
                - draft
                - processing
                - completed
                - failed
              description: >-
                The project status right after creation, usually `draft` or
                `processing`. Follow it with GET /v1/project/{projectId}.
          required:
            - projectId
            - status
        message:
          type: string
      required:
        - success
        - data
        - message
    ValidationError400:
      type: object
      description: >-
        The request is invalid. `message` is `<field>: <reason>` when a field is
        to blame.
      properties:
        success:
          type: boolean
          enum:
            - false
        message:
          type: string
      required:
        - success
        - message
      example:
        success: false
        message: 'webhook: Must be a valid HTTPS URL'
    Error401:
      type: object
      description: Missing or invalid `x-api-key`.
      properties:
        code:
          type: string
          enum:
            - not_authenticated
        message:
          type: string
          example: Not authenticated
        errorCode:
          type: string
          enum:
            - NOT_AUTHENTICATED
        details:
          type: object
          additionalProperties:
            type: string
      example:
        code: not_authenticated
        message: Not authenticated
        errorCode: NOT_AUTHENTICATED
        details:
          x-api-key: Header not provided or API Key invalid
    MissingCredentials402:
      type: object
      description: >-
        BYOK team without the provider keys this request uses. Nothing was
        created or charged. Add the keys in Settings → AI keys.
      properties:
        success:
          type: boolean
          enum:
            - false
          description: Present when raised by the spend check
        code:
          type: string
          enum:
            - missing_credentials
        errorCode:
          type: string
          enum:
            - MISSING_CREDENTIALS
        missingProviders:
          type: array
          items:
            type: string
            enum:
              - openrouter
              - elevenlabs
              - gemini
              - bria
              - firecrawl
        message:
          type: string
        details:
          type: object
      required:
        - code
        - errorCode
        - missingProviders
        - message
      example:
        code: missing_credentials
        message: >-
          Your team uses its own provider keys (BYOK) and these are missing or
          invalid: OpenRouter, ElevenLabs. Add them in Settings → AI keys.
        errorCode: MISSING_CREDENTIALS
        missingProviders:
          - openrouter
          - elevenlabs
        details: {}
    SubscriptionRequired402:
      type: object
      description: Managed team (generates with Hooked's keys) without a live subscription.
      properties:
        success:
          type: boolean
          enum:
            - false
        code:
          type: string
          enum:
            - subscription_required
        errorCode:
          type: string
          enum:
            - SUBSCRIPTION_REQUIRED
        message:
          type: string
      required:
        - success
        - code
        - errorCode
        - message
      example:
        success: false
        code: subscription_required
        errorCode: SUBSCRIPTION_REQUIRED
        message: >-
          Your team generates with Hooked's keys, which are paid by your plan.
          Subscribe to keep generating.
    InsufficientCredits402:
      type: object
      description: >-
        Not enough credits for this request. `creditsNeeded` /
        `creditsAvailable` are included when the estimate is known.
      properties:
        success:
          type: boolean
          enum:
            - false
        errorCode:
          type: string
          enum:
            - INSUFFICIENT_CREDITS
        message:
          type: string
        creditsNeeded:
          type: number
        creditsAvailable:
          type: number
      required:
        - success
        - errorCode
        - message
      example:
        success: false
        errorCode: INSUFFICIENT_CREDITS
        message: Not enough credits to perform this action
        creditsNeeded: 40
        creditsAvailable: 12
    EntitlementRequired403:
      type: object
      description: >-
        Valid key, but the team does not have the product this endpoint belongs
        to.
      properties:
        code:
          type: string
          enum:
            - entitlement_required
        error:
          type: string
          enum:
            - entitlement_required
        message:
          type: string
        product:
          type: string
          example: app
      required:
        - code
        - error
        - message
        - product
      example:
        code: entitlement_required
        error: entitlement_required
        message: This endpoint requires the "app" product.
        product: app
    Error500:
      type: object
      properties:
        success:
          type: boolean
          enum:
            - false
        message:
          type: string
        error:
          type: string
          description: Present on some endpoints
      example:
        success: false
        message: Internal server error
  responses:
    ValidationError:
      description: Validation error (also `Invalid JSON body`)
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ValidationError400'
    Unauthorized:
      description: Missing or invalid API key
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error401'
    PaymentRequired:
      description: >-
        Payment required: a BYOK team is missing provider keys (nothing was
        created or charged), a managed team has no live subscription, or there
        are not enough credits.
      content:
        application/json:
          schema:
            oneOf:
              - $ref: '#/components/schemas/MissingCredentials402'
              - $ref: '#/components/schemas/SubscriptionRequired402'
              - $ref: '#/components/schemas/InsufficientCredits402'
          examples:
            missingCredentials:
              value:
                code: missing_credentials
                message: >-
                  Your team uses its own provider keys (BYOK) and these are
                  missing or invalid: OpenRouter, ElevenLabs. Add them in
                  Settings → AI keys.
                errorCode: MISSING_CREDENTIALS
                missingProviders:
                  - openrouter
                  - elevenlabs
                details: {}
            subscriptionRequired:
              value:
                success: false
                code: subscription_required
                errorCode: SUBSCRIPTION_REQUIRED
                message: >-
                  Your team generates with Hooked's keys, which are paid by your
                  plan. Subscribe to keep generating.
            insufficientCredits:
              value:
                success: false
                errorCode: INSUFFICIENT_CREDITS
                message: Not enough credits to perform this action
                creditsNeeded: 40
                creditsAvailable: 12
    EntitlementRequired:
      description: The team does not have the product this endpoint needs
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/EntitlementRequired403'
    IdempotencyInProgress:
      description: >-
        A request with the same `Idempotency-Key` is still running. Retry in a
        few seconds.
      content:
        application/json:
          schema:
            type: object
            properties:
              success:
                type: boolean
                enum:
                  - false
              code:
                type: string
              message:
                type: string
              details:
                type: object
                additionalProperties: true
            required:
              - success
              - code
              - message
          example:
            success: false
            code: idempotency_conflict
            message: A request with this Idempotency-Key is still in progress
            details: {}
    IdempotencyMismatch:
      description: >-
        The `Idempotency-Key` was already used with a different body. Use a new
        key for a new request.
      content:
        application/json:
          schema:
            type: object
            properties:
              success:
                type: boolean
                enum:
                  - false
              code:
                type: string
              message:
                type: string
              details:
                type: object
                additionalProperties: true
            required:
              - success
              - code
              - message
          example:
            success: false
            code: idempotency_mismatch
            message: Idempotency-Key was used with a different request
            details: {}
    RateLimited429:
      description: >-
        Your team is over a rate limit: 30 POST requests per minute, 120 other
        requests per minute, or 3 downloads of your URLs running at once.
        Nothing ran and nothing was charged: wait `Retry-After` seconds and send
        the request again. See [Rate
        limits](/guides/error-handling#rate-limits-429).
      headers:
        Retry-After:
          description: Seconds to wait before sending again.
          schema:
            type: integer
        X-RateLimit-Limit:
          description: The limit of the bucket you hit (not sent for the download cap).
          schema:
            type: integer
        X-RateLimit-Remaining:
          description: 'Requests left in this window: 0 (not sent for the download cap).'
          schema:
            type: integer
        X-RateLimit-Reset:
          description: >-
            When the window ends, in Unix seconds (not sent for the download
            cap).
          schema:
            type: integer
      content:
        application/json:
          schema:
            type: object
            properties:
              success:
                type: boolean
                enum:
                  - false
              errorCode:
                type: string
                enum:
                  - RATE_LIMITED
              message:
                type: string
              retryAfterSeconds:
                type: integer
            required:
              - success
              - errorCode
              - message
              - retryAfterSeconds
          example:
            success: false
            errorCode: RATE_LIMITED
            message: >-
              Rate limit exceeded: 30 POST requests per minute per team. Retry
              after 12 s.
            retryAfterSeconds: 12
    InternalError:
      description: Internal server error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error500'
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.