{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/neurall-io/json-schema/neurall-io-generation-schema.json",
  "title": "Generation",
  "description": "An async generation. `status` moves from `pending` through `running` to `done`, `error` or `timeout`; once done, `output` holds the asset as a signed URL named by the kind (image, video or audio) plus its `mime`.",
  "x-generated": "2026-10-31",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/neurall-io-openapi.json#/components/schemas/Generation",
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "projectId": {
      "type": "string"
    },
    "feature": {
      "type": "string"
    },
    "kind": {
      "type": "string",
      "enum": [
        "image",
        "video",
        "audio",
        "text"
      ]
    },
    "status": {
      "type": "string",
      "enum": [
        "pending",
        "running",
        "done",
        "timeout",
        "error"
      ]
    },
    "title": {
      "type": "string"
    },
    "params": {
      "type": "object",
      "description": "The submitted args (echoed back)"
    },
    "output": {
      "type": "object",
      "description": "Set once status is done. The finished asset is served under the generation's kind, mirroring the args side: exactly one of image, video or audio is present.",
      "properties": {
        "image": {
          "type": "string",
          "description": "URL of the result (kind image)"
        },
        "video": {
          "type": "string",
          "description": "URL of the result (kind video)"
        },
        "audio": {
          "type": "string",
          "description": "URL of the result (kind audio)"
        },
        "mime": {
          "type": "string",
          "description": "Media type of the result"
        }
      }
    },
    "error": {
      "type": "string"
    },
    "balanceUsed": {
      "type": "number"
    },
    "requestDate": {
      "type": "string",
      "format": "date-time"
    },
    "responseDate": {
      "type": "string",
      "format": "date-time"
    },
    "expiresAt": {
      "type": "string",
      "format": "date-time",
      "description": "API-created generations only: when the generation and its assets are deleted, 24 hours after the request. Absent on generations made in the app, which stay in its library."
    }
  }
}