{"api_name":"RAG Query API Server","version":"1.0.0","description":"REST API for semantic search against military documents stored in Qdrant","endpoints":{"GET /docs/oauth2-redirect":"swagger_ui_redirect","GET /health":"Health check endpoint — verifies Qdrant and embedding service.","GET /api/collections":"List all collections with their metadata (parallel fetch, Ruff-style).","DELETE /api/cache/collections":"Invalidate the collections metadata cache. Call after updating collection data.","DELETE /api/cache/query":"Invalidate the content-addressed query result cache. Call after pipelines F or G upsert data.","GET /api/catalog":"Return documents grouped by branch/collection, filtered to only those indexed in Qdrant.\n\nReads from the unified registry, cross-references with Qdrant to include only\ningested documents, and returns document listings per collection.\nEach entry includes: doc_id, title, branch, category, pub_year, page_count.","GET /api/collections/{collection}":"Get info for a single collection.","GET /api/doc/{doc_id}":"Get document metadata from Qdrant payload.\n\nReturns document metadata from the first matching point found.\nSearches across all known collections using Qdrant filters for efficiency.\n\nArgs:\n    doc_id: The document ID to retrieve metadata for\n    \nReturns:\n    Dictionary with document metadata fields (title, branch, category, etc.)","GET /api/context":"Get a window of chunks from a document by position.\n\nReturns chunks from a single document centered around the specified\nchunk_index. For example, window=1 returns chunks at indices N-1, N, N+1.\n\nArgs:\n    doc_id: The document ID\n    chunk_index: The center chunk index (0-based)\n    collection: The collection name to search in\n    window: Window size (returns 2*window+1 chunks centered on chunk_index)\n\nReturns:\n    Dictionary with 'results' list containing the window of chunks","GET /api/images/{doc_id}/{page_num}":"List images for a specific page of a document.\n\nArgs:\n    doc_id: The document ID\n    page_num: The page number to list images for\n    \nReturns:\n    Dictionary with 'images' list containing image filenames for that page","GET /api/manifest":"Return machine-readable API manifest auto-generated from FastAPI routes.\n\nNo manual maintenance — every route registered with the app appears here.","GET /api/openapi.json":"Return OpenAPI 3.1 specification auto-generated from FastAPI routes.\n\nThis is a proxy to FastAPI's built-in openapi schema — no manual\nmaintenance required. Every route registered with the app automatically\nappears here.","POST /api/query":"Vector search endpoint using Qdrant similarity search.\n\nAccepts a natural language query and returns relevant document chunks\nfrom Qdrant using vector similarity search.\n\nSupports single collection search or cross-collection search with collection='*'.\n\nArgs:\n    request: QueryRequest with query text, top_k, and collection\n    \nReturns:\n    QueryResponse with matching chunks, query, collection, and total count","POST /api/query-provable":"Vector search with ZK proofs attached to every result chunk.\n\nFlow:\n    1. Query Qdrant (vector similarity)\n    2. Generate ZK proofs in parallel for all result chunks\n    3. Return only chunks that have successfully generated proofs\n\nNo chunk text is returned for a chunk unless its ZK proof exists.\nProof generation runs in parallel, capped by ZK_PROOF_PARALLELISM env var\n(default 2, set to 4 on the R730, 2 on the VPS).\n\nArgs:\n    request: QueryProvanableRequest with query text, top_k, and collection\n\nReturns:\n    QueryProvanableResponse with chunks (each with zk_proof attached),\n    plus a proofs dict keyed by chunk_id.","POST /api/provenance/submit":"Submit a ZK proof to Kurier/zkVerify for on-chain verification.\n\nAccepts proof data directly (no server-side cache required).\nReturns job_id immediately for polling.","POST /api/provenance/prove":"Generate a ZK proof for a specific chunk identified by doc_id and chunk_id.\n\nTakes a doc_id + chunk_id + collection, fetches the chunk from Qdrant,\ngenerates a ZK proof for it, and returns the chunk payload plus proof fields.\n\nUsed by the website's next/previous chunk navigation with provenance.","GET /api/provenance/status/{job_id}":"Poll Kurier job status for a proof verification job.\n\nReturns current status and, if complete, the verification result.","GET /api/provenance/poll/{job_id}":"Poll Kurier job status — no auth required.\n\nThis is a thin proxy to poll_zkverify_job that bypasses nginx's\nauth layer so browsers can poll without an API key.","GET /api/source/{doc_id}/info":"Return document metadata and price for paid PDF download.","GET /api/source/{doc_id}":"Stream the source PDF for a document, requiring X402 payment proof.\n\nWithout a Payment-Signature header: returns 402 with PAYMENT-REQUIRED.\nWith a valid EIP-3009 PaymentPayload: streams the PDF file."},"collections":["army","navy","marines","coast_guard","air_force","other"],"embedding_model":"Qwen/Qwen3-Embedding-0.6B","vector_dimension":1024}