{
  "openapi": "3.0.4",
  "info": {
    "title": "Kinds Of Taxonomy Packet",
    "description": "HTTP projection of the one-shot Kinds Of Taxonomy Packet capability.",
    "version": "v1"
  },
  "paths": {
    "/capabilities": {
      "get": {
        "tags": [
          "Discovery"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicApiDescriptorDocument"
                }
              }
            }
          }
        }
      }
    },
    "/health/live": {
      "get": {
        "tags": [
          "System"
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      },
      "head": {
        "tags": [
          "System"
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/v1/taxonomy-packets": {
      "post": {
        "tags": [
          "Taxonomy Packet"
        ],
        "parameters": [
          {
            "name": "PAYMENT-SIGNATURE",
            "in": "header",
            "description": "Optional x402 payment signature for the one-shot fulfillment.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TaxonomyPacketRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "PAYMENT-RESPONSE": {
                "description": "Provider settlement response.",
                "schema": {
                  "type": "string"
                }
              },
              "Location": {
                "description": "Continuation URL for the accepted run.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TaxonomyPacketSubmission"
                }
              }
            }
          },
          "202": {
            "description": "Accepted",
            "headers": {
              "PAYMENT-RESPONSE": {
                "description": "Provider settlement response.",
                "schema": {
                  "type": "string"
                }
              },
              "Location": {
                "description": "Continuation URL for the accepted run.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TaxonomyPacketSubmission"
                }
              }
            }
          },
          "402": {
            "description": "Payment Required",
            "headers": {
              "PAYMENT-REQUIRED": {
                "description": "Server payment challenge.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TaxonomyPacketSubmission"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TaxonomyPacketSubmission"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TaxonomyPacketSubmission"
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable Entity",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TaxonomyPacketSubmission"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TaxonomyPacketSubmission"
                }
              }
            }
          }
        }
      }
    },
    "/v1/taxonomy-packets/{runId}": {
      "get": {
        "tags": [
          "Taxonomy Packet"
        ],
        "parameters": [
          {
            "name": "runId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TaxonomyPacketSubmission"
                }
              }
            }
          },
          "202": {
            "description": "Accepted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TaxonomyPacketSubmission"
                }
              }
            }
          },
          "402": {
            "description": "Payment Required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TaxonomyPacketSubmission"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TaxonomyPacketSubmission"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearer": [ ]
          }
        ]
      }
    },
    "/v1/taxonomy-packets/{runId}/resource": {
      "get": {
        "tags": [
          "Taxonomy Packet"
        ],
        "parameters": [
          {
            "name": "runId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Void"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not Found"
          },
          "424": {
            "description": "Failed Dependency"
          }
        },
        "security": [
          {
            "bearer": [ ]
          }
        ]
      }
    }
  },
  "components": {
    "schemas": {
      "PublicApiCommerceDescriptor": {
        "type": "object",
        "properties": {
          "available": {
            "type": "boolean"
          },
          "mode": {
            "type": "string",
            "nullable": true
          },
          "recurringSubscription": {
            "type": "boolean"
          },
          "unlimitedApiAccess": {
            "type": "boolean"
          },
          "anonymousExecution": {
            "type": "boolean"
          },
          "settlementEvidence": {
            "type": "string",
            "nullable": true
          },
          "supportedSchemes": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "PublicApiDescriptorDocument": {
        "type": "object",
        "properties": {
          "schema": {
            "type": "string",
            "nullable": true
          },
          "host": {
            "type": "string",
            "nullable": true
          },
          "product": {
            "type": "string",
            "nullable": true
          },
          "contract": {
            "type": "string",
            "nullable": true
          },
          "authority": {
            "type": "string",
            "nullable": true
          },
          "endpoint": {
            "type": "string",
            "nullable": true
          },
          "operations": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PublicApiOperationDescriptor"
            },
            "nullable": true
          },
          "variants": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PublicApiVariantDescriptor"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "PublicApiOperationDescriptor": {
        "type": "object",
        "properties": {
          "capabilityId": {
            "type": "string",
            "nullable": true
          },
          "operationId": {
            "type": "string",
            "nullable": true
          },
          "mcpTool": {
            "type": "string",
            "nullable": true
          },
          "httpPaths": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "nullable": true
          },
          "requestSchema": {
            "type": "string",
            "nullable": true
          },
          "resultSchema": {
            "type": "string",
            "nullable": true
          },
          "commerce": {
            "$ref": "#/components/schemas/PublicApiCommerceDescriptor"
          }
        },
        "additionalProperties": false
      },
      "PublicApiVariantDescriptor": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "nullable": true
          },
          "version": {
            "type": "string",
            "nullable": true
          },
          "contentProfileId": {
            "type": "string",
            "nullable": true
          },
          "mediaProfileId": {
            "type": "string",
            "nullable": true
          },
          "licenseProfileId": {
            "type": "string",
            "nullable": true
          },
          "deliverableSchemaId": {
            "type": "string",
            "nullable": true
          },
          "requiresMedia": {
            "type": "boolean"
          }
        },
        "additionalProperties": false
      },
      "TaxonomyPacketArtifact": {
        "type": "object",
        "properties": {
          "reference": {
            "type": "string",
            "nullable": true
          },
          "digest": {
            "type": "string",
            "nullable": true
          },
          "subject": {
            "type": "string",
            "nullable": true
          },
          "variantId": {
            "type": "string",
            "nullable": true
          },
          "variantVersion": {
            "type": "string",
            "nullable": true
          },
          "payload": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "TaxonomyPacketBasicTaxonomy": {
        "type": "object",
        "properties": {
          "slug": {
            "type": "string",
            "nullable": true
          },
          "title": {
            "type": "string",
            "nullable": true
          },
          "description": {
            "type": "string",
            "nullable": true
          },
          "canonicalUrl": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "TaxonomyPacketDeliveryEvidence": {
        "type": "object",
        "properties": {
          "stage": {
            "$ref": "#/components/schemas/TaxonomyPacketFulfillmentStage"
          },
          "evidenceReference": {
            "type": "string",
            "nullable": true
          },
          "artifactDigest": {
            "type": "string",
            "nullable": true
          },
          "observedAtUtc": {
            "type": "string",
            "format": "date-time"
          },
          "trusted": {
            "type": "boolean"
          }
        },
        "additionalProperties": false
      },
      "TaxonomyPacketFulfillmentStage": {
        "enum": [
          "CommerceConfigurationVerified",
          "SettlementVerified",
          "DirectoriesResolved",
          "FulfillmentAccepted",
          "ReusingQualifiedPacket",
          "BuildingQualifiedPacket",
          "MediaComposed",
          "LicenseAttached",
          "FulfillmentCompleted",
          "Delivered",
          "PaidUndelivered"
        ],
        "type": "string"
      },
      "TaxonomyPacketFulfillmentStatus": {
        "enum": [
          "Accepted",
          "Running",
          "Completed",
          "Failed",
          "NeedsInput",
          "PaidUndelivered"
        ],
        "type": "string"
      },
      "TaxonomyPacketLicenseEvidence": {
        "type": "object",
        "properties": {
          "licenseProfileId": {
            "type": "string",
            "nullable": true
          },
          "licenseTermsReference": {
            "type": "string",
            "nullable": true
          },
          "licenseVersion": {
            "type": "string",
            "nullable": true
          },
          "evidenceReference": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "TaxonomyPacketPaymentRequirements": {
        "type": "object",
        "properties": {
          "scheme": {
            "type": "string",
            "nullable": true
          },
          "operationId": {
            "type": "string",
            "nullable": true
          },
          "offerId": {
            "type": "string",
            "nullable": true
          },
          "variantId": {
            "type": "string",
            "nullable": true
          },
          "offerVersion": {
            "type": "string",
            "nullable": true
          },
          "requestFingerprint": {
            "type": "string",
            "nullable": true
          },
          "amountMicros": {
            "type": "integer",
            "format": "int64",
            "nullable": true
          },
          "assetReference": {
            "type": "string",
            "nullable": true
          },
          "network": {
            "type": "string",
            "nullable": true
          },
          "resource": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "TaxonomyPacketPreferences": {
        "type": "object",
        "properties": {
          "locale": {
            "type": "string",
            "nullable": true
          },
          "maxItems": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "includeSources": {
            "type": "boolean"
          }
        },
        "additionalProperties": false
      },
      "TaxonomyPacketRequest": {
        "type": "object",
        "properties": {
          "subject": {
            "type": "string",
            "nullable": true
          },
          "variantId": {
            "type": "string",
            "nullable": true
          },
          "variantVersion": {
            "type": "string",
            "nullable": true
          },
          "preferences": {
            "$ref": "#/components/schemas/TaxonomyPacketPreferences"
          }
        },
        "additionalProperties": false
      },
      "TaxonomyPacketResourceReference": {
        "type": "object",
        "properties": {
          "resourceId": {
            "type": "string",
            "nullable": true
          },
          "schemaId": {
            "type": "string",
            "nullable": true
          },
          "contentType": {
            "type": "string",
            "nullable": true
          },
          "digest": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "TaxonomyPacketResult": {
        "type": "object",
        "properties": {
          "contract": {
            "type": "string",
            "nullable": true
          },
          "operationId": {
            "type": "string",
            "nullable": true
          },
          "status": {
            "$ref": "#/components/schemas/TaxonomyPacketFulfillmentStatus"
          },
          "runId": {
            "type": "string",
            "nullable": true
          },
          "variantId": {
            "type": "string",
            "nullable": true
          },
          "variantVersion": {
            "type": "string",
            "nullable": true
          },
          "requestFingerprint": {
            "type": "string",
            "nullable": true
          },
          "stage": {
            "$ref": "#/components/schemas/TaxonomyPacketFulfillmentStage"
          },
          "reusedQualifiedPacket": {
            "type": "boolean"
          },
          "taxonomy": {
            "$ref": "#/components/schemas/TaxonomyPacketBasicTaxonomy"
          },
          "resource": {
            "$ref": "#/components/schemas/TaxonomyPacketResourceReference"
          },
          "artifact": {
            "$ref": "#/components/schemas/TaxonomyPacketArtifact"
          },
          "license": {
            "$ref": "#/components/schemas/TaxonomyPacketLicenseEvidence"
          },
          "evidence": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TaxonomyPacketDeliveryEvidence"
            },
            "nullable": true
          },
          "errorCode": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "TaxonomyPacketSubmission": {
        "type": "object",
        "properties": {
          "operationId": {
            "type": "string",
            "nullable": true
          },
          "status": {
            "$ref": "#/components/schemas/TaxonomyPacketSubmissionStatus"
          },
          "purchaseIntentId": {
            "type": "string",
            "nullable": true
          },
          "paymentRequirements": {
            "$ref": "#/components/schemas/TaxonomyPacketPaymentRequirements"
          },
          "result": {
            "$ref": "#/components/schemas/TaxonomyPacketResult"
          },
          "errorCode": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "TaxonomyPacketSubmissionStatus": {
        "enum": [
          "PaymentRequired",
          "Accepted",
          "Running",
          "Completed",
          "Failed",
          "NeedsInput",
          "PaidUndelivered",
          "Rejected",
          "NotFound",
          "Unavailable"
        ],
        "type": "string"
      },
      "Void": {
        "type": "object",
        "additionalProperties": false
      }
    },
    "securitySchemes": {
      "bearer": {
        "type": "http",
        "description": "Bearer token required for purchased run and resource reads.",
        "scheme": "bearer",
        "bearerFormat": "JWT"
      }
    }
  }
}