{"openapi":"3.1.0","info":{"title":"VideoScope AI Analytics","description":"All projects available. Call onboard, read dictionary/rules, preflight, explicitly accept size, then execute. Read-only SQL.","version":"2026-10-03.3"},"servers":[{"url":"https://185-239-142-139.sslip.io/ai"}],"paths":{"/dictionary":{"get":{"summary":"Fields","operationId":"getDictionary","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/projects":{"get":{"summary":"Projects","description":"Discover projects in pages of 100. Every project is accessible. No implicit fixed project.","operationId":"listProjects","security":[{"HTTPBearer":[]}],"parameters":[{"name":"offset","in":"query","required":false,"schema":{"type":"integer","maximum":1000000,"minimum":0,"default":0,"title":"Offset"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/onboard":{"get":{"summary":"Onboard","description":"Mandatory first call in every chat. Read rules and all field meanings before acknowledging version.","operationId":"onboard","security":[{"HTTPBearer":[]}],"parameters":[{"name":"project_id","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","minimum":1},{"type":"null"}],"title":"Project Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/preflight":{"post":{"summary":"Preflight","description":"Compile SQL only. Inspect table sizes/unknowns and hard result caps BEFORE deciding to accept size.","operationId":"preflight","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Preflight"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}],"x-openai-isConsequential":false}},"/queries/{qid}/execute":{"post":{"summary":"Execute","description":"Start an asynchronous CSV export AFTER accepting preflight. Null caps explicitly mean unlimited. Poll status, do not repeat SQL.","operationId":"executeApprovedQuery","security":[{"HTTPBearer":[]}],"parameters":[{"name":"qid","in":"path","required":true,"schema":{"type":"string","title":"Qid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Confirm"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-openai-isConsequential":true}},"/queries/{qid}/cancel":{"post":{"summary":"Cancel","description":"Cancel your running/prepared export. No partial CSV will be downloadable.","operationId":"cancelQuery","security":[{"HTTPBearer":[]}],"parameters":[{"name":"qid","in":"path","required":true,"schema":{"type":"string","title":"Qid"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/queries/{qid}":{"get":{"summary":"Status","description":"Poll here after lost execute response. Do not re-create an identical query while status is running.","operationId":"queryStatus","security":[{"HTTPBearer":[]}],"parameters":[{"name":"qid","in":"path","required":true,"schema":{"type":"string","title":"Qid"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/queries/{qid}/csv":{"get":{"summary":"Download","description":"Authenticated complete UTF-8 CSV streamed from disk. Expires six hours after completion.","operationId":"downloadCSV","security":[{"HTTPBearer":[]}],"parameters":[{"name":"qid","in":"path","required":true,"schema":{"type":"string","title":"Qid"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/queries/{qid}/rows":{"get":{"summary":"Rows","description":"Read up to 20 rows / 32000 JSON bytes. Explicit preview_complete indicates whether more CSV rows exist.","operationId":"readSmallResult","security":[{"HTTPBearer":[]}],"parameters":[{"name":"qid","in":"path","required":true,"schema":{"type":"string","title":"Qid"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}},"components":{"schemas":{"Confirm":{"properties":{"accept_size":{"type":"boolean","title":"Accept Size"},"accepted_max_rows":{"anyOf":[{"type":"integer","minimum":1.0},{"type":"null"}],"title":"Accepted Max Rows"},"accepted_max_bytes":{"anyOf":[{"type":"integer","minimum":1.0},{"type":"null"}],"title":"Accepted Max Bytes"}},"additionalProperties":false,"type":"object","required":["accept_size","accepted_max_rows","accepted_max_bytes"],"title":"Confirm"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"Preflight":{"properties":{"session_id":{"type":"string","maxLength":80,"title":"Session Id"},"acknowledged_version":{"type":"string","maxLength":40,"title":"Acknowledged Version"},"sql":{"type":"string","maxLength":8192,"minLength":1,"title":"Sql"},"max_rows":{"anyOf":[{"type":"integer","minimum":1.0},{"type":"null"}],"title":"Max Rows"},"max_bytes":{"anyOf":[{"type":"integer","minimum":1.0},{"type":"null"}],"title":"Max Bytes"}},"additionalProperties":false,"type":"object","required":["session_id","acknowledged_version","sql"],"title":"Preflight"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"},"input":{"title":"Input"},"ctx":{"type":"object","title":"Context"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"}},"securitySchemes":{"HTTPBearer":{"type":"http","scheme":"bearer"}}}}