{"openapi":"3.1.0","info":{"title":"TryRobe Virtual Try-On API","version":"1.0.0","description":"Sanitized public API contract for verified TryRobe Business accounts. Internal generation providers, prompts, credentials, and infrastructure are not part of this specification."},"servers":[{"url":"https://api.tryrobe.in","description":"Production"}],"security":[{"bearerAuth":[]}],"paths":{"/v1/tryon":{"post":{"summary":"Create a URL-based virtual try-on job","operationId":"createTryon","parameters":[{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","minLength":8,"maxLength":100}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TryonRequest"}}}},"responses":{"202":{"description":"Job accepted","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TryonJob"}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"402":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/v1/tryon/upload":{"post":{"summary":"Create a multipart virtual try-on job","operationId":"uploadTryon","parameters":[{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","minLength":8,"maxLength":100}}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","required":["human_image","product_url"],"anyOf":[{"required":["product_image"]},{"required":["product_image_url"]}],"properties":{"human_image":{"type":"string","format":"binary"},"product_image":{"type":"string","format":"binary"},"product_image_url":{"type":"string","format":"uri"},"secondary_product_image":{"type":"string","format":"binary"},"secondary_product_image_url":{"type":"string","format":"uri"},"garment_scope":{"$ref":"#/components/schemas/GarmentScope"},"product_url":{"type":"string","format":"uri"},"product_title":{"type":"string","maxLength":120},"merchant_user_id":{"type":"string","maxLength":128}}}}}},"responses":{"202":{"description":"Job accepted","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TryonJob"}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"413":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/v1/tryon/recover":{"get":{"summary":"Recover an accepted job after an uncertain submission response","description":"Send the same Idempotency-Key used for creation. This endpoint never creates or charges a new job.","operationId":"recoverTryon","parameters":[{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","minLength":8,"maxLength":128}}],"responses":{"200":{"description":"Accepted job recovered","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TryonJob"}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/v1/tryon/{jobId}":{"get":{"summary":"Get a merchant-scoped try-on job","operationId":"getTryon","parameters":[{"name":"jobId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Current job state","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TryonJob"}}}},"401":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"}}}},"/v1/credits/balance":{"get":{"summary":"Get the authenticated Business credit balance","operationId":"getCreditBalance","responses":{"200":{"description":"Credit balance"},"401":{"$ref":"#/components/responses/Error"}}}}},"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","description":"Business license key. Use only from a trusted merchant backend."}},"schemas":{"GarmentScope":{"type":"string","enum":["complete_outfit","upper_wear","lower_wear","accessory"],"default":"complete_outfit"},"TryonRequest":{"type":"object","required":["human_image_url","product_image_url","product_url"],"properties":{"human_image_url":{"type":"string","format":"uri"},"product_image_url":{"type":"string","format":"uri"},"secondary_product_image_url":{"type":"string","format":"uri"},"garment_scope":{"$ref":"#/components/schemas/GarmentScope"},"product_url":{"type":"string","format":"uri"},"product_title":{"type":"string","maxLength":120},"merchant_user_id":{"type":"string","maxLength":128}}},"TryonJob":{"type":"object","properties":{"success":{"type":"boolean"},"job_id":{"type":"string"},"request_id":{"type":"string"},"status":{"type":"string","enum":["received","queued","processing","succeeded","failed","timeout"]},"output_image_url":{"type":["string","null"],"format":"uri"},"output_expires_at":{"type":["string","null"],"format":"date-time"},"credits_locked":{"type":"integer"},"credits_charged":{"type":"integer"}}},"Error":{"type":"object","properties":{"success":{"const":false},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}}}}}},"responses":{"Error":{"description":"Request error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}