{"openapi":"3.1.0","info":{"title":"BitMorph API","version":"1.0.0","description":"Convert, transform, and extract files programmatically. Auth with an API key: `Authorization: Bearer bm_live_…`."},"servers":[{"url":"https://api.bitmorph.io/v1"}],"security":[{"bearerAuth":[]}],"paths":{"/jobs":{"post":{"summary":"Create a job","description":"Run a tool on an input. Returns 202 (queued) unless the job finishes within a `Prefer: wait=<seconds>` budget, then 200 (completed).","parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string"},"description":"Dedupe retries — same key returns the same job."},{"name":"Prefer","in":"header","required":false,"schema":{"type":"string"},"description":"`wait=<0-55>` to long-poll for a fast job."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["tool","input"],"properties":{"tool":{"type":"string","enum":["aac-to-mp3","add-page-numbers","ai-to-pdf","ai-to-svg","ass-to-srt","ass-to-vtt","avi-to-mp4","avif-to-jpg","avif-to-png","avif-to-webp","azw3-to-pdf","barcode-generate","bmp-to-jpg","bmp-to-png","compress-image","compress-pdf","compress-video","contract-to-json","csv-to-excel","csv-to-json","csv-to-tsv","eml-to-html","eml-to-pdf","eps-to-pdf","eps-to-svg","epub-to-docx","epub-to-mobi","epub-to-pdf","excel-to-csv","excel-to-json","excel-to-pdf","extract-audio","extract-images","extract-tables","fbx-to-glb","fbx-to-obj","flac-to-mp3","flv-to-mp4","gif-to-jpg","gif-to-mp4","gif-to-png","glb-to-obj","glb-to-stl","heic-to-jpg","heic-to-png","html-to-markdown","html-to-pdf","ico-to-png","image-to-text","invoice-to-json","jpg-to-avif","jpg-to-pdf","jpg-to-png","jpg-to-svg","jpg-to-tiff","jpg-to-webp","json-to-csv","json-to-excel","json-to-xml","json-to-yaml","jupyter-to-html","jupyter-to-markdown","jupyter-to-pdf","latex-to-pdf","m4a-to-mp3","markdown-to-html","merge-pdf","mkv-to-mp4","mobi-to-pdf","mov-to-gif","mov-to-mp4","mp3-to-aac","mp3-to-wav","mp4-to-avi","mp4-to-gif","mp4-to-mov","mp4-to-mp3","mp4-to-webm","msg-to-html","msg-to-pdf","obj-to-glb","obj-to-stl","ocr-pdf","odp-to-pdf","ods-to-pdf","odt-to-pdf","ogg-to-mp3","pdf-to-chunks","pdf-to-csv","pdf-to-epub","pdf-to-excel","pdf-to-jpg","pdf-to-json","pdf-to-markdown","pdf-to-pdfa","pdf-to-png","pdf-to-powerpoint","pdf-to-text","pdf-to-word","ply-to-stl","png-to-avif","png-to-ico","png-to-jpg","png-to-pdf","png-to-svg","png-to-tiff","png-to-webp","powerpoint-to-pdf","protect-pdf","receipt-to-json","redact-pdf","resume-to-json","rotate-pdf","rtf-to-pdf","sbv-to-srt","sbv-to-vtt","scan-qr","split-pdf","srt-to-ass","srt-to-sbv","srt-to-vtt","ssa-to-srt","stl-to-glb","stl-to-obj","stl-to-ply","svg-to-jpg","svg-to-png","text-to-qr","tiff-to-jpg","tiff-to-png","tsv-to-csv","tsv-to-json","unlock-pdf","url-to-markdown","url-to-pdf","url-to-qr","vtt-to-ass","vtt-to-sbv","vtt-to-srt","watermark-pdf","wav-to-flac","wav-to-mp3","webm-to-mp4","webp-to-avif","webp-to-jpg","webp-to-png","wma-to-mp3","word-to-pdf","xml-to-json","yaml-to-json"]},"input":{"type":"object","description":"One of: {type:upload,file}, {type:url,url}, {type:inline,data}, or {type:multi,files:[]}."},"params":{"type":"object","additionalProperties":{"type":"string"}}}}}}},"responses":{"200":{"description":"Job","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Job"}}}},"202":{"description":"Job","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Job"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Auth","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"Quota exhausted","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate/concurrency limit","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"API launching soon","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"get":{"summary":"List jobs","parameters":[{"name":"limit","in":"query","schema":{"type":"integer","default":20,"maximum":100}},{"name":"starting_after","in":"query","schema":{"type":"string"}},{"name":"status","in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"A list of jobs"},"401":{"description":"Auth","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/jobs/{id}":{"get":{"summary":"Retrieve a job","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Job","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Job"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"summary":"Cancel a job","description":"Best-effort — removes a still-queued job.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Job","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Job"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/uploads":{"post":{"summary":"Create an upload","description":"Mint a presigned R2 PUT for a source file; reference the returned `file` handle in a job's input.","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"filename":{"type":"string"},"size":{"type":"integer"}}}}}},"responses":{"201":{"description":"Upload target"},"401":{"description":"Auth","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Too large","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"API launching soon","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/tools":{"get":{"summary":"List tools","security":[],"responses":{"200":{"description":"A list of tools"}}}},"/tools/{slug}":{"get":{"summary":"Retrieve a tool","security":[],"parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Tool contract"},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/webhook_endpoints":{"post":{"summary":"Register a webhook endpoint","requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["url"],"properties":{"url":{"type":"string","format":"uri"},"events":{"type":"array","items":{"type":"string"}}}}}}},"responses":{"201":{"description":"Endpoint (secret shown once)"},"400":{"description":"Invalid URL","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"get":{"summary":"List webhook endpoints","responses":{"200":{"description":"A list of endpoints"}}}},"/webhook_endpoints/{id}":{"get":{"summary":"Retrieve an endpoint","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Endpoint"},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"summary":"Delete an endpoint","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Deleted"},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/health":{"get":{"summary":"Health","security":[],"responses":{"200":{"description":"OK"}}}}},"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","description":"Your API key (bm_live_… / bm_test_…)."}},"schemas":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"param":{"type":"string"},"request_id":{"type":"string"},"doc_url":{"type":"string"}},"required":["type","code","message","request_id"]}}},"Job":{"type":"object","properties":{"id":{"type":"string"},"object":{"type":"string","enum":["job"]},"tool":{"type":"string"},"status":{"type":"string","enum":["queued","processing","completed","failed","canceled"]},"usage":{"type":"object","properties":{"units":{"type":"integer"},"class":{"type":"string","enum":["standard","heavy","ai","video"]}}},"output":{"type":["object","null"],"properties":{"url":{"type":"string","format":"uri"},"filename":{"type":"string"},"content_type":{"type":"string"},"size":{"type":"integer"},"expires_at":{"type":"string","format":"date-time"}}},"error":{"type":["object","null"]},"created_at":{"type":"string","format":"date-time"},"expires_at":{"type":"string","format":"date-time"}}}}}}