{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/frameo-ai/json-schema/frameo-ai-generation-schema.json",
  "title": "Generation",
  "x-generated": "2026-11-09",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/frameo-ai-openapi.json#/components/schemas/Generation",
  "properties": {
    "id": {
      "type": "string",
      "title": "Id"
    },
    "object": {
      "type": "string",
      "const": "generation",
      "title": "Object",
      "default": "generation"
    },
    "type": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Type",
      "description": "video or image"
    },
    "model": {
      "type": "string",
      "title": "Model"
    },
    "status": {
      "type": "string",
      "enum": [
        "queued",
        "running",
        "succeeded",
        "failed",
        "cancelled"
      ],
      "title": "Status"
    },
    "created_at": {
      "type": "string",
      "title": "Created At"
    },
    "updated_at": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Updated At"
    },
    "outputs": {
      "items": {
        "$ref": "#/$defs/Output"
      },
      "type": "array",
      "title": "Outputs",
      "description": "Filled once the generation has succeeded."
    },
    "credits": {
      "anyOf": [
        {
          "$ref": "#/$defs/Credits"
        },
        {
          "type": "null"
        }
      ],
      "description": "Null until the first charge lands."
    },
    "error": {
      "anyOf": [
        {
          "$ref": "#/$defs/GenerationError"
        },
        {
          "type": "null"
        }
      ],
      "description": "Set when the generation failed."
    },
    "draft": {
      "anyOf": [
        {
          "$ref": "#/$defs/DraftInfo"
        },
        {
          "type": "null"
        }
      ],
      "description": "Set for a draft-mode video; null otherwise."
    },
    "metadata": {
      "additionalProperties": {
        "type": "string"
      },
      "type": "object",
      "title": "Metadata",
      "description": "Your own key/value pairs, as sent."
    }
  },
  "type": "object",
  "required": [
    "id",
    "type",
    "model",
    "status",
    "created_at",
    "outputs",
    "credits",
    "error",
    "metadata"
  ],
  "$defs": {
    "Credits": {
      "properties": {
        "charged": {
          "type": "integer",
          "title": "Charged",
          "description": "Net credits charged: debits less refunds."
        },
        "standard": {
          "type": "integer",
          "title": "Standard",
          "description": "The same at list price, before the workspace's overrides."
        }
      },
      "type": "object",
      "required": [
        "charged",
        "standard"
      ],
      "title": "Credits"
    },
    "DraftInfo": {
      "properties": {
        "mode": {
          "type": "string",
          "enum": [
            "draft",
            "finalize"
          ],
          "title": "Mode",
          "description": "draft: a preview render; finalize: the full render of one draft."
        }
      },
      "type": "object",
      "required": [
        "mode"
      ],
      "title": "DraftInfo"
    },
    "GenerationError": {
      "properties": {
        "code": {
          "type": "string",
          "title": "Code"
        },
        "message": {
          "type": "string",
          "title": "Message"
        }
      },
      "type": "object",
      "required": [
        "code",
        "message"
      ],
      "title": "GenerationError"
    },
    "Output": {
      "properties": {
        "type": {
          "type": "string",
          "title": "Type",
          "description": "video or image"
        },
        "url": {
          "type": "string",
          "title": "Url",
          "description": "Ready to download. A private file comes back signed for an hour."
        },
        "width": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "title": "Width"
        },
        "height": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "title": "Height"
        },
        "duration_seconds": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "title": "Duration Seconds"
        }
      },
      "type": "object",
      "required": [
        "type",
        "url"
      ],
      "title": "Output"
    }
  }
}