{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/hydracept-com/json-schema/hydracept-com-hydracept-job-schema.json",
  "title": "HydraceptJob",
  "x-generated": "2026-10-30",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/hydracept-com-openapi.json#/components/schemas/HydraceptJob",
  "properties": {
    "jobId": {
      "type": "string",
      "title": "Jobid"
    },
    "capabilityKey": {
      "type": "string",
      "title": "Capabilitykey"
    },
    "status": {
      "$ref": "#/$defs/HydraceptJobStatus"
    },
    "projectId": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Projectid"
    },
    "productId": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Productid"
    },
    "externalRef": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Externalref"
    },
    "tags": {
      "items": {
        "type": "string"
      },
      "type": "array",
      "title": "Tags"
    },
    "metadata": {
      "additionalProperties": true,
      "type": "object",
      "title": "Metadata"
    },
    "createdAt": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ],
      "title": "Createdat"
    },
    "completedAt": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ],
      "title": "Completedat"
    },
    "estimatedCost": {
      "anyOf": [
        {
          "type": "number"
        },
        {
          "type": "null"
        }
      ],
      "title": "Estimatedcost"
    },
    "actualCost": {
      "anyOf": [
        {
          "type": "number"
        },
        {
          "type": "null"
        }
      ],
      "title": "Actualcost",
      "description": "Provider cost when the receipt has evidence for it; null when unknown. Never the customer charge (that is pricing.charge.customerCharge) and never a fabricated 0."
    },
    "pricing": {
      "anyOf": [
        {
          "$ref": "#/$defs/HydraceptReceiptPricing"
        },
        {
          "type": "null"
        }
      ],
      "description": "Canonical terminal pricing once a receipt is sealed: charge (customer) and providerCost (provider cost evidence) as distinct dimensions."
    },
    "currency": {
      "type": "string",
      "title": "Currency",
      "default": "USD"
    },
    "artifacts": {
      "items": {
        "$ref": "#/$defs/HydraceptJobArtifactRef"
      },
      "type": "array",
      "title": "Artifacts"
    },
    "variantSet": {
      "anyOf": [
        {
          "$ref": "#/$defs/HydraceptVariantSet"
        },
        {
          "type": "null"
        }
      ]
    },
    "receiptId": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Receiptid"
    },
    "primaryArtifactId": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Primaryartifactid"
    },
    "typedOutput": {
      "anyOf": [
        {},
        {
          "type": "null"
        }
      ],
      "title": "Typedoutput"
    },
    "warnings": {
      "items": {
        "additionalProperties": true,
        "type": "object"
      },
      "type": "array",
      "title": "Warnings"
    },
    "error": {
      "anyOf": [
        {
          "additionalProperties": true,
          "type": "object"
        },
        {
          "type": "null"
        }
      ],
      "title": "Error"
    },
    "progress": {
      "anyOf": [
        {
          "$ref": "#/$defs/HydraceptJobProgress"
        },
        {
          "type": "null"
        }
      ],
      "description": "Latest projection of the job's job.progress events; absent until one exists."
    },
    "diagnostics": {
      "anyOf": [
        {
          "$ref": "#/$defs/HydraceptJobDiagnostics"
        },
        {
          "type": "null"
        }
      ]
    },
    "requestSnapshot": {
      "anyOf": [
        {
          "additionalProperties": true,
          "type": "object"
        },
        {
          "type": "null"
        }
      ],
      "title": "Requestsnapshot",
      "description": "Canonical submitted request for rerunning the same inputs in Studio (not the sealed receipt)."
    },
    "nextAction": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Nextaction"
    },
    "pollAfterSeconds": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "title": "Pollafterseconds"
    },
    "retry": {
      "anyOf": [
        {
          "additionalProperties": true,
          "type": "object"
        },
        {
          "type": "null"
        }
      ],
      "title": "Retry"
    },
    "approval": {
      "anyOf": [
        {
          "additionalProperties": true,
          "type": "object"
        },
        {
          "type": "null"
        }
      ],
      "title": "Approval",
      "description": "Sanitized human-gate payload. Present only while the job awaits approval."
    }
  },
  "type": "object",
  "required": [
    "jobId",
    "capabilityKey",
    "status"
  ],
  "$defs": {
    "CredentialPricingMode": {
      "type": "string",
      "enum": [
        "byok",
        "managed"
      ],
      "title": "CredentialPricingMode"
    },
    "CustomerCharge": {
      "properties": {
        "upstreamMicros": {
          "type": "integer",
          "title": "Upstreammicros"
        },
        "hydraceptFeeMicros": {
          "type": "integer",
          "title": "Hydraceptfeemicros"
        },
        "customerTotalMicros": {
          "type": "integer",
          "title": "Customertotalmicros"
        },
        "currency": {
          "type": "string",
          "title": "Currency",
          "default": "USD"
        },
        "lineItems": {
          "items": {
            "$ref": "#/$defs/PricingLineItem"
          },
          "type": "array",
          "title": "Lineitems"
        }
      },
      "type": "object",
      "required": [
        "upstreamMicros",
        "hydraceptFeeMicros",
        "customerTotalMicros"
      ],
      "title": "CustomerCharge"
    },
    "HydraceptJobArtifactRef": {
      "properties": {
        "artifactId": {
          "type": "string",
          "title": "Artifactid"
        },
        "mediaType": {
          "type": "string",
          "title": "Mediatype"
        },
        "kind": {
          "type": "string",
          "title": "Kind"
        },
        "downloadPath": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Downloadpath"
        },
        "sha256": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Sha256"
        },
        "exportSha256": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Exportsha256",
          "description": "SHA-256 of default export bytes (neutral generator metadata) when they differ from sha256."
        },
        "byteLength": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "title": "Bytelength"
        },
        "variantIndex": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "title": "Variantindex"
        },
        "slotStatus": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Slotstatus"
        },
        "selected": {
          "anyOf": [
            {
              "type": "boolean"
            },
            {
              "type": "null"
            }
          ],
          "title": "Selected"
        },
        "label": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Label"
        },
        "filename": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Filename"
        },
        "sliceCellId": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Slicecellid"
        }
      },
      "type": "object",
      "required": [
        "artifactId",
        "mediaType",
        "kind"
      ],
      "title": "HydraceptJobArtifactRef"
    },
    "HydraceptJobDiagnostics": {
      "properties": {
        "backendKind": {
          "type": "string",
          "title": "Backendkind"
        },
        "backendState": {
          "type": "string",
          "title": "Backendstate"
        },
        "backendId": {
          "type": "string",
          "title": "Backendid"
        }
      },
      "type": "object",
      "required": [
        "backendKind",
        "backendState",
        "backendId"
      ],
      "title": "HydraceptJobDiagnostics"
    },
    "HydraceptJobProgress": {
      "properties": {
        "phase": {
          "type": "string",
          "title": "Phase"
        },
        "step": {
          "type": "string",
          "title": "Step"
        },
        "percent": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "title": "Percent"
        },
        "etaSeconds": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "title": "Etaseconds"
        },
        "updatedAt": {
          "type": "string",
          "format": "date-time",
          "title": "Updatedat"
        }
      },
      "type": "object",
      "required": [
        "phase",
        "step",
        "updatedAt"
      ],
      "title": "HydraceptJobProgress",
      "description": "Where a durable job has reached, as reported by the activity that owns the work.\n\n``updatedAt`` is required whenever progress is present, so a reader can always tell\nhow fresh the projection is. ``percent`` and ``etaSeconds`` are optional on purpose:\nthey are present only when the authority (a provider that reports them) can compute\nthem. Unknown values are omitted rather than defaulted to ``0``."
    },
    "HydraceptJobStatus": {
      "type": "string",
      "enum": [
        "queued",
        "running",
        "awaiting_approval",
        "succeeded",
        "failed",
        "canceling",
        "canceled",
        "needs_attention"
      ],
      "title": "HydraceptJobStatus"
    },
    "HydraceptReceiptHydracept": {
      "properties": {
        "serviceFeeRateBps": {
          "type": "integer",
          "title": "Servicefeeratebps",
          "default": 0
        },
        "inferenceFeeMicros": {
          "type": "integer",
          "title": "Inferencefeemicros",
          "default": 0
        }
      },
      "type": "object",
      "title": "HydraceptReceiptHydracept"
    },
    "HydraceptReceiptPricing": {
      "properties": {
        "quote": {
          "anyOf": [
            {
              "$ref": "#/$defs/ReceiptQuote"
            },
            {
              "type": "null"
            }
          ]
        },
        "charge": {
          "anyOf": [
            {
              "$ref": "#/$defs/ReceiptCharge"
            },
            {
              "type": "null"
            }
          ]
        },
        "providerUsage": {
          "anyOf": [
            {
              "$ref": "#/$defs/ReceiptProviderUsage"
            },
            {
              "type": "null"
            }
          ]
        },
        "providerCost": {
          "anyOf": [
            {
              "$ref": "#/$defs/ReceiptProviderCost"
            },
            {
              "type": "null"
            }
          ]
        },
        "policy": {
          "anyOf": [
            {
              "$ref": "#/$defs/ReceiptPricingPolicy"
            },
            {
              "type": "null"
            }
          ]
        },
        "presentation": {
          "anyOf": [
            {
              "$ref": "#/$defs/PresentationMoney"
            },
            {
              "type": "null"
            }
          ]
        },
        "mode": {
          "anyOf": [
            {
              "$ref": "#/$defs/CredentialPricingMode"
            },
            {
              "type": "null"
            }
          ]
        },
        "estimatedProviderPriceBasisMicros": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "title": "Estimatedproviderpricebasismicros"
        },
        "observedUsage": {
          "anyOf": [
            {
              "additionalProperties": true,
              "type": "object"
            },
            {
              "type": "null"
            }
          ],
          "title": "Observedusage"
        },
        "hydraceptInferenceFeeMicros": {
          "type": "integer",
          "title": "Hydraceptinferencefeemicros",
          "default": 0
        },
        "providerReportedCostMicros": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "title": "Providerreportedcostmicros"
        },
        "customerCharge": {
          "anyOf": [
            {
              "$ref": "#/$defs/CustomerCharge"
            },
            {
              "type": "null"
            }
          ]
        },
        "hydracept": {
          "anyOf": [
            {
              "$ref": "#/$defs/HydraceptReceiptHydracept"
            },
            {
              "type": "null"
            }
          ]
        },
        "executionPlanId": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Executionplanid"
        },
        "pricingSnapshotIds": {
          "items": {
            "type": "string"
          },
          "type": "array",
          "title": "Pricingsnapshotids"
        },
        "quoteId": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Quoteid"
        },
        "estimateId": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Estimateid",
          "description": "Inbound/outbound alias of quoteId. Prefer quoteId and pricing.quote."
        },
        "pricingVersion": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Pricingversion"
        },
        "pricingInputFingerprint": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Pricinginputfingerprint"
        },
        "resolvedRoute": {
          "anyOf": [
            {
              "additionalProperties": true,
              "type": "object"
            },
            {
              "type": "null"
            }
          ],
          "title": "Resolvedroute"
        },
        "estimatedCharge": {
          "anyOf": [
            {
              "additionalProperties": true,
              "type": "object"
            },
            {
              "type": "null"
            }
          ],
          "title": "Estimatedcharge"
        },
        "maximumAuthorizedCharge": {
          "anyOf": [
            {
              "additionalProperties": true,
              "type": "object"
            },
            {
              "type": "null"
            }
          ],
          "title": "Maximumauthorizedcharge"
        },
        "actualCharge": {
          "anyOf": [
            {
              "additionalProperties": true,
              "type": "object"
            },
            {
              "type": "null"
            }
          ],
          "title": "Actualcharge"
        },
        "price": {
          "anyOf": [
            {
              "$ref": "#/$defs/Money"
            },
            {
              "type": "null"
            }
          ],
          "description": "Retail price of the capability for this execution. Independent of wallet debit."
        },
        "basisEstimated": {
          "anyOf": [
            {
              "additionalProperties": true,
              "type": "object"
            },
            {
              "type": "null"
            }
          ],
          "title": "Basisestimated"
        },
        "basisActual": {
          "anyOf": [
            {
              "additionalProperties": true,
              "type": "object"
            },
            {
              "type": "null"
            }
          ],
          "title": "Basisactual"
        },
        "fundingSource": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Fundingsource"
        },
        "trialCoveredMicros": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "title": "Trialcoveredmicros"
        },
        "customerDebitedMicros": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "title": "Customerdebitedmicros"
        },
        "actualChargeMicros": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "title": "Actualchargemicros"
        }
      },
      "type": "object",
      "title": "HydraceptReceiptPricing",
      "description": "Canonical pricing on a receipt. Legacy micros fields remain for compatibility."
    },
    "HydraceptVariantSet": {
      "properties": {
        "schemaVersion": {
          "type": "string",
          "title": "Schemaversion",
          "default": "hydracept.variant-set.v1"
        },
        "requestedCount": {
          "type": "integer",
          "title": "Requestedcount"
        },
        "completedCount": {
          "type": "integer",
          "title": "Completedcount"
        },
        "failedCount": {
          "type": "integer",
          "title": "Failedcount"
        },
        "selectedArtifactId": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Selectedartifactid"
        }
      },
      "type": "object",
      "required": [
        "requestedCount",
        "completedCount",
        "failedCount"
      ],
      "title": "HydraceptVariantSet"
    },
    "Money": {
      "properties": {
        "amountMicros": {
          "type": "integer",
          "title": "Amountmicros"
        },
        "currency": {
          "type": "string",
          "title": "Currency"
        },
        "amountMinor": {
          "type": "integer",
          "title": "Amountminor"
        },
        "display": {
          "type": "string",
          "title": "Display"
        }
      },
      "type": "object",
      "required": [
        "amountMicros",
        "currency",
        "amountMinor",
        "display"
      ],
      "title": "Money",
      "description": "Hydracept price before transactional tax. ``amountMicros`` is authority."
    },
    "PresentationMoney": {
      "properties": {
        "convertedTotal": {
          "$ref": "#/$defs/Money"
        },
        "fx": {
          "$ref": "#/$defs/ScaledFxRate"
        }
      },
      "type": "object",
      "required": [
        "convertedTotal",
        "fx"
      ],
      "title": "PresentationMoney",
      "description": "Optional converted display of a charge. Not part of the financial receipt."
    },
    "PricingLineItem": {
      "properties": {
        "label": {
          "type": "string",
          "title": "Label"
        },
        "upstreamMicros": {
          "type": "integer",
          "title": "Upstreammicros"
        },
        "hydraceptFeeMicros": {
          "type": "integer",
          "title": "Hydraceptfeemicros",
          "default": 0
        },
        "includedProcessing": {
          "type": "boolean",
          "title": "Includedprocessing",
          "default": false
        }
      },
      "type": "object",
      "required": [
        "label",
        "upstreamMicros"
      ],
      "title": "PricingLineItem"
    },
    "ProviderCostBearer": {
      "type": "string",
      "enum": [
        "hydracept",
        "customer",
        "none",
        "unknown"
      ],
      "title": "ProviderCostBearer"
    },
    "QuoteKind": {
      "type": "string",
      "enum": [
        "fixed",
        "estimate",
        "range"
      ],
      "title": "QuoteKind"
    },
    "ReceiptCharge": {
      "properties": {
        "customerCharge": {
          "$ref": "#/$defs/Money",
          "description": "Amount the customer owes Hydracept for this execution. $0 when Hydracept covers it."
        },
        "customerDebit": {
          "anyOf": [
            {
              "$ref": "#/$defs/Money"
            },
            {
              "type": "null"
            }
          ],
          "description": "Amount actually removed from a customer-visible stored balance."
        },
        "chargedAt": {
          "anyOf": [
            {
              "type": "string",
              "format": "date-time"
            },
            {
              "type": "null"
            }
          ],
          "title": "Chargedat"
        }
      },
      "type": "object",
      "required": [
        "customerCharge"
      ],
      "title": "ReceiptCharge"
    },
    "ReceiptPricingPolicy": {
      "properties": {
        "serviceFeeBps": {
          "type": "integer",
          "title": "Servicefeebps",
          "default": 0
        },
        "pricingMode": {
          "$ref": "#/$defs/CredentialPricingMode"
        }
      },
      "type": "object",
      "required": [
        "pricingMode"
      ],
      "title": "ReceiptPricingPolicy"
    },
    "ReceiptProviderCost": {
      "properties": {
        "amount": {
          "anyOf": [
            {
              "$ref": "#/$defs/Money"
            },
            {
              "type": "null"
            }
          ]
        },
        "status": {
          "type": "string",
          "title": "Status",
          "default": "unknown"
        },
        "basis": {
          "type": "string",
          "title": "Basis",
          "default": "unknown"
        },
        "priceScheduleId": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Pricescheduleid"
        }
      },
      "type": "object",
      "title": "ReceiptProviderCost",
      "description": "Provider cost evidence. ``amount`` is null when unknown — never ``0``.\n\n``basis``/``status`` explain how the amount was obtained; a usage-priced cost\nnames the pinned ``priceScheduleId`` so a later catalog change cannot silently\nrewrite historical provider cost."
    },
    "ReceiptProviderUsage": {
      "properties": {
        "reportedCost": {
          "anyOf": [
            {
              "$ref": "#/$defs/Money"
            },
            {
              "type": "null"
            }
          ]
        },
        "costBearer": {
          "$ref": "#/$defs/ProviderCostBearer",
          "default": "unknown"
        }
      },
      "type": "object",
      "title": "ReceiptProviderUsage"
    },
    "ReceiptQuote": {
      "properties": {
        "quoteId": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Quoteid"
        },
        "kind": {
          "$ref": "#/$defs/QuoteKind",
          "default": "fixed"
        },
        "chargeBasis": {
          "anyOf": [
            {
              "$ref": "#/$defs/Money"
            },
            {
              "type": "null"
            }
          ]
        },
        "serviceFee": {
          "anyOf": [
            {
              "$ref": "#/$defs/Money"
            },
            {
              "type": "null"
            }
          ]
        },
        "customerTotal": {
          "anyOf": [
            {
              "$ref": "#/$defs/Money"
            },
            {
              "type": "null"
            }
          ]
        },
        "maximumCustomerTotal": {
          "anyOf": [
            {
              "$ref": "#/$defs/Money"
            },
            {
              "type": "null"
            }
          ]
        },
        "expiresAt": {
          "anyOf": [
            {
              "type": "string",
              "format": "date-time"
            },
            {
              "type": "null"
            }
          ],
          "title": "Expiresat"
        },
        "pricingInputsHash": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Pricinginputshash"
        }
      },
      "type": "object",
      "title": "ReceiptQuote"
    },
    "ScaledFxRate": {
      "properties": {
        "rateScaled": {
          "type": "integer",
          "title": "Ratescaled"
        },
        "scale": {
          "type": "integer",
          "title": "Scale",
          "default": 8
        },
        "baseCurrency": {
          "type": "string",
          "title": "Basecurrency"
        },
        "quoteCurrency": {
          "type": "string",
          "title": "Quotecurrency"
        },
        "source": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Source"
        },
        "asOf": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Asof"
        }
      },
      "type": "object",
      "required": [
        "rateScaled",
        "baseCurrency",
        "quoteCurrency"
      ],
      "title": "ScaledFxRate",
      "description": "FX snapshot using scaled integers — never IEEE binary floats."
    }
  }
}