{
  "openapi": "3.1.0",
  "info": {
    "title": "FlashData Customer API",
    "version": "0.2.0-draft",
    "summary": "FlashData control-plane API contract",
    "description": "Google search, YouTube data and media downloads, with endpoints for jobs, accounts, API keys and billing. See /docs for request examples and setup guides.",
    "contact": {
      "name": "FlashData Engineering"
    }
  },
  "servers": [
    {
      "url": "https://api.flashdata.dev/v2",
      "description": "Management API"
    }
  ],
  "tags": [
    {
      "name": "System"
    },
    {
      "name": "Auth"
    },
    {
      "name": "Account"
    },
    {
      "name": "Onboarding"
    },
    {
      "name": "Overview"
    },
    {
      "name": "API Keys"
    },
    {
      "name": "Agent Connections"
    },
    {
      "name": "Catalog"
    },
    {
      "name": "Billing"
    },
    {
      "name": "Credits"
    },
    {
      "name": "Trial Credits"
    },
    {
      "name": "Delivery"
    },
    {
      "name": "Jobs"
    },
    {
      "name": "Bulk Jobs"
    },
    {
      "name": "Playground"
    },
    {
      "name": "Data Queries"
    }
  ],
  "paths": {
    "/api-access/identity": {
      "get": {
        "operationId": "getApiKeyIdentity",
        "tags": [
          "API Keys"
        ],
        "summary": "Verify current API key ownership and recurring readiness",
        "description": "Free header-only API-key read. Returns public account/key IDs and authoritative ownership. No request body. Does not alter the existing /api-access metadata response. Shares the 120/minute account-read limit. Fail closed on unavailability; do not infer ownership from key prefix, plan, or local state. No query parameters are accepted. Responses are no-store.",
        "security": [
          {
            "dataApiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "Verify current API key ownership and recurring readiness",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIKeyIdentity"
                }
              }
            }
          },
          "400": {
            "description": "Rejected request; inspect the Problem code. Never retry a mutation blindly.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "401": {
            "description": "Rejected request; inspect the Problem code. Never retry a mutation blindly.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "403": {
            "description": "Rejected request; inspect the Problem code. Never retry a mutation blindly.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "409": {
            "description": "Rejected request; inspect the Problem code. Never retry a mutation blindly.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "410": {
            "description": "Rejected request; inspect the Problem code. Never retry a mutation blindly.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "422": {
            "description": "Rejected request; inspect the Problem code. Never retry a mutation blindly.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "429": {
            "description": "Rejected request; inspect the Problem code. Never retry a mutation blindly.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "503": {
            "description": "Rejected request; inspect the Problem code. Never retry a mutation blindly.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      }
    },
    "/agent-connections/capabilities": {
      "get": {
        "operationId": "getAgentCapabilities",
        "tags": [
          "Agent Connections"
        ],
        "summary": "Discover protocol 2 onboarding availability",
        "description": " No query parameters are accepted. Responses are no-store. Agent routes are management-only and feature-gated; deployments can return 404 when disabled. X-API-Key is forbidden on agent routes.",
        "security": [],
        "responses": {
          "200": {
            "description": "Discover protocol 2 onboarding availability",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentCapabilities"
                }
              }
            }
          },
          "400": {
            "description": "Rejected request; inspect the Problem code. Never retry a mutation blindly.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "401": {
            "description": "Rejected request; inspect the Problem code. Never retry a mutation blindly.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "403": {
            "description": "Rejected request; inspect the Problem code. Never retry a mutation blindly.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "409": {
            "description": "Rejected request; inspect the Problem code. Never retry a mutation blindly.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "410": {
            "description": "Rejected request; inspect the Problem code. Never retry a mutation blindly.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "422": {
            "description": "Rejected request; inspect the Problem code. Never retry a mutation blindly.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "429": {
            "description": "Rejected request; inspect the Problem code. Never retry a mutation blindly.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "503": {
            "description": "Rejected request; inspect the Problem code. Never retry a mutation blindly.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      }
    },
    "/agent-connections/registrations": {
      "post": {
        "operationId": "registerAgentConnection",
        "tags": [
          "Agent Connections"
        ],
        "summary": "Create or recover a temporary API-key connection",
        "description": "Persist the registration proof and exact input before POST. Same proof and body recover the same trial; changing input yields conflict. Temporary trial: 1 Credit, 72 hours, 1 request/second, batch size 1. Source scope limits remain authoritative on the server. No query parameters are accepted. Responses are no-store. Agent routes are management-only and feature-gated; deployments can return 404 when disabled. X-API-Key is forbidden on agent routes.",
        "security": [
          {
            "agentRegistrationProof": []
          }
        ],
        "responses": {
          "201": {
            "description": "Create or recover a temporary API-key connection",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentRegistration"
                }
              }
            }
          },
          "400": {
            "description": "Rejected request; inspect the Problem code. Never retry a mutation blindly.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "401": {
            "description": "Rejected request; inspect the Problem code. Never retry a mutation blindly.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "403": {
            "description": "Rejected request; inspect the Problem code. Never retry a mutation blindly.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "409": {
            "description": "Rejected request; inspect the Problem code. Never retry a mutation blindly.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "410": {
            "description": "Rejected request; inspect the Problem code. Never retry a mutation blindly.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "422": {
            "description": "Rejected request; inspect the Problem code. Never retry a mutation blindly.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "429": {
            "description": "Rejected request; inspect the Problem code. Never retry a mutation blindly.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "503": {
            "description": "Rejected request; inspect the Problem code. Never retry a mutation blindly.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AgentRegistrationRequest"
              }
            }
          }
        }
      }
    },
    "/agent-connections/owned": {
      "get": {
        "operationId": "listOwnedAgentConnections",
        "tags": [
          "Agent Connections"
        ],
        "summary": "List browser-owned connections",
        "description": " No query parameters are accepted. Responses are no-store. Agent routes are management-only and feature-gated; deployments can return 404 when disabled. X-API-Key is forbidden on agent routes. Browser-owned operation. Full verified Session required; caller must not substitute an API key or proof.",
        "security": [
          {
            "cookieSession": []
          }
        ],
        "responses": {
          "200": {
            "description": "List browser-owned connections",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "connections": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/AgentConnection"
                      }
                    }
                  },
                  "required": [
                    "connections"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Rejected request; inspect the Problem code. Never retry a mutation blindly.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "401": {
            "description": "Rejected request; inspect the Problem code. Never retry a mutation blindly.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "403": {
            "description": "Rejected request; inspect the Problem code. Never retry a mutation blindly.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "409": {
            "description": "Rejected request; inspect the Problem code. Never retry a mutation blindly.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "410": {
            "description": "Rejected request; inspect the Problem code. Never retry a mutation blindly.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "422": {
            "description": "Rejected request; inspect the Problem code. Never retry a mutation blindly.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "429": {
            "description": "Rejected request; inspect the Problem code. Never retry a mutation blindly.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "503": {
            "description": "Rejected request; inspect the Problem code. Never retry a mutation blindly.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        },
        "x-session-modes": [
          "full"
        ]
      }
    },
    "/agent-connections/{connectionId}": {
      "get": {
        "operationId": "getTemporaryAgentConnection",
        "tags": [
          "Agent Connections"
        ],
        "summary": "Read temporary connection status",
        "description": " No query parameters are accepted. Responses are no-store. Agent routes are management-only and feature-gated; deployments can return 404 when disabled. X-API-Key is forbidden on agent routes.",
        "security": [
          {
            "agentSetupCredential": []
          }
        ],
        "responses": {
          "200": {
            "description": "Read temporary connection status",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentConnectionResponse"
                }
              }
            }
          },
          "400": {
            "description": "Rejected request; inspect the Problem code. Never retry a mutation blindly.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "401": {
            "description": "Rejected request; inspect the Problem code. Never retry a mutation blindly.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "403": {
            "description": "Rejected request; inspect the Problem code. Never retry a mutation blindly.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "409": {
            "description": "Rejected request; inspect the Problem code. Never retry a mutation blindly.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "410": {
            "description": "Rejected request; inspect the Problem code. Never retry a mutation blindly.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "422": {
            "description": "Rejected request; inspect the Problem code. Never retry a mutation blindly.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "429": {
            "description": "Rejected request; inspect the Problem code. Never retry a mutation blindly.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "503": {
            "description": "Rejected request; inspect the Problem code. Never retry a mutation blindly.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "connectionId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^acn_[A-Za-z0-9_-]{8,100}$"
            }
          }
        ]
      },
      "delete": {
        "operationId": "revokeAgentConnection",
        "tags": [
          "Agent Connections"
        ],
        "summary": "Revoke an owned connection",
        "description": " No query parameters are accepted. Responses are no-store. Agent routes are management-only and feature-gated; deployments can return 404 when disabled. X-API-Key is forbidden on agent routes. Browser-owned operation. Full verified Session required; caller must not substitute an API key or proof.",
        "security": [
          {
            "cookieSession": [],
            "csrfToken": []
          }
        ],
        "responses": {
          "204": {
            "description": "Revoke an owned connection"
          },
          "400": {
            "description": "Rejected request; inspect the Problem code. Never retry a mutation blindly.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "401": {
            "description": "Rejected request; inspect the Problem code. Never retry a mutation blindly.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "403": {
            "description": "Rejected request; inspect the Problem code. Never retry a mutation blindly.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "409": {
            "description": "Rejected request; inspect the Problem code. Never retry a mutation blindly.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "410": {
            "description": "Rejected request; inspect the Problem code. Never retry a mutation blindly.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "422": {
            "description": "Rejected request; inspect the Problem code. Never retry a mutation blindly.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "429": {
            "description": "Rejected request; inspect the Problem code. Never retry a mutation blindly.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "503": {
            "description": "Rejected request; inspect the Problem code. Never retry a mutation blindly.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        },
        "x-session-modes": [
          "full"
        ],
        "parameters": [
          {
            "name": "connectionId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^acn_[A-Za-z0-9_-]{8,100}$"
            }
          },
          {
            "name": "Origin",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-CSRF-Token",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ]
      }
    },
    "/agent-connections/{connectionId}/identity": {
      "get": {
        "operationId": "getAgentConnectionIdentity",
        "tags": [
          "Agent Connections"
        ],
        "summary": "Verify the current data API key for a connection",
        "description": " No query parameters are accepted. Responses are no-store. Agent routes are management-only and feature-gated; deployments can return 404 when disabled. X-API-Key is forbidden on agent routes.",
        "security": [
          {
            "agentIdentityKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "Verify the current data API key for a connection",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentConnectionResponse"
                }
              }
            }
          },
          "400": {
            "description": "Rejected request; inspect the Problem code. Never retry a mutation blindly.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "401": {
            "description": "Rejected request; inspect the Problem code. Never retry a mutation blindly.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "403": {
            "description": "Rejected request; inspect the Problem code. Never retry a mutation blindly.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "409": {
            "description": "Rejected request; inspect the Problem code. Never retry a mutation blindly.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "410": {
            "description": "Rejected request; inspect the Problem code. Never retry a mutation blindly.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "422": {
            "description": "Rejected request; inspect the Problem code. Never retry a mutation blindly.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "429": {
            "description": "Rejected request; inspect the Problem code. Never retry a mutation blindly.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "503": {
            "description": "Rejected request; inspect the Problem code. Never retry a mutation blindly.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "connectionId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^acn_[A-Za-z0-9_-]{8,100}$"
            }
          }
        ]
      }
    },
    "/agent-connections/{connectionId}/onboarding": {
      "get": {
        "operationId": "getAgentOnboardingStatus",
        "tags": [
          "Agent Connections"
        ],
        "summary": "Read recoverable onboarding state",
        "description": " No query parameters are accepted. Responses are no-store. Agent routes are management-only and feature-gated; deployments can return 404 when disabled. X-API-Key is forbidden on agent routes.",
        "security": [
          {
            "agentHandoffProof": []
          }
        ],
        "responses": {
          "200": {
            "description": "Read recoverable onboarding state",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentOnboardingStatus"
                }
              }
            }
          },
          "400": {
            "description": "Rejected request; inspect the Problem code. Never retry a mutation blindly.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "401": {
            "description": "Rejected request; inspect the Problem code. Never retry a mutation blindly.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "403": {
            "description": "Rejected request; inspect the Problem code. Never retry a mutation blindly.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "409": {
            "description": "Rejected request; inspect the Problem code. Never retry a mutation blindly.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "410": {
            "description": "Rejected request; inspect the Problem code. Never retry a mutation blindly.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "422": {
            "description": "Rejected request; inspect the Problem code. Never retry a mutation blindly.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "429": {
            "description": "Rejected request; inspect the Problem code. Never retry a mutation blindly.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "503": {
            "description": "Rejected request; inspect the Problem code. Never retry a mutation blindly.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "connectionId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^acn_[A-Za-z0-9_-]{8,100}$"
            }
          }
        ]
      }
    },
    "/agent-connections/{connectionId}/claims": {
      "post": {
        "operationId": "createAgentClaim",
        "tags": [
          "Agent Connections"
        ],
        "summary": "Create a browser approval claim",
        "description": "Open claimPath on a trusted FlashData web origin and display the code separately. Never place credentials or the confirmation code in the URL. No query parameters are accepted. Responses are no-store. Agent routes are management-only and feature-gated; deployments can return 404 when disabled. X-API-Key is forbidden on agent routes.",
        "security": [
          {
            "agentSetupCredential": []
          }
        ],
        "responses": {
          "201": {
            "description": "Create a browser approval claim",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentClaim"
                }
              }
            }
          },
          "400": {
            "description": "Rejected request; inspect the Problem code. Never retry a mutation blindly.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "401": {
            "description": "Rejected request; inspect the Problem code. Never retry a mutation blindly.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "403": {
            "description": "Rejected request; inspect the Problem code. Never retry a mutation blindly.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "409": {
            "description": "Rejected request; inspect the Problem code. Never retry a mutation blindly.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "410": {
            "description": "Rejected request; inspect the Problem code. Never retry a mutation blindly.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "422": {
            "description": "Rejected request; inspect the Problem code. Never retry a mutation blindly.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "429": {
            "description": "Rejected request; inspect the Problem code. Never retry a mutation blindly.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "503": {
            "description": "Rejected request; inspect the Problem code. Never retry a mutation blindly.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "connectionId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^acn_[A-Za-z0-9_-]{8,100}$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "properties": {},
                "required": []
              }
            }
          }
        }
      }
    },
    "/agent-connections/claims/{claimId}/confirm": {
      "post": {
        "operationId": "confirmAgentClaim",
        "tags": [
          "Agent Connections"
        ],
        "summary": "Confirm the claim code in a verified browser session",
        "description": " No query parameters are accepted. Responses are no-store. Agent routes are management-only and feature-gated; deployments can return 404 when disabled. X-API-Key is forbidden on agent routes. Browser-owned operation. Full verified Session required; caller must not substitute an API key or proof.",
        "security": [
          {
            "cookieSession": [],
            "csrfToken": []
          }
        ],
        "responses": {
          "200": {
            "description": "Confirm the claim code in a verified browser session",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentBrowserClaim"
                }
              }
            }
          },
          "400": {
            "description": "Rejected request; inspect the Problem code. Never retry a mutation blindly.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "401": {
            "description": "Rejected request; inspect the Problem code. Never retry a mutation blindly.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "403": {
            "description": "Rejected request; inspect the Problem code. Never retry a mutation blindly.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "409": {
            "description": "Rejected request; inspect the Problem code. Never retry a mutation blindly.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "410": {
            "description": "Rejected request; inspect the Problem code. Never retry a mutation blindly.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "422": {
            "description": "Rejected request; inspect the Problem code. Never retry a mutation blindly.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "429": {
            "description": "Rejected request; inspect the Problem code. Never retry a mutation blindly.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "503": {
            "description": "Rejected request; inspect the Problem code. Never retry a mutation blindly.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        },
        "x-session-modes": [
          "full"
        ],
        "parameters": [
          {
            "name": "claimId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^acl_[A-Za-z0-9_-]{8,100}$"
            }
          },
          {
            "name": "Origin",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-CSRF-Token",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "code": {
                    "type": "string",
                    "pattern": "^\\d{8}$"
                  }
                },
                "required": [
                  "code"
                ]
              }
            }
          }
        }
      }
    },
    "/agent-connections/claims/{claimId}": {
      "get": {
        "operationId": "getAgentClaim",
        "tags": [
          "Agent Connections"
        ],
        "summary": "Read a confirmed claim in its browser session",
        "description": " No query parameters are accepted. Responses are no-store. Agent routes are management-only and feature-gated; deployments can return 404 when disabled. X-API-Key is forbidden on agent routes. Browser-owned operation. Full verified Session required; caller must not substitute an API key or proof.",
        "security": [
          {
            "cookieSession": []
          }
        ],
        "responses": {
          "200": {
            "description": "Read a confirmed claim in its browser session",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentClaimView"
                }
              }
            }
          },
          "400": {
            "description": "Rejected request; inspect the Problem code. Never retry a mutation blindly.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "401": {
            "description": "Rejected request; inspect the Problem code. Never retry a mutation blindly.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "403": {
            "description": "Rejected request; inspect the Problem code. Never retry a mutation blindly.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "409": {
            "description": "Rejected request; inspect the Problem code. Never retry a mutation blindly.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "410": {
            "description": "Rejected request; inspect the Problem code. Never retry a mutation blindly.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "422": {
            "description": "Rejected request; inspect the Problem code. Never retry a mutation blindly.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "429": {
            "description": "Rejected request; inspect the Problem code. Never retry a mutation blindly.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "503": {
            "description": "Rejected request; inspect the Problem code. Never retry a mutation blindly.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        },
        "x-session-modes": [
          "full"
        ],
        "parameters": [
          {
            "name": "claimId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^acl_[A-Za-z0-9_-]{8,100}$"
            }
          }
        ]
      }
    },
    "/agent-connections/claims/{claimId}/approve": {
      "post": {
        "operationId": "approveAgentClaim",
        "tags": [
          "Agent Connections"
        ],
        "summary": "Approve reduced scopes and account-balance funding",
        "description": " No query parameters are accepted. Responses are no-store. Agent routes are management-only and feature-gated; deployments can return 404 when disabled. X-API-Key is forbidden on agent routes. Browser-owned operation. Full verified Session required; caller must not substitute an API key or proof.",
        "security": [
          {
            "cookieSession": [],
            "csrfToken": []
          }
        ],
        "responses": {
          "200": {
            "description": "Approve reduced scopes and account-balance funding",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "connection": {
                      "$ref": "#/components/schemas/AgentConnection"
                    },
                    "handoff": {
                      "type": "object",
                      "additionalProperties": false,
                      "properties": {
                        "status": {
                          "type": "string"
                        },
                        "expiresAt": {
                          "type": "string",
                          "format": "date-time"
                        }
                      },
                      "required": [
                        "status",
                        "expiresAt"
                      ]
                    }
                  },
                  "required": [
                    "connection",
                    "handoff"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Rejected request; inspect the Problem code. Never retry a mutation blindly.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "401": {
            "description": "Rejected request; inspect the Problem code. Never retry a mutation blindly.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "403": {
            "description": "Rejected request; inspect the Problem code. Never retry a mutation blindly.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "409": {
            "description": "Rejected request; inspect the Problem code. Never retry a mutation blindly.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "410": {
            "description": "Rejected request; inspect the Problem code. Never retry a mutation blindly.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "422": {
            "description": "Rejected request; inspect the Problem code. Never retry a mutation blindly.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "429": {
            "description": "Rejected request; inspect the Problem code. Never retry a mutation blindly.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "503": {
            "description": "Rejected request; inspect the Problem code. Never retry a mutation blindly.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        },
        "x-session-modes": [
          "full"
        ],
        "parameters": [
          {
            "name": "claimId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^acl_[A-Za-z0-9_-]{8,100}$"
            }
          },
          {
            "name": "Origin",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-CSRF-Token",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AgentApproval"
              }
            }
          }
        }
      }
    },
    "/agent-connections/{connectionId}/handoff": {
      "post": {
        "operationId": "deliverAgentHandoff",
        "tags": [
          "Agent Connections"
        ],
        "summary": "Recover the approved owner API key",
        "description": "Candidate key expires in 24 hours until installation ACK. Persist atomically, reload in a fresh process and verify identity before ACK. A repeated delivery recovers the same candidate; confirmed delivery returns a receipt without credentials. No query parameters are accepted. Responses are no-store. Agent routes are management-only and feature-gated; deployments can return 404 when disabled. X-API-Key is forbidden on agent routes.",
        "security": [
          {
            "agentHandoffProof": []
          }
        ],
        "responses": {
          "200": {
            "description": "Recover the approved owner API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentHandoff"
                }
              }
            }
          },
          "400": {
            "description": "Rejected request; inspect the Problem code. Never retry a mutation blindly.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "401": {
            "description": "Rejected request; inspect the Problem code. Never retry a mutation blindly.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "403": {
            "description": "Rejected request; inspect the Problem code. Never retry a mutation blindly.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "409": {
            "description": "Rejected request; inspect the Problem code. Never retry a mutation blindly.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "410": {
            "description": "Rejected request; inspect the Problem code. Never retry a mutation blindly.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "422": {
            "description": "Rejected request; inspect the Problem code. Never retry a mutation blindly.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "429": {
            "description": "Rejected request; inspect the Problem code. Never retry a mutation blindly.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "503": {
            "description": "Rejected request; inspect the Problem code. Never retry a mutation blindly.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "connectionId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^acn_[A-Za-z0-9_-]{8,100}$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "properties": {},
                "required": []
              }
            }
          }
        }
      }
    },
    "/agent-connections/{connectionId}/handoff/ack": {
      "post": {
        "operationId": "acknowledgeAgentHandoff",
        "tags": [
          "Agent Connections"
        ],
        "summary": "Acknowledge verified owner-key installation",
        "description": "Caller must already have saved the candidate and independently verified it in a fresh process. Successful ACK marks installed, removes the candidate key expiry and deletes recoverable credential material. Repeated ACK is idempotent. No query parameters are accepted. Responses are no-store. Agent routes are management-only and feature-gated; deployments can return 404 when disabled. X-API-Key is forbidden on agent routes.",
        "security": [
          {
            "agentHandoffProof": []
          }
        ],
        "responses": {
          "200": {
            "description": "Acknowledge verified owner-key installation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentHandoff"
                }
              }
            }
          },
          "400": {
            "description": "Rejected request; inspect the Problem code. Never retry a mutation blindly.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "401": {
            "description": "Rejected request; inspect the Problem code. Never retry a mutation blindly.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "403": {
            "description": "Rejected request; inspect the Problem code. Never retry a mutation blindly.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "409": {
            "description": "Rejected request; inspect the Problem code. Never retry a mutation blindly.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "410": {
            "description": "Rejected request; inspect the Problem code. Never retry a mutation blindly.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "422": {
            "description": "Rejected request; inspect the Problem code. Never retry a mutation blindly.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "429": {
            "description": "Rejected request; inspect the Problem code. Never retry a mutation blindly.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "503": {
            "description": "Rejected request; inspect the Problem code. Never retry a mutation blindly.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "connectionId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^acn_[A-Za-z0-9_-]{8,100}$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "apiKey": {
                    "type": "string"
                  }
                },
                "required": [
                  "apiKey"
                ]
              }
            }
          }
        }
      }
    },
    "/oauth/requests/{requestId}": {
      "parameters": [
        {
          "name": "requestId",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string",
            "pattern": "^fdo_[A-Za-z0-9_-]{43}$"
          }
        }
      ],
      "get": {
        "operationId": "getOAuthConsent",
        "tags": [
          "Auth"
        ],
        "summary": "Read an app authorization request and bind it to the current session",
        "description": "Full session required. Request expires after ten minutes. Response is no-store.",
        "security": [
          {
            "cookieSession": []
          }
        ],
        "responses": {
          "200": {
            "description": "Requested app permissions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OAuthConsent"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "410": {
            "description": "Request expired, used, or bound to another session",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "decideOAuthConsent",
        "tags": [
          "Auth"
        ],
        "summary": "Approve or deny an app authorization request",
        "description": "Full session, CSRF and allowed Origin required. Consumes the request once. Response is no-store.",
        "security": [
          {
            "cookieSession": [],
            "csrfToken": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "decision"
                ],
                "properties": {
                  "decision": {
                    "type": "string",
                    "enum": [
                      "approve",
                      "deny"
                    ]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Registered client callback with code or denial, state and issuer",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "redirectUrl"
                  ],
                  "properties": {
                    "redirectUrl": {
                      "type": "string",
                      "format": "uri"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "410": {
            "description": "Authorization request unavailable; start a new connection",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          }
        }
      }
    },
    "/oauth/connections": {
      "get": {
        "operationId": "listOAuthConnections",
        "tags": [
          "Account"
        ],
        "summary": "List the current account's connected apps",
        "description": "Full session required. Empty when the account has no connected apps. Response is no-store.",
        "security": [
          {
            "cookieSession": []
          }
        ],
        "responses": {
          "200": {
            "description": "Connected apps",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/OAuthConnection"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        }
      }
    },
    "/oauth/connections/{grantId}": {
      "delete": {
        "operationId": "revokeOAuthConnection",
        "tags": [
          "Account"
        ],
        "summary": "Revoke a connected app and its dedicated API key",
        "description": "Full session, CSRF and allowed Origin required. Account ownership is enforced. Response is no-store.",
        "security": [
          {
            "cookieSession": [],
            "csrfToken": []
          }
        ],
        "parameters": [
          {
            "name": "grantId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^oag_[A-Za-z0-9_-]{8,}$"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Authorization revoked"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      }
    },
    "/health": {
      "get": {
        "operationId": "getHealth",
        "tags": [
          "System"
        ],
        "summary": "Service health",
        "security": [],
        "responses": {
          "200": {
            "description": "Healthy",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Health"
                }
              }
            }
          }
        }
      }
    },
    "/status": {
      "get": {
        "operationId": "getPublicStatus",
        "tags": [
          "System"
        ],
        "summary": "Read the public component status summary",
        "security": [],
        "responses": {
          "200": {
            "description": "Public status summary",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/CacheControlPublic"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicStatus"
                }
              }
            }
          }
        }
      }
    },
    "/catalog/sources": {
      "get": {
        "operationId": "listPublicDataSources",
        "tags": [
          "Catalog"
        ],
        "summary": "List public source capabilities without account-specific pricing",
        "security": [],
        "responses": {
          "200": {
            "description": "Public source catalog",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/CacheControlPublic"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/DataSource"
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/plans": {
      "get": {
        "operationId": "listPlans",
        "tags": [
          "Catalog"
        ],
        "summary": "List public USD plans and prices",
        "security": [],
        "responses": {
          "200": {
            "description": "Public plan catalog",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/CacheControlPublic"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PlanCatalog"
                }
              }
            }
          }
        }
      }
    },
    "/legal/current": {
      "get": {
        "operationId": "getCurrentLegalVersions",
        "tags": [
          "Catalog"
        ],
        "summary": "Read the current Terms and Privacy versions required for signup",
        "security": [],
        "responses": {
          "200": {
            "description": "Current legal version catalog",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/CacheControlPublic"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicLegalVersions"
                }
              }
            }
          }
        }
      }
    },
    "/auth/register": {
      "post": {
        "operationId": "register",
        "tags": [
          "Auth"
        ],
        "summary": "Create a pending FlashData account",
        "description": "The submitted Terms and Privacy versions must match the current published legal bundle.",
        "security": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RegisterRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Account created; email verification required",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/CacheControlNoStore"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RegisterResponse"
                }
              }
            }
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/auth/login": {
      "post": {
        "operationId": "login",
        "tags": [
          "Auth"
        ],
        "summary": "Create an opaque Web session",
        "description": "Sets the Secure, HttpOnly `__Host-fd_session` cookie. Pending accounts\nreceive a restricted email_verification Session for the verification dashboard.\nEligible verified accounts receive their one-time Trial Credits on login if not already granted.\nAn active account\nreceives a full Session unless its migrated identity still requires a\ncurrent legal acceptance, in which case it receives a restricted\nlegal_acceptance Session. An account with a scheduled deletion request\nreceives a restricted deletion_recovery Session. Accounts whose deletion\nis processing/failed/completed, and suspended accounts, receive 403.\n",
        "security": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LoginRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Authenticated",
            "headers": {
              "Set-Cookie": {
                "$ref": "#/components/headers/SessionCookie"
              },
              "Cache-Control": {
                "$ref": "#/components/headers/CacheControlNoStore"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LoginResponse"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/LoginForbidden"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "423": {
            "$ref": "#/components/responses/AccountLocked"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/auth/logout": {
      "post": {
        "operationId": "logout",
        "tags": [
          "Auth"
        ],
        "summary": "Revoke the current session",
        "x-session-modes": [
          "full",
          "email_verification",
          "legal_acceptance",
          "deletion_recovery"
        ],
        "security": [
          {
            "cookieSession": [],
            "csrfToken": []
          }
        ],
        "responses": {
          "204": {
            "description": "Session revoked and cookie cleared",
            "headers": {
              "Set-Cookie": {
                "$ref": "#/components/headers/ClearedSessionCookie"
              },
              "Cache-Control": {
                "$ref": "#/components/headers/CacheControlNoStore"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        }
      }
    },
    "/auth/me": {
      "get": {
        "operationId": "getCurrentAccount",
        "tags": [
          "Auth"
        ],
        "summary": "Read the current account and user",
        "x-session-modes": [
          "full",
          "email_verification",
          "legal_acceptance",
          "deletion_recovery"
        ],
        "security": [
          {
            "cookieSession": []
          }
        ],
        "responses": {
          "200": {
            "description": "Current account",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/CacheControlNoStore"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Account"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      }
    },
    "/auth/csrf": {
      "get": {
        "operationId": "getCsrfToken",
        "tags": [
          "Auth"
        ],
        "summary": "Get the CSRF token bound to the current session",
        "x-session-modes": [
          "full",
          "email_verification",
          "legal_acceptance",
          "deletion_recovery"
        ],
        "security": [
          {
            "cookieSession": []
          }
        ],
        "responses": {
          "200": {
            "description": "CSRF token",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/CacheControlNoStore"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "csrfToken"
                  ],
                  "properties": {
                    "csrfToken": {
                      "type": "string",
                      "minLength": 32,
                      "readOnly": true
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      }
    },
    "/auth/email-verifications": {
      "post": {
        "operationId": "requestEmailVerification",
        "tags": [
          "Auth"
        ],
        "summary": "Request or resend an email verification message",
        "description": "For every syntactically valid email, returns the same response regardless of whether the account is missing, pending, active, suspended, or deleted. Eligible pending accounts receive a rotated one-time link after the resend cooldown.",
        "security": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "email"
                ],
                "properties": {
                  "email": {
                    "type": "string",
                    "format": "email",
                    "maxLength": 320
                  }
                }
              }
            }
          }
        },
        "responses": {
          "202": {
            "$ref": "#/components/responses/AcceptedGeneric"
          },
          "422": {
            "$ref": "#/components/responses/AnonymousValidationError"
          },
          "429": {
            "$ref": "#/components/responses/AnonymousRateLimited"
          },
          "500": {
            "$ref": "#/components/responses/AnonymousInternalError"
          },
          "503": {
            "$ref": "#/components/responses/AnonymousServiceUnavailable"
          }
        }
      }
    },
    "/auth/email-verifications/confirm": {
      "post": {
        "operationId": "confirmEmailVerification",
        "tags": [
          "Auth"
        ],
        "summary": "Verify an email and activate the account",
        "description": "Atomically consumes the one-time token and activates the Account and User. Existing account and trial-credit rules apply. Without a signup Session the user logs in explicitly. An allowed-origin request carrying the matching signup Session and its X-CSRF-Token may receive a rotated Session cookie for the same verified account; a verification token alone never signs in a user.",
        "security": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TokenRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Account activated",
            "headers": {
              "Set-Cookie": {
                "$ref": "#/components/headers/SessionCookie"
              },
              "Cache-Control": {
                "$ref": "#/components/headers/CacheControlNoStore"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Account"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "status": {
                          "const": "active"
                        },
                        "emailVerified": {
                          "const": true
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "410": {
            "$ref": "#/components/responses/TokenExpired"
          },
          "422": {
            "$ref": "#/components/responses/AnonymousValidationError"
          },
          "429": {
            "$ref": "#/components/responses/AnonymousRateLimited"
          },
          "500": {
            "$ref": "#/components/responses/AnonymousInternalError"
          },
          "503": {
            "$ref": "#/components/responses/AnonymousServiceUnavailable"
          }
        }
      }
    },
    "/auth/email-verifications/session": {
      "post": {
        "operationId": "resumeEmailVerificationSession",
        "tags": [
          "Auth"
        ],
        "summary": "Continue the original signup session after email verification",
        "description": "Requires an allowed Origin and the CSRF token bound to a live password-authenticated email-verification Session. Returns pending until that Session's own account is verified, including verification in another browser. Atomically revokes the signup Session and issues a fresh full or legal-acceptance Session. Does not accept an account ID, email, password or verification token, bypass legal acceptance, or grant credits.",
        "x-session-modes": [
          "email_verification"
        ],
        "security": [
          {
            "cookieSession": [],
            "csrfToken": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Signup Session rotated",
            "headers": {
              "Set-Cookie": {
                "$ref": "#/components/headers/SessionCookie"
              },
              "Cache-Control": {
                "$ref": "#/components/headers/CacheControlNoStore"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LoginResponse"
                }
              }
            }
          },
          "202": {
            "description": "Email verification is pending; no new Session",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/CacheControlNoStore"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "pending"
                  ],
                  "additionalProperties": false,
                  "properties": {
                    "pending": {
                      "type": "boolean",
                      "const": true
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        }
      }
    },
    "/auth/password-resets": {
      "post": {
        "operationId": "requestPasswordReset",
        "tags": [
          "Auth"
        ],
        "summary": "Request a password reset email",
        "description": "Always returns the same 202 response for a syntactically valid email regardless of account existence or lifecycle state. Only eligible active or locked identities receive mail.",
        "security": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "email"
                ],
                "properties": {
                  "email": {
                    "type": "string",
                    "format": "email",
                    "maxLength": 320
                  }
                }
              }
            }
          }
        },
        "responses": {
          "202": {
            "$ref": "#/components/responses/AcceptedGeneric"
          },
          "422": {
            "$ref": "#/components/responses/AnonymousValidationError"
          },
          "429": {
            "$ref": "#/components/responses/AnonymousRateLimited"
          },
          "500": {
            "$ref": "#/components/responses/AnonymousInternalError"
          },
          "503": {
            "$ref": "#/components/responses/AnonymousServiceUnavailable"
          }
        }
      }
    },
    "/auth/password-resets/confirm": {
      "post": {
        "operationId": "confirmPasswordReset",
        "tags": [
          "Auth"
        ],
        "summary": "Set a new password and revoke existing sessions",
        "description": "Atomically consumes the password-reset token, stores a new Argon2id credential, revokes every existing Session, and invalidates other password-reset tokens. It does not log the user in or create a Session.",
        "security": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "token",
                  "password"
                ],
                "properties": {
                  "token": {
                    "type": "string",
                    "minLength": 32,
                    "maxLength": 256,
                    "writeOnly": true
                  },
                  "password": {
                    "$ref": "#/components/schemas/Password"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "204": {
            "description": "Password updated; existing sessions revoked",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/CacheControlNoStore"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "410": {
            "$ref": "#/components/responses/TokenExpired"
          },
          "422": {
            "$ref": "#/components/responses/AnonymousValidationError"
          },
          "429": {
            "$ref": "#/components/responses/AnonymousRateLimited"
          },
          "500": {
            "$ref": "#/components/responses/AnonymousInternalError"
          },
          "503": {
            "$ref": "#/components/responses/AnonymousServiceUnavailable"
          }
        }
      }
    },
    "/auth/sessions": {
      "get": {
        "operationId": "listSessions",
        "tags": [
          "Auth"
        ],
        "summary": "List active sessions for the current user",
        "security": [
          {
            "cookieSession": []
          }
        ],
        "responses": {
          "200": {
            "description": "Sessions",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/CacheControlNoStore"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Session"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      },
      "delete": {
        "operationId": "revokeOtherSessions",
        "tags": [
          "Auth"
        ],
        "summary": "Revoke all sessions except the current one",
        "security": [
          {
            "cookieSession": [],
            "csrfToken": []
          }
        ],
        "responses": {
          "204": {
            "description": "Other sessions revoked",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/CacheControlNoStore"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        }
      }
    },
    "/auth/sessions/{sessionId}": {
      "delete": {
        "operationId": "revokeSession",
        "tags": [
          "Auth"
        ],
        "summary": "Revoke one session",
        "security": [
          {
            "cookieSession": [],
            "csrfToken": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/SessionId"
          }
        ],
        "responses": {
          "204": {
            "description": "Session revoked. If it was the current Session, the cookie is cleared.",
            "headers": {
              "Set-Cookie": {
                "$ref": "#/components/headers/ClearedSessionCookie"
              },
              "Cache-Control": {
                "$ref": "#/components/headers/CacheControlNoStore"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/auth/re-authenticate": {
      "post": {
        "operationId": "reauthenticateSession",
        "tags": [
          "Auth"
        ],
        "summary": "Verify the current password for a sensitive operation",
        "description": "Records a short-lived recent-auth proof on the current server-side session.",
        "x-session-modes": [
          "full",
          "email_verification",
          "legal_acceptance",
          "deletion_recovery"
        ],
        "security": [
          {
            "cookieSession": [],
            "csrfToken": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "password"
                ],
                "properties": {
                  "password": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 128,
                    "writeOnly": true
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Session has recent authentication",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/CacheControlNoStore"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Reauthentication"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/auth/password": {
      "patch": {
        "operationId": "changePassword",
        "tags": [
          "Auth"
        ],
        "summary": "Change the password and rotate the current session",
        "x-requires-recent-auth": true,
        "security": [
          {
            "cookieSession": [],
            "csrfToken": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "currentPassword",
                  "newPassword"
                ],
                "properties": {
                  "currentPassword": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 128,
                    "writeOnly": true
                  },
                  "newPassword": {
                    "$ref": "#/components/schemas/Password"
                  },
                  "revokeOtherSessions": {
                    "type": "boolean",
                    "default": true
                  }
                }
              }
            }
          }
        },
        "responses": {
          "204": {
            "description": "Password changed; current session rotated and other sessions revoked when requested",
            "headers": {
              "Set-Cookie": {
                "$ref": "#/components/headers/SessionCookie"
              },
              "Cache-Control": {
                "$ref": "#/components/headers/CacheControlNoStore"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          }
        }
      }
    },
    "/account": {
      "get": {
        "operationId": "getAccount",
        "tags": [
          "Account"
        ],
        "summary": "Read account settings",
        "security": [
          {
            "cookieSession": []
          }
        ],
        "responses": {
          "200": {
            "description": "Account",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Account"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      },
      "patch": {
        "operationId": "updateAccount",
        "tags": [
          "Account"
        ],
        "summary": "Update profile settings",
        "security": [
          {
            "cookieSession": [],
            "csrfToken": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateAccountRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated account",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Account"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          }
        }
      },
      "delete": {
        "operationId": "deleteAccount",
        "tags": [
          "Account"
        ],
        "summary": "Schedule account deletion and revoke all existing sessions and API Keys",
        "description": "Administrator accounts must have their platform role revoked through the audited operator workflow before deletion can be scheduled. A unique active deletion request is the natural idempotency boundary. Concurrent authenticated schedules return the same request. After Session revocation, a lost response is recovered by logging into deletion_recovery mode and reading GET /account/deletion; revoked Sessions are never accepted for replay.",
        "security": [
          {
            "cookieSession": [],
            "csrfToken": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "password",
                  "confirmation"
                ],
                "properties": {
                  "password": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 128,
                    "writeOnly": true
                  },
                  "confirmation": {
                    "type": "string",
                    "const": "DELETE"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Deletion scheduled; active sessions and keys revoked",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AccountDeletionRequest"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          }
        }
      }
    },
    "/account/deletion": {
      "get": {
        "operationId": "getAccountDeletion",
        "tags": [
          "Account"
        ],
        "summary": "Read the current account deletion request",
        "x-session-modes": [
          "deletion_recovery"
        ],
        "security": [
          {
            "cookieSession": []
          }
        ],
        "responses": {
          "200": {
            "description": "Current deletion request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AccountDeletionRequest"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      },
      "delete": {
        "operationId": "cancelAccountDeletion",
        "tags": [
          "Account"
        ],
        "summary": "Cancel a scheduled deletion during the grace period",
        "description": "Uses a scheduled-to-cancelled compare-and-set. A processor race returns 409; after success the recovery Session is rotated and cannot replay the old transition.",
        "x-requires-recent-auth": true,
        "x-session-modes": [
          "deletion_recovery"
        ],
        "security": [
          {
            "cookieSession": [],
            "csrfToken": []
          }
        ],
        "responses": {
          "204": {
            "description": "Deletion cancelled, account reactivated, and recovery Session rotated according to the legal-acceptance gate",
            "headers": {
              "Set-Cookie": {
                "$ref": "#/components/headers/SessionCookie"
              },
              "Cache-Control": {
                "$ref": "#/components/headers/CacheControlNoStore"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        }
      }
    },
    "/account/legal-acceptances": {
      "post": {
        "operationId": "acceptCurrentLegalTerms",
        "tags": [
          "Account"
        ],
        "summary": "Accept the currently published Terms and Privacy versions",
        "description": "Appends an immutable legal acceptance, clears the migration gate, and rotates the Session. Stale submitted versions are rejected.",
        "x-session-modes": [
          "legal_acceptance"
        ],
        "security": [
          {
            "cookieSession": [],
            "csrfToken": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LegalAcceptanceRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Legal acceptance recorded and Session rotated to full mode",
            "headers": {
              "Set-Cookie": {
                "$ref": "#/components/headers/SessionCookie"
              },
              "Cache-Control": {
                "$ref": "#/components/headers/CacheControlNoStore"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LoginResponse"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          }
        }
      }
    },
    "/onboarding": {
      "get": {
        "operationId": "getOnboardingProgress",
        "tags": [
          "Onboarding"
        ],
        "summary": "Read resumable onboarding progress",
        "security": [
          {
            "cookieSession": []
          }
        ],
        "responses": {
          "200": {
            "description": "Current onboarding state",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/CacheControlNoStore"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OnboardingProgress"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/NoStoreUnauthorized"
          },
          "500": {
            "$ref": "#/components/responses/NoStoreInternalError"
          },
          "503": {
            "$ref": "#/components/responses/NoStoreServiceUnavailable"
          }
        }
      },
      "patch": {
        "operationId": "updateOnboardingProgress",
        "tags": [
          "Onboarding"
        ],
        "summary": "Advance onboarding without allowing progress to move backward",
        "security": [
          {
            "cookieSession": [],
            "csrfToken": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateOnboardingRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated onboarding state",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/CacheControlNoStore"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OnboardingProgress"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/NoStoreUnauthorized"
          },
          "403": {
            "$ref": "#/components/responses/NoStoreForbidden"
          },
          "409": {
            "$ref": "#/components/responses/NoStoreConflict"
          },
          "422": {
            "$ref": "#/components/responses/NoStoreValidationError"
          },
          "500": {
            "$ref": "#/components/responses/NoStoreInternalError"
          },
          "503": {
            "$ref": "#/components/responses/NoStoreServiceUnavailable"
          }
        }
      }
    },
    "/overview": {
      "get": {
        "operationId": "getConsoleOverview",
        "tags": [
          "Overview"
        ],
        "summary": "Read the account dashboard aggregate",
        "security": [
          {
            "cookieSession": []
          }
        ],
        "responses": {
          "200": {
            "description": "Account-scoped overview",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/CacheControlNoStore"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConsoleOverview"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/NoStoreUnauthorized"
          },
          "500": {
            "$ref": "#/components/responses/NoStoreInternalError"
          },
          "503": {
            "$ref": "#/components/responses/NoStoreServiceUnavailable"
          }
        }
      }
    },
    "/trial-credit-request": {
      "get": {
        "operationId": "getTrialCreditRequest",
        "tags": [
          "Trial Credits"
        ],
        "summary": "Read Trial Credit eligibility and the account's lifetime request",
        "security": [
          {
            "cookieSession": []
          }
        ],
        "responses": {
          "200": {
            "description": "Current eligibility, configured grant, and request state",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/CacheControlNoStore"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TrialCreditState"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/NoStoreUnauthorized"
          },
          "500": {
            "$ref": "#/components/responses/NoStoreInternalError"
          },
          "503": {
            "$ref": "#/components/responses/NoStoreServiceUnavailable"
          }
        }
      },
      "post": {
        "operationId": "createTrialCreditRequest",
        "tags": [
          "Trial Credits"
        ],
        "summary": "Submit the account's one lifetime Trial Credit request",
        "description": "The trial amount and use case are saved when you submit the request.",
        "security": [
          {
            "cookieSession": [],
            "csrfToken": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Trial Credit request created and automatically approved for eligible verified accounts, regardless of email provider",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/CacheControlNoStore"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TrialCreditState"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/NoStoreUnauthorized"
          },
          "403": {
            "$ref": "#/components/responses/NoStoreForbidden"
          },
          "409": {
            "$ref": "#/components/responses/NoStoreConflict"
          },
          "422": {
            "$ref": "#/components/responses/NoStoreValidationError"
          },
          "500": {
            "$ref": "#/components/responses/NoStoreInternalError"
          },
          "503": {
            "$ref": "#/components/responses/NoStoreServiceUnavailable"
          }
        }
      }
    },
    "/api-keys": {
      "get": {
        "operationId": "listApiKeys",
        "tags": [
          "API Keys"
        ],
        "summary": "List API Key metadata",
        "security": [
          {
            "cookieSession": []
          }
        ],
        "responses": {
          "200": {
            "description": "API Keys without secrets",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/ApiKey"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      },
      "post": {
        "operationId": "createApiKey",
        "tags": [
          "API Keys"
        ],
        "summary": "Create an API Key and reveal its secret once",
        "security": [
          {
            "cookieSession": [],
            "csrfToken": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateApiKeyRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created; the same idempotent replay may return the same encrypted response for five minutes",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiKeyCreated"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/api-keys/{keyId}": {
      "delete": {
        "operationId": "revokeApiKey",
        "tags": [
          "API Keys"
        ],
        "summary": "Revoke an API Key",
        "security": [
          {
            "cookieSession": [],
            "csrfToken": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/KeyId"
          }
        ],
        "responses": {
          "204": {
            "description": "Revoked"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/api-keys/{keyId}/rotate": {
      "post": {
        "operationId": "rotateApiKey",
        "tags": [
          "API Keys"
        ],
        "summary": "Create a replacement key and schedule old-key revocation",
        "description": "Creates a new key and keeps the old key active until revokeOldAt. By default, the overlap lasts 24 hours or until the old key expires, whichever is earlier. A custom revokeOldAt must be in the future, within seven days, and no later than the old key expiry.",
        "security": [
          {
            "cookieSession": [],
            "csrfToken": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/KeyId"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "revokeOldAt": {
                    "type": "string",
                    "format": "date-time",
                    "description": "Optional old-key revocation time; defaults to 24 hours and cannot exceed seven days or the old key expiry."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Replacement created; secret returned once",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiKeyCreated"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/billing/subscription": {
      "get": {
        "operationId": "getSubscription",
        "tags": [
          "Billing"
        ],
        "summary": "Read the effective Stripe subscription",
        "security": [
          {
            "cookieSession": []
          }
        ],
        "responses": {
          "200": {
            "description": "Subscription or PAYG entitlement",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Subscription"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      }
    },
    "/billing/checkout-sessions": {
      "post": {
        "operationId": "createCheckoutSession",
        "tags": [
          "Billing"
        ],
        "summary": "Create a Stripe-hosted Checkout Session",
        "description": "Subscriptions and published credit packs use priceId. A custom top-up uses amountMinor instead (USD cents, $10 to $999,999.99); the server calculates credits at the fixed credit value and creates a private one-time Stripe price. Product, provider price, currency, success URL and cancel URL are never accepted from the browser. Credits are granted only after a verified paid event for the quoted amount.",
        "security": [
          {
            "cookieSession": [],
            "csrfToken": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "object",
                    "additionalProperties": false,
                    "required": [
                      "priceId"
                    ],
                    "properties": {
                      "priceId": {
                        "type": "string",
                        "pattern": "^prc_"
                      },
                      "purchaseType": {
                        "type": "string",
                        "enum": [
                          "subscription",
                          "top_up"
                        ],
                        "default": "subscription"
                      }
                    }
                  },
                  {
                    "type": "object",
                    "additionalProperties": false,
                    "required": [
                      "amountMinor",
                      "purchaseType"
                    ],
                    "properties": {
                      "amountMinor": {
                        "type": "integer",
                        "minimum": 1000,
                        "maximum": 99999999,
                        "description": "Custom top-up amount in USD cents."
                      },
                      "purchaseType": {
                        "type": "string",
                        "const": "top_up"
                      }
                    }
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Stripe Checkout Session",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HostedSession"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "502": {
            "$ref": "#/components/responses/UpstreamError"
          },
          "503": {
            "$ref": "#/components/responses/BillingUnavailable"
          }
        }
      }
    },
    "/billing/subscription-changes": {
      "post": {
        "operationId": "createSubscriptionChange",
        "tags": [
          "Billing"
        ],
        "summary": "Upgrade the current Stripe subscription to a higher published price",
        "description": "The server verifies that the FlashData price is active, available in the current livemode, USD-denominated, recurring, the same interval, and strictly more expensive than the current subscription price. Product, provider price, currency and proration options are never accepted from the browser. Local entitlement and credits change only after a verified provider event is projected.",
        "security": [
          {
            "cookieSession": [],
            "csrfToken": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "priceId"
                ],
                "properties": {
                  "priceId": {
                    "type": "string",
                    "pattern": "^prc_"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Subscription change submitted to Stripe",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SubscriptionChange"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "502": {
            "$ref": "#/components/responses/UpstreamError"
          },
          "503": {
            "$ref": "#/components/responses/BillingUnavailable"
          }
        }
      }
    },
    "/billing/portal-sessions": {
      "post": {
        "operationId": "createBillingPortalSession",
        "tags": [
          "Billing"
        ],
        "summary": "Create a Stripe Customer Portal Session",
        "security": [
          {
            "cookieSession": [],
            "csrfToken": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "responses": {
          "201": {
            "description": "Stripe Customer Portal Session",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HostedSession"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "502": {
            "$ref": "#/components/responses/UpstreamError"
          },
          "503": {
            "$ref": "#/components/responses/BillingUnavailable"
          }
        }
      }
    },
    "/billing/subscription-cancellation": {
      "post": {
        "operationId": "setSubscriptionCancellation",
        "tags": [
          "Billing"
        ],
        "summary": "Schedule or undo cancellation of the current paid subscription",
        "description": "Setting cancelAtPeriodEnd to true schedules cancellation at the current billing period end; false keeps the subscription. Entitlements update after a verified Stripe subscription event. This endpoint never cancels immediately or issues a refund.",
        "security": [
          {
            "cookieSession": [],
            "csrfToken": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "cancelAtPeriodEnd"
                ],
                "properties": {
                  "cancelAtPeriodEnd": {
                    "type": "boolean"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Cancellation update submitted to Stripe",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SubscriptionCancellationChange"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "502": {
            "$ref": "#/components/responses/UpstreamError"
          },
          "503": {
            "$ref": "#/components/responses/BillingUnavailable"
          }
        }
      }
    },
    "/billing/invoices": {
      "get": {
        "operationId": "listInvoices",
        "tags": [
          "Billing"
        ],
        "summary": "List Stripe invoice projections",
        "security": [
          {
            "cookieSession": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/Cursor"
          },
          {
            "$ref": "#/components/parameters/Limit"
          }
        ],
        "responses": {
          "200": {
            "description": "Invoices",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Page"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/Invoice"
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      }
    },
    "/billing/payments": {
      "get": {
        "operationId": "listBillingPayments",
        "tags": [
          "Billing"
        ],
        "summary": "List account-scoped top-up and refund payment projections",
        "security": [
          {
            "cookieSession": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/Cursor"
          },
          {
            "$ref": "#/components/parameters/Limit"
          }
        ],
        "responses": {
          "200": {
            "description": "One-time payment history without provider secrets",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BillingPaymentPage"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      }
    },
    "/api-access": {
      "get": {
        "operationId": "getApiAccess",
        "tags": [
          "API Keys"
        ],
        "summary": "Read the calling API key's authorized sources and result origin",
        "description": "Free, header-only X-API-Key authentication. Returns only granted public\nsource names and the configured signed-result storage origin (null if\nunavailable). No account ID, key ID, secret or storage credentials are returned.\nLocal MCP revalidates this endpoint before every tool discovery and call,\nincluding cached result reads. No query parameters or request body are accepted.\nAll /api-access routes share 120 requests per minute per client IP and return\nCache-Control private, no-store. Normal key last-used tracking still occurs.\n",
        "security": [
          {
            "dataApiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "Authorized public sources and result origin",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiAccess"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "description": "Too many account reads; retry after the rate-limit window"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/api-access/balance": {
      "get": {
        "operationId": "getApiAccessBalance",
        "tags": [
          "Credits"
        ],
        "summary": "Read the live account balance using an API key",
        "description": "Read the current credit balance shared by all API keys in your account. Active reservations can reduce the available balance. This request costs no Credits and takes no query parameters or body. Responses are private and are not cached; account-read rate limits apply.",
        "security": [
          {
            "dataApiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "Signed balance and nonnegative available Credits",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiAccessBalance"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "description": "Too many account reads; retry after the rate-limit window"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/api-access/pricing": {
      "get": {
        "operationId": "getApiAccessPricing",
        "tags": [
          "Credits"
        ],
        "summary": "Read actual account prices for sources authorized by the API key",
        "description": "Read your account rates for sources allowed by the API key. A null price means that source is unavailable. request_count counts queries, not returned items; download rates are per TB (10^12 bytes). Estimates do not reserve Credits or capacity. This request costs no Credits. Responses are private and are not cached; account-read rate limits apply.",
        "security": [
          {
            "dataApiKey": []
          }
        ],
        "parameters": [
          {
            "name": "source",
            "in": "query",
            "description": "A source granted to this key; omit to read all granted sources.",
            "schema": {
              "$ref": "#/components/schemas/ApiAccessSource"
            }
          },
          {
            "name": "request_count",
            "in": "query",
            "description": "Decimal integer number of calls; does not estimate download size.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100000,
              "default": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Account plan and source-specific prices",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiAccessPricing"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "description": "Too many account reads; retry after the rate-limit window"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/api-access/limits": {
      "get": {
        "operationId": "getApiAccessLimits",
        "tags": [
          "Credits"
        ],
        "summary": "Read account plan limits and current pending jobs using an API key",
        "description": "Read your concurrency, batch-size and pending-job limits, plus the current pending count. These values help plan requests but do not reserve capacity. This request costs no Credits and takes no query parameters or body. Responses are private and are not cached; account-read rate limits apply.",
        "security": [
          {
            "dataApiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "Plan ceilings and current pending count",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiAccessLimits"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "description": "Too many account reads; retry after the rate-limit window"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/usage": {
      "get": {
        "operationId": "getApiKeyUsage",
        "tags": [
          "Credits"
        ],
        "summary": "Read account usage for sources authorized by the API key",
        "description": "Free read, authenticated only by X-API-Key. Includes all account keys but\nonly sources granted to the calling key. Does not return query text, keys,\npayment details or other accounts. Defaults to seven days; maximum 31 days.\nDates must use UTC Z timestamps. From is inclusive and to exclusive;\nboth are rounded down to minutes. With from alone, to defaults to from + 7 days.\nWith neither, to is the start of the next minute. Aggregates are eventually\nconsistent; even updating=false does not guarantee all recent events are ingested.\nRead limit: 60 requests per minute per client IP.\n",
        "security": [
          {
            "dataApiKey": []
          }
        ],
        "parameters": [
          {
            "name": "source",
            "in": "query",
            "description": "An exact catalog source granted to the calling key; omitted means all granted sources.",
            "schema": {
              "type": "string",
              "enum": [
                "google_search",
                "google_images",
                "google_news",
                "google_shopping",
                "google_videos",
                "google_places",
                "youtube_search",
                "youtube_search_extended",
                "youtube_metadata",
                "youtube_transcript",
                "youtube_captions",
                "youtube_trainability",
                "youtube_channel",
                "youtube_suggestions",
                "youtube_download"
              ]
            }
          },
          {
            "name": "from",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "to",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Scoped request counts and charged Credits, with freshness information",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiKeyUsage"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "description": "Too many usage reads; retry after the rate-limit window"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/credits/balance": {
      "get": {
        "operationId": "getCreditBalance",
        "tags": [
          "Credits"
        ],
        "summary": "Read current available and reserved credits",
        "security": [
          {
            "cookieSession": []
          }
        ],
        "responses": {
          "200": {
            "description": "Credit balance",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreditBalance"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      }
    },
    "/credits/policy": {
      "get": {
        "operationId": "getCreditPolicy",
        "tags": [
          "Credits"
        ],
        "summary": "Read the effective account credit grant and charging policy",
        "security": [
          {
            "cookieSession": []
          }
        ],
        "responses": {
          "200": {
            "description": "Effective credit policy",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreditPolicy"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      }
    },
    "/credits/transactions": {
      "get": {
        "operationId": "listCreditTransactions",
        "tags": [
          "Credits"
        ],
        "summary": "List credit ledger entries",
        "security": [
          {
            "cookieSession": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/Cursor"
          },
          {
            "$ref": "#/components/parameters/Limit"
          },
          {
            "name": "type",
            "in": "query",
            "schema": {
              "$ref": "#/components/schemas/CreditEntryType"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Ledger entries",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Page"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/CreditTransaction"
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      }
    },
    "/delivery/webhooks": {
      "get": {
        "operationId": "listDeliveryWebhooks",
        "tags": [
          "Delivery"
        ],
        "summary": "List saved completion callback URLs",
        "security": [
          {
            "cookieSession": []
          }
        ],
        "responses": {
          "200": {
            "description": "Callback URLs",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/DeliveryWebhook"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      },
      "post": {
        "operationId": "createDeliveryWebhook",
        "tags": [
          "Delivery"
        ],
        "summary": "Save a completion callback URL",
        "security": [
          {
            "cookieSession": [],
            "csrfToken": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateDeliveryWebhookRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "webhook"
                  ],
                  "properties": {
                    "webhook": {
                      "$ref": "#/components/schemas/DeliveryWebhook"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          }
        }
      }
    },
    "/delivery/webhooks/{webhookId}": {
      "delete": {
        "operationId": "deleteDeliveryWebhook",
        "tags": [
          "Delivery"
        ],
        "summary": "Remove a completion callback URL",
        "security": [
          {
            "cookieSession": [],
            "csrfToken": []
          }
        ],
        "parameters": [
          {
            "name": "webhookId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^cbk_[A-Za-z0-9_-]{8,}$"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Removed"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      }
    },
    "/delivery/webhooks/{webhookId}/test": {
      "post": {
        "operationId": "testDeliveryWebhook",
        "tags": [
          "Delivery"
        ],
        "summary": "Send a sample download-complete payload",
        "security": [
          {
            "cookieSession": [],
            "csrfToken": []
          }
        ],
        "parameters": [
          {
            "name": "webhookId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^cbk_[A-Za-z0-9_-]{8,}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Test attempted",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "statusCode",
                    "webhook"
                  ],
                  "properties": {
                    "statusCode": {
                      "type": "integer",
                      "minimum": 0
                    },
                    "webhook": {
                      "$ref": "#/components/schemas/DeliveryWebhook"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      }
    },
    "/playground/run": {
      "post": {
        "operationId": "runPlaygroundQuery",
        "tags": [
          "Playground"
        ],
        "summary": "Run a playground query as the current workspace",
        "security": [
          {
            "cookieSession": [],
            "csrfToken": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "source",
                  "mode",
                  "query"
                ],
                "properties": {
                  "source": {
                    "type": "string"
                  },
                  "mode": {
                    "type": "string",
                    "enum": [
                      "realtime",
                      "async",
                      "batch"
                    ]
                  },
                  "query": {
                    "description": "Source request body. In batch mode, also accepts an object containing only queries, an array of 1 to 20 request bodies. Every entry must match the selected source and its input schema. Search and Suggestions require query; Channel requires handle; Metadata, Transcript, Captions, Trainability and Download require an 11-character video_id matching [A-Za-z0-9_-]. Download batch entries must supply params.storage for customer storage; console browser delivery is not supported in this envelope. Account batch and pending-job limits still apply.",
                    "type": "object",
                    "additionalProperties": true
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Upstream Data API response captured for the playground",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "body",
                    "endpoint",
                    "mode",
                    "status"
                  ],
                  "properties": {
                    "body": {},
                    "endpoint": {
                      "type": "string",
                      "enum": [
                        "/v1/queries",
                        "/v1/queries/batch",
                        "/v1/queries/realtime"
                      ]
                    },
                    "mode": {
                      "type": "string",
                      "enum": [
                        "realtime",
                        "async",
                        "batch"
                      ]
                    },
                    "status": {
                      "type": "integer",
                      "minimum": 100,
                      "maximum": 599
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          }
        }
      }
    },
    "/playground/jobs/{jobId}/download": {
      "get": {
        "operationId": "downloadPlaygroundJob",
        "tags": [
          "Playground"
        ],
        "summary": "Download a completed Playground artifact in the current browser",
        "security": [
          {
            "cookieSession": []
          }
        ],
        "parameters": [
          {
            "in": "path",
            "name": "jobId",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^job_[A-Za-z0-9_-]+$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Temporary browser-download artifact",
            "headers": {
              "Content-Disposition": {
                "schema": {
                  "type": "string"
                }
              },
              "Content-Length": {
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/octet-stream": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "410": {
            "description": "The temporary artifact has expired",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/jobs": {
      "get": {
        "operationId": "listConsoleJobs",
        "tags": [
          "Jobs"
        ],
        "summary": "List Data API jobs for the current workspace",
        "description": "Cursor-paginated active and archived history. Defaults to the last seven days; each UTC date range is limited to 31 days. From is inclusive and to is exclusive, at minute precision. Summaries are maintained asynchronously and may lag ingestion.",
        "security": [
          {
            "cookieSession": []
          }
        ],
        "parameters": [
          {
            "name": "cursor",
            "in": "query",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 512
            }
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 50
            }
          },
          {
            "name": "source",
            "in": "query",
            "schema": {
              "type": "string",
              "pattern": "^(google|youtube|google_[a-z]+|youtube_[a-z_]+)$"
            }
          },
          {
            "name": "status",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "completed",
                "failed",
                "pending",
                "processing"
              ]
            }
          },
          {
            "name": "mode",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "async",
                "batch",
                "realtime"
              ]
            }
          },
          {
            "name": "from",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "to",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Job page",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "data",
                    "pagination",
                    "summary"
                  ],
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/ConsoleJob"
                      }
                    },
                    "pagination": {
                      "$ref": "#/components/schemas/Pagination"
                    },
                    "summary": {
                      "type": [
                        "object",
                        "null"
                      ],
                      "additionalProperties": false,
                      "required": [
                        "completed",
                        "credits",
                        "failed",
                        "total"
                      ],
                      "properties": {
                        "completed": {
                          "type": "integer",
                          "minimum": 0
                        },
                        "credits": {
                          "type": "number",
                          "minimum": 0
                        },
                        "failed": {
                          "type": "integer",
                          "minimum": 0
                        },
                        "total": {
                          "type": "integer",
                          "minimum": 0
                        },
                        "updating": {
                          "type": "boolean"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          }
        }
      }
    },
    "/jobs/{jobId}": {
      "get": {
        "operationId": "getConsoleJob",
        "tags": [
          "Jobs"
        ],
        "summary": "Read one Data API job",
        "description": "Read job.status to check progress and job.error if processing failed. JSON is the default; use Accept: text/plain for readable text. X-Respond-With is ignored here. Follow Retry-After when provided before checking again.",
        "security": [
          {
            "cookieSession": []
          },
          {
            "dataApiKey": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ResponseEnvelopeAccept"
          },
          {
            "name": "jobId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^job_[A-Za-z0-9_-]+$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Job detail",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "job"
                  ],
                  "properties": {
                    "job": {
                      "$ref": "#/components/schemas/ConsoleJob"
                    }
                  }
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                },
                "example": "Job:\n  Id: \"job_example\"\n  Source: \"google_search\"\n  Status: \"processing\"\n"
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "406": {
            "description": "Neither application/json nor text/plain is acceptable; response is JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/QueryRepresentationError"
                }
              }
            }
          }
        }
      }
    },
    "/bulk-jobs": {
      "get": {
        "operationId": "listBulkJobs",
        "tags": [
          "Bulk Jobs"
        ],
        "summary": "List bulk YouTube jobs",
        "security": [
          {
            "cookieSession": []
          },
          {
            "dataApiKey": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/Cursor"
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 50,
              "default": 20
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Bulk job page",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BulkJobPage"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      },
      "post": {
        "operationId": "createBulkJob",
        "tags": [
          "Bulk Jobs"
        ],
        "summary": "Create a Bulk job and get a file upload URL",
        "description": "Create a job, upload a UTF-8 text file with one 11-character YouTube video ID per line to upload.href, then call start. Creating the job alone does not begin processing.",
        "security": [
          {
            "cookieSession": [],
            "csrfToken": []
          },
          {
            "dataApiKey": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateBulkJobRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Bulk job created with a 15-minute direct upload URL",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BulkJobCreated"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/bulk-jobs/{bulkId}": {
      "get": {
        "operationId": "getBulkJob",
        "tags": [
          "Bulk Jobs"
        ],
        "summary": "Read bulk job progress and aggregate counts",
        "security": [
          {
            "cookieSession": []
          },
          {
            "dataApiKey": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/BulkId"
          }
        ],
        "responses": {
          "200": {
            "description": "Bulk job state",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BulkJobResponse"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      },
      "patch": {
        "operationId": "updateBulkJob",
        "tags": [
          "Bulk Jobs"
        ],
        "summary": "Change settings for videos that have not started",
        "description": "Update options while awaiting upload, or while paused before all input has been read. Existing jobs keep their settings. If pausing is still in progress, wait and retry a 409 response. After all input has been read, only delivery credentials can be updated. Set callback_url to null to remove it.",
        "security": [
          {
            "cookieSession": [],
            "csrfToken": []
          },
          {
            "dataApiKey": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/BulkId"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateBulkJobRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated bulk job state",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BulkJobResponse"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          }
        }
      },
      "delete": {
        "operationId": "cancelBulkJob",
        "tags": [
          "Bulk Jobs"
        ],
        "summary": "Cancel a Bulk job",
        "description": "Stop new submissions. Existing jobs can still finish and incur their normal charges. A cancelled job does not publish a final manifest.",
        "security": [
          {
            "cookieSession": [],
            "csrfToken": []
          },
          {
            "dataApiKey": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/BulkId"
          }
        ],
        "responses": {
          "200": {
            "description": "Current bulk job state",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BulkJobResponse"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      }
    },
    "/bulk-jobs/{bulkId}/start": {
      "post": {
        "operationId": "startBulkJob",
        "tags": [
          "Bulk Jobs"
        ],
        "summary": "Start scanning an uploaded YouTube ID file",
        "description": "Start processing the uploaded UTF-8 video ID file, up to 2 GiB (2147483648 bytes). Keep the file unchanged after starting.",
        "security": [
          {
            "cookieSession": [],
            "csrfToken": []
          },
          {
            "dataApiKey": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/BulkId"
          }
        ],
        "responses": {
          "200": {
            "description": "Bulk job started or its current idempotent state",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BulkJobResponse"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/bulk-jobs/{bulkId}/pause": {
      "post": {
        "operationId": "pauseBulkJob",
        "tags": [
          "Bulk Jobs"
        ],
        "summary": "Pause a Bulk job",
        "description": "Pause new submissions and result packaging. Existing jobs continue with their original settings and charges. Resume the job when ready.",
        "security": [
          {
            "cookieSession": [],
            "csrfToken": []
          },
          {
            "dataApiKey": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/BulkId"
          }
        ],
        "responses": {
          "200": {
            "description": "Paused bulk job or its current idempotent state",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BulkJobResponse"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      }
    },
    "/bulk-jobs/{bulkId}/resume": {
      "post": {
        "operationId": "resumeBulkJob",
        "tags": [
          "Bulk Jobs"
        ],
        "summary": "Resume a manually or automatically paused bulk job",
        "security": [
          {
            "cookieSession": [],
            "csrfToken": []
          },
          {
            "dataApiKey": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/BulkId"
          }
        ],
        "responses": {
          "200": {
            "description": "Current bulk job state",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BulkJobResponse"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      }
    },
    "/bulk-jobs/{bulkId}/results": {
      "get": {
        "operationId": "downloadBulkJobManifest",
        "tags": [
          "Bulk Jobs"
        ],
        "summary": "Download the completed bulk manifest",
        "description": "Follow the redirect to download the JSON manifest and use its links to retrieve result files. Fetch signed storage URLs without your API key. Results remain available for 24 hours after the entire Bulk job completes.",
        "security": [
          {
            "cookieSession": []
          },
          {
            "dataApiKey": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/BulkId"
          }
        ],
        "responses": {
          "200": {
            "description": "JSON manifest downloaded after following the redirect",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "302": {
            "$ref": "#/components/responses/BulkResultRedirect"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "410": {
            "$ref": "#/components/responses/Gone"
          }
        }
      }
    },
    "/bulk-jobs/{bulkId}/results/{partNumber}": {
      "get": {
        "operationId": "downloadBulkJobPart",
        "tags": [
          "Bulk Jobs"
        ],
        "summary": "Download one gzip-compressed NDJSON bulk result part",
        "security": [
          {
            "cookieSession": []
          },
          {
            "dataApiKey": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/BulkId"
          },
          {
            "name": "partNumber",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 0
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Gzip-compressed NDJSON downloaded after following the redirect",
            "content": {
              "application/x-ndjson": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "302": {
            "$ref": "#/components/responses/BulkResultRedirect"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "410": {
            "$ref": "#/components/responses/Gone"
          }
        }
      }
    },
    "/jobs/{jobId}/results": {
      "get": {
        "operationId": "downloadJobResult",
        "tags": [
          "Jobs"
        ],
        "summary": "Download a completed async result",
        "description": "By default, authenticates access and redirects to a short-lived private R2 URL; clients receive the original JSON directly from R2. Accept: text/plain independently returns HTTP 200 with the original result fields as indented plain text. X-Respond-With: markdown selects Markdown content: application/json wraps it in content alongside the original metadata, replacing results; text/plain returns metadata followed by Markdown. Missing Accept or a global wildcard defaults to JSON. Formatting does not submit another query or charge query credits. Stored results expire 24 hours after completion. Errors remain structured JSON.",
        "security": [
          {
            "cookieSession": []
          },
          {
            "dataApiKey": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/QueryRepresentation"
          },
          {
            "$ref": "#/components/parameters/QueryRepresentationAccept"
          },
          {
            "name": "jobId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^job_[A-Za-z0-9_-]+$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Plain-text original fields or Markdown returned directly; original JSON from R2 after following the default redirect",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/MarkdownQueryResult"
                    },
                    {
                      "type": "object",
                      "additionalProperties": true
                    }
                  ]
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                },
                "examples": {
                  "original": {
                    "value": "Source: \"google_search\"\nStatus: \"completed\"\nResults:\n  1:\n    Organic: []\n"
                  },
                  "markdown": {
                    "value": "Source: \"google_search\"\nStatus: \"completed\"\n\nMarkdown Content:\n# Google search\n"
                  }
                }
              }
            }
          },
          "302": {
            "description": "Redirect to original JSON in private R2 storage when JSON is selected without X-Respond-With",
            "headers": {
              "Location": {
                "description": "Short-lived presigned R2 URL",
                "required": true,
                "schema": {
                  "type": "string",
                  "format": "uri"
                }
              }
            }
          },
          "400": {
            "description": "Unsupported X-Respond-With value; response is JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/QueryRepresentationError"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "406": {
            "description": "Neither application/json nor text/plain is acceptable; response is JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/QueryRepresentationError"
                }
              }
            }
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "410": {
            "description": "Result expired",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "422": {
            "description": "The job failed. The response includes the saved failure reason in detail when available.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/v1/queries/realtime": {
      "post": {
        "servers": [
          {
            "url": "https://data.flashdata.dev"
          }
        ],
        "tags": [
          "Data Queries"
        ],
        "operationId": "queryRealtime",
        "summary": "Retrieve results in the same HTTP response",
        "security": [
          {
            "dataApiKey": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "oneOf": [
                  {
                    "$ref": "#/components/schemas/Query_google_search"
                  },
                  {
                    "$ref": "#/components/schemas/Query_google_images"
                  },
                  {
                    "$ref": "#/components/schemas/Query_google_news"
                  },
                  {
                    "$ref": "#/components/schemas/Query_google_shopping"
                  },
                  {
                    "$ref": "#/components/schemas/Query_google_videos"
                  },
                  {
                    "$ref": "#/components/schemas/Query_google_places"
                  },
                  {
                    "$ref": "#/components/schemas/Query_youtube_search"
                  },
                  {
                    "$ref": "#/components/schemas/Query_youtube_search_extended"
                  },
                  {
                    "$ref": "#/components/schemas/Query_youtube_metadata"
                  },
                  {
                    "$ref": "#/components/schemas/Query_youtube_transcript"
                  },
                  {
                    "$ref": "#/components/schemas/Query_youtube_captions"
                  },
                  {
                    "$ref": "#/components/schemas/Query_youtube_trainability"
                  },
                  {
                    "$ref": "#/components/schemas/Query_youtube_channel"
                  },
                  {
                    "$ref": "#/components/schemas/Query_youtube_suggestions"
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "$ref": "#/components/schemas/DataQueryResponse"
                    },
                    {
                      "$ref": "#/components/schemas/MarkdownQueryResult"
                    }
                  ]
                },
                "examples": {
                  "uploaderFallback": {
                    "summary": "English transcript using uploader captions when native speech recognition is unavailable",
                    "value": {
                      "source": "youtube_transcript",
                      "status": "done",
                      "results": [
                        {
                          "videoId": "jNQXAC9IVRw",
                          "languageCode": "en",
                          "captionSource": "uploader",
                          "isAutoGenerated": false,
                          "languageName": null,
                          "segments": [
                            {
                              "start": 0,
                              "end": 1,
                              "text": "Hello."
                            }
                          ],
                          "fullText": "Hello."
                        }
                      ]
                    }
                  }
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                },
                "examples": {
                  "original": {
                    "value": "Source: \"google_search\"\nStatus: \"done\"\nResults:\n  1:\n    Organic: []\n"
                  },
                  "markdown": {
                    "value": "Source: \"google_search\"\nStatus: \"done\"\n\nMarkdown Content:\n# Google search\n"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid query input or unsupported X-Respond-With value. Correct the request before retrying.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DataQueryError"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid or revoked API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DataQueryError"
                }
              }
            }
          },
          "402": {
            "description": "Insufficient Credits balance for this request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DataQueryError"
                }
              }
            }
          },
          "403": {
            "description": "API key does not include permission for the requested source.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DataQueryError"
                }
              }
            }
          },
          "406": {
            "description": "Unsupported Accept type. Use application/json or text/plain.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/QueryRepresentationError"
                }
              }
            }
          },
          "422": {
            "description": "The requested video, channel or subtitle track is unavailable or access is restricted.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DataQueryError"
                },
                "examples": {
                  "videoUnavailable": {
                    "value": {
                      "error": true,
                      "code": "video_unavailable",
                      "retryable": false,
                      "message": "This video is unavailable."
                    }
                  },
                  "membersOnly": {
                    "value": {
                      "error": true,
                      "code": "video_members_only",
                      "retryable": false,
                      "message": "This video is members-only and requires a YouTube channel membership."
                    }
                  },
                  "ageRestricted": {
                    "value": {
                      "error": true,
                      "code": "video_age_restricted",
                      "retryable": false,
                      "message": "This video is age-restricted and requires age-verified YouTube authentication. Retrying without changing authentication will not help."
                    }
                  },
                  "subtitlesUnavailable": {
                    "value": {
                      "error": true,
                      "code": "youtube_subtitles_unavailable",
                      "retryable": false,
                      "message": "Uploader-provided subtitles not available for language: en"
                    }
                  },
                  "originalLanguageUnknown": {
                    "value": {
                      "error": true,
                      "code": "youtube_original_language_unknown",
                      "retryable": false,
                      "message": "Cannot confirm the original audio language."
                    }
                  },
                  "originalSubtitlesUnavailable": {
                    "value": {
                      "error": true,
                      "code": "youtube_original_subtitles_unavailable",
                      "retryable": false,
                      "message": "No confirmed uploader-provided subtitles for the original audio language: ja."
                    }
                  },
                  "defaultLanguageUnknown": {
                    "value": {
                      "error": true,
                      "code": "youtube_default_language_unknown",
                      "retryable": false,
                      "message": "Cannot confirm the default audio language."
                    }
                  },
                  "defaultSubtitlesUnavailable": {
                    "value": {
                      "error": true,
                      "code": "youtube_default_subtitles_unavailable",
                      "retryable": false,
                      "message": "No matching subtitles for the default audio language: es."
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Rate limit or plan capacity exceeded. Inspect Retry-After before retrying.",
            "headers": {
              "Retry-After": {
                "description": "Seconds to wait before retrying.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DataQueryError"
                }
              }
            }
          },
          "500": {
            "description": "FlashData encountered an internal error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DataQueryError"
                },
                "example": {
                  "error": true,
                  "code": "youtube_worker_error",
                  "message": "The YouTube worker could not complete the request."
                }
              }
            }
          },
          "502": {
            "description": "An upstream response could not be used. Known YouTube failures include a code and a public message describing the reason.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DataQueryError"
                },
                "example": {
                  "error": true,
                  "code": "youtube_access_denied",
                  "message": "YouTube refused the metadata request (HTTP 403 Forbidden)."
                }
              }
            }
          },
          "503": {
            "description": "FlashData or its upstream service is temporarily unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DataQueryError"
                },
                "example": {
                  "error": true,
                  "code": "youtube_rate_limited",
                  "message": "YouTube rate-limited the metadata request (HTTP 429)."
                }
              }
            }
          },
          "504": {
            "description": "The upstream request timed out.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DataQueryError"
                },
                "example": {
                  "error": true,
                  "code": "youtube_timeout",
                  "message": "The YouTube subtitle request timed out."
                }
              }
            }
          },
          "default": {
            "description": "Query rejected or upstream unavailable. Inspect the HTTP status, code and message; see /docs/errors."
          }
        },
        "description": "Return query results in the same response. JSON is the default; use Accept: text/plain for readable text. Add X-Respond-With: markdown to replace the results array with Markdown content while keeping source, status, usage and timestamps. Without it, the original fields are returned. Errors use JSON. YouTube transcript and caption requests that retrieve zero tracks fail and any reserved credits are refunded. See /docs/guides/response-formats for examples.",
        "parameters": [
          {
            "$ref": "#/components/parameters/QueryRepresentation"
          },
          {
            "$ref": "#/components/parameters/QueryRepresentationAccept"
          }
        ]
      }
    },
    "/v1/queries": {
      "post": {
        "servers": [
          {
            "url": "https://data.flashdata.dev"
          }
        ],
        "tags": [
          "Data Queries"
        ],
        "operationId": "queryAsync",
        "summary": "Submit a background query and follow its job links",
        "security": [
          {
            "dataApiKey": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "oneOf": [
                  {
                    "$ref": "#/components/schemas/AsyncQuery_google_search"
                  },
                  {
                    "$ref": "#/components/schemas/AsyncQuery_google_images"
                  },
                  {
                    "$ref": "#/components/schemas/AsyncQuery_google_news"
                  },
                  {
                    "$ref": "#/components/schemas/AsyncQuery_google_shopping"
                  },
                  {
                    "$ref": "#/components/schemas/AsyncQuery_google_videos"
                  },
                  {
                    "$ref": "#/components/schemas/AsyncQuery_google_places"
                  },
                  {
                    "$ref": "#/components/schemas/AsyncQuery_youtube_search"
                  },
                  {
                    "$ref": "#/components/schemas/AsyncQuery_youtube_search_extended"
                  },
                  {
                    "$ref": "#/components/schemas/AsyncQuery_youtube_metadata"
                  },
                  {
                    "$ref": "#/components/schemas/AsyncQuery_youtube_transcript"
                  },
                  {
                    "$ref": "#/components/schemas/AsyncQuery_youtube_captions"
                  },
                  {
                    "$ref": "#/components/schemas/AsyncQuery_youtube_trainability"
                  },
                  {
                    "$ref": "#/components/schemas/AsyncQuery_youtube_channel"
                  },
                  {
                    "$ref": "#/components/schemas/AsyncQuery_youtube_suggestions"
                  },
                  {
                    "$ref": "#/components/schemas/AsyncQuery_youtube_download"
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AsyncSubmission"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "description": "Invalid query input, batch size or callback_url. Correct the request before retrying.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DataQueryError"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid or revoked API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DataQueryError"
                }
              }
            }
          },
          "402": {
            "description": "Insufficient Credits balance for this request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DataQueryError"
                }
              }
            }
          },
          "403": {
            "description": "API key does not include permission for the requested source.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DataQueryError"
                }
              }
            }
          },
          "406": {
            "description": "Unsupported Accept type. Use application/json or text/plain.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/QueryRepresentationError"
                }
              }
            }
          },
          "422": {
            "description": "Validation or policy rejection for the requested input.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DataQueryError"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit or plan capacity exceeded. Inspect Retry-After before retrying.",
            "headers": {
              "Retry-After": {
                "description": "Seconds to wait before retrying.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DataQueryError"
                }
              }
            }
          },
          "500": {
            "description": "FlashData encountered an internal error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DataQueryError"
                },
                "example": {
                  "error": true,
                  "code": "youtube_worker_error",
                  "message": "The YouTube worker could not complete the request."
                }
              }
            }
          },
          "502": {
            "description": "An upstream response could not be used. Known YouTube failures include a code and a public message describing the reason.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DataQueryError"
                },
                "example": {
                  "error": true,
                  "code": "youtube_access_denied",
                  "message": "YouTube refused the metadata request (HTTP 403 Forbidden)."
                }
              }
            }
          },
          "503": {
            "description": "FlashData or its upstream service is temporarily unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DataQueryError"
                },
                "example": {
                  "error": true,
                  "code": "youtube_rate_limited",
                  "message": "YouTube rate-limited the metadata request (HTTP 429)."
                }
              }
            }
          },
          "504": {
            "description": "The upstream request timed out.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DataQueryError"
                },
                "example": {
                  "error": true,
                  "code": "youtube_timeout",
                  "message": "The YouTube subtitle request timed out."
                }
              }
            }
          },
          "default": {
            "description": "Query rejected or upstream unavailable. Inspect the HTTP status, code and message; see /docs/errors."
          }
        },
        "description": "Return a receipt for each accepted job. JSON is the default; use Accept: text/plain for readable text. X-Respond-With is ignored here. To receive Markdown results, set that header when retrieving each completed job's results. Errors use JSON.",
        "parameters": [
          {
            "$ref": "#/components/parameters/ResponseEnvelopeAccept"
          }
        ]
      }
    },
    "/v1/queries/batch": {
      "post": {
        "servers": [
          {
            "url": "https://data.flashdata.dev"
          }
        ],
        "tags": [
          "Data Queries"
        ],
        "operationId": "queryBatch",
        "summary": "Submit multiple background queries; each is billed separately",
        "security": [
          {
            "dataApiKey": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "queries"
                ],
                "properties": {
                  "queries": {
                    "type": "array",
                    "minItems": 1,
                    "items": {
                      "oneOf": [
                        {
                          "$ref": "#/components/schemas/AsyncQuery_google_search"
                        },
                        {
                          "$ref": "#/components/schemas/AsyncQuery_google_images"
                        },
                        {
                          "$ref": "#/components/schemas/AsyncQuery_google_news"
                        },
                        {
                          "$ref": "#/components/schemas/AsyncQuery_google_shopping"
                        },
                        {
                          "$ref": "#/components/schemas/AsyncQuery_google_videos"
                        },
                        {
                          "$ref": "#/components/schemas/AsyncQuery_google_places"
                        },
                        {
                          "$ref": "#/components/schemas/AsyncQuery_youtube_search"
                        },
                        {
                          "$ref": "#/components/schemas/AsyncQuery_youtube_search_extended"
                        },
                        {
                          "$ref": "#/components/schemas/AsyncQuery_youtube_metadata"
                        },
                        {
                          "$ref": "#/components/schemas/AsyncQuery_youtube_transcript"
                        },
                        {
                          "$ref": "#/components/schemas/AsyncQuery_youtube_captions"
                        },
                        {
                          "$ref": "#/components/schemas/AsyncQuery_youtube_trainability"
                        },
                        {
                          "$ref": "#/components/schemas/AsyncQuery_youtube_channel"
                        },
                        {
                          "$ref": "#/components/schemas/AsyncQuery_youtube_suggestions"
                        },
                        {
                          "$ref": "#/components/schemas/AsyncQuery_youtube_download"
                        }
                      ]
                    },
                    "description": "Batch size and pending-job limits depend on your plan."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "queries": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/AsyncSubmission"
                      }
                    },
                    "total_credits": {
                      "type": "number"
                    },
                    "usage": {
                      "type": "object",
                      "properties": {
                        "credits": {
                          "type": "number"
                        }
                      }
                    }
                  }
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "description": "Invalid query input, batch size or callback_url. Correct the request before retrying.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DataQueryError"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid or revoked API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DataQueryError"
                }
              }
            }
          },
          "402": {
            "description": "Insufficient Credits balance for this request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DataQueryError"
                }
              }
            }
          },
          "403": {
            "description": "API key does not include permission for the requested source.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DataQueryError"
                }
              }
            }
          },
          "406": {
            "description": "Unsupported Accept type. Use application/json or text/plain.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/QueryRepresentationError"
                }
              }
            }
          },
          "422": {
            "description": "Validation or policy rejection for the requested input.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DataQueryError"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit or plan capacity exceeded. Inspect Retry-After before retrying.",
            "headers": {
              "Retry-After": {
                "description": "Seconds to wait before retrying.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DataQueryError"
                }
              }
            }
          },
          "500": {
            "description": "FlashData encountered an internal error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DataQueryError"
                },
                "example": {
                  "error": true,
                  "code": "youtube_worker_error",
                  "message": "The YouTube worker could not complete the request."
                }
              }
            }
          },
          "502": {
            "description": "An upstream response could not be used. Known YouTube failures include a code and a public message describing the reason.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DataQueryError"
                },
                "example": {
                  "error": true,
                  "code": "youtube_access_denied",
                  "message": "YouTube refused the metadata request (HTTP 403 Forbidden)."
                }
              }
            }
          },
          "503": {
            "description": "FlashData or its upstream service is temporarily unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DataQueryError"
                },
                "example": {
                  "error": true,
                  "code": "youtube_rate_limited",
                  "message": "YouTube rate-limited the metadata request (HTTP 429)."
                }
              }
            }
          },
          "504": {
            "description": "The upstream request timed out.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DataQueryError"
                },
                "example": {
                  "error": true,
                  "code": "youtube_timeout",
                  "message": "The YouTube subtitle request timed out."
                }
              }
            }
          },
          "default": {
            "description": "Query rejected or upstream unavailable. Inspect the HTTP status, code and message; see /docs/errors."
          }
        },
        "description": "Return a receipt for each accepted job. JSON is the default; use Accept: text/plain for readable text. X-Respond-With is ignored here. To receive Markdown results, set that header when retrieving each completed job's results. Errors use JSON.",
        "parameters": [
          {
            "$ref": "#/components/parameters/ResponseEnvelopeAccept"
          }
        ]
      }
    }
  },
  "components": {
    "schemas": {
      "APIKeyIdentity": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "apiKeyId": {
            "type": "string"
          },
          "accountId": {
            "type": "string"
          },
          "accountType": {
            "type": "string",
            "enum": [
              "owned",
              "temporary"
            ]
          },
          "ownership": {
            "type": "string",
            "enum": [
              "owned",
              "unowned"
            ]
          },
          "access": {
            "type": "string",
            "enum": [
              "ready",
              "blocked"
            ]
          },
          "installed": {
            "type": "boolean"
          },
          "recurringAllowed": {
            "type": "boolean"
          },
          "connectionId": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "scopes": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "expiresAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "verifiedAt": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "apiKeyId",
          "accountId",
          "accountType",
          "ownership",
          "access",
          "installed",
          "recurringAllowed",
          "connectionId",
          "scopes",
          "expiresAt",
          "verifiedAt"
        ],
        "description": "Authoritative current-record ownership and readiness. Public IDs only. recurringAllowed requires a verified active owner and, for agent-issued keys, server-confirmed installation. It is a point-in-time check, not an authorization token or permission to reuse cached data after revocation."
      },
      "Problem": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "type",
          "title",
          "status",
          "code",
          "requestId"
        ],
        "properties": {
          "type": {
            "type": "string",
            "format": "uri-reference"
          },
          "title": {
            "type": "string"
          },
          "status": {
            "type": "integer",
            "minimum": 400,
            "maximum": 599
          },
          "code": {
            "type": "string",
            "pattern": "^[a-z0-9_]+$"
          },
          "detail": {
            "type": "string"
          },
          "requestId": {
            "type": "string",
            "pattern": "^req_"
          },
          "fieldErrors": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/FieldError"
            }
          }
        }
      },
      "FieldError": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "field",
          "code",
          "message"
        ],
        "properties": {
          "field": {
            "type": "string"
          },
          "code": {
            "type": "string"
          },
          "message": {
            "type": "string"
          }
        }
      },
      "AgentCapabilities": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "protocolVersion": {
            "const": 2
          },
          "available": {
            "type": "boolean"
          },
          "flow": {
            "const": "temporary_account_api_key"
          },
          "dataOrigin": {
            "type": "string"
          },
          "queryPath": {
            "const": "/v1/queries/realtime"
          },
          "credentialType": {
            "const": "api_key"
          },
          "permissions": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AgentPermission"
            }
          },
          "owner": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "scopes"
            ],
            "properties": {
              "scopes": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              }
            }
          },
          "trial": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "scopes": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "credits": {
                "type": "number"
              },
              "lifetimeHours": {
                "type": "integer",
                "minimum": 0
              },
              "requestsPerSecond": {
                "type": "integer",
                "minimum": 0
              },
              "maxBatchSize": {
                "type": "integer",
                "minimum": 0
              },
              "requestCounts": {}
            },
            "required": [
              "credits",
              "lifetimeHours",
              "requestsPerSecond",
              "maxBatchSize",
              "requestCounts"
            ]
          },
          "recurringRequires": {
            "const": "owned_key_installed"
          },
          "replayProtection": {
            "const": "client_local_only"
          }
        },
        "required": [
          "protocolVersion",
          "available"
        ]
      },
      "AgentPermission": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "source",
          "name",
          "product",
          "trialEligible",
          "ownerAllowed",
          "requiresStorageDestination"
        ],
        "properties": {
          "source": {
            "type": "string",
            "pattern": "^[a-z_]{1,80}$"
          },
          "name": {
            "type": "string"
          },
          "product": {
            "type": "string"
          },
          "trialEligible": {
            "type": "boolean"
          },
          "ownerAllowed": {
            "type": "boolean"
          },
          "requiresStorageDestination": {
            "type": "boolean"
          }
        },
        "description": "Catalog-derived agent permissions. Trial eligibility is an explicit opt-in independent of owner approval. Storage and variable-price sources require owner access."
      },
      "AgentRegistration": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "connection": {
            "$ref": "#/components/schemas/AgentConnection"
          },
          "credentials": {
            "$ref": "#/components/schemas/AgentCredentials"
          },
          "dataOrigin": {
            "type": "string"
          },
          "deniedScopes": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "limits": {
            "type": "object",
            "additionalProperties": true
          },
          "nextAction": {
            "type": "string",
            "enum": [
              "query_or_claim",
              "claim"
            ],
            "description": "Claim before the first data request when no requested source is trial eligible."
          }
        },
        "required": [
          "connection",
          "credentials",
          "dataOrigin",
          "deniedScopes",
          "limits"
        ]
      },
      "AgentConnection": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "audience": {
            "type": "string",
            "enum": [
              "coding",
              "personal",
              "unspecified"
            ]
          },
          "ownership": {
            "type": "string",
            "enum": [
              "owned",
              "unowned"
            ]
          },
          "lifecycle": {
            "type": "string",
            "enum": [
              "valid",
              "revoked",
              "expired"
            ]
          },
          "access": {
            "type": "string",
            "enum": [
              "ready",
              "fenced",
              "blocked"
            ]
          },
          "scopes": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Actual scopes on the current API key. May be empty on an unowned claim-only connection; every data-source request is then forbidden."
          },
          "requestedScopes": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Original owner-access request. Claim approval can only reduce this set. Legacy connections retain their original scopes."
          },
          "trialScopes": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Saved subset eligible for the temporary key. Never expanded by catalog changes."
          },
          "permissions": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AgentPermission"
            }
          },
          "generation": {
            "type": "integer",
            "minimum": 0
          },
          "installed": {
            "type": "boolean"
          },
          "trialExpiresAt": {
            "type": "string",
            "format": "date-time"
          },
          "fundingMode": {
            "type": "string",
            "enum": [
              "trial",
              "account_balance"
            ]
          },
          "trialCredits": {
            "type": "number"
          },
          "trialRequestCounts": {}
        },
        "required": [
          "id",
          "name",
          "audience",
          "ownership",
          "lifecycle",
          "access",
          "scopes",
          "generation",
          "installed",
          "trialExpiresAt",
          "fundingMode",
          "trialCredits",
          "trialRequestCounts"
        ]
      },
      "AgentCredentials": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "connectionId": {
            "type": "string"
          },
          "apiKey": {
            "type": "string"
          },
          "setupCredential": {
            "type": "string"
          },
          "handoffProof": {
            "type": "string"
          },
          "generation": {
            "type": "integer",
            "minimum": 0
          }
        },
        "required": [
          "connectionId",
          "apiKey",
          "generation"
        ],
        "description": "Sensitive ordinary API-key credentials. Never log or put in browser URLs. Proofs are returned on temporary registration; handoff returns the owned candidate key."
      },
      "AgentRegistrationRequest": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 80
          },
          "audience": {
            "type": "string",
            "enum": [
              "coding",
              "personal"
            ]
          },
          "scopes": {
            "type": "array",
            "minItems": 1,
            "maxItems": 30,
            "uniqueItems": true,
            "items": {
              "type": "string",
              "pattern": "^[a-z_]{1,80}$"
            }
          },
          "client": {
            "type": "string",
            "pattern": "^[a-z0-9][a-z0-9_-]{0,63}$"
          },
          "transport": {
            "type": "string",
            "enum": [
              "api",
              "cli",
              "mcp"
            ]
          }
        },
        "required": [
          "name",
          "scopes"
        ]
      },
      "AgentConnectionResponse": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "connection": {
            "$ref": "#/components/schemas/AgentConnection"
          }
        },
        "required": [
          "connection"
        ]
      },
      "AgentOnboardingStatus": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "status": {
            "type": "string",
            "enum": [
              "awaiting_claim",
              "claim_processing",
              "handoff_ready",
              "installed",
              "handoff_expired",
              "expired",
              "revoked",
              "blocked"
            ]
          },
          "connection": {
            "$ref": "#/components/schemas/AgentConnection"
          },
          "expiresAt": {
            "type": "string",
            "format": "date-time"
          },
          "nextAction": {
            "type": "string"
          },
          "pollAfterSeconds": {
            "type": "integer",
            "minimum": 0
          }
        },
        "required": [
          "status"
        ]
      },
      "AgentClaim": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "claimId": {
            "type": "string"
          },
          "claimPath": {
            "type": "string"
          },
          "confirmationCode": {
            "type": "string",
            "pattern": "^\\d{8}$"
          },
          "expiresAt": {
            "type": "string",
            "format": "date-time"
          },
          "pollAfterSeconds": {
            "type": "integer",
            "minimum": 0
          }
        },
        "required": [
          "claimId",
          "claimPath",
          "confirmationCode",
          "expiresAt",
          "pollAfterSeconds"
        ]
      },
      "AgentBrowserClaim": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "connection": {
            "$ref": "#/components/schemas/AgentConnection"
          },
          "claimId": {
            "type": "string"
          },
          "expiresAt": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "connection",
          "claimId",
          "expiresAt"
        ]
      },
      "AgentClaimView": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "connection"
        ],
        "properties": {
          "connection": {
            "$ref": "#/components/schemas/AgentConnection"
          },
          "handoff": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "status"
            ],
            "properties": {
              "status": {
                "type": "string"
              }
            }
          }
        }
      },
      "AgentApproval": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "scopes": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "allowAccountBalance": {
            "const": true
          }
        },
        "required": [
          "scopes",
          "allowAccountBalance"
        ]
      },
      "AgentHandoff": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "status": {
            "type": "string",
            "enum": [
              "delivered",
              "confirmed"
            ]
          },
          "connection": {
            "$ref": "#/components/schemas/AgentConnection"
          },
          "credentials": {
            "$ref": "#/components/schemas/AgentCredentials"
          },
          "generation": {
            "type": "integer",
            "minimum": 0
          }
        },
        "required": [
          "status"
        ]
      },
      "OAuthConsent": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "clientName",
          "scope",
          "sources",
          "redirectUri",
          "expiresAt"
        ],
        "properties": {
          "clientName": {
            "type": "string",
            "maxLength": 80
          },
          "scope": {
            "type": "string",
            "enum": [
              "mcp:research"
            ]
          },
          "sources": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "google_search",
                "youtube_search",
                "youtube_metadata",
                "youtube_transcript"
              ]
            }
          },
          "redirectUri": {
            "type": "string",
            "format": "uri"
          },
          "expiresAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "OAuthConnection": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "clientName",
          "scope",
          "status",
          "createdAt",
          "expiresAt"
        ],
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^oag_[A-Za-z0-9_-]{8,}$"
          },
          "clientName": {
            "type": "string"
          },
          "scope": {
            "type": "string",
            "enum": [
              "mcp:research"
            ]
          },
          "status": {
            "type": "string",
            "enum": [
              "active",
              "expired",
              "revoked"
            ]
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "expiresAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "Health": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "status",
          "service",
          "version",
          "time"
        ],
        "properties": {
          "status": {
            "type": "string",
            "enum": [
              "healthy",
              "degraded"
            ]
          },
          "service": {
            "type": "string"
          },
          "version": {
            "type": "string"
          },
          "time": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "PublicStatus": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "status",
          "updatedAt",
          "components"
        ],
        "properties": {
          "status": {
            "type": "string",
            "enum": [
              "healthy",
              "degraded",
              "outage"
            ]
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          },
          "components": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PublicStatusComponent"
            }
          }
        }
      },
      "PublicStatusComponent": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "name",
          "status"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "enum": [
              "operational",
              "degraded",
              "outage"
            ]
          }
        }
      },
      "DataSource": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "name",
          "category",
          "product",
          "modes",
          "inputSchema",
          "estimatedCredits",
          "requiresStorageDestination"
        ],
        "properties": {
          "id": {
            "type": "string",
            "enum": [
              "google_search",
              "google_images",
              "google_news",
              "google_shopping",
              "google_videos",
              "google_places",
              "youtube_search",
              "youtube_search_extended",
              "youtube_metadata",
              "youtube_transcript",
              "youtube_captions",
              "youtube_trainability",
              "youtube_channel",
              "youtube_suggestions",
              "youtube_download"
            ]
          },
          "name": {
            "type": "string"
          },
          "category": {
            "type": "string",
            "enum": [
              "google",
              "youtube"
            ]
          },
          "product": {
            "type": "string",
            "enum": [
              "google_search",
              "youtube_data",
              "youtube_download"
            ]
          },
          "modes": {
            "type": "array",
            "minItems": 1,
            "uniqueItems": true,
            "description": "Only modes backed by a real adapter or consumer in the current release",
            "items": {
              "type": "string",
              "enum": [
                "realtime",
                "async",
                "batch"
              ]
            }
          },
          "inputSchema": {
            "type": "object",
            "additionalProperties": true,
            "description": "JSON Schema used by the Playground and generated clients"
          },
          "estimatedCredits": {
            "type": "number",
            "minimum": 0,
            "multipleOf": 0.001
          },
          "requiresStorageDestination": {
            "type": "boolean",
            "description": "Whether query submission must include per-request storage configuration."
          }
        }
      },
      "PlanCatalog": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "data",
          "currency",
          "billingAvailability",
          "creditValueUsd"
        ],
        "properties": {
          "trialOffer": {
            "description": "Current one-time trial allowance expressed as alternative PAYG usage amounts. Eligibility and approval are required. The amounts share one balance and are not additive. Null when a reliable estimate is unavailable. This is not an account eligibility decision or a promise of immediate credit issuance.",
            "oneOf": [
              {
                "$ref": "#/components/schemas/PublicTrialOffer"
              },
              {
                "type": "null"
              }
            ]
          },
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Plan"
            }
          },
          "currency": {
            "type": "string",
            "const": "USD"
          },
          "creditValueUsd": {
            "type": "number",
            "exclusiveMinimum": 0,
            "description": "Fixed USD value of one credit, used to preview custom top-ups. The server computes the credited amount."
          },
          "billingAvailability": {
            "type": "string",
            "enum": [
              "available",
              "unconfigured",
              "unavailable"
            ]
          },
          "billingMessage": {
            "type": [
              "string",
              "null"
            ],
            "description": "Stable, non-sensitive explanation suitable for the Pricing and Billing UI."
          }
        }
      },
      "PublicTrialOffer": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "googleSearchRequests",
          "youtubeDataRequests",
          "downloadGigabytes"
        ],
        "properties": {
          "maxApiRequests": {
            "type": "integer",
            "minimum": 0,
            "description": "Maximum free API calls when the entire trial grant is spent on the lowest-cost per-request API at current Pay as you go rates. Other APIs may allow fewer calls. Downloads are billed by delivered bytes and excluded from this count."
          },
          "googleSearchRequests": {
            "type": "integer",
            "minimum": 0,
            "description": "Requests if the entire grant is spent on Google sources, using the highest current source rate."
          },
          "youtubeDataRequests": {
            "type": "integer",
            "minimum": 0,
            "description": "Standard YouTube requests, excluding Extended Search, using the highest current source rate."
          },
          "downloadGigabytes": {
            "type": "number",
            "minimum": 0,
            "description": "Approximate delivered media volume in decimal GB (1 GB = 1000000000 bytes). Zero when the grant cannot cover the initial download reservation. Completion also depends on per-job reservations and settlement."
          }
        }
      },
      "Plan": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "slug",
          "name",
          "description",
          "includedCredits",
          "limits",
          "prices",
          "features",
          "usagePrices"
        ],
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^plan_"
          },
          "slug": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "includedCredits": {
            "type": "number",
            "minimum": 0,
            "multipleOf": 0.001,
            "description": "Credits included in each paid subscription cycle; zero for Pay As You Go."
          },
          "limits": {
            "$ref": "#/components/schemas/PlanLimits"
          },
          "prices": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PlanPrice"
            }
          },
          "features": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "usagePrices": {
            "$ref": "#/components/schemas/PlanUsagePrices"
          }
        }
      },
      "PlanLimits": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "concurrency",
          "maxBatchSize",
          "maxPendingJobs"
        ],
        "properties": {
          "concurrency": {
            "type": "integer",
            "minimum": 1
          },
          "maxBatchSize": {
            "type": "integer",
            "minimum": 1
          },
          "maxPendingJobs": {
            "type": "integer",
            "minimum": 1
          }
        }
      },
      "PlanPrice": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "currency",
          "unitAmount",
          "credits",
          "type",
          "interval"
        ],
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^prc_"
          },
          "currency": {
            "type": "string",
            "const": "USD"
          },
          "unitAmount": {
            "type": "integer",
            "minimum": 0,
            "description": "USD cents"
          },
          "credits": {
            "type": "number",
            "minimum": 0,
            "multipleOf": 0.001,
            "description": "Credits granted by a successful one-time top-up; zero for recurring prices."
          },
          "type": {
            "type": "string",
            "enum": [
              "recurring",
              "one_time"
            ]
          },
          "interval": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "month",
              "year",
              null
            ]
          }
        }
      },
      "PlanUsagePrices": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "googlePer1kCents",
          "youtubePer1kCents",
          "downloadPerTbCents"
        ],
        "properties": {
          "googlePer1kCents": {
            "type": "integer",
            "minimum": 0,
            "description": "Google request price per 1,000 successful requests, in USD cents."
          },
          "youtubePer1kCents": {
            "type": "integer",
            "minimum": 0,
            "description": "Standard YouTube request price per 1,000 successful requests, in USD cents."
          },
          "downloadPerTbCents": {
            "type": "integer",
            "minimum": 0,
            "description": "Download price per decimal TB (1,000,000,000,000 bytes), in USD cents."
          }
        }
      },
      "PublicLegalVersions": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "availability",
          "termsVersion",
          "privacyVersion"
        ],
        "properties": {
          "availability": {
            "type": "string",
            "enum": [
              "configured",
              "unconfigured"
            ]
          },
          "termsVersion": {
            "type": [
              "string",
              "null"
            ],
            "minLength": 1,
            "maxLength": 64
          },
          "privacyVersion": {
            "type": [
              "string",
              "null"
            ],
            "minLength": 1,
            "maxLength": 64
          }
        }
      },
      "RegisterRequest": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "email",
          "password",
          "acceptedTerms",
          "termsVersion",
          "privacyVersion"
        ],
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 100,
            "description": "Optional display name. When omitted, defaults to the normalized email local part, truncated to 100 characters. Can be changed in the profile later."
          },
          "email": {
            "type": "string",
            "format": "email",
            "maxLength": 320
          },
          "password": {
            "$ref": "#/components/schemas/Password"
          },
          "acceptedTerms": {
            "type": "boolean",
            "const": true
          },
          "termsVersion": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "Exact version rendered by the signup page; stale versions are rejected."
          },
          "privacyVersion": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "Exact version rendered by the signup page; stale versions are rejected."
          }
        }
      },
      "Password": {
        "type": "string",
        "minLength": 8,
        "maxLength": 128,
        "writeOnly": true
      },
      "RegisterResponse": {
        "type": "object",
        "additionalProperties": false,
        "description": "Generic receipt returned for both a new account and a recoverable pending account. It intentionally omits identity data to limit account enumeration.",
        "required": [
          "emailVerificationRequired"
        ],
        "properties": {
          "emailVerificationRequired": {
            "type": "boolean",
            "const": true
          }
        }
      },
      "LoginRequest": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "email",
          "password"
        ],
        "properties": {
          "email": {
            "type": "string",
            "format": "email",
            "maxLength": 320
          },
          "password": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128,
            "writeOnly": true
          },
          "rememberMe": {
            "type": "boolean",
            "default": false,
            "description": "Ignored for email_verification, legal_acceptance and deletion_recovery Sessions, which always use a short fixed expiry."
          }
        }
      },
      "LoginResponse": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "account",
          "csrfToken",
          "sessionMode"
        ],
        "properties": {
          "account": {
            "$ref": "#/components/schemas/Account"
          },
          "csrfToken": {
            "type": "string",
            "minLength": 32,
            "readOnly": true
          },
          "sessionMode": {
            "type": "string",
            "enum": [
              "full",
              "email_verification",
              "legal_acceptance",
              "deletion_recovery"
            ]
          }
        }
      },
      "Account": {
        "type": "object",
        "description": "Deleted accounts are only returned through authorized Admin projections; their identity fields are redacted.",
        "additionalProperties": false,
        "required": [
          "id",
          "name",
          "email",
          "status",
          "emailVerified",
          "legalAcceptanceRequired",
          "role",
          "timezone",
          "createdAt",
          "updatedAt"
        ],
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^acct_"
          },
          "name": {
            "type": "string"
          },
          "email": {
            "type": [
              "string",
              "null"
            ],
            "format": "email"
          },
          "status": {
            "type": "string",
            "enum": [
              "pending_verification",
              "active",
              "suspended",
              "deleting",
              "deleted"
            ]
          },
          "emailVerified": {
            "type": "boolean"
          },
          "legalAcceptanceRequired": {
            "type": "boolean"
          },
          "role": {
            "type": "string",
            "enum": [
              "user",
              "admin"
            ]
          },
          "timezone": {
            "type": "string",
            "minLength": 1,
            "maxLength": 80
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "TokenRequest": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "token"
        ],
        "properties": {
          "token": {
            "type": "string",
            "minLength": 32,
            "maxLength": 256,
            "writeOnly": true
          }
        }
      },
      "Session": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "current",
          "mode",
          "createdAt",
          "lastSeenAt",
          "expiresAt",
          "device"
        ],
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^ses_"
          },
          "current": {
            "type": "boolean"
          },
          "mode": {
            "type": "string",
            "enum": [
              "full",
              "email_verification",
              "legal_acceptance",
              "deletion_recovery"
            ]
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "lastSeenAt": {
            "type": "string",
            "format": "date-time"
          },
          "expiresAt": {
            "type": "string",
            "format": "date-time"
          },
          "device": {
            "type": "string"
          },
          "approximateLocation": {
            "type": "string"
          },
          "reauthenticatedUntil": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        }
      },
      "Reauthentication": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "reauthenticatedUntil"
        ],
        "properties": {
          "reauthenticatedUntil": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "UpdateAccountRequest": {
        "type": "object",
        "additionalProperties": false,
        "minProperties": 1,
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 100
          },
          "timezone": {
            "type": "string",
            "minLength": 1,
            "maxLength": 80
          }
        }
      },
      "AccountDeletionRequest": {
        "type": "object",
        "description": "User-safe deletion summary. Durable processor cursor and per-step metadata are internal operational state and are intentionally omitted.",
        "additionalProperties": false,
        "required": [
          "id",
          "status",
          "requestedAt",
          "scheduledFor",
          "cancellable",
          "billingCancellationStatus",
          "activeJobsAtRequest",
          "retryable"
        ],
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^del_"
          },
          "status": {
            "type": "string",
            "enum": [
              "scheduled",
              "cancelled",
              "processing",
              "completed",
              "failed"
            ]
          },
          "requestedAt": {
            "type": "string",
            "format": "date-time"
          },
          "scheduledFor": {
            "type": "string",
            "format": "date-time"
          },
          "cancellable": {
            "type": "boolean"
          },
          "cancelledAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "processingStartedAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "completedAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "failureCode": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 80
          },
          "billingCancellationStatus": {
            "type": "string",
            "enum": [
              "not_required",
              "pending",
              "completed",
              "failed"
            ]
          },
          "activeJobsAtRequest": {
            "type": "integer",
            "minimum": 0
          },
          "retryable": {
            "type": "boolean",
            "description": "True only when an Admin-audited processor retry is possible; it does not grant the user mutation access."
          }
        }
      },
      "LegalAcceptanceRequest": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "acceptedTerms",
          "termsVersion",
          "privacyVersion"
        ],
        "properties": {
          "acceptedTerms": {
            "type": "boolean",
            "const": true
          },
          "termsVersion": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64
          },
          "privacyVersion": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64
          }
        }
      },
      "OnboardingProgress": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "currentStep",
          "apiKeyStepStatus",
          "firstRequestStatus",
          "version",
          "updatedAt"
        ],
        "properties": {
          "currentStep": {
            "type": "string",
            "enum": [
              "welcome",
              "api_key",
              "first_request",
              "completed"
            ]
          },
          "useCase": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "google_search",
              "youtube_data",
              "download",
              null
            ]
          },
          "apiKeyStepStatus": {
            "type": "string",
            "enum": [
              "pending",
              "created",
              "skipped"
            ]
          },
          "firstRequestStatus": {
            "type": "string",
            "enum": [
              "pending",
              "succeeded",
              "skipped"
            ]
          },
          "firstApiKeyId": {
            "type": [
              "string",
              "null"
            ],
            "pattern": "^key_"
          },
          "firstRequestId": {
            "type": [
              "string",
              "null"
            ],
            "pattern": "^req_"
          },
          "completedAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "version": {
            "type": "integer",
            "minimum": 0
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "UpdateOnboardingRequest": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "version",
          "action"
        ],
        "properties": {
          "version": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "action": {
            "type": "string",
            "enum": [
              "select_use_case",
              "confirm_api_key_saved",
              "skip_api_key",
              "confirm_first_request",
              "skip_first_request"
            ]
          },
          "useCase": {
            "type": "string",
            "enum": [
              "google_search",
              "youtube_data",
              "download"
            ]
          }
        },
        "allOf": [
          {
            "if": {
              "properties": {
                "action": {
                  "const": "select_use_case"
                }
              }
            },
            "then": {
              "required": [
                "useCase"
              ],
              "properties": {
                "useCase": {}
              }
            },
            "else": {
              "not": {
                "required": [
                  "useCase"
                ],
                "properties": {
                  "useCase": {}
                }
              }
            }
          }
        ],
        "description": "Server-owned resource state validates confirmation actions; clients never submit API Key or request IDs."
      },
      "ConsoleOverview": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "account",
          "onboarding",
          "subscription",
          "balance",
          "publicStatus",
          "degradedSections",
          "generatedAt"
        ],
        "properties": {
          "account": {
            "$ref": "#/components/schemas/Account"
          },
          "onboarding": {
            "$ref": "#/components/schemas/OnboardingProgress"
          },
          "subscription": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/Subscription"
              },
              {
                "type": "null"
              }
            ]
          },
          "balance": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/CreditBalance"
              },
              {
                "type": "null"
              }
            ]
          },
          "publicStatus": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/PublicStatus"
              },
              {
                "type": "null"
              }
            ]
          },
          "degradedSections": {
            "type": "array",
            "uniqueItems": true,
            "items": {
              "type": "string",
              "enum": [
                "subscription",
                "balance",
                "public_status"
              ]
            },
            "description": "A listed section uses its unavailable representation; null and empty values must not be interpreted as zero or healthy."
          },
          "generatedAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "Subscription": {
        "type": "object",
        "description": "Effective entitlement projection. `status=payg` and `id=null` means no billing subscription record exists.",
        "additionalProperties": false,
        "required": [
          "status",
          "plan",
          "cancelAtPeriodEnd",
          "usageRates"
        ],
        "properties": {
          "id": {
            "type": [
              "string",
              "null"
            ],
            "pattern": "^sub_"
          },
          "status": {
            "type": "string",
            "enum": [
              "payg",
              "trialing",
              "active",
              "past_due",
              "grace",
              "cancelled"
            ]
          },
          "plan": {
            "$ref": "#/components/schemas/Plan"
          },
          "usageRates": {
            "type": "object",
            "description": "Account-specific configured credit rates. Query rates come from the account entitlement, not the public plan catalog. One TB is 1,000,000,000,000 bytes; download charges are settled against actual bytes and rounded per result.",
            "additionalProperties": false,
            "required": [
              "customized",
              "queries",
              "downloadCreditsPerTb"
            ],
            "properties": {
              "customized": {
                "type": "boolean",
                "description": "True when an administrator configured rates for this account."
              },
              "queries": {
                "type": "array",
                "items": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "source",
                    "name",
                    "creditsPerRequest"
                  ],
                  "properties": {
                    "source": {
                      "type": "string"
                    },
                    "name": {
                      "type": "string"
                    },
                    "creditsPerRequest": {
                      "type": "number",
                      "minimum": 0
                    }
                  }
                }
              },
              "downloadCreditsPerTb": {
                "type": "number",
                "minimum": 0
              }
            }
          },
          "currentPeriodStart": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "currentPeriodEnd": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "cancelAtPeriodEnd": {
            "type": "boolean"
          },
          "graceEndsAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        }
      },
      "CreditBalance": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "balanceCredits",
          "reservedCredits",
          "availableCredits",
          "lifetimeGrantedCredits",
          "lifetimeUsedCredits",
          "lifetimeRefundedCredits",
          "lifetimePaymentReversedCredits",
          "updatedAt"
        ],
        "properties": {
          "balanceCredits": {
            "type": "number",
            "multipleOf": 0.001,
            "description": "Signed settled balance after grants, usage, refunds and provider reversals."
          },
          "reservedCredits": {
            "type": "number",
            "minimum": 0,
            "multipleOf": 0.001
          },
          "availableCredits": {
            "type": "number",
            "minimum": 0,
            "multipleOf": 0.001,
            "description": "max(balanceCredits, 0)."
          },
          "lifetimeGrantedCredits": {
            "type": "number",
            "minimum": 0,
            "multipleOf": 0.001
          },
          "lifetimeUsedCredits": {
            "type": "number",
            "minimum": 0,
            "multipleOf": 0.001
          },
          "lifetimeRefundedCredits": {
            "type": "number",
            "minimum": 0,
            "multipleOf": 0.001,
            "description": "Credits returned to the account after failed usage."
          },
          "lifetimePaymentReversedCredits": {
            "type": "number",
            "minimum": 0,
            "multipleOf": 0.001,
            "description": "Absolute Credits removed after verified provider refunds or chargebacks."
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "TrialCreditState": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "eligible",
          "ineligibilityReason",
          "grantCredits",
          "settingsVersion",
          "request"
        ],
        "properties": {
          "eligible": {
            "type": "boolean"
          },
          "ineligibilityReason": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "account_inactive",
              "email_unverified",
              "onboarding_incomplete",
              "not_payg",
              "payment_history",
              "already_granted",
              "already_requested",
              null
            ]
          },
          "grantCredits": {
            "type": "integer",
            "minimum": 1
          },
          "settingsVersion": {
            "type": "integer",
            "minimum": 0
          },
          "request": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/TrialCreditRequest"
              },
              {
                "type": "null"
              }
            ]
          }
        }
      },
      "TrialCreditRequest": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "status",
          "requestedCredits",
          "policyVersion",
          "useCase",
          "requestedAt",
          "reviewedAt",
          "reviewReason",
          "version"
        ],
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^tcr_[A-Za-z0-9_-]{8,}$"
          },
          "status": {
            "$ref": "#/components/schemas/TrialCreditRequestStatus"
          },
          "requestedCredits": {
            "type": "integer",
            "minimum": 1
          },
          "policyVersion": {
            "type": "integer",
            "minimum": 0
          },
          "useCase": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "google_search",
              "youtube_data",
              "download",
              null
            ]
          },
          "requestedAt": {
            "type": "string",
            "format": "date-time"
          },
          "reviewedAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "reviewReason": {
            "type": [
              "string",
              "null"
            ]
          },
          "version": {
            "type": "integer",
            "minimum": 0
          }
        }
      },
      "TrialCreditRequestStatus": {
        "type": "string",
        "enum": [
          "pending",
          "approved",
          "rejected"
        ]
      },
      "ApiKey": {
        "type": "object",
        "description": "API key details. A key remains active until scheduledRevocationAt when revocation is scheduled.",
        "additionalProperties": false,
        "required": [
          "id",
          "name",
          "prefix",
          "last4",
          "scopes",
          "status",
          "createdAt"
        ],
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^key_"
          },
          "name": {
            "type": "string"
          },
          "prefix": {
            "type": "string"
          },
          "last4": {
            "type": "string",
            "minLength": 4,
            "maxLength": 4
          },
          "scopes": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "status": {
            "type": "string",
            "enum": [
              "active",
              "revoked",
              "expired"
            ]
          },
          "lastUsedAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "expiresAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "scheduledRevocationAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "Planned revocation time for an overlapping retiring key; null for a primary or immediately revoked key."
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "CreateApiKeyRequest": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "name",
          "scopes"
        ],
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 80
          },
          "scopes": {
            "type": "array",
            "minItems": 1,
            "uniqueItems": true,
            "items": {
              "type": "string",
              "enum": [
                "google_search",
                "google_images",
                "google_news",
                "google_shopping",
                "google_videos",
                "google_places",
                "youtube_search",
                "youtube_search_extended",
                "youtube_metadata",
                "youtube_transcript",
                "youtube_captions",
                "youtube_trainability",
                "youtube_channel",
                "youtube_suggestions",
                "youtube_download"
              ]
            }
          },
          "expiresAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "ApiKeyCreated": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "apiKey",
          "secret"
        ],
        "properties": {
          "apiKey": {
            "$ref": "#/components/schemas/ApiKey"
          },
          "secret": {
            "type": "string",
            "readOnly": true,
            "pattern": "^fd_(?:(?:test|live)_)?[A-Za-z0-9_-]{43}$",
            "description": "Plaintext secret returned only by this create/rotate transaction. Newly issued secrets use the `fd_` prefix. Previously issued `fd_test_` and `fd_live_` secrets still authenticate. An authenticated replay with the same Idempotency-Key and request body may receive the same KMS-encrypted response for five minutes; it is not recoverable afterward.",
            "x-secret-reveal": "once"
          }
        }
      },
      "HostedSession": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "url",
          "expiresAt"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "url": {
            "type": "string",
            "format": "uri",
            "description": "Provider-hosted HTTPS URL on a Stripe-controlled *.stripe.com host. Web clients must validate the origin and redirect from a server-only boundary."
          },
          "expiresAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "SubscriptionChange": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "fromPriceId",
          "toPriceId",
          "effective",
          "status"
        ],
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^sub_",
            "description": "FlashData subscription public ID. Entitlement still updates only after a verified provider event."
          },
          "fromPriceId": {
            "type": "string",
            "pattern": "^prc_"
          },
          "toPriceId": {
            "type": "string",
            "pattern": "^prc_"
          },
          "effective": {
            "type": "string",
            "enum": [
              "immediate"
            ]
          },
          "status": {
            "type": "string",
            "enum": [
              "submitted"
            ]
          }
        }
      },
      "SubscriptionCancellationChange": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "cancelAtPeriodEnd",
          "status"
        ],
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^sub_"
          },
          "cancelAtPeriodEnd": {
            "type": "boolean"
          },
          "status": {
            "type": "string",
            "enum": [
              "submitted"
            ]
          }
        }
      },
      "Page": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "data",
          "pagination"
        ],
        "properties": {
          "data": {
            "type": "array",
            "items": {}
          },
          "pagination": {
            "$ref": "#/components/schemas/Pagination"
          }
        }
      },
      "Pagination": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "hasMore",
          "limit"
        ],
        "properties": {
          "nextCursor": {
            "type": [
              "string",
              "null"
            ]
          },
          "previousCursor": {
            "type": [
              "string",
              "null"
            ]
          },
          "hasMore": {
            "type": "boolean"
          },
          "limit": {
            "type": "integer",
            "minimum": 1,
            "maximum": 100
          }
        }
      },
      "Invoice": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "number",
          "status",
          "currency",
          "total",
          "amountPaid",
          "refundedAmount",
          "billingReason",
          "createdAt",
          "periodStart",
          "periodEnd"
        ],
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^inv_"
          },
          "number": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "enum": [
              "draft",
              "open",
              "paid",
              "void",
              "uncollectible"
            ]
          },
          "currency": {
            "type": "string",
            "const": "USD"
          },
          "total": {
            "type": "integer",
            "description": "USD cents"
          },
          "amountPaid": {
            "type": "integer",
            "description": "USD cents"
          },
          "refundedAmount": {
            "type": "integer",
            "minimum": 0,
            "description": "Cumulative USD cents observed from verified provider events."
          },
          "billingReason": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "subscription_create",
              "subscription_cycle",
              "subscription_update",
              null
            ]
          },
          "hostedInvoiceUrl": {
            "type": [
              "string",
              "null"
            ],
            "format": "uri",
            "description": "Stripe-hosted HTTPS invoice URL. Production Web clients accept only Stripe-controlled *.stripe.com origins."
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "paidAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "periodStart": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "periodEnd": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        }
      },
      "BillingPaymentPage": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "data",
          "pagination"
        ],
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/BillingPayment"
            }
          },
          "pagination": {
            "$ref": "#/components/schemas/Pagination"
          }
        }
      },
      "BillingPayment": {
        "description": "Account-scoped top-up projection. Refund state is updated only from verified provider events; this API does not initiate refunds.",
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "purchaseType",
          "status",
          "currency",
          "amount",
          "refundedAmount",
          "credits",
          "reversedCredits",
          "createdAt"
        ],
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^pay_"
          },
          "purchaseType": {
            "type": "string",
            "const": "top_up"
          },
          "status": {
            "type": "string",
            "enum": [
              "pending",
              "paid",
              "partially_refunded",
              "refunded",
              "failed"
            ]
          },
          "currency": {
            "type": "string",
            "const": "USD"
          },
          "amount": {
            "type": "integer",
            "minimum": 0,
            "description": "USD cents"
          },
          "refundedAmount": {
            "type": "integer",
            "minimum": 0,
            "description": "USD cents"
          },
          "credits": {
            "type": "number",
            "minimum": 0,
            "multipleOf": 0.001
          },
          "hostedInvoiceUrl": {
            "type": [
              "string",
              "null"
            ],
            "format": "uri",
            "description": "Stripe-hosted HTTPS invoice URL, when Stripe created an invoice for this top-up."
          },
          "invoiceNumber": {
            "type": [
              "string",
              "null"
            ],
            "description": "Stripe invoice number, when available."
          },
          "reversedCredits": {
            "type": "number",
            "minimum": 0,
            "multipleOf": 0.001,
            "description": "Cumulative credits removed by append-only payment_reversal entries; never exceeds credits."
          },
          "paidAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "refundedAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "ApiAccess": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "sources",
          "result_origin"
        ],
        "properties": {
          "sources": {
            "type": "array",
            "uniqueItems": true,
            "items": {
              "$ref": "#/components/schemas/ApiAccessSource"
            }
          },
          "result_origin": {
            "type": [
              "string",
              "null"
            ],
            "format": "uri",
            "description": "Configured signed-result storage origin, without credentials, path, query or fragment. Not an access token or a media URL."
          }
        }
      },
      "ApiAccessSource": {
        "type": "string",
        "enum": [
          "google_search",
          "google_images",
          "google_news",
          "google_shopping",
          "google_videos",
          "google_places",
          "youtube_search",
          "youtube_search_extended",
          "youtube_metadata",
          "youtube_transcript",
          "youtube_captions",
          "youtube_trainability",
          "youtube_channel",
          "youtube_suggestions",
          "youtube_download"
        ]
      },
      "ApiAccessBalance": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "scope",
          "unit",
          "balanceCredits",
          "availableCredits",
          "updatedAt",
          "note"
        ],
        "properties": {
          "scope": {
            "type": "string",
            "const": "account"
          },
          "unit": {
            "type": "string",
            "const": "Credits"
          },
          "balanceCredits": {
            "type": "number",
            "description": "Signed live balance; in-flight reservations may already be reflected."
          },
          "availableCredits": {
            "type": "number",
            "minimum": 0,
            "description": "max(balanceCredits, 0)."
          },
          "updatedAt": {
            "type": [
              "string",
              "null"
            ]
          },
          "note": {
            "type": "string"
          }
        }
      },
      "ApiAccessPricing": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "unit",
          "plan",
          "requestCount",
          "prices",
          "note"
        ],
        "properties": {
          "unit": {
            "type": "string",
            "const": "Credits"
          },
          "plan": {
            "$ref": "#/components/schemas/ApiAccessPlan"
          },
          "requestCount": {
            "type": "integer",
            "minimum": 1,
            "maximum": 100000
          },
          "prices": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "source",
                "available",
                "estimatedCredits"
              ],
              "properties": {
                "source": {
                  "$ref": "#/components/schemas/ApiAccessSource"
                },
                "available": {
                  "type": "boolean"
                },
                "creditsPerRequest": {
                  "type": [
                    "number",
                    "null"
                  ],
                  "minimum": 0
                },
                "estimatedCredits": {
                  "type": [
                    "number",
                    "null"
                  ],
                  "minimum": 0,
                  "description": "Null for downloads or missing pricing."
                },
                "billingUnit": {
                  "type": "string",
                  "const": "TB"
                },
                "bytesPerUnit": {
                  "type": "integer",
                  "const": 1000000000000
                },
                "creditsPerTb": {
                  "type": [
                    "number",
                    "null"
                  ],
                  "minimum": 0
                },
                "note": {
                  "type": "string"
                }
              }
            }
          },
          "note": {
            "type": "string"
          }
        }
      },
      "ApiAccessPlan": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "name": {
            "type": "string"
          },
          "type": {
            "type": "string"
          },
          "billingMode": {
            "type": "string"
          },
          "status": {
            "type": "string"
          }
        }
      },
      "ApiAccessLimits": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "scope",
          "plan",
          "limits",
          "current",
          "note"
        ],
        "properties": {
          "scope": {
            "type": "string",
            "const": "account"
          },
          "plan": {
            "$ref": "#/components/schemas/ApiAccessPlan"
          },
          "limits": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "concurrency": {
                "type": "integer",
                "minimum": 0
              },
              "batchSize": {
                "type": "integer",
                "minimum": 0
              },
              "pendingJobs": {
                "type": "integer",
                "minimum": 0
              }
            }
          },
          "current": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "pendingJobs"
            ],
            "properties": {
              "pendingJobs": {
                "type": "integer",
                "minimum": 0
              }
            }
          },
          "note": {
            "type": "string"
          }
        }
      },
      "ApiKeyUsage": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "scope",
          "unit",
          "from",
          "to",
          "observedAt",
          "totals",
          "bySource",
          "updating",
          "note"
        ],
        "properties": {
          "scope": {
            "type": "string",
            "const": "account_authorized_sources"
          },
          "unit": {
            "type": "string",
            "const": "Credits"
          },
          "from": {
            "type": "string",
            "format": "date-time"
          },
          "to": {
            "type": "string",
            "format": "date-time"
          },
          "observedAt": {
            "type": "string",
            "format": "date-time"
          },
          "totals": {
            "$ref": "#/components/schemas/UsageCounts"
          },
          "bySource": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "source",
                "requests",
                "completed",
                "failed",
                "credits"
              ],
              "properties": {
                "source": {
                  "type": "string"
                },
                "requests": {
                  "type": "integer",
                  "minimum": 0
                },
                "completed": {
                  "type": "integer",
                  "minimum": 0
                },
                "failed": {
                  "type": "integer",
                  "minimum": 0
                },
                "credits": {
                  "type": "number",
                  "minimum": 0
                }
              }
            }
          },
          "updating": {
            "type": "boolean"
          },
          "note": {
            "type": "string"
          }
        }
      },
      "UsageCounts": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "requests",
          "completed",
          "failed",
          "credits"
        ],
        "properties": {
          "requests": {
            "type": "integer",
            "minimum": 0
          },
          "completed": {
            "type": "integer",
            "minimum": 0
          },
          "failed": {
            "type": "integer",
            "minimum": 0
          },
          "credits": {
            "type": "number",
            "minimum": 0,
            "description": "Charged Credits in the current aggregate; pending work may not be finally settled."
          }
        }
      },
      "CreditPolicy": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "unit",
          "failedRequestsCharged",
          "subscriptionGrantTiming",
          "refundHandling"
        ],
        "properties": {
          "unit": {
            "type": "string",
            "const": "credit"
          },
          "failedRequestsCharged": {
            "type": "boolean",
            "const": false
          },
          "subscriptionGrantTiming": {
            "type": "string",
            "const": "invoice_paid"
          },
          "refundHandling": {
            "type": "string",
            "const": "append_only_reversal",
            "description": "Failed requests are refunded; verified provider refunds remove the proportional Credits through immutable transactions."
          }
        }
      },
      "CreditEntryType": {
        "type": "string",
        "enum": [
          "subscription_grant",
          "topup_grant",
          "payment_reversal",
          "admin_adjustment",
          "trial_grant"
        ]
      },
      "CreditTransaction": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "type",
          "deltaCredits",
          "balanceAfterCredits",
          "createdAt"
        ],
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^ctx_"
          },
          "type": {
            "$ref": "#/components/schemas/CreditEntryType"
          },
          "deltaCredits": {
            "type": "number",
            "multipleOf": 0.001
          },
          "balanceAfterCredits": {
            "type": [
              "number",
              "null"
            ],
            "multipleOf": 0.001,
            "description": "Signed settled balance after this immutable transaction, when recorded."
          },
          "description": {
            "type": "string"
          },
          "requestId": {
            "type": [
              "string",
              "null"
            ]
          },
          "jobId": {
            "type": [
              "string",
              "null"
            ]
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "DeliveryWebhook": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "createdAt",
          "id",
          "lastTestStatus",
          "lastTestedAt",
          "name",
          "status",
          "updatedAt",
          "url"
        ],
        "properties": {
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "id": {
            "type": "string",
            "pattern": "^cbk_[A-Za-z0-9_-]{8,}$"
          },
          "lastTestStatus": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 0
          },
          "lastTestedAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "name": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "enum": [
              "active",
              "disabled"
            ]
          },
          "updatedAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "url": {
            "type": "string",
            "format": "uri"
          }
        }
      },
      "CreateDeliveryWebhookRequest": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "name",
          "url"
        ],
        "properties": {
          "name": {
            "type": "string"
          },
          "url": {
            "type": "string",
            "format": "uri"
          }
        }
      },
      "ConsoleJob": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "createdAt",
          "credits",
          "durationMs",
          "error",
          "id",
          "params",
          "progress",
          "result",
          "source",
          "status",
          "updatedAt",
          "videoId"
        ],
        "properties": {
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "credits": {
            "type": "number",
            "multipleOf": 0.001
          },
          "durationMs": {
            "type": [
              "number",
              "null"
            ],
            "minimum": 0
          },
          "error": {
            "type": [
              "string",
              "null"
            ]
          },
          "id": {
            "type": "string"
          },
          "params": {
            "type": "object",
            "additionalProperties": true
          },
          "progress": {
            "type": "integer",
            "minimum": 0
          },
          "result": {
            "type": [
              "object",
              "null"
            ],
            "additionalProperties": true
          },
          "source": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "enum": [
              "completed",
              "failed",
              "pending",
              "processing"
            ]
          },
          "updatedAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "videoId": {
            "type": [
              "string",
              "null"
            ]
          },
          "links": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/JobLink"
            }
          }
        }
      },
      "JobLink": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "rel",
          "href",
          "method"
        ],
        "properties": {
          "rel": {
            "type": "string",
            "enum": [
              "self",
              "results",
              "content",
              "download"
            ]
          },
          "href": {
            "type": "string",
            "format": "uri"
          },
          "method": {
            "type": "string",
            "const": "GET"
          },
          "expires_at": {
            "type": "string",
            "format": "date-time"
          },
          "filename": {
            "type": "string"
          },
          "content_type": {
            "type": "string"
          },
          "size_bytes": {
            "type": "integer",
            "minimum": 1
          }
        }
      },
      "QueryRepresentationError": {
        "type": "object",
        "required": [
          "error",
          "code",
          "message"
        ],
        "properties": {
          "error": {
            "type": "boolean",
            "const": true
          },
          "code": {
            "type": "string",
            "enum": [
              "unsupported_representation",
              "not_acceptable"
            ]
          },
          "message": {
            "type": "string"
          }
        }
      },
      "BulkJobPage": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "data",
          "pagination"
        ],
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/BulkJob"
            }
          },
          "pagination": {
            "$ref": "#/components/schemas/Pagination"
          }
        }
      },
      "BulkJob": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "source",
          "status",
          "input",
          "counts",
          "delivery",
          "pauseReason",
          "error",
          "createdAt",
          "startedAt",
          "completedAt",
          "expiresAt",
          "links"
        ],
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^bulk_[A-Za-z0-9_-]{8,}$"
          },
          "source": {
            "type": "string",
            "enum": [
              "youtube_metadata",
              "youtube_transcript",
              "youtube_captions",
              "youtube_trainability",
              "youtube_download"
            ]
          },
          "status": {
            "type": "string",
            "enum": [
              "awaiting_upload",
              "running",
              "paused",
              "finalizing",
              "completed",
              "failed",
              "cancelled"
            ]
          },
          "input": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "bytes",
              "complete",
              "scannedBytes",
              "scannedLines"
            ],
            "properties": {
              "bytes": {
                "type": "integer",
                "minimum": 0
              },
              "complete": {
                "type": "boolean"
              },
              "scannedBytes": {
                "type": "integer",
                "minimum": 0
              },
              "scannedLines": {
                "type": "integer",
                "minimum": 0
              }
            }
          },
          "counts": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "accepted",
              "completed",
              "failed",
              "invalid",
              "results"
            ],
            "properties": {
              "accepted": {
                "type": "integer",
                "minimum": 0
              },
              "completed": {
                "type": "integer",
                "minimum": 0
              },
              "failed": {
                "type": "integer",
                "minimum": 0
              },
              "invalid": {
                "type": "integer",
                "minimum": 0
              },
              "results": {
                "type": "integer",
                "minimum": 0
              }
            }
          },
          "pauseReason": {
            "type": [
              "string",
              "null"
            ]
          },
          "delivery": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "customerStorage",
              "storageType",
              "uploadedParts",
              "retryCount"
            ],
            "properties": {
              "customerStorage": {
                "type": "boolean"
              },
              "storageType": {
                "type": [
                  "string",
                  "null"
                ],
                "enum": [
                  "s3",
                  "s3_compatible",
                  "oss",
                  "gcs",
                  "azure",
                  "cos",
                  "bos",
                  "tos",
                  null
                ]
              },
              "uploadedParts": {
                "type": "integer",
                "minimum": 0
              },
              "retryCount": {
                "type": "integer",
                "minimum": 0
              }
            }
          },
          "error": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "code",
                  "detail"
                ],
                "properties": {
                  "code": {
                    "type": "string"
                  },
                  "detail": {
                    "type": [
                      "string",
                      "null"
                    ]
                  }
                }
              }
            ]
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "startedAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "completedAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "expiresAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "links": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/JobLink"
            }
          }
        }
      },
      "CreateBulkJobRequest": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "source"
        ],
        "properties": {
          "source": {
            "type": "string",
            "enum": [
              "youtube_metadata",
              "youtube_transcript",
              "youtube_captions",
              "youtube_trainability",
              "youtube_download"
            ]
          },
          "options": {
            "type": "object",
            "additionalProperties": true,
            "description": "Reused for every ID. Metadata accepts include_formats and include_chapters. Transcript and captions accept language (one code or an array of 1–10 distinct codes) and auto (applies to all requested languages). Omitted language targets English. Use \"default\" for the marked playback language or \"original\" for the original audio language. With auto=true, try these sources in the target language: native YouTube speech recognition, uploader captions, automatic captions of unknown type, then YouTube translations. auto=false is uploader-only; explicit -orig keys stay exact. captionSource and isAutoGenerated report the delivered track, not the request. languageCode identifies the actual track; requestedLanguageCode is included when the selector differs. A language array returns tracks and per-language errors for each video with at least one retrieved track. If no track is retrieved, the video job fails and its reserved credits are refunded. Bulk exports use one JSONL record per video. Trainability accepts no source options. These four data sources optionally accept result_storage. Supported storage_type values are s3, s3_compatible, oss, gcs, azure, cos, bos, and tos. storage_url is the bucket name (Azure container name); object_prefix is optional. S3, S3-compatible, OSS, COS, BOS, and TOS use access_key and secret_key. S3, S3-compatible storage, OSS, COS, BOS, and TOS optionally accept session_token with the matching temporary key pair issued by that storage provider. Use AWS/BOS/TOS SessionToken, OSS SecurityToken, or COS Token (with TmpSecretId and TmpSecretKey). The provider must support temporary credentials. These credentials must remain valid through queueing, processing, upload and retries; FlashData does not refresh them. S3-compatible and OSS also require a public HTTPS endpoint_url. COS, BOS, and TOS require region and use fixed provider endpoints. COS bucket names include the APPID. BOS S3-compatible HTTPS delivery supports bj, su, and hkg. GCS requires service_account with project_id, client_email, and private_key. Azure requires account_name and a container SAS sas_token with write permission. Default object_prefix is YYYYMMDD, frozen to the UTC bulk creation date. Files are written to <prefix>/<source>/<bulkId>/results/part-NNNNNNNN.jsonl.gz; manifest.json in the same bulk directory is written last. Each JSONL row includes its input index and completed, failed, or invalid status. Internal R2 results remain available through the result links for 24 hours. Download accepts the normal YouTube download parameters, requires customer storage, and does not permit browser_delivery. Download storage supports the same eight provider types and credential shapes listed above under the storage field. Download storage may include object_prefix; YYYYMMDD tokens resolve to the UTC upload date, while literal prefixes are unchanged."
          },
          "callback_url": {
            "type": "string",
            "format": "uri",
            "maxLength": 2048,
            "description": "Optional public HTTPS endpoint notified once after manifest publication."
          }
        }
      },
      "BulkJobCreated": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "job",
          "upload"
        ],
        "properties": {
          "job": {
            "$ref": "#/components/schemas/BulkJob"
          },
          "upload": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "href",
              "method",
              "expiresAt",
              "contentType"
            ],
            "properties": {
              "href": {
                "type": "string",
                "format": "uri"
              },
              "method": {
                "type": "string",
                "const": "PUT"
              },
              "expiresAt": {
                "type": "string",
                "format": "date-time"
              },
              "contentType": {
                "type": "string",
                "const": "text/plain; charset=utf-8"
              }
            }
          }
        }
      },
      "BulkJobResponse": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "job"
        ],
        "properties": {
          "job": {
            "$ref": "#/components/schemas/BulkJob"
          }
        }
      },
      "UpdateBulkJobRequest": {
        "type": "object",
        "additionalProperties": false,
        "minProperties": 1,
        "properties": {
          "options": {
            "type": "object",
            "additionalProperties": true,
            "description": "Partial option update. Nested storage fields are merged so unchanged credentials do not need to be resent. Data result_storage fields are merged the same way. After all IDs have been scanned, a paused data bulk job accepts credential updates only: access_key and secret_key, S3/S3-compatible/OSS/COS/BOS/TOS session_token, GCS service_account, or Azure sas_token, depending on the storage type. The complete merged configuration is validated before it is stored."
          },
          "callback_url": {
            "type": [
              "string",
              "null"
            ],
            "format": "uri",
            "maxLength": 2048,
            "description": "Replacement completion callback, or null to remove the callback."
          }
        }
      },
      "MarkdownQueryResult": {
        "type": "object",
        "required": [
          "source",
          "status",
          "content"
        ],
        "additionalProperties": true,
        "description": "Markdown result content. content replaces the results array; other response fields such as id, source, status, usage and timestamps are preserved. No generated summary is added. Source URLs and transcript segment start/end times are retained.",
        "properties": {
          "source": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "content": {
            "type": "string",
            "description": "Deterministic Markdown derived from the retrieved source result."
          },
          "usage": {
            "type": "object",
            "additionalProperties": true
          }
        }
      },
      "Query_google_search": {
        "type": "object",
        "required": [
          "source",
          "query"
        ],
        "properties": {
          "source": {
            "type": "string",
            "const": "google_search"
          },
          "query": {
            "type": "string",
            "minLength": 1,
            "maxLength": 2000
          },
          "params": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "gl": {
                "type": "string",
                "minLength": 2,
                "maxLength": 2,
                "pattern": "^[A-Za-z]{2}$",
                "description": "Country code. Set explicitly when needed; omitted values use the search provider’s behavior."
              },
              "hl": {
                "type": "string",
                "minLength": 1,
                "maxLength": 35,
                "pattern": "^[A-Za-z0-9-]+$",
                "description": "Interface language. Set explicitly when needed; omitted values use the search provider’s behavior."
              },
              "location": {
                "type": "string",
                "minLength": 1,
                "maxLength": 200
              },
              "num": {
                "type": "integer",
                "minimum": 1,
                "maximum": 100,
                "description": "Requested result count. Actual count varies by query and search type; no fixed value is added when omitted."
              },
              "page": {
                "type": "integer",
                "minimum": 1,
                "maximum": 100,
                "description": "Requested page. Set explicitly for pagination; each page is a separate query."
              },
              "tbs": {
                "type": "string",
                "minLength": 1,
                "maxLength": 200
              },
              "autocorrect": {
                "type": "boolean"
              }
            }
          }
        },
        "description": "Google Search. Supported modes: realtime, async, batch. Provider-specific storage requirements and conditional media options are validated by the server; see the source reference.",
        "externalDocs": {
          "url": "https://flashdata.dev/docs/sources/google_search"
        }
      },
      "AsyncQuery_google_search": {
        "type": "object",
        "required": [
          "source",
          "query"
        ],
        "properties": {
          "source": {
            "type": "string",
            "const": "google_search"
          },
          "query": {
            "type": "string",
            "minLength": 1,
            "maxLength": 2000
          },
          "params": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "gl": {
                "type": "string",
                "minLength": 2,
                "maxLength": 2,
                "pattern": "^[A-Za-z]{2}$",
                "description": "Country code. Set explicitly when needed; omitted values use the search provider’s behavior."
              },
              "hl": {
                "type": "string",
                "minLength": 1,
                "maxLength": 35,
                "pattern": "^[A-Za-z0-9-]+$",
                "description": "Interface language. Set explicitly when needed; omitted values use the search provider’s behavior."
              },
              "location": {
                "type": "string",
                "minLength": 1,
                "maxLength": 200
              },
              "num": {
                "type": "integer",
                "minimum": 1,
                "maximum": 100,
                "description": "Requested result count. Actual count varies by query and search type; no fixed value is added when omitted."
              },
              "page": {
                "type": "integer",
                "minimum": 1,
                "maximum": 100,
                "description": "Requested page. Set explicitly for pagination; each page is a separate query."
              },
              "tbs": {
                "type": "string",
                "minLength": 1,
                "maxLength": 200
              },
              "autocorrect": {
                "type": "boolean"
              }
            }
          },
          "callback_url": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 2048,
            "description": "Async and batch only. Public HTTPS URL on port 443 without credentials or a fragment. Omit, null or empty string disables callbacks. Server validates public reachability."
          }
        },
        "description": "Google Search. Supported modes: realtime, async, batch. Provider-specific storage requirements and conditional media options are validated by the server; see the source reference.",
        "externalDocs": {
          "url": "https://flashdata.dev/docs/sources/google_search"
        }
      },
      "Query_google_images": {
        "type": "object",
        "required": [
          "source",
          "query"
        ],
        "properties": {
          "source": {
            "type": "string",
            "const": "google_images"
          },
          "query": {
            "type": "string",
            "minLength": 1,
            "maxLength": 2000
          },
          "params": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "gl": {
                "type": "string",
                "minLength": 2,
                "maxLength": 2,
                "pattern": "^[A-Za-z]{2}$",
                "description": "Country code. Set explicitly when needed; omitted values use the search provider’s behavior."
              },
              "hl": {
                "type": "string",
                "minLength": 1,
                "maxLength": 35,
                "pattern": "^[A-Za-z0-9-]+$",
                "description": "Interface language. Set explicitly when needed; omitted values use the search provider’s behavior."
              },
              "location": {
                "type": "string",
                "minLength": 1,
                "maxLength": 200
              },
              "num": {
                "type": "integer",
                "minimum": 1,
                "maximum": 100,
                "description": "Requested result count. Actual count varies by query and search type; no fixed value is added when omitted."
              },
              "page": {
                "type": "integer",
                "minimum": 1,
                "maximum": 100,
                "description": "Requested page. Set explicitly for pagination; each page is a separate query."
              },
              "tbs": {
                "type": "string",
                "minLength": 1,
                "maxLength": 200
              },
              "autocorrect": {
                "type": "boolean"
              }
            }
          }
        },
        "description": "Google Images. Supported modes: realtime, async, batch. Provider-specific storage requirements and conditional media options are validated by the server; see the source reference.",
        "externalDocs": {
          "url": "https://flashdata.dev/docs/sources/google_images"
        }
      },
      "AsyncQuery_google_images": {
        "type": "object",
        "required": [
          "source",
          "query"
        ],
        "properties": {
          "source": {
            "type": "string",
            "const": "google_images"
          },
          "query": {
            "type": "string",
            "minLength": 1,
            "maxLength": 2000
          },
          "params": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "gl": {
                "type": "string",
                "minLength": 2,
                "maxLength": 2,
                "pattern": "^[A-Za-z]{2}$",
                "description": "Country code. Set explicitly when needed; omitted values use the search provider’s behavior."
              },
              "hl": {
                "type": "string",
                "minLength": 1,
                "maxLength": 35,
                "pattern": "^[A-Za-z0-9-]+$",
                "description": "Interface language. Set explicitly when needed; omitted values use the search provider’s behavior."
              },
              "location": {
                "type": "string",
                "minLength": 1,
                "maxLength": 200
              },
              "num": {
                "type": "integer",
                "minimum": 1,
                "maximum": 100,
                "description": "Requested result count. Actual count varies by query and search type; no fixed value is added when omitted."
              },
              "page": {
                "type": "integer",
                "minimum": 1,
                "maximum": 100,
                "description": "Requested page. Set explicitly for pagination; each page is a separate query."
              },
              "tbs": {
                "type": "string",
                "minLength": 1,
                "maxLength": 200
              },
              "autocorrect": {
                "type": "boolean"
              }
            }
          },
          "callback_url": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 2048,
            "description": "Async and batch only. Public HTTPS URL on port 443 without credentials or a fragment. Omit, null or empty string disables callbacks. Server validates public reachability."
          }
        },
        "description": "Google Images. Supported modes: realtime, async, batch. Provider-specific storage requirements and conditional media options are validated by the server; see the source reference.",
        "externalDocs": {
          "url": "https://flashdata.dev/docs/sources/google_images"
        }
      },
      "Query_google_news": {
        "type": "object",
        "required": [
          "source",
          "query"
        ],
        "properties": {
          "source": {
            "type": "string",
            "const": "google_news"
          },
          "query": {
            "type": "string",
            "minLength": 1,
            "maxLength": 2000
          },
          "params": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "gl": {
                "type": "string",
                "minLength": 2,
                "maxLength": 2,
                "pattern": "^[A-Za-z]{2}$",
                "description": "Country code. Set explicitly when needed; omitted values use the search provider’s behavior."
              },
              "hl": {
                "type": "string",
                "minLength": 1,
                "maxLength": 35,
                "pattern": "^[A-Za-z0-9-]+$",
                "description": "Interface language. Set explicitly when needed; omitted values use the search provider’s behavior."
              },
              "location": {
                "type": "string",
                "minLength": 1,
                "maxLength": 200
              },
              "num": {
                "type": "integer",
                "minimum": 1,
                "maximum": 100,
                "description": "Requested result count. Actual count varies by query and search type; no fixed value is added when omitted."
              },
              "page": {
                "type": "integer",
                "minimum": 1,
                "maximum": 100,
                "description": "Requested page. Set explicitly for pagination; each page is a separate query."
              },
              "tbs": {
                "type": "string",
                "minLength": 1,
                "maxLength": 200
              },
              "autocorrect": {
                "type": "boolean"
              }
            }
          }
        },
        "description": "Google News. Supported modes: realtime, async, batch. Provider-specific storage requirements and conditional media options are validated by the server; see the source reference.",
        "externalDocs": {
          "url": "https://flashdata.dev/docs/sources/google_news"
        }
      },
      "AsyncQuery_google_news": {
        "type": "object",
        "required": [
          "source",
          "query"
        ],
        "properties": {
          "source": {
            "type": "string",
            "const": "google_news"
          },
          "query": {
            "type": "string",
            "minLength": 1,
            "maxLength": 2000
          },
          "params": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "gl": {
                "type": "string",
                "minLength": 2,
                "maxLength": 2,
                "pattern": "^[A-Za-z]{2}$",
                "description": "Country code. Set explicitly when needed; omitted values use the search provider’s behavior."
              },
              "hl": {
                "type": "string",
                "minLength": 1,
                "maxLength": 35,
                "pattern": "^[A-Za-z0-9-]+$",
                "description": "Interface language. Set explicitly when needed; omitted values use the search provider’s behavior."
              },
              "location": {
                "type": "string",
                "minLength": 1,
                "maxLength": 200
              },
              "num": {
                "type": "integer",
                "minimum": 1,
                "maximum": 100,
                "description": "Requested result count. Actual count varies by query and search type; no fixed value is added when omitted."
              },
              "page": {
                "type": "integer",
                "minimum": 1,
                "maximum": 100,
                "description": "Requested page. Set explicitly for pagination; each page is a separate query."
              },
              "tbs": {
                "type": "string",
                "minLength": 1,
                "maxLength": 200
              },
              "autocorrect": {
                "type": "boolean"
              }
            }
          },
          "callback_url": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 2048,
            "description": "Async and batch only. Public HTTPS URL on port 443 without credentials or a fragment. Omit, null or empty string disables callbacks. Server validates public reachability."
          }
        },
        "description": "Google News. Supported modes: realtime, async, batch. Provider-specific storage requirements and conditional media options are validated by the server; see the source reference.",
        "externalDocs": {
          "url": "https://flashdata.dev/docs/sources/google_news"
        }
      },
      "Query_google_shopping": {
        "type": "object",
        "required": [
          "source",
          "query"
        ],
        "properties": {
          "source": {
            "type": "string",
            "const": "google_shopping"
          },
          "query": {
            "type": "string",
            "minLength": 1,
            "maxLength": 2000
          },
          "params": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "gl": {
                "type": "string",
                "minLength": 2,
                "maxLength": 2,
                "pattern": "^[A-Za-z]{2}$",
                "description": "Country code. Set explicitly when needed; omitted values use the search provider’s behavior."
              },
              "hl": {
                "type": "string",
                "minLength": 1,
                "maxLength": 35,
                "pattern": "^[A-Za-z0-9-]+$",
                "description": "Interface language. Set explicitly when needed; omitted values use the search provider’s behavior."
              },
              "location": {
                "type": "string",
                "minLength": 1,
                "maxLength": 200
              },
              "num": {
                "type": "integer",
                "minimum": 1,
                "maximum": 100,
                "description": "Requested result count. Actual count varies by query and search type; no fixed value is added when omitted."
              },
              "page": {
                "type": "integer",
                "minimum": 1,
                "maximum": 100,
                "description": "Requested page. Set explicitly for pagination; each page is a separate query."
              },
              "tbs": {
                "type": "string",
                "minLength": 1,
                "maxLength": 200
              },
              "autocorrect": {
                "type": "boolean"
              }
            }
          }
        },
        "description": "Google Shopping. Supported modes: realtime, async, batch. Provider-specific storage requirements and conditional media options are validated by the server; see the source reference.",
        "externalDocs": {
          "url": "https://flashdata.dev/docs/sources/google_shopping"
        }
      },
      "AsyncQuery_google_shopping": {
        "type": "object",
        "required": [
          "source",
          "query"
        ],
        "properties": {
          "source": {
            "type": "string",
            "const": "google_shopping"
          },
          "query": {
            "type": "string",
            "minLength": 1,
            "maxLength": 2000
          },
          "params": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "gl": {
                "type": "string",
                "minLength": 2,
                "maxLength": 2,
                "pattern": "^[A-Za-z]{2}$",
                "description": "Country code. Set explicitly when needed; omitted values use the search provider’s behavior."
              },
              "hl": {
                "type": "string",
                "minLength": 1,
                "maxLength": 35,
                "pattern": "^[A-Za-z0-9-]+$",
                "description": "Interface language. Set explicitly when needed; omitted values use the search provider’s behavior."
              },
              "location": {
                "type": "string",
                "minLength": 1,
                "maxLength": 200
              },
              "num": {
                "type": "integer",
                "minimum": 1,
                "maximum": 100,
                "description": "Requested result count. Actual count varies by query and search type; no fixed value is added when omitted."
              },
              "page": {
                "type": "integer",
                "minimum": 1,
                "maximum": 100,
                "description": "Requested page. Set explicitly for pagination; each page is a separate query."
              },
              "tbs": {
                "type": "string",
                "minLength": 1,
                "maxLength": 200
              },
              "autocorrect": {
                "type": "boolean"
              }
            }
          },
          "callback_url": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 2048,
            "description": "Async and batch only. Public HTTPS URL on port 443 without credentials or a fragment. Omit, null or empty string disables callbacks. Server validates public reachability."
          }
        },
        "description": "Google Shopping. Supported modes: realtime, async, batch. Provider-specific storage requirements and conditional media options are validated by the server; see the source reference.",
        "externalDocs": {
          "url": "https://flashdata.dev/docs/sources/google_shopping"
        }
      },
      "Query_google_videos": {
        "type": "object",
        "required": [
          "source",
          "query"
        ],
        "properties": {
          "source": {
            "type": "string",
            "const": "google_videos"
          },
          "query": {
            "type": "string",
            "minLength": 1,
            "maxLength": 2000
          },
          "params": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "gl": {
                "type": "string",
                "minLength": 2,
                "maxLength": 2,
                "pattern": "^[A-Za-z]{2}$",
                "description": "Country code. Set explicitly when needed; omitted values use the search provider’s behavior."
              },
              "hl": {
                "type": "string",
                "minLength": 1,
                "maxLength": 35,
                "pattern": "^[A-Za-z0-9-]+$",
                "description": "Interface language. Set explicitly when needed; omitted values use the search provider’s behavior."
              },
              "location": {
                "type": "string",
                "minLength": 1,
                "maxLength": 200
              },
              "num": {
                "type": "integer",
                "minimum": 1,
                "maximum": 100,
                "description": "Requested result count. Actual count varies by query and search type; no fixed value is added when omitted."
              },
              "page": {
                "type": "integer",
                "minimum": 1,
                "maximum": 100,
                "description": "Requested page. Set explicitly for pagination; each page is a separate query."
              },
              "tbs": {
                "type": "string",
                "minLength": 1,
                "maxLength": 200
              },
              "autocorrect": {
                "type": "boolean"
              }
            }
          }
        },
        "description": "Google Videos. Supported modes: realtime, async, batch. Provider-specific storage requirements and conditional media options are validated by the server; see the source reference.",
        "externalDocs": {
          "url": "https://flashdata.dev/docs/sources/google_videos"
        }
      },
      "AsyncQuery_google_videos": {
        "type": "object",
        "required": [
          "source",
          "query"
        ],
        "properties": {
          "source": {
            "type": "string",
            "const": "google_videos"
          },
          "query": {
            "type": "string",
            "minLength": 1,
            "maxLength": 2000
          },
          "params": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "gl": {
                "type": "string",
                "minLength": 2,
                "maxLength": 2,
                "pattern": "^[A-Za-z]{2}$",
                "description": "Country code. Set explicitly when needed; omitted values use the search provider’s behavior."
              },
              "hl": {
                "type": "string",
                "minLength": 1,
                "maxLength": 35,
                "pattern": "^[A-Za-z0-9-]+$",
                "description": "Interface language. Set explicitly when needed; omitted values use the search provider’s behavior."
              },
              "location": {
                "type": "string",
                "minLength": 1,
                "maxLength": 200
              },
              "num": {
                "type": "integer",
                "minimum": 1,
                "maximum": 100,
                "description": "Requested result count. Actual count varies by query and search type; no fixed value is added when omitted."
              },
              "page": {
                "type": "integer",
                "minimum": 1,
                "maximum": 100,
                "description": "Requested page. Set explicitly for pagination; each page is a separate query."
              },
              "tbs": {
                "type": "string",
                "minLength": 1,
                "maxLength": 200
              },
              "autocorrect": {
                "type": "boolean"
              }
            }
          },
          "callback_url": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 2048,
            "description": "Async and batch only. Public HTTPS URL on port 443 without credentials or a fragment. Omit, null or empty string disables callbacks. Server validates public reachability."
          }
        },
        "description": "Google Videos. Supported modes: realtime, async, batch. Provider-specific storage requirements and conditional media options are validated by the server; see the source reference.",
        "externalDocs": {
          "url": "https://flashdata.dev/docs/sources/google_videos"
        }
      },
      "Query_google_places": {
        "type": "object",
        "required": [
          "source",
          "query"
        ],
        "properties": {
          "source": {
            "type": "string",
            "const": "google_places"
          },
          "query": {
            "type": "string",
            "minLength": 1,
            "maxLength": 2000
          },
          "params": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "gl": {
                "type": "string",
                "minLength": 2,
                "maxLength": 2,
                "pattern": "^[A-Za-z]{2}$",
                "description": "Country code. Set explicitly when needed; omitted values use the search provider’s behavior."
              },
              "hl": {
                "type": "string",
                "minLength": 1,
                "maxLength": 35,
                "pattern": "^[A-Za-z0-9-]+$",
                "description": "Interface language. Set explicitly when needed; omitted values use the search provider’s behavior."
              },
              "location": {
                "type": "string",
                "minLength": 1,
                "maxLength": 200
              },
              "num": {
                "type": "integer",
                "minimum": 1,
                "maximum": 100,
                "description": "Requested result count. Actual count varies by query and search type; no fixed value is added when omitted."
              },
              "page": {
                "type": "integer",
                "minimum": 1,
                "maximum": 100,
                "description": "Requested page. Set explicitly for pagination; each page is a separate query."
              },
              "tbs": {
                "type": "string",
                "minLength": 1,
                "maxLength": 200
              },
              "autocorrect": {
                "type": "boolean"
              }
            }
          }
        },
        "description": "Google Places. Supported modes: realtime, async, batch. Provider-specific storage requirements and conditional media options are validated by the server; see the source reference.",
        "externalDocs": {
          "url": "https://flashdata.dev/docs/sources/google_places"
        }
      },
      "AsyncQuery_google_places": {
        "type": "object",
        "required": [
          "source",
          "query"
        ],
        "properties": {
          "source": {
            "type": "string",
            "const": "google_places"
          },
          "query": {
            "type": "string",
            "minLength": 1,
            "maxLength": 2000
          },
          "params": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "gl": {
                "type": "string",
                "minLength": 2,
                "maxLength": 2,
                "pattern": "^[A-Za-z]{2}$",
                "description": "Country code. Set explicitly when needed; omitted values use the search provider’s behavior."
              },
              "hl": {
                "type": "string",
                "minLength": 1,
                "maxLength": 35,
                "pattern": "^[A-Za-z0-9-]+$",
                "description": "Interface language. Set explicitly when needed; omitted values use the search provider’s behavior."
              },
              "location": {
                "type": "string",
                "minLength": 1,
                "maxLength": 200
              },
              "num": {
                "type": "integer",
                "minimum": 1,
                "maximum": 100,
                "description": "Requested result count. Actual count varies by query and search type; no fixed value is added when omitted."
              },
              "page": {
                "type": "integer",
                "minimum": 1,
                "maximum": 100,
                "description": "Requested page. Set explicitly for pagination; each page is a separate query."
              },
              "tbs": {
                "type": "string",
                "minLength": 1,
                "maxLength": 200
              },
              "autocorrect": {
                "type": "boolean"
              }
            }
          },
          "callback_url": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 2048,
            "description": "Async and batch only. Public HTTPS URL on port 443 without credentials or a fragment. Omit, null or empty string disables callbacks. Server validates public reachability."
          }
        },
        "description": "Google Places. Supported modes: realtime, async, batch. Provider-specific storage requirements and conditional media options are validated by the server; see the source reference.",
        "externalDocs": {
          "url": "https://flashdata.dev/docs/sources/google_places"
        }
      },
      "Query_youtube_search": {
        "type": "object",
        "required": [
          "source",
          "query"
        ],
        "properties": {
          "source": {
            "type": "string",
            "const": "youtube_search"
          },
          "query": {
            "type": "string",
            "minLength": 1,
            "maxLength": 2000
          },
          "params": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "max_results": {
                "type": "integer",
                "minimum": 1,
                "maximum": 20,
                "default": 20
              },
              "filters": {
                "type": [
                  "object",
                  "null"
                ],
                "additionalProperties": false,
                "properties": {
                  "360": {
                    "type": "boolean"
                  },
                  "duration": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 2000,
                    "enum": [
                      "<4",
                      "4-20",
                      ">20"
                    ]
                  },
                  "sort_by": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 2000,
                    "enum": [
                      "rating",
                      "relevance",
                      "view_count",
                      "upload_date"
                    ]
                  },
                  "type": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 2000,
                    "enum": [
                      "video",
                      "channel",
                      "playlist",
                      "movie"
                    ]
                  },
                  "upload_date": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 2000,
                    "enum": [
                      "today",
                      "last_hour",
                      "this_week",
                      "this_month",
                      "this_year"
                    ]
                  },
                  "3d": {
                    "type": "boolean"
                  },
                  "4k": {
                    "type": "boolean"
                  },
                  "creative_commons": {
                    "type": "boolean"
                  },
                  "hd": {
                    "type": "boolean"
                  },
                  "hdr": {
                    "type": "boolean"
                  },
                  "live": {
                    "type": "boolean"
                  },
                  "location": {
                    "type": "boolean"
                  },
                  "purchased": {
                    "type": "boolean"
                  },
                  "subtitles": {
                    "type": "boolean"
                  },
                  "vr180": {
                    "type": "boolean"
                  }
                }
              }
            }
          }
        },
        "description": "YouTube Search. Supported modes: realtime, async, batch. Provider-specific storage requirements and conditional media options are validated by the server; see the source reference.",
        "externalDocs": {
          "url": "https://flashdata.dev/docs/sources/youtube_search"
        }
      },
      "AsyncQuery_youtube_search": {
        "type": "object",
        "required": [
          "source",
          "query"
        ],
        "properties": {
          "source": {
            "type": "string",
            "const": "youtube_search"
          },
          "query": {
            "type": "string",
            "minLength": 1,
            "maxLength": 2000
          },
          "params": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "max_results": {
                "type": "integer",
                "minimum": 1,
                "maximum": 20,
                "default": 20
              },
              "filters": {
                "type": [
                  "object",
                  "null"
                ],
                "additionalProperties": false,
                "properties": {
                  "360": {
                    "type": "boolean"
                  },
                  "duration": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 2000,
                    "enum": [
                      "<4",
                      "4-20",
                      ">20"
                    ]
                  },
                  "sort_by": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 2000,
                    "enum": [
                      "rating",
                      "relevance",
                      "view_count",
                      "upload_date"
                    ]
                  },
                  "type": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 2000,
                    "enum": [
                      "video",
                      "channel",
                      "playlist",
                      "movie"
                    ]
                  },
                  "upload_date": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 2000,
                    "enum": [
                      "today",
                      "last_hour",
                      "this_week",
                      "this_month",
                      "this_year"
                    ]
                  },
                  "3d": {
                    "type": "boolean"
                  },
                  "4k": {
                    "type": "boolean"
                  },
                  "creative_commons": {
                    "type": "boolean"
                  },
                  "hd": {
                    "type": "boolean"
                  },
                  "hdr": {
                    "type": "boolean"
                  },
                  "live": {
                    "type": "boolean"
                  },
                  "location": {
                    "type": "boolean"
                  },
                  "purchased": {
                    "type": "boolean"
                  },
                  "subtitles": {
                    "type": "boolean"
                  },
                  "vr180": {
                    "type": "boolean"
                  }
                }
              }
            }
          },
          "callback_url": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 2048,
            "description": "Async and batch only. Public HTTPS URL on port 443 without credentials or a fragment. Omit, null or empty string disables callbacks. Server validates public reachability."
          }
        },
        "description": "YouTube Search. Supported modes: realtime, async, batch. Provider-specific storage requirements and conditional media options are validated by the server; see the source reference.",
        "externalDocs": {
          "url": "https://flashdata.dev/docs/sources/youtube_search"
        }
      },
      "Query_youtube_search_extended": {
        "type": "object",
        "required": [
          "source",
          "query"
        ],
        "properties": {
          "source": {
            "type": "string",
            "const": "youtube_search_extended"
          },
          "query": {
            "type": "string",
            "minLength": 1,
            "maxLength": 2000
          },
          "params": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "max_results": {
                "type": "integer",
                "minimum": 1,
                "maximum": 700,
                "default": 20
              },
              "filters": {
                "type": [
                  "object",
                  "null"
                ],
                "additionalProperties": false,
                "properties": {
                  "360": {
                    "type": "boolean"
                  },
                  "duration": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 2000,
                    "enum": [
                      "<4",
                      "4-20",
                      ">20"
                    ]
                  },
                  "sort_by": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 2000,
                    "enum": [
                      "rating",
                      "relevance",
                      "view_count",
                      "upload_date"
                    ]
                  },
                  "type": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 2000,
                    "enum": [
                      "video",
                      "channel",
                      "playlist",
                      "movie"
                    ]
                  },
                  "upload_date": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 2000,
                    "enum": [
                      "today",
                      "last_hour",
                      "this_week",
                      "this_month",
                      "this_year"
                    ]
                  },
                  "3d": {
                    "type": "boolean"
                  },
                  "4k": {
                    "type": "boolean"
                  },
                  "creative_commons": {
                    "type": "boolean"
                  },
                  "hd": {
                    "type": "boolean"
                  },
                  "hdr": {
                    "type": "boolean"
                  },
                  "live": {
                    "type": "boolean"
                  },
                  "location": {
                    "type": "boolean"
                  },
                  "purchased": {
                    "type": "boolean"
                  },
                  "subtitles": {
                    "type": "boolean"
                  },
                  "vr180": {
                    "type": "boolean"
                  }
                }
              }
            }
          }
        },
        "description": "YouTube Extended Search. Supported modes: realtime, async, batch. Provider-specific storage requirements and conditional media options are validated by the server; see the source reference.",
        "externalDocs": {
          "url": "https://flashdata.dev/docs/sources/youtube_search_extended"
        }
      },
      "AsyncQuery_youtube_search_extended": {
        "type": "object",
        "required": [
          "source",
          "query"
        ],
        "properties": {
          "source": {
            "type": "string",
            "const": "youtube_search_extended"
          },
          "query": {
            "type": "string",
            "minLength": 1,
            "maxLength": 2000
          },
          "params": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "max_results": {
                "type": "integer",
                "minimum": 1,
                "maximum": 700,
                "default": 20
              },
              "filters": {
                "type": [
                  "object",
                  "null"
                ],
                "additionalProperties": false,
                "properties": {
                  "360": {
                    "type": "boolean"
                  },
                  "duration": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 2000,
                    "enum": [
                      "<4",
                      "4-20",
                      ">20"
                    ]
                  },
                  "sort_by": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 2000,
                    "enum": [
                      "rating",
                      "relevance",
                      "view_count",
                      "upload_date"
                    ]
                  },
                  "type": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 2000,
                    "enum": [
                      "video",
                      "channel",
                      "playlist",
                      "movie"
                    ]
                  },
                  "upload_date": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 2000,
                    "enum": [
                      "today",
                      "last_hour",
                      "this_week",
                      "this_month",
                      "this_year"
                    ]
                  },
                  "3d": {
                    "type": "boolean"
                  },
                  "4k": {
                    "type": "boolean"
                  },
                  "creative_commons": {
                    "type": "boolean"
                  },
                  "hd": {
                    "type": "boolean"
                  },
                  "hdr": {
                    "type": "boolean"
                  },
                  "live": {
                    "type": "boolean"
                  },
                  "location": {
                    "type": "boolean"
                  },
                  "purchased": {
                    "type": "boolean"
                  },
                  "subtitles": {
                    "type": "boolean"
                  },
                  "vr180": {
                    "type": "boolean"
                  }
                }
              }
            }
          },
          "callback_url": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 2048,
            "description": "Async and batch only. Public HTTPS URL on port 443 without credentials or a fragment. Omit, null or empty string disables callbacks. Server validates public reachability."
          }
        },
        "description": "YouTube Extended Search. Supported modes: realtime, async, batch. Provider-specific storage requirements and conditional media options are validated by the server; see the source reference.",
        "externalDocs": {
          "url": "https://flashdata.dev/docs/sources/youtube_search_extended"
        }
      },
      "Query_youtube_metadata": {
        "type": "object",
        "required": [
          "source",
          "video_id"
        ],
        "properties": {
          "source": {
            "type": "string",
            "const": "youtube_metadata"
          },
          "video_id": {
            "type": "string",
            "minLength": 11,
            "maxLength": 11,
            "pattern": "^[A-Za-z0-9_-]{11}$"
          },
          "params": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "include_formats": {
                "type": "boolean",
                "default": true
              },
              "include_chapters": {
                "type": "boolean",
                "default": true
              }
            }
          }
        },
        "description": "YouTube Metadata. Supported modes: realtime, async, batch. Provider-specific storage requirements and conditional media options are validated by the server; see the source reference.",
        "externalDocs": {
          "url": "https://flashdata.dev/docs/sources/youtube_metadata"
        }
      },
      "AsyncQuery_youtube_metadata": {
        "type": "object",
        "required": [
          "source",
          "video_id"
        ],
        "properties": {
          "source": {
            "type": "string",
            "const": "youtube_metadata"
          },
          "video_id": {
            "type": "string",
            "minLength": 11,
            "maxLength": 11,
            "pattern": "^[A-Za-z0-9_-]{11}$"
          },
          "params": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "include_formats": {
                "type": "boolean",
                "default": true
              },
              "include_chapters": {
                "type": "boolean",
                "default": true
              }
            }
          },
          "callback_url": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 2048,
            "description": "Async and batch only. Public HTTPS URL on port 443 without credentials or a fragment. Omit, null or empty string disables callbacks. Server validates public reachability."
          }
        },
        "description": "YouTube Metadata. Supported modes: realtime, async, batch. Provider-specific storage requirements and conditional media options are validated by the server; see the source reference.",
        "externalDocs": {
          "url": "https://flashdata.dev/docs/sources/youtube_metadata"
        }
      },
      "Query_youtube_transcript": {
        "type": "object",
        "required": [
          "source",
          "video_id"
        ],
        "properties": {
          "source": {
            "type": "string",
            "const": "youtube_transcript"
          },
          "video_id": {
            "type": "string",
            "minLength": 11,
            "maxLength": 11,
            "pattern": "^[A-Za-z0-9_-]{11}$"
          },
          "params": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "language": {
                "oneOf": [
                  {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 35,
                    "pattern": "^[A-Za-z0-9-]+$"
                  },
                  {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 35,
                      "pattern": "^[A-Za-z0-9-]+$"
                    },
                    "minItems": 1,
                    "maxItems": 10,
                    "uniqueItems": true
                  }
                ],
                "description": "Omit language for English. Use a language code, \"default\" for the marked playback language, or \"original\" for the original audio language. Arrays accept 1–10 distinct selectors; explicit -orig codes stay exact. With auto=true, try these sources in the target language: native YouTube speech recognition, uploader captions, automatic captions of unknown type, then YouTube translations. With auto=false, only uploader captions are eligible. languageCode identifies the selected track; requestedLanguageCode records the selector when it differs. Actual track source: youtube_asr, youtube_translated, uploader, or youtube_auto_unknown when YouTube does not identify the automatic subtype."
              },
              "auto": {
                "type": "boolean",
                "default": true,
                "description": "With auto=true, try these sources in the target language: native YouTube speech recognition, uploader captions, automatic captions of unknown type, then YouTube translations. With auto=false, only uploader captions are eligible."
              }
            }
          }
        },
        "description": "YouTube Transcript. Supported modes: realtime, async, batch. Provider-specific storage requirements and conditional media options are validated by the server; see the source reference.",
        "externalDocs": {
          "url": "https://flashdata.dev/docs/sources/youtube_transcript"
        }
      },
      "AsyncQuery_youtube_transcript": {
        "type": "object",
        "required": [
          "source",
          "video_id"
        ],
        "properties": {
          "source": {
            "type": "string",
            "const": "youtube_transcript"
          },
          "video_id": {
            "type": "string",
            "minLength": 11,
            "maxLength": 11,
            "pattern": "^[A-Za-z0-9_-]{11}$"
          },
          "params": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "language": {
                "oneOf": [
                  {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 35,
                    "pattern": "^[A-Za-z0-9-]+$"
                  },
                  {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 35,
                      "pattern": "^[A-Za-z0-9-]+$"
                    },
                    "minItems": 1,
                    "maxItems": 10,
                    "uniqueItems": true
                  }
                ],
                "description": "Omit language for English. Use a language code, \"default\" for the marked playback language, or \"original\" for the original audio language. Arrays accept 1–10 distinct selectors; explicit -orig codes stay exact. With auto=true, try these sources in the target language: native YouTube speech recognition, uploader captions, automatic captions of unknown type, then YouTube translations. With auto=false, only uploader captions are eligible. languageCode identifies the selected track; requestedLanguageCode records the selector when it differs. Actual track source: youtube_asr, youtube_translated, uploader, or youtube_auto_unknown when YouTube does not identify the automatic subtype."
              },
              "auto": {
                "type": "boolean",
                "default": true,
                "description": "With auto=true, try these sources in the target language: native YouTube speech recognition, uploader captions, automatic captions of unknown type, then YouTube translations. With auto=false, only uploader captions are eligible."
              }
            }
          },
          "callback_url": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 2048,
            "description": "Async and batch only. Public HTTPS URL on port 443 without credentials or a fragment. Omit, null or empty string disables callbacks. Server validates public reachability."
          }
        },
        "description": "YouTube Transcript. Supported modes: realtime, async, batch. Provider-specific storage requirements and conditional media options are validated by the server; see the source reference.",
        "externalDocs": {
          "url": "https://flashdata.dev/docs/sources/youtube_transcript"
        }
      },
      "Query_youtube_captions": {
        "type": "object",
        "required": [
          "source",
          "video_id"
        ],
        "properties": {
          "source": {
            "type": "string",
            "const": "youtube_captions"
          },
          "video_id": {
            "type": "string",
            "minLength": 11,
            "maxLength": 11,
            "pattern": "^[A-Za-z0-9_-]{11}$"
          },
          "params": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "language": {
                "oneOf": [
                  {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 35,
                    "pattern": "^[A-Za-z0-9-]+$"
                  },
                  {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 35,
                      "pattern": "^[A-Za-z0-9-]+$"
                    },
                    "minItems": 1,
                    "maxItems": 10,
                    "uniqueItems": true
                  }
                ],
                "description": "Omit language for English. Use a language code, \"default\" for the marked playback language, or \"original\" for the original audio language. Arrays accept 1–10 distinct selectors; explicit -orig codes stay exact. With auto=true, try these sources in the target language: native YouTube speech recognition, uploader captions, automatic captions of unknown type, then YouTube translations. With auto=false, only uploader captions are eligible. languageCode identifies the selected track; requestedLanguageCode records the selector when it differs. Actual track source: youtube_asr, youtube_translated, uploader, or youtube_auto_unknown when YouTube does not identify the automatic subtype."
              },
              "auto": {
                "type": "boolean",
                "default": false,
                "description": "With auto=true, try these sources in the target language: native YouTube speech recognition, uploader captions, automatic captions of unknown type, then YouTube translations. With auto=false, only uploader captions are eligible."
              }
            }
          }
        },
        "description": "YouTube Captions. Supported modes: realtime, async, batch. Provider-specific storage requirements and conditional media options are validated by the server; see the source reference.",
        "externalDocs": {
          "url": "https://flashdata.dev/docs/sources/youtube_captions"
        }
      },
      "AsyncQuery_youtube_captions": {
        "type": "object",
        "required": [
          "source",
          "video_id"
        ],
        "properties": {
          "source": {
            "type": "string",
            "const": "youtube_captions"
          },
          "video_id": {
            "type": "string",
            "minLength": 11,
            "maxLength": 11,
            "pattern": "^[A-Za-z0-9_-]{11}$"
          },
          "params": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "language": {
                "oneOf": [
                  {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 35,
                    "pattern": "^[A-Za-z0-9-]+$"
                  },
                  {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 35,
                      "pattern": "^[A-Za-z0-9-]+$"
                    },
                    "minItems": 1,
                    "maxItems": 10,
                    "uniqueItems": true
                  }
                ],
                "description": "Omit language for English. Use a language code, \"default\" for the marked playback language, or \"original\" for the original audio language. Arrays accept 1–10 distinct selectors; explicit -orig codes stay exact. With auto=true, try these sources in the target language: native YouTube speech recognition, uploader captions, automatic captions of unknown type, then YouTube translations. With auto=false, only uploader captions are eligible. languageCode identifies the selected track; requestedLanguageCode records the selector when it differs. Actual track source: youtube_asr, youtube_translated, uploader, or youtube_auto_unknown when YouTube does not identify the automatic subtype."
              },
              "auto": {
                "type": "boolean",
                "default": false,
                "description": "With auto=true, try these sources in the target language: native YouTube speech recognition, uploader captions, automatic captions of unknown type, then YouTube translations. With auto=false, only uploader captions are eligible."
              }
            }
          },
          "callback_url": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 2048,
            "description": "Async and batch only. Public HTTPS URL on port 443 without credentials or a fragment. Omit, null or empty string disables callbacks. Server validates public reachability."
          }
        },
        "description": "YouTube Captions. Supported modes: realtime, async, batch. Provider-specific storage requirements and conditional media options are validated by the server; see the source reference.",
        "externalDocs": {
          "url": "https://flashdata.dev/docs/sources/youtube_captions"
        }
      },
      "Query_youtube_trainability": {
        "type": "object",
        "required": [
          "source",
          "video_id"
        ],
        "properties": {
          "source": {
            "type": "string",
            "const": "youtube_trainability"
          },
          "video_id": {
            "type": "string",
            "minLength": 11,
            "maxLength": 11,
            "pattern": "^[A-Za-z0-9_-]{11}$"
          },
          "params": {
            "type": "object",
            "additionalProperties": false,
            "properties": {}
          }
        },
        "description": "YouTube Trainability. Supported modes: realtime, async, batch. Provider-specific storage requirements and conditional media options are validated by the server; see the source reference.",
        "externalDocs": {
          "url": "https://flashdata.dev/docs/sources/youtube_trainability"
        }
      },
      "AsyncQuery_youtube_trainability": {
        "type": "object",
        "required": [
          "source",
          "video_id"
        ],
        "properties": {
          "source": {
            "type": "string",
            "const": "youtube_trainability"
          },
          "video_id": {
            "type": "string",
            "minLength": 11,
            "maxLength": 11,
            "pattern": "^[A-Za-z0-9_-]{11}$"
          },
          "params": {
            "type": "object",
            "additionalProperties": false,
            "properties": {}
          },
          "callback_url": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 2048,
            "description": "Async and batch only. Public HTTPS URL on port 443 without credentials or a fragment. Omit, null or empty string disables callbacks. Server validates public reachability."
          }
        },
        "description": "YouTube Trainability. Supported modes: realtime, async, batch. Provider-specific storage requirements and conditional media options are validated by the server; see the source reference.",
        "externalDocs": {
          "url": "https://flashdata.dev/docs/sources/youtube_trainability"
        }
      },
      "Query_youtube_channel": {
        "type": "object",
        "required": [
          "source",
          "handle"
        ],
        "properties": {
          "source": {
            "type": "string",
            "const": "youtube_channel"
          },
          "handle": {
            "type": "string",
            "minLength": 1,
            "maxLength": 100
          },
          "params": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "video_limit": {
                "type": "integer",
                "minimum": 1,
                "maximum": 100,
                "default": 20
              }
            }
          }
        },
        "description": "YouTube Channel. Supported modes: realtime, async, batch. Provider-specific storage requirements and conditional media options are validated by the server; see the source reference.",
        "externalDocs": {
          "url": "https://flashdata.dev/docs/sources/youtube_channel"
        }
      },
      "AsyncQuery_youtube_channel": {
        "type": "object",
        "required": [
          "source",
          "handle"
        ],
        "properties": {
          "source": {
            "type": "string",
            "const": "youtube_channel"
          },
          "handle": {
            "type": "string",
            "minLength": 1,
            "maxLength": 100
          },
          "params": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "video_limit": {
                "type": "integer",
                "minimum": 1,
                "maximum": 100,
                "default": 20
              }
            }
          },
          "callback_url": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 2048,
            "description": "Async and batch only. Public HTTPS URL on port 443 without credentials or a fragment. Omit, null or empty string disables callbacks. Server validates public reachability."
          }
        },
        "description": "YouTube Channel. Supported modes: realtime, async, batch. Provider-specific storage requirements and conditional media options are validated by the server; see the source reference.",
        "externalDocs": {
          "url": "https://flashdata.dev/docs/sources/youtube_channel"
        }
      },
      "Query_youtube_suggestions": {
        "type": "object",
        "required": [
          "source",
          "query"
        ],
        "properties": {
          "source": {
            "type": "string",
            "const": "youtube_suggestions"
          },
          "query": {
            "type": "string",
            "minLength": 1,
            "maxLength": 2000
          },
          "params": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "language": {
                "type": "string",
                "minLength": 1,
                "maxLength": 35,
                "pattern": "^[A-Za-z0-9-]+$",
                "default": "en"
              },
              "region": {
                "type": "string",
                "minLength": 2,
                "maxLength": 2,
                "default": "US",
                "pattern": "^[A-Za-z]{2}$"
              }
            }
          }
        },
        "description": "YouTube Suggestions. Supported modes: realtime, async, batch. Provider-specific storage requirements and conditional media options are validated by the server; see the source reference.",
        "externalDocs": {
          "url": "https://flashdata.dev/docs/sources/youtube_suggestions"
        }
      },
      "AsyncQuery_youtube_suggestions": {
        "type": "object",
        "required": [
          "source",
          "query"
        ],
        "properties": {
          "source": {
            "type": "string",
            "const": "youtube_suggestions"
          },
          "query": {
            "type": "string",
            "minLength": 1,
            "maxLength": 2000
          },
          "params": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "language": {
                "type": "string",
                "minLength": 1,
                "maxLength": 35,
                "pattern": "^[A-Za-z0-9-]+$",
                "default": "en"
              },
              "region": {
                "type": "string",
                "minLength": 2,
                "maxLength": 2,
                "default": "US",
                "pattern": "^[A-Za-z]{2}$"
              }
            }
          },
          "callback_url": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 2048,
            "description": "Async and batch only. Public HTTPS URL on port 443 without credentials or a fragment. Omit, null or empty string disables callbacks. Server validates public reachability."
          }
        },
        "description": "YouTube Suggestions. Supported modes: realtime, async, batch. Provider-specific storage requirements and conditional media options are validated by the server; see the source reference.",
        "externalDocs": {
          "url": "https://flashdata.dev/docs/sources/youtube_suggestions"
        }
      },
      "Query_youtube_download": {
        "type": "object",
        "required": [
          "source",
          "video_id",
          "params"
        ],
        "properties": {
          "source": {
            "type": "string",
            "const": "youtube_download"
          },
          "video_id": {
            "type": "string",
            "minLength": 11,
            "maxLength": 11,
            "pattern": "^[A-Za-z0-9_-]{11}$"
          },
          "params": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "download_type": {
                "type": "string",
                "minLength": 1,
                "maxLength": 11,
                "default": "audio_video",
                "enum": [
                  "audio_video",
                  "video",
                  "audio"
                ]
              },
              "video_quality": {
                "type": "string",
                "minLength": 1,
                "maxLength": 40,
                "default": "<=720",
                "enum": [
                  "best",
                  "worst",
                  "<=144",
                  "==144",
                  ">=144",
                  "<=360",
                  "==360",
                  ">=360",
                  "<=480",
                  "==480",
                  ">=480",
                  "<=720",
                  "==720",
                  ">=720",
                  "<=1080",
                  "==1080",
                  ">=1080",
                  "<=1440",
                  "==1440",
                  ">=1440",
                  "<=2160",
                  "==2160",
                  ">=2160",
                  "<=4320",
                  "==4320",
                  ">=4320"
                ]
              },
              "fps": {
                "type": "string",
                "minLength": 1,
                "maxLength": 6,
                "pattern": "^(?:>=|<=|==)(?:[1-9]\\d?|1\\d\\d|2[0-3]\\d|240)$"
              },
              "audio_language": {
                "type": "string",
                "minLength": 1,
                "maxLength": 8,
                "default": "default",
                "enum": [
                  "default",
                  "original"
                ]
              },
              "audio_quality": {
                "type": "string",
                "minLength": 1,
                "maxLength": 10,
                "default": "best",
                "enum": [
                  "best",
                  "320",
                  "256",
                  "192",
                  "128"
                ]
              },
              "yt_dlp_format": {
                "type": "string",
                "minLength": 1,
                "maxLength": 1024
              },
              "upload_metadata": {
                "type": "boolean",
                "default": false
              },
              "output_format": {
                "type": "string",
                "minLength": 1,
                "maxLength": 10,
                "default": "mp4",
                "enum": [
                  "mp4",
                  "webm",
                  "mkv",
                  "m4a",
                  "mp3",
                  "opus"
                ]
              },
              "start_at": {
                "type": "string",
                "minLength": 1,
                "maxLength": 8,
                "pattern": "^\\d{1,2}:[0-5]\\d:[0-5]\\d$"
              },
              "end_at": {
                "type": "string",
                "minLength": 1,
                "maxLength": 8,
                "pattern": "^\\d{1,2}:[0-5]\\d:[0-5]\\d$"
              },
              "storage": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "storage_type",
                  "storage_url"
                ],
                "description": "Customer-owned destination, using the same fields as Download API params.storage. Supply credentials from your configured storage; do not invent values or display secrets. GCS uses service_account; Azure uses account_name and a container SAS with write permission; other providers use access_key/secret_key and provider endpoint/region as needed.",
                "properties": {
                  "storage_type": {
                    "type": "string",
                    "enum": [
                      "azure",
                      "bos",
                      "cos",
                      "gcs",
                      "oss",
                      "s3",
                      "s3_compatible",
                      "tos"
                    ]
                  },
                  "storage_url": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 1024,
                    "description": "Bucket name (Azure: container name). Not a local path or a full object URL."
                  },
                  "object_prefix": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 513,
                    "description": "Optional object folder prefix. Use a distinct prefix when keeping multiple versions of a video."
                  },
                  "access_key": {
                    "type": "string",
                    "maxLength": 4096
                  },
                  "secret_key": {
                    "type": "string",
                    "maxLength": 4096
                  },
                  "session_token": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 16384,
                    "writeOnly": true,
                    "description": "Optional session token for s3, s3_compatible, oss, cos, bos or tos, with the matching temporary access_key and secret_key issued by that storage provider. The provider must support temporary credentials. Use AWS/BOS/TOS SessionToken, OSS SecurityToken or COS Token. Credentials must remain valid through queueing, download and upload retries. Never display this secret."
                  },
                  "endpoint_url": {
                    "type": "string",
                    "maxLength": 4096,
                    "description": "Provider endpoint, required for S3-compatible storage. Must be reachable from the download Worker."
                  },
                  "region": {
                    "type": "string",
                    "maxLength": 4096
                  },
                  "account_name": {
                    "type": "string",
                    "pattern": "^[a-z0-9]{3,24}$"
                  },
                  "sas_token": {
                    "type": "string",
                    "maxLength": 4097,
                    "description": "Azure container SAS with write permission; never return this secret to the user in output."
                  },
                  "service_account": {
                    "type": "object",
                    "required": [
                      "project_id",
                      "client_email",
                      "private_key"
                    ],
                    "properties": {
                      "project_id": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 256
                      },
                      "client_email": {
                        "type": "string",
                        "minLength": 1
                      },
                      "private_key": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 16384
                      }
                    },
                    "additionalProperties": true
                  }
                }
              }
            },
            "required": [
              "storage"
            ]
          }
        },
        "description": "YouTube Download. Supported modes: async, batch. Provider-specific storage requirements and conditional media options are validated by the server; see the source reference.",
        "externalDocs": {
          "url": "https://flashdata.dev/docs/sources/youtube_download"
        },
        "examples": [
          {
            "source": "youtube_download",
            "video_id": "jNQXAC9IVRw",
            "params": {
              "download_type": "audio_video",
              "output_format": "mp4",
              "storage": {
                "storage_type": "s3",
                "storage_url": "your-media-bucket",
                "region": "us-east-1",
                "object_prefix": "downloads",
                "access_key": "YOUR_STS_ACCESS_KEY_ID",
                "secret_key": "YOUR_STS_SECRET_ACCESS_KEY",
                "session_token": "YOUR_STS_SESSION_TOKEN"
              }
            }
          },
          {
            "source": "youtube_download",
            "video_id": "jNQXAC9IVRw",
            "params": {
              "download_type": "audio_video",
              "output_format": "mp4",
              "storage": {
                "storage_type": "s3_compatible",
                "storage_url": "your-media-bucket",
                "endpoint_url": "https://your-account-id.r2.cloudflarestorage.com",
                "region": "auto",
                "object_prefix": "downloads",
                "access_key": "YOUR_STS_ACCESS_KEY_ID",
                "secret_key": "YOUR_STS_SECRET_ACCESS_KEY",
                "session_token": "YOUR_STS_SESSION_TOKEN"
              }
            }
          },
          {
            "source": "youtube_download",
            "video_id": "jNQXAC9IVRw",
            "params": {
              "download_type": "audio_video",
              "output_format": "mp4",
              "storage": {
                "storage_type": "bos",
                "storage_url": "your-media-bucket",
                "region": "bj",
                "object_prefix": "downloads",
                "access_key": "YOUR_STS_ACCESS_KEY_ID",
                "secret_key": "YOUR_STS_SECRET_ACCESS_KEY",
                "session_token": "YOUR_STS_SESSION_TOKEN"
              }
            }
          },
          {
            "source": "youtube_download",
            "video_id": "jNQXAC9IVRw",
            "params": {
              "download_type": "audio_video",
              "output_format": "mp4",
              "storage": {
                "storage_type": "cos",
                "storage_url": "your-media-bucket-1234567890",
                "region": "ap-hongkong",
                "object_prefix": "downloads",
                "access_key": "YOUR_STS_TMP_SECRET_ID",
                "secret_key": "YOUR_STS_TMP_SECRET_KEY",
                "session_token": "YOUR_STS_TOKEN"
              }
            }
          },
          {
            "source": "youtube_download",
            "video_id": "jNQXAC9IVRw",
            "params": {
              "download_type": "audio_video",
              "output_format": "mp4",
              "storage": {
                "storage_type": "oss",
                "storage_url": "your-media-bucket",
                "endpoint_url": "https://oss-cn-hongkong.aliyuncs.com",
                "object_prefix": "downloads",
                "access_key": "YOUR_STS_ACCESS_KEY_ID",
                "secret_key": "YOUR_STS_ACCESS_KEY_SECRET",
                "session_token": "YOUR_STS_SECURITY_TOKEN"
              }
            }
          },
          {
            "source": "youtube_download",
            "video_id": "jNQXAC9IVRw",
            "params": {
              "download_type": "audio_video",
              "output_format": "mp4",
              "storage": {
                "storage_type": "tos",
                "storage_url": "your-media-bucket",
                "region": "cn-beijing",
                "object_prefix": "downloads",
                "access_key": "YOUR_STS_ACCESS_KEY_ID",
                "secret_key": "YOUR_STS_SECRET_ACCESS_KEY",
                "session_token": "YOUR_STS_SESSION_TOKEN"
              }
            }
          }
        ]
      },
      "AsyncQuery_youtube_download": {
        "type": "object",
        "required": [
          "source",
          "video_id",
          "params"
        ],
        "properties": {
          "source": {
            "type": "string",
            "const": "youtube_download"
          },
          "video_id": {
            "type": "string",
            "minLength": 11,
            "maxLength": 11,
            "pattern": "^[A-Za-z0-9_-]{11}$"
          },
          "params": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "download_type": {
                "type": "string",
                "minLength": 1,
                "maxLength": 11,
                "default": "audio_video",
                "enum": [
                  "audio_video",
                  "video",
                  "audio"
                ]
              },
              "video_quality": {
                "type": "string",
                "minLength": 1,
                "maxLength": 40,
                "default": "<=720",
                "enum": [
                  "best",
                  "worst",
                  "<=144",
                  "==144",
                  ">=144",
                  "<=360",
                  "==360",
                  ">=360",
                  "<=480",
                  "==480",
                  ">=480",
                  "<=720",
                  "==720",
                  ">=720",
                  "<=1080",
                  "==1080",
                  ">=1080",
                  "<=1440",
                  "==1440",
                  ">=1440",
                  "<=2160",
                  "==2160",
                  ">=2160",
                  "<=4320",
                  "==4320",
                  ">=4320"
                ]
              },
              "fps": {
                "type": "string",
                "minLength": 1,
                "maxLength": 6,
                "pattern": "^(?:>=|<=|==)(?:[1-9]\\d?|1\\d\\d|2[0-3]\\d|240)$"
              },
              "audio_language": {
                "type": "string",
                "minLength": 1,
                "maxLength": 8,
                "default": "default",
                "enum": [
                  "default",
                  "original"
                ]
              },
              "audio_quality": {
                "type": "string",
                "minLength": 1,
                "maxLength": 10,
                "default": "best",
                "enum": [
                  "best",
                  "320",
                  "256",
                  "192",
                  "128"
                ]
              },
              "yt_dlp_format": {
                "type": "string",
                "minLength": 1,
                "maxLength": 1024
              },
              "upload_metadata": {
                "type": "boolean",
                "default": false
              },
              "output_format": {
                "type": "string",
                "minLength": 1,
                "maxLength": 10,
                "default": "mp4",
                "enum": [
                  "mp4",
                  "webm",
                  "mkv",
                  "m4a",
                  "mp3",
                  "opus"
                ]
              },
              "start_at": {
                "type": "string",
                "minLength": 1,
                "maxLength": 8,
                "pattern": "^\\d{1,2}:[0-5]\\d:[0-5]\\d$"
              },
              "end_at": {
                "type": "string",
                "minLength": 1,
                "maxLength": 8,
                "pattern": "^\\d{1,2}:[0-5]\\d:[0-5]\\d$"
              },
              "storage": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "storage_type",
                  "storage_url"
                ],
                "description": "Customer-owned destination, using the same fields as Download API params.storage. Supply credentials from your configured storage; do not invent values or display secrets. GCS uses service_account; Azure uses account_name and a container SAS with write permission; other providers use access_key/secret_key and provider endpoint/region as needed.",
                "properties": {
                  "storage_type": {
                    "type": "string",
                    "enum": [
                      "azure",
                      "bos",
                      "cos",
                      "gcs",
                      "oss",
                      "s3",
                      "s3_compatible",
                      "tos"
                    ]
                  },
                  "storage_url": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 1024,
                    "description": "Bucket name (Azure: container name). Not a local path or a full object URL."
                  },
                  "object_prefix": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 513,
                    "description": "Optional object folder prefix. Use a distinct prefix when keeping multiple versions of a video."
                  },
                  "access_key": {
                    "type": "string",
                    "maxLength": 4096
                  },
                  "secret_key": {
                    "type": "string",
                    "maxLength": 4096
                  },
                  "session_token": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 16384,
                    "writeOnly": true,
                    "description": "Optional session token for s3, s3_compatible, oss, cos, bos or tos, with the matching temporary access_key and secret_key issued by that storage provider. The provider must support temporary credentials. Use AWS/BOS/TOS SessionToken, OSS SecurityToken or COS Token. Credentials must remain valid through queueing, download and upload retries. Never display this secret."
                  },
                  "endpoint_url": {
                    "type": "string",
                    "maxLength": 4096,
                    "description": "Provider endpoint, required for S3-compatible storage. Must be reachable from the download Worker."
                  },
                  "region": {
                    "type": "string",
                    "maxLength": 4096
                  },
                  "account_name": {
                    "type": "string",
                    "pattern": "^[a-z0-9]{3,24}$"
                  },
                  "sas_token": {
                    "type": "string",
                    "maxLength": 4097,
                    "description": "Azure container SAS with write permission; never return this secret to the user in output."
                  },
                  "service_account": {
                    "type": "object",
                    "required": [
                      "project_id",
                      "client_email",
                      "private_key"
                    ],
                    "properties": {
                      "project_id": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 256
                      },
                      "client_email": {
                        "type": "string",
                        "minLength": 1
                      },
                      "private_key": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 16384
                      }
                    },
                    "additionalProperties": true
                  }
                }
              }
            },
            "required": [
              "storage"
            ]
          },
          "callback_url": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 2048,
            "description": "Async and batch only. Public HTTPS URL on port 443 without credentials or a fragment. Omit, null or empty string disables callbacks. Server validates public reachability."
          }
        },
        "description": "YouTube Download. Supported modes: async, batch. Provider-specific storage requirements and conditional media options are validated by the server; see the source reference.",
        "externalDocs": {
          "url": "https://flashdata.dev/docs/sources/youtube_download"
        },
        "examples": [
          {
            "source": "youtube_download",
            "video_id": "jNQXAC9IVRw",
            "params": {
              "download_type": "audio_video",
              "output_format": "mp4",
              "storage": {
                "storage_type": "s3",
                "storage_url": "your-media-bucket",
                "region": "us-east-1",
                "object_prefix": "downloads",
                "access_key": "YOUR_STS_ACCESS_KEY_ID",
                "secret_key": "YOUR_STS_SECRET_ACCESS_KEY",
                "session_token": "YOUR_STS_SESSION_TOKEN"
              }
            }
          },
          {
            "source": "youtube_download",
            "video_id": "jNQXAC9IVRw",
            "params": {
              "download_type": "audio_video",
              "output_format": "mp4",
              "storage": {
                "storage_type": "s3_compatible",
                "storage_url": "your-media-bucket",
                "endpoint_url": "https://your-account-id.r2.cloudflarestorage.com",
                "region": "auto",
                "object_prefix": "downloads",
                "access_key": "YOUR_STS_ACCESS_KEY_ID",
                "secret_key": "YOUR_STS_SECRET_ACCESS_KEY",
                "session_token": "YOUR_STS_SESSION_TOKEN"
              }
            }
          },
          {
            "source": "youtube_download",
            "video_id": "jNQXAC9IVRw",
            "params": {
              "download_type": "audio_video",
              "output_format": "mp4",
              "storage": {
                "storage_type": "bos",
                "storage_url": "your-media-bucket",
                "region": "bj",
                "object_prefix": "downloads",
                "access_key": "YOUR_STS_ACCESS_KEY_ID",
                "secret_key": "YOUR_STS_SECRET_ACCESS_KEY",
                "session_token": "YOUR_STS_SESSION_TOKEN"
              }
            }
          },
          {
            "source": "youtube_download",
            "video_id": "jNQXAC9IVRw",
            "params": {
              "download_type": "audio_video",
              "output_format": "mp4",
              "storage": {
                "storage_type": "cos",
                "storage_url": "your-media-bucket-1234567890",
                "region": "ap-hongkong",
                "object_prefix": "downloads",
                "access_key": "YOUR_STS_TMP_SECRET_ID",
                "secret_key": "YOUR_STS_TMP_SECRET_KEY",
                "session_token": "YOUR_STS_TOKEN"
              }
            }
          },
          {
            "source": "youtube_download",
            "video_id": "jNQXAC9IVRw",
            "params": {
              "download_type": "audio_video",
              "output_format": "mp4",
              "storage": {
                "storage_type": "oss",
                "storage_url": "your-media-bucket",
                "endpoint_url": "https://oss-cn-hongkong.aliyuncs.com",
                "object_prefix": "downloads",
                "access_key": "YOUR_STS_ACCESS_KEY_ID",
                "secret_key": "YOUR_STS_ACCESS_KEY_SECRET",
                "session_token": "YOUR_STS_SECURITY_TOKEN"
              }
            }
          },
          {
            "source": "youtube_download",
            "video_id": "jNQXAC9IVRw",
            "params": {
              "download_type": "audio_video",
              "output_format": "mp4",
              "storage": {
                "storage_type": "tos",
                "storage_url": "your-media-bucket",
                "region": "cn-beijing",
                "object_prefix": "downloads",
                "access_key": "YOUR_STS_ACCESS_KEY_ID",
                "secret_key": "YOUR_STS_SECRET_ACCESS_KEY",
                "session_token": "YOUR_STS_SESSION_TOKEN"
              }
            }
          }
        ]
      },
      "DataQueryResponse": {
        "type": "object",
        "properties": {
          "source": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "results": {
            "type": "array",
            "items": {}
          },
          "usage": {
            "type": "object",
            "properties": {
              "credits": {
                "type": "number"
              }
            }
          }
        },
        "description": "Source-specific JSON results. See the source reference for response fields and examples.",
        "required": [
          "source",
          "status",
          "results"
        ]
      },
      "AsyncSubmission": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "source": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "links": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/JobLink"
            }
          },
          "usage": {
            "type": "object",
            "properties": {
              "credits": {
                "type": "number"
              }
            }
          }
        }
      },
      "DataQueryError": {
        "type": "object",
        "required": [
          "error",
          "message"
        ],
        "properties": {
          "error": {
            "type": "boolean",
            "const": true
          },
          "message": {
            "type": "string"
          },
          "code": {
            "type": "string"
          },
          "field": {
            "type": "string"
          },
          "retryable": {
            "type": "boolean",
            "description": "When false, do not retry the request unchanged."
          }
        }
      }
    },
    "responses": {
      "Unauthorized": {
        "description": "Authentication required or invalid",
        "content": {
          "application/problem+json": {
            "schema": {
              "$ref": "#/components/schemas/Problem"
            }
          }
        }
      },
      "Forbidden": {
        "description": "Authenticated but not permitted, or CSRF validation failed",
        "content": {
          "application/problem+json": {
            "schema": {
              "$ref": "#/components/schemas/Problem"
            }
          }
        }
      },
      "ValidationError": {
        "description": "Request validation failed",
        "content": {
          "application/problem+json": {
            "schema": {
              "$ref": "#/components/schemas/Problem"
            }
          }
        }
      },
      "NotFound": {
        "description": "Resource not found or not owned by the caller",
        "content": {
          "application/problem+json": {
            "schema": {
              "$ref": "#/components/schemas/Problem"
            }
          }
        }
      },
      "Conflict": {
        "description": "Resource state or idempotency conflict",
        "content": {
          "application/problem+json": {
            "schema": {
              "$ref": "#/components/schemas/Problem"
            }
          }
        }
      },
      "RateLimited": {
        "description": "Rate, concurrency, batch, or pending-job limit exceeded",
        "headers": {
          "Retry-After": {
            "schema": {
              "type": "integer"
            }
          }
        },
        "content": {
          "application/problem+json": {
            "schema": {
              "$ref": "#/components/schemas/Problem"
            }
          }
        }
      },
      "InternalError": {
        "description": "An unexpected internal error occurred",
        "content": {
          "application/problem+json": {
            "schema": {
              "$ref": "#/components/schemas/Problem"
            }
          }
        }
      },
      "ServiceUnavailable": {
        "description": "A required dependency or catalog is temporarily unavailable",
        "content": {
          "application/problem+json": {
            "schema": {
              "$ref": "#/components/schemas/Problem"
            }
          }
        }
      },
      "LoginForbidden": {
        "description": "Login is forbidden; Problem.code is email_not_verified, account_suspended, account_deletion_processing, account_deletion_failed, or account_deleted",
        "content": {
          "application/problem+json": {
            "schema": {
              "$ref": "#/components/schemas/Problem"
            }
          }
        }
      },
      "AccountLocked": {
        "description": "Account temporarily locked",
        "headers": {
          "Retry-After": {
            "schema": {
              "type": "integer"
            }
          }
        },
        "content": {
          "application/problem+json": {
            "schema": {
              "$ref": "#/components/schemas/Problem"
            }
          }
        }
      },
      "AcceptedGeneric": {
        "description": "Request accepted. The response does not reveal whether an account exists.",
        "headers": {
          "Cache-Control": {
            "$ref": "#/components/headers/CacheControlNoStore"
          },
          "X-Request-Id": {
            "$ref": "#/components/headers/RequestId"
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "accepted"
              ],
              "properties": {
                "accepted": {
                  "type": "boolean",
                  "const": true
                }
              }
            }
          }
        }
      },
      "AnonymousValidationError": {
        "description": "Anonymous authentication request validation failed",
        "headers": {
          "Cache-Control": {
            "$ref": "#/components/headers/CacheControlNoStore"
          },
          "X-Request-Id": {
            "$ref": "#/components/headers/RequestId"
          }
        },
        "content": {
          "application/problem+json": {
            "schema": {
              "$ref": "#/components/schemas/Problem"
            }
          }
        }
      },
      "AnonymousRateLimited": {
        "description": "Anonymous authentication rate limit exceeded",
        "headers": {
          "Cache-Control": {
            "$ref": "#/components/headers/CacheControlNoStore"
          },
          "Retry-After": {
            "schema": {
              "type": "integer"
            }
          },
          "X-Request-Id": {
            "$ref": "#/components/headers/RequestId"
          }
        },
        "content": {
          "application/problem+json": {
            "schema": {
              "$ref": "#/components/schemas/Problem"
            }
          }
        }
      },
      "AnonymousInternalError": {
        "description": "An unexpected anonymous authentication error occurred",
        "headers": {
          "Cache-Control": {
            "$ref": "#/components/headers/CacheControlNoStore"
          },
          "X-Request-Id": {
            "$ref": "#/components/headers/RequestId"
          }
        },
        "content": {
          "application/problem+json": {
            "schema": {
              "$ref": "#/components/schemas/Problem"
            }
          }
        }
      },
      "AnonymousServiceUnavailable": {
        "description": "An anonymous authentication dependency is temporarily unavailable",
        "headers": {
          "Cache-Control": {
            "$ref": "#/components/headers/CacheControlNoStore"
          },
          "X-Request-Id": {
            "$ref": "#/components/headers/RequestId"
          }
        },
        "content": {
          "application/problem+json": {
            "schema": {
              "$ref": "#/components/schemas/Problem"
            }
          }
        }
      },
      "TokenExpired": {
        "description": "One-time token is invalid, expired, invalidated, already used, or lost a concurrent confirmation race. Problem.code is `token_unavailable`.",
        "headers": {
          "Cache-Control": {
            "$ref": "#/components/headers/CacheControlNoStore"
          },
          "X-Request-Id": {
            "$ref": "#/components/headers/RequestId"
          }
        },
        "content": {
          "application/problem+json": {
            "schema": {
              "$ref": "#/components/schemas/Problem"
            }
          }
        }
      },
      "NoStoreUnauthorized": {
        "description": "Authentication required or invalid",
        "headers": {
          "Cache-Control": {
            "$ref": "#/components/headers/CacheControlNoStore"
          },
          "X-Request-Id": {
            "$ref": "#/components/headers/RequestId"
          }
        },
        "content": {
          "application/problem+json": {
            "schema": {
              "$ref": "#/components/schemas/Problem"
            }
          }
        }
      },
      "NoStoreInternalError": {
        "description": "An unexpected internal error occurred",
        "headers": {
          "Cache-Control": {
            "$ref": "#/components/headers/CacheControlNoStore"
          },
          "X-Request-Id": {
            "$ref": "#/components/headers/RequestId"
          }
        },
        "content": {
          "application/problem+json": {
            "schema": {
              "$ref": "#/components/schemas/Problem"
            }
          }
        }
      },
      "NoStoreServiceUnavailable": {
        "description": "A required dependency or onboarding record is temporarily unavailable",
        "headers": {
          "Cache-Control": {
            "$ref": "#/components/headers/CacheControlNoStore"
          },
          "X-Request-Id": {
            "$ref": "#/components/headers/RequestId"
          }
        },
        "content": {
          "application/problem+json": {
            "schema": {
              "$ref": "#/components/schemas/Problem"
            }
          }
        }
      },
      "NoStoreForbidden": {
        "description": "Authenticated but not permitted, or CSRF validation failed",
        "headers": {
          "Cache-Control": {
            "$ref": "#/components/headers/CacheControlNoStore"
          },
          "X-Request-Id": {
            "$ref": "#/components/headers/RequestId"
          }
        },
        "content": {
          "application/problem+json": {
            "schema": {
              "$ref": "#/components/schemas/Problem"
            }
          }
        }
      },
      "NoStoreConflict": {
        "description": "Resource state or idempotency conflict",
        "headers": {
          "Cache-Control": {
            "$ref": "#/components/headers/CacheControlNoStore"
          },
          "X-Request-Id": {
            "$ref": "#/components/headers/RequestId"
          }
        },
        "content": {
          "application/problem+json": {
            "schema": {
              "$ref": "#/components/schemas/Problem"
            }
          }
        }
      },
      "NoStoreValidationError": {
        "description": "Request validation failed",
        "headers": {
          "Cache-Control": {
            "$ref": "#/components/headers/CacheControlNoStore"
          },
          "X-Request-Id": {
            "$ref": "#/components/headers/RequestId"
          }
        },
        "content": {
          "application/problem+json": {
            "schema": {
              "$ref": "#/components/schemas/Problem"
            }
          }
        }
      },
      "UpstreamError": {
        "description": "An upstream provider failed",
        "content": {
          "application/problem+json": {
            "schema": {
              "$ref": "#/components/schemas/Problem"
            }
          }
        }
      },
      "BillingUnavailable": {
        "description": "The billing catalog or provider is not configured or is temporarily unavailable",
        "content": {
          "application/problem+json": {
            "schema": {
              "$ref": "#/components/schemas/Problem"
            }
          }
        }
      },
      "BulkResultRedirect": {
        "description": "Redirect to a short-lived private R2 URL; API credentials must not be forwarded",
        "headers": {
          "Location": {
            "required": true,
            "description": "Five-minute presigned R2 URL",
            "schema": {
              "type": "string",
              "format": "uri"
            }
          }
        }
      },
      "Gone": {
        "description": "The retained result has expired",
        "content": {
          "application/problem+json": {
            "schema": {
              "$ref": "#/components/schemas/Problem"
            }
          }
        }
      }
    },
    "headers": {
      "CacheControlPublic": {
        "description": "Public cache duration and stale-response policy",
        "schema": {
          "type": "string",
          "const": "public, max-age=60, stale-while-revalidate=300"
        }
      },
      "CacheControlNoStore": {
        "description": "Prevents storage of sensitive or state-changing responses by browsers and intermediaries",
        "schema": {
          "type": "string",
          "const": "no-store"
        }
      },
      "RequestId": {
        "description": "Stable request correlation ID",
        "schema": {
          "type": "string",
          "pattern": "^req_"
        }
      },
      "SessionCookie": {
        "description": "Opaque session cookie with `Secure; HttpOnly; SameSite=Lax; Path=/`, High priority, and no Domain attribute",
        "schema": {
          "type": "string",
          "pattern": "^__Host-fd_session=fds_[A-Za-z0-9_-]{43}; Path=/; Expires=[^;]+; HttpOnly; Secure; Priority=High; SameSite=Lax$"
        }
      },
      "ClearedSessionCookie": {
        "description": "Clears the opaque session cookie with the same host-only security attributes",
        "schema": {
          "type": "string",
          "pattern": "^__Host-fd_session=; Max-Age=0; Path=/; Expires=Thu, 01 Jan 1970 00:00:00 GMT; HttpOnly; Secure; Priority=High; SameSite=Lax$"
        }
      }
    },
    "parameters": {
      "SessionId": {
        "name": "sessionId",
        "in": "path",
        "required": true,
        "schema": {
          "type": "string",
          "pattern": "^ses_"
        }
      },
      "IdempotencyKey": {
        "name": "Idempotency-Key",
        "in": "header",
        "required": true,
        "schema": {
          "type": "string",
          "minLength": 1,
          "maxLength": 255
        }
      },
      "KeyId": {
        "name": "keyId",
        "in": "path",
        "required": true,
        "schema": {
          "type": "string",
          "pattern": "^key_"
        }
      },
      "Cursor": {
        "name": "cursor",
        "in": "query",
        "schema": {
          "type": "string",
          "maxLength": 512
        }
      },
      "Limit": {
        "name": "limit",
        "in": "query",
        "schema": {
          "type": "integer",
          "minimum": 1,
          "maximum": 100,
          "default": 50
        }
      },
      "ResponseEnvelopeAccept": {
        "name": "Accept",
        "in": "header",
        "description": "application/json returns the original structured response; text/plain returns the same fields as indented plain text. Standard media ranges and q weights are supported; missing Accept or a global wildcard defaults to JSON. X-Respond-With is ignored on submission and job-status endpoints. Errors remain structured JSON. Both response types use UTF-8; an explicit charset=utf-8 parameter is supported.",
        "schema": {
          "type": "string"
        },
        "examples": {
          "json": {
            "value": "application/json"
          },
          "plain": {
            "value": "text/plain"
          }
        }
      },
      "BulkId": {
        "name": "bulkId",
        "in": "path",
        "required": true,
        "schema": {
          "type": "string",
          "pattern": "^bulk_[A-Za-z0-9_-]{8,}$"
        }
      },
      "QueryRepresentation": {
        "name": "X-Respond-With",
        "in": "header",
        "description": "Set to markdown to return result content as Markdown. Omit to retain the original result fields. Accept independently selects JSON or plain text. Only realtime queries and completed job result reads support this header. It does not change job submissions, status, account APIs, callbacks, Bulk files, binary downloads, or MCP protocol responses.",
        "schema": {
          "type": "string",
          "enum": [
            "markdown"
          ]
        }
      },
      "QueryRepresentationAccept": {
        "name": "Accept",
        "in": "header",
        "description": "Select application/json or text/plain independently of X-Respond-With. Without X-Respond-With, text/plain returns the original fields with indentation; JSON retains the original response fields (completed-result reads redirect to storage). With markdown, JSON returns content plus metadata and plain text returns metadata followed by Markdown. Standard media ranges and q weights are supported; missing Accept or a global wildcard defaults to JSON. Both response types use UTF-8; an explicit charset=utf-8 parameter is supported.",
        "schema": {
          "type": "string"
        },
        "examples": {
          "json": {
            "value": "application/json"
          },
          "plain": {
            "value": "text/plain"
          }
        }
      }
    },
    "securitySchemes": {
      "dataApiKey": {
        "type": "apiKey",
        "in": "header",
        "name": "X-API-Key",
        "description": "FlashData API key. Job access is restricted to the key's source scopes."
      },
      "agentRegistrationProof": {
        "type": "http",
        "scheme": "bearer",
        "description": "Persist a cryptographically random 32-byte base64url proof and exact request BEFORE sending; recover only with the same proof and body. Not an OAuth token."
      },
      "cookieSession": {
        "type": "apiKey",
        "in": "cookie",
        "name": "__Host-fd_session",
        "description": "Opaque Web session. The browser cannot read this cookie."
      },
      "agentSetupCredential": {
        "type": "http",
        "scheme": "bearer",
        "description": "Temporary setup credential for status and claim creation only. Not a data API key."
      },
      "csrfToken": {
        "type": "apiKey",
        "in": "header",
        "name": "X-CSRF-Token"
      },
      "agentIdentityKey": {
        "type": "http",
        "scheme": "bearer",
        "description": "Ordinary FlashData API key in Authorization Bearer, only on agent identity. Data queries use X-API-Key instead."
      },
      "agentHandoffProof": {
        "type": "http",
        "scheme": "bearer",
        "description": "Proof used to recover the owner key and acknowledge installation. Never sent to a data query."
      }
    }
  }
}