{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/huggingbay-xyz/json-schema/huggingbay-xyz-task-execution-response-schema.json",
  "title": "TaskExecutionResponse",
  "description": "Explicit response contract for an execution and its receipt envelope.",
  "x-generated": "2026-10-30",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/huggingbay-xyz-run-openapi.json#/components/schemas/TaskExecutionResponse",
  "properties": {
    "schema": {
      "type": "string",
      "title": "Schema",
      "default": "bay-run.task-execution.v1"
    },
    "execution_id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Execution Id"
    },
    "quote_id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Quote Id"
    },
    "task_profile_id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Task Profile Id"
    },
    "status": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Status"
    },
    "output": {
      "title": "Output"
    },
    "actual_price_usd": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Actual Price Usd"
    },
    "actual_latency_ms": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "title": "Actual Latency Ms"
    },
    "provider": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Provider"
    },
    "model": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Model"
    },
    "model_version": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Model Version"
    },
    "route": {
      "additionalProperties": true,
      "type": "object",
      "title": "Route"
    },
    "fallback_route": {
      "anyOf": [
        {
          "additionalProperties": true,
          "type": "object"
        },
        {
          "type": "null"
        }
      ],
      "title": "Fallback Route"
    },
    "quality": {
      "title": "Quality"
    },
    "payment_status": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Payment Status"
    },
    "payment_receipt": {
      "anyOf": [
        {
          "additionalProperties": true,
          "type": "object"
        },
        {
          "type": "null"
        }
      ],
      "title": "Payment Receipt"
    },
    "data_retention": {
      "anyOf": [
        {
          "type": "string",
          "enum": [
            "none",
            "execution_metadata",
            "task_profile"
          ]
        },
        {
          "type": "null"
        }
      ],
      "title": "Data Retention"
    },
    "input_hash": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Input Hash"
    },
    "replayed": {
      "anyOf": [
        {
          "type": "boolean"
        },
        {
          "type": "null"
        }
      ],
      "title": "Replayed"
    },
    "execution_receipt": {
      "anyOf": [
        {
          "additionalProperties": true,
          "type": "object"
        },
        {
          "type": "null"
        }
      ],
      "title": "Execution Receipt"
    },
    "output_retained": {
      "anyOf": [
        {
          "type": "boolean"
        },
        {
          "type": "null"
        }
      ],
      "title": "Output Retained"
    },
    "learning": {
      "anyOf": [
        {
          "additionalProperties": true,
          "type": "object"
        },
        {
          "type": "null"
        }
      ],
      "title": "Learning"
    },
    "next_call": {
      "anyOf": [
        {
          "additionalProperties": true,
          "type": "object"
        },
        {
          "type": "null"
        }
      ],
      "title": "Next Call",
      "description": "Machine-readable verification call for the returned execution, when available."
    },
    "durable_free_key": {
      "anyOf": [
        {
          "additionalProperties": true,
          "type": "object"
        },
        {
          "type": "null"
        }
      ],
      "title": "Durable Free Key",
      "description": "Email-free durable-key offer with its published daily task quota."
    }
  },
  "additionalProperties": true,
  "type": "object",
  "required": [
    "schema",
    "execution_id",
    "quote_id",
    "status",
    "output",
    "actual_price_usd",
    "actual_latency_ms",
    "payment_status",
    "replayed"
  ]
}