{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/openmayhem-ai/json-schema/openmayhem-ai-job-schema.json",
  "title": "Job",
  "x-generated": "2026-11-20",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/openmayhem-ai-openapi.json#/components/schemas/Job",
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "status": {
      "type": "string",
      "enum": [
        "submitted",
        "running",
        "reconciling",
        "completed",
        "failed",
        "cancelled"
      ]
    },
    "polling_url": {
      "type": "string"
    },
    "cost": {
      "type": "string",
      "description": "USD, set once settled."
    },
    "retail_cost_limit": {
      "type": [
        "string",
        "null"
      ],
      "description": "Effective per-request retail USD cap after combining request and API-key limits."
    },
    "routing": {
      "type": "object",
      "description": "Validated routing controls frozen when the job was submitted.",
      "additionalProperties": true
    },
    "artifacts": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "content_type": {
            "type": "string"
          },
          "size_bytes": {
            "type": "integer"
          }
        }
      }
    }
  }
}