{"openapi":"3.1.0","info":{"title":"BrokenGPT API","version":"1.0.0","description":"OpenAI-compatible inference and usage endpoints backed by the stable broken-one model alias."},"servers":[{"url":"https://brokengpt.com"}],"tags":[{"name":"Inference","description":"Generate responses and count input tokens."},{"name":"Models","description":"Inspect public model capabilities."},{"name":"Batches","description":"Queue and inspect asynchronous inference requests."}],"paths":{"/v1/models":{"get":{"tags":["Models"],"summary":"List available public models","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Model list","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string"},"type":{"type":"string"},"code":{"type":"string"}},"required":["message","type"]}},"required":["error"]}}}},"403":{"description":"API key scope does not permit the operation","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string"},"type":{"type":"string"},"code":{"type":"string"}},"required":["message","type"]}},"required":["error"]}}}}}}},"/v1/chat/completions":{"post":{"tags":["Inference"],"summary":"Create a chat completion","security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"model":{"type":"string","default":"broken-one"},"messages":{"type":"array","minItems":1,"items":{"type":"object","properties":{"role":{"type":"string"},"content":{}},"required":["role","content"]}},"stream":{"type":"boolean","default":false},"temperature":{"type":"number"},"max_tokens":{"type":"integer","minimum":1},"tools":{"type":"array","items":{"type":"object","additionalProperties":true}}},"required":["model","messages"],"additionalProperties":true}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string"},"type":{"type":"string"},"code":{"type":"string"}},"required":["message","type"]}},"required":["error"]}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string"},"type":{"type":"string"},"code":{"type":"string"}},"required":["message","type"]}},"required":["error"]}}}},"403":{"description":"API key scope does not permit the operation","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string"},"type":{"type":"string"},"code":{"type":"string"}},"required":["message","type"]}},"required":["error"]}}}},"503":{"description":"Inference service is unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string"},"type":{"type":"string"},"code":{"type":"string"}},"required":["message","type"]}},"required":["error"]}}}}}}},"/v1/responses":{"post":{"tags":["Inference"],"summary":"Create a response","security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"model":{"type":"string","default":"broken-one"},"input":{"oneOf":[{"type":"string"},{"type":"array"}]},"stream":{"type":"boolean","default":false},"tools":{"type":"array","items":{"type":"object","additionalProperties":true}}},"required":["model","input"],"additionalProperties":true}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string"},"type":{"type":"string"},"code":{"type":"string"}},"required":["message","type"]}},"required":["error"]}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string"},"type":{"type":"string"},"code":{"type":"string"}},"required":["message","type"]}},"required":["error"]}}}},"403":{"description":"API key scope does not permit the operation","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string"},"type":{"type":"string"},"code":{"type":"string"}},"required":["message","type"]}},"required":["error"]}}}},"503":{"description":"Inference service is unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string"},"type":{"type":"string"},"code":{"type":"string"}},"required":["message","type"]}},"required":["error"]}}}}}}},"/v1/tokens/count":{"post":{"tags":["Inference"],"summary":"Count input tokens","security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"model":{"type":"string","default":"broken-one"},"input":{},"messages":{"type":"array","items":{"type":"object","additionalProperties":true}}},"additionalProperties":true}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string"},"type":{"type":"string"},"code":{"type":"string"}},"required":["message","type"]}},"required":["error"]}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string"},"type":{"type":"string"},"code":{"type":"string"}},"required":["message","type"]}},"required":["error"]}}}},"403":{"description":"API key scope does not permit the operation","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string"},"type":{"type":"string"},"code":{"type":"string"}},"required":["message","type"]}},"required":["error"]}}}},"503":{"description":"Inference service is unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string"},"type":{"type":"string"},"code":{"type":"string"}},"required":["message","type"]}},"required":["error"]}}}}}}},"/v1/batches":{"post":{"tags":["Batches"],"summary":"Create an inference batch","security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"requests":{"type":"array","minItems":1,"items":{"type":"object","properties":{"custom_id":{"type":"string"},"method":{"type":"string","const":"POST"},"url":{"type":"string","const":"/v1/chat/completions"},"body":{"type":"object","additionalProperties":true}},"required":["custom_id","body"]}}},"required":["requests"]}}}},"responses":{"200":{"description":"Batch queued","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string"},"type":{"type":"string"},"code":{"type":"string"}},"required":["message","type"]}},"required":["error"]}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string"},"type":{"type":"string"},"code":{"type":"string"}},"required":["message","type"]}},"required":["error"]}}}},"403":{"description":"API key scope does not permit the operation","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string"},"type":{"type":"string"},"code":{"type":"string"}},"required":["message","type"]}},"required":["error"]}}}},"503":{"description":"Inference service is unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string"},"type":{"type":"string"},"code":{"type":"string"}},"required":["message","type"]}},"required":["error"]}}}}}}},"/v1/batches/{id}":{"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"get":{"tags":["Batches"],"summary":"Retrieve a batch","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Batch status and items","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string"},"type":{"type":"string"},"code":{"type":"string"}},"required":["message","type"]}},"required":["error"]}}}},"403":{"description":"API key scope does not permit the operation","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string"},"type":{"type":"string"},"code":{"type":"string"}},"required":["message","type"]}},"required":["error"]}}}},"404":{"description":"Batch not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string"},"type":{"type":"string"},"code":{"type":"string"}},"required":["message","type"]}},"required":["error"]}}}}}},"delete":{"tags":["Batches"],"summary":"Cancel a queued batch","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Batch cancelled","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string"},"type":{"type":"string"},"code":{"type":"string"}},"required":["message","type"]}},"required":["error"]}}}},"403":{"description":"API key scope does not permit the operation","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string"},"type":{"type":"string"},"code":{"type":"string"}},"required":["message","type"]}},"required":["error"]}}}},"409":{"description":"Batch cannot be cancelled","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string"},"type":{"type":"string"},"code":{"type":"string"}},"required":["message","type"]}},"required":["error"]}}}}}}}},"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"API key"}}}}