{
  "openapi": "3.0.1",
  "info": {
    "title": "Fanify Hub API",
    "description": "Generate media and text with Fanify credits. All prices use EUR.",
    "version": "v1"
  },
  "servers": [
    {
      "url": "https://fanifyai.com"
    }
  ],
  "paths": {
    "/api/v1/hub/characters": {
      "get": {
        "tags": [
          "Characters"
        ],
        "responses": {
          "429": {
            "description": "Rate limit reached",
            "headers": {
              "Retry-After": {
                "description": "Seconds before retrying.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "required": [
                    "type",
                    "title",
                    "status",
                    "code"
                  ],
                  "type": "object",
                  "properties": {
                    "type": {
                      "type": "string",
                      "format": "uri"
                    },
                    "title": {
                      "type": "string"
                    },
                    "status": {
                      "type": "integer",
                      "format": "int32"
                    },
                    "detail": {
                      "type": "string",
                      "nullable": true
                    },
                    "instance": {
                      "type": "string"
                    },
                    "code": {
                      "enum": [
                        "rate_limited"
                      ],
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    },
                    "unrepresentable": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "missing": {
                      "type": "array",
                      "items": {
                        "required": [
                          "sha256"
                        ],
                        "type": "object",
                        "properties": {
                          "sha256": {
                            "type": "string"
                          },
                          "kind": {
                            "type": "string",
                            "nullable": true
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "type": "https://fanifyai.com/docs/hub/errors#rate_limited",
                  "title": "Rate limit reached",
                  "status": 429,
                  "code": "rate_limited"
                }
              }
            }
          }
        },
        "security": [
          {
            "Bearer": [ ]
          }
        ]
      },
      "post": {
        "tags": [
          "Characters"
        ],
        "responses": {
          "429": {
            "description": "Rate limit reached",
            "headers": {
              "Retry-After": {
                "description": "Seconds before retrying.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "required": [
                    "type",
                    "title",
                    "status",
                    "code"
                  ],
                  "type": "object",
                  "properties": {
                    "type": {
                      "type": "string",
                      "format": "uri"
                    },
                    "title": {
                      "type": "string"
                    },
                    "status": {
                      "type": "integer",
                      "format": "int32"
                    },
                    "detail": {
                      "type": "string",
                      "nullable": true
                    },
                    "instance": {
                      "type": "string"
                    },
                    "code": {
                      "enum": [
                        "rate_limited"
                      ],
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    },
                    "unrepresentable": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "missing": {
                      "type": "array",
                      "items": {
                        "required": [
                          "sha256"
                        ],
                        "type": "object",
                        "properties": {
                          "sha256": {
                            "type": "string"
                          },
                          "kind": {
                            "type": "string",
                            "nullable": true
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "type": "https://fanifyai.com/docs/hub/errors#rate_limited",
                  "title": "Rate limit reached",
                  "status": 429,
                  "code": "rate_limited"
                }
              }
            }
          }
        },
        "security": [
          {
            "Bearer": [ ]
          }
        ]
      }
    },
    "/api/v1/hub/characters/{id}": {
      "get": {
        "tags": [
          "Characters"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "429": {
            "description": "Rate limit reached",
            "headers": {
              "Retry-After": {
                "description": "Seconds before retrying.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "required": [
                    "type",
                    "title",
                    "status",
                    "code"
                  ],
                  "type": "object",
                  "properties": {
                    "type": {
                      "type": "string",
                      "format": "uri"
                    },
                    "title": {
                      "type": "string"
                    },
                    "status": {
                      "type": "integer",
                      "format": "int32"
                    },
                    "detail": {
                      "type": "string",
                      "nullable": true
                    },
                    "instance": {
                      "type": "string"
                    },
                    "code": {
                      "enum": [
                        "rate_limited"
                      ],
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    },
                    "unrepresentable": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "missing": {
                      "type": "array",
                      "items": {
                        "required": [
                          "sha256"
                        ],
                        "type": "object",
                        "properties": {
                          "sha256": {
                            "type": "string"
                          },
                          "kind": {
                            "type": "string",
                            "nullable": true
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "type": "https://fanifyai.com/docs/hub/errors#rate_limited",
                  "title": "Rate limit reached",
                  "status": 429,
                  "code": "rate_limited"
                }
              }
            }
          }
        },
        "security": [
          {
            "Bearer": [ ]
          }
        ]
      },
      "patch": {
        "tags": [
          "Characters"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/HubCharacterPatchRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/HubCharacterPatchRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/HubCharacterPatchRequest"
              }
            }
          }
        },
        "responses": {
          "429": {
            "description": "Rate limit reached",
            "headers": {
              "Retry-After": {
                "description": "Seconds before retrying.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "required": [
                    "type",
                    "title",
                    "status",
                    "code"
                  ],
                  "type": "object",
                  "properties": {
                    "type": {
                      "type": "string",
                      "format": "uri"
                    },
                    "title": {
                      "type": "string"
                    },
                    "status": {
                      "type": "integer",
                      "format": "int32"
                    },
                    "detail": {
                      "type": "string",
                      "nullable": true
                    },
                    "instance": {
                      "type": "string"
                    },
                    "code": {
                      "enum": [
                        "rate_limited"
                      ],
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    },
                    "unrepresentable": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "missing": {
                      "type": "array",
                      "items": {
                        "required": [
                          "sha256"
                        ],
                        "type": "object",
                        "properties": {
                          "sha256": {
                            "type": "string"
                          },
                          "kind": {
                            "type": "string",
                            "nullable": true
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "type": "https://fanifyai.com/docs/hub/errors#rate_limited",
                  "title": "Rate limit reached",
                  "status": 429,
                  "code": "rate_limited"
                }
              }
            }
          }
        },
        "security": [
          {
            "Bearer": [ ]
          }
        ]
      },
      "delete": {
        "tags": [
          "Characters"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "429": {
            "description": "Rate limit reached",
            "headers": {
              "Retry-After": {
                "description": "Seconds before retrying.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "required": [
                    "type",
                    "title",
                    "status",
                    "code"
                  ],
                  "type": "object",
                  "properties": {
                    "type": {
                      "type": "string",
                      "format": "uri"
                    },
                    "title": {
                      "type": "string"
                    },
                    "status": {
                      "type": "integer",
                      "format": "int32"
                    },
                    "detail": {
                      "type": "string",
                      "nullable": true
                    },
                    "instance": {
                      "type": "string"
                    },
                    "code": {
                      "enum": [
                        "rate_limited"
                      ],
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    },
                    "unrepresentable": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "missing": {
                      "type": "array",
                      "items": {
                        "required": [
                          "sha256"
                        ],
                        "type": "object",
                        "properties": {
                          "sha256": {
                            "type": "string"
                          },
                          "kind": {
                            "type": "string",
                            "nullable": true
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "type": "https://fanifyai.com/docs/hub/errors#rate_limited",
                  "title": "Rate limit reached",
                  "status": 429,
                  "code": "rate_limited"
                }
              }
            }
          }
        },
        "security": [
          {
            "Bearer": [ ]
          }
        ]
      }
    },
    "/api/v1/hub/characters/{id}/start": {
      "post": {
        "tags": [
          "Characters"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/HubCharacterStartRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/HubCharacterStartRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/HubCharacterStartRequest"
              }
            }
          }
        },
        "responses": {
          "429": {
            "description": "Rate limit reached",
            "headers": {
              "Retry-After": {
                "description": "Seconds before retrying.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "required": [
                    "type",
                    "title",
                    "status",
                    "code"
                  ],
                  "type": "object",
                  "properties": {
                    "type": {
                      "type": "string",
                      "format": "uri"
                    },
                    "title": {
                      "type": "string"
                    },
                    "status": {
                      "type": "integer",
                      "format": "int32"
                    },
                    "detail": {
                      "type": "string",
                      "nullable": true
                    },
                    "instance": {
                      "type": "string"
                    },
                    "code": {
                      "enum": [
                        "rate_limited"
                      ],
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    },
                    "unrepresentable": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "missing": {
                      "type": "array",
                      "items": {
                        "required": [
                          "sha256"
                        ],
                        "type": "object",
                        "properties": {
                          "sha256": {
                            "type": "string"
                          },
                          "kind": {
                            "type": "string",
                            "nullable": true
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "type": "https://fanifyai.com/docs/hub/errors#rate_limited",
                  "title": "Rate limit reached",
                  "status": 429,
                  "code": "rate_limited"
                }
              }
            }
          }
        },
        "security": [
          {
            "Bearer": [ ]
          }
        ]
      }
    },
    "/api/v1/hub/characters/{id}/resume": {
      "post": {
        "tags": [
          "Characters"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "429": {
            "description": "Rate limit reached",
            "headers": {
              "Retry-After": {
                "description": "Seconds before retrying.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "required": [
                    "type",
                    "title",
                    "status",
                    "code"
                  ],
                  "type": "object",
                  "properties": {
                    "type": {
                      "type": "string",
                      "format": "uri"
                    },
                    "title": {
                      "type": "string"
                    },
                    "status": {
                      "type": "integer",
                      "format": "int32"
                    },
                    "detail": {
                      "type": "string",
                      "nullable": true
                    },
                    "instance": {
                      "type": "string"
                    },
                    "code": {
                      "enum": [
                        "rate_limited"
                      ],
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    },
                    "unrepresentable": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "missing": {
                      "type": "array",
                      "items": {
                        "required": [
                          "sha256"
                        ],
                        "type": "object",
                        "properties": {
                          "sha256": {
                            "type": "string"
                          },
                          "kind": {
                            "type": "string",
                            "nullable": true
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "type": "https://fanifyai.com/docs/hub/errors#rate_limited",
                  "title": "Rate limit reached",
                  "status": 429,
                  "code": "rate_limited"
                }
              }
            }
          }
        },
        "security": [
          {
            "Bearer": [ ]
          }
        ]
      }
    },
    "/api/v1/hub/characters/{id}/cancel": {
      "post": {
        "tags": [
          "Generations"
        ],
        "summary": "Cancel generation",
        "description": "Cancels a generation that is still queued, or a running worker generation (provider = worker; the GPU time already consumed is billed, capped at the estimate).",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Canceled generation.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HubGenerationDto"
                },
                "example": {
                  "id": "0192f3a4-8c1e-7b2a-9f10-2b6d4e0c9a11",
                  "model": "nano-banana-2",
                  "is_llm": false,
                  "status": "canceled",
                  "input": {
                    "prompt": "a cat",
                    "aspect_ratio": "16:9",
                    "resolution": "2K"
                  },
                  "estimated_cost": 0.04,
                  "billed_cost": null,
                  "currency": "EUR",
                  "outputs": [ ],
                  "error": null,
                  "missing": [ ],
                  "created_at": "2026-09-07T10:00:00Z",
                  "started_at": null,
                  "completed_at": "2026-09-07T10:00:10Z",
                  "provider": "kie",
                  "batch_id": null,
                  "progress": null
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/problem+json": {
                "schema": {
                  "required": [
                    "type",
                    "title",
                    "status",
                    "code"
                  ],
                  "type": "object",
                  "properties": {
                    "type": {
                      "type": "string",
                      "format": "uri"
                    },
                    "title": {
                      "type": "string"
                    },
                    "status": {
                      "type": "integer",
                      "format": "int32"
                    },
                    "detail": {
                      "type": "string",
                      "nullable": true
                    },
                    "instance": {
                      "type": "string"
                    },
                    "code": {
                      "enum": [
                        "unauthorized"
                      ],
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    },
                    "unrepresentable": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "missing": {
                      "type": "array",
                      "items": {
                        "required": [
                          "sha256"
                        ],
                        "type": "object",
                        "properties": {
                          "sha256": {
                            "type": "string"
                          },
                          "kind": {
                            "type": "string",
                            "nullable": true
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "type": "https://fanifyai.com/docs/hub/errors#unauthorized",
                  "title": "Unauthorized",
                  "status": 401,
                  "code": "unauthorized"
                }
              }
            }
          },
          "404": {
            "description": "Generation not found",
            "content": {
              "application/problem+json": {
                "schema": {
                  "required": [
                    "type",
                    "title",
                    "status",
                    "code"
                  ],
                  "type": "object",
                  "properties": {
                    "type": {
                      "type": "string",
                      "format": "uri"
                    },
                    "title": {
                      "type": "string"
                    },
                    "status": {
                      "type": "integer",
                      "format": "int32"
                    },
                    "detail": {
                      "type": "string",
                      "nullable": true
                    },
                    "instance": {
                      "type": "string"
                    },
                    "code": {
                      "enum": [
                        "generation_not_found"
                      ],
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    },
                    "unrepresentable": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "missing": {
                      "type": "array",
                      "items": {
                        "required": [
                          "sha256"
                        ],
                        "type": "object",
                        "properties": {
                          "sha256": {
                            "type": "string"
                          },
                          "kind": {
                            "type": "string",
                            "nullable": true
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "type": "https://fanifyai.com/docs/hub/errors#generation_not_found",
                  "title": "Generation not found",
                  "status": 404,
                  "code": "generation_not_found"
                }
              }
            }
          },
          "409": {
            "description": "Generation cannot be canceled",
            "content": {
              "application/problem+json": {
                "schema": {
                  "required": [
                    "type",
                    "title",
                    "status",
                    "code"
                  ],
                  "type": "object",
                  "properties": {
                    "type": {
                      "type": "string",
                      "format": "uri"
                    },
                    "title": {
                      "type": "string"
                    },
                    "status": {
                      "type": "integer",
                      "format": "int32"
                    },
                    "detail": {
                      "type": "string",
                      "nullable": true
                    },
                    "instance": {
                      "type": "string"
                    },
                    "code": {
                      "enum": [
                        "not_cancelable"
                      ],
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    },
                    "unrepresentable": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "missing": {
                      "type": "array",
                      "items": {
                        "required": [
                          "sha256"
                        ],
                        "type": "object",
                        "properties": {
                          "sha256": {
                            "type": "string"
                          },
                          "kind": {
                            "type": "string",
                            "nullable": true
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "type": "https://fanifyai.com/docs/hub/errors#not_cancelable",
                  "title": "Generation cannot be canceled",
                  "status": 409,
                  "code": "not_cancelable"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit reached",
            "headers": {
              "Retry-After": {
                "description": "Seconds before retrying.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "required": [
                    "type",
                    "title",
                    "status",
                    "code"
                  ],
                  "type": "object",
                  "properties": {
                    "type": {
                      "type": "string",
                      "format": "uri"
                    },
                    "title": {
                      "type": "string"
                    },
                    "status": {
                      "type": "integer",
                      "format": "int32"
                    },
                    "detail": {
                      "type": "string",
                      "nullable": true
                    },
                    "instance": {
                      "type": "string"
                    },
                    "code": {
                      "enum": [
                        "rate_limited"
                      ],
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    },
                    "unrepresentable": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "missing": {
                      "type": "array",
                      "items": {
                        "required": [
                          "sha256"
                        ],
                        "type": "object",
                        "properties": {
                          "sha256": {
                            "type": "string"
                          },
                          "kind": {
                            "type": "string",
                            "nullable": true
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "type": "https://fanifyai.com/docs/hub/errors#rate_limited",
                  "title": "Rate limit reached",
                  "status": 429,
                  "code": "rate_limited"
                }
              }
            }
          }
        },
        "security": [
          {
            "Bearer": [ ]
          }
        ]
      }
    },
    "/api/v1/hub/characters/{id}/models/{family}/train": {
      "post": {
        "tags": [
          "Characters"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "family",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "429": {
            "description": "Rate limit reached",
            "headers": {
              "Retry-After": {
                "description": "Seconds before retrying.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "required": [
                    "type",
                    "title",
                    "status",
                    "code"
                  ],
                  "type": "object",
                  "properties": {
                    "type": {
                      "type": "string",
                      "format": "uri"
                    },
                    "title": {
                      "type": "string"
                    },
                    "status": {
                      "type": "integer",
                      "format": "int32"
                    },
                    "detail": {
                      "type": "string",
                      "nullable": true
                    },
                    "instance": {
                      "type": "string"
                    },
                    "code": {
                      "enum": [
                        "rate_limited"
                      ],
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    },
                    "unrepresentable": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "missing": {
                      "type": "array",
                      "items": {
                        "required": [
                          "sha256"
                        ],
                        "type": "object",
                        "properties": {
                          "sha256": {
                            "type": "string"
                          },
                          "kind": {
                            "type": "string",
                            "nullable": true
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "type": "https://fanifyai.com/docs/hub/errors#rate_limited",
                  "title": "Rate limit reached",
                  "status": 429,
                  "code": "rate_limited"
                }
              }
            }
          }
        },
        "security": [
          {
            "Bearer": [ ]
          }
        ]
      }
    },
    "/api/v1/hub/characters/estimate": {
      "post": {
        "tags": [
          "Characters"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/HubCharacterEstimateRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/HubCharacterEstimateRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/HubCharacterEstimateRequest"
              }
            }
          }
        },
        "responses": {
          "429": {
            "description": "Rate limit reached",
            "headers": {
              "Retry-After": {
                "description": "Seconds before retrying.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "required": [
                    "type",
                    "title",
                    "status",
                    "code"
                  ],
                  "type": "object",
                  "properties": {
                    "type": {
                      "type": "string",
                      "format": "uri"
                    },
                    "title": {
                      "type": "string"
                    },
                    "status": {
                      "type": "integer",
                      "format": "int32"
                    },
                    "detail": {
                      "type": "string",
                      "nullable": true
                    },
                    "instance": {
                      "type": "string"
                    },
                    "code": {
                      "enum": [
                        "rate_limited"
                      ],
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    },
                    "unrepresentable": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "missing": {
                      "type": "array",
                      "items": {
                        "required": [
                          "sha256"
                        ],
                        "type": "object",
                        "properties": {
                          "sha256": {
                            "type": "string"
                          },
                          "kind": {
                            "type": "string",
                            "nullable": true
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "type": "https://fanifyai.com/docs/hub/errors#rate_limited",
                  "title": "Rate limit reached",
                  "status": 429,
                  "code": "rate_limited"
                }
              }
            }
          }
        },
        "security": [
          {
            "Bearer": [ ]
          }
        ]
      }
    },
    "/api/v1/hub/characters/{id}/photos": {
      "post": {
        "tags": [
          "Characters"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "429": {
            "description": "Rate limit reached",
            "headers": {
              "Retry-After": {
                "description": "Seconds before retrying.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "required": [
                    "type",
                    "title",
                    "status",
                    "code"
                  ],
                  "type": "object",
                  "properties": {
                    "type": {
                      "type": "string",
                      "format": "uri"
                    },
                    "title": {
                      "type": "string"
                    },
                    "status": {
                      "type": "integer",
                      "format": "int32"
                    },
                    "detail": {
                      "type": "string",
                      "nullable": true
                    },
                    "instance": {
                      "type": "string"
                    },
                    "code": {
                      "enum": [
                        "rate_limited"
                      ],
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    },
                    "unrepresentable": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "missing": {
                      "type": "array",
                      "items": {
                        "required": [
                          "sha256"
                        ],
                        "type": "object",
                        "properties": {
                          "sha256": {
                            "type": "string"
                          },
                          "kind": {
                            "type": "string",
                            "nullable": true
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "type": "https://fanifyai.com/docs/hub/errors#rate_limited",
                  "title": "Rate limit reached",
                  "status": 429,
                  "code": "rate_limited"
                }
              }
            }
          }
        },
        "security": [
          {
            "Bearer": [ ]
          }
        ]
      }
    },
    "/api/v1/hub/characters/{id}/photos/{sha256}": {
      "delete": {
        "tags": [
          "Characters"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "sha256",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "429": {
            "description": "Rate limit reached",
            "headers": {
              "Retry-After": {
                "description": "Seconds before retrying.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "required": [
                    "type",
                    "title",
                    "status",
                    "code"
                  ],
                  "type": "object",
                  "properties": {
                    "type": {
                      "type": "string",
                      "format": "uri"
                    },
                    "title": {
                      "type": "string"
                    },
                    "status": {
                      "type": "integer",
                      "format": "int32"
                    },
                    "detail": {
                      "type": "string",
                      "nullable": true
                    },
                    "instance": {
                      "type": "string"
                    },
                    "code": {
                      "enum": [
                        "rate_limited"
                      ],
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    },
                    "unrepresentable": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "missing": {
                      "type": "array",
                      "items": {
                        "required": [
                          "sha256"
                        ],
                        "type": "object",
                        "properties": {
                          "sha256": {
                            "type": "string"
                          },
                          "kind": {
                            "type": "string",
                            "nullable": true
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "type": "https://fanifyai.com/docs/hub/errors#rate_limited",
                  "title": "Rate limit reached",
                  "status": 429,
                  "code": "rate_limited"
                }
              }
            }
          }
        },
        "security": [
          {
            "Bearer": [ ]
          }
        ]
      }
    },
    "/api/v1/hub/characters/photos/{sha256}": {
      "get": {
        "tags": [
          "Characters"
        ],
        "parameters": [
          {
            "name": "sha256",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "429": {
            "description": "Rate limit reached",
            "headers": {
              "Retry-After": {
                "description": "Seconds before retrying.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "required": [
                    "type",
                    "title",
                    "status",
                    "code"
                  ],
                  "type": "object",
                  "properties": {
                    "type": {
                      "type": "string",
                      "format": "uri"
                    },
                    "title": {
                      "type": "string"
                    },
                    "status": {
                      "type": "integer",
                      "format": "int32"
                    },
                    "detail": {
                      "type": "string",
                      "nullable": true
                    },
                    "instance": {
                      "type": "string"
                    },
                    "code": {
                      "enum": [
                        "rate_limited"
                      ],
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    },
                    "unrepresentable": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "missing": {
                      "type": "array",
                      "items": {
                        "required": [
                          "sha256"
                        ],
                        "type": "object",
                        "properties": {
                          "sha256": {
                            "type": "string"
                          },
                          "kind": {
                            "type": "string",
                            "nullable": true
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "type": "https://fanifyai.com/docs/hub/errors#rate_limited",
                  "title": "Rate limit reached",
                  "status": 429,
                  "code": "rate_limited"
                }
              }
            }
          }
        },
        "security": [
          {
            "Bearer": [ ]
          }
        ]
      }
    },
    "/api/v1/hub/characters/photos/{sha256}/thumb": {
      "get": {
        "tags": [
          "Characters"
        ],
        "parameters": [
          {
            "name": "sha256",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "429": {
            "description": "Rate limit reached",
            "headers": {
              "Retry-After": {
                "description": "Seconds before retrying.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "required": [
                    "type",
                    "title",
                    "status",
                    "code"
                  ],
                  "type": "object",
                  "properties": {
                    "type": {
                      "type": "string",
                      "format": "uri"
                    },
                    "title": {
                      "type": "string"
                    },
                    "status": {
                      "type": "integer",
                      "format": "int32"
                    },
                    "detail": {
                      "type": "string",
                      "nullable": true
                    },
                    "instance": {
                      "type": "string"
                    },
                    "code": {
                      "enum": [
                        "rate_limited"
                      ],
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    },
                    "unrepresentable": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "missing": {
                      "type": "array",
                      "items": {
                        "required": [
                          "sha256"
                        ],
                        "type": "object",
                        "properties": {
                          "sha256": {
                            "type": "string"
                          },
                          "kind": {
                            "type": "string",
                            "nullable": true
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "type": "https://fanifyai.com/docs/hub/errors#rate_limited",
                  "title": "Rate limit reached",
                  "status": 429,
                  "code": "rate_limited"
                }
              }
            }
          }
        },
        "security": [
          {
            "Bearer": [ ]
          }
        ]
      }
    },
    "/api/v1/hub/characters/{id}/descriptions": {
      "get": {
        "tags": [
          "Characters"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "model",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "429": {
            "description": "Rate limit reached",
            "headers": {
              "Retry-After": {
                "description": "Seconds before retrying.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "required": [
                    "type",
                    "title",
                    "status",
                    "code"
                  ],
                  "type": "object",
                  "properties": {
                    "type": {
                      "type": "string",
                      "format": "uri"
                    },
                    "title": {
                      "type": "string"
                    },
                    "status": {
                      "type": "integer",
                      "format": "int32"
                    },
                    "detail": {
                      "type": "string",
                      "nullable": true
                    },
                    "instance": {
                      "type": "string"
                    },
                    "code": {
                      "enum": [
                        "rate_limited"
                      ],
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    },
                    "unrepresentable": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "missing": {
                      "type": "array",
                      "items": {
                        "required": [
                          "sha256"
                        ],
                        "type": "object",
                        "properties": {
                          "sha256": {
                            "type": "string"
                          },
                          "kind": {
                            "type": "string",
                            "nullable": true
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "type": "https://fanifyai.com/docs/hub/errors#rate_limited",
                  "title": "Rate limit reached",
                  "status": 429,
                  "code": "rate_limited"
                }
              }
            }
          }
        },
        "security": [
          {
            "Bearer": [ ]
          }
        ]
      }
    },
    "/api/v1/hub/characters/{id}/descriptions/{sha256}": {
      "put": {
        "tags": [
          "Characters"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "sha256",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/HubCharacterDescriptionRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/HubCharacterDescriptionRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/HubCharacterDescriptionRequest"
              }
            }
          }
        },
        "responses": {
          "429": {
            "description": "Rate limit reached",
            "headers": {
              "Retry-After": {
                "description": "Seconds before retrying.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "required": [
                    "type",
                    "title",
                    "status",
                    "code"
                  ],
                  "type": "object",
                  "properties": {
                    "type": {
                      "type": "string",
                      "format": "uri"
                    },
                    "title": {
                      "type": "string"
                    },
                    "status": {
                      "type": "integer",
                      "format": "int32"
                    },
                    "detail": {
                      "type": "string",
                      "nullable": true
                    },
                    "instance": {
                      "type": "string"
                    },
                    "code": {
                      "enum": [
                        "rate_limited"
                      ],
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    },
                    "unrepresentable": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "missing": {
                      "type": "array",
                      "items": {
                        "required": [
                          "sha256"
                        ],
                        "type": "object",
                        "properties": {
                          "sha256": {
                            "type": "string"
                          },
                          "kind": {
                            "type": "string",
                            "nullable": true
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "type": "https://fanifyai.com/docs/hub/errors#rate_limited",
                  "title": "Rate limit reached",
                  "status": 429,
                  "code": "rate_limited"
                }
              }
            }
          }
        },
        "security": [
          {
            "Bearer": [ ]
          }
        ]
      }
    },
    "/api/v1/hub/characters/loras": {
      "get": {
        "tags": [
          "Characters"
        ],
        "parameters": [
          {
            "name": "family",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "429": {
            "description": "Rate limit reached",
            "headers": {
              "Retry-After": {
                "description": "Seconds before retrying.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "required": [
                    "type",
                    "title",
                    "status",
                    "code"
                  ],
                  "type": "object",
                  "properties": {
                    "type": {
                      "type": "string",
                      "format": "uri"
                    },
                    "title": {
                      "type": "string"
                    },
                    "status": {
                      "type": "integer",
                      "format": "int32"
                    },
                    "detail": {
                      "type": "string",
                      "nullable": true
                    },
                    "instance": {
                      "type": "string"
                    },
                    "code": {
                      "enum": [
                        "rate_limited"
                      ],
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    },
                    "unrepresentable": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "missing": {
                      "type": "array",
                      "items": {
                        "required": [
                          "sha256"
                        ],
                        "type": "object",
                        "properties": {
                          "sha256": {
                            "type": "string"
                          },
                          "kind": {
                            "type": "string",
                            "nullable": true
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "type": "https://fanifyai.com/docs/hub/errors#rate_limited",
                  "title": "Rate limit reached",
                  "status": 429,
                  "code": "rate_limited"
                }
              }
            }
          }
        },
        "security": [
          {
            "Bearer": [ ]
          }
        ]
      }
    },
    "/api/v1/hub/characters/loras/import": {
      "post": {
        "tags": [
          "Characters"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/HubCharacterImportRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/HubCharacterImportRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/HubCharacterImportRequest"
              }
            }
          }
        },
        "responses": {
          "429": {
            "description": "Rate limit reached",
            "headers": {
              "Retry-After": {
                "description": "Seconds before retrying.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "required": [
                    "type",
                    "title",
                    "status",
                    "code"
                  ],
                  "type": "object",
                  "properties": {
                    "type": {
                      "type": "string",
                      "format": "uri"
                    },
                    "title": {
                      "type": "string"
                    },
                    "status": {
                      "type": "integer",
                      "format": "int32"
                    },
                    "detail": {
                      "type": "string",
                      "nullable": true
                    },
                    "instance": {
                      "type": "string"
                    },
                    "code": {
                      "enum": [
                        "rate_limited"
                      ],
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    },
                    "unrepresentable": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "missing": {
                      "type": "array",
                      "items": {
                        "required": [
                          "sha256"
                        ],
                        "type": "object",
                        "properties": {
                          "sha256": {
                            "type": "string"
                          },
                          "kind": {
                            "type": "string",
                            "nullable": true
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "type": "https://fanifyai.com/docs/hub/errors#rate_limited",
                  "title": "Rate limit reached",
                  "status": 429,
                  "code": "rate_limited"
                }
              }
            }
          }
        },
        "security": [
          {
            "Bearer": [ ]
          }
        ]
      }
    },
    "/api/v1/hub/characters/loras/{id}/retrain": {
      "post": {
        "tags": [
          "Characters"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "429": {
            "description": "Rate limit reached",
            "headers": {
              "Retry-After": {
                "description": "Seconds before retrying.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "required": [
                    "type",
                    "title",
                    "status",
                    "code"
                  ],
                  "type": "object",
                  "properties": {
                    "type": {
                      "type": "string",
                      "format": "uri"
                    },
                    "title": {
                      "type": "string"
                    },
                    "status": {
                      "type": "integer",
                      "format": "int32"
                    },
                    "detail": {
                      "type": "string",
                      "nullable": true
                    },
                    "instance": {
                      "type": "string"
                    },
                    "code": {
                      "enum": [
                        "rate_limited"
                      ],
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    },
                    "unrepresentable": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "missing": {
                      "type": "array",
                      "items": {
                        "required": [
                          "sha256"
                        ],
                        "type": "object",
                        "properties": {
                          "sha256": {
                            "type": "string"
                          },
                          "kind": {
                            "type": "string",
                            "nullable": true
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "type": "https://fanifyai.com/docs/hub/errors#rate_limited",
                  "title": "Rate limit reached",
                  "status": 429,
                  "code": "rate_limited"
                }
              }
            }
          }
        },
        "security": [
          {
            "Bearer": [ ]
          }
        ]
      }
    },
    "/api/v1/hub/characters/loras/{id}": {
      "delete": {
        "tags": [
          "Characters"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "429": {
            "description": "Rate limit reached",
            "headers": {
              "Retry-After": {
                "description": "Seconds before retrying.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "required": [
                    "type",
                    "title",
                    "status",
                    "code"
                  ],
                  "type": "object",
                  "properties": {
                    "type": {
                      "type": "string",
                      "format": "uri"
                    },
                    "title": {
                      "type": "string"
                    },
                    "status": {
                      "type": "integer",
                      "format": "int32"
                    },
                    "detail": {
                      "type": "string",
                      "nullable": true
                    },
                    "instance": {
                      "type": "string"
                    },
                    "code": {
                      "enum": [
                        "rate_limited"
                      ],
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    },
                    "unrepresentable": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "missing": {
                      "type": "array",
                      "items": {
                        "required": [
                          "sha256"
                        ],
                        "type": "object",
                        "properties": {
                          "sha256": {
                            "type": "string"
                          },
                          "kind": {
                            "type": "string",
                            "nullable": true
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "type": "https://fanifyai.com/docs/hub/errors#rate_limited",
                  "title": "Rate limit reached",
                  "status": 429,
                  "code": "rate_limited"
                }
              }
            }
          }
        },
        "security": [
          {
            "Bearer": [ ]
          }
        ]
      }
    },
    "/api/v1/hub/chat/completions": {
      "post": {
        "tags": [
          "Chat"
        ],
        "summary": "Chat Completion",
        "description": "Creates a synchronous chat completion from an OpenAI-compatible request. Provider failures preserve an upstream 4xx status when applicable and use the provider_error code; upstream 5xx failures return 503.",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "description": "Optional idempotency key, from 1 to 255 characters.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "description": "OpenAI-compatible chat completion request. Additional top-level fields are forwarded. The stream field must be omitted or false; n is not supported and must be omitted.",
          "content": {
            "application/json": {
              "schema": {
                "required": [
                  "model",
                  "messages"
                ],
                "type": "object",
                "properties": {
                  "model": {
                    "type": "string"
                  },
                  "messages": {
                    "type": "array",
                    "items": {
                      "type": "object"
                    }
                  }
                }
              },
              "example": {
                "model": "deepseek-v4-flash-0731",
                "messages": [
                  {
                    "role": "user",
                    "content": "Hello"
                  }
                ]
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OpenAI-compatible chat completion.",
            "headers": {
              "X-Fanify-Generation-Id": {
                "description": "Hub generation identifier.",
                "schema": {
                  "type": "string"
                }
              },
              "X-Fanify-Billed-Cost": {
                "description": "Billed cost in EUR, using invariant decimal notation.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                },
                "example": {
                  "id": "0192f3a4-8c1e-7b2a-9f10-2b6d4e0c9a11",
                  "object": "chat.completion",
                  "created": 1757239231,
                  "model": "deepseek-v4-flash-0731",
                  "choices": [
                    {
                      "index": 0,
                      "message": {
                        "role": "assistant",
                        "content": "Hello!"
                      },
                      "finish_reason": "stop"
                    }
                  ],
                  "usage": {
                    "prompt_tokens": 10,
                    "completion_tokens": 120,
                    "total_tokens": 130,
                    "cost": 0.000041
                  }
                }
              }
            }
          },
          "400": {
            "description": "OpenAI-compatible error.",
            "content": {
              "application/json": {
                "schema": {
                  "required": [
                    "error"
                  ],
                  "type": "object",
                  "properties": {
                    "error": {
                      "required": [
                        "message",
                        "code",
                        "type",
                        "metadata"
                      ],
                      "type": "object",
                      "properties": {
                        "message": {
                          "type": "string"
                        },
                        "code": {
                          "enum": [
                            "invalid_input",
                            "provider_error"
                          ],
                          "type": "string"
                        },
                        "type": {
                          "type": "string"
                        },
                        "metadata": {
                          "required": [
                            "provider_name"
                          ],
                          "type": "object",
                          "properties": {
                            "provider_name": {
                              "enum": [
                                "FanifyHub"
                              ],
                              "type": "string"
                            }
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "error": {
                    "message": "The request input is invalid.",
                    "code": "invalid_input",
                    "type": "invalid_request_error",
                    "metadata": {
                      "provider_name": "FanifyHub"
                    }
                  }
                }
              }
            }
          },
          "402": {
            "description": "OpenAI-compatible error.",
            "content": {
              "application/json": {
                "schema": {
                  "required": [
                    "error"
                  ],
                  "type": "object",
                  "properties": {
                    "error": {
                      "required": [
                        "message",
                        "code",
                        "type",
                        "metadata"
                      ],
                      "type": "object",
                      "properties": {
                        "message": {
                          "type": "string"
                        },
                        "code": {
                          "enum": [
                            "insufficient_credits"
                          ],
                          "type": "string"
                        },
                        "type": {
                          "type": "string"
                        },
                        "metadata": {
                          "required": [
                            "provider_name"
                          ],
                          "type": "object",
                          "properties": {
                            "provider_name": {
                              "enum": [
                                "FanifyHub"
                              ],
                              "type": "string"
                            }
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "error": {
                    "message": "Your available balance does not cover this generation.",
                    "code": "insufficient_credits",
                    "type": "invalid_request_error",
                    "metadata": {
                      "provider_name": "FanifyHub"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "OpenAI-compatible error.",
            "content": {
              "application/json": {
                "schema": {
                  "required": [
                    "error"
                  ],
                  "type": "object",
                  "properties": {
                    "error": {
                      "required": [
                        "message",
                        "code",
                        "type",
                        "metadata"
                      ],
                      "type": "object",
                      "properties": {
                        "message": {
                          "type": "string"
                        },
                        "code": {
                          "enum": [
                            "model_not_found"
                          ],
                          "type": "string"
                        },
                        "type": {
                          "type": "string"
                        },
                        "metadata": {
                          "required": [
                            "provider_name"
                          ],
                          "type": "object",
                          "properties": {
                            "provider_name": {
                              "enum": [
                                "FanifyHub"
                              ],
                              "type": "string"
                            }
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "error": {
                    "message": "The requested model was not found.",
                    "code": "model_not_found",
                    "type": "invalid_request_error",
                    "metadata": {
                      "provider_name": "FanifyHub"
                    }
                  }
                }
              }
            }
          },
          "410": {
            "description": "OpenAI-compatible error.",
            "content": {
              "application/json": {
                "schema": {
                  "required": [
                    "error"
                  ],
                  "type": "object",
                  "properties": {
                    "error": {
                      "required": [
                        "message",
                        "code",
                        "type",
                        "metadata"
                      ],
                      "type": "object",
                      "properties": {
                        "message": {
                          "type": "string"
                        },
                        "code": {
                          "enum": [
                            "file_expired"
                          ],
                          "type": "string"
                        },
                        "type": {
                          "type": "string"
                        },
                        "metadata": {
                          "required": [
                            "provider_name"
                          ],
                          "type": "object",
                          "properties": {
                            "provider_name": {
                              "enum": [
                                "FanifyHub"
                              ],
                              "type": "string"
                            }
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "error": {
                    "message": "The requested file has expired or is unavailable.",
                    "code": "file_expired",
                    "type": "invalid_request_error",
                    "metadata": {
                      "provider_name": "FanifyHub"
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "OpenAI-compatible error.",
            "content": {
              "application/json": {
                "schema": {
                  "required": [
                    "error"
                  ],
                  "type": "object",
                  "properties": {
                    "error": {
                      "required": [
                        "message",
                        "code",
                        "type",
                        "metadata"
                      ],
                      "type": "object",
                      "properties": {
                        "message": {
                          "type": "string"
                        },
                        "code": {
                          "enum": [
                            "idempotency_conflict"
                          ],
                          "type": "string"
                        },
                        "type": {
                          "type": "string"
                        },
                        "metadata": {
                          "required": [
                            "provider_name"
                          ],
                          "type": "object",
                          "properties": {
                            "provider_name": {
                              "enum": [
                                "FanifyHub"
                              ],
                              "type": "string"
                            }
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "error": {
                    "message": "This idempotency key was already used with a different request.",
                    "code": "idempotency_conflict",
                    "type": "invalid_request_error",
                    "metadata": {
                      "provider_name": "FanifyHub"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "OpenAI-compatible error.",
            "headers": {
              "Retry-After": {
                "description": "Seconds before retrying.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "required": [
                    "error"
                  ],
                  "type": "object",
                  "properties": {
                    "error": {
                      "required": [
                        "message",
                        "code",
                        "type",
                        "metadata"
                      ],
                      "type": "object",
                      "properties": {
                        "message": {
                          "type": "string"
                        },
                        "code": {
                          "enum": [
                            "rate_limited"
                          ],
                          "type": "string"
                        },
                        "type": {
                          "type": "string"
                        },
                        "metadata": {
                          "required": [
                            "provider_name"
                          ],
                          "type": "object",
                          "properties": {
                            "provider_name": {
                              "enum": [
                                "FanifyHub"
                              ],
                              "type": "string"
                            }
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "error": {
                    "message": "Rate limit reached, retry later.",
                    "code": "rate_limited",
                    "type": "invalid_request_error",
                    "metadata": {
                      "provider_name": "FanifyHub"
                    }
                  }
                }
              }
            }
          },
          "503": {
            "description": "OpenAI-compatible error.",
            "headers": {
              "Retry-After": {
                "description": "Always 5 seconds for an in-progress replay.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "required": [
                    "error"
                  ],
                  "type": "object",
                  "properties": {
                    "error": {
                      "required": [
                        "message",
                        "code",
                        "type",
                        "metadata"
                      ],
                      "type": "object",
                      "properties": {
                        "message": {
                          "type": "string"
                        },
                        "code": {
                          "enum": [
                            "generation_in_progress",
                            "provider_error",
                            "hub_paused"
                          ],
                          "type": "string"
                        },
                        "type": {
                          "type": "string"
                        },
                        "metadata": {
                          "required": [
                            "provider_name"
                          ],
                          "type": "object",
                          "properties": {
                            "provider_name": {
                              "enum": [
                                "FanifyHub"
                              ],
                              "type": "string"
                            }
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "error": {
                    "message": "A generation with this idempotency key is still in progress.",
                    "code": "generation_in_progress",
                    "type": "invalid_request_error",
                    "metadata": {
                      "provider_name": "FanifyHub"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/problem+json": {
                "schema": {
                  "required": [
                    "type",
                    "title",
                    "status",
                    "code"
                  ],
                  "type": "object",
                  "properties": {
                    "type": {
                      "type": "string",
                      "format": "uri"
                    },
                    "title": {
                      "type": "string"
                    },
                    "status": {
                      "type": "integer",
                      "format": "int32"
                    },
                    "detail": {
                      "type": "string",
                      "nullable": true
                    },
                    "instance": {
                      "type": "string"
                    },
                    "code": {
                      "enum": [
                        "unauthorized"
                      ],
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    },
                    "unrepresentable": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "missing": {
                      "type": "array",
                      "items": {
                        "required": [
                          "sha256"
                        ],
                        "type": "object",
                        "properties": {
                          "sha256": {
                            "type": "string"
                          },
                          "kind": {
                            "type": "string",
                            "nullable": true
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "type": "https://fanifyai.com/docs/hub/errors#unauthorized",
                  "title": "Unauthorized",
                  "status": 401,
                  "code": "unauthorized"
                }
              }
            }
          }
        },
        "security": [
          {
            "Bearer": [ ]
          }
        ]
      }
    },
    "/api/v1/hub/files": {
      "post": {
        "tags": [
          "Files"
        ],
        "summary": "Upload file",
        "description": "Uploads a file once; reference it in model inputs as sha256:<hash>. HEAD /api/v1/hub/files/sha256/{hash} tells whether the Hub already has it, so the bytes are never sent twice. A .safetensors LoRA is detected automatically, stored durably (expires_at null, kind lora) and never expires; any other file expires 7 days after its last use by a generation.",
        "requestBody": {
          "description": "File upload. The Hub detects the kind: a .safetensors LoRA (up to 1 GiB by default, stored durably), a ZIP dataset sent as application/zip (up to 512 MiB), anything else an ordinary upload (up to 1 GiB). Datasets and uploads expire 7 days after their last use by a generation. The service configuration can change these limits.",
          "content": {
            "multipart/form-data": {
              "schema": {
                "required": [
                  "file"
                ],
                "type": "object",
                "properties": {
                  "file": {
                    "type": "string",
                    "format": "binary"
                  }
                }
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Uploaded file. Re-uploading the same content returns the same response and extends the file's lifetime. The kind is detected by the Hub: a .safetensors LoRA goes to durable storage, anything else expires 7 days after its last use.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HubFileDto"
                },
                "example": {
                  "url": "https://fanifyai.com/api/v1/hub/files/sha256/e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
                  "sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
                  "size": 812345,
                  "media_type": "image/png",
                  "expires_at": "2026-09-14T10:00:00Z",
                  "kind": "upload"
                },
                "examples": {
                  "upload": {
                    "value": {
                      "url": "https://fanifyai.com/api/v1/hub/files/sha256/e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
                      "sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
                      "size": 812345,
                      "media_type": "image/png",
                      "expires_at": "2026-09-14T10:00:00Z",
                      "kind": "upload"
                    }
                  },
                  "lora": {
                    "value": {
                      "url": "https://fanifyai.com/api/v1/hub/files/sha256/e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
                      "sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
                      "size": 194640349,
                      "media_type": "application/octet-stream",
                      "expires_at": null,
                      "kind": "lora"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid input",
            "content": {
              "application/problem+json": {
                "schema": {
                  "required": [
                    "type",
                    "title",
                    "status",
                    "code"
                  ],
                  "type": "object",
                  "properties": {
                    "type": {
                      "type": "string",
                      "format": "uri"
                    },
                    "title": {
                      "type": "string"
                    },
                    "status": {
                      "type": "integer",
                      "format": "int32"
                    },
                    "detail": {
                      "type": "string",
                      "nullable": true
                    },
                    "instance": {
                      "type": "string"
                    },
                    "code": {
                      "enum": [
                        "invalid_input"
                      ],
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    },
                    "unrepresentable": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "missing": {
                      "type": "array",
                      "items": {
                        "required": [
                          "sha256"
                        ],
                        "type": "object",
                        "properties": {
                          "sha256": {
                            "type": "string"
                          },
                          "kind": {
                            "type": "string",
                            "nullable": true
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "type": "https://fanifyai.com/docs/hub/errors#invalid_input",
                  "title": "Invalid input",
                  "status": 400,
                  "code": "invalid_input"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/problem+json": {
                "schema": {
                  "required": [
                    "type",
                    "title",
                    "status",
                    "code"
                  ],
                  "type": "object",
                  "properties": {
                    "type": {
                      "type": "string",
                      "format": "uri"
                    },
                    "title": {
                      "type": "string"
                    },
                    "status": {
                      "type": "integer",
                      "format": "int32"
                    },
                    "detail": {
                      "type": "string",
                      "nullable": true
                    },
                    "instance": {
                      "type": "string"
                    },
                    "code": {
                      "enum": [
                        "unauthorized"
                      ],
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    },
                    "unrepresentable": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "missing": {
                      "type": "array",
                      "items": {
                        "required": [
                          "sha256"
                        ],
                        "type": "object",
                        "properties": {
                          "sha256": {
                            "type": "string"
                          },
                          "kind": {
                            "type": "string",
                            "nullable": true
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "type": "https://fanifyai.com/docs/hub/errors#unauthorized",
                  "title": "Unauthorized",
                  "status": 401,
                  "code": "unauthorized"
                }
              }
            }
          },
          "413": {
            "description": "Payload too large",
            "content": {
              "application/problem+json": {
                "schema": {
                  "required": [
                    "type",
                    "title",
                    "status",
                    "code"
                  ],
                  "type": "object",
                  "properties": {
                    "type": {
                      "type": "string",
                      "format": "uri"
                    },
                    "title": {
                      "type": "string"
                    },
                    "status": {
                      "type": "integer",
                      "format": "int32"
                    },
                    "detail": {
                      "type": "string",
                      "nullable": true
                    },
                    "instance": {
                      "type": "string"
                    },
                    "code": {
                      "enum": [
                        "payload_too_large"
                      ],
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    },
                    "unrepresentable": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "missing": {
                      "type": "array",
                      "items": {
                        "required": [
                          "sha256"
                        ],
                        "type": "object",
                        "properties": {
                          "sha256": {
                            "type": "string"
                          },
                          "kind": {
                            "type": "string",
                            "nullable": true
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "type": "https://fanifyai.com/docs/hub/errors#payload_too_large",
                  "title": "Payload too large",
                  "status": 413,
                  "code": "payload_too_large"
                }
              }
            }
          },
          "503": {
            "description": "Storage temporarily unavailable",
            "content": {
              "application/problem+json": {
                "schema": {
                  "required": [
                    "type",
                    "title",
                    "status",
                    "code"
                  ],
                  "type": "object",
                  "properties": {
                    "type": {
                      "type": "string",
                      "format": "uri"
                    },
                    "title": {
                      "type": "string"
                    },
                    "status": {
                      "type": "integer",
                      "format": "int32"
                    },
                    "detail": {
                      "type": "string",
                      "nullable": true
                    },
                    "instance": {
                      "type": "string"
                    },
                    "code": {
                      "enum": [
                        "storage_unavailable"
                      ],
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    },
                    "unrepresentable": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "missing": {
                      "type": "array",
                      "items": {
                        "required": [
                          "sha256"
                        ],
                        "type": "object",
                        "properties": {
                          "sha256": {
                            "type": "string"
                          },
                          "kind": {
                            "type": "string",
                            "nullable": true
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "type": "https://fanifyai.com/docs/hub/errors#storage_unavailable",
                  "title": "Storage temporarily unavailable",
                  "status": 503,
                  "code": "storage_unavailable"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit reached",
            "headers": {
              "Retry-After": {
                "description": "Seconds before retrying.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "required": [
                    "type",
                    "title",
                    "status",
                    "code"
                  ],
                  "type": "object",
                  "properties": {
                    "type": {
                      "type": "string",
                      "format": "uri"
                    },
                    "title": {
                      "type": "string"
                    },
                    "status": {
                      "type": "integer",
                      "format": "int32"
                    },
                    "detail": {
                      "type": "string",
                      "nullable": true
                    },
                    "instance": {
                      "type": "string"
                    },
                    "code": {
                      "enum": [
                        "rate_limited"
                      ],
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    },
                    "unrepresentable": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "missing": {
                      "type": "array",
                      "items": {
                        "required": [
                          "sha256"
                        ],
                        "type": "object",
                        "properties": {
                          "sha256": {
                            "type": "string"
                          },
                          "kind": {
                            "type": "string",
                            "nullable": true
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "type": "https://fanifyai.com/docs/hub/errors#rate_limited",
                  "title": "Rate limit reached",
                  "status": 429,
                  "code": "rate_limited"
                }
              }
            }
          }
        },
        "security": [
          {
            "Bearer": [ ]
          }
        ]
      },
      "get": {
        "tags": [
          "Files"
        ],
        "summary": "List files",
        "description": "Lists your files, newest first, optionally filtered by kind.",
        "parameters": [
          {
            "name": "kind",
            "in": "query",
            "description": "Optional filter: upload, output, lora or dataset. Omit it to list every kind.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Your files, newest first, optionally one kind (upload, output, lora, dataset).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HubFileListDto"
                },
                "example": {
                  "files": [
                    {
                      "sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
                      "kind": "lora",
                      "family": "sdxl",
                      "size": 194640349,
                      "created_at": "2026-09-17T14:22:05Z"
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid input",
            "content": {
              "application/problem+json": {
                "schema": {
                  "required": [
                    "type",
                    "title",
                    "status",
                    "code"
                  ],
                  "type": "object",
                  "properties": {
                    "type": {
                      "type": "string",
                      "format": "uri"
                    },
                    "title": {
                      "type": "string"
                    },
                    "status": {
                      "type": "integer",
                      "format": "int32"
                    },
                    "detail": {
                      "type": "string",
                      "nullable": true
                    },
                    "instance": {
                      "type": "string"
                    },
                    "code": {
                      "enum": [
                        "invalid_input"
                      ],
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    },
                    "unrepresentable": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "missing": {
                      "type": "array",
                      "items": {
                        "required": [
                          "sha256"
                        ],
                        "type": "object",
                        "properties": {
                          "sha256": {
                            "type": "string"
                          },
                          "kind": {
                            "type": "string",
                            "nullable": true
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "type": "https://fanifyai.com/docs/hub/errors#invalid_input",
                  "title": "Invalid input",
                  "status": 400,
                  "code": "invalid_input"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/problem+json": {
                "schema": {
                  "required": [
                    "type",
                    "title",
                    "status",
                    "code"
                  ],
                  "type": "object",
                  "properties": {
                    "type": {
                      "type": "string",
                      "format": "uri"
                    },
                    "title": {
                      "type": "string"
                    },
                    "status": {
                      "type": "integer",
                      "format": "int32"
                    },
                    "detail": {
                      "type": "string",
                      "nullable": true
                    },
                    "instance": {
                      "type": "string"
                    },
                    "code": {
                      "enum": [
                        "unauthorized"
                      ],
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    },
                    "unrepresentable": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "missing": {
                      "type": "array",
                      "items": {
                        "required": [
                          "sha256"
                        ],
                        "type": "object",
                        "properties": {
                          "sha256": {
                            "type": "string"
                          },
                          "kind": {
                            "type": "string",
                            "nullable": true
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "type": "https://fanifyai.com/docs/hub/errors#unauthorized",
                  "title": "Unauthorized",
                  "status": 401,
                  "code": "unauthorized"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit reached",
            "headers": {
              "Retry-After": {
                "description": "Seconds before retrying.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "required": [
                    "type",
                    "title",
                    "status",
                    "code"
                  ],
                  "type": "object",
                  "properties": {
                    "type": {
                      "type": "string",
                      "format": "uri"
                    },
                    "title": {
                      "type": "string"
                    },
                    "status": {
                      "type": "integer",
                      "format": "int32"
                    },
                    "detail": {
                      "type": "string",
                      "nullable": true
                    },
                    "instance": {
                      "type": "string"
                    },
                    "code": {
                      "enum": [
                        "rate_limited"
                      ],
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    },
                    "unrepresentable": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "missing": {
                      "type": "array",
                      "items": {
                        "required": [
                          "sha256"
                        ],
                        "type": "object",
                        "properties": {
                          "sha256": {
                            "type": "string"
                          },
                          "kind": {
                            "type": "string",
                            "nullable": true
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "type": "https://fanifyai.com/docs/hub/errors#rate_limited",
                  "title": "Rate limit reached",
                  "status": 429,
                  "code": "rate_limited"
                }
              }
            }
          }
        },
        "security": [
          {
            "Bearer": [ ]
          }
        ]
      }
    },
    "/api/v1/hub/files/sha256/{hash}": {
      "get": {
        "tags": [
          "Files"
        ],
        "summary": "Download file by hash",
        "description": "Downloads a file by content hash, no authentication required: the hash is the capability. Durable LoRA files are streamed from the Hub's storage through this route.",
        "parameters": [
          {
            "name": "hash",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "File contents, returned with the stored media type. Durable LoRA files are proxied through the Hub.",
            "headers": {
              "X-Content-Type-Options": {
                "description": "Always nosniff.",
                "schema": {
                  "type": "string"
                }
              },
              "Content-Disposition": {
                "description": "Always attachment.",
                "schema": {
                  "type": "string"
                }
              },
              "Content-Security-Policy": {
                "description": "Always sandbox.",
                "schema": {
                  "type": "string"
                }
              },
              "Cache-Control": {
                "description": "Always private.",
                "schema": {
                  "type": "string"
                }
              },
              "Content-Length": {
                "description": "Size of the file in bytes.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "image/png": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              },
              "image/jpeg": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              },
              "image/webp": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              },
              "image/gif": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              },
              "image/bmp": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              },
              "video/mp4": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              },
              "video/webm": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              },
              "video/quicktime": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              },
              "video/x-matroska": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              },
              "video/x-msvideo": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              },
              "audio/mpeg": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              },
              "audio/wav": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              },
              "audio/ogg": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              },
              "audio/flac": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              },
              "audio/mp4": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              },
              "audio/aac": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              },
              "application/pdf": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              },
              "application/octet-stream": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              },
              "application/zip": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              },
              "application/x-zip-compressed": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "410": {
            "description": "File expired",
            "content": {
              "application/problem+json": {
                "schema": {
                  "required": [
                    "type",
                    "title",
                    "status",
                    "code"
                  ],
                  "type": "object",
                  "properties": {
                    "type": {
                      "type": "string",
                      "format": "uri"
                    },
                    "title": {
                      "type": "string"
                    },
                    "status": {
                      "type": "integer",
                      "format": "int32"
                    },
                    "detail": {
                      "type": "string",
                      "nullable": true
                    },
                    "instance": {
                      "type": "string"
                    },
                    "code": {
                      "enum": [
                        "file_expired"
                      ],
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    },
                    "unrepresentable": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "missing": {
                      "type": "array",
                      "items": {
                        "required": [
                          "sha256"
                        ],
                        "type": "object",
                        "properties": {
                          "sha256": {
                            "type": "string"
                          },
                          "kind": {
                            "type": "string",
                            "nullable": true
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "type": "https://fanifyai.com/docs/hub/errors#file_expired",
                  "title": "File expired",
                  "status": 410,
                  "code": "file_expired"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit reached",
            "headers": {
              "Retry-After": {
                "description": "Seconds before retrying.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "required": [
                    "type",
                    "title",
                    "status",
                    "code"
                  ],
                  "type": "object",
                  "properties": {
                    "type": {
                      "type": "string",
                      "format": "uri"
                    },
                    "title": {
                      "type": "string"
                    },
                    "status": {
                      "type": "integer",
                      "format": "int32"
                    },
                    "detail": {
                      "type": "string",
                      "nullable": true
                    },
                    "instance": {
                      "type": "string"
                    },
                    "code": {
                      "enum": [
                        "rate_limited"
                      ],
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    },
                    "unrepresentable": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "missing": {
                      "type": "array",
                      "items": {
                        "required": [
                          "sha256"
                        ],
                        "type": "object",
                        "properties": {
                          "sha256": {
                            "type": "string"
                          },
                          "kind": {
                            "type": "string",
                            "nullable": true
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "type": "https://fanifyai.com/docs/hub/errors#rate_limited",
                  "title": "Rate limit reached",
                  "status": 429,
                  "code": "rate_limited"
                }
              }
            }
          }
        }
      },
      "head": {
        "tags": [
          "Files"
        ],
        "summary": "Probe file by hash",
        "description": "Tells whether the Hub has a file (Content-Length, Content-Type), no authentication required. Call it before uploading: 200 means the upload can be skipped. No body.",
        "parameters": [
          {
            "name": "hash",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The Hub has the file: a generation referencing sha256:<hash> will not ask for it. Content-Length and Content-Type describe it. No body.",
            "headers": {
              "X-Content-Type-Options": {
                "description": "Always nosniff.",
                "schema": {
                  "type": "string"
                }
              },
              "Content-Disposition": {
                "description": "Always attachment.",
                "schema": {
                  "type": "string"
                }
              },
              "Content-Security-Policy": {
                "description": "Always sandbox.",
                "schema": {
                  "type": "string"
                }
              },
              "Cache-Control": {
                "description": "Always private.",
                "schema": {
                  "type": "string"
                }
              },
              "Content-Length": {
                "description": "Size of the file in bytes.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "image/png": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              },
              "image/jpeg": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              },
              "image/webp": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              },
              "image/gif": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              },
              "image/bmp": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              },
              "video/mp4": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              },
              "video/webm": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              },
              "video/quicktime": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              },
              "video/x-matroska": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              },
              "video/x-msvideo": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              },
              "audio/mpeg": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              },
              "audio/wav": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              },
              "audio/ogg": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              },
              "audio/flac": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              },
              "audio/mp4": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              },
              "audio/aac": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              },
              "application/pdf": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              },
              "application/octet-stream": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              },
              "application/zip": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              },
              "application/x-zip-compressed": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "410": {
            "description": "File expired",
            "content": {
              "application/problem+json": {
                "schema": {
                  "required": [
                    "type",
                    "title",
                    "status",
                    "code"
                  ],
                  "type": "object",
                  "properties": {
                    "type": {
                      "type": "string",
                      "format": "uri"
                    },
                    "title": {
                      "type": "string"
                    },
                    "status": {
                      "type": "integer",
                      "format": "int32"
                    },
                    "detail": {
                      "type": "string",
                      "nullable": true
                    },
                    "instance": {
                      "type": "string"
                    },
                    "code": {
                      "enum": [
                        "file_expired"
                      ],
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    },
                    "unrepresentable": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "missing": {
                      "type": "array",
                      "items": {
                        "required": [
                          "sha256"
                        ],
                        "type": "object",
                        "properties": {
                          "sha256": {
                            "type": "string"
                          },
                          "kind": {
                            "type": "string",
                            "nullable": true
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "type": "https://fanifyai.com/docs/hub/errors#file_expired",
                  "title": "File expired",
                  "status": 410,
                  "code": "file_expired"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit reached",
            "headers": {
              "Retry-After": {
                "description": "Seconds before retrying.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "required": [
                    "type",
                    "title",
                    "status",
                    "code"
                  ],
                  "type": "object",
                  "properties": {
                    "type": {
                      "type": "string",
                      "format": "uri"
                    },
                    "title": {
                      "type": "string"
                    },
                    "status": {
                      "type": "integer",
                      "format": "int32"
                    },
                    "detail": {
                      "type": "string",
                      "nullable": true
                    },
                    "instance": {
                      "type": "string"
                    },
                    "code": {
                      "enum": [
                        "rate_limited"
                      ],
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    },
                    "unrepresentable": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "missing": {
                      "type": "array",
                      "items": {
                        "required": [
                          "sha256"
                        ],
                        "type": "object",
                        "properties": {
                          "sha256": {
                            "type": "string"
                          },
                          "kind": {
                            "type": "string",
                            "nullable": true
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "type": "https://fanifyai.com/docs/hub/errors#rate_limited",
                  "title": "Rate limit reached",
                  "status": 429,
                  "code": "rate_limited"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "Files"
        ],
        "summary": "Delete file",
        "description": "Deletes your row for this hash. Refused while one of your non-terminal generations uses it; the durable object is removed once no row references it.",
        "parameters": [
          {
            "name": "hash",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Your row for this hash is deleted; the durable object goes once no row references it."
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/problem+json": {
                "schema": {
                  "required": [
                    "type",
                    "title",
                    "status",
                    "code"
                  ],
                  "type": "object",
                  "properties": {
                    "type": {
                      "type": "string",
                      "format": "uri"
                    },
                    "title": {
                      "type": "string"
                    },
                    "status": {
                      "type": "integer",
                      "format": "int32"
                    },
                    "detail": {
                      "type": "string",
                      "nullable": true
                    },
                    "instance": {
                      "type": "string"
                    },
                    "code": {
                      "enum": [
                        "unauthorized"
                      ],
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    },
                    "unrepresentable": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "missing": {
                      "type": "array",
                      "items": {
                        "required": [
                          "sha256"
                        ],
                        "type": "object",
                        "properties": {
                          "sha256": {
                            "type": "string"
                          },
                          "kind": {
                            "type": "string",
                            "nullable": true
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "type": "https://fanifyai.com/docs/hub/errors#unauthorized",
                  "title": "Unauthorized",
                  "status": 401,
                  "code": "unauthorized"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found",
            "content": {
              "application/problem+json": {
                "schema": {
                  "required": [
                    "type",
                    "title",
                    "status",
                    "code"
                  ],
                  "type": "object",
                  "properties": {
                    "type": {
                      "type": "string",
                      "format": "uri"
                    },
                    "title": {
                      "type": "string"
                    },
                    "status": {
                      "type": "integer",
                      "format": "int32"
                    },
                    "detail": {
                      "type": "string",
                      "nullable": true
                    },
                    "instance": {
                      "type": "string"
                    },
                    "code": {
                      "enum": [
                        "resource_not_found"
                      ],
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    },
                    "unrepresentable": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "missing": {
                      "type": "array",
                      "items": {
                        "required": [
                          "sha256"
                        ],
                        "type": "object",
                        "properties": {
                          "sha256": {
                            "type": "string"
                          },
                          "kind": {
                            "type": "string",
                            "nullable": true
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "type": "https://fanifyai.com/docs/hub/errors#resource_not_found",
                  "title": "Resource not found",
                  "status": 404,
                  "code": "resource_not_found"
                }
              }
            }
          },
          "503": {
            "description": "Generation in progress",
            "content": {
              "application/problem+json": {
                "schema": {
                  "required": [
                    "type",
                    "title",
                    "status",
                    "code"
                  ],
                  "type": "object",
                  "properties": {
                    "type": {
                      "type": "string",
                      "format": "uri"
                    },
                    "title": {
                      "type": "string"
                    },
                    "status": {
                      "type": "integer",
                      "format": "int32"
                    },
                    "detail": {
                      "type": "string",
                      "nullable": true
                    },
                    "instance": {
                      "type": "string"
                    },
                    "code": {
                      "enum": [
                        "generation_in_progress"
                      ],
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    },
                    "unrepresentable": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "missing": {
                      "type": "array",
                      "items": {
                        "required": [
                          "sha256"
                        ],
                        "type": "object",
                        "properties": {
                          "sha256": {
                            "type": "string"
                          },
                          "kind": {
                            "type": "string",
                            "nullable": true
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "type": "https://fanifyai.com/docs/hub/errors#generation_in_progress",
                  "title": "Generation in progress",
                  "status": 503,
                  "code": "generation_in_progress"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit reached",
            "headers": {
              "Retry-After": {
                "description": "Seconds before retrying.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "required": [
                    "type",
                    "title",
                    "status",
                    "code"
                  ],
                  "type": "object",
                  "properties": {
                    "type": {
                      "type": "string",
                      "format": "uri"
                    },
                    "title": {
                      "type": "string"
                    },
                    "status": {
                      "type": "integer",
                      "format": "int32"
                    },
                    "detail": {
                      "type": "string",
                      "nullable": true
                    },
                    "instance": {
                      "type": "string"
                    },
                    "code": {
                      "enum": [
                        "rate_limited"
                      ],
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    },
                    "unrepresentable": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "missing": {
                      "type": "array",
                      "items": {
                        "required": [
                          "sha256"
                        ],
                        "type": "object",
                        "properties": {
                          "sha256": {
                            "type": "string"
                          },
                          "kind": {
                            "type": "string",
                            "nullable": true
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "type": "https://fanifyai.com/docs/hub/errors#rate_limited",
                  "title": "Rate limit reached",
                  "status": 429,
                  "code": "rate_limited"
                }
              }
            }
          }
        },
        "security": [
          {
            "Bearer": [ ]
          }
        ]
      }
    },
    "/api/v1/hub/generations": {
      "post": {
        "tags": [
          "Generations"
        ],
        "summary": "Create generation",
        "description": "Submits a media generation for a selected model.",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "description": "Idempotency key. Required for FanifyServer clients.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "description": "Generation request. quantity (1..100, default 1) admits a batch all-or-nothing (D44). Reference a file input as sha256:<hash> (see POST /api/v1/hub/files); a hash the Hub does not have answers 422 missing_resource listing missing[].sha256: upload those files, then resubmit with the same Idempotency-Key. Any other URL is forwarded to the provider as is.",
          "content": {
            "application/json": {
              "schema": {
                "required": [
                  "model",
                  "input"
                ],
                "type": "object",
                "properties": {
                  "model": {
                    "type": "string"
                  },
                  "input": {
                    "type": "object"
                  },
                  "quantity": {
                    "maximum": 100,
                    "minimum": 1,
                    "type": "integer",
                    "format": "int32",
                    "nullable": true
                  }
                },
                "additionalProperties": false
              },
              "example": {
                "model": "nano-banana-2",
                "input": {
                  "prompt": "a cat",
                  "resolution": "2K",
                  "aspect_ratio": "16:9"
                },
                "quantity": 1
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Generation accepted. With quantity > 1 the body is {batch_id, generations[]} (D44).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HubGenerationDto"
                },
                "example": {
                  "id": "0192f3a4-8c1e-7b2a-9f10-2b6d4e0c9a11",
                  "model": "nano-banana-2",
                  "is_llm": false,
                  "status": "queued",
                  "input": {
                    "prompt": "a cat",
                    "aspect_ratio": "16:9",
                    "resolution": "2K"
                  },
                  "estimated_cost": 0.04,
                  "billed_cost": null,
                  "currency": "EUR",
                  "outputs": [ ],
                  "error": null,
                  "missing": [ ],
                  "created_at": "2026-09-07T10:00:00Z",
                  "started_at": null,
                  "completed_at": null,
                  "provider": "kie",
                  "batch_id": null,
                  "progress": null
                },
                "examples": {
                  "single": {
                    "value": {
                      "id": "0192f3a4-8c1e-7b2a-9f10-2b6d4e0c9a11",
                      "model": "nano-banana-2",
                      "is_llm": false,
                      "status": "queued",
                      "input": {
                        "prompt": "a cat",
                        "aspect_ratio": "16:9",
                        "resolution": "2K"
                      },
                      "estimated_cost": 0.04,
                      "billed_cost": null,
                      "currency": "EUR",
                      "outputs": [ ],
                      "error": null,
                      "missing": [ ],
                      "created_at": "2026-09-07T10:00:00Z",
                      "started_at": null,
                      "completed_at": null,
                      "provider": "kie",
                      "batch_id": null,
                      "progress": null
                    }
                  },
                  "batch": {
                    "value": {
                      "batch_id": "0192f3a4-8c1e-7b2a-9f10-2b6d4e0c9a22",
                      "generations": [
                        {
                          "id": "0192f3a4-8c1e-7b2a-9f10-2b6d4e0c9a11",
                          "model": "biglust-sdxl",
                          "is_llm": false,
                          "status": "queued",
                          "input": {
                            "prompt": "a cat",
                            "priority": "normal"
                          },
                          "estimated_cost": 0.112,
                          "billed_cost": null,
                          "currency": "EUR",
                          "outputs": [ ],
                          "error": null,
                          "missing": [ ],
                          "created_at": "2026-09-07T10:00:00Z",
                          "started_at": null,
                          "completed_at": null,
                          "provider": "worker",
                          "batch_id": "0192f3a4-8c1e-7b2a-9f10-2b6d4e0c9a22",
                          "progress": null
                        },
                        {
                          "id": "0192f3a4-8c1e-7b2a-9f10-2b6d4e0c9a12",
                          "model": "biglust-sdxl",
                          "is_llm": false,
                          "status": "queued",
                          "input": {
                            "prompt": "a cat",
                            "priority": "normal"
                          },
                          "estimated_cost": 0.04,
                          "billed_cost": null,
                          "currency": "EUR",
                          "outputs": [ ],
                          "error": null,
                          "missing": [ ],
                          "created_at": "2026-09-07T10:00:00Z",
                          "started_at": null,
                          "completed_at": null,
                          "provider": "worker",
                          "batch_id": "0192f3a4-8c1e-7b2a-9f10-2b6d4e0c9a22",
                          "progress": null
                        }
                      ]
                    }
                  }
                }
              }
            }
          },
          "200": {
            "description": "Completed idempotent replay (a batch replays as {batch_id, generations[]}).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HubGenerationDto"
                },
                "example": {
                  "id": "0192f3a4-8c1e-7b2a-9f10-2b6d4e0c9a11",
                  "model": "nano-banana-2",
                  "is_llm": false,
                  "status": "succeeded",
                  "input": {
                    "prompt": "a cat",
                    "aspect_ratio": "16:9",
                    "resolution": "2K",
                    "image_input": [
                      "https://host/cdn/a.png"
                    ]
                  },
                  "estimated_cost": 0.04,
                  "billed_cost": 0.04,
                  "currency": "EUR",
                  "outputs": [
                    {
                      "index": 0,
                      "media_type": "image/png",
                      "url": "https://fanifyai.com/api/v1/hub/files/sha256/e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
                      "sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
                      "size": 812345,
                      "expires_at": "2026-09-14T10:00:31Z",
                      "file_name": "fanify-20260907-100000-0192f3a4.png"
                    }
                  ],
                  "error": null,
                  "missing": [ ],
                  "created_at": "2026-09-07T10:00:00Z",
                  "started_at": "2026-09-07T10:00:01Z",
                  "completed_at": "2026-09-07T10:00:31Z",
                  "provider": "kie",
                  "batch_id": null,
                  "progress": null
                }
              }
            }
          },
          "400": {
            "description": "Invalid input",
            "content": {
              "application/problem+json": {
                "schema": {
                  "required": [
                    "type",
                    "title",
                    "status",
                    "code"
                  ],
                  "type": "object",
                  "properties": {
                    "type": {
                      "type": "string",
                      "format": "uri"
                    },
                    "title": {
                      "type": "string"
                    },
                    "status": {
                      "type": "integer",
                      "format": "int32"
                    },
                    "detail": {
                      "type": "string",
                      "nullable": true
                    },
                    "instance": {
                      "type": "string"
                    },
                    "code": {
                      "enum": [
                        "invalid_input"
                      ],
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    },
                    "unrepresentable": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "missing": {
                      "type": "array",
                      "items": {
                        "required": [
                          "sha256"
                        ],
                        "type": "object",
                        "properties": {
                          "sha256": {
                            "type": "string"
                          },
                          "kind": {
                            "type": "string",
                            "nullable": true
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "type": "https://fanifyai.com/docs/hub/errors#invalid_input",
                  "title": "Invalid input",
                  "status": 400,
                  "code": "invalid_input"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/problem+json": {
                "schema": {
                  "required": [
                    "type",
                    "title",
                    "status",
                    "code"
                  ],
                  "type": "object",
                  "properties": {
                    "type": {
                      "type": "string",
                      "format": "uri"
                    },
                    "title": {
                      "type": "string"
                    },
                    "status": {
                      "type": "integer",
                      "format": "int32"
                    },
                    "detail": {
                      "type": "string",
                      "nullable": true
                    },
                    "instance": {
                      "type": "string"
                    },
                    "code": {
                      "enum": [
                        "unauthorized"
                      ],
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    },
                    "unrepresentable": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "missing": {
                      "type": "array",
                      "items": {
                        "required": [
                          "sha256"
                        ],
                        "type": "object",
                        "properties": {
                          "sha256": {
                            "type": "string"
                          },
                          "kind": {
                            "type": "string",
                            "nullable": true
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "type": "https://fanifyai.com/docs/hub/errors#unauthorized",
                  "title": "Unauthorized",
                  "status": 401,
                  "code": "unauthorized"
                }
              }
            }
          },
          "402": {
            "description": "Insufficient credits",
            "content": {
              "application/problem+json": {
                "schema": {
                  "required": [
                    "type",
                    "title",
                    "status",
                    "code"
                  ],
                  "type": "object",
                  "properties": {
                    "type": {
                      "type": "string",
                      "format": "uri"
                    },
                    "title": {
                      "type": "string"
                    },
                    "status": {
                      "type": "integer",
                      "format": "int32"
                    },
                    "detail": {
                      "type": "string",
                      "nullable": true
                    },
                    "instance": {
                      "type": "string"
                    },
                    "code": {
                      "enum": [
                        "insufficient_credits"
                      ],
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    },
                    "unrepresentable": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "missing": {
                      "type": "array",
                      "items": {
                        "required": [
                          "sha256"
                        ],
                        "type": "object",
                        "properties": {
                          "sha256": {
                            "type": "string"
                          },
                          "kind": {
                            "type": "string",
                            "nullable": true
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "type": "https://fanifyai.com/docs/hub/errors#insufficient_credits",
                  "title": "Insufficient credits",
                  "status": 402,
                  "code": "insufficient_credits",
                  "detail": "Your available balance does not cover this generation.",
                  "instance": "/api/v1/hub/generations"
                }
              }
            }
          },
          "404": {
            "description": "Model not found",
            "content": {
              "application/problem+json": {
                "schema": {
                  "required": [
                    "type",
                    "title",
                    "status",
                    "code"
                  ],
                  "type": "object",
                  "properties": {
                    "type": {
                      "type": "string",
                      "format": "uri"
                    },
                    "title": {
                      "type": "string"
                    },
                    "status": {
                      "type": "integer",
                      "format": "int32"
                    },
                    "detail": {
                      "type": "string",
                      "nullable": true
                    },
                    "instance": {
                      "type": "string"
                    },
                    "code": {
                      "enum": [
                        "model_not_found"
                      ],
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    },
                    "unrepresentable": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "missing": {
                      "type": "array",
                      "items": {
                        "required": [
                          "sha256"
                        ],
                        "type": "object",
                        "properties": {
                          "sha256": {
                            "type": "string"
                          },
                          "kind": {
                            "type": "string",
                            "nullable": true
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "type": "https://fanifyai.com/docs/hub/errors#model_not_found",
                  "title": "Model not found",
                  "status": 404,
                  "code": "model_not_found"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit reached",
            "headers": {
              "Retry-After": {
                "description": "Seconds before retrying.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "required": [
                    "type",
                    "title",
                    "status",
                    "code"
                  ],
                  "type": "object",
                  "properties": {
                    "type": {
                      "type": "string",
                      "format": "uri"
                    },
                    "title": {
                      "type": "string"
                    },
                    "status": {
                      "type": "integer",
                      "format": "int32"
                    },
                    "detail": {
                      "type": "string",
                      "nullable": true
                    },
                    "instance": {
                      "type": "string"
                    },
                    "code": {
                      "enum": [
                        "rate_limited"
                      ],
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    },
                    "unrepresentable": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "missing": {
                      "type": "array",
                      "items": {
                        "required": [
                          "sha256"
                        ],
                        "type": "object",
                        "properties": {
                          "sha256": {
                            "type": "string"
                          },
                          "kind": {
                            "type": "string",
                            "nullable": true
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "type": "https://fanifyai.com/docs/hub/errors#rate_limited",
                  "title": "Rate limit reached",
                  "status": 429,
                  "code": "rate_limited"
                }
              }
            }
          },
          "422": {
            "description": "No route available",
            "content": {
              "application/problem+json": {
                "schema": {
                  "required": [
                    "type",
                    "title",
                    "status",
                    "code"
                  ],
                  "type": "object",
                  "properties": {
                    "type": {
                      "type": "string",
                      "format": "uri"
                    },
                    "title": {
                      "type": "string"
                    },
                    "status": {
                      "type": "integer",
                      "format": "int32"
                    },
                    "detail": {
                      "type": "string",
                      "nullable": true
                    },
                    "instance": {
                      "type": "string"
                    },
                    "code": {
                      "enum": [
                        "no_route_available",
                        "idempotency_conflict",
                        "missing_resource"
                      ],
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    },
                    "unrepresentable": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "missing": {
                      "type": "array",
                      "items": {
                        "required": [
                          "sha256"
                        ],
                        "type": "object",
                        "properties": {
                          "sha256": {
                            "type": "string"
                          },
                          "kind": {
                            "type": "string",
                            "nullable": true
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "type": "https://fanifyai.com/docs/hub/errors#no_route_available",
                  "title": "No route available",
                  "status": 422,
                  "code": "no_route_available"
                }
              }
            }
          },
          "503": {
            "description": "Generation in progress",
            "headers": {
              "Retry-After": {
                "description": "Always 5 seconds for an in-progress replay.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "required": [
                    "type",
                    "title",
                    "status",
                    "code"
                  ],
                  "type": "object",
                  "properties": {
                    "type": {
                      "type": "string",
                      "format": "uri"
                    },
                    "title": {
                      "type": "string"
                    },
                    "status": {
                      "type": "integer",
                      "format": "int32"
                    },
                    "detail": {
                      "type": "string",
                      "nullable": true
                    },
                    "instance": {
                      "type": "string"
                    },
                    "code": {
                      "enum": [
                        "generation_in_progress",
                        "hub_paused"
                      ],
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    },
                    "unrepresentable": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "missing": {
                      "type": "array",
                      "items": {
                        "required": [
                          "sha256"
                        ],
                        "type": "object",
                        "properties": {
                          "sha256": {
                            "type": "string"
                          },
                          "kind": {
                            "type": "string",
                            "nullable": true
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "type": "https://fanifyai.com/docs/hub/errors#generation_in_progress",
                  "title": "Generation in progress",
                  "status": 503,
                  "code": "generation_in_progress"
                }
              }
            }
          }
        },
        "security": [
          {
            "Bearer": [ ]
          }
        ]
      },
      "get": {
        "tags": [
          "Generations"
        ],
        "summary": "List generations",
        "description": "Lists your generations from newest to oldest.",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32",
              "default": 30
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "status",
            "in": "query",
            "schema": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          },
          {
            "name": "from",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "to",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "model",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "media_only",
            "in": "query",
            "description": "When true, exclude LLM executions before pagination and total_billed. Defaults to false (all executions). The execution kind is retained after content expires.",
            "schema": {
              "type": "boolean",
              "default": false
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Generation history, newest first.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HubGenerationListDto"
                },
                "example": {
                  "data": [
                    {
                      "id": "0192f3a4-8c1e-7b2a-9f10-2b6d4e0c9a11",
                      "model": "biglust-sdxl",
                      "is_llm": false,
                      "status": "running",
                      "input": {
                        "prompt": "a cat",
                        "priority": "normal",
                        "image": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"
                      },
                      "estimated_cost": 0.04,
                      "billed_cost": null,
                      "currency": "EUR",
                      "outputs": [ ],
                      "error": null,
                      "missing": [ ],
                      "created_at": "2026-09-07T10:00:00Z",
                      "started_at": "2026-09-07T10:00:01Z",
                      "completed_at": null,
                      "provider": "worker",
                      "batch_id": null,
                      "progress": {
                        "percent": 42,
                        "phase": "running",
                        "eta_s": 38
                      }
                    }
                  ],
                  "next_cursor": "MTc1NzIzNDAwMDAwMDAwMDA6MDE5MmYzYTQ",
                  "total_billed": 1.2345
                }
              }
            }
          },
          "400": {
            "description": "Invalid input",
            "content": {
              "application/problem+json": {
                "schema": {
                  "required": [
                    "type",
                    "title",
                    "status",
                    "code"
                  ],
                  "type": "object",
                  "properties": {
                    "type": {
                      "type": "string",
                      "format": "uri"
                    },
                    "title": {
                      "type": "string"
                    },
                    "status": {
                      "type": "integer",
                      "format": "int32"
                    },
                    "detail": {
                      "type": "string",
                      "nullable": true
                    },
                    "instance": {
                      "type": "string"
                    },
                    "code": {
                      "enum": [
                        "invalid_input"
                      ],
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    },
                    "unrepresentable": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "missing": {
                      "type": "array",
                      "items": {
                        "required": [
                          "sha256"
                        ],
                        "type": "object",
                        "properties": {
                          "sha256": {
                            "type": "string"
                          },
                          "kind": {
                            "type": "string",
                            "nullable": true
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "type": "https://fanifyai.com/docs/hub/errors#invalid_input",
                  "title": "Invalid input",
                  "status": 400,
                  "code": "invalid_input"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/problem+json": {
                "schema": {
                  "required": [
                    "type",
                    "title",
                    "status",
                    "code"
                  ],
                  "type": "object",
                  "properties": {
                    "type": {
                      "type": "string",
                      "format": "uri"
                    },
                    "title": {
                      "type": "string"
                    },
                    "status": {
                      "type": "integer",
                      "format": "int32"
                    },
                    "detail": {
                      "type": "string",
                      "nullable": true
                    },
                    "instance": {
                      "type": "string"
                    },
                    "code": {
                      "enum": [
                        "unauthorized"
                      ],
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    },
                    "unrepresentable": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "missing": {
                      "type": "array",
                      "items": {
                        "required": [
                          "sha256"
                        ],
                        "type": "object",
                        "properties": {
                          "sha256": {
                            "type": "string"
                          },
                          "kind": {
                            "type": "string",
                            "nullable": true
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "type": "https://fanifyai.com/docs/hub/errors#unauthorized",
                  "title": "Unauthorized",
                  "status": 401,
                  "code": "unauthorized"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit reached",
            "headers": {
              "Retry-After": {
                "description": "Seconds before retrying.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "required": [
                    "type",
                    "title",
                    "status",
                    "code"
                  ],
                  "type": "object",
                  "properties": {
                    "type": {
                      "type": "string",
                      "format": "uri"
                    },
                    "title": {
                      "type": "string"
                    },
                    "status": {
                      "type": "integer",
                      "format": "int32"
                    },
                    "detail": {
                      "type": "string",
                      "nullable": true
                    },
                    "instance": {
                      "type": "string"
                    },
                    "code": {
                      "enum": [
                        "rate_limited"
                      ],
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    },
                    "unrepresentable": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "missing": {
                      "type": "array",
                      "items": {
                        "required": [
                          "sha256"
                        ],
                        "type": "object",
                        "properties": {
                          "sha256": {
                            "type": "string"
                          },
                          "kind": {
                            "type": "string",
                            "nullable": true
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "type": "https://fanifyai.com/docs/hub/errors#rate_limited",
                  "title": "Rate limit reached",
                  "status": 429,
                  "code": "rate_limited"
                }
              }
            }
          }
        },
        "security": [
          {
            "Bearer": [ ]
          }
        ]
      }
    },
    "/api/v1/hub/generations/{id}": {
      "get": {
        "tags": [
          "Generations"
        ],
        "summary": "Get generation",
        "description": "Retrieves one generation and its current status.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Generation details.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HubGenerationDto"
                },
                "example": {
                  "id": "0192f3a4-8c1e-7b2a-9f10-2b6d4e0c9a11",
                  "model": "nano-banana-2",
                  "is_llm": false,
                  "status": "succeeded",
                  "input": {
                    "prompt": "a cat",
                    "aspect_ratio": "16:9",
                    "resolution": "2K",
                    "image_input": [
                      "https://host/cdn/a.png"
                    ]
                  },
                  "estimated_cost": 0.04,
                  "billed_cost": 0.04,
                  "currency": "EUR",
                  "outputs": [
                    {
                      "index": 0,
                      "media_type": "image/png",
                      "url": "https://fanifyai.com/api/v1/hub/files/sha256/e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
                      "sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
                      "size": 812345,
                      "expires_at": "2026-09-14T10:00:31Z",
                      "file_name": "fanify-20260907-100000-0192f3a4.png"
                    }
                  ],
                  "error": null,
                  "missing": [ ],
                  "created_at": "2026-09-07T10:00:00Z",
                  "started_at": "2026-09-07T10:00:01Z",
                  "completed_at": "2026-09-07T10:00:31Z",
                  "provider": "kie",
                  "batch_id": null,
                  "progress": null
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/problem+json": {
                "schema": {
                  "required": [
                    "type",
                    "title",
                    "status",
                    "code"
                  ],
                  "type": "object",
                  "properties": {
                    "type": {
                      "type": "string",
                      "format": "uri"
                    },
                    "title": {
                      "type": "string"
                    },
                    "status": {
                      "type": "integer",
                      "format": "int32"
                    },
                    "detail": {
                      "type": "string",
                      "nullable": true
                    },
                    "instance": {
                      "type": "string"
                    },
                    "code": {
                      "enum": [
                        "unauthorized"
                      ],
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    },
                    "unrepresentable": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "missing": {
                      "type": "array",
                      "items": {
                        "required": [
                          "sha256"
                        ],
                        "type": "object",
                        "properties": {
                          "sha256": {
                            "type": "string"
                          },
                          "kind": {
                            "type": "string",
                            "nullable": true
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "type": "https://fanifyai.com/docs/hub/errors#unauthorized",
                  "title": "Unauthorized",
                  "status": 401,
                  "code": "unauthorized"
                }
              }
            }
          },
          "404": {
            "description": "Generation not found",
            "content": {
              "application/problem+json": {
                "schema": {
                  "required": [
                    "type",
                    "title",
                    "status",
                    "code"
                  ],
                  "type": "object",
                  "properties": {
                    "type": {
                      "type": "string",
                      "format": "uri"
                    },
                    "title": {
                      "type": "string"
                    },
                    "status": {
                      "type": "integer",
                      "format": "int32"
                    },
                    "detail": {
                      "type": "string",
                      "nullable": true
                    },
                    "instance": {
                      "type": "string"
                    },
                    "code": {
                      "enum": [
                        "generation_not_found"
                      ],
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    },
                    "unrepresentable": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "missing": {
                      "type": "array",
                      "items": {
                        "required": [
                          "sha256"
                        ],
                        "type": "object",
                        "properties": {
                          "sha256": {
                            "type": "string"
                          },
                          "kind": {
                            "type": "string",
                            "nullable": true
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "type": "https://fanifyai.com/docs/hub/errors#generation_not_found",
                  "title": "Generation not found",
                  "status": 404,
                  "code": "generation_not_found"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit reached",
            "headers": {
              "Retry-After": {
                "description": "Seconds before retrying.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "required": [
                    "type",
                    "title",
                    "status",
                    "code"
                  ],
                  "type": "object",
                  "properties": {
                    "type": {
                      "type": "string",
                      "format": "uri"
                    },
                    "title": {
                      "type": "string"
                    },
                    "status": {
                      "type": "integer",
                      "format": "int32"
                    },
                    "detail": {
                      "type": "string",
                      "nullable": true
                    },
                    "instance": {
                      "type": "string"
                    },
                    "code": {
                      "enum": [
                        "rate_limited"
                      ],
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    },
                    "unrepresentable": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "missing": {
                      "type": "array",
                      "items": {
                        "required": [
                          "sha256"
                        ],
                        "type": "object",
                        "properties": {
                          "sha256": {
                            "type": "string"
                          },
                          "kind": {
                            "type": "string",
                            "nullable": true
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "type": "https://fanifyai.com/docs/hub/errors#rate_limited",
                  "title": "Rate limit reached",
                  "status": 429,
                  "code": "rate_limited"
                }
              }
            }
          }
        },
        "security": [
          {
            "Bearer": [ ]
          }
        ]
      }
    },
    "/api/v1/hub/generations/{id}/cancel": {
      "post": {
        "tags": [
          "Generations"
        ],
        "summary": "Cancel generation",
        "description": "Cancels a generation that is still queued, or a running worker generation (provider = worker; the GPU time already consumed is billed, capped at the estimate).",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Canceled generation.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HubGenerationDto"
                },
                "example": {
                  "id": "0192f3a4-8c1e-7b2a-9f10-2b6d4e0c9a11",
                  "model": "nano-banana-2",
                  "is_llm": false,
                  "status": "canceled",
                  "input": {
                    "prompt": "a cat",
                    "aspect_ratio": "16:9",
                    "resolution": "2K"
                  },
                  "estimated_cost": 0.04,
                  "billed_cost": null,
                  "currency": "EUR",
                  "outputs": [ ],
                  "error": null,
                  "missing": [ ],
                  "created_at": "2026-09-07T10:00:00Z",
                  "started_at": null,
                  "completed_at": "2026-09-07T10:00:10Z",
                  "provider": "kie",
                  "batch_id": null,
                  "progress": null
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/problem+json": {
                "schema": {
                  "required": [
                    "type",
                    "title",
                    "status",
                    "code"
                  ],
                  "type": "object",
                  "properties": {
                    "type": {
                      "type": "string",
                      "format": "uri"
                    },
                    "title": {
                      "type": "string"
                    },
                    "status": {
                      "type": "integer",
                      "format": "int32"
                    },
                    "detail": {
                      "type": "string",
                      "nullable": true
                    },
                    "instance": {
                      "type": "string"
                    },
                    "code": {
                      "enum": [
                        "unauthorized"
                      ],
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    },
                    "unrepresentable": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "missing": {
                      "type": "array",
                      "items": {
                        "required": [
                          "sha256"
                        ],
                        "type": "object",
                        "properties": {
                          "sha256": {
                            "type": "string"
                          },
                          "kind": {
                            "type": "string",
                            "nullable": true
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "type": "https://fanifyai.com/docs/hub/errors#unauthorized",
                  "title": "Unauthorized",
                  "status": 401,
                  "code": "unauthorized"
                }
              }
            }
          },
          "404": {
            "description": "Generation not found",
            "content": {
              "application/problem+json": {
                "schema": {
                  "required": [
                    "type",
                    "title",
                    "status",
                    "code"
                  ],
                  "type": "object",
                  "properties": {
                    "type": {
                      "type": "string",
                      "format": "uri"
                    },
                    "title": {
                      "type": "string"
                    },
                    "status": {
                      "type": "integer",
                      "format": "int32"
                    },
                    "detail": {
                      "type": "string",
                      "nullable": true
                    },
                    "instance": {
                      "type": "string"
                    },
                    "code": {
                      "enum": [
                        "generation_not_found"
                      ],
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    },
                    "unrepresentable": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "missing": {
                      "type": "array",
                      "items": {
                        "required": [
                          "sha256"
                        ],
                        "type": "object",
                        "properties": {
                          "sha256": {
                            "type": "string"
                          },
                          "kind": {
                            "type": "string",
                            "nullable": true
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "type": "https://fanifyai.com/docs/hub/errors#generation_not_found",
                  "title": "Generation not found",
                  "status": 404,
                  "code": "generation_not_found"
                }
              }
            }
          },
          "409": {
            "description": "Generation cannot be canceled",
            "content": {
              "application/problem+json": {
                "schema": {
                  "required": [
                    "type",
                    "title",
                    "status",
                    "code"
                  ],
                  "type": "object",
                  "properties": {
                    "type": {
                      "type": "string",
                      "format": "uri"
                    },
                    "title": {
                      "type": "string"
                    },
                    "status": {
                      "type": "integer",
                      "format": "int32"
                    },
                    "detail": {
                      "type": "string",
                      "nullable": true
                    },
                    "instance": {
                      "type": "string"
                    },
                    "code": {
                      "enum": [
                        "not_cancelable"
                      ],
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    },
                    "unrepresentable": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "missing": {
                      "type": "array",
                      "items": {
                        "required": [
                          "sha256"
                        ],
                        "type": "object",
                        "properties": {
                          "sha256": {
                            "type": "string"
                          },
                          "kind": {
                            "type": "string",
                            "nullable": true
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "type": "https://fanifyai.com/docs/hub/errors#not_cancelable",
                  "title": "Generation cannot be canceled",
                  "status": 409,
                  "code": "not_cancelable"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit reached",
            "headers": {
              "Retry-After": {
                "description": "Seconds before retrying.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "required": [
                    "type",
                    "title",
                    "status",
                    "code"
                  ],
                  "type": "object",
                  "properties": {
                    "type": {
                      "type": "string",
                      "format": "uri"
                    },
                    "title": {
                      "type": "string"
                    },
                    "status": {
                      "type": "integer",
                      "format": "int32"
                    },
                    "detail": {
                      "type": "string",
                      "nullable": true
                    },
                    "instance": {
                      "type": "string"
                    },
                    "code": {
                      "enum": [
                        "rate_limited"
                      ],
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    },
                    "unrepresentable": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "missing": {
                      "type": "array",
                      "items": {
                        "required": [
                          "sha256"
                        ],
                        "type": "object",
                        "properties": {
                          "sha256": {
                            "type": "string"
                          },
                          "kind": {
                            "type": "string",
                            "nullable": true
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "type": "https://fanifyai.com/docs/hub/errors#rate_limited",
                  "title": "Rate limit reached",
                  "status": 429,
                  "code": "rate_limited"
                }
              }
            }
          }
        },
        "security": [
          {
            "Bearer": [ ]
          }
        ]
      }
    },
    "/api/v1/hub/keys": {
      "get": {
        "tags": [
          "API keys"
        ],
        "summary": "List API keys",
        "description": "Lists the API keys available in the Fanify console.",
        "parameters": [
          {
            "name": "X-Requested-With",
            "in": "header",
            "description": "Must be XMLHttpRequest.",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "User API keys.",
            "content": {
              "application/json": {
                "schema": {
                  "required": [
                    "data"
                  ],
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "required": [
                          "created_at",
                          "id",
                          "last_used_at",
                          "name",
                          "prefix"
                        ],
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "integer",
                            "format": "int32"
                          },
                          "name": {
                            "type": "string"
                          },
                          "prefix": {
                            "type": "string"
                          },
                          "created_at": {
                            "type": "string",
                            "format": "date-time"
                          },
                          "last_used_at": {
                            "type": "string",
                            "format": "date-time",
                            "nullable": true
                          }
                        },
                        "additionalProperties": false
                      }
                    }
                  },
                  "additionalProperties": false
                },
                "example": {
                  "data": [
                    {
                      "id": 12,
                      "name": "My laptop",
                      "prefix": "fanify_sk_a1B2c3D4",
                      "created_at": "2026-09-07T10:00:00Z",
                      "last_used_at": null
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/problem+json": {
                "schema": {
                  "required": [
                    "type",
                    "title",
                    "status",
                    "code"
                  ],
                  "type": "object",
                  "properties": {
                    "type": {
                      "type": "string",
                      "format": "uri"
                    },
                    "title": {
                      "type": "string"
                    },
                    "status": {
                      "type": "integer",
                      "format": "int32"
                    },
                    "detail": {
                      "type": "string",
                      "nullable": true
                    },
                    "instance": {
                      "type": "string"
                    },
                    "code": {
                      "enum": [
                        "unauthorized"
                      ],
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    },
                    "unrepresentable": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "missing": {
                      "type": "array",
                      "items": {
                        "required": [
                          "sha256"
                        ],
                        "type": "object",
                        "properties": {
                          "sha256": {
                            "type": "string"
                          },
                          "kind": {
                            "type": "string",
                            "nullable": true
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "type": "https://fanifyai.com/docs/hub/errors#unauthorized",
                  "title": "Unauthorized",
                  "status": 401,
                  "code": "unauthorized"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit reached",
            "headers": {
              "Retry-After": {
                "description": "Seconds before retrying.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "required": [
                    "type",
                    "title",
                    "status",
                    "code"
                  ],
                  "type": "object",
                  "properties": {
                    "type": {
                      "type": "string",
                      "format": "uri"
                    },
                    "title": {
                      "type": "string"
                    },
                    "status": {
                      "type": "integer",
                      "format": "int32"
                    },
                    "detail": {
                      "type": "string",
                      "nullable": true
                    },
                    "instance": {
                      "type": "string"
                    },
                    "code": {
                      "enum": [
                        "rate_limited"
                      ],
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    },
                    "unrepresentable": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "missing": {
                      "type": "array",
                      "items": {
                        "required": [
                          "sha256"
                        ],
                        "type": "object",
                        "properties": {
                          "sha256": {
                            "type": "string"
                          },
                          "kind": {
                            "type": "string",
                            "nullable": true
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "type": "https://fanifyai.com/docs/hub/errors#rate_limited",
                  "title": "Rate limit reached",
                  "status": 429,
                  "code": "rate_limited"
                }
              }
            }
          }
        },
        "security": [
          {
            "ConsoleSession": [ ]
          }
        ]
      },
      "post": {
        "tags": [
          "API keys"
        ],
        "summary": "Create API key",
        "description": "Creates an API key and returns its secret once.",
        "parameters": [
          {
            "name": "X-Requested-With",
            "in": "header",
            "description": "Must be XMLHttpRequest.",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "description": "API key name",
          "content": {
            "application/json": {
              "schema": {
                "required": [
                  "name"
                ],
                "type": "object",
                "properties": {
                  "name": {
                    "maxLength": 100,
                    "minLength": 1,
                    "type": "string"
                  }
                },
                "additionalProperties": false
              },
              "example": {
                "name": "My laptop"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "API key. The secret is returned once.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiKeyDto"
                },
                "example": {
                  "id": 12,
                  "name": "My laptop",
                  "prefix": "fanify_sk_a1B2c3D4",
                  "created_at": "2026-09-07T10:00:00Z",
                  "last_used_at": null,
                  "key": "fanify_sk_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
                }
              }
            }
          },
          "400": {
            "description": "Invalid input",
            "content": {
              "application/problem+json": {
                "schema": {
                  "required": [
                    "type",
                    "title",
                    "status",
                    "code"
                  ],
                  "type": "object",
                  "properties": {
                    "type": {
                      "type": "string",
                      "format": "uri"
                    },
                    "title": {
                      "type": "string"
                    },
                    "status": {
                      "type": "integer",
                      "format": "int32"
                    },
                    "detail": {
                      "type": "string",
                      "nullable": true
                    },
                    "instance": {
                      "type": "string"
                    },
                    "code": {
                      "enum": [
                        "invalid_input"
                      ],
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    },
                    "unrepresentable": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "missing": {
                      "type": "array",
                      "items": {
                        "required": [
                          "sha256"
                        ],
                        "type": "object",
                        "properties": {
                          "sha256": {
                            "type": "string"
                          },
                          "kind": {
                            "type": "string",
                            "nullable": true
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "type": "https://fanifyai.com/docs/hub/errors#invalid_input",
                  "title": "Invalid input",
                  "status": 400,
                  "code": "invalid_input"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/problem+json": {
                "schema": {
                  "required": [
                    "type",
                    "title",
                    "status",
                    "code"
                  ],
                  "type": "object",
                  "properties": {
                    "type": {
                      "type": "string",
                      "format": "uri"
                    },
                    "title": {
                      "type": "string"
                    },
                    "status": {
                      "type": "integer",
                      "format": "int32"
                    },
                    "detail": {
                      "type": "string",
                      "nullable": true
                    },
                    "instance": {
                      "type": "string"
                    },
                    "code": {
                      "enum": [
                        "unauthorized"
                      ],
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    },
                    "unrepresentable": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "missing": {
                      "type": "array",
                      "items": {
                        "required": [
                          "sha256"
                        ],
                        "type": "object",
                        "properties": {
                          "sha256": {
                            "type": "string"
                          },
                          "kind": {
                            "type": "string",
                            "nullable": true
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "type": "https://fanifyai.com/docs/hub/errors#unauthorized",
                  "title": "Unauthorized",
                  "status": 401,
                  "code": "unauthorized"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit reached",
            "headers": {
              "Retry-After": {
                "description": "Seconds before retrying.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "required": [
                    "type",
                    "title",
                    "status",
                    "code"
                  ],
                  "type": "object",
                  "properties": {
                    "type": {
                      "type": "string",
                      "format": "uri"
                    },
                    "title": {
                      "type": "string"
                    },
                    "status": {
                      "type": "integer",
                      "format": "int32"
                    },
                    "detail": {
                      "type": "string",
                      "nullable": true
                    },
                    "instance": {
                      "type": "string"
                    },
                    "code": {
                      "enum": [
                        "rate_limited"
                      ],
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    },
                    "unrepresentable": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "missing": {
                      "type": "array",
                      "items": {
                        "required": [
                          "sha256"
                        ],
                        "type": "object",
                        "properties": {
                          "sha256": {
                            "type": "string"
                          },
                          "kind": {
                            "type": "string",
                            "nullable": true
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "type": "https://fanifyai.com/docs/hub/errors#rate_limited",
                  "title": "Rate limit reached",
                  "status": 429,
                  "code": "rate_limited"
                }
              }
            }
          }
        },
        "security": [
          {
            "ConsoleSession": [ ]
          }
        ]
      }
    },
    "/api/v1/hub/keys/{id}": {
      "delete": {
        "tags": [
          "API keys"
        ],
        "summary": "Revoke API key",
        "description": "Revokes an API key so it can no longer authenticate requests.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "X-Requested-With",
            "in": "header",
            "description": "Must be XMLHttpRequest.",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "API key revoked."
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/problem+json": {
                "schema": {
                  "required": [
                    "type",
                    "title",
                    "status",
                    "code"
                  ],
                  "type": "object",
                  "properties": {
                    "type": {
                      "type": "string",
                      "format": "uri"
                    },
                    "title": {
                      "type": "string"
                    },
                    "status": {
                      "type": "integer",
                      "format": "int32"
                    },
                    "detail": {
                      "type": "string",
                      "nullable": true
                    },
                    "instance": {
                      "type": "string"
                    },
                    "code": {
                      "enum": [
                        "unauthorized"
                      ],
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    },
                    "unrepresentable": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "missing": {
                      "type": "array",
                      "items": {
                        "required": [
                          "sha256"
                        ],
                        "type": "object",
                        "properties": {
                          "sha256": {
                            "type": "string"
                          },
                          "kind": {
                            "type": "string",
                            "nullable": true
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "type": "https://fanifyai.com/docs/hub/errors#unauthorized",
                  "title": "Unauthorized",
                  "status": 401,
                  "code": "unauthorized"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found",
            "content": {
              "application/problem+json": {
                "schema": {
                  "required": [
                    "type",
                    "title",
                    "status",
                    "code"
                  ],
                  "type": "object",
                  "properties": {
                    "type": {
                      "type": "string",
                      "format": "uri"
                    },
                    "title": {
                      "type": "string"
                    },
                    "status": {
                      "type": "integer",
                      "format": "int32"
                    },
                    "detail": {
                      "type": "string",
                      "nullable": true
                    },
                    "instance": {
                      "type": "string"
                    },
                    "code": {
                      "enum": [
                        "resource_not_found"
                      ],
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    },
                    "unrepresentable": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "missing": {
                      "type": "array",
                      "items": {
                        "required": [
                          "sha256"
                        ],
                        "type": "object",
                        "properties": {
                          "sha256": {
                            "type": "string"
                          },
                          "kind": {
                            "type": "string",
                            "nullable": true
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "type": "https://fanifyai.com/docs/hub/errors#resource_not_found",
                  "title": "Resource not found",
                  "status": 404,
                  "code": "resource_not_found"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit reached",
            "headers": {
              "Retry-After": {
                "description": "Seconds before retrying.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "required": [
                    "type",
                    "title",
                    "status",
                    "code"
                  ],
                  "type": "object",
                  "properties": {
                    "type": {
                      "type": "string",
                      "format": "uri"
                    },
                    "title": {
                      "type": "string"
                    },
                    "status": {
                      "type": "integer",
                      "format": "int32"
                    },
                    "detail": {
                      "type": "string",
                      "nullable": true
                    },
                    "instance": {
                      "type": "string"
                    },
                    "code": {
                      "enum": [
                        "rate_limited"
                      ],
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    },
                    "unrepresentable": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "missing": {
                      "type": "array",
                      "items": {
                        "required": [
                          "sha256"
                        ],
                        "type": "object",
                        "properties": {
                          "sha256": {
                            "type": "string"
                          },
                          "kind": {
                            "type": "string",
                            "nullable": true
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "type": "https://fanifyai.com/docs/hub/errors#rate_limited",
                  "title": "Rate limit reached",
                  "status": 429,
                  "code": "rate_limited"
                }
              }
            }
          }
        },
        "security": [
          {
            "ConsoleSession": [ ]
          }
        ]
      }
    },
    "/api/v1/me": {
      "get": {
        "tags": [
          "Account"
        ],
        "summary": "Get account",
        "description": "Returns your account details and available credit balance.",
        "responses": {
          "200": {
            "description": "Caller account and balance.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HubMeDto"
                },
                "example": {
                  "client_id": 42,
                  "email": "client@example.com",
                  "membership": true,
                  "balance": 4.9521,
                  "available": 4.9121,
                  "currency": "EUR",
                  "key": {
                    "name": "Instance ABCD-EFGH-IJKL-MNOP-QRST",
                    "prefix": "fanify_sk_a1B2c3D4"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/problem+json": {
                "schema": {
                  "required": [
                    "type",
                    "title",
                    "status",
                    "code"
                  ],
                  "type": "object",
                  "properties": {
                    "type": {
                      "type": "string",
                      "format": "uri"
                    },
                    "title": {
                      "type": "string"
                    },
                    "status": {
                      "type": "integer",
                      "format": "int32"
                    },
                    "detail": {
                      "type": "string",
                      "nullable": true
                    },
                    "instance": {
                      "type": "string"
                    },
                    "code": {
                      "enum": [
                        "unauthorized"
                      ],
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    },
                    "unrepresentable": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "missing": {
                      "type": "array",
                      "items": {
                        "required": [
                          "sha256"
                        ],
                        "type": "object",
                        "properties": {
                          "sha256": {
                            "type": "string"
                          },
                          "kind": {
                            "type": "string",
                            "nullable": true
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "type": "https://fanifyai.com/docs/hub/errors#unauthorized",
                  "title": "Unauthorized",
                  "status": 401,
                  "code": "unauthorized"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit reached",
            "headers": {
              "Retry-After": {
                "description": "Seconds before retrying.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "required": [
                    "type",
                    "title",
                    "status",
                    "code"
                  ],
                  "type": "object",
                  "properties": {
                    "type": {
                      "type": "string",
                      "format": "uri"
                    },
                    "title": {
                      "type": "string"
                    },
                    "status": {
                      "type": "integer",
                      "format": "int32"
                    },
                    "detail": {
                      "type": "string",
                      "nullable": true
                    },
                    "instance": {
                      "type": "string"
                    },
                    "code": {
                      "enum": [
                        "rate_limited"
                      ],
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    },
                    "unrepresentable": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "missing": {
                      "type": "array",
                      "items": {
                        "required": [
                          "sha256"
                        ],
                        "type": "object",
                        "properties": {
                          "sha256": {
                            "type": "string"
                          },
                          "kind": {
                            "type": "string",
                            "nullable": true
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "type": "https://fanifyai.com/docs/hub/errors#rate_limited",
                  "title": "Rate limit reached",
                  "status": 429,
                  "code": "rate_limited"
                }
              }
            }
          }
        },
        "security": [
          {
            "Bearer": [ ]
          }
        ]
      }
    },
    "/api/v1/hub/models": {
      "get": {
        "tags": [
          "Models"
        ],
        "summary": "List models",
        "description": "Lists the models and prices available to your account.",
        "responses": {
          "200": {
            "description": "Caller-specific Hub model catalog.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HubModelDtoHubListDto"
                },
                "example": {
                  "data": [
                    {
                      "id": "nano-banana-2",
                      "name": "Nano Banana 2",
                      "description": "Fanify image model, 1K/2K/4K.",
                      "input_modalities": [
                        "text",
                        "image"
                      ],
                      "output_modalities": [
                        "image"
                      ],
                      "currency": "EUR",
                      "is_llm": false,
                      "parameters_schema": {
                        "type": "object",
                        "required": [
                          "prompt"
                        ],
                        "properties": { }
                      },
                      "pricing_tiers": [
                        {
                          "match": {
                            "resolution": "1K"
                          },
                          "price_usd": 0.036
                        },
                        {
                          "match": {
                            "resolution": "2K"
                          },
                          "price_usd": 0.048
                        },
                        {
                          "match": {
                            "resolution": "4K"
                          },
                          "price_usd": 0.072
                        }
                      ],
                      "input_cost_per_million": null,
                      "output_cost_per_million": null,
                      "context_length": null,
                      "max_output_tokens": null,
                      "supports_vision": false,
                      "supports_tools": false,
                      "supports_structured_output": false,
                      "supports_reasoning": false
                    },
                    {
                      "id": "deepseek-v4-flash-0731",
                      "name": "DeepSeek V4 Flash",
                      "description": null,
                      "input_modalities": [
                        "text"
                      ],
                      "output_modalities": [
                        "text"
                      ],
                      "currency": "EUR",
                      "is_llm": true,
                      "parameters_schema": {
                        "type": "object",
                        "properties": { }
                      },
                      "pricing_tiers": null,
                      "input_cost_per_million": 0.0837,
                      "output_cost_per_million": 0.3348,
                      "context_length": 163840,
                      "max_output_tokens": 32768,
                      "supports_vision": true,
                      "supports_tools": true,
                      "supports_structured_output": true,
                      "supports_reasoning": true
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/problem+json": {
                "schema": {
                  "required": [
                    "type",
                    "title",
                    "status",
                    "code"
                  ],
                  "type": "object",
                  "properties": {
                    "type": {
                      "type": "string",
                      "format": "uri"
                    },
                    "title": {
                      "type": "string"
                    },
                    "status": {
                      "type": "integer",
                      "format": "int32"
                    },
                    "detail": {
                      "type": "string",
                      "nullable": true
                    },
                    "instance": {
                      "type": "string"
                    },
                    "code": {
                      "enum": [
                        "unauthorized"
                      ],
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    },
                    "unrepresentable": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "missing": {
                      "type": "array",
                      "items": {
                        "required": [
                          "sha256"
                        ],
                        "type": "object",
                        "properties": {
                          "sha256": {
                            "type": "string"
                          },
                          "kind": {
                            "type": "string",
                            "nullable": true
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "type": "https://fanifyai.com/docs/hub/errors#unauthorized",
                  "title": "Unauthorized",
                  "status": 401,
                  "code": "unauthorized"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit reached",
            "headers": {
              "Retry-After": {
                "description": "Seconds before retrying.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "required": [
                    "type",
                    "title",
                    "status",
                    "code"
                  ],
                  "type": "object",
                  "properties": {
                    "type": {
                      "type": "string",
                      "format": "uri"
                    },
                    "title": {
                      "type": "string"
                    },
                    "status": {
                      "type": "integer",
                      "format": "int32"
                    },
                    "detail": {
                      "type": "string",
                      "nullable": true
                    },
                    "instance": {
                      "type": "string"
                    },
                    "code": {
                      "enum": [
                        "rate_limited"
                      ],
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    },
                    "unrepresentable": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "missing": {
                      "type": "array",
                      "items": {
                        "required": [
                          "sha256"
                        ],
                        "type": "object",
                        "properties": {
                          "sha256": {
                            "type": "string"
                          },
                          "kind": {
                            "type": "string",
                            "nullable": true
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "type": "https://fanifyai.com/docs/hub/errors#rate_limited",
                  "title": "Rate limit reached",
                  "status": 429,
                  "code": "rate_limited"
                }
              }
            }
          }
        },
        "security": [
          {
            "Bearer": [ ]
          }
        ]
      }
    },
    "/api/v1/hub/models/{id}/pricing": {
      "post": {
        "tags": [
          "Models"
        ],
        "summary": "Estimate price",
        "description": "Estimates the price for model input without creating a generation.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "description": "Hub input. quantity (1..100, default 1) quotes a batch; priority stays inside input (D44, D102).",
          "content": {
            "application/json": {
              "schema": {
                "required": [
                  "input"
                ],
                "type": "object",
                "properties": {
                  "input": {
                    "type": "object"
                  },
                  "quantity": {
                    "maximum": 100,
                    "minimum": 1,
                    "type": "integer",
                    "format": "int32",
                    "nullable": true
                  }
                },
                "additionalProperties": false
              },
              "example": {
                "input": {
                  "resolution": "4K",
                  "aspect_ratio": "16:9"
                },
                "quantity": 1
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Estimated price in EUR (total of the batch). Worker models add unit_cost, quantity, estimated_duration_s, message, and, only when they apply, cold_start and queue; other models keep the two base fields.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HubPricingDto"
                },
                "example": {
                  "estimated_cost": 0.072,
                  "currency": "EUR"
                },
                "examples": {
                  "external": {
                    "value": {
                      "estimated_cost": 0.072,
                      "currency": "EUR"
                    }
                  },
                  "worker": {
                    "value": {
                      "estimated_cost": 0.472,
                      "currency": "EUR",
                      "unit_cost": 0.04,
                      "quantity": 10,
                      "cold_start": {
                        "included": true,
                        "cost": 0.072,
                        "seconds": 240
                      },
                      "estimated_duration_s": 64,
                      "queue": {
                        "pending_ahead": 0,
                        "machines_alive": 0,
                        "machines_booting": 0,
                        "estimated_wait_s": 240
                      },
                      "message": "first_generation_more_expensive"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid input",
            "content": {
              "application/problem+json": {
                "schema": {
                  "required": [
                    "type",
                    "title",
                    "status",
                    "code"
                  ],
                  "type": "object",
                  "properties": {
                    "type": {
                      "type": "string",
                      "format": "uri"
                    },
                    "title": {
                      "type": "string"
                    },
                    "status": {
                      "type": "integer",
                      "format": "int32"
                    },
                    "detail": {
                      "type": "string",
                      "nullable": true
                    },
                    "instance": {
                      "type": "string"
                    },
                    "code": {
                      "enum": [
                        "invalid_input"
                      ],
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    },
                    "unrepresentable": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "missing": {
                      "type": "array",
                      "items": {
                        "required": [
                          "sha256"
                        ],
                        "type": "object",
                        "properties": {
                          "sha256": {
                            "type": "string"
                          },
                          "kind": {
                            "type": "string",
                            "nullable": true
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "type": "https://fanifyai.com/docs/hub/errors#invalid_input",
                  "title": "Invalid input",
                  "status": 400,
                  "code": "invalid_input"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/problem+json": {
                "schema": {
                  "required": [
                    "type",
                    "title",
                    "status",
                    "code"
                  ],
                  "type": "object",
                  "properties": {
                    "type": {
                      "type": "string",
                      "format": "uri"
                    },
                    "title": {
                      "type": "string"
                    },
                    "status": {
                      "type": "integer",
                      "format": "int32"
                    },
                    "detail": {
                      "type": "string",
                      "nullable": true
                    },
                    "instance": {
                      "type": "string"
                    },
                    "code": {
                      "enum": [
                        "unauthorized"
                      ],
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    },
                    "unrepresentable": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "missing": {
                      "type": "array",
                      "items": {
                        "required": [
                          "sha256"
                        ],
                        "type": "object",
                        "properties": {
                          "sha256": {
                            "type": "string"
                          },
                          "kind": {
                            "type": "string",
                            "nullable": true
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "type": "https://fanifyai.com/docs/hub/errors#unauthorized",
                  "title": "Unauthorized",
                  "status": 401,
                  "code": "unauthorized"
                }
              }
            }
          },
          "404": {
            "description": "Model not found",
            "content": {
              "application/problem+json": {
                "schema": {
                  "required": [
                    "type",
                    "title",
                    "status",
                    "code"
                  ],
                  "type": "object",
                  "properties": {
                    "type": {
                      "type": "string",
                      "format": "uri"
                    },
                    "title": {
                      "type": "string"
                    },
                    "status": {
                      "type": "integer",
                      "format": "int32"
                    },
                    "detail": {
                      "type": "string",
                      "nullable": true
                    },
                    "instance": {
                      "type": "string"
                    },
                    "code": {
                      "enum": [
                        "model_not_found"
                      ],
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    },
                    "unrepresentable": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "missing": {
                      "type": "array",
                      "items": {
                        "required": [
                          "sha256"
                        ],
                        "type": "object",
                        "properties": {
                          "sha256": {
                            "type": "string"
                          },
                          "kind": {
                            "type": "string",
                            "nullable": true
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "type": "https://fanifyai.com/docs/hub/errors#model_not_found",
                  "title": "Model not found",
                  "status": 404,
                  "code": "model_not_found"
                }
              }
            }
          },
          "422": {
            "description": "No route available",
            "content": {
              "application/problem+json": {
                "schema": {
                  "required": [
                    "type",
                    "title",
                    "status",
                    "code"
                  ],
                  "type": "object",
                  "properties": {
                    "type": {
                      "type": "string",
                      "format": "uri"
                    },
                    "title": {
                      "type": "string"
                    },
                    "status": {
                      "type": "integer",
                      "format": "int32"
                    },
                    "detail": {
                      "type": "string",
                      "nullable": true
                    },
                    "instance": {
                      "type": "string"
                    },
                    "code": {
                      "enum": [
                        "no_route_available"
                      ],
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    },
                    "unrepresentable": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "missing": {
                      "type": "array",
                      "items": {
                        "required": [
                          "sha256"
                        ],
                        "type": "object",
                        "properties": {
                          "sha256": {
                            "type": "string"
                          },
                          "kind": {
                            "type": "string",
                            "nullable": true
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "type": "https://fanifyai.com/docs/hub/errors#no_route_available",
                  "title": "No route available",
                  "status": 422,
                  "code": "no_route_available"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit reached",
            "headers": {
              "Retry-After": {
                "description": "Seconds before retrying.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "required": [
                    "type",
                    "title",
                    "status",
                    "code"
                  ],
                  "type": "object",
                  "properties": {
                    "type": {
                      "type": "string",
                      "format": "uri"
                    },
                    "title": {
                      "type": "string"
                    },
                    "status": {
                      "type": "integer",
                      "format": "int32"
                    },
                    "detail": {
                      "type": "string",
                      "nullable": true
                    },
                    "instance": {
                      "type": "string"
                    },
                    "code": {
                      "enum": [
                        "rate_limited"
                      ],
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    },
                    "unrepresentable": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "missing": {
                      "type": "array",
                      "items": {
                        "required": [
                          "sha256"
                        ],
                        "type": "object",
                        "properties": {
                          "sha256": {
                            "type": "string"
                          },
                          "kind": {
                            "type": "string",
                            "nullable": true
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "type": "https://fanifyai.com/docs/hub/errors#rate_limited",
                  "title": "Rate limit reached",
                  "status": 429,
                  "code": "rate_limited"
                }
              }
            }
          }
        },
        "security": [
          {
            "Bearer": [ ]
          }
        ]
      }
    },
    "/api/v1/hub/webhooks": {
      "get": {
        "tags": [
          "Webhooks"
        ],
        "summary": "List webhooks",
        "description": "Lists your registered webhooks without their secrets.",
        "responses": {
          "200": {
            "description": "Registered webhook endpoints.",
            "content": {
              "application/json": {
                "schema": {
                  "required": [
                    "data"
                  ],
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "required": [
                          "created_at",
                          "events",
                          "id",
                          "last_error",
                          "url"
                        ],
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string",
                            "format": "uuid"
                          },
                          "url": {
                            "type": "string"
                          },
                          "events": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          },
                          "created_at": {
                            "type": "string",
                            "format": "date-time"
                          },
                          "last_error": {
                            "type": "string",
                            "nullable": true
                          }
                        },
                        "additionalProperties": false
                      }
                    }
                  },
                  "additionalProperties": false
                },
                "example": {
                  "data": [ ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/problem+json": {
                "schema": {
                  "required": [
                    "type",
                    "title",
                    "status",
                    "code"
                  ],
                  "type": "object",
                  "properties": {
                    "type": {
                      "type": "string",
                      "format": "uri"
                    },
                    "title": {
                      "type": "string"
                    },
                    "status": {
                      "type": "integer",
                      "format": "int32"
                    },
                    "detail": {
                      "type": "string",
                      "nullable": true
                    },
                    "instance": {
                      "type": "string"
                    },
                    "code": {
                      "enum": [
                        "unauthorized"
                      ],
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    },
                    "unrepresentable": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "missing": {
                      "type": "array",
                      "items": {
                        "required": [
                          "sha256"
                        ],
                        "type": "object",
                        "properties": {
                          "sha256": {
                            "type": "string"
                          },
                          "kind": {
                            "type": "string",
                            "nullable": true
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "type": "https://fanifyai.com/docs/hub/errors#unauthorized",
                  "title": "Unauthorized",
                  "status": 401,
                  "code": "unauthorized"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit reached",
            "headers": {
              "Retry-After": {
                "description": "Seconds before retrying.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "required": [
                    "type",
                    "title",
                    "status",
                    "code"
                  ],
                  "type": "object",
                  "properties": {
                    "type": {
                      "type": "string",
                      "format": "uri"
                    },
                    "title": {
                      "type": "string"
                    },
                    "status": {
                      "type": "integer",
                      "format": "int32"
                    },
                    "detail": {
                      "type": "string",
                      "nullable": true
                    },
                    "instance": {
                      "type": "string"
                    },
                    "code": {
                      "enum": [
                        "rate_limited"
                      ],
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    },
                    "unrepresentable": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "missing": {
                      "type": "array",
                      "items": {
                        "required": [
                          "sha256"
                        ],
                        "type": "object",
                        "properties": {
                          "sha256": {
                            "type": "string"
                          },
                          "kind": {
                            "type": "string",
                            "nullable": true
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "type": "https://fanifyai.com/docs/hub/errors#rate_limited",
                  "title": "Rate limit reached",
                  "status": 429,
                  "code": "rate_limited"
                }
              }
            }
          }
        },
        "security": [
          {
            "Bearer": [ ]
          }
        ]
      },
      "post": {
        "tags": [
          "Webhooks"
        ],
        "summary": "Create webhook",
        "description": "Registers a webhook and returns its secret once.",
        "requestBody": {
          "description": "Webhook registration",
          "content": {
            "application/json": {
              "schema": {
                "required": [
                  "url",
                  "events"
                ],
                "type": "object",
                "properties": {
                  "url": {
                    "type": "string",
                    "format": "uri"
                  },
                  "events": {
                    "type": "array",
                    "items": {
                      "enum": [
                        "generation.running",
                        "generation.completed"
                      ],
                      "type": "string"
                    }
                  }
                },
                "additionalProperties": false
              },
              "example": {
                "url": "https://host/FanifyHub/Webhook",
                "events": [
                  "generation.running",
                  "generation.completed"
                ]
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Webhook endpoint and one-time secret.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookEndpointDto"
                },
                "example": {
                  "id": "0192f3a4-8c1e-7b2a-9f10-2b6d4e0c9a11",
                  "url": "https://host/FanifyHub/Webhook",
                  "events": [
                    "generation.running",
                    "generation.completed"
                  ],
                  "created_at": "2026-09-07T10:00:00Z",
                  "last_error": null,
                  "secret": "3s9K7dQ2pR1sT4uV6wX9yZ0aB2cD4eF6gH8iJ0kL2mN"
                }
              }
            }
          },
          "400": {
            "description": "Invalid input",
            "content": {
              "application/problem+json": {
                "schema": {
                  "required": [
                    "type",
                    "title",
                    "status",
                    "code"
                  ],
                  "type": "object",
                  "properties": {
                    "type": {
                      "type": "string",
                      "format": "uri"
                    },
                    "title": {
                      "type": "string"
                    },
                    "status": {
                      "type": "integer",
                      "format": "int32"
                    },
                    "detail": {
                      "type": "string",
                      "nullable": true
                    },
                    "instance": {
                      "type": "string"
                    },
                    "code": {
                      "enum": [
                        "invalid_input"
                      ],
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    },
                    "unrepresentable": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "missing": {
                      "type": "array",
                      "items": {
                        "required": [
                          "sha256"
                        ],
                        "type": "object",
                        "properties": {
                          "sha256": {
                            "type": "string"
                          },
                          "kind": {
                            "type": "string",
                            "nullable": true
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "type": "https://fanifyai.com/docs/hub/errors#invalid_input",
                  "title": "Invalid input",
                  "status": 400,
                  "code": "invalid_input"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/problem+json": {
                "schema": {
                  "required": [
                    "type",
                    "title",
                    "status",
                    "code"
                  ],
                  "type": "object",
                  "properties": {
                    "type": {
                      "type": "string",
                      "format": "uri"
                    },
                    "title": {
                      "type": "string"
                    },
                    "status": {
                      "type": "integer",
                      "format": "int32"
                    },
                    "detail": {
                      "type": "string",
                      "nullable": true
                    },
                    "instance": {
                      "type": "string"
                    },
                    "code": {
                      "enum": [
                        "unauthorized"
                      ],
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    },
                    "unrepresentable": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "missing": {
                      "type": "array",
                      "items": {
                        "required": [
                          "sha256"
                        ],
                        "type": "object",
                        "properties": {
                          "sha256": {
                            "type": "string"
                          },
                          "kind": {
                            "type": "string",
                            "nullable": true
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "type": "https://fanifyai.com/docs/hub/errors#unauthorized",
                  "title": "Unauthorized",
                  "status": 401,
                  "code": "unauthorized"
                }
              }
            }
          },
          "503": {
            "description": "Webhooks not configured",
            "content": {
              "application/problem+json": {
                "schema": {
                  "required": [
                    "type",
                    "title",
                    "status",
                    "code"
                  ],
                  "type": "object",
                  "properties": {
                    "type": {
                      "type": "string",
                      "format": "uri"
                    },
                    "title": {
                      "type": "string"
                    },
                    "status": {
                      "type": "integer",
                      "format": "int32"
                    },
                    "detail": {
                      "type": "string",
                      "nullable": true
                    },
                    "instance": {
                      "type": "string"
                    },
                    "code": {
                      "enum": [
                        "webhooks_not_configured"
                      ],
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    },
                    "unrepresentable": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "missing": {
                      "type": "array",
                      "items": {
                        "required": [
                          "sha256"
                        ],
                        "type": "object",
                        "properties": {
                          "sha256": {
                            "type": "string"
                          },
                          "kind": {
                            "type": "string",
                            "nullable": true
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "type": "https://fanifyai.com/docs/hub/errors#webhooks_not_configured",
                  "title": "Webhooks not configured",
                  "status": 503,
                  "code": "webhooks_not_configured"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit reached",
            "headers": {
              "Retry-After": {
                "description": "Seconds before retrying.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "required": [
                    "type",
                    "title",
                    "status",
                    "code"
                  ],
                  "type": "object",
                  "properties": {
                    "type": {
                      "type": "string",
                      "format": "uri"
                    },
                    "title": {
                      "type": "string"
                    },
                    "status": {
                      "type": "integer",
                      "format": "int32"
                    },
                    "detail": {
                      "type": "string",
                      "nullable": true
                    },
                    "instance": {
                      "type": "string"
                    },
                    "code": {
                      "enum": [
                        "rate_limited"
                      ],
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    },
                    "unrepresentable": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "missing": {
                      "type": "array",
                      "items": {
                        "required": [
                          "sha256"
                        ],
                        "type": "object",
                        "properties": {
                          "sha256": {
                            "type": "string"
                          },
                          "kind": {
                            "type": "string",
                            "nullable": true
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "type": "https://fanifyai.com/docs/hub/errors#rate_limited",
                  "title": "Rate limit reached",
                  "status": 429,
                  "code": "rate_limited"
                }
              }
            }
          }
        },
        "security": [
          {
            "Bearer": [ ]
          }
        ]
      }
    },
    "/api/v1/hub/webhooks/{id}": {
      "delete": {
        "tags": [
          "Webhooks"
        ],
        "summary": "Delete webhook",
        "description": "Deletes a registered webhook.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Webhook deleted."
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/problem+json": {
                "schema": {
                  "required": [
                    "type",
                    "title",
                    "status",
                    "code"
                  ],
                  "type": "object",
                  "properties": {
                    "type": {
                      "type": "string",
                      "format": "uri"
                    },
                    "title": {
                      "type": "string"
                    },
                    "status": {
                      "type": "integer",
                      "format": "int32"
                    },
                    "detail": {
                      "type": "string",
                      "nullable": true
                    },
                    "instance": {
                      "type": "string"
                    },
                    "code": {
                      "enum": [
                        "unauthorized"
                      ],
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    },
                    "unrepresentable": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "missing": {
                      "type": "array",
                      "items": {
                        "required": [
                          "sha256"
                        ],
                        "type": "object",
                        "properties": {
                          "sha256": {
                            "type": "string"
                          },
                          "kind": {
                            "type": "string",
                            "nullable": true
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "type": "https://fanifyai.com/docs/hub/errors#unauthorized",
                  "title": "Unauthorized",
                  "status": 401,
                  "code": "unauthorized"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found",
            "content": {
              "application/problem+json": {
                "schema": {
                  "required": [
                    "type",
                    "title",
                    "status",
                    "code"
                  ],
                  "type": "object",
                  "properties": {
                    "type": {
                      "type": "string",
                      "format": "uri"
                    },
                    "title": {
                      "type": "string"
                    },
                    "status": {
                      "type": "integer",
                      "format": "int32"
                    },
                    "detail": {
                      "type": "string",
                      "nullable": true
                    },
                    "instance": {
                      "type": "string"
                    },
                    "code": {
                      "enum": [
                        "resource_not_found"
                      ],
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    },
                    "unrepresentable": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "missing": {
                      "type": "array",
                      "items": {
                        "required": [
                          "sha256"
                        ],
                        "type": "object",
                        "properties": {
                          "sha256": {
                            "type": "string"
                          },
                          "kind": {
                            "type": "string",
                            "nullable": true
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "type": "https://fanifyai.com/docs/hub/errors#resource_not_found",
                  "title": "Resource not found",
                  "status": 404,
                  "code": "resource_not_found"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit reached",
            "headers": {
              "Retry-After": {
                "description": "Seconds before retrying.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "required": [
                    "type",
                    "title",
                    "status",
                    "code"
                  ],
                  "type": "object",
                  "properties": {
                    "type": {
                      "type": "string",
                      "format": "uri"
                    },
                    "title": {
                      "type": "string"
                    },
                    "status": {
                      "type": "integer",
                      "format": "int32"
                    },
                    "detail": {
                      "type": "string",
                      "nullable": true
                    },
                    "instance": {
                      "type": "string"
                    },
                    "code": {
                      "enum": [
                        "rate_limited"
                      ],
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    },
                    "unrepresentable": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "missing": {
                      "type": "array",
                      "items": {
                        "required": [
                          "sha256"
                        ],
                        "type": "object",
                        "properties": {
                          "sha256": {
                            "type": "string"
                          },
                          "kind": {
                            "type": "string",
                            "nullable": true
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "type": "https://fanifyai.com/docs/hub/errors#rate_limited",
                  "title": "Rate limit reached",
                  "status": 429,
                  "code": "rate_limited"
                }
              }
            }
          }
        },
        "security": [
          {
            "Bearer": [ ]
          }
        ]
      }
    },
    "/api/v1/hub/openapi.json": {
      "get": {
        "tags": [
          "Reference"
        ],
        "summary": "OpenAPI document",
        "description": "Downloads the OpenAPI document used by this reference.",
        "responses": {
          "200": {
            "description": "Fanify Hub OpenAPI 3 document.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "ApiKeyDto": {
        "required": [
          "created_at",
          "id",
          "key",
          "last_used_at",
          "name",
          "prefix"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "format": "int32"
          },
          "name": {
            "type": "string"
          },
          "prefix": {
            "type": "string"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "last_used_at": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "key": {
            "type": "string"
          }
        },
        "additionalProperties": false
      },
      "CreateApiKeyRequest": {
        "required": [
          "name"
        ],
        "type": "object",
        "properties": {
          "name": {
            "maxLength": 100,
            "minLength": 1,
            "type": "string"
          }
        },
        "additionalProperties": false
      },
      "CreateWebhookRequest": {
        "required": [
          "events",
          "url"
        ],
        "type": "object",
        "properties": {
          "url": {
            "minLength": 1,
            "type": "string",
            "format": "uri"
          },
          "events": {
            "type": "array",
            "items": {
              "enum": [
                "generation.running",
                "generation.completed"
              ],
              "type": "string"
            }
          }
        },
        "additionalProperties": false
      },
      "HubCharacterDescriptionRequest": {
        "type": "object",
        "properties": {
          "model": {
            "type": "string",
            "nullable": true
          },
          "text": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "HubCharacterEstimateRequest": {
        "type": "object",
        "properties": {
          "photos": {
            "type": "integer",
            "format": "int32"
          },
          "models": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "HubCharacterImportRequest": {
        "type": "object",
        "properties": {
          "character_id": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "character_name": {
            "type": "string",
            "nullable": true
          },
          "name": {
            "type": "string",
            "nullable": true
          },
          "trigger_word": {
            "type": "string",
            "nullable": true
          },
          "sha256": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "HubCharacterPatchRequest": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "nullable": true
          },
          "cover_sha256": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "HubCharacterStartRequest": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "nullable": true
          },
          "models": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "HubColdStartDto": {
        "type": "object",
        "properties": {
          "included": {
            "type": "boolean"
          },
          "cost": {
            "type": "number",
            "format": "double"
          },
          "seconds": {
            "type": "integer",
            "format": "int32"
          }
        },
        "additionalProperties": false
      },
      "HubErrorDto": {
        "required": [
          "code",
          "message"
        ],
        "type": "object",
        "properties": {
          "code": {
            "type": "string"
          },
          "message": {
            "type": "string"
          }
        },
        "additionalProperties": false
      },
      "HubFileDto": {
        "required": [
          "expires_at",
          "kind",
          "media_type",
          "sha256",
          "size",
          "url"
        ],
        "type": "object",
        "properties": {
          "url": {
            "type": "string"
          },
          "sha256": {
            "type": "string"
          },
          "size": {
            "type": "integer",
            "format": "int64"
          },
          "media_type": {
            "type": "string"
          },
          "expires_at": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "kind": {
            "type": "string"
          }
        },
        "additionalProperties": false
      },
      "HubFileListDto": {
        "required": [
          "files"
        ],
        "type": "object",
        "properties": {
          "files": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/HubFileListItemDto"
            }
          }
        },
        "additionalProperties": false
      },
      "HubFileListItemDto": {
        "required": [
          "created_at",
          "kind",
          "sha256",
          "size"
        ],
        "type": "object",
        "properties": {
          "sha256": {
            "type": "string"
          },
          "kind": {
            "type": "string"
          },
          "family": {
            "type": "string",
            "nullable": true
          },
          "size": {
            "type": "integer",
            "format": "int64"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          }
        },
        "additionalProperties": false
      },
      "HubGenerationDto": {
        "required": [
          "billed_cost",
          "completed_at",
          "created_at",
          "currency",
          "error",
          "estimated_cost",
          "id",
          "input",
          "is_llm",
          "missing",
          "model",
          "outputs",
          "started_at",
          "status"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "model": {
            "type": "string"
          },
          "is_llm": {
            "type": "boolean"
          },
          "status": {
            "enum": [
              "queued",
              "running",
              "succeeded",
              "failed",
              "canceled",
              "awaiting_supply"
            ],
            "type": "string"
          },
          "input": {
            "type": "object",
            "nullable": true
          },
          "estimated_cost": {
            "type": "number",
            "format": "double"
          },
          "billed_cost": {
            "type": "number",
            "format": "double",
            "nullable": true
          },
          "currency": {
            "enum": [
              "EUR"
            ],
            "type": "string"
          },
          "outputs": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/HubOutputDto"
            }
          },
          "error": {
            "allOf": [
              {
                "$ref": "#/components/schemas/HubErrorDto"
              }
            ],
            "nullable": true
          },
          "missing": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "started_at": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "completed_at": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "provider": {
            "type": "string",
            "nullable": true
          },
          "batch_id": {
            "type": "string",
            "format": "uuid",
            "nullable": true
          },
          "progress": {
            "$ref": "#/components/schemas/HubProgressDto"
          }
        },
        "additionalProperties": false
      },
      "HubGenerationListDto": {
        "required": [
          "data",
          "next_cursor",
          "total_billed"
        ],
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/HubGenerationDto"
            }
          },
          "next_cursor": {
            "type": "string",
            "nullable": true
          },
          "total_billed": {
            "type": "number",
            "format": "double",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "HubMeDto": {
        "required": [
          "available",
          "balance",
          "client_id",
          "currency",
          "email",
          "key",
          "membership"
        ],
        "type": "object",
        "properties": {
          "client_id": {
            "type": "integer",
            "format": "int32"
          },
          "email": {
            "type": "string"
          },
          "membership": {
            "type": "boolean"
          },
          "balance": {
            "type": "number",
            "format": "double"
          },
          "available": {
            "type": "number",
            "format": "double"
          },
          "currency": {
            "enum": [
              "EUR"
            ],
            "type": "string"
          },
          "key": {
            "allOf": [
              {
                "$ref": "#/components/schemas/HubMeKeyDto"
              }
            ],
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "HubMeKeyDto": {
        "required": [
          "name",
          "prefix"
        ],
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "prefix": {
            "type": "string"
          }
        },
        "additionalProperties": false
      },
      "HubModelDto": {
        "required": [
          "context_length",
          "currency",
          "description",
          "id",
          "input_cost_per_million",
          "input_modalities",
          "is_llm",
          "max_output_tokens",
          "name",
          "output_cost_per_million",
          "output_modalities",
          "parameters_schema",
          "pricing_tiers",
          "supports_reasoning",
          "supports_structured_output",
          "supports_tools",
          "supports_vision"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "description": {
            "type": "string",
            "nullable": true
          },
          "input_modalities": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "nullable": true
          },
          "output_modalities": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "nullable": true
          },
          "currency": {
            "enum": [
              "EUR"
            ],
            "type": "string"
          },
          "is_llm": {
            "type": "boolean"
          },
          "parameters_schema": {
            "type": "object",
            "nullable": true
          },
          "pricing_tiers": {
            "type": "array",
            "items": {
              "type": "object"
            },
            "nullable": true
          },
          "input_cost_per_million": {
            "type": "number",
            "format": "double",
            "nullable": true
          },
          "output_cost_per_million": {
            "type": "number",
            "format": "double",
            "nullable": true
          },
          "context_length": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "max_output_tokens": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "supports_vision": {
            "type": "boolean"
          },
          "supports_tools": {
            "type": "boolean"
          },
          "supports_structured_output": {
            "type": "boolean"
          },
          "supports_reasoning": {
            "type": "boolean"
          }
        },
        "additionalProperties": false
      },
      "HubModelDtoHubListDto": {
        "required": [
          "data"
        ],
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/HubModelDto"
            }
          }
        },
        "additionalProperties": false
      },
      "HubOutputDto": {
        "required": [
          "index"
        ],
        "type": "object",
        "properties": {
          "index": {
            "type": "integer",
            "format": "int32"
          },
          "media_type": {
            "type": "string",
            "nullable": true
          },
          "url": {
            "type": "string",
            "nullable": true
          },
          "sha256": {
            "type": "string",
            "nullable": true
          },
          "size": {
            "type": "integer",
            "format": "int64",
            "nullable": true
          },
          "expires_at": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "data": {
            "type": "object",
            "nullable": true
          },
          "file_name": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "HubPricingDto": {
        "required": [
          "currency",
          "estimated_cost"
        ],
        "type": "object",
        "properties": {
          "estimated_cost": {
            "type": "number",
            "format": "double"
          },
          "currency": {
            "enum": [
              "EUR"
            ],
            "type": "string"
          },
          "unit_cost": {
            "type": "number",
            "format": "double",
            "nullable": true
          },
          "quantity": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "cold_start": {
            "$ref": "#/components/schemas/HubColdStartDto"
          },
          "estimated_duration_s": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "queue": {
            "$ref": "#/components/schemas/HubQueueDto"
          },
          "message": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "HubPricingRequest": {
        "type": "object",
        "properties": {
          "input": {
            "type": "object",
            "nullable": true
          },
          "quantity": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "HubProgressDto": {
        "type": "object",
        "properties": {
          "percent": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "phase": {
            "type": "string",
            "nullable": true
          },
          "eta_s": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "HubQueueDto": {
        "type": "object",
        "properties": {
          "pending_ahead": {
            "type": "integer",
            "format": "int32"
          },
          "machines_alive": {
            "type": "integer",
            "format": "int32"
          },
          "machines_booting": {
            "type": "integer",
            "format": "int32"
          },
          "estimated_wait_s": {
            "type": "integer",
            "format": "int32"
          }
        },
        "additionalProperties": false
      },
      "WebhookEndpointDto": {
        "required": [
          "created_at",
          "events",
          "id",
          "last_error",
          "secret",
          "url"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "url": {
            "type": "string"
          },
          "events": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "last_error": {
            "type": "string",
            "nullable": true
          },
          "secret": {
            "type": "string"
          }
        },
        "additionalProperties": false
      }
    },
    "securitySchemes": {
      "Bearer": {
        "type": "http",
        "description": "Fanify API key.",
        "scheme": "bearer",
        "bearerFormat": "fanify_sk_..."
      },
      "ConsoleSession": {
        "type": "apiKey",
        "description": "Fanify console session. X-Requested-With: XMLHttpRequest is also required.",
        "name": ".AspNetCore.Cookies",
        "in": "cookie"
      }
    }
  }
}