openapi: 3.1.0 info: title: Civitai Orchestration Blobs ModelVersions API version: v2 description: 'Submit AI generation workflows — image, video, audio, language, and LoRA training — through a single contract. The Orchestration API races multiple providers and engines behind one workflow surface and delivers results via webhooks or polling. Authenticate with a Bearer token issued at civitai.com. ' contact: name: Civitai Developer Support url: https://developer.civitai.com/orchestration/ termsOfService: https://civitai.com/content/tos license: name: Civitai Terms of Service url: https://civitai.com/content/tos servers: - url: https://orchestration.civitai.com description: Civitai Orchestration API security: - BearerAuth: [] tags: - name: ModelVersions description: Specific versions of a model with files, hashes, and AIR identifiers. paths: /model-versions/{id}: get: operationId: getModelVersion summary: Get Model Version tags: - ModelVersions parameters: - name: id in: path required: true schema: type: integer responses: '200': description: Model version detail. content: application/json: schema: $ref: '#/components/schemas/ModelVersion' '404': $ref: '#/components/responses/NotFound' /model-versions/mini/{id}: get: operationId: getModelVersionMini summary: Get Model Version Mini tags: - ModelVersions description: Lightweight model-version payload optimized for client tools. parameters: - name: id in: path required: true schema: type: integer responses: '200': description: Lightweight model version. content: application/json: schema: $ref: '#/components/schemas/ModelVersionMini' /model-versions/by-hash/{hash}: get: operationId: getModelVersionByHash summary: Get Model Version By Hash tags: - ModelVersions parameters: - name: hash in: path required: true schema: type: string description: AutoV1, AutoV2, SHA256, CRC32, or Blake3 hash of the model file. responses: '200': description: Model version matching the file hash. content: application/json: schema: $ref: '#/components/schemas/ModelVersion' '404': $ref: '#/components/responses/NotFound' /model-versions/by-hash: post: operationId: getModelVersionsByHashes summary: Get Model Versions By Hashes tags: - ModelVersions requestBody: required: true content: application/json: schema: type: array items: type: string responses: '200': description: Map of hash to model version. content: application/json: schema: type: array items: $ref: '#/components/schemas/ModelVersion' /model-versions/by-hash/ids: post: operationId: getModelVersionIdsByHashes summary: Get Model Version IDs By Hashes tags: - ModelVersions requestBody: required: true content: application/json: schema: type: array items: type: string responses: '200': description: Map of hash to model version ID. content: application/json: schema: type: object additionalProperties: type: integer components: schemas: ModelVersion: type: object properties: id: type: integer modelId: type: integer name: type: string baseModel: type: string description: e.g. SD 1.5, SDXL 1.0, Flux.1 D baseModelType: type: string createdAt: type: string format: date-time updatedAt: type: string format: date-time publishedAt: type: string format: date-time trainedWords: type: array items: type: string air: type: string description: AI Resource Identifier, e.g. urn:air:sdxl:lora:civitai:12345@67890 downloadUrl: type: string format: uri files: type: array items: $ref: '#/components/schemas/ModelFile' images: type: array items: $ref: '#/components/schemas/Image' stats: $ref: '#/components/schemas/Stats' ModelFile: type: object properties: id: type: integer name: type: string sizeKB: type: number type: type: string enum: - Model - VAE - Config - Negative - Training Data - Archive - Other format: type: string enum: - SafeTensor - PickleTensor - Other pickleScanResult: type: string virusScanResult: type: string scannedAt: type: string format: date-time downloadUrl: type: string format: uri hashes: type: object properties: AutoV1: type: string AutoV2: type: string SHA256: type: string CRC32: type: string Blake3: type: string Image: type: object properties: id: type: integer url: type: string format: uri hash: type: string width: type: integer height: type: integer nsfwLevel: type: integer nsfw: type: boolean createdAt: type: string format: date-time postId: type: integer stats: $ref: '#/components/schemas/Stats' meta: type: object additionalProperties: true username: type: string ModelVersionMini: type: object properties: id: type: integer modelId: type: integer name: type: string baseModel: type: string air: type: string downloadUrl: type: string format: uri Error: type: object properties: error: type: string message: type: string code: type: string Stats: type: object properties: downloadCount: type: integer favoriteCount: type: integer commentCount: type: integer ratingCount: type: integer rating: type: number thumbsUpCount: type: integer thumbsDownCount: type: integer responses: NotFound: description: Resource not found. content: application/json: schema: $ref: '#/components/schemas/Error' securitySchemes: BearerAuth: type: http scheme: bearer bearerFormat: token description: Personal API token issued at https://civitai.com/user/account.