{"openapi":"3.1.0","info":{"title":"PennyCompute buyer API","version":"1.0.0"},"servers":[{"url":"https://api.pennycompute.com"}],"security":[{"buyerKey":[]}],"components":{"securitySchemes":{"buyerKey":{"type":"http","scheme":"bearer"}},"schemas":{"Job":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"service_id":{"type":"string"},"status":{"type":"string"},"outstanding_micros":{"type":"string","pattern":"^[0-9]+$","description":"Millionths of one US dollar"},"charged_fee_micros":{"type":["string","null"],"description":"Final charge in millionths of a US dollar after successful completion."},"created_at":{"type":"string"}},"required":["id","service_id","status"]},"Specification":{"type":"object","properties":{"service_id":{"type":"string","enum":["h3.reference_480p.v1","ffmpeg.stitch_export.v1","ffmpeg.transcode.v1","ffmpeg.caption_burn.v1","ffmpeg.audio_mix.v1"]},"input":{"type":"object","description":"Operation-specific input. Use a single JPEG for H3 and managed input URLs for FFmpeg."}},"required":["service_id","input"]}}},"paths":{"/v1/services":{"get":{"summary":"List enabled services","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"services":{"type":"array","items":{"type":"object","properties":{"service_id":{"type":"string"},"display_name":{"type":"string"}},"required":[]}}},"required":[]}}}},"default":{"description":"Request error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}},"security":[]}},"/v1/assets":{"post":{"summary":"Prepare a source upload","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"bytes":{"type":"integer","minimum":12,"maximum":33554432},"content_type":{"enum":["video/mp4","audio/mp4","audio/wav","text/plain"]},"public_intent":{"const":true}},"required":["bytes","content_type","public_intent"]}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"upload_url":{"type":"string","format":"uri"},"input_url":{"type":"string","format":"uri"}},"required":[]}}}},"default":{"description":"Request error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/v1/jobs":{"post":{"summary":"Submit a job","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Specification"}}}},"responses":{"200":{"description":"Idempotent retry","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Job"}}}},"201":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Job"}}}},"default":{"description":"Request error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}},"parameters":[{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string"}}]},"get":{"summary":"List your jobs","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"jobs":{"type":"array","items":{"$ref":"#/components/schemas/Job"}},"next_cursor":{"type":["string","null"],"description":"Opaque cursor for the next page, or null when there are no more jobs."}},"required":["jobs","next_cursor"]}}}},"default":{"description":"Request error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}},"parameters":[{"name":"status","in":"query","schema":{"type":"string"},"description":"Return only jobs with this status."},{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":200,"default":50},"description":"Maximum number of jobs to return."},{"name":"cursor","in":"query","schema":{"type":"string"},"description":"Opaque next_cursor from the previous response. Omit for the first page."}]}},"/v1/jobs/{id}":{"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"get":{"summary":"Read job status and charges","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Job"}}}},"default":{"description":"Request error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/v1/jobs/{id}/output":{"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"get":{"summary":"Get a short-lived output download link","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string","format":"uri"}},"required":["url"]}}}},"default":{"description":"Request error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/v1/jobs/{id}/cancel":{"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"post":{"summary":"Cancel a job","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{},"required":[]}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Job"}}}},"default":{"description":"Request error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/v1/billing/balance":{"get":{"summary":"Read the prepaid balance","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"prepaid_micros":{"type":"string","pattern":"^[0-9]+$","description":"Millionths of one US dollar"},"outstanding_micros":{"type":"string","pattern":"^[0-9]+$","description":"Millionths of one US dollar"}},"required":["prepaid_micros","outstanding_micros"]}}}},"default":{"description":"Request error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}}}}