{
  "openapi": "3.1.1",
  "info": {
    "title": "OngsooLabs AI Reader API - Direct",
    "version": "1.0"
  },
  "paths": {
    "/api/v1/reader": {
      "get": {
        "tags": [
          "Reader"
        ],
        "parameters": [
          {
            "name": "url",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "output_format",
            "in": "query",
            "schema": {
              "type": "string",
              "default": "markdown"
            }
          },
          {
            "name": "tokenizer",
            "in": "query",
            "schema": {
              "type": "string",
              "default": "openai"
            }
          },
          {
            "name": "enable_chunking",
            "in": "query",
            "schema": {
              "type": "boolean",
              "default": false
            }
          },
          {
            "name": "chunk_size_tokens",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32",
              "default": 500
            }
          },
          {
            "name": "overlap_size_tokens",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32",
              "default": 100
            }
          },
          {
            "name": "force_dynamic",
            "in": "query",
            "schema": {
              "type": "boolean",
              "default": false
            }
          },
          {
            "name": "mode",
            "in": "query",
            "schema": {
              "type": "string",
              "default": "generic"
            }
          },
          {
            "name": "output_content",
            "in": "query",
            "schema": {
              "type": "boolean",
              "default": true
            }
          },
          {
            "name": "output_metadata",
            "in": "query",
            "schema": {
              "type": "boolean",
              "default": true
            }
          },
          {
            "name": "output_tables",
            "in": "query",
            "schema": {
              "type": "boolean",
              "default": true
            }
          },
          {
            "name": "output_code_blocks",
            "in": "query",
            "schema": {
              "type": "boolean",
              "default": true
            }
          },
          {
            "name": "output_images",
            "in": "query",
            "schema": {
              "type": "boolean",
              "default": false
            }
          },
          {
            "name": "output_links",
            "in": "query",
            "schema": {
              "type": "boolean",
              "default": false
            }
          },
          {
            "name": "disable_css",
            "in": "query",
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ReaderResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReaderResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReaderResponse"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "Opaque Direct Gateway request identifier. It may be absent when rejection happens before request preparation.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "description": "Invalid Direct Gateway request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "Opaque Direct Gateway request identifier when request preparation completed.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "403": {
            "description": "Direct usage is exhausted or unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "Opaque Direct Gateway request identifier when request preparation completed.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "Opaque Direct Gateway request identifier. It may be absent when rejection happens before request preparation.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable Content",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "Opaque Direct Gateway request identifier. It may be absent when rejection happens before request preparation.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "429": {
            "description": "Direct Gateway rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "Opaque Direct Gateway request identifier when request preparation completed.",
                "schema": {
                  "type": "string"
                }
              },
              "Retry-After": {
                "description": "Positive delay in seconds before retrying.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "502": {
            "description": "Bad Gateway",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "Opaque Direct Gateway request identifier. It may be absent when rejection happens before request preparation.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "504": {
            "description": "Gateway Timeout",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "Opaque Direct Gateway request identifier. It may be absent when rejection happens before request preparation.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "Opaque Direct Gateway request identifier. It may be absent when rejection happens before request preparation.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid Direct API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "Opaque Direct Gateway request identifier when request preparation completed.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "409": {
            "description": "Idempotency key conflict.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "Opaque Direct Gateway request identifier when request preparation completed.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "413": {
            "description": "Direct Gateway request body limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "Opaque Direct Gateway request identifier when request preparation completed.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "503": {
            "description": "The Direct Gateway could not safely determine the request settlement.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "Opaque Direct Gateway request identifier when request preparation completed.",
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        },
        "security": [
          {
            "DirectApiKey": []
          }
        ],
        "x-ongsoolabs-usage-note": "RapidAPI plan quota is separate from Reader response usage.credits metadata.",
        "x-ongsoolabs-credit-cost": {
          "success": 1,
          "partial": 0,
          "failure": 0,
          "gatewayRejection": 0
        }
      },
      "post": {
        "tags": [
          "Reader"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PublicReaderRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/PublicReaderRequest"
              }
            },
            "application/*\u002Bjson": {
              "schema": {
                "$ref": "#/components/schemas/PublicReaderRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ReaderResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReaderResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReaderResponse"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "Opaque Direct Gateway request identifier. It may be absent when rejection happens before request preparation.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "description": "Invalid Direct Gateway request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "Opaque Direct Gateway request identifier when request preparation completed.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "403": {
            "description": "Direct usage is exhausted or unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "Opaque Direct Gateway request identifier when request preparation completed.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "Opaque Direct Gateway request identifier. It may be absent when rejection happens before request preparation.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable Content",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "Opaque Direct Gateway request identifier. It may be absent when rejection happens before request preparation.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "429": {
            "description": "Direct Gateway rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "Opaque Direct Gateway request identifier when request preparation completed.",
                "schema": {
                  "type": "string"
                }
              },
              "Retry-After": {
                "description": "Positive delay in seconds before retrying.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "502": {
            "description": "Bad Gateway",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "Opaque Direct Gateway request identifier. It may be absent when rejection happens before request preparation.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "504": {
            "description": "Gateway Timeout",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "Opaque Direct Gateway request identifier. It may be absent when rejection happens before request preparation.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "Opaque Direct Gateway request identifier. It may be absent when rejection happens before request preparation.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid Direct API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "Opaque Direct Gateway request identifier when request preparation completed.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "409": {
            "description": "Idempotency key conflict.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "Opaque Direct Gateway request identifier when request preparation completed.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "413": {
            "description": "Direct Gateway request body limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "Opaque Direct Gateway request identifier when request preparation completed.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "503": {
            "description": "The Direct Gateway could not safely determine the request settlement.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "Opaque Direct Gateway request identifier when request preparation completed.",
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        },
        "security": [
          {
            "DirectApiKey": []
          }
        ],
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string"
            },
            "example": "UUID (D format) or ULID"
          }
        ],
        "x-ongsoolabs-usage-note": "RapidAPI plan quota is separate from Reader response usage.credits metadata.",
        "x-ongsoolabs-credit-cost": {
          "success": 1,
          "partial": 0,
          "failure": 0,
          "gatewayRejection": 0
        }
      }
    },
    "/api/v1/reader/document": {
      "post": {
        "tags": [
          "Document"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PublicDocumentReaderRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/PublicDocumentReaderRequest"
              }
            },
            "application/*\u002Bjson": {
              "schema": {
                "$ref": "#/components/schemas/PublicDocumentReaderRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ReaderResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReaderResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReaderResponse"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "Opaque Direct Gateway request identifier. It may be absent when rejection happens before request preparation.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "description": "Invalid Direct Gateway request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "Opaque Direct Gateway request identifier when request preparation completed.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "403": {
            "description": "Direct usage is exhausted or unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "Opaque Direct Gateway request identifier when request preparation completed.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "Opaque Direct Gateway request identifier. It may be absent when rejection happens before request preparation.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable Content",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "Opaque Direct Gateway request identifier. It may be absent when rejection happens before request preparation.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "429": {
            "description": "Direct Gateway rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "Opaque Direct Gateway request identifier when request preparation completed.",
                "schema": {
                  "type": "string"
                }
              },
              "Retry-After": {
                "description": "Positive delay in seconds before retrying.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "502": {
            "description": "Bad Gateway",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "Opaque Direct Gateway request identifier. It may be absent when rejection happens before request preparation.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "Opaque Direct Gateway request identifier. It may be absent when rejection happens before request preparation.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid Direct API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "Opaque Direct Gateway request identifier when request preparation completed.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "409": {
            "description": "Idempotency key conflict.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "Opaque Direct Gateway request identifier when request preparation completed.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "413": {
            "description": "Direct Gateway request body limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "Opaque Direct Gateway request identifier when request preparation completed.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "503": {
            "description": "The Direct Gateway could not safely determine the request settlement.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "Opaque Direct Gateway request identifier when request preparation completed.",
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        },
        "security": [
          {
            "DirectApiKey": []
          }
        ],
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string"
            },
            "example": "UUID (D format) or ULID"
          }
        ],
        "x-ongsoolabs-usage-note": "RapidAPI plan quota is separate from Reader response usage.credits metadata.",
        "x-ongsoolabs-credit-cost": {
          "success": 1,
          "partial": 0,
          "failure": 0,
          "gatewayRejection": 0
        }
      }
    },
    "/api/v1/reader/chunk": {
      "post": {
        "tags": [
          "Reader"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ChunkRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/ChunkRequest"
              }
            },
            "application/*\u002Bjson": {
              "schema": {
                "$ref": "#/components/schemas/ChunkRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ChunkItem"
                  }
                }
              },
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ChunkItem"
                  }
                }
              },
              "text/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ChunkItem"
                  }
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "Opaque Direct Gateway request identifier. It may be absent when rejection happens before request preparation.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "description": "Invalid Direct Gateway request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "Opaque Direct Gateway request identifier when request preparation completed.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "429": {
            "description": "Direct Gateway rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "Opaque Direct Gateway request identifier when request preparation completed.",
                "schema": {
                  "type": "string"
                }
              },
              "Retry-After": {
                "description": "Positive delay in seconds before retrying.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "Opaque Direct Gateway request identifier. It may be absent when rejection happens before request preparation.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid Direct API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "Opaque Direct Gateway request identifier when request preparation completed.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "403": {
            "description": "Direct usage is exhausted or unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "Opaque Direct Gateway request identifier when request preparation completed.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "409": {
            "description": "Idempotency key conflict.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "Opaque Direct Gateway request identifier when request preparation completed.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "413": {
            "description": "Direct Gateway request body limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "Opaque Direct Gateway request identifier when request preparation completed.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "503": {
            "description": "The Direct Gateway could not safely determine the request settlement.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "Opaque Direct Gateway request identifier when request preparation completed.",
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        },
        "security": [
          {
            "DirectApiKey": []
          }
        ],
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string"
            },
            "example": "UUID (D format) or ULID"
          }
        ],
        "x-ongsoolabs-usage-note": "RapidAPI plan quota is separate from Reader response usage.credits metadata.",
        "x-ongsoolabs-credit-cost": {
          "success": 1,
          "partial": 0,
          "failure": 0,
          "gatewayRejection": 0
        }
      }
    },
    "/api/v1/summary": {
      "post": {
        "tags": [
          "Summary"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SummaryRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/SummaryRequest"
              }
            },
            "application/*\u002Bjson": {
              "schema": {
                "$ref": "#/components/schemas/SummaryRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/SummaryResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SummaryResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/SummaryResponse"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "Opaque Direct Gateway request identifier. It may be absent when rejection happens before request preparation.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "Opaque Direct Gateway request identifier. It may be absent when rejection happens before request preparation.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "description": "Direct Gateway rejection or Summary execution error.",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    },
                    {
                      "$ref": "#/components/schemas/SummaryErrorResponse"
                    }
                  ]
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "Opaque Direct Gateway request identifier when request preparation completed.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "413": {
            "description": "Direct Gateway rejection or Summary execution error.",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    },
                    {
                      "$ref": "#/components/schemas/SummaryErrorResponse"
                    }
                  ]
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "Opaque Direct Gateway request identifier when request preparation completed.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable Content",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/SummaryErrorResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SummaryErrorResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/SummaryErrorResponse"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "Opaque Direct Gateway request identifier. It may be absent when rejection happens before request preparation.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "429": {
            "description": "Direct Gateway rejection or Summary execution error.",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    },
                    {
                      "$ref": "#/components/schemas/SummaryErrorResponse"
                    }
                  ]
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "Opaque Direct Gateway request identifier when request preparation completed.",
                "schema": {
                  "type": "string"
                }
              },
              "Retry-After": {
                "description": "Positive delay in seconds before retrying.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "502": {
            "description": "Bad Gateway",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/SummaryErrorResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SummaryErrorResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/SummaryErrorResponse"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "Opaque Direct Gateway request identifier. It may be absent when rejection happens before request preparation.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "504": {
            "description": "Gateway Timeout",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/SummaryErrorResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SummaryErrorResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/SummaryErrorResponse"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "Opaque Direct Gateway request identifier. It may be absent when rejection happens before request preparation.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid Direct API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "Opaque Direct Gateway request identifier when request preparation completed.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "403": {
            "description": "Direct usage is exhausted or unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "Opaque Direct Gateway request identifier when request preparation completed.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "409": {
            "description": "Idempotency key conflict.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "Opaque Direct Gateway request identifier when request preparation completed.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "503": {
            "description": "The Direct Gateway could not safely determine the request settlement.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "Opaque Direct Gateway request identifier when request preparation completed.",
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        },
        "operationId": "createSummary",
        "summary": "Summarize one public webpage synchronously.",
        "description": "Provide a public URL and optional quality (standard). Successful Direct Summary requests cost 5 credits; failures cost 0 credits.",
        "security": [
          {
            "DirectApiKey": []
          }
        ],
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string"
            },
            "example": "UUID (D format) or ULID"
          }
        ],
        "x-ongsoolabs-credit-cost": {
          "success": 5,
          "partial": 0,
          "failure": 0,
          "gatewayRejection": 0
        }
      }
    },
    "/api/v1/reader/jobs": {
      "post": {
        "tags": [
          "Async Jobs"
        ],
        "summary": "Submit a Reader job.",
        "operationId": "submitAsyncReaderJob",
        "security": [
          {
            "DirectApiKey": []
          }
        ],
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "00000000-0000-4000-8000-000000000000"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PublicReaderRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/PublicReaderRequest"
              }
            },
            "application/*\u002Bjson": {
              "schema": {
                "$ref": "#/components/schemas/PublicReaderRequest"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "The job was accepted and queued.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AsyncJobAcceptedResponse"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "Opaque Direct Gateway request identifier when request preparation completed.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "description": "The request or required Idempotency-Key is invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "Opaque Direct Gateway request identifier when request preparation completed.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid Direct API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "Opaque Direct Gateway request identifier when request preparation completed.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "403": {
            "description": "Direct usage is exhausted or unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "Opaque Direct Gateway request identifier when request preparation completed.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "409": {
            "description": "Idempotency key conflict.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "Opaque Direct Gateway request identifier when request preparation completed.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "413": {
            "description": "Direct Gateway request body limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "Opaque Direct Gateway request identifier when request preparation completed.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "429": {
            "description": "Direct Gateway rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "Opaque Direct Gateway request identifier when request preparation completed.",
                "schema": {
                  "type": "string"
                }
              },
              "Retry-After": {
                "description": "Positive delay in seconds before retrying.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "503": {
            "description": "Submission or activation settlement is temporarily indeterminate.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "Opaque Direct Gateway request identifier when request preparation completed.",
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        },
        "x-ongsoolabs-credit-cost": {
          "reservedAtSubmission": 1,
          "finalizedOnSuccess": 1,
          "partial": 0,
          "failure": 0,
          "cancellation": 0
        }
      }
    },
    "/api/v1/reader/document/jobs": {
      "post": {
        "tags": [
          "Async Jobs"
        ],
        "summary": "Submit a Document Reader job.",
        "operationId": "submitAsyncDocumentJob",
        "security": [
          {
            "DirectApiKey": []
          }
        ],
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "00000000-0000-4000-8000-000000000000"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PublicDocumentReaderRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/PublicDocumentReaderRequest"
              }
            },
            "application/*\u002Bjson": {
              "schema": {
                "$ref": "#/components/schemas/PublicDocumentReaderRequest"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "The job was accepted and queued.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AsyncJobAcceptedResponse"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "Opaque Direct Gateway request identifier when request preparation completed.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "description": "The request or required Idempotency-Key is invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "Opaque Direct Gateway request identifier when request preparation completed.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid Direct API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "Opaque Direct Gateway request identifier when request preparation completed.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "403": {
            "description": "Direct usage is exhausted or unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "Opaque Direct Gateway request identifier when request preparation completed.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "409": {
            "description": "Idempotency key conflict.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "Opaque Direct Gateway request identifier when request preparation completed.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "413": {
            "description": "Direct Gateway request body limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "Opaque Direct Gateway request identifier when request preparation completed.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "429": {
            "description": "Direct Gateway rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "Opaque Direct Gateway request identifier when request preparation completed.",
                "schema": {
                  "type": "string"
                }
              },
              "Retry-After": {
                "description": "Positive delay in seconds before retrying.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "503": {
            "description": "Submission or activation settlement is temporarily indeterminate.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "Opaque Direct Gateway request identifier when request preparation completed.",
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        },
        "x-ongsoolabs-credit-cost": {
          "reservedAtSubmission": 1,
          "finalizedOnSuccess": 1,
          "partial": 0,
          "failure": 0,
          "cancellation": 0
        }
      }
    },
    "/api/v1/summary/jobs": {
      "post": {
        "tags": [
          "Async Jobs"
        ],
        "summary": "Submit a Summary job.",
        "operationId": "submitAsyncSummaryJob",
        "security": [
          {
            "DirectApiKey": []
          }
        ],
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "00000000-0000-4000-8000-000000000000"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "url"
                ],
                "properties": {
                  "url": {
                    "type": "string",
                    "format": "uri"
                  },
                  "quality": {
                    "type": "string",
                    "enum": [
                      "standard"
                    ],
                    "default": "standard"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "The job was accepted and queued.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AsyncJobAcceptedResponse"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "Opaque Direct Gateway request identifier when request preparation completed.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "description": "The request or required Idempotency-Key is invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "Opaque Direct Gateway request identifier when request preparation completed.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid Direct API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "Opaque Direct Gateway request identifier when request preparation completed.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "403": {
            "description": "Direct usage is exhausted or unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "Opaque Direct Gateway request identifier when request preparation completed.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "409": {
            "description": "Idempotency key conflict.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "Opaque Direct Gateway request identifier when request preparation completed.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "413": {
            "description": "Direct Gateway request body limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "Opaque Direct Gateway request identifier when request preparation completed.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "429": {
            "description": "Direct Gateway rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "Opaque Direct Gateway request identifier when request preparation completed.",
                "schema": {
                  "type": "string"
                }
              },
              "Retry-After": {
                "description": "Positive delay in seconds before retrying.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "503": {
            "description": "Submission or activation settlement is temporarily indeterminate.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "Opaque Direct Gateway request identifier when request preparation completed.",
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        },
        "x-ongsoolabs-credit-cost": {
          "reservedAtSubmission": 5,
          "finalizedOnSuccess": 5,
          "partial": 0,
          "failure": 0,
          "cancellation": 0
        }
      }
    },
    "/api/v1/jobs/{jobId}": {
      "get": {
        "tags": [
          "Async Jobs"
        ],
        "summary": "Get an async job status.",
        "operationId": "getAsyncJobStatus",
        "security": [
          {
            "DirectApiKey": []
          }
        ],
        "parameters": [
          {
            "name": "jobId",
            "in": "path",
            "required": true,
            "description": "Opaque job ID returned by a successful async submission.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The tenant-scoped job status.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AsyncJobStatusResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid Direct API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "No job is visible to this Workspace for the supplied ID."
          }
        }
      },
      "delete": {
        "tags": [
          "Async Jobs"
        ],
        "summary": "Cancel a queued or running async job.",
        "operationId": "cancelAsyncJob",
        "security": [
          {
            "DirectApiKey": []
          }
        ],
        "parameters": [
          {
            "name": "jobId",
            "in": "path",
            "required": true,
            "description": "Opaque job ID returned by a successful async submission.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "202": {
            "description": "Cancellation was accepted.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AsyncJobCancellationResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid Direct API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "No job is visible to this Workspace for the supplied ID."
          },
          "409": {
            "description": "The job is no longer cancellable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "502": {
            "description": "Cancellation could not be safely relayed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "Cancellation is temporarily unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/jobs/{jobId}/result": {
      "get": {
        "tags": [
          "Async Jobs"
        ],
        "summary": "Get an async job result after settlement.",
        "operationId": "getAsyncJobResult",
        "security": [
          {
            "DirectApiKey": []
          }
        ],
        "parameters": [
          {
            "name": "jobId",
            "in": "path",
            "required": true,
            "description": "Opaque job ID returned by a successful async submission.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The canonical Reader, Document, or Summary response for this job.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid Direct API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "No job is visible to this Workspace for the supplied ID."
          },
          "409": {
            "description": "Web settlement is not complete. Retry the same result URL.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "The canonical result is temporarily unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "ReaderResponse": {
        "type": "object",
        "properties": {
          "id": {
            "type": [
              "null",
              "string"
            ]
          },
          "schemaVersion": {
            "type": [
              "null",
              "string"
            ]
          },
          "apiVersion": {
            "type": [
              "null",
              "string"
            ]
          },
          "url": {
            "type": [
              "null",
              "string"
            ]
          },
          "finalUrl": {
            "type": [
              "null",
              "string"
            ]
          },
          "status": {
            "type": [
              "null",
              "string"
            ]
          },
          "error": {
            "$ref": "#/components/schemas/ErrorDetails"
          },
          "contentType": {
            "type": [
              "null",
              "string"
            ]
          },
          "title": {
            "type": [
              "null",
              "string"
            ]
          },
          "description": {
            "type": [
              "null",
              "string"
            ]
          },
          "language": {
            "type": [
              "null",
              "string"
            ]
          },
          "content": {
            "$ref": "#/components/schemas/ReaderContent"
          },
          "metadata": {
            "$ref": "#/components/schemas/ReaderMetadata"
          },
          "usage": {
            "$ref": "#/components/schemas/UsageMetadata"
          },
          "quality": {
            "$ref": "#/components/schemas/QualityMetadata"
          },
          "execution": {
            "$ref": "#/components/schemas/ExecutionMetadata"
          },
          "chunks": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "$ref": "#/components/schemas/ChunkItem"
            }
          }
        },
        "additionalProperties": false
      },
      "ErrorResponse": {
        "type": "object",
        "properties": {
          "id": {
            "type": [
              "null",
              "string"
            ]
          },
          "schemaVersion": {
            "type": [
              "null",
              "string"
            ]
          },
          "apiVersion": {
            "type": [
              "null",
              "string"
            ]
          },
          "url": {
            "type": [
              "null",
              "string"
            ]
          },
          "status": {
            "type": [
              "null",
              "string"
            ]
          },
          "error": {
            "$ref": "#/components/schemas/ErrorDetails"
          },
          "usage": {
            "$ref": "#/components/schemas/UsageMetadata"
          },
          "execution": {
            "$ref": "#/components/schemas/ExecutionMetadata"
          }
        },
        "additionalProperties": false
      },
      "PublicReaderRequest": {
        "type": "object",
        "properties": {
          "url": {
            "type": [
              "null",
              "string"
            ]
          },
          "output_format": {
            "type": [
              "null",
              "string"
            ]
          },
          "tokenizer": {
            "type": [
              "null",
              "string"
            ]
          },
          "enable_chunking": {
            "type": "boolean"
          },
          "chunk_size_tokens": {
            "type": "integer",
            "format": "int32"
          },
          "overlap_size_tokens": {
            "type": "integer",
            "format": "int32"
          },
          "force_dynamic": {
            "type": "boolean"
          },
          "mode": {
            "type": [
              "null",
              "string"
            ]
          },
          "output": {
            "$ref": "#/components/schemas/OutputOptions"
          },
          "disable_css": {
            "type": [
              "null",
              "boolean"
            ]
          }
        },
        "additionalProperties": false
      },
      "PublicDocumentReaderRequest": {
        "type": "object",
        "properties": {
          "url": {
            "type": [
              "null",
              "string"
            ]
          },
          "tokenizer": {
            "type": [
              "null",
              "string"
            ]
          },
          "enable_chunking": {
            "type": "boolean"
          },
          "chunk_size_tokens": {
            "type": "integer",
            "format": "int32"
          },
          "overlap_size_tokens": {
            "type": "integer",
            "format": "int32"
          }
        },
        "additionalProperties": false
      },
      "ChunkRequest": {
        "type": "object",
        "properties": {
          "text": {
            "type": [
              "null",
              "string"
            ]
          },
          "tokenizer": {
            "type": [
              "null",
              "string"
            ]
          },
          "use_tokens": {
            "type": "boolean"
          },
          "chunk_size_tokens": {
            "type": "integer",
            "format": "int32"
          },
          "overlap_size_tokens": {
            "type": "integer",
            "format": "int32"
          },
          "chunk_size": {
            "type": "integer",
            "format": "int32"
          },
          "overlap_size": {
            "type": "integer",
            "format": "int32"
          }
        },
        "additionalProperties": false
      },
      "ChunkItem": {
        "type": "object",
        "properties": {
          "index": {
            "type": "integer",
            "format": "int32"
          },
          "start_char": {
            "type": "integer",
            "format": "int32"
          },
          "end_char": {
            "type": "integer",
            "format": "int32"
          },
          "token_count": {
            "type": "integer",
            "format": "int32"
          },
          "content": {
            "type": [
              "null",
              "string"
            ]
          }
        },
        "additionalProperties": false
      },
      "ErrorDetails": {
        "type": "object",
        "properties": {
          "code": {
            "type": [
              "null",
              "string"
            ]
          },
          "message": {
            "type": [
              "null",
              "string"
            ]
          },
          "retryable": {
            "type": "boolean"
          },
          "recommendedProfile": {
            "type": [
              "null",
              "string"
            ]
          },
          "userActionable": {
            "type": "boolean"
          }
        },
        "additionalProperties": false
      },
      "ReaderContent": {
        "type": "object",
        "properties": {
          "format": {
            "type": [
              "null",
              "string"
            ]
          },
          "value": {
            "type": [
              "null",
              "string"
            ]
          },
          "article": {
            "$ref": "#/components/schemas/ArticleDetails"
          }
        },
        "additionalProperties": false
      },
      "ReaderMetadata": {
        "type": "object",
        "properties": {
          "published_at": {
            "type": [
              "null",
              "string"
            ]
          },
          "canonical_url": {
            "type": [
              "null",
              "string"
            ]
          },
          "source_name": {
            "type": [
              "null",
              "string"
            ]
          },
          "language": {
            "type": [
              "null",
              "string"
            ]
          },
          "excerpt": {
            "type": [
              "null",
              "string"
            ]
          },
          "lead_image_url": {
            "type": [
              "null",
              "string"
            ]
          },
          "word_count": {
            "type": "integer",
            "format": "int32"
          },
          "reading_time_minutes": {
            "type": "integer",
            "format": "int32"
          }
        },
        "additionalProperties": false
      },
      "UsageMetadata": {
        "type": "object",
        "properties": {
          "characters": {
            "type": "integer",
            "format": "int32"
          },
          "tokens": {
            "type": "integer",
            "format": "int32"
          },
          "chunks": {
            "type": "integer",
            "format": "int32"
          },
          "credits": {
            "type": "number",
            "format": "double"
          }
        },
        "additionalProperties": false
      },
      "QualityMetadata": {
        "type": "object",
        "properties": {
          "version": {
            "type": [
              "null",
              "string"
            ]
          },
          "score": {
            "type": [
              "null",
              "number"
            ],
            "format": "double"
          },
          "grade": {
            "type": [
              "null",
              "string"
            ]
          },
          "confidence": {
            "type": [
              "null",
              "string"
            ]
          },
          "signals": {
            "$ref": "#/components/schemas/QualitySignals"
          },
          "warnings": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "type": "string"
            }
          }
        },
        "additionalProperties": false
      },
      "ExecutionMetadata": {
        "type": "object",
        "properties": {
          "profile": {
            "type": [
              "null",
              "string"
            ]
          },
          "usedBrowser": {
            "type": "boolean"
          },
          "cache": {
            "type": [
              "null",
              "string"
            ]
          },
          "retryCount": {
            "type": "integer",
            "format": "int32"
          },
          "durationMs": {
            "type": "integer",
            "format": "int64"
          }
        },
        "additionalProperties": false
      },
      "OutputOptions": {
        "type": "object",
        "properties": {
          "content": {
            "type": "boolean"
          },
          "metadata": {
            "type": "boolean"
          },
          "tables": {
            "type": "boolean"
          },
          "codeBlocks": {
            "type": "boolean"
          },
          "images": {
            "type": "boolean"
          },
          "links": {
            "type": "boolean"
          }
        },
        "additionalProperties": false
      },
      "ArticleDetails": {
        "type": "object",
        "properties": {
          "title": {
            "type": [
              "null",
              "string"
            ]
          },
          "body": {
            "type": [
              "null",
              "string"
            ]
          }
        },
        "additionalProperties": false
      },
      "QualitySignals": {
        "type": "object",
        "properties": {
          "contentLength": {
            "type": [
              "null",
              "integer"
            ],
            "format": "int32"
          },
          "markdownLength": {
            "type": [
              "null",
              "integer"
            ],
            "format": "int32"
          },
          "headingCount": {
            "type": [
              "null",
              "integer"
            ],
            "format": "int32"
          },
          "linkDensity": {
            "type": [
              "null",
              "number"
            ],
            "format": "double"
          },
          "boilerplateRatio": {
            "type": [
              "null",
              "number"
            ],
            "format": "double"
          },
          "duplicateParagraphRatio": {
            "type": [
              "null",
              "number"
            ],
            "format": "double"
          },
          "codeBlockCount": {
            "type": [
              "null",
              "integer"
            ],
            "format": "int32"
          },
          "tableCount": {
            "type": [
              "null",
              "integer"
            ],
            "format": "int32"
          },
          "imageCount": {
            "type": [
              "null",
              "integer"
            ],
            "format": "int32"
          },
          "languageDetected": {
            "type": [
              "null",
              "string"
            ]
          },
          "htmlToMarkdownRatio": {
            "type": [
              "null",
              "number"
            ],
            "format": "double"
          },
          "mainContentExtractionRatio": {
            "type": [
              "null",
              "number"
            ],
            "format": "double"
          }
        },
        "additionalProperties": false
      },
      "SummaryRequest": {
        "type": "object",
        "properties": {
          "url": {
            "type": [
              "null",
              "string"
            ]
          },
          "quality": {
            "type": [
              "null",
              "string"
            ]
          }
        },
        "additionalProperties": false
      },
      "SummaryResponse": {
        "type": "object",
        "properties": {
          "id": {
            "type": [
              "null",
              "string"
            ]
          },
          "schemaVersion": {
            "type": [
              "null",
              "string"
            ]
          },
          "apiVersion": {
            "type": [
              "null",
              "string"
            ]
          },
          "url": {
            "type": [
              "null",
              "string"
            ]
          },
          "finalUrl": {
            "type": [
              "null",
              "string"
            ]
          },
          "status": {
            "type": [
              "null",
              "string"
            ]
          },
          "sourceType": {
            "type": [
              "null",
              "string"
            ]
          },
          "title": {
            "type": [
              "null",
              "string"
            ]
          },
          "summary": {
            "type": [
              "null",
              "string"
            ]
          },
          "keywords": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "type": "string"
            }
          },
          "quality": {
            "type": [
              "null",
              "string"
            ]
          },
          "usage": {
            "$ref": "#/components/schemas/SummaryUsage"
          },
          "execution": {
            "$ref": "#/components/schemas/SummaryExecution"
          }
        },
        "additionalProperties": false
      },
      "ProblemDetails": {
        "type": "object",
        "properties": {
          "type": {
            "type": [
              "null",
              "string"
            ]
          },
          "title": {
            "type": [
              "null",
              "string"
            ]
          },
          "status": {
            "type": [
              "null",
              "integer"
            ],
            "format": "int32"
          },
          "detail": {
            "type": [
              "null",
              "string"
            ]
          },
          "instance": {
            "type": [
              "null",
              "string"
            ]
          }
        },
        "additionalProperties": {}
      },
      "SummaryErrorResponse": {
        "type": "object",
        "properties": {
          "id": {
            "type": [
              "null",
              "string"
            ]
          },
          "schemaVersion": {
            "type": [
              "null",
              "string"
            ]
          },
          "apiVersion": {
            "type": [
              "null",
              "string"
            ]
          },
          "url": {
            "type": [
              "null",
              "string"
            ]
          },
          "status": {
            "type": [
              "null",
              "string"
            ]
          },
          "error": {
            "$ref": "#/components/schemas/ErrorDetails"
          },
          "usage": {
            "$ref": "#/components/schemas/SummaryUsage"
          },
          "execution": {
            "$ref": "#/components/schemas/SummaryExecution"
          }
        },
        "additionalProperties": false
      },
      "SummaryUsage": {
        "type": "object",
        "properties": {
          "inputTokens": {
            "type": "integer",
            "format": "int32"
          },
          "outputTokens": {
            "type": "integer",
            "format": "int32"
          },
          "credits": {
            "type": "integer",
            "format": "int32"
          }
        },
        "additionalProperties": false
      },
      "SummaryExecution": {
        "type": "object",
        "properties": {
          "durationMs": {
            "type": "integer",
            "format": "int64"
          }
        },
        "additionalProperties": false
      },
      "AsyncJobAcceptedResponse": {
        "type": "object",
        "required": [
          "jobId",
          "operation",
          "status",
          "statusUrl",
          "resultUrl"
        ],
        "properties": {
          "jobId": {
            "type": "string"
          },
          "operation": {
            "type": "string",
            "enum": [
              "reader",
              "document",
              "summary"
            ]
          },
          "status": {
            "type": "string",
            "enum": [
              "queued"
            ]
          },
          "statusUrl": {
            "type": "string"
          },
          "resultUrl": {
            "type": "string"
          }
        }
      },
      "AsyncJobStatusResponse": {
        "type": "object",
        "required": [
          "jobId",
          "operation",
          "status",
          "createdAt"
        ],
        "properties": {
          "jobId": {
            "type": "string"
          },
          "operation": {
            "type": "string",
            "enum": [
              "reader",
              "document",
              "summary"
            ]
          },
          "status": {
            "type": "string",
            "enum": [
              "created",
              "queued",
              "running",
              "settling",
              "succeeded",
              "partial",
              "failed",
              "cancelled",
              "reconciliation_required"
            ]
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "completedAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "errorCode": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "AsyncJobCancellationResponse": {
        "type": "object",
        "required": [
          "jobId",
          "status"
        ],
        "properties": {
          "jobId": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "enum": [
              "cancelled",
              "cancellation_requested"
            ]
          }
        }
      },
      "AsyncWebhookCompletionEvent": {
        "type": "object",
        "required": [
          "id",
          "type",
          "createdAt",
          "data"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "type": {
            "type": "string",
            "enum": [
              "job.succeeded",
              "job.partial",
              "job.failed",
              "job.cancelled"
            ]
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "data": {
            "type": "object",
            "required": [
              "jobId",
              "operation",
              "status",
              "completedAt"
            ],
            "properties": {
              "jobId": {
                "type": "string"
              },
              "operation": {
                "type": "string",
                "enum": [
                  "reader",
                  "document",
                  "summary"
                ]
              },
              "status": {
                "type": "string",
                "enum": [
                  "succeeded",
                  "partial",
                  "failed",
                  "cancelled"
                ]
              },
              "completedAt": {
                "type": "string",
                "format": "date-time"
              },
              "errorCode": {
                "type": [
                  "string",
                  "null"
                ]
              }
            }
          }
        }
      }
    },
    "securitySchemes": {
      "DirectApiKey": {
        "type": "apiKey",
        "in": "header",
        "name": "X-API-Key"
      }
    }
  },
  "tags": [
    {
      "name": "Reader"
    },
    {
      "name": "Document"
    },
    {
      "name": "Summary"
    },
    {
      "name": "Async Jobs"
    }
  ],
  "servers": [
    {
      "url": "https://ongsoolabs.com"
    }
  ],
  "webhooks": {
    "jobCompletion": {
      "post": {
        "tags": [
          "Async Jobs"
        ],
        "summary": "Signed terminal async job event sent to the configured Workspace endpoint.",
        "parameters": [
          {
            "name": "X-OngsooLabs-Timestamp",
            "in": "header",
            "required": true,
            "description": "Unix time in seconds used in the signature input.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-OngsooLabs-Signature",
            "in": "header",
            "required": true,
            "description": "HMAC-SHA-256 signature in the form v1=\u003Clowercase-hex-digest\u003E.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-OngsooLabs-Event-Id",
            "in": "header",
            "required": true,
            "description": "Stable event ID for receiver idempotency.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-OngsooLabs-Delivery-Id",
            "in": "header",
            "required": true,
            "description": "Unique ID for this delivery attempt.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AsyncWebhookCompletionEvent"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Any 2xx response within 10 seconds acknowledges the delivery."
          }
        },
        "x-ongsoolabs-signature-input": "UTF8(timestamp \u002B \u0027.\u0027) || raw_request_body",
        "x-ongsoolabs-retry-schedule": [
          "immediate",
          "1m",
          "5m",
          "30m",
          "2h"
        ]
      }
    }
  }
}