{"openapi":"3.1.0","info":{"title":"Browser Platform API","version":"1.0.0","description":"Queue browser-backed chat, image, and video generation using authenticated provider sessions."},"servers":[{"url":"https://myapi-console.7akwy.net"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"API key"}},"parameters":{"provider":{"name":"provider","in":"path","required":true,"schema":{"type":"string"}},"userId":{"name":"userId","in":"query","required":false,"schema":{"type":"string"}},"jobId":{"name":"id","in":"path","required":true,"schema":{"type":"string"}}},"responses":{"Unauthorized":{"description":"Missing or invalid bearer key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"schemas":{"Job":{"type":"object","required":["id","status","type","provider","attempts","createdAt"],"properties":{"id":{"type":"string"},"status":{"type":"string","enum":["queued","running","succeeded","failed","cancelled"]},"type":{"type":"string","enum":["chat","image","video"]},"provider":{"type":"string"},"attempts":{"type":"integer"},"createdAt":{"type":"string","format":"date-time"},"statusUrl":{"type":"string"},"result":{"type":"object"},"error":{"type":"object"}}},"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"retryable":{"type":"boolean"}}}}}}},"paths":{"/health":{"get":{"security":[],"summary":"Service liveness","responses":{"200":{"description":"Online"}}}},"/providers":{"get":{"summary":"List active providers","responses":{"200":{"description":"Providers"},"401":{"$ref":"#/components/responses/Unauthorized"}}}},"/providers/{provider}/metadata":{"get":{"summary":"Read runtime provider options","parameters":[{"$ref":"#/components/parameters/provider"},{"$ref":"#/components/parameters/userId"}],"responses":{"200":{"description":"Discovered metadata"}}}},"/providers/{provider}/health":{"get":{"summary":"Check session health","parameters":[{"$ref":"#/components/parameters/provider"},{"$ref":"#/components/parameters/userId"}],"responses":{"200":{"description":"Provider health"}}}},"/chat":{"post":{"summary":"Queue a chat job","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["prompt"],"properties":{"provider":{"type":"string","default":"grok"},"userId":{"type":"string"},"async":{"type":"boolean","default":true},"prompt":{"type":"string","maxLength":20000},"conversationId":{"type":"string"}}}}}},"responses":{"202":{"description":"Queued job","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Job"}}}},"400":{"description":"Invalid input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/image":{"post":{"summary":"Queue an image job","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["prompt"],"properties":{"provider":{"type":"string","default":"grok"},"userId":{"type":"string"},"async":{"type":"boolean","default":true},"prompt":{"type":"string","maxLength":5000},"count":{"type":"integer","minimum":1,"maximum":4},"aspectRatio":{"type":"string"},"quality":{"type":"string"},"speed":{"type":"string"},"model":{"type":"string"}}}}}},"responses":{"202":{"description":"Queued job","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Job"}}}},"400":{"description":"Invalid input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/video":{"post":{"summary":"Queue a video job","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["prompt"],"properties":{"provider":{"type":"string","default":"grok"},"userId":{"type":"string"},"async":{"type":"boolean","default":true},"prompt":{"type":"string","maxLength":5000},"count":{"type":"integer","minimum":1,"maximum":4},"aspectRatio":{"type":"string"},"quality":{"type":"string"},"speed":{"type":"string"},"resolution":{"type":"string"},"duration":{"type":"string"},"model":{"type":"string"},"maxWaitMs":{"type":"integer"}}}}}},"responses":{"202":{"description":"Queued job","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Job"}}}},"400":{"description":"Invalid input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/jobs/{id}":{"get":{"summary":"Poll one job","parameters":[{"$ref":"#/components/parameters/jobId"}],"responses":{"200":{"description":"Job","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Job"}}}}}}},"/jobs/{id}/cancel":{"post":{"summary":"Cancel queued or running job","parameters":[{"$ref":"#/components/parameters/jobId"}],"responses":{"200":{"description":"Cancelled job"}}}},"/files/{id}":{"get":{"summary":"Download a generated file","parameters":[{"$ref":"#/components/parameters/jobId"}],"responses":{"200":{"description":"Generated file","content":{"application/octet-stream":{}}},"404":{"description":"Asset not found"}}}}}}