{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/everyn-ai/json-schema/everyn-ai-callable-history-response-schema.json",
  "title": "CallableHistoryResponse",
  "x-generated": "2026-11-07",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/everyn-ai-openapi.json#/components/schemas/CallableHistoryResponse",
  "additionalProperties": false,
  "properties": {
    "action": {
      "anyOf": [
        {
          "$ref": "#/$defs/CallableActionResponse"
        },
        {
          "type": "null"
        }
      ]
    },
    "billingIngestCompletedAt": {
      "anyOf": [
        {
          "description": "UTC RFC 3339 timestamp string.",
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Billingingestcompletedat"
    },
    "billingStatus": {
      "enum": [
        "not_started",
        "settling",
        "settled"
      ],
      "title": "Billingstatus",
      "type": "string"
    },
    "completedAt": {
      "anyOf": [
        {
          "description": "UTC RFC 3339 timestamp string.",
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Completedat"
    },
    "createdAt": {
      "description": "UTC RFC 3339 timestamp string.",
      "title": "Createdat",
      "type": "string"
    },
    "deploymentId": {
      "minLength": 1,
      "title": "Deploymentid",
      "type": "string"
    },
    "deploymentRevisionId": {
      "minLength": 1,
      "title": "Deploymentrevisionid",
      "type": "string"
    },
    "error": {
      "anyOf": [
        {
          "additionalProperties": true,
          "type": "object"
        },
        {
          "type": "null"
        }
      ],
      "description": "Original preparation or structured row failure after current public metadata redaction.",
      "title": "Error"
    },
    "execution": {
      "anyOf": [
        {
          "$ref": "#/$defs/CallableExecutionResponse"
        },
        {
          "type": "null"
        }
      ]
    },
    "id": {
      "minLength": 1,
      "title": "Id",
      "type": "string"
    },
    "input": {
      "additionalProperties": true,
      "description": "Original typed input; absent, null and exact decimal numeric values are preserved.",
      "title": "Input",
      "type": "object"
    },
    "inputPresence": {
      "items": {
        "type": "string"
      },
      "title": "Inputpresence",
      "type": "array"
    },
    "jobSpecVersionId": {
      "minLength": 1,
      "title": "Jobspecversionid",
      "type": "string"
    },
    "metadata": {
      "additionalProperties": {
        "type": "string"
      },
      "title": "Metadata",
      "type": "object"
    },
    "outcome": {
      "$ref": "#/$defs/CallableInvocationResponse"
    },
    "phase": {
      "enum": [
        "preparing_input",
        "awaiting_execution",
        "executing",
        "action_required",
        "finished"
      ],
      "title": "Phase",
      "type": "string"
    },
    "purpose": {
      "enum": [
        "preview",
        "production"
      ],
      "title": "Purpose",
      "type": "string"
    },
    "references": {
      "items": {
        "$ref": "#/$defs/CallableReferenceResponse"
      },
      "title": "References",
      "type": "array"
    },
    "resultAvailable": {
      "title": "Resultavailable",
      "type": "boolean"
    },
    "resultUrl": {
      "title": "Resulturl",
      "type": "string"
    },
    "startedAt": {
      "anyOf": [
        {
          "description": "UTC RFC 3339 timestamp string.",
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Startedat"
    },
    "status": {
      "enum": [
        "queued",
        "running",
        "paused",
        "succeeded",
        "completed_with_flags",
        "failed",
        "canceled"
      ],
      "title": "Status",
      "type": "string"
    },
    "statusUrl": {
      "title": "Statusurl",
      "type": "string"
    },
    "usage": {
      "anyOf": [
        {
          "$ref": "#/$defs/CallableUsageResponse"
        },
        {
          "type": "null"
        }
      ]
    },
    "webhooks": {
      "$ref": "#/$defs/CallableWebhooksResponse"
    }
  },
  "required": [
    "id",
    "deploymentId",
    "deploymentRevisionId",
    "status",
    "phase",
    "statusUrl",
    "resultUrl",
    "resultAvailable",
    "billingStatus",
    "createdAt",
    "metadata",
    "purpose",
    "jobSpecVersionId",
    "references",
    "startedAt",
    "completedAt",
    "billingIngestCompletedAt",
    "execution",
    "error",
    "action",
    "usage",
    "webhooks",
    "input",
    "inputPresence",
    "outcome"
  ],
  "type": "object",
  "$defs": {
    "CallableActionResponse": {
      "additionalProperties": false,
      "properties": {
        "statusUrl": {
          "title": "Statusurl",
          "type": "string"
        },
        "type": {
          "const": "human_recovery",
          "title": "Type",
          "type": "string"
        }
      },
      "required": [
        "type",
        "statusUrl"
      ],
      "title": "CallableActionResponse",
      "type": "object"
    },
    "CallableDeliveryCountsResponse": {
      "additionalProperties": false,
      "properties": {
        "attemptCount": {
          "minimum": 0.0,
          "title": "Attemptcount",
          "type": "integer"
        },
        "deliveryCount": {
          "minimum": 0.0,
          "title": "Deliverycount",
          "type": "integer"
        }
      },
      "required": [
        "deliveryCount",
        "attemptCount"
      ],
      "title": "CallableDeliveryCountsResponse",
      "type": "object"
    },
    "CallableExecutionResponse": {
      "additionalProperties": false,
      "properties": {
        "attemptCount": {
          "minimum": 0.0,
          "title": "Attemptcount",
          "type": "integer"
        },
        "invocationId": {
          "minLength": 1,
          "title": "Invocationid",
          "type": "string"
        },
        "recordedHistory": {
          "title": "Recordedhistory",
          "type": "boolean"
        },
        "rowState": {
          "anyOf": [
            {
              "enum": [
                "pending",
                "running",
                "succeeded",
                "flagged",
                "failed",
                "skipped"
              ],
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Rowstate"
        },
        "statusUrl": {
          "title": "Statusurl",
          "type": "string"
        }
      },
      "required": [
        "invocationId",
        "statusUrl",
        "rowState",
        "attemptCount",
        "recordedHistory"
      ],
      "title": "CallableExecutionResponse",
      "type": "object"
    },
    "CallableInvocationResponse": {
      "additionalProperties": false,
      "properties": {
        "billingStatus": {
          "enum": [
            "not_started",
            "settling",
            "settled"
          ],
          "title": "Billingstatus",
          "type": "string"
        },
        "deploymentId": {
          "minLength": 1,
          "title": "Deploymentid",
          "type": "string"
        },
        "deploymentRevisionId": {
          "minLength": 1,
          "title": "Deploymentrevisionid",
          "type": "string"
        },
        "id": {
          "minLength": 1,
          "title": "Id",
          "type": "string"
        },
        "phase": {
          "enum": [
            "preparing_input",
            "awaiting_execution",
            "executing",
            "action_required",
            "finished"
          ],
          "title": "Phase",
          "type": "string"
        },
        "resultAvailable": {
          "title": "Resultavailable",
          "type": "boolean"
        },
        "resultUrl": {
          "title": "Resulturl",
          "type": "string"
        },
        "status": {
          "enum": [
            "queued",
            "running",
            "paused",
            "succeeded",
            "completed_with_flags",
            "failed",
            "canceled"
          ],
          "title": "Status",
          "type": "string"
        },
        "statusUrl": {
          "title": "Statusurl",
          "type": "string"
        }
      },
      "required": [
        "id",
        "deploymentId",
        "deploymentRevisionId",
        "status",
        "phase",
        "statusUrl",
        "resultUrl",
        "resultAvailable",
        "billingStatus"
      ],
      "title": "CallableInvocationResponse",
      "type": "object"
    },
    "CallableModelUsageResponse": {
      "additionalProperties": false,
      "properties": {
        "failedProviderAttempts": {
          "minimum": 0.0,
          "title": "Failedproviderattempts",
          "type": "integer"
        },
        "inputTokens": {
          "minimum": 0.0,
          "title": "Inputtokens",
          "type": "integer"
        },
        "outputTokens": {
          "minimum": 0.0,
          "title": "Outputtokens",
          "type": "integer"
        },
        "providerAttempts": {
          "minimum": 0.0,
          "title": "Providerattempts",
          "type": "integer"
        },
        "successfulProviderAttempts": {
          "minimum": 0.0,
          "title": "Successfulproviderattempts",
          "type": "integer"
        },
        "totalTokens": {
          "minimum": 0.0,
          "title": "Totaltokens",
          "type": "integer"
        }
      },
      "required": [
        "inputTokens",
        "outputTokens",
        "totalTokens",
        "providerAttempts",
        "successfulProviderAttempts",
        "failedProviderAttempts"
      ],
      "title": "CallableModelUsageResponse",
      "type": "object"
    },
    "CallableReferenceResponse": {
      "additionalProperties": false,
      "properties": {
        "alias": {
          "title": "Alias",
          "type": "string"
        },
        "datasetId": {
          "minLength": 1,
          "title": "Datasetid",
          "type": "string"
        },
        "snapshotId": {
          "minLength": 1,
          "title": "Snapshotid",
          "type": "string"
        }
      },
      "required": [
        "alias",
        "datasetId",
        "snapshotId"
      ],
      "title": "CallableReferenceResponse",
      "type": "object"
    },
    "CallableUsageResponse": {
      "additionalProperties": false,
      "properties": {
        "managedAi": {
          "anyOf": [
            {
              "$ref": "#/$defs/ManagedAiUsageSummaryResponse"
            },
            {
              "type": "null"
            }
          ]
        },
        "model": {
          "anyOf": [
            {
              "$ref": "#/$defs/CallableModelUsageResponse"
            },
            {
              "type": "null"
            }
          ]
        },
        "modelSpend": {
          "anyOf": [
            {
              "$ref": "#/$defs/ProviderCostSummary"
            },
            {
              "type": "null"
            }
          ]
        }
      },
      "required": [
        "modelSpend",
        "managedAi",
        "model"
      ],
      "title": "CallableUsageResponse",
      "type": "object"
    },
    "CallableWebhookEventResponse": {
      "additionalProperties": false,
      "properties": {
        "createdAt": {
          "description": "UTC RFC 3339 timestamp string.",
          "title": "Createdat",
          "type": "string"
        },
        "id": {
          "minLength": 1,
          "title": "Id",
          "type": "string"
        },
        "transitionGeneration": {
          "minimum": 0.0,
          "title": "Transitiongeneration",
          "type": "integer"
        },
        "type": {
          "title": "Type",
          "type": "string"
        }
      },
      "required": [
        "id",
        "type",
        "transitionGeneration",
        "createdAt"
      ],
      "title": "CallableWebhookEventResponse",
      "type": "object"
    },
    "CallableWebhooksResponse": {
      "additionalProperties": false,
      "properties": {
        "attemptCount": {
          "minimum": 0.0,
          "title": "Attemptcount",
          "type": "integer"
        },
        "deliveryCount": {
          "minimum": 0.0,
          "title": "Deliverycount",
          "type": "integer"
        },
        "eventCount": {
          "minimum": 0.0,
          "title": "Eventcount",
          "type": "integer"
        },
        "latestEvent": {
          "anyOf": [
            {
              "$ref": "#/$defs/CallableWebhookEventResponse"
            },
            {
              "type": "null"
            }
          ]
        },
        "states": {
          "additionalProperties": {
            "$ref": "#/$defs/CallableDeliveryCountsResponse"
          },
          "title": "States",
          "type": "object"
        }
      },
      "required": [
        "deliveryCount",
        "attemptCount",
        "eventCount",
        "latestEvent",
        "states"
      ],
      "title": "CallableWebhooksResponse",
      "type": "object"
    },
    "ManagedAiUsageComponentResponse": {
      "additionalProperties": false,
      "properties": {
        "activeHoldAmount": {
          "description": "Decimal amount serialized as a string to preserve precision.",
          "title": "Activeholdamount",
          "type": "string"
        },
        "activeHolds": {
          "minimum": 0.0,
          "title": "Activeholds",
          "type": "integer"
        },
        "committedAmount": {
          "description": "Decimal amount serialized as a string to preserve precision.",
          "title": "Committedamount",
          "type": "string"
        },
        "settledActions": {
          "minimum": 0.0,
          "title": "Settledactions",
          "type": "integer"
        },
        "settledAmount": {
          "description": "Decimal amount serialized as a string to preserve precision.",
          "title": "Settledamount",
          "type": "string"
        }
      },
      "required": [
        "settledAmount",
        "activeHoldAmount",
        "committedAmount",
        "settledActions",
        "activeHolds"
      ],
      "title": "ManagedAiUsageComponentResponse",
      "type": "object"
    },
    "ManagedAiUsageSummaryResponse": {
      "additionalProperties": false,
      "description": "Exact customer-wallet value attributable to a run or row.",
      "properties": {
        "activeHoldAmount": {
          "description": "Decimal amount serialized as a string to preserve precision.",
          "title": "Activeholdamount",
          "type": "string"
        },
        "committedAmount": {
          "description": "Decimal amount serialized as a string to preserve precision.",
          "title": "Committedamount",
          "type": "string"
        },
        "currencyCode": {
          "maxLength": 3,
          "minLength": 3,
          "title": "Currencycode",
          "type": "string"
        },
        "model": {
          "$ref": "#/$defs/ManagedAiUsageComponentResponse"
        },
        "paidTools": {
          "$ref": "#/$defs/ManagedAiUsageComponentResponse"
        },
        "settledAmount": {
          "description": "Decimal amount serialized as a string to preserve precision.",
          "title": "Settledamount",
          "type": "string"
        }
      },
      "required": [
        "currencyCode",
        "settledAmount",
        "activeHoldAmount",
        "committedAmount",
        "model",
        "paidTools"
      ],
      "title": "ManagedAiUsageSummaryResponse",
      "type": "object"
    },
    "ProviderCostSummary": {
      "additionalProperties": false,
      "properties": {
        "currencyCode": {
          "default": "USD",
          "maxLength": 3,
          "minLength": 3,
          "title": "Currencycode",
          "type": "string"
        },
        "pricedAmount": {
          "description": "Decimal amount serialized as a string to preserve precision.",
          "title": "Pricedamount",
          "type": "string"
        },
        "status": {
          "enum": [
            "priced",
            "partially_priced",
            "pricing_unavailable",
            "usage_unavailable",
            "not_billable"
          ],
          "title": "Status",
          "type": "string"
        },
        "totalAmount": {
          "anyOf": [
            {
              "description": "Decimal amount serialized as a string to preserve precision.",
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Totalamount"
        }
      },
      "required": [
        "status",
        "totalAmount",
        "pricedAmount"
      ],
      "title": "ProviderCostSummary",
      "type": "object"
    }
  }
}