{
  "openapi": "3.1.0",
  "info": {
    "title": "blatent-struct JSON Schema API",
    "version": "docs-snapshot-2026-09-29-native",
    "description": "Documentation snapshot of request definitions, public resolve/model responses and HTTP statuses. See the API reference for registration response shapes."
  },
  "paths": {
    "/v1/models": {
      "get": {
        "summary": "List public models",
        "security": [
          {
            "ServiceKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "Available public model.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ModelList"
                }
              }
            },
            "headers": {
              "X-Blatent-Request-ID": {
                "description": "Request identifier. Include it in support requests.",
                "schema": {
                  "type": "string"
                }
              },
              "Server-Timing": {
                "description": "Durations in milliseconds. gateway measures processing up to response headers; runtime measures the call to Struct. total, inference and queue may also be present. Durations overlap and exclude the client network round trip.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key.",
            "headers": {
              "X-Blatent-Request-ID": {
                "description": "Request identifier. Include it in support requests.",
                "schema": {
                  "type": "string"
                }
              },
              "WWW-Authenticate": {
                "schema": {
                  "type": "string",
                  "const": "Bearer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AuthenticationFailure"
                }
              }
            }
          },
          "503": {
            "description": "RUNTIME_UNAVAILABLE.",
            "headers": {
              "X-Blatent-Request-ID": {
                "description": "Request identifier. Include it in support requests.",
                "schema": {
                  "type": "string"
                }
              },
              "Retry-After": {
                "description": "Seconds to wait. Sent with RATE_LIMITED, CONCURRENCY_LIMITED, RUNTIME_UNAVAILABLE and 529 CAPACITY_BUSY.",
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FailureResult"
                }
              }
            }
          }
        }
      }
    },
    "/v1/policies": {
      "post": {
        "summary": "Register an immutable policy",
        "security": [
          {
            "ServiceKey": []
          }
        ],
        "responses": {
          "201": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PolicyRegistrationResult"
                }
              }
            },
            "headers": {
              "X-Blatent-Request-ID": {
                "description": "Request identifier. Include it in support requests.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key.",
            "headers": {
              "X-Blatent-Request-ID": {
                "description": "Request identifier. Include it in support requests.",
                "schema": {
                  "type": "string"
                }
              },
              "WWW-Authenticate": {
                "schema": {
                  "type": "string",
                  "const": "Bearer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AuthenticationFailure"
                }
              }
            }
          },
          "403": {
            "description": "PREVIEW_UNAVAILABLE or SCHEMA_LIMIT_REACHED.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FailureResult"
                }
              }
            },
            "headers": {
              "X-Blatent-Request-ID": {
                "description": "Request identifier. Include it in support requests.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "409": {
            "description": "VERSION_CONFLICT or OUTCOME_INDETERMINATE.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FailureResult"
                }
              }
            },
            "headers": {
              "X-Blatent-Request-ID": {
                "description": "Request identifier. Include it in support requests.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "413": {
            "description": "REQUEST_TOO_LARGE.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FailureResult"
                }
              }
            },
            "headers": {
              "X-Blatent-Request-ID": {
                "description": "Request identifier. Include it in support requests.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "422": {
            "description": "Invalid policy.",
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "$ref": "#/components/schemas/ValidationFailure"
                    },
                    {
                      "$ref": "#/components/schemas/FailureResult"
                    }
                  ]
                }
              }
            },
            "headers": {
              "X-Blatent-Request-ID": {
                "description": "Request identifier. Include it in support requests.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED or CONCURRENCY_LIMITED.",
            "headers": {
              "X-Blatent-Request-ID": {
                "description": "Request identifier. Include it in support requests.",
                "schema": {
                  "type": "string"
                }
              },
              "Retry-After": {
                "description": "Seconds to wait. Sent with RATE_LIMITED, CONCURRENCY_LIMITED, RUNTIME_UNAVAILABLE and 529 CAPACITY_BUSY.",
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FailureResult"
                }
              }
            }
          },
          "503": {
            "description": "RUNTIME_UNAVAILABLE, POLICY_UNAVAILABLE or POLICY_CAPABILITY_UNAVAILABLE.",
            "headers": {
              "X-Blatent-Request-ID": {
                "description": "Request identifier. Include it in support requests.",
                "schema": {
                  "type": "string"
                }
              },
              "Retry-After": {
                "description": "Seconds to wait. Sent with RATE_LIMITED, CONCURRENCY_LIMITED, RUNTIME_UNAVAILABLE and 529 CAPACITY_BUSY.",
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FailureResult"
                }
              }
            }
          },
          "529": {
            "description": "CAPACITY_BUSY: another schema is compiling.",
            "headers": {
              "X-Blatent-Request-ID": {
                "description": "Request identifier. Include it in support requests.",
                "schema": {
                  "type": "string"
                }
              },
              "Retry-After": {
                "description": "Seconds to wait. Sent with RATE_LIMITED, CONCURRENCY_LIMITED, RUNTIME_UNAVAILABLE and 529 CAPACITY_BUSY.",
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FailureResult"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PolicyRegistration"
              }
            }
          }
        }
      }
    },
    "/v1/policies/{reference}": {
      "get": {
        "summary": "Inspect a policy",
        "security": [
          {
            "ServiceKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PolicyRegistrationResult"
                }
              }
            },
            "headers": {
              "X-Blatent-Request-ID": {
                "description": "Request identifier. Include it in support requests.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key.",
            "headers": {
              "X-Blatent-Request-ID": {
                "description": "Request identifier. Include it in support requests.",
                "schema": {
                  "type": "string"
                }
              },
              "WWW-Authenticate": {
                "schema": {
                  "type": "string",
                  "const": "Bearer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AuthenticationFailure"
                }
              }
            }
          },
          "404": {
            "description": "POLICY_NOT_FOUND.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FailureResult"
                }
              }
            },
            "headers": {
              "X-Blatent-Request-ID": {
                "description": "Request identifier. Include it in support requests.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "422": {
            "description": "Invalid reference.",
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "$ref": "#/components/schemas/ValidationFailure"
                    },
                    {
                      "$ref": "#/components/schemas/FailureResult"
                    }
                  ]
                }
              }
            },
            "headers": {
              "X-Blatent-Request-ID": {
                "description": "Request identifier. Include it in support requests.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED or CONCURRENCY_LIMITED.",
            "headers": {
              "X-Blatent-Request-ID": {
                "description": "Request identifier. Include it in support requests.",
                "schema": {
                  "type": "string"
                }
              },
              "Retry-After": {
                "description": "Seconds to wait. Sent with RATE_LIMITED, CONCURRENCY_LIMITED, RUNTIME_UNAVAILABLE and 529 CAPACITY_BUSY.",
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FailureResult"
                }
              }
            }
          },
          "503": {
            "description": "RUNTIME_UNAVAILABLE, POLICY_UNAVAILABLE or POLICY_CAPABILITY_UNAVAILABLE.",
            "headers": {
              "X-Blatent-Request-ID": {
                "description": "Request identifier. Include it in support requests.",
                "schema": {
                  "type": "string"
                }
              },
              "Retry-After": {
                "description": "Seconds to wait. Sent with RATE_LIMITED, CONCURRENCY_LIMITED, RUNTIME_UNAVAILABLE and 529 CAPACITY_BUSY.",
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FailureResult"
                }
              }
            }
          },
          "529": {
            "description": "CAPACITY_BUSY: another schema is compiling.",
            "headers": {
              "X-Blatent-Request-ID": {
                "description": "Request identifier. Include it in support requests.",
                "schema": {
                  "type": "string"
                }
              },
              "Retry-After": {
                "description": "Seconds to wait. Sent with RATE_LIMITED, CONCURRENCY_LIMITED, RUNTIME_UNAVAILABLE and 529 CAPACITY_BUSY.",
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FailureResult"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "reference",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ]
      }
    },
    "/v1/resolve": {
      "post": {
        "summary": "Resolve input",
        "security": [
          {
            "ServiceKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "Generated output.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ResolveResult"
                }
              }
            },
            "headers": {
              "X-Blatent-Request-ID": {
                "description": "Request identifier. Include it in support requests.",
                "schema": {
                  "type": "string"
                }
              },
              "Server-Timing": {
                "description": "Durations in milliseconds. gateway measures processing up to response headers; runtime measures the call to Struct. total, inference and queue may also be present. Durations overlap and exclude the client network round trip.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key.",
            "headers": {
              "X-Blatent-Request-ID": {
                "description": "Request identifier. Include it in support requests.",
                "schema": {
                  "type": "string"
                }
              },
              "WWW-Authenticate": {
                "schema": {
                  "type": "string",
                  "const": "Bearer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AuthenticationFailure"
                }
              }
            }
          },
          "403": {
            "description": "POLICY_DENIED, BUDGET_EXHAUSTED or PREVIEW_UNAVAILABLE.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FailureResult"
                }
              }
            },
            "headers": {
              "X-Blatent-Request-ID": {
                "description": "Request identifier. Include it in support requests.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "404": {
            "description": "SCHEMA_NOT_FOUND or POLICY_NOT_FOUND.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FailureResult"
                }
              }
            },
            "headers": {
              "X-Blatent-Request-ID": {
                "description": "Request identifier. Include it in support requests.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "409": {
            "description": "OUTCOME_INDETERMINATE or RUNTIME_CONTRACT_ERROR.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FailureResult"
                }
              }
            },
            "headers": {
              "X-Blatent-Request-ID": {
                "description": "Request identifier. Include it in support requests.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "413": {
            "description": "REQUEST_TOO_LARGE.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FailureResult"
                }
              }
            },
            "headers": {
              "X-Blatent-Request-ID": {
                "description": "Request identifier. Include it in support requests.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "422": {
            "description": "Invalid request, schema or policy, or no policy-allowed output.",
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "$ref": "#/components/schemas/ValidationFailure"
                    },
                    {
                      "$ref": "#/components/schemas/FailureResult"
                    }
                  ]
                }
              }
            },
            "headers": {
              "X-Blatent-Request-ID": {
                "description": "Request identifier. Include it in support requests.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED, CONCURRENCY_LIMITED or POLICY_CAPACITY_BUSY.",
            "headers": {
              "X-Blatent-Request-ID": {
                "description": "Request identifier. Include it in support requests.",
                "schema": {
                  "type": "string"
                }
              },
              "Retry-After": {
                "description": "Seconds to wait. Sent with RATE_LIMITED, CONCURRENCY_LIMITED, RUNTIME_UNAVAILABLE and 529 CAPACITY_BUSY.",
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FailureResult"
                }
              }
            }
          },
          "503": {
            "description": "RUNTIME_UNAVAILABLE, POLICY_UNAVAILABLE, POLICY_CAPABILITY_UNAVAILABLE or GPU_CAPABILITY_UNAVAILABLE.",
            "headers": {
              "X-Blatent-Request-ID": {
                "description": "Request identifier. Include it in support requests.",
                "schema": {
                  "type": "string"
                }
              },
              "Retry-After": {
                "description": "Seconds to wait. Sent with RATE_LIMITED, CONCURRENCY_LIMITED, RUNTIME_UNAVAILABLE and 529 CAPACITY_BUSY.",
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FailureResult"
                }
              }
            }
          },
          "504": {
            "description": "CAPACITY_BUSY: the request deadline passed; execution may have started.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FailureResult"
                }
              }
            },
            "headers": {
              "X-Blatent-Request-ID": {
                "description": "Request identifier. Include it in support requests.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "529": {
            "description": "CAPACITY_BUSY.",
            "headers": {
              "X-Blatent-Request-ID": {
                "description": "Request identifier. Include it in support requests.",
                "schema": {
                  "type": "string"
                }
              },
              "Retry-After": {
                "description": "Seconds to wait. Sent with RATE_LIMITED, CONCURRENCY_LIMITED, RUNTIME_UNAVAILABLE and 529 CAPACITY_BUSY.",
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FailureResult"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Resolve"
              }
            }
          }
        }
      }
    },
    "/v1/schemas": {
      "post": {
        "summary": "Register a schema version",
        "security": [
          {
            "ServiceKey": []
          }
        ],
        "responses": {
          "201": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SchemaRegistrationResult"
                }
              }
            },
            "headers": {
              "X-Blatent-Request-ID": {
                "description": "Request identifier. Include it in support requests.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key.",
            "headers": {
              "X-Blatent-Request-ID": {
                "description": "Request identifier. Include it in support requests.",
                "schema": {
                  "type": "string"
                }
              },
              "WWW-Authenticate": {
                "schema": {
                  "type": "string",
                  "const": "Bearer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AuthenticationFailure"
                }
              }
            }
          },
          "403": {
            "description": "PREVIEW_UNAVAILABLE or SCHEMA_LIMIT_REACHED.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FailureResult"
                }
              }
            },
            "headers": {
              "X-Blatent-Request-ID": {
                "description": "Request identifier. Include it in support requests.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "409": {
            "description": "VERSION_CONFLICT or OUTCOME_INDETERMINATE.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FailureResult"
                }
              }
            },
            "headers": {
              "X-Blatent-Request-ID": {
                "description": "Request identifier. Include it in support requests.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "413": {
            "description": "REQUEST_TOO_LARGE.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FailureResult"
                }
              }
            },
            "headers": {
              "X-Blatent-Request-ID": {
                "description": "Request identifier. Include it in support requests.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "422": {
            "description": "Invalid request or schema.",
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "$ref": "#/components/schemas/ValidationFailure"
                    },
                    {
                      "$ref": "#/components/schemas/FailureResult"
                    }
                  ]
                }
              }
            },
            "headers": {
              "X-Blatent-Request-ID": {
                "description": "Request identifier. Include it in support requests.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED or CONCURRENCY_LIMITED.",
            "headers": {
              "X-Blatent-Request-ID": {
                "description": "Request identifier. Include it in support requests.",
                "schema": {
                  "type": "string"
                }
              },
              "Retry-After": {
                "description": "Seconds to wait. Sent with RATE_LIMITED, CONCURRENCY_LIMITED, RUNTIME_UNAVAILABLE and 529 CAPACITY_BUSY.",
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FailureResult"
                }
              }
            }
          },
          "503": {
            "description": "RUNTIME_UNAVAILABLE.",
            "headers": {
              "X-Blatent-Request-ID": {
                "description": "Request identifier. Include it in support requests.",
                "schema": {
                  "type": "string"
                }
              },
              "Retry-After": {
                "description": "Seconds to wait. Sent with RATE_LIMITED, CONCURRENCY_LIMITED, RUNTIME_UNAVAILABLE and 529 CAPACITY_BUSY.",
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FailureResult"
                }
              }
            }
          },
          "529": {
            "description": "CAPACITY_BUSY: another schema is compiling.",
            "headers": {
              "X-Blatent-Request-ID": {
                "description": "Request identifier. Include it in support requests.",
                "schema": {
                  "type": "string"
                }
              },
              "Retry-After": {
                "description": "Seconds to wait. Sent with RATE_LIMITED, CONCURRENCY_LIMITED, RUNTIME_UNAVAILABLE and 529 CAPACITY_BUSY.",
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FailureResult"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Registration"
              }
            }
          }
        }
      }
    },
    "/v1/schemas/{reference}": {
      "get": {
        "summary": "Inspect a schema",
        "security": [
          {
            "ServiceKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SchemaInspectionResult"
                }
              }
            },
            "headers": {
              "X-Blatent-Request-ID": {
                "description": "Request identifier. Include it in support requests.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key.",
            "headers": {
              "X-Blatent-Request-ID": {
                "description": "Request identifier. Include it in support requests.",
                "schema": {
                  "type": "string"
                }
              },
              "WWW-Authenticate": {
                "schema": {
                  "type": "string",
                  "const": "Bearer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AuthenticationFailure"
                }
              }
            }
          },
          "403": {
            "description": "PREVIEW_UNAVAILABLE.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FailureResult"
                }
              }
            },
            "headers": {
              "X-Blatent-Request-ID": {
                "description": "Request identifier. Include it in support requests.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "404": {
            "description": "SCHEMA_NOT_FOUND.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FailureResult"
                }
              }
            },
            "headers": {
              "X-Blatent-Request-ID": {
                "description": "Request identifier. Include it in support requests.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED or CONCURRENCY_LIMITED.",
            "headers": {
              "X-Blatent-Request-ID": {
                "description": "Request identifier. Include it in support requests.",
                "schema": {
                  "type": "string"
                }
              },
              "Retry-After": {
                "description": "Seconds to wait. Sent with RATE_LIMITED, CONCURRENCY_LIMITED, RUNTIME_UNAVAILABLE and 529 CAPACITY_BUSY.",
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FailureResult"
                }
              }
            }
          },
          "503": {
            "description": "RUNTIME_UNAVAILABLE.",
            "headers": {
              "X-Blatent-Request-ID": {
                "description": "Request identifier. Include it in support requests.",
                "schema": {
                  "type": "string"
                }
              },
              "Retry-After": {
                "description": "Seconds to wait. Sent with RATE_LIMITED, CONCURRENCY_LIMITED, RUNTIME_UNAVAILABLE and 529 CAPACITY_BUSY.",
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FailureResult"
                }
              }
            }
          },
          "529": {
            "description": "CAPACITY_BUSY: another schema is compiling.",
            "headers": {
              "X-Blatent-Request-ID": {
                "description": "Request identifier. Include it in support requests.",
                "schema": {
                  "type": "string"
                }
              },
              "Retry-After": {
                "description": "Seconds to wait. Sent with RATE_LIMITED, CONCURRENCY_LIMITED, RUNTIME_UNAVAILABLE and 529 CAPACITY_BUSY.",
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FailureResult"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "reference",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ]
      }
    },
    "/v1/schema-aliases": {
      "post": {
        "summary": "Publish or update an alias",
        "security": [
          {
            "ServiceKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SchemaRegistrationResult"
                }
              }
            },
            "headers": {
              "X-Blatent-Request-ID": {
                "description": "Request identifier. Include it in support requests.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key.",
            "headers": {
              "X-Blatent-Request-ID": {
                "description": "Request identifier. Include it in support requests.",
                "schema": {
                  "type": "string"
                }
              },
              "WWW-Authenticate": {
                "schema": {
                  "type": "string",
                  "const": "Bearer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AuthenticationFailure"
                }
              }
            }
          },
          "403": {
            "description": "PREVIEW_UNAVAILABLE.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FailureResult"
                }
              }
            },
            "headers": {
              "X-Blatent-Request-ID": {
                "description": "Request identifier. Include it in support requests.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "404": {
            "description": "SCHEMA_NOT_FOUND.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FailureResult"
                }
              }
            },
            "headers": {
              "X-Blatent-Request-ID": {
                "description": "Request identifier. Include it in support requests.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "409": {
            "description": "VERSION_CONFLICT or OUTCOME_INDETERMINATE.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FailureResult"
                }
              }
            },
            "headers": {
              "X-Blatent-Request-ID": {
                "description": "Request identifier. Include it in support requests.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "422": {
            "description": "Invalid request.",
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "$ref": "#/components/schemas/ValidationFailure"
                    },
                    {
                      "$ref": "#/components/schemas/FailureResult"
                    }
                  ]
                }
              }
            },
            "headers": {
              "X-Blatent-Request-ID": {
                "description": "Request identifier. Include it in support requests.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED or CONCURRENCY_LIMITED.",
            "headers": {
              "X-Blatent-Request-ID": {
                "description": "Request identifier. Include it in support requests.",
                "schema": {
                  "type": "string"
                }
              },
              "Retry-After": {
                "description": "Seconds to wait. Sent with RATE_LIMITED, CONCURRENCY_LIMITED, RUNTIME_UNAVAILABLE and 529 CAPACITY_BUSY.",
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FailureResult"
                }
              }
            }
          },
          "503": {
            "description": "RUNTIME_UNAVAILABLE.",
            "headers": {
              "X-Blatent-Request-ID": {
                "description": "Request identifier. Include it in support requests.",
                "schema": {
                  "type": "string"
                }
              },
              "Retry-After": {
                "description": "Seconds to wait. Sent with RATE_LIMITED, CONCURRENCY_LIMITED, RUNTIME_UNAVAILABLE and 529 CAPACITY_BUSY.",
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FailureResult"
                }
              }
            }
          },
          "529": {
            "description": "CAPACITY_BUSY: another schema is compiling.",
            "headers": {
              "X-Blatent-Request-ID": {
                "description": "Request identifier. Include it in support requests.",
                "schema": {
                  "type": "string"
                }
              },
              "Retry-After": {
                "description": "Seconds to wait. Sent with RATE_LIMITED, CONCURRENCY_LIMITED, RUNTIME_UNAVAILABLE and 529 CAPACITY_BUSY.",
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FailureResult"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Alias"
              }
            }
          }
        }
      }
    },
    "/v1/health": {
      "get": {
        "security": [],
        "responses": {
          "200": {
            "description": "API is reachable. Empty body; does not test inference.",
            "headers": {
              "X-Blatent-Request-ID": {
                "description": "Request identifier. Include it in support requests.",
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/v1/health/auth": {
      "get": {
        "security": [
          {
            "ServiceKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "API key is valid. Empty body; does not test inference or available credit.",
            "headers": {
              "X-Blatent-Request-ID": {
                "description": "Request identifier. Include it in support requests.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key.",
            "headers": {
              "X-Blatent-Request-ID": {
                "description": "Request identifier. Include it in support requests.",
                "schema": {
                  "type": "string"
                }
              },
              "WWW-Authenticate": {
                "schema": {
                  "type": "string",
                  "const": "Bearer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AuthenticationFailure"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "Alias": {
        "additionalProperties": false,
        "properties": {
          "name": {
            "title": "Name",
            "type": "string",
            "description": "The schema name."
          },
          "alias": {
            "title": "Alias",
            "type": "string",
            "description": "A movable tag, such as production."
          },
          "target": {
            "title": "Target",
            "type": "string",
            "description": "An existing release of the same schema."
          },
          "expected_digest": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Expected Digest",
            "description": "If supplied, must match the alias’s current digest."
          }
        },
        "required": [
          "name",
          "alias",
          "target"
        ],
        "title": "Alias",
        "type": "object"
      },
      "JsonValue": {},
      "FailureResult": {
        "title": "FailureResult",
        "type": "object",
        "required": [
          "error"
        ],
        "properties": {
          "error": {
            "type": "object",
            "required": [
              "code",
              "message",
              "path",
              "request_id"
            ],
            "properties": {
              "code": {
                "type": "string",
                "description": "Uppercase error code, such as SCHEMA_NOT_FOUND."
              },
              "message": {
                "type": "string"
              },
              "path": {
                "type": "string",
                "description": "JSON Pointer to the failing schema or output location, or an empty string."
              },
              "request_id": {
                "type": "string",
                "description": "Equals the X-Blatent-Request-ID response header."
              }
            }
          }
        }
      },
      "ModelMetadata": {
        "properties": {
          "name": {
            "const": "blatent-struct-v0.0.1a",
            "default": "blatent-struct-v0.0.1a",
            "title": "Name",
            "type": "string"
          },
          "description": {
            "default": "JSON Schema constrained generation.",
            "title": "Description",
            "type": "string"
          },
          "release_date": {
            "default": "2026-09-28",
            "title": "Release Date",
            "type": "string"
          }
        },
        "title": "ModelMetadata",
        "type": "object"
      },
      "ModelList": {
        "properties": {
          "models": {
            "items": {
              "$ref": "#/components/schemas/ModelMetadata"
            },
            "title": "Models",
            "type": "array"
          }
        },
        "required": [
          "models"
        ],
        "title": "ModelList",
        "type": "object"
      },
      "PolicyRegistration": {
        "additionalProperties": false,
        "properties": {
          "name": {
            "title": "Name",
            "type": "string",
            "description": "Policy name using the schema naming rules."
          },
          "version": {
            "title": "Version",
            "type": "string",
            "description": "Immutable version tag."
          },
          "definition": {
            "additionalProperties": {
              "$ref": "#/components/schemas/JsonValue"
            },
            "title": "Definition",
            "type": "object",
            "description": "OPA definition with engine, entrypoint, modules and optional data."
          }
        },
        "required": [
          "name",
          "version",
          "definition"
        ],
        "title": "PolicyRegistration",
        "type": "object"
      },
      "PolicyResult": {
        "properties": {
          "policy_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Policy Id"
          },
          "digest": {
            "title": "Digest",
            "type": "string"
          },
          "status": {
            "const": "allow",
            "title": "Status",
            "type": "string"
          }
        },
        "required": [
          "digest",
          "status"
        ],
        "title": "PolicyResult",
        "type": "object"
      },
      "Registration": {
        "additionalProperties": false,
        "properties": {
          "name": {
            "title": "Name",
            "type": "string",
            "description": "Schema name, such as support/triage."
          },
          "version": {
            "title": "Version",
            "type": "string",
            "description": "Immutable version tag, such as 0.0.1."
          },
          "schema": {
            "anyOf": [
              {
                "additionalProperties": {
                  "$ref": "#/components/schemas/JsonValue"
                },
                "type": "object"
              },
              {
                "type": "boolean"
              }
            ],
            "title": "Schema",
            "description": "The output schema, including descriptions."
          }
        },
        "required": [
          "name",
          "version",
          "schema"
        ],
        "title": "Registration",
        "type": "object"
      },
      "UserContext": {
        "additionalProperties": false,
        "properties": {
          "scopes": {
            "anyOf": [
              {
                "items": {
                  "minLength": 1,
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Scopes"
          },
          "attributes": {
            "anyOf": [
              {
                "additionalProperties": {
                  "$ref": "#/components/schemas/JsonValue"
                },
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Attributes"
          }
        },
        "title": "UserContext",
        "type": "object"
      },
      "Resolve": {
        "additionalProperties": false,
        "properties": {
          "input": {
            "$ref": "#/components/schemas/JsonValue",
            "default": null,
            "description": "Material to interpret: text or any JSON value. May be omitted."
          },
          "schema": {
            "anyOf": [
              {
                "additionalProperties": {
                  "$ref": "#/components/schemas/JsonValue"
                },
                "type": "object"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Schema",
            "description": "An inline JSON Schema. Use this or schema_id, never both."
          },
          "schema_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Schema Id",
            "description": "An immutable version, digest reference, or alias in your tenant."
          },
          "model": {
            "anyOf": [
              {
                "const": "blatent-struct-v0.0.1a",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Model",
            "description": "Optional. The only accepted non-null value is blatent-struct-v0.0.1a."
          },
          "parameters": {
            "anyOf": [
              {
                "additionalProperties": {
                  "$ref": "#/components/schemas/JsonValue"
                },
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Parameters",
            "description": "Optional named JSON context values, separate from input and state. Not schema substitution."
          },
          "user_context": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/UserContext"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "description": "Optional user scopes and attributes supplied by your backend. Forward verified claims, never OAuth tokens."
          },
          "state": {
            "anyOf": [
              {
                "additionalProperties": {
                  "$ref": "#/components/schemas/JsonValue"
                },
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "State",
            "description": "Optional application context. Inline state is not persisted."
          },
          "policy": {
            "anyOf": [
              {
                "additionalProperties": {
                  "$ref": "#/components/schemas/JsonValue"
                },
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Policy",
            "description": "Inline OPA definition. Use policy or policy_id, not both. Requires a policy-capable deployment."
          },
          "policy_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Policy Id",
            "description": "Tenant-owned immutable policy version or digest reference."
          },
          "policy_max_retries": {
            "anyOf": [
              {
                "maximum": 128,
                "minimum": 0,
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Policy Max Retries",
            "description": "Maximum retries after the first attempt: 0–128; defaults to 32 when a policy is bound."
          },
          "policy_feedback": {
            "anyOf": [
              {
                "enum": [
                  "off",
                  "chat",
                  "inline"
                ],
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Policy Feedback",
            "description": "Optional recovery guidance: off, chat or inline. Requires a policy binding; changes subsequent conditioning."
          }
        },
        "title": "Resolve",
        "type": "object",
        "oneOf": [
          {
            "required": [
              "schema"
            ],
            "properties": {
              "schema": {
                "not": {
                  "type": "null"
                }
              }
            },
            "allOf": [
              {
                "properties": {
                  "schema_id": {
                    "type": "null"
                  }
                }
              }
            ]
          },
          {
            "required": [
              "schema_id"
            ],
            "properties": {
              "schema_id": {
                "not": {
                  "type": "null"
                }
              }
            },
            "allOf": [
              {
                "properties": {
                  "schema": {
                    "type": "null"
                  }
                }
              }
            ]
          }
        ],
        "allOf": [
          {
            "not": {
              "allOf": [
                {
                  "required": [
                    "policy"
                  ],
                  "properties": {
                    "policy": {
                      "not": {
                        "type": "null"
                      }
                    }
                  }
                },
                {
                  "required": [
                    "policy_id"
                  ],
                  "properties": {
                    "policy_id": {
                      "not": {
                        "type": "null"
                      }
                    }
                  }
                }
              ]
            }
          },
          {
            "if": {
              "anyOf": [
                {
                  "required": [
                    "policy_max_retries"
                  ],
                  "properties": {
                    "policy_max_retries": {
                      "not": {
                        "type": "null"
                      }
                    }
                  }
                },
                {
                  "required": [
                    "policy_feedback"
                  ],
                  "properties": {
                    "policy_feedback": {
                      "not": {
                        "type": "null"
                      }
                    }
                  }
                }
              ]
            },
            "then": {
              "anyOf": [
                {
                  "required": [
                    "policy"
                  ],
                  "properties": {
                    "policy": {
                      "not": {
                        "type": "null"
                      }
                    }
                  }
                },
                {
                  "required": [
                    "policy_id"
                  ],
                  "properties": {
                    "policy_id": {
                      "not": {
                        "type": "null"
                      }
                    }
                  }
                }
              ]
            }
          }
        ]
      },
      "ResolveResult": {
        "description": "Customer result contract; additional response metadata may be added.",
        "properties": {
          "output": {
            "$ref": "#/components/schemas/JsonValue"
          },
          "model": {
            "const": "blatent-struct-v0.0.1a",
            "title": "Model",
            "type": "string"
          },
          "schema_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Schema Id"
          },
          "schema_digest": {
            "title": "Schema Digest",
            "type": "string"
          },
          "state": {
            "anyOf": [
              {
                "additionalProperties": {
                  "$ref": "#/components/schemas/JsonValue"
                },
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "State"
          },
          "state_version": {
            "type": "null",
            "description": "The hosted API accepts inline state only."
          },
          "policy": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/PolicyResult"
              },
              {
                "type": "null"
              }
            ],
            "default": null
          },
          "probabilities": {
            "anyOf": [
              {
                "additionalProperties": {
                  "$ref": "#/components/schemas/JsonValue"
                },
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Probabilities"
          },
          "usage": {
            "type": "object",
            "required": [
              "input_tokens"
            ],
            "properties": {
              "input_tokens": {
                "type": "integer",
                "minimum": 0,
                "description": "Billable input tokens, counted with o200k_base."
              }
            }
          }
        },
        "required": [
          "output",
          "model",
          "schema_digest",
          "schema_id",
          "state",
          "state_version",
          "usage"
        ],
        "title": "ResolveResult",
        "type": "object"
      },
      "SchemaRegistrationResult": {
        "type": "object",
        "required": [
          "schema_id",
          "schema_digest"
        ],
        "properties": {
          "schema_id": {
            "type": "string"
          },
          "schema_digest": {
            "type": "string"
          }
        }
      },
      "SchemaInspectionResult": {
        "type": "object",
        "required": [
          "schema_id",
          "schema_digest",
          "schema"
        ],
        "properties": {
          "schema_id": {
            "type": "string"
          },
          "schema_digest": {
            "type": "string"
          },
          "schema": {
            "oneOf": [
              {
                "type": "object"
              },
              {
                "type": "boolean"
              }
            ]
          }
        }
      },
      "PolicyRegistrationResult": {
        "type": "object",
        "required": [
          "policy_id",
          "digest"
        ],
        "properties": {
          "policy_id": {
            "type": "string"
          },
          "digest": {
            "type": "string"
          }
        }
      },
      "AuthenticationFailure": {
        "title": "AuthenticationFailure",
        "type": "object",
        "required": [
          "detail"
        ],
        "properties": {
          "detail": {
            "type": "string",
            "const": "Missing or invalid API key"
          }
        }
      },
      "ValidationFailure": {
        "title": "ValidationFailure",
        "type": "object",
        "required": [
          "detail"
        ],
        "properties": {
          "detail": {
            "type": "array",
            "items": {
              "type": "object",
              "required": [
                "loc",
                "msg",
                "type"
              ],
              "properties": {
                "loc": {
                  "type": "array",
                  "items": {
                    "type": [
                      "string",
                      "integer"
                    ]
                  }
                },
                "msg": {
                  "type": "string"
                },
                "type": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "securitySchemes": {
      "ServiceKey": {
        "type": "http",
        "scheme": "bearer",
        "description": "A service API key, supplied by your administrator."
      }
    }
  },
  "servers": [
    {
      "url": "https://api.blatent.ai"
    }
  ]
}
