{
  "openapi": "3.1.0",
  "info": {
    "title": "Fittins AI API",
    "version": "1.0.0",
    "summary": "Premium on-model fashion photos from your product photos.",
    "description": "The Fittins AI API creates studio-quality on-model photos of your products, up to 8K. Included in the Pro, Business, Enterprise plans; uses the same credits as fittins.ai. Docs: https://fittins.ai/docs/api",
    "contact": {
      "name": "Fittins AI",
      "url": "https://fittins.ai/support",
      "email": "support@fittins.ai"
    },
    "termsOfService": "https://fittins.ai/terms"
  },
  "servers": [
    {
      "url": "https://api.fittins.ai/v1"
    }
  ],
  "security": [
    {
      "bearerAuth": []
    }
  ],
  "tags": [
    {
      "name": "Images"
    },
    {
      "name": "Generations"
    },
    {
      "name": "Uploads"
    },
    {
      "name": "Files"
    },
    {
      "name": "Models and locations"
    },
    {
      "name": "Account"
    }
  ],
  "paths": {
    "/images": {
      "post": {
        "operationId": "createImage",
        "summary": "Create an on-model photo",
        "tags": [
          "Images"
        ],
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z0-9_-]{8,64}$"
            },
            "description": "Retry safely: the same key and body return the same generation for 24 hours."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "product_images",
                  "model_id",
                  "prompt"
                ],
                "properties": {
                  "product_images": {
                    "type": "array",
                    "minItems": 1,
                    "maxItems": 3,
                    "description": "1 to 3 photos of the product: { \"url\": \"https://…\" } or { \"upload_id\": \"upl_…\" }. Flat lays, hanger and ghost-mannequin shots and packshots all work. Different angles of one item are fine; another colour of the same item goes in a separate generation.",
                    "items": {
                      "oneOf": [
                        {
                          "type": "object",
                          "additionalProperties": false,
                          "required": [
                            "url"
                          ],
                          "properties": {
                            "url": {
                              "type": "string",
                              "format": "uri",
                              "pattern": "^https://",
                              "maxLength": 2048
                            }
                          }
                        },
                        {
                          "type": "object",
                          "additionalProperties": false,
                          "required": [
                            "upload_id"
                          ],
                          "properties": {
                            "upload_id": {
                              "type": "string",
                              "pattern": "^upl_"
                            }
                          }
                        }
                      ]
                    }
                  },
                  "model_id": {
                    "type": "string",
                    "pattern": "^mdl_(lib|own)_",
                    "description": "A library model (mdl_lib_…) or one of your custom models (mdl_own_…). List them with GET /v1/models."
                  },
                  "prompt": {
                    "type": "string",
                    "minLength": 3,
                    "maxLength": 1500,
                    "description": "3 to 1500 characters: pose, framing, light, mood, setting."
                  },
                  "location_id": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "pattern": "^loc_(lib|own)_",
                    "description": "A library or custom location (loc_lib_…, loc_own_…). Leave it out to describe the setting in the prompt."
                  },
                  "aspect_ratio": {
                    "type": "string",
                    "enum": [
                      "1:1",
                      "9:16",
                      "16:9",
                      "3:4",
                      "4:3",
                      "3:2",
                      "2:3"
                    ],
                    "default": "1:1"
                  },
                  "tier": {
                    "type": "string",
                    "enum": [
                      "turbo",
                      "default",
                      "premium",
                      "ultra"
                    ],
                    "default": "default",
                    "description": "turbo · default · premium (Starter plan and up) · ultra (Business and up)."
                  },
                  "quality": {
                    "type": "string",
                    "enum": [
                      "1k",
                      "2k",
                      "4k",
                      "8k"
                    ],
                    "default": "1k",
                    "description": "1k · 2k · 4k · 8k. 2K, 4K and 8K are upscaled from the generated photo."
                  },
                  "metadata": {
                    "type": "object",
                    "maxProperties": 20,
                    "additionalProperties": {
                      "type": "string",
                      "maxLength": 500
                    },
                    "description": "Your own references, returned unchanged: up to 20 keys (letters, digits, - or _, up to 40 characters), values up to 500 characters. metadata.sku (or reference) is shown on the result in My Generations."
                  }
                }
              },
              "example": {
                "product_images": [
                  {
                    "url": "https://cdn.mystore.com/p/tshirt-red-front.jpg"
                  }
                ],
                "model_id": "mdl_lib_DM5rQvl3KtlR7nqumd6I",
                "prompt": "full body, plain light grey background, soft studio light, front view",
                "aspect_ratio": "3:4",
                "tier": "default",
                "quality": "2k",
                "metadata": {
                  "sku": "TSHIRT-RED-M"
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The generation an earlier request with the same Idempotency-Key made.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Generation"
                }
              }
            }
          },
          "202": {
            "description": "Accepted and queued.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Generation"
                },
                "example": {
                  "id": "gen_7Hq2Mz9TkQ4x1bVnR8sL",
                  "object": "generation",
                  "type": "image",
                  "status": "queued",
                  "created_at": "2026-11-04T17:02:11.000Z",
                  "started_at": null,
                  "completed_at": null,
                  "input": {
                    "model_id": "mdl_lib_DM5rQvl3KtlR7nqumd6I",
                    "product_images": [
                      {
                        "url": "https://cdn.mystore.com/p/tshirt-red-front.jpg"
                      }
                    ],
                    "location_id": null,
                    "prompt": "full body, plain light grey background, soft studio light, front view",
                    "aspect_ratio": "3:4",
                    "tier": "default",
                    "quality": "2k"
                  },
                  "output": null,
                  "credits": {
                    "estimated": 50,
                    "charged": 0
                  },
                  "project_id": null,
                  "metadata": {
                    "sku": "TSHIRT-RED-M"
                  },
                  "error": null,
                  "livemode": true
                }
              }
            }
          },
          "400": {
            "description": "invalid_request or invalid_image; param names the field.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, unknown or revoked API key (invalid_api_key).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "insufficient_credits",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The plan does not include the API or this option (api_not_in_plan, not_in_plan, storage_full).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Unknown model, location or upload.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "idempotency_conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests (rate_limited) or generations (concurrency_limit). See Retry-After.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/generations": {
      "get": {
        "operationId": "listGenerations",
        "summary": "List generations",
        "tags": [
          "Generations"
        ],
        "parameters": [
          {
            "name": "status",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "queued",
                "running",
                "succeeded",
                "failed"
              ]
            }
          },
          {
            "name": "type",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "image"
              ]
            }
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 20
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Newest first.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "object",
                    "data",
                    "has_more",
                    "next_cursor"
                  ],
                  "properties": {
                    "object": {
                      "const": "list"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Generation"
                      }
                    },
                    "has_more": {
                      "type": "boolean"
                    },
                    "next_cursor": {
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing, unknown or revoked API key (invalid_api_key).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The plan does not include the API or this option (api_not_in_plan, not_in_plan, storage_full).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests (rate_limited) or generations (concurrency_limit). See Retry-After.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/generations/{id}": {
      "get": {
        "operationId": "getGeneration",
        "summary": "Get a generation",
        "tags": [
          "Generations"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "gen_…"
          }
        ],
        "responses": {
          "200": {
            "description": "The generation.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Generation"
                },
                "example": {
                  "id": "gen_7Hq2Mz9TkQ4x1bVnR8sL",
                  "object": "generation",
                  "type": "image",
                  "status": "succeeded",
                  "created_at": "2026-11-04T17:02:11.000Z",
                  "started_at": "2026-11-04T17:02:13.000Z",
                  "completed_at": "2026-11-04T17:03:02.000Z",
                  "input": {
                    "model_id": "mdl_lib_DM5rQvl3KtlR7nqumd6I",
                    "product_images": [
                      {
                        "url": "https://cdn.mystore.com/p/tshirt-red-front.jpg"
                      }
                    ],
                    "location_id": null,
                    "prompt": "full body, plain light grey background, soft studio light, front view",
                    "aspect_ratio": "3:4",
                    "tier": "default",
                    "quality": "2k"
                  },
                  "output": {
                    "file_id": "file_3f9c2a7b1e0d4c6a8b2f5e1d",
                    "url": "https://api.fittins.ai/v1/files/file_3f9c2a7b1e0d4c6a8b2f5e1d/content?expires=1793905382&sig=Jk2v…",
                    "url_expires_at": "2026-11-05T17:03:02.000Z",
                    "format": "png",
                    "width": 1536,
                    "height": 2048,
                    "quality": "2k",
                    "title": "Red cotton T-shirt on a model, studio front view",
                    "alt_text": "Model wearing a red crew-neck cotton T-shirt, light grey studio background"
                  },
                  "credits": {
                    "estimated": 50,
                    "charged": 50
                  },
                  "project_id": "proj_img_1793816582113_k2p9x4",
                  "metadata": {
                    "sku": "TSHIRT-RED-M"
                  },
                  "error": null,
                  "livemode": true
                }
              }
            }
          },
          "401": {
            "description": "Missing, unknown or revoked API key (invalid_api_key).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The plan does not include the API or this option (api_not_in_plan, not_in_plan, storage_full).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not on this account.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests (rate_limited) or generations (concurrency_limit). See Retry-After.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/uploads": {
      "post": {
        "operationId": "createUpload",
        "summary": "Upload a product photo",
        "tags": [
          "Uploads"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "required": [
                  "file"
                ],
                "properties": {
                  "file": {
                    "type": "string",
                    "format": "binary",
                    "description": "PNG, JPEG or WebP, up to 10 MB."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Saved to the image library.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Upload"
                },
                "example": {
                  "id": "upl_1793816500123_5Tn8Rr2W",
                  "object": "upload",
                  "filename": "tshirt-red-front.jpg",
                  "content_type": "image/jpeg",
                  "size_bytes": 842113,
                  "width": 1024,
                  "height": 1024,
                  "created_at": "2026-11-04T17:01:40.000Z"
                }
              }
            }
          },
          "400": {
            "description": "invalid_request or invalid_image.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, unknown or revoked API key (invalid_api_key).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The plan does not include the API or this option (api_not_in_plan, not_in_plan, storage_full).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests (rate_limited) or generations (concurrency_limit). See Retry-After.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/files/{file_id}/content": {
      "get": {
        "operationId": "downloadFile",
        "summary": "Download a file",
        "tags": [
          "Files"
        ],
        "description": "Full-quality file. Works with the API key, or with the signed expires and sig of output.url (24 hours) and no key.",
        "security": [
          {
            "bearerAuth": []
          },
          {}
        ],
        "parameters": [
          {
            "name": "file_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "file_…"
          },
          {
            "name": "expires",
            "in": "query",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "sig",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The file.",
            "content": {
              "image/png": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "400": {
            "description": "Expired or invalid signed link.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "No such file on this account.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/models": {
      "get": {
        "operationId": "listModels",
        "summary": "List models",
        "tags": [
          "Models and locations"
        ],
        "parameters": [
          {
            "name": "source",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "library",
                "custom"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Library and custom models.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "object",
                    "data",
                    "has_more",
                    "next_cursor"
                  ],
                  "properties": {
                    "object": {
                      "const": "list"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Model"
                      }
                    },
                    "has_more": {
                      "type": "boolean"
                    },
                    "next_cursor": {
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing, unknown or revoked API key (invalid_api_key).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The plan does not include the API or this option (api_not_in_plan, not_in_plan, storage_full).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests (rate_limited) or generations (concurrency_limit). See Retry-After.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/models/{id}": {
      "get": {
        "operationId": "getModel",
        "summary": "Get a model",
        "tags": [
          "Models and locations"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "mdl_lib_… or mdl_own_…"
          }
        ],
        "responses": {
          "200": {
            "description": "One model.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Model"
                }
              }
            }
          },
          "401": {
            "description": "Missing, unknown or revoked API key (invalid_api_key).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The plan does not include the API or this option (api_not_in_plan, not_in_plan, storage_full).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not in our library or this account.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests (rate_limited) or generations (concurrency_limit). See Retry-After.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/locations": {
      "get": {
        "operationId": "listLocations",
        "summary": "List locations",
        "tags": [
          "Models and locations"
        ],
        "parameters": [
          {
            "name": "source",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "library",
                "custom"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Library and custom locations.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "object",
                    "data",
                    "has_more",
                    "next_cursor"
                  ],
                  "properties": {
                    "object": {
                      "const": "list"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Location"
                      }
                    },
                    "has_more": {
                      "type": "boolean"
                    },
                    "next_cursor": {
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing, unknown or revoked API key (invalid_api_key).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The plan does not include the API or this option (api_not_in_plan, not_in_plan, storage_full).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests (rate_limited) or generations (concurrency_limit). See Retry-After.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/locations/{id}": {
      "get": {
        "operationId": "getLocation",
        "summary": "Get a location",
        "tags": [
          "Models and locations"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "loc_lib_… or loc_own_…"
          }
        ],
        "responses": {
          "200": {
            "description": "One location.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Location"
                }
              }
            }
          },
          "401": {
            "description": "Missing, unknown or revoked API key (invalid_api_key).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The plan does not include the API or this option (api_not_in_plan, not_in_plan, storage_full).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not in our library or this account.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests (rate_limited) or generations (concurrency_limit). See Retry-After.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/account": {
      "get": {
        "operationId": "getAccount",
        "summary": "Get the account",
        "tags": [
          "Account"
        ],
        "responses": {
          "200": {
            "description": "Plan, credits, features, limits and storage.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Account"
                },
                "example": {
                  "object": "account",
                  "plan": {
                    "id": "creator_pro",
                    "name": "Pro",
                    "billing_cycle": "monthly",
                    "renews_at": "2026-12-01T00:00:00.000Z"
                  },
                  "credits": {
                    "balance": 2860,
                    "reserved": 110,
                    "available": 2750
                  },
                  "features": {
                    "image_tiers": [
                      "default",
                      "turbo",
                      "premium"
                    ],
                    "image_qualities": [
                      "1k",
                      "2k",
                      "4k",
                      "8k"
                    ],
                    "video_tiers": [
                      "default",
                      "turbo",
                      "premium"
                    ],
                    "video_qualities": [
                      "1k",
                      "2k",
                      "4k"
                    ],
                    "custom_models_max": 50,
                    "custom_locations_max": 50
                  },
                  "limits": {
                    "concurrent_generations": 5,
                    "requests_per_minute": 60,
                    "creates_per_minute": 20
                  },
                  "storage": {
                    "used_bytes": 812649113,
                    "limit_bytes": 5368709120
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing, unknown or revoked API key (invalid_api_key).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The plan does not include the API or this option (api_not_in_plan, not_in_plan, storage_full).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests (rate_limited) or generations (concurrency_limit). See Retry-After.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "description": "fit_live_… key from Profile → API keys."
      }
    },
    "schemas": {
      "Generation": {
        "type": "object",
        "required": [
          "id",
          "object",
          "type",
          "status",
          "created_at",
          "input",
          "credits",
          "metadata",
          "livemode"
        ],
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^gen_"
          },
          "object": {
            "const": "generation"
          },
          "type": {
            "type": "string",
            "enum": [
              "image"
            ]
          },
          "status": {
            "type": "string",
            "enum": [
              "queued",
              "running",
              "succeeded",
              "failed"
            ]
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "started_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "completed_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "input": {
            "type": "object"
          },
          "output": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "type": "object",
                "properties": {
                  "file_id": {
                    "type": "string"
                  },
                  "url": {
                    "type": "string",
                    "format": "uri"
                  },
                  "url_expires_at": {
                    "type": "string",
                    "format": "date-time"
                  },
                  "format": {
                    "const": "png"
                  },
                  "width": {
                    "type": [
                      "integer",
                      "null"
                    ]
                  },
                  "height": {
                    "type": [
                      "integer",
                      "null"
                    ]
                  },
                  "quality": {
                    "type": "string",
                    "enum": [
                      "1k",
                      "2k",
                      "4k",
                      "8k"
                    ]
                  },
                  "title": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "alt_text": {
                    "type": [
                      "string",
                      "null"
                    ]
                  }
                }
              }
            ]
          },
          "credits": {
            "type": "object",
            "properties": {
              "estimated": {
                "type": "integer"
              },
              "charged": {
                "type": "integer"
              }
            }
          },
          "project_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "metadata": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            }
          },
          "error": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "type": "object",
                "properties": {
                  "code": {
                    "type": "string",
                    "enum": [
                      "invalid_request",
                      "invalid_image",
                      "invalid_api_key",
                      "insufficient_credits",
                      "api_not_in_plan",
                      "not_in_plan",
                      "storage_full",
                      "not_found",
                      "method_not_allowed",
                      "idempotency_conflict",
                      "content_flagged",
                      "protected_content",
                      "rate_limited",
                      "concurrency_limit",
                      "generation_failed",
                      "internal_error"
                    ]
                  },
                  "message": {
                    "type": "string"
                  }
                }
              }
            ]
          },
          "livemode": {
            "type": "boolean"
          }
        }
      },
      "Model": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "object": {
            "const": "model"
          },
          "source": {
            "type": "string",
            "enum": [
              "library",
              "custom"
            ]
          },
          "name": {
            "type": "string"
          },
          "image_url": {
            "type": [
              "string",
              "null"
            ],
            "format": "uri"
          },
          "created_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        },
        "example": {
          "id": "mdl_lib_DM5rQvl3KtlR7nqumd6I",
          "object": "model",
          "source": "library",
          "name": "Layla Noor",
          "image_url": "https://api.fittins.ai/v1/files/file_8a1d0c3e5f7b9d2c4e6a8b0d/content?expires=1793905382&sig=Qa9…",
          "created_at": null
        }
      },
      "Location": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "object": {
            "const": "location"
          },
          "source": {
            "type": "string",
            "enum": [
              "library",
              "custom"
            ]
          },
          "name": {
            "type": "string"
          },
          "image_url": {
            "type": [
              "string",
              "null"
            ],
            "format": "uri"
          },
          "created_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        }
      },
      "Upload": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^upl_"
          },
          "object": {
            "const": "upload"
          },
          "filename": {
            "type": "string"
          },
          "content_type": {
            "type": "string"
          },
          "size_bytes": {
            "type": "integer"
          },
          "width": {
            "type": [
              "integer",
              "null"
            ]
          },
          "height": {
            "type": [
              "integer",
              "null"
            ]
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "Account": {
        "type": "object"
      },
      "Error": {
        "type": "object",
        "required": [
          "error"
        ],
        "properties": {
          "error": {
            "type": "object",
            "required": [
              "type",
              "code",
              "message",
              "request_id"
            ],
            "properties": {
              "type": {
                "type": "string",
                "enum": [
                  "invalid_request_error",
                  "authentication_error",
                  "credits_error",
                  "permission_error",
                  "not_found_error",
                  "idempotency_error",
                  "content_error",
                  "rate_limit_error",
                  "generation_error",
                  "api_error"
                ]
              },
              "code": {
                "type": "string",
                "enum": [
                  "invalid_request",
                  "invalid_image",
                  "invalid_api_key",
                  "insufficient_credits",
                  "api_not_in_plan",
                  "not_in_plan",
                  "storage_full",
                  "not_found",
                  "method_not_allowed",
                  "idempotency_conflict",
                  "content_flagged",
                  "protected_content",
                  "rate_limited",
                  "concurrency_limit",
                  "generation_failed",
                  "internal_error"
                ]
              },
              "message": {
                "type": "string"
              },
              "param": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "request_id": {
                "type": "string"
              },
              "doc_url": {
                "type": "string",
                "format": "uri"
              }
            }
          }
        },
        "example": {
          "error": {
            "type": "credits_error",
            "code": "insufficient_credits",
            "message": "This photo needs 60 credits and 38 are available. Buy a credit pack or upgrade your plan.",
            "param": null,
            "request_id": "req_6RkP2wQ9mT3xLc8B",
            "doc_url": "https://fittins.ai/docs/api/errors#insufficient_credits"
          }
        }
      }
    }
  }
}