{
    "openapi": "3.1.0",
    "info": {
        "title": "Dinamico Studio Hybrid Visual Production API",
        "version": "1.1.0",
        "summary": "Enterprise e-commerce image editing API: synchronous HD Background Removal, Reusable Style Guides, Zero-Credit Sandbox Mode, 3D Ghost Mannequin, Editorial Flat-Lay & Virtual Try-On.",
        "description": "Authenticate every request using `X-Api-Key: <token>` or `Authorization: Bearer <token>`. Add `X-Dinamico-Sandbox: 1` (or `\"sandbox\": true`) to test integrations free with watermarked previews and 0 credits deducted.",
        "contact": {
            "name": "Dinamico Studio API Engineering",
            "email": "info@dinamicostudio.com",
            "url": "https://docs.dinamicostudio.com/developers"
        }
    },
    "servers": [
        {
            "url": "https://docs.dinamicostudio.com/api/v1",
            "description": "Primary Production & Sandbox REST API v1"
        }
    ],
    "security": [
        {
            "ApiKeyHeader": []
        },
        {
            "BearerAuth": []
        }
    ],
    "components": {
        "securitySchemes": {
            "ApiKeyHeader": {
                "type": "apiKey",
                "in": "header",
                "name": "X-Api-Key"
            },
            "BearerAuth": {
                "type": "http",
                "scheme": "bearer"
            }
        }
    },
    "paths": {
        "/balance": {
            "get": {
                "operationId": "getWorkspaceBalance",
                "summary": "Get workspace credit balances & rate limits",
                "responses": {
                    "200": {
                        "description": "Workspace wallet balances and API tier"
                    }
                }
            }
        },
        "/presets": {
            "get": {
                "operationId": "listWorkspacePresets",
                "summary": "List built-in marketplace templates, AI presets & saved Order Style Guides",
                "responses": {
                    "200": {
                        "description": "All built-in and workspace preset UUIDs"
                    }
                }
            }
        },
        "/remove-bg": {
            "post": {
                "operationId": "removeBackground",
                "summary": "Synchronous HD Background Removal & Marketplace Compositing",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "image_url": {
                                        "type": "string",
                                        "format": "uri"
                                    },
                                    "preset_uuid": {
                                        "type": "string",
                                        "example": "tpl-amazon-main"
                                    },
                                    "background": {
                                        "type": "string",
                                        "example": "#FFFFFF"
                                    },
                                    "format": {
                                        "type": "string",
                                        "enum": [
                                            "png",
                                            "jpg",
                                            "jpeg",
                                            "webp"
                                        ]
                                    },
                                    "aspect_ratio": {
                                        "type": "string",
                                        "enum": [
                                            "original",
                                            "amazon_1x1",
                                            "square_1x1",
                                            "shopify_4x5",
                                            "portrait_3x4",
                                            "landscape_16x9"
                                        ]
                                    },
                                    "shadow": {
                                        "type": "string",
                                        "enum": [
                                            "none",
                                            "soft_contact",
                                            "drop_shadow"
                                        ]
                                    },
                                    "padding_pct": {
                                        "type": "integer",
                                        "minimum": 0,
                                        "maximum": 25
                                    },
                                    "alignment": {
                                        "type": "string",
                                        "enum": [
                                            "center",
                                            "bottom_baseline",
                                            "top",
                                            "original"
                                        ]
                                    },
                                    "return_type": {
                                        "type": "string",
                                        "enum": [
                                            "url",
                                            "binary"
                                        ]
                                    },
                                    "hybrid_fallback": {
                                        "type": "string",
                                        "enum": [
                                            "none",
                                            "auto_human"
                                        ]
                                    },
                                    "qa_threshold": {
                                        "type": "integer",
                                        "minimum": 50,
                                        "maximum": 98
                                    },
                                    "webhook_url": {
                                        "type": "string",
                                        "format": "uri"
                                    },
                                    "external_id": {
                                        "type": "string"
                                    },
                                    "sandbox": {
                                        "type": "boolean",
                                        "default": false
                                    }
                                }
                            }
                        },
                        "multipart/form-data": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "file": {
                                        "type": "string",
                                        "format": "binary"
                                    },
                                    "preset_uuid": {
                                        "type": "string"
                                    },
                                    "background": {
                                        "type": "string"
                                    },
                                    "format": {
                                        "type": "string"
                                    },
                                    "aspect_ratio": {
                                        "type": "string"
                                    },
                                    "shadow": {
                                        "type": "string"
                                    },
                                    "padding_pct": {
                                        "type": "integer"
                                    },
                                    "alignment": {
                                        "type": "string"
                                    },
                                    "return_type": {
                                        "type": "string"
                                    },
                                    "sandbox": {
                                        "type": "boolean"
                                    }
                                }
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Cutout JSON URL or binary image"
                    },
                    "402": {
                        "description": "Insufficient credits"
                    },
                    "422": {
                        "description": "Validation or preset error"
                    },
                    "429": {
                        "description": "Rate limit or daily sandbox quota exceeded"
                    }
                }
            }
        },
        "/ghost-mannequin": {
            "post": {
                "operationId": "createGhostMannequinJob",
                "summary": "Async 3D Ghost Mannequin composite generation",
                "responses": {
                    "202": {
                        "description": "Job accepted; poll status_url"
                    }
                }
            }
        },
        "/flat-lay": {
            "post": {
                "operationId": "createFlatLayJob",
                "summary": "Async 90-degree Editorial Flat-Lay scene generation",
                "responses": {
                    "202": {
                        "description": "Job accepted; poll status_url"
                    }
                }
            }
        },
        "/vto": {
            "post": {
                "operationId": "createVirtualTryOnJob",
                "summary": "Async AI Virtual Try-On studio model casting",
                "responses": {
                    "202": {
                        "description": "Job accepted; poll status_url"
                    }
                }
            }
        },
        "/uploads/presign": {
            "post": {
                "operationId": "presignStudioUploads",
                "summary": "Issue 256-bit encrypted cloud PUT URLs (up to 2 GB/file for RAW, PSD, TIFF, PNG, JPG)",
                "responses": {
                    "200": {
                        "description": "Presigned PUT URLs and workspace storage_keys"
                    }
                }
            }
        },
        "/jobs/{uuid}": {
            "get": {
                "operationId": "getJobStatus",
                "summary": "Poll async job status, Edge QA score & retrieve signed output URL",
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Job status, QA score, and output URL"
                    }
                }
            }
        },
        "/jobs/{uuid}/reject": {
            "post": {
                "operationId": "rejectJobToHumanStudio",
                "summary": "1-call QA rejection escalating an AI job + coordinate pins into a Human Retouching Order",
                "responses": {
                    "201": {
                        "description": "Human Order created with linked assets and pins"
                    }
                }
            }
        },
        "/orders": {
            "get": {
                "operationId": "listHumanOrders",
                "summary": "List Human Retouching Orders with status & external_id filters",
                "responses": {
                    "200": {
                        "description": "Paginated Human Retouching Orders"
                    }
                }
            },
            "post": {
                "operationId": "createHumanOrder",
                "summary": "Create Human Retouching Order (Style Guide UUID, multi-frame focus stacks & colorway pins)",
                "responses": {
                    "201": {
                        "description": "Human Retouching Order queued"
                    }
                }
            }
        },
        "/orders/{id}": {
            "get": {
                "operationId": "getHumanOrder",
                "summary": "Get Human Order status, specs, and signed delivered file URLs",
                "responses": {
                    "200": {
                        "description": "Order specifications and delivered assets"
                    }
                }
            }
        },
        "/orders/{id}/revisions": {
            "post": {
                "operationId": "createOrderRevisions",
                "summary": "Submit (x,y) coordinate pin revisions on a Human Retouching Order",
                "responses": {
                    "201": {
                        "description": "Revision pins recorded and order re-opened"
                    }
                }
            }
        }
    }
}