{
  "openapi": "3.1.0",
  "info": {
    "title": "VidWords — YouTube Transcript API",
    "description": "Fetch transcripts for any public YouTube video and list a channel's uploads. No proxies or infrastructure to manage — one API call returns clean, timestamped transcript text ready for analysis, AI models, or automation.",
    "version": "1.0.0",
    "contact": {
      "name": "VidWords",
      "url": "https://vidwords.com"
    },
    "license": {
      "name": "Proprietary — see VidWords Terms",
      "url": "https://vidwords.com/terms"
    }
  },
  "servers": [
    {
      "url": "https://vidwords.com",
      "description": "VidWords production"
    }
  ],
  "tags": [
    {
      "name": "Transcripts",
      "description": "Fetch video transcripts"
    },
    {
      "name": "Channels",
      "description": "List a channel's uploaded videos"
    },
    {
      "name": "Webhooks",
      "description": "Signed event deliveries to your HTTPS endpoint (Pro and Team)"
    }
  ],
  "paths": {
    "/api/transcripts": {
      "post": {
        "tags": [
          "Transcripts"
        ],
        "summary": "Fetch transcripts for up to 50 videos",
        "description": "Batch size depends on your plan. Via RapidAPI the per-request cap is BASIC 1 / PRO 5 / ULTRA 20 / MEGA 50 videos. Direct API tokens allow up to 50 videos per request. On RapidAPI, sending more videos than your per-call cap does not fail the request: the first N are processed and the remaining videos are returned as per-item `tier_limit` errors inside a 200 response.",
        "operationId": "fetchTranscripts",
        "security": [
          {
            "ApiKeyAuth": []
          },
          {
            "RapidApiProxy": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TranscriptsRequest"
              },
              "example": {
                "ids": [
                  "dQw4w9WgXcQ"
                ],
                "lang": "en"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Transcript results (per-video; a failed video has an `error` field instead of segments)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TranscriptsResponse"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              }
            }
          },
          "400": {
            "description": "Malformed body, empty `ids`, or more than 50 ids. Note: on RapidAPI, exceeding your per-call plan cap is NOT a 400 — the extra videos are returned as per-item `tier_limit` errors in a 200 response. Direct API tokens are capped at 50 ids per request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Insufficient Cloud Requests (`insufficient_credits`, retained for client compatibility) — direct API tokens only; RapidAPI traffic is metered separately",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Email not verified (`email_unverified`) — a direct API token only works once its owner has confirmed their email address. This is the most common first-call failure for a new account. RapidAPI traffic is unaffected.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded: per minute by plan for a direct API token (Free 60, Starter 200, Pro 500, Team 1,000), 200 requests / 10s for RapidAPI traffic. Retry after the number of seconds in the `Retry-After` header.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "description": "Seconds to wait before retrying.",
                "schema": {
                  "type": "integer"
                }
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              }
            }
          }
        }
      }
    },
    "/api/channels": {
      "post": {
        "tags": [
          "Channels"
        ],
        "summary": "List a channel's uploaded videos (newest first, up to 500)",
        "description": "Batch size depends on your plan. Each successful direct-token channel listing uses 1 Cloud Request. Via RapidAPI the per-request cap is BASIC 1 / PRO 5 / ULTRA 20 / MEGA 50 channels and usage is metered by RapidAPI. Direct API tokens allow 10 channels per request on Starter, 100 on Pro and 500 on Team (the channels API requires Starter or higher).",
        "operationId": "fetchChannels",
        "security": [
          {
            "ApiKeyAuth": []
          },
          {
            "RapidApiProxy": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ChannelsRequest"
              },
              "example": {
                "ids": [
                  "@mkbhd"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Channel video lists (per-channel; a failed channel has an `error` field instead of videos)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChannelsResponse"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              }
            }
          },
          "400": {
            "description": "Malformed body or empty `ids`. Note: on RapidAPI, exceeding your per-call plan cap is NOT a 400 — the extra channels are returned as per-item `tier_limit` errors in a 200 response. Direct API tokens: 10 channels on Starter, 100 on Pro and 500 on Team.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Not enough Cloud Requests for the requested channel listings (`insufficient_cloud_requests`). Nothing was processed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Plan does not include the channels API (`plan_required`) — direct Free-plan tokens; requires Starter or higher. Also returned as `email_unverified` when the token owner has not confirmed their email address.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded. Direct tokens allow 60 requests/minute on Free, 200 on Starter, 500 on Pro and 1,000 on Team; RapidAPI uses a separate safety limit. Retry after the `Retry-After` header.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "description": "Seconds to wait before retrying.",
                "schema": {
                  "type": "integer"
                }
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              }
            }
          }
        }
      }
    },
    "/api/watch": {
      "post": {
        "tags": [
          "Transcripts"
        ],
        "summary": "Start a video evidence analysis",
        "description": "Analyses a public YouTube video frame by frame as well as by speech, returning chapters, key points and evidence tied to exact timestamps. Asynchronous: returns a jobId to poll. A fresh analysis spends 1 Cloud Request plus AI Units per minute of video: Standard Watch 4, Deep 30, Quick 2.8. Starting the same analysis again on this account (same video, mode and range) returns the existing job rather than charging twice; it may still be running.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WatchStartRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The analysis is already finished, so the job comes back with status \"ready\" at once. Either this account already ran the same analysis (same video, mode and range), which comes back free, or the same analysis was produced before for anyone and is reused (`cached: true`). No `watch.completed` webhook is sent for a job that starts ready, so read the result from this response. A matching run that is still in progress comes back as 202 instead.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WatchJob"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              }
            }
          },
          "202": {
            "description": "Accepted and queued. Poll GET /api/watch/{jobId}.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WatchJob"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              }
            }
          },
          "400": {
            "description": "Malformed body or an unusable video id.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Not enough AI Units for this run. Nothing was charged.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Email unverified (`email_unverified`), or a RapidAPI key was used (`unsupported_transport`): the Watch API needs a VidWords API token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Video is not public, age-restricted, too long for the plan, or over the cost limit.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited — 10 starts per minute.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying.",
                "schema": {
                  "type": "integer"
                }
              }
            }
          },
          "500": {
            "description": "The analysis could not be started (`internal`). A start that fails before its job exists is refunded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Watch is unavailable on this deployment, or free capacity is exhausted for the day.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          },
          {
            "RapidApiProxy": []
          }
        ]
      }
    },
    "/api/watch/{jobId}": {
      "get": {
        "tags": [
          "Transcripts"
        ],
        "summary": "Poll an analysis",
        "description": "Returns the job. While status is \"queued\" or \"processing\" there is no artifact yet; when \"ready\" the artifact holds the summary, chapters, key points and timestamped evidence. Free.",
        "parameters": [
          {
            "name": "jobId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The job.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WatchJob"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              }
            }
          },
          "401": {
            "description": "Missing or invalid API token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "A RapidAPI key was used (`unsupported_transport`). The Watch API needs a VidWords API token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "No such analysis on this account.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited — 30 reads per 10 seconds.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying.",
                "schema": {
                  "type": "integer"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          },
          {
            "RapidApiProxy": []
          }
        ]
      }
    },
    "/api/watch/{jobId}/ask": {
      "post": {
        "tags": [
          "Transcripts"
        ],
        "summary": "Ask a question about an analysis",
        "description": "Answers from the stored analysis. Every citation is verified against it — a visual claim must match a recorded frame and a spoken one a real transcript segment — and when nothing survives the answer reports insufficient evidence rather than guessing. Spends one Watch question.",
        "parameters": [
          {
            "name": "jobId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "question"
                ],
                "properties": {
                  "question": {
                    "type": "string",
                    "maxLength": 2000
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The answer and its verified citations.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              }
            }
          },
          "400": {
            "description": "Missing question or unusable job id.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Not enough AI Processing Units left for this request (a question uses 6). Top up or upgrade.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Email unverified (`email_unverified`), or a RapidAPI key was used (`unsupported_transport`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "No such analysis on this account.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "The analysis has not finished yet — keep polling.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited — 10 questions per minute.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying.",
                "schema": {
                  "type": "integer"
                }
              }
            }
          },
          "502": {
            "description": "The analysis provider failed; the reserved question was refunded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Watch is not available on this deployment (`not_configured`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          },
          {
            "RapidApiProxy": []
          }
        ]
      }
    }
  },
  "webhooks": {
    "transcript.completed": {
      "post": {
        "tags": [
          "Webhooks"
        ],
        "summary": "A transcript was delivered",
        "description": "A transcript reached your account from any surface: the website, the extension, the API, or MCP. Sent to every enabled endpoint subscribed to it (Pro and Team). Delivery is at least once and unordered.",
        "operationId": "webhook_transcript_completed",
        "parameters": [
          {
            "name": "x-vidwords-signature",
            "in": "header",
            "required": true,
            "description": "`t=<unix seconds>,v1=<hex HMAC-SHA256 of \"<t>.<raw body>\" keyed with the endpoint's signing secret>`. Recompute it over the RAW body, compare in constant time, and reject a `t` more than 5 minutes from your clock. Each attempt is signed afresh.",
            "schema": {
              "type": "string",
              "examples": [
                "t=1760261400,v1=5d41402abc4b2a76b9719d911017c592ae2f5c1c6e2b8d1b5f4a3c2e1d0f9a8b"
              ]
            }
          },
          {
            "name": "x-vidwords-event",
            "in": "header",
            "required": true,
            "description": "The event type, same as `type` in the body.",
            "schema": {
              "type": "string",
              "examples": [
                "watch.completed"
              ]
            }
          },
          {
            "name": "x-vidwords-delivery",
            "in": "header",
            "required": true,
            "description": "The event id, same as `id` in the body and identical on every retry.",
            "schema": {
              "type": "string",
              "examples": [
                "evt_3f9c1a7b2d4e6f80a1b2c3d4e5f60718"
              ]
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TranscriptCompletedEvent"
              }
            }
          }
        },
        "responses": {
          "2XX": {
            "description": "Received. Any 2xx within 10 seconds ends delivery."
          },
          "default": {
            "description": "Anything else (another status, a redirect, or no answer within 10 seconds) is retried 10 s, 1 min, 5 min and 30 min after each failed attempt: five attempts in all."
          }
        },
        "security": []
      }
    },
    "transcript.failed": {
      "post": {
        "tags": [
          "Webhooks"
        ],
        "summary": "A background transcript job failed",
        "description": "A queued transcript job failed. A synchronous API call reports its failure in the response instead and sends no event. Sent to every enabled endpoint subscribed to it (Pro and Team). Delivery is at least once and unordered.",
        "operationId": "webhook_transcript_failed",
        "parameters": [
          {
            "name": "x-vidwords-signature",
            "in": "header",
            "required": true,
            "description": "`t=<unix seconds>,v1=<hex HMAC-SHA256 of \"<t>.<raw body>\" keyed with the endpoint's signing secret>`. Recompute it over the RAW body, compare in constant time, and reject a `t` more than 5 minutes from your clock. Each attempt is signed afresh.",
            "schema": {
              "type": "string",
              "examples": [
                "t=1760261400,v1=5d41402abc4b2a76b9719d911017c592ae2f5c1c6e2b8d1b5f4a3c2e1d0f9a8b"
              ]
            }
          },
          {
            "name": "x-vidwords-event",
            "in": "header",
            "required": true,
            "description": "The event type, same as `type` in the body.",
            "schema": {
              "type": "string",
              "examples": [
                "watch.completed"
              ]
            }
          },
          {
            "name": "x-vidwords-delivery",
            "in": "header",
            "required": true,
            "description": "The event id, same as `id` in the body and identical on every retry.",
            "schema": {
              "type": "string",
              "examples": [
                "evt_3f9c1a7b2d4e6f80a1b2c3d4e5f60718"
              ]
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TranscriptFailedEvent"
              }
            }
          }
        },
        "responses": {
          "2XX": {
            "description": "Received. Any 2xx within 10 seconds ends delivery."
          },
          "default": {
            "description": "Anything else (another status, a redirect, or no answer within 10 seconds) is retried 10 s, 1 min, 5 min and 30 min after each failed attempt: five attempts in all."
          }
        },
        "security": []
      }
    },
    "watch.completed": {
      "post": {
        "tags": [
          "Webhooks"
        ],
        "summary": "An AI Watch analysis finished",
        "description": "An analysis that was still running when it was started is ready to read with GET /api/watch/{jobId}. Not sent for a start that answered 200 with a ready job (an analysis reused from the cache): that response already carries the result. Sent to every enabled endpoint subscribed to it (Pro and Team). Delivery is at least once and unordered.",
        "operationId": "webhook_watch_completed",
        "parameters": [
          {
            "name": "x-vidwords-signature",
            "in": "header",
            "required": true,
            "description": "`t=<unix seconds>,v1=<hex HMAC-SHA256 of \"<t>.<raw body>\" keyed with the endpoint's signing secret>`. Recompute it over the RAW body, compare in constant time, and reject a `t` more than 5 minutes from your clock. Each attempt is signed afresh.",
            "schema": {
              "type": "string",
              "examples": [
                "t=1760261400,v1=5d41402abc4b2a76b9719d911017c592ae2f5c1c6e2b8d1b5f4a3c2e1d0f9a8b"
              ]
            }
          },
          {
            "name": "x-vidwords-event",
            "in": "header",
            "required": true,
            "description": "The event type, same as `type` in the body.",
            "schema": {
              "type": "string",
              "examples": [
                "watch.completed"
              ]
            }
          },
          {
            "name": "x-vidwords-delivery",
            "in": "header",
            "required": true,
            "description": "The event id, same as `id` in the body and identical on every retry.",
            "schema": {
              "type": "string",
              "examples": [
                "evt_3f9c1a7b2d4e6f80a1b2c3d4e5f60718"
              ]
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WatchCompletedEvent"
              }
            }
          }
        },
        "responses": {
          "2XX": {
            "description": "Received. Any 2xx within 10 seconds ends delivery."
          },
          "default": {
            "description": "Anything else (another status, a redirect, or no answer within 10 seconds) is retried 10 s, 1 min, 5 min and 30 min after each failed attempt: five attempts in all."
          }
        },
        "security": []
      }
    },
    "watch.failed": {
      "post": {
        "tags": [
          "Webhooks"
        ],
        "summary": "An AI Watch analysis failed",
        "description": "An analysis failed. Its AI Units were refunded; GET /api/watch/{jobId} carries `errorCode` and `retryable`. Sent to every enabled endpoint subscribed to it (Pro and Team). Delivery is at least once and unordered.",
        "operationId": "webhook_watch_failed",
        "parameters": [
          {
            "name": "x-vidwords-signature",
            "in": "header",
            "required": true,
            "description": "`t=<unix seconds>,v1=<hex HMAC-SHA256 of \"<t>.<raw body>\" keyed with the endpoint's signing secret>`. Recompute it over the RAW body, compare in constant time, and reject a `t` more than 5 minutes from your clock. Each attempt is signed afresh.",
            "schema": {
              "type": "string",
              "examples": [
                "t=1760261400,v1=5d41402abc4b2a76b9719d911017c592ae2f5c1c6e2b8d1b5f4a3c2e1d0f9a8b"
              ]
            }
          },
          {
            "name": "x-vidwords-event",
            "in": "header",
            "required": true,
            "description": "The event type, same as `type` in the body.",
            "schema": {
              "type": "string",
              "examples": [
                "watch.completed"
              ]
            }
          },
          {
            "name": "x-vidwords-delivery",
            "in": "header",
            "required": true,
            "description": "The event id, same as `id` in the body and identical on every retry.",
            "schema": {
              "type": "string",
              "examples": [
                "evt_3f9c1a7b2d4e6f80a1b2c3d4e5f60718"
              ]
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WatchFailedEvent"
              }
            }
          }
        },
        "responses": {
          "2XX": {
            "description": "Received. Any 2xx within 10 seconds ends delivery."
          },
          "default": {
            "description": "Anything else (another status, a redirect, or no answer within 10 seconds) is retried 10 s, 1 min, 5 min and 30 min after each failed attempt: five attempts in all."
          }
        },
        "security": []
      }
    }
  },
  "components": {
    "securitySchemes": {
      "ApiKeyAuth": {
        "type": "apiKey",
        "in": "header",
        "name": "Authorization",
        "description": "For direct use: `Basic <your-api-token>`. On RapidAPI this is handled automatically by the proxy."
      },
      "RapidApiProxy": {
        "type": "apiKey",
        "in": "header",
        "name": "x-rapidapi-proxy-secret",
        "description": "RapidAPI marketplace traffic only, set by the proxy — never by you. RapidAPI also forwards `x-rapidapi-user` and `x-rapidapi-subscription`; the latter selects the per-call batch cap (BASIC/PRO/ULTRA/MEGA) referenced throughout this spec. RapidAPI traffic is metered by RapidAPI and is not credit-billed."
      }
    },
    "schemas": {
      "TranscriptsRequest": {
        "type": "object",
        "required": [
          "ids"
        ],
        "properties": {
          "ids": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "maxItems": 50,
            "description": "Video IDs or full YouTube URLs (max 50)",
            "minItems": 1
          },
          "lang": {
            "type": "string",
            "description": "Preferred caption language code. Omit it (or send an empty string) for the video's own language; send \"en\" for English.",
            "default": ""
          },
          "transcribeAudio": {
            "type": "boolean",
            "default": true,
            "description": "Whether a video with no captions may be transcribed from its audio (paid: 3 AI Units per minute of video plus the Cloud Request, charged only for a delivered transcript). Send false to refuse it: the item is then an error carrying `audioTranscriptionOffer` with the video's length and `estimatedAiUnits`, and nothing is charged."
          },
          "maxAiUnits": {
            "type": "integer",
            "minimum": 0,
            "description": "The most AI Units any ONE video's audio transcription may cost. A dearer video is refused before anything is downloaded, as `asr_insufficient` with its price, and is not charged."
          }
        }
      },
      "TranscriptsResponse": {
        "type": "object",
        "properties": {
          "results": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TranscriptResult"
            }
          },
          "creditsRemaining": {
            "type": "number",
            "description": "Deprecated compatibility alias for Cloud Requests remaining. Only present for direct API calls."
          },
          "cloudRequestsRemaining": {
            "type": "number",
            "description": "Cloud Requests available to this API token, including its one-time Developer Requests."
          },
          "aiUnitsRemaining": {
            "type": "number",
            "description": "AI Processing Units available on the account."
          }
        }
      },
      "TranscriptResult": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "The video id, echoed back. For a successful item this is the resolved 11-character YouTube id; for `invalid_id` it is the raw string you sent."
          },
          "title": {
            "type": [
              "string",
              "null"
            ],
            "description": "Video title, or null when metadata could not be fetched."
          },
          "author": {
            "type": [
              "string",
              "null"
            ],
            "description": "Channel name, or null when metadata could not be fetched."
          },
          "language": {
            "type": "string",
            "description": "Human-readable caption language, e.g. \"English\"."
          },
          "languageCode": {
            "type": "string",
            "description": "BCP-47 language tag for the returned captions, e.g. \"en\" or \"pt-BR\"."
          },
          "isGenerated": {
            "type": "boolean",
            "description": "True when these are YouTube auto-generated captions rather than human-authored ones."
          },
          "text": {
            "type": "string",
            "description": "Full transcript as one string"
          },
          "segments": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "text": {
                  "type": "string",
                  "description": "Cue text."
                },
                "start": {
                  "type": "number",
                  "description": "Cue start offset from the beginning of the video, in seconds.",
                  "format": "float",
                  "example": 12.34
                },
                "duration": {
                  "type": "number",
                  "description": "How long the cue is displayed, in seconds.",
                  "format": "float",
                  "example": 3.2
                }
              }
            },
            "description": "Timed caption cues in playback order. Absent when `error` is set."
          },
          "error": {
            "type": "string",
            "description": "Present instead of `segments` when a video was not returned. `invalid_id` not a video id/URL · `no_transcript` no captions exist · `transcripts_disabled` owner disabled captions · `video_unavailable` private/deleted/region-blocked · `age_restricted` needs sign-in · `tier_limit` exceeded your RapidAPI per-call batch cap and was not processed · `insufficient_credits` balance ran out mid-batch · `fetch_failed` upstream fetch failed, retryable · `service_paused` extraction temporarily paused by the cost breaker, retryable · `ip_blocked`/`request_blocked` upstream blocked the request, retryable · `internal` unexpected server error.",
            "enum": [
              "invalid_id",
              "no_transcript",
              "transcripts_disabled",
              "video_unavailable",
              "age_restricted",
              "tier_limit",
              "insufficient_credits",
              "fetch_failed",
              "service_paused",
              "ip_blocked",
              "request_blocked",
              "internal"
            ]
          },
          "message": {
            "type": "string",
            "description": "Human-readable detail accompanying `error`."
          },
          "source": {
            "type": "string",
            "enum": [
              "captions",
              "auto_captions",
              "transcribed",
              "browser_capture"
            ],
            "description": "Optional provenance of the returned text; use this instead of method. It describes the text, not the implementation."
          },
          "method": {
            "type": "string",
            "deprecated": true,
            "description": "Legacy extraction marker retained for existing clients. Use source for provenance; method does not identify the active model or provider."
          },
          "audioTranscriptionStatus": {
            "type": "object",
            "description": "On a captionless or audio-refused item: what happened to audio transcription. `state` is `not_requested` (transcribeAudio was false), `not_available` (`reason`: plan_required, insufficient or anonymous), `refused` (`reason`: the error code, e.g. asr_over_cap or asr_insufficient — decided before anything ran) or `failed` (`stage`: where it failed).",
            "properties": {
              "state": {
                "type": "string",
                "enum": [
                  "not_requested",
                  "not_available",
                  "refused",
                  "failed"
                ]
              },
              "reason": {
                "type": "string"
              },
              "stage": {
                "type": [
                  "string",
                  "null"
                ]
              }
            }
          }
        }
      },
      "ChannelsRequest": {
        "type": "object",
        "required": [
          "ids"
        ],
        "properties": {
          "ids": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "maxItems": 50,
            "description": "Channel @handles, URLs, or UC… IDs",
            "minItems": 1
          }
        }
      },
      "ChannelsResponse": {
        "type": "object",
        "properties": {
          "results": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ChannelResult"
            }
          }
        }
      },
      "ChannelResult": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "The channel identifier you sent, echoed back verbatim (handle, URL, or UC… id)."
          },
          "channelId": {
            "type": "string",
            "description": "The resolved canonical channel id, always in UC… form."
          },
          "title": {
            "type": "string",
            "description": "Channel title."
          },
          "videoCount": {
            "type": "integer",
            "description": "Number of videos returned in `videos` — not the channel total."
          },
          "truncated": {
            "type": "boolean",
            "description": "True when the channel has more uploads than the 500-video ceiling and the list was cut short."
          },
          "videos": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "description": "Video id, usable directly as an entry in `ids` for POST /api/transcripts."
                },
                "title": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "description": "Video title, or null when unavailable."
                },
                "author": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "description": "Channel name, or null when unavailable."
                }
              }
            },
            "description": "Uploads newest first, capped at 500 (see `truncated`). Absent when `error` is set."
          },
          "error": {
            "type": [
              "string",
              "null"
            ],
            "description": "Present instead of `videos` when a channel could not be fetched. `invalid_id` not a handle/URL/UC… id · `channel_not_found` no such channel · `tier_limit` exceeded your per-call batch cap and was not processed · `fetch_failed` upstream fetch failed, retryable · `service_paused` temporarily paused by the cost breaker, retryable · `internal` unexpected server error.",
            "enum": [
              "invalid_id",
              "channel_not_found",
              "tier_limit",
              "fetch_failed",
              "service_paused",
              "internal"
            ]
          },
          "message": {
            "type": [
              "string",
              "null"
            ],
            "description": "Human-readable detail accompanying `error`."
          }
        }
      },
      "Error": {
        "type": "object",
        "description": "Every 4xx response uses this shape. `error` is the stable machine-readable code; `message` is human-readable and may change.",
        "required": [
          "error"
        ],
        "properties": {
          "error": {
            "type": "string",
            "description": "Stable machine-readable error code.",
            "example": "unauthorized"
          },
          "message": {
            "type": "string",
            "description": "Human-readable explanation. Do not match on this.",
            "example": "Invalid API token"
          },
          "topUpUrl": {
            "type": "string",
            "description": "On a 402 balance refusal only: where the account owner buys a one-time top-up.",
            "example": "https://vidwords.com/pricing#topups-title"
          },
          "autoRechargeUrl": {
            "type": "string",
            "description": "On a 402 balance refusal, for an account on an active monthly plan only: the Settings card where the account owner can turn on auto-recharge, so the balance refills within a monthly cap they set (charged to the plan's card) and automated calls do not stop.",
            "example": "https://vidwords.com/profile#auto-recharge"
          },
          "upgradeUrl": {
            "type": "string",
            "description": "On a 402 balance refusal only: the plans page.",
            "example": "https://vidwords.com/pricing"
          },
          "guidance": {
            "type": "string",
            "description": "On a 402 balance refusal only: one line on recovering, for the developer reading the response. May change."
          }
        }
      },
      "WatchStartRequest": {
        "type": "object",
        "required": [
          "id"
        ],
        "properties": {
          "id": {
            "type": "string",
            "description": "YouTube video URL or id. Public videos only."
          },
          "mode": {
            "type": "string",
            "enum": [
              "quick",
              "smart",
              "deep",
              "auto"
            ],
            "default": "smart",
            "description": "\"auto\" resolves from the video's length and visual pace. \"deep\" costs 30 AI Processing Units per minute of video and runs on any plan with enough of them."
          },
          "lang": {
            "type": "string",
            "default": "",
            "description": "Preferred caption language. Omit it (or send an empty string) for the video's own language; send \"en\" for English."
          },
          "partial": {
            "type": "boolean",
            "default": false,
            "description": "If the video exceeds the plan length cap, analyse the first allowed minutes and charge only for those. Never implied."
          }
        }
      },
      "WatchJob": {
        "type": "object",
        "properties": {
          "jobId": {
            "type": "integer"
          },
          "status": {
            "type": "string",
            "enum": [
              "queued",
              "processing",
              "ready",
              "failed"
            ]
          },
          "videoId": {
            "type": "string"
          },
          "durationSeconds": {
            "type": "integer"
          },
          "chargedSeconds": {
            "type": "integer"
          },
          "remainingSeconds": {
            "type": "integer",
            "description": "Watch seconds left on the plan after this run."
          },
          "cached": {
            "type": "boolean",
            "description": "True when a previous analysis of this video was reused."
          },
          "mode": {
            "type": "string",
            "enum": [
              "quick",
              "smart",
              "deep"
            ]
          },
          "artifact": {
            "type": "object",
            "description": "Present only when status is \"ready\": summary, chapters, key points and timestamped evidence."
          },
          "errorCode": {
            "type": "string"
          },
          "retryable": {
            "type": "boolean"
          }
        }
      },
      "WebhookEventBase": {
        "type": "object",
        "required": [
          "id",
          "type",
          "createdAt",
          "data"
        ],
        "properties": {
          "id": {
            "type": "string",
            "description": "Event id, also sent as `x-vidwords-delivery`. Every retry of one event carries the same id: de-duplicate on it.",
            "examples": [
              "evt_3f9c1a7b2d4e6f80a1b2c3d4e5f60718"
            ]
          },
          "type": {
            "type": "string",
            "enum": [
              "transcript.completed",
              "transcript.failed",
              "watch.completed",
              "watch.failed"
            ]
          },
          "createdAt": {
            "type": "string",
            "format": "date-time",
            "description": "When the event happened (not when this attempt was sent)."
          },
          "data": {
            "type": "object"
          }
        }
      },
      "TranscriptCompletedEvent": {
        "allOf": [
          {
            "$ref": "#/components/schemas/WebhookEventBase"
          },
          {
            "type": "object",
            "properties": {
              "type": {
                "const": "transcript.completed"
              },
              "data": {
                "type": "object",
                "required": [
                  "videoId",
                  "source"
                ],
                "properties": {
                  "videoId": {
                    "type": "string",
                    "examples": [
                      "dQw4w9WgXcQ"
                    ]
                  },
                  "source": {
                    "type": "string",
                    "description": "Where the transcript was requested, such as `web`, `extension`, `api` or `mcp`."
                  },
                  "librarySaved": {
                    "type": "boolean",
                    "description": "Whether it was filed in your Library."
                  },
                  "jobId": {
                    "type": "string",
                    "description": "Present when a background job produced it. An opaque string id."
                  },
                  "bulkJobId": {
                    "type": "string",
                    "description": "Optional historical import reference. An opaque string id."
                  }
                }
              }
            }
          }
        ]
      },
      "TranscriptFailedEvent": {
        "allOf": [
          {
            "$ref": "#/components/schemas/WebhookEventBase"
          },
          {
            "type": "object",
            "properties": {
              "type": {
                "const": "transcript.failed"
              },
              "data": {
                "type": "object",
                "required": [
                  "jobId",
                  "videoId"
                ],
                "properties": {
                  "jobId": {
                    "type": "string",
                    "description": "The background transcript job. An opaque string id."
                  },
                  "videoId": {
                    "type": "string"
                  },
                  "source": {
                    "type": "string"
                  },
                  "error": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "description": "Stable error code, as in the API's per-video errors."
                  },
                  "retryable": {
                    "type": [
                      "boolean",
                      "null"
                    ]
                  }
                }
              }
            }
          }
        ]
      },
      "WatchCompletedEvent": {
        "allOf": [
          {
            "$ref": "#/components/schemas/WebhookEventBase"
          },
          {
            "type": "object",
            "properties": {
              "type": {
                "const": "watch.completed"
              },
              "data": {
                "type": "object",
                "required": [
                  "jobId",
                  "videoId",
                  "mode",
                  "status"
                ],
                "properties": {
                  "jobId": {
                    "type": "integer",
                    "description": "Read the result with GET /api/watch/{jobId}."
                  },
                  "videoId": {
                    "type": "string"
                  },
                  "mode": {
                    "type": "string",
                    "enum": [
                      "quick",
                      "smart",
                      "deep"
                    ]
                  },
                  "origin": {
                    "type": "string",
                    "enum": [
                      "user",
                      "radar"
                    ],
                    "description": "`radar` when a Radar watchlist started it."
                  },
                  "status": {
                    "const": "ready"
                  }
                }
              }
            }
          }
        ]
      },
      "WatchFailedEvent": {
        "allOf": [
          {
            "$ref": "#/components/schemas/WebhookEventBase"
          },
          {
            "type": "object",
            "properties": {
              "type": {
                "const": "watch.failed"
              },
              "data": {
                "type": "object",
                "required": [
                  "jobId",
                  "videoId",
                  "mode",
                  "status"
                ],
                "properties": {
                  "jobId": {
                    "type": "integer",
                    "description": "Read the result with GET /api/watch/{jobId}."
                  },
                  "videoId": {
                    "type": "string"
                  },
                  "mode": {
                    "type": "string",
                    "enum": [
                      "quick",
                      "smart",
                      "deep"
                    ]
                  },
                  "origin": {
                    "type": "string",
                    "enum": [
                      "user",
                      "radar"
                    ],
                    "description": "`radar` when a Radar watchlist started it."
                  },
                  "status": {
                    "const": "failed"
                  }
                }
              }
            }
          }
        ]
      }
    },
    "headers": {
      "RateLimit-Limit": {
        "description": "Requests allowed in the current window. On the Watch endpoints this is the endpoint's own limit (10 per minute to start or ask, 30 per 10 seconds to poll). A 429 from the per-plan ceiling the Watch endpoints share with the rest of the API carries that ceiling's values instead. Absent on a request refused before the limiter, such as a missing token.",
        "schema": {
          "type": "integer"
        }
      },
      "RateLimit-Remaining": {
        "description": "Requests left in the current window. Slow down as it approaches 0 instead of waiting for a 429.",
        "schema": {
          "type": "integer"
        }
      },
      "RateLimit-Reset": {
        "description": "Seconds until the window frees a request.",
        "schema": {
          "type": "integer"
        }
      }
    }
  }
}
