{
  "openapi": "3.1.0",
  "info": {
    "title": "The router API (massrelay.ai)",
    "version": "0.4.0",
    "description": "Generated by tools/api/openapi.mjs from the served routers. Do not edit."
  },
  "servers": [
    {
      "url": "https://api.massrelay.ai",
      "description": "production"
    },
    {
      "url": "https://relay-stag.massrelay.ai",
      "description": "staging"
    }
  ],
  "components": {
    "securitySchemes": {
      "relayKey": {
        "type": "http",
        "scheme": "bearer",
        "description": "A relay key."
      },
      "session": {
        "type": "http",
        "scheme": "bearer",
        "description": "A signed-in session; the roles allowed per door are in x-massrelay-roles."
      }
    }
  },
  "paths": {
    "/api/me/spending": {
      "get": {
        "operationId": "getApiMeSpending",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "description": "Hand-written, read against me_spending in crates/mr-server/src/routes.rs (and PauseStateDto, TopUpIntentDto, SkippedRunDto in crates/mr-kernel/src/spending.rs). A session credential. With no personal workspace the page is empty (topUpPolicy is then absent).",
                  "type": "object",
                  "required": [
                    "wallets",
                    "caps",
                    "pause",
                    "topUpIntents",
                    "skippedRuns",
                    "trial"
                  ],
                  "properties": {
                    "wallets": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "id",
                          "kind",
                          "balanceMu",
                          "heldMu"
                        ],
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "tenantId": {
                            "type": "string"
                          },
                          "ownerKind": {
                            "type": "string"
                          },
                          "ownerId": {
                            "type": "string"
                          },
                          "kind": {
                            "type": "string"
                          },
                          "balanceMu": {
                            "type": "integer"
                          },
                          "heldMu": {
                            "type": "integer"
                          },
                          "currencyHint": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "expiresAt": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "spendPriority": {
                            "type": "integer"
                          },
                          "sourceKind": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "sourceRef": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "periodStart": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "periodEnd": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "rolloverCapMu": {
                            "type": [
                              "integer",
                              "null"
                            ]
                          },
                          "createdAt": {
                            "type": "string"
                          },
                          "closedAt": {
                            "type": [
                              "string",
                              "null"
                            ]
                          }
                        }
                      }
                    },
                    "caps": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "period": {
                            "type": "string"
                          },
                          "tier": {},
                          "botKey": {},
                          "limitMu": {
                            "type": [
                              "integer",
                              "null"
                            ]
                          },
                          "perRequestMu": {
                            "type": [
                              "integer",
                              "null"
                            ]
                          },
                          "reservedMu": {
                            "type": [
                              "integer",
                              "null"
                            ]
                          },
                          "spentMu": {
                            "type": "integer"
                          },
                          "periodStartedAt": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "runsOutAt": {
                            "type": [
                              "string",
                              "null"
                            ]
                          }
                        }
                      }
                    },
                    "pause": {
                      "type": [
                        "object",
                        "null"
                      ],
                      "properties": {
                        "pausedAt": {
                          "type": "string"
                        },
                        "pausedBy": {
                          "type": "string"
                        },
                        "note": {
                          "type": [
                            "string",
                            "null"
                          ]
                        }
                      }
                    },
                    "topUpPolicy": {
                      "type": [
                        "object",
                        "null"
                      ],
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "amountMu": {
                          "type": "integer"
                        },
                        "triggerBalanceMu": {
                          "type": "integer"
                        },
                        "monthlyCeilingMu": {
                          "type": [
                            "integer",
                            "null"
                          ]
                        }
                      }
                    },
                    "topUpIntents": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "amountMu": {
                            "type": "integer"
                          },
                          "reason": {
                            "type": "string"
                          },
                          "state": {
                            "type": "string"
                          },
                          "periodStart": {
                            "type": "string"
                          },
                          "confirmedAt": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "createdAt": {
                            "type": "string"
                          }
                        }
                      }
                    },
                    "skippedRuns": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "reason": {
                            "type": "string"
                          },
                          "detail": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "createdAt": {
                            "type": "string"
                          }
                        }
                      }
                    },
                    "trial": {
                      "type": [
                        "object",
                        "null"
                      ],
                      "properties": {
                        "balanceMu": {
                          "type": "integer"
                        },
                        "expiresAt": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "daysLeft": {
                          "type": "number"
                        },
                        "freeLaneCallsThisPeriod": {
                          "type": "integer"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credential"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "x-massrelay-roles": [
          "admin",
          "cfo_viewer",
          "fde",
          "hr_ops",
          "manager",
          "member",
          "operator"
        ]
      }
    },
    "/api/me/spending/caps": {
      "put": {
        "operationId": "putApiMeSpendingCaps",
        "responses": {
          "200": {
            "description": "OK"
          },
          "401": {
            "description": "Missing or invalid credential"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "x-massrelay-roles": [
          "admin",
          "cfo_viewer",
          "fde",
          "hr_ops",
          "manager",
          "member",
          "operator"
        ],
        "x-massrelay-shape": "untyped"
      }
    },
    "/api/me/spending/pause": {
      "post": {
        "operationId": "postApiMeSpendingPause",
        "responses": {
          "200": {
            "description": "OK"
          },
          "401": {
            "description": "Missing or invalid credential"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "x-massrelay-roles": [
          "admin",
          "cfo_viewer",
          "fde",
          "hr_ops",
          "manager",
          "member",
          "operator"
        ],
        "x-massrelay-shape": "untyped"
      }
    },
    "/api/me/spending/resume": {
      "post": {
        "operationId": "postApiMeSpendingResume",
        "responses": {
          "200": {
            "description": "OK"
          },
          "401": {
            "description": "Missing or invalid credential"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "x-massrelay-roles": [
          "admin",
          "cfo_viewer",
          "fde",
          "hr_ops",
          "manager",
          "member",
          "operator"
        ],
        "x-massrelay-shape": "untyped"
      }
    },
    "/api/me/spending/top-up-intents/{id}/confirm": {
      "post": {
        "operationId": "postApiMeSpendingTopUpIntentsIdConfirm",
        "responses": {
          "200": {
            "description": "OK"
          },
          "401": {
            "description": "Missing or invalid credential"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "security": [
          {
            "session": []
          }
        ],
        "x-massrelay-roles": [
          "admin",
          "cfo_viewer",
          "fde",
          "hr_ops",
          "manager",
          "member",
          "operator"
        ],
        "x-massrelay-shape": "untyped"
      }
    },
    "/api/me/spending/top-up-policy": {
      "put": {
        "operationId": "putApiMeSpendingTopUpPolicy",
        "responses": {
          "200": {
            "description": "OK"
          },
          "401": {
            "description": "Missing or invalid credential"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "x-massrelay-roles": [
          "admin",
          "cfo_viewer",
          "fde",
          "hr_ops",
          "manager",
          "member",
          "operator"
        ],
        "x-massrelay-shape": "untyped"
      }
    },
    "/api/me/wallets": {
      "get": {
        "operationId": "getApiMeWallets",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "description": "Hand-written, read against me_wallets in crates/mr-server/src/routes.rs and WalletRow in crates/mr-kernel/src/wallets.rs. A session credential. A person with no personal workspace yet gets an empty list, not an error. Amounts are in mu (the unit of account).",
                  "type": "object",
                  "required": [
                    "wallets"
                  ],
                  "properties": {
                    "wallets": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "id",
                          "kind",
                          "balanceMu",
                          "heldMu"
                        ],
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "tenantId": {
                            "type": "string"
                          },
                          "ownerKind": {
                            "type": "string"
                          },
                          "ownerId": {
                            "type": "string"
                          },
                          "kind": {
                            "type": "string"
                          },
                          "balanceMu": {
                            "type": "integer"
                          },
                          "heldMu": {
                            "type": "integer"
                          },
                          "currencyHint": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "expiresAt": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "spendPriority": {
                            "type": "integer"
                          },
                          "sourceKind": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "sourceRef": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "periodStart": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "periodEnd": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "rolloverCapMu": {
                            "type": [
                              "integer",
                              "null"
                            ]
                          },
                          "createdAt": {
                            "type": "string"
                          },
                          "closedAt": {
                            "type": [
                              "string",
                              "null"
                            ]
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credential"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "x-massrelay-roles": [
          "admin",
          "cfo_viewer",
          "fde",
          "hr_ops",
          "manager",
          "member",
          "operator"
        ]
      }
    },
    "/api/me/wallets/{id}/entries": {
      "get": {
        "operationId": "getApiMeWalletsIdEntries",
        "responses": {
          "200": {
            "description": "OK"
          },
          "401": {
            "description": "Missing or invalid credential"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "security": [
          {
            "session": []
          }
        ],
        "x-massrelay-roles": [
          "admin",
          "cfo_viewer",
          "fde",
          "hr_ops",
          "manager",
          "member",
          "operator"
        ],
        "x-massrelay-shape": "untyped"
      }
    },
    "/api/relay/accounts": {
      "get": {
        "operationId": "getApiRelayAccounts",
        "responses": {
          "200": {
            "description": "OK"
          },
          "401": {
            "description": "Missing or invalid credential"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "x-massrelay-roles": [
          "admin",
          "fde"
        ],
        "x-massrelay-shape": "untyped"
      },
      "post": {
        "operationId": "postApiRelayAccounts",
        "responses": {
          "200": {
            "description": "OK"
          },
          "401": {
            "description": "Missing or invalid credential"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "x-massrelay-roles": [
          "admin",
          "fde"
        ],
        "x-massrelay-shape": "untyped"
      }
    },
    "/api/relay/accounts/{id}/rotate": {
      "post": {
        "operationId": "postApiRelayAccountsIdRotate",
        "responses": {
          "200": {
            "description": "OK"
          },
          "401": {
            "description": "Missing or invalid credential"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "security": [
          {
            "session": []
          }
        ],
        "x-massrelay-roles": [
          "admin",
          "fde"
        ],
        "x-massrelay-shape": "untyped"
      }
    },
    "/api/relay/accounts/{id}/status": {
      "post": {
        "operationId": "postApiRelayAccountsIdStatus",
        "responses": {
          "200": {
            "description": "OK"
          },
          "401": {
            "description": "Missing or invalid credential"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "security": [
          {
            "session": []
          }
        ],
        "x-massrelay-roles": [
          "admin",
          "fde"
        ],
        "x-massrelay-shape": "untyped"
      }
    },
    "/api/relay/catalogue/overrides": {
      "get": {
        "operationId": "getApiRelayCatalogueOverrides",
        "responses": {
          "200": {
            "description": "OK"
          },
          "401": {
            "description": "Missing or invalid credential"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "x-massrelay-roles": [
          "admin",
          "fde"
        ],
        "x-massrelay-shape": "untyped"
      },
      "post": {
        "operationId": "postApiRelayCatalogueOverrides",
        "responses": {
          "200": {
            "description": "OK"
          },
          "401": {
            "description": "Missing or invalid credential"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "x-massrelay-roles": [
          "admin",
          "fde"
        ],
        "x-massrelay-shape": "untyped"
      }
    },
    "/api/relay/catalogue/overrides/{id}/revoke": {
      "post": {
        "operationId": "postApiRelayCatalogueOverridesIdRevoke",
        "responses": {
          "200": {
            "description": "OK"
          },
          "401": {
            "description": "Missing or invalid credential"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "security": [
          {
            "session": []
          }
        ],
        "x-massrelay-roles": [
          "admin",
          "fde"
        ],
        "x-massrelay-shape": "untyped"
      }
    },
    "/api/relay/ceilings": {
      "get": {
        "operationId": "getApiRelayCeilings",
        "responses": {
          "200": {
            "description": "OK"
          },
          "401": {
            "description": "Missing or invalid credential"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "x-massrelay-roles": [
          "admin",
          "fde"
        ],
        "x-massrelay-shape": "untyped"
      },
      "put": {
        "operationId": "putApiRelayCeilings",
        "responses": {
          "200": {
            "description": "OK"
          },
          "401": {
            "description": "Missing or invalid credential"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "x-massrelay-roles": [
          "admin",
          "fde"
        ],
        "x-massrelay-shape": "untyped"
      }
    },
    "/api/relay/credentials": {
      "get": {
        "operationId": "getApiRelayCredentials",
        "responses": {
          "200": {
            "description": "OK"
          },
          "401": {
            "description": "Missing or invalid credential"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "x-massrelay-roles": [
          "admin",
          "fde"
        ],
        "x-massrelay-shape": "untyped"
      }
    },
    "/api/relay/credentials/test": {
      "post": {
        "operationId": "postApiRelayCredentialsTest",
        "responses": {
          "200": {
            "description": "OK"
          },
          "401": {
            "description": "Missing or invalid credential"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "x-massrelay-roles": [
          "admin",
          "fde"
        ],
        "x-massrelay-shape": "untyped"
      }
    },
    "/api/relay/credentials/{name}": {
      "put": {
        "operationId": "putApiRelayCredentialsName",
        "responses": {
          "200": {
            "description": "OK"
          },
          "401": {
            "description": "Missing or invalid credential"
          }
        },
        "parameters": [
          {
            "name": "name",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "security": [
          {
            "session": []
          }
        ],
        "x-massrelay-roles": [
          "admin",
          "fde"
        ],
        "x-massrelay-shape": "untyped"
      },
      "delete": {
        "operationId": "deleteApiRelayCredentialsName",
        "responses": {
          "200": {
            "description": "OK"
          },
          "401": {
            "description": "Missing or invalid credential"
          }
        },
        "parameters": [
          {
            "name": "name",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "security": [
          {
            "session": []
          }
        ],
        "x-massrelay-roles": [
          "admin",
          "fde"
        ],
        "x-massrelay-shape": "untyped"
      }
    },
    "/api/relay/credentials/{name}/grants": {
      "get": {
        "operationId": "getApiRelayCredentialsNameGrants",
        "responses": {
          "200": {
            "description": "OK"
          },
          "401": {
            "description": "Missing or invalid credential"
          }
        },
        "parameters": [
          {
            "name": "name",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "security": [
          {
            "session": []
          }
        ],
        "x-massrelay-roles": [
          "admin",
          "fde"
        ],
        "x-massrelay-shape": "untyped"
      },
      "post": {
        "operationId": "postApiRelayCredentialsNameGrants",
        "responses": {
          "200": {
            "description": "OK"
          },
          "401": {
            "description": "Missing or invalid credential"
          }
        },
        "parameters": [
          {
            "name": "name",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "security": [
          {
            "session": []
          }
        ],
        "x-massrelay-roles": [
          "admin",
          "fde"
        ],
        "x-massrelay-shape": "untyped"
      }
    },
    "/api/relay/credentials/{name}/grants/{id}": {
      "delete": {
        "operationId": "deleteApiRelayCredentialsNameGrantsId",
        "responses": {
          "200": {
            "description": "OK"
          },
          "401": {
            "description": "Missing or invalid credential"
          }
        },
        "parameters": [
          {
            "name": "name",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "security": [
          {
            "session": []
          }
        ],
        "x-massrelay-roles": [
          "admin",
          "fde"
        ],
        "x-massrelay-shape": "untyped"
      }
    },
    "/api/relay/credentials/{name}/uses": {
      "get": {
        "operationId": "getApiRelayCredentialsNameUses",
        "responses": {
          "200": {
            "description": "OK"
          },
          "401": {
            "description": "Missing or invalid credential"
          }
        },
        "parameters": [
          {
            "name": "name",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "security": [
          {
            "session": []
          }
        ],
        "x-massrelay-roles": [
          "admin",
          "fde"
        ],
        "x-massrelay-shape": "untyped"
      }
    },
    "/api/relay/end-users": {
      "get": {
        "operationId": "getApiRelayEndUsers",
        "responses": {
          "200": {
            "description": "OK"
          },
          "401": {
            "description": "Missing or invalid credential"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "x-massrelay-roles": [
          "admin",
          "fde",
          "operator"
        ],
        "x-massrelay-shape": "untyped"
      }
    },
    "/api/relay/fees": {
      "get": {
        "operationId": "getApiRelayFees",
        "responses": {
          "200": {
            "description": "OK"
          },
          "401": {
            "description": "Missing or invalid credential"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "x-massrelay-roles": [
          "admin",
          "cfo_viewer",
          "fde",
          "hr_ops",
          "manager",
          "member",
          "operator"
        ],
        "x-massrelay-shape": "untyped"
      }
    },
    "/api/relay/free-tier": {
      "get": {
        "operationId": "getApiRelayFreeTier",
        "responses": {
          "200": {
            "description": "OK"
          },
          "401": {
            "description": "Missing or invalid credential"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "x-massrelay-roles": [
          "admin",
          "fde"
        ],
        "x-massrelay-shape": "untyped"
      }
    },
    "/api/relay/free-tier-keys": {
      "get": {
        "operationId": "getApiRelayFreeTierKeys",
        "responses": {
          "200": {
            "description": "OK"
          },
          "401": {
            "description": "Missing or invalid credential"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "x-massrelay-roles": [
          "admin",
          "fde"
        ],
        "x-massrelay-shape": "untyped"
      }
    },
    "/api/relay/free-tier-keys/{provider}": {
      "put": {
        "operationId": "putApiRelayFreeTierKeysProvider",
        "responses": {
          "200": {
            "description": "OK"
          },
          "401": {
            "description": "Missing or invalid credential"
          }
        },
        "parameters": [
          {
            "name": "provider",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "security": [
          {
            "session": []
          }
        ],
        "x-massrelay-roles": [
          "admin",
          "fde"
        ],
        "x-massrelay-shape": "untyped"
      }
    },
    "/api/relay/guardrails": {
      "get": {
        "operationId": "getApiRelayGuardrails",
        "responses": {
          "200": {
            "description": "OK"
          },
          "401": {
            "description": "Missing or invalid credential"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "x-massrelay-roles": [
          "admin",
          "fde"
        ],
        "x-massrelay-shape": "untyped"
      },
      "post": {
        "operationId": "postApiRelayGuardrails",
        "responses": {
          "200": {
            "description": "OK"
          },
          "401": {
            "description": "Missing or invalid credential"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "x-massrelay-roles": [
          "admin",
          "fde"
        ],
        "x-massrelay-shape": "untyped"
      }
    },
    "/api/relay/guardrails/preview": {
      "post": {
        "operationId": "postApiRelayGuardrailsPreview",
        "responses": {
          "200": {
            "description": "OK"
          },
          "401": {
            "description": "Missing or invalid credential"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "x-massrelay-roles": [
          "admin",
          "fde"
        ],
        "x-massrelay-shape": "untyped"
      }
    },
    "/api/relay/guardrails/registry": {
      "get": {
        "operationId": "getApiRelayGuardrailsRegistry",
        "responses": {
          "200": {
            "description": "OK"
          },
          "401": {
            "description": "Missing or invalid credential"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "x-massrelay-roles": [
          "admin",
          "fde"
        ],
        "x-massrelay-shape": "untyped"
      }
    },
    "/api/relay/guardrails/{id}": {
      "patch": {
        "operationId": "patchApiRelayGuardrailsId",
        "responses": {
          "200": {
            "description": "OK"
          },
          "401": {
            "description": "Missing or invalid credential"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "security": [
          {
            "session": []
          }
        ],
        "x-massrelay-roles": [
          "admin",
          "fde"
        ],
        "x-massrelay-shape": "untyped"
      }
    },
    "/api/relay/guardrails/{id}/eligibility": {
      "get": {
        "operationId": "getApiRelayGuardrailsIdEligibility",
        "responses": {
          "200": {
            "description": "OK"
          },
          "401": {
            "description": "Missing or invalid credential"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "security": [
          {
            "session": []
          }
        ],
        "x-massrelay-roles": [
          "admin",
          "fde"
        ],
        "x-massrelay-shape": "untyped"
      }
    },
    "/api/relay/keys/{id}/policy": {
      "get": {
        "operationId": "getApiRelayKeysIdPolicy",
        "responses": {
          "200": {
            "description": "OK"
          },
          "401": {
            "description": "Missing or invalid credential"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "security": [
          {
            "session": []
          }
        ],
        "x-massrelay-roles": [
          "admin",
          "fde"
        ],
        "x-massrelay-shape": "untyped"
      }
    },
    "/api/relay/model-packs": {
      "get": {
        "operationId": "getApiRelayModelPacks",
        "responses": {
          "200": {
            "description": "OK"
          },
          "401": {
            "description": "Missing or invalid credential"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "x-massrelay-roles": [
          "admin",
          "fde"
        ],
        "x-massrelay-shape": "untyped"
      },
      "post": {
        "operationId": "postApiRelayModelPacks",
        "responses": {
          "200": {
            "description": "OK"
          },
          "401": {
            "description": "Missing or invalid credential"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "x-massrelay-roles": [
          "admin",
          "fde"
        ],
        "x-massrelay-shape": "untyped"
      }
    },
    "/api/relay/model-packs/{id}": {
      "delete": {
        "operationId": "deleteApiRelayModelPacksId",
        "responses": {
          "200": {
            "description": "OK"
          },
          "401": {
            "description": "Missing or invalid credential"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "security": [
          {
            "session": []
          }
        ],
        "x-massrelay-roles": [
          "admin",
          "fde"
        ],
        "x-massrelay-shape": "untyped"
      }
    },
    "/api/relay/models/detail": {
      "get": {
        "operationId": "getApiRelayModelsDetail",
        "responses": {
          "200": {
            "description": "OK"
          },
          "401": {
            "description": "Missing or invalid credential"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "x-massrelay-roles": [
          "admin",
          "cfo_viewer",
          "fde",
          "guest",
          "hr_ops",
          "manager",
          "member"
        ],
        "x-massrelay-shape": "untyped"
      }
    },
    "/api/relay/nodes/me/earnings": {
      "get": {
        "operationId": "getApiRelayNodesMeEarnings",
        "responses": {
          "200": {
            "description": "OK"
          },
          "401": {
            "description": "Missing or invalid credential"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "x-massrelay-roles": [
          "admin",
          "fde"
        ],
        "x-massrelay-shape": "untyped"
      }
    },
    "/api/relay/own-models/bot": {
      "get": {
        "operationId": "getApiRelayOwnModelsBot",
        "responses": {
          "200": {
            "description": "OK"
          },
          "401": {
            "description": "Missing or invalid credential"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "x-massrelay-roles": [
          "admin",
          "fde"
        ],
        "x-massrelay-shape": "untyped"
      },
      "post": {
        "operationId": "postApiRelayOwnModelsBot",
        "responses": {
          "200": {
            "description": "OK"
          },
          "401": {
            "description": "Missing or invalid credential"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "x-massrelay-roles": [
          "admin",
          "fde"
        ],
        "x-massrelay-shape": "untyped"
      }
    },
    "/api/relay/own-models/devices/{id}/probe": {
      "post": {
        "operationId": "postApiRelayOwnModelsDevicesIdProbe",
        "responses": {
          "200": {
            "description": "OK"
          },
          "401": {
            "description": "Missing or invalid credential"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "security": [
          {
            "session": []
          }
        ],
        "x-massrelay-roles": [
          "admin",
          "cfo_viewer",
          "fde",
          "hr_ops",
          "manager",
          "member"
        ],
        "x-massrelay-shape": "untyped"
      }
    },
    "/api/relay/own-models/egress-hosts": {
      "get": {
        "operationId": "getApiRelayOwnModelsEgressHosts",
        "responses": {
          "200": {
            "description": "OK"
          },
          "401": {
            "description": "Missing or invalid credential"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "x-massrelay-roles": [
          "admin",
          "fde"
        ],
        "x-massrelay-shape": "untyped"
      },
      "post": {
        "operationId": "postApiRelayOwnModelsEgressHosts",
        "responses": {
          "200": {
            "description": "OK"
          },
          "401": {
            "description": "Missing or invalid credential"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "x-massrelay-roles": [
          "admin",
          "fde"
        ],
        "x-massrelay-shape": "untyped"
      },
      "delete": {
        "operationId": "deleteApiRelayOwnModelsEgressHosts",
        "responses": {
          "200": {
            "description": "OK"
          },
          "401": {
            "description": "Missing or invalid credential"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "x-massrelay-roles": [
          "admin",
          "fde"
        ],
        "x-massrelay-shape": "untyped"
      }
    },
    "/api/relay/own-models/probe": {
      "post": {
        "operationId": "postApiRelayOwnModelsProbe",
        "responses": {
          "200": {
            "description": "OK"
          },
          "401": {
            "description": "Missing or invalid credential"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "x-massrelay-roles": [
          "admin",
          "fde"
        ],
        "x-massrelay-shape": "untyped"
      }
    },
    "/api/relay/own-models/seats": {
      "get": {
        "operationId": "getApiRelayOwnModelsSeats",
        "responses": {
          "200": {
            "description": "OK"
          },
          "401": {
            "description": "Missing or invalid credential"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "x-massrelay-roles": [
          "admin",
          "cfo_viewer",
          "fde",
          "hr_ops",
          "manager",
          "member"
        ],
        "x-massrelay-shape": "untyped"
      }
    },
    "/api/relay/own-models/upstreams": {
      "get": {
        "operationId": "getApiRelayOwnModelsUpstreams",
        "responses": {
          "200": {
            "description": "OK"
          },
          "401": {
            "description": "Missing or invalid credential"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "x-massrelay-roles": [
          "admin",
          "fde"
        ],
        "x-massrelay-shape": "untyped"
      },
      "post": {
        "operationId": "postApiRelayOwnModelsUpstreams",
        "responses": {
          "200": {
            "description": "OK"
          },
          "401": {
            "description": "Missing or invalid credential"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "x-massrelay-roles": [
          "admin",
          "fde"
        ],
        "x-massrelay-shape": "untyped"
      }
    },
    "/api/relay/own-models/{id}/golden": {
      "get": {
        "operationId": "getApiRelayOwnModelsIdGolden",
        "responses": {
          "200": {
            "description": "OK"
          },
          "401": {
            "description": "Missing or invalid credential"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "security": [
          {
            "session": []
          }
        ],
        "x-massrelay-roles": [
          "admin",
          "cfo_viewer",
          "fde",
          "hr_ops",
          "manager",
          "member"
        ],
        "x-massrelay-shape": "untyped"
      }
    },
    "/api/relay/own-models/{id}/golden-run": {
      "post": {
        "operationId": "postApiRelayOwnModelsIdGoldenRun",
        "responses": {
          "200": {
            "description": "OK"
          },
          "401": {
            "description": "Missing or invalid credential"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "security": [
          {
            "session": []
          }
        ],
        "x-massrelay-roles": [
          "admin",
          "cfo_viewer",
          "fde",
          "hr_ops",
          "manager",
          "member"
        ],
        "x-massrelay-shape": "untyped"
      }
    },
    "/api/relay/own-models/{id}/listing": {
      "put": {
        "operationId": "putApiRelayOwnModelsIdListing",
        "responses": {
          "200": {
            "description": "OK"
          },
          "401": {
            "description": "Missing or invalid credential"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "security": [
          {
            "session": []
          }
        ],
        "x-massrelay-roles": [
          "admin",
          "fde"
        ],
        "x-massrelay-shape": "untyped"
      },
      "delete": {
        "operationId": "deleteApiRelayOwnModelsIdListing",
        "responses": {
          "200": {
            "description": "OK"
          },
          "401": {
            "description": "Missing or invalid credential"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "security": [
          {
            "session": []
          }
        ],
        "x-massrelay-roles": [
          "admin",
          "fde"
        ],
        "x-massrelay-shape": "untyped"
      }
    },
    "/api/relay/pool": {
      "get": {
        "operationId": "getApiRelayPool",
        "responses": {
          "200": {
            "description": "OK"
          },
          "401": {
            "description": "Missing or invalid credential"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "x-massrelay-roles": [
          "operator"
        ],
        "x-massrelay-shape": "untyped"
      }
    },
    "/api/relay/routing/rules": {
      "get": {
        "operationId": "getApiRelayRoutingRules",
        "responses": {
          "200": {
            "description": "OK"
          },
          "401": {
            "description": "Missing or invalid credential"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "x-massrelay-roles": [
          "admin",
          "fde"
        ],
        "x-massrelay-shape": "untyped"
      },
      "put": {
        "operationId": "putApiRelayRoutingRules",
        "responses": {
          "200": {
            "description": "OK"
          },
          "401": {
            "description": "Missing or invalid credential"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "x-massrelay-roles": [
          "admin",
          "fde"
        ],
        "x-massrelay-shape": "untyped"
      }
    },
    "/api/relay/routing/rules/explain": {
      "post": {
        "operationId": "postApiRelayRoutingRulesExplain",
        "responses": {
          "200": {
            "description": "OK"
          },
          "401": {
            "description": "Missing or invalid credential"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "x-massrelay-roles": [
          "admin",
          "fde"
        ],
        "x-massrelay-shape": "untyped"
      }
    },
    "/api/relay/savings": {
      "get": {
        "operationId": "getApiRelaySavings",
        "responses": {
          "200": {
            "description": "OK"
          },
          "401": {
            "description": "Missing or invalid credential"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "x-massrelay-roles": [
          "admin",
          "fde",
          "operator"
        ],
        "x-massrelay-shape": "untyped"
      }
    },
    "/api/relay/scorecards": {
      "get": {
        "operationId": "getApiRelayScorecards",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "window": {
                      "type": "string",
                      "enum": [
                        "24h",
                        "30d"
                      ]
                    },
                    "cards": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "provider": {
                            "type": "string"
                          },
                          "model": {
                            "type": "string"
                          },
                          "baseUrlFingerprint": {
                            "type": "string"
                          },
                          "region": {
                            "type": "string"
                          },
                          "windowKind": {
                            "type": "string",
                            "enum": [
                              "24h",
                              "30d"
                            ]
                          },
                          "ttftP50Ms": {
                            "type": "integer",
                            "nullable": true
                          },
                          "ttftP95Ms": {
                            "type": "integer",
                            "nullable": true
                          },
                          "tokensPerSecP50": {
                            "type": "number",
                            "nullable": true
                          },
                          "callsCounted": {
                            "type": "integer"
                          },
                          "errorRatePct": {
                            "type": "number",
                            "nullable": true
                          },
                          "errorKinds": {
                            "type": "string"
                          },
                          "availabilityPct": {
                            "type": "number",
                            "nullable": true
                          },
                          "probeContextOk": {
                            "type": "boolean",
                            "nullable": true
                          },
                          "probeToolsOk": {
                            "type": "boolean",
                            "nullable": true
                          },
                          "probeJsonModeOk": {
                            "type": "boolean",
                            "nullable": true
                          },
                          "probeStreamingOk": {
                            "type": "boolean",
                            "nullable": true
                          },
                          "probeGreenStreakDays": {
                            "type": "integer"
                          },
                          "quality": {
                            "type": "string",
                            "nullable": true
                          },
                          "pricePerMillionMu": {
                            "type": "integer",
                            "nullable": true
                          },
                          "effectiveCostPerVerifiedTaskMu": {
                            "type": "integer",
                            "nullable": true
                          },
                          "personalOk": {
                            "type": "boolean"
                          },
                          "personalOkReason": {
                            "type": "string"
                          },
                          "rentable": {
                            "type": "boolean"
                          },
                          "rentableReason": {
                            "type": "string"
                          },
                          "computedAt": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "id",
                          "provider",
                          "model",
                          "baseUrlFingerprint",
                          "region",
                          "windowKind",
                          "ttftP50Ms",
                          "ttftP95Ms",
                          "tokensPerSecP50",
                          "callsCounted",
                          "errorRatePct",
                          "errorKinds",
                          "availabilityPct",
                          "probeContextOk",
                          "probeToolsOk",
                          "probeJsonModeOk",
                          "probeStreamingOk",
                          "probeGreenStreakDays",
                          "quality",
                          "pricePerMillionMu",
                          "effectiveCostPerVerifiedTaskMu",
                          "personalOk",
                          "personalOkReason",
                          "rentable",
                          "rentableReason",
                          "computedAt"
                        ],
                        "additionalProperties": false
                      }
                    }
                  },
                  "required": [
                    "window",
                    "cards"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credential"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "x-massrelay-roles": [
          "admin",
          "fde",
          "operator"
        ]
      }
    },
    "/api/relay/scorecards/{hop}": {
      "get": {
        "operationId": "getApiRelayScorecardsHop",
        "responses": {
          "200": {
            "description": "OK"
          },
          "401": {
            "description": "Missing or invalid credential"
          }
        },
        "parameters": [
          {
            "name": "hop",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "security": [
          {
            "session": []
          }
        ],
        "x-massrelay-roles": [
          "admin",
          "fde",
          "operator"
        ],
        "x-massrelay-shape": "untyped"
      }
    },
    "/api/relay/strategies": {
      "get": {
        "operationId": "getApiRelayStrategies",
        "responses": {
          "200": {
            "description": "OK"
          },
          "401": {
            "description": "Missing or invalid credential"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "x-massrelay-roles": [
          "admin",
          "fde",
          "operator"
        ],
        "x-massrelay-shape": "untyped"
      }
    },
    "/public/asks/{aid}": {
      "get": {
        "operationId": "getPublicAsksAid",
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "parameters": [
          {
            "name": "aid",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "x-massrelay-shape": "untyped"
      }
    },
    "/public/demand": {
      "post": {
        "operationId": "postPublicDemand",
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "x-massrelay-shape": "untyped"
      }
    },
    "/public/directory": {
      "get": {
        "operationId": "getPublicDirectory",
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "x-massrelay-shape": "untyped"
      }
    },
    "/public/models": {
      "get": {
        "operationId": "getPublicModels",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "description": "Hand-written, read against public_models_list in crates/mr-server/src/public_models.rs. No credential. 404 when the public pages are switched off. `floor` is the k-floor: a figure backed by fewer calls is null, never a small number.",
                  "type": "object",
                  "required": [
                    "floor",
                    "models"
                  ],
                  "properties": {
                    "floor": {
                      "type": "integer"
                    },
                    "models": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "provider",
                          "model",
                          "partner"
                        ],
                        "properties": {
                          "provider": {
                            "type": "string"
                          },
                          "model": {
                            "type": "string"
                          },
                          "family": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "contextWindow": {
                            "type": [
                              "integer",
                              "null"
                            ]
                          },
                          "priceInputPerMillionUsd": {
                            "type": [
                              "number",
                              "null"
                            ]
                          },
                          "priceOutputPerMillionUsd": {
                            "type": [
                              "number",
                              "null"
                            ]
                          },
                          "partner": {
                            "type": "boolean"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/public/models/{provider}/{model}": {
      "get": {
        "operationId": "getPublicModelsProviderModel",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "description": "Hand-written, read against public_models_detail in crates/mr-server/src/public_models.rs. 404 {error:not_found} for a name the catalogue and the partner listing do not know. Latency and uptime are null below the k-floor.",
                  "type": "object",
                  "required": [
                    "provider",
                    "model",
                    "partner"
                  ],
                  "properties": {
                    "provider": {
                      "type": "string"
                    },
                    "model": {
                      "type": "string"
                    },
                    "family": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "contextWindow": {
                      "type": [
                        "integer",
                        "null"
                      ]
                    },
                    "priceInputPerMillionUsd": {
                      "type": [
                        "number",
                        "null"
                      ]
                    },
                    "priceOutputPerMillionUsd": {
                      "type": [
                        "number",
                        "null"
                      ]
                    },
                    "partner": {
                      "type": "boolean"
                    },
                    "latency": {
                      "type": "object",
                      "properties": {
                        "p50Ms": {
                          "type": [
                            "number",
                            "null"
                          ]
                        },
                        "p95Ms": {
                          "type": [
                            "number",
                            "null"
                          ]
                        },
                        "window": {
                          "const": "24h"
                        }
                      }
                    },
                    "uptime": {
                      "type": "object",
                      "properties": {
                        "5m": {
                          "type": "null"
                        },
                        "30m": {
                          "type": "null"
                        },
                        "1d": {
                          "type": [
                            "number",
                            "null"
                          ]
                        }
                      }
                    },
                    "floor": {
                      "type": "integer"
                    }
                  }
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "provider",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "model",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ]
      }
    },
    "/public/packs/{id}": {
      "get": {
        "operationId": "getPublicPacksId",
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "x-massrelay-shape": "untyped"
      }
    },
    "/public/profiles/{handle}": {
      "get": {
        "operationId": "getPublicProfilesHandle",
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "parameters": [
          {
            "name": "handle",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "x-massrelay-shape": "untyped"
      }
    },
    "/public/profiles/{handle}/photo": {
      "get": {
        "operationId": "getPublicProfilesHandlePhoto",
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "parameters": [
          {
            "name": "handle",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "x-massrelay-shape": "untyped"
      }
    },
    "/public/receipts/{id}": {
      "get": {
        "operationId": "getPublicReceiptsId",
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "x-massrelay-shape": "untyped"
      }
    },
    "/public/receipts/{id}/verify": {
      "get": {
        "operationId": "getPublicReceiptsIdVerify",
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "x-massrelay-shape": "untyped"
      }
    },
    "/public/report": {
      "post": {
        "operationId": "postPublicReport",
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "x-massrelay-shape": "untyped"
      }
    },
    "/public/rooms/{handle}/front": {
      "get": {
        "operationId": "getPublicRoomsHandleFront",
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "parameters": [
          {
            "name": "handle",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "x-massrelay-shape": "untyped"
      }
    },
    "/public/rooms/{handle}/photo": {
      "get": {
        "operationId": "getPublicRoomsHandlePhoto",
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "parameters": [
          {
            "name": "handle",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "x-massrelay-shape": "untyped"
      }
    },
    "/public/rooms/{handle}/updates": {
      "get": {
        "operationId": "getPublicRoomsHandleUpdates",
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "parameters": [
          {
            "name": "handle",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "x-massrelay-shape": "untyped"
      }
    },
    "/public/trending": {
      "get": {
        "operationId": "getPublicTrending",
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "x-massrelay-shape": "untyped"
      }
    },
    "/public/version": {
      "get": {
        "operationId": "getPublicVersion",
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "x-massrelay-shape": "untyped"
      }
    },
    "/public/verticals/{pack}": {
      "get": {
        "operationId": "getPublicVerticalsPack",
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "parameters": [
          {
            "name": "pack",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "x-massrelay-shape": "untyped"
      }
    },
    "/public/waitlist": {
      "post": {
        "operationId": "postPublicWaitlist",
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "x-massrelay-shape": "untyped"
      }
    },
    "/public/waitlist/confirm": {
      "post": {
        "operationId": "postPublicWaitlistConfirm",
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "x-massrelay-shape": "untyped"
      }
    },
    "/public/waitlist/me": {
      "post": {
        "operationId": "postPublicWaitlistMe",
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "x-massrelay-shape": "untyped"
      }
    },
    "/public/waitlist/me/delete": {
      "post": {
        "operationId": "postPublicWaitlistMeDelete",
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "x-massrelay-shape": "untyped"
      }
    },
    "/public/waitlist/total": {
      "get": {
        "operationId": "getPublicWaitlistTotal",
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "x-massrelay-shape": "untyped"
      }
    },
    "/v1/audio/speech": {
      "post": {
        "operationId": "postV1AudioSpeech",
        "responses": {
          "200": {
            "description": "OK"
          },
          "401": {
            "description": "Missing or invalid credential"
          }
        },
        "security": [
          {
            "relayKey": []
          }
        ],
        "x-massrelay-shape": "untyped"
      }
    },
    "/v1/chat/completions": {
      "post": {
        "operationId": "postV1ChatCompletions",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "description": "Hand-written. Mirrors the public reference https://platform.openai.com/docs/api-reference/chat/object (read 2026-10-11), reduced to the fields this gateway reads: struct chat_completion_body in crates/mr-gateway/src/wire.rs. Every other field is accepted and not read (streaming responses are server-sent events and are not described here). Fields the gateway does not read are not documented as honoured.",
                  "type": "object",
                  "additionalProperties": true,
                  "required": [
                    "id",
                    "object",
                    "created",
                    "model",
                    "choices",
                    "usage"
                  ],
                  "properties": {
                    "id": {
                      "type": "string",
                      "description": "chatcmpl-<decisionId>; the decision id is the key of GET /v1/route/explain/{decisionId}."
                    },
                    "object": {
                      "const": "chat.completion"
                    },
                    "created": {
                      "type": "integer"
                    },
                    "model": {
                      "type": "string"
                    },
                    "choices": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "index": {
                            "type": "integer"
                          },
                          "message": {
                            "type": "object",
                            "properties": {
                              "role": {
                                "const": "assistant"
                              },
                              "content": {
                                "type": "string"
                              }
                            }
                          },
                          "finish_reason": {
                            "type": "string"
                          }
                        }
                      }
                    },
                    "usage": {
                      "type": "object",
                      "properties": {
                        "prompt_tokens": {
                          "type": "number"
                        },
                        "completion_tokens": {
                          "type": "number"
                        },
                        "total_tokens": {
                          "type": "number"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credential"
          }
        },
        "security": [
          {
            "relayKey": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "description": "Hand-written. Mirrors the public reference https://platform.openai.com/docs/api-reference/chat/create (read 2026-10-11), reduced to the fields this gateway reads: struct ChatBody in crates/mr-gateway/src/wire.rs. Every other field is accepted and not read (for example n, stop, top_p, seed are ignored). Fields the gateway does not read are not documented as honoured.",
                "type": "object",
                "required": [
                  "messages"
                ],
                "additionalProperties": true,
                "properties": {
                  "model": {
                    "type": "string",
                    "description": "A model id or an alias from GET /v1/models. Optional: the key's routing decides when absent."
                  },
                  "messages": {
                    "type": "array",
                    "minItems": 1,
                    "items": {
                      "type": "object",
                      "additionalProperties": true,
                      "properties": {
                        "role": {
                          "type": "string"
                        },
                        "content": {
                          "description": "Text; the gateway reads the text of a message.",
                          "type": [
                            "string",
                            "array"
                          ]
                        }
                      }
                    },
                    "description": "Required and non-empty; an empty or missing list is a 400."
                  },
                  "max_completion_tokens": {
                    "type": "number"
                  },
                  "max_tokens": {
                    "type": "number"
                  },
                  "temperature": {
                    "type": "number"
                  },
                  "stream": {
                    "type": "boolean",
                    "description": "Default false."
                  },
                  "tools": {
                    "description": "Carried and forwarded verbatim upstream; never validated here.",
                    "type": "array"
                  },
                  "response_format": {
                    "description": "Carried and forwarded verbatim upstream.",
                    "type": "object",
                    "additionalProperties": true
                  },
                  "reasoning_effort": {
                    "type": "string",
                    "description": "The o-series field; read as the request's effort."
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/credits": {
      "get": {
        "operationId": "getV1Credits",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "description": "Read against crates/mr-gateway/src/key_doors.rs `credits_inner`. The wallets are the key's workspace's own (owner kind workspace).",
                  "type": "object",
                  "required": [
                    "object",
                    "unit",
                    "displayCurrency",
                    "totalBalanceMu",
                    "totalAvailableMu",
                    "wallets",
                    "freeAllowanceLeft",
                    "freeAllowance"
                  ],
                  "properties": {
                    "object": {
                      "const": "credits"
                    },
                    "unit": {
                      "const": "mu"
                    },
                    "displayCurrency": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "totalBalanceMu": {
                      "type": "integer",
                      "description": "micro-dollars, the unit of account"
                    },
                    "totalAvailableMu": {
                      "type": "integer",
                      "description": "micro-dollars, the unit of account"
                    },
                    "wallets": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "id",
                          "kind",
                          "balanceMu",
                          "heldMu",
                          "availableMu",
                          "currency",
                          "expiresAt"
                        ],
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "kind": {
                            "enum": [
                              "prepaid",
                              "allowance",
                              "grant",
                              "pool",
                              "sponsor"
                            ]
                          },
                          "balanceMu": {
                            "type": "integer",
                            "description": "micro-dollars, the unit of account"
                          },
                          "heldMu": {
                            "type": "integer",
                            "description": "micro-dollars, the unit of account"
                          },
                          "availableMu": {
                            "type": "integer",
                            "description": "micro-dollars, the unit of account"
                          },
                          "currency": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "expiresAt": {
                            "type": [
                              "string",
                              "null"
                            ]
                          }
                        }
                      }
                    },
                    "freeAllowanceLeft": {
                      "type": [
                        "integer",
                        "null"
                      ],
                      "description": "requests left in this month's free allowance; null when the plan has none"
                    },
                    "freeAllowance": {
                      "type": [
                        "object",
                        "null"
                      ],
                      "properties": {
                        "meter": {
                          "type": "string"
                        },
                        "plan": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "allowance": {
                          "type": "integer"
                        },
                        "used": {
                          "type": "integer"
                        },
                        "resetsAt": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credential"
          }
        },
        "security": [
          {
            "relayKey": []
          }
        ]
      }
    },
    "/v1/generation/{id}": {
      "get": {
        "operationId": "getV1GenerationId",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "description": "Read against crates/mr-gateway/src/key_doors.rs `generation_inner`. 404 decision_not_found for another key's, another workspace's or a missing id.",
                  "type": "object",
                  "required": [
                    "object",
                    "id",
                    "model",
                    "provider",
                    "inputTokens",
                    "outputTokens",
                    "unit",
                    "costMu",
                    "fee",
                    "latencyMs",
                    "createdAt",
                    "explain"
                  ],
                  "properties": {
                    "object": {
                      "const": "generation"
                    },
                    "id": {
                      "type": "string"
                    },
                    "model": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "provider": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "inputTokens": {
                      "type": "integer"
                    },
                    "outputTokens": {
                      "type": "integer"
                    },
                    "unit": {
                      "const": "mu"
                    },
                    "costMu": {
                      "type": "integer",
                      "description": "micro-dollars, the unit of account"
                    },
                    "fee": {
                      "type": [
                        "object",
                        "null"
                      ],
                      "properties": {
                        "costMu": {
                          "type": "integer",
                          "description": "micro-dollars, the unit of account"
                        },
                        "plan": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "reason": {
                          "type": [
                            "string",
                            "null"
                          ]
                        }
                      }
                    },
                    "latencyMs": {
                      "type": [
                        "integer",
                        "null"
                      ]
                    },
                    "createdAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "explain": {
                      "type": "string",
                      "description": "the /v1/route/explain/{id} path"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credential"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "security": [
          {
            "relayKey": []
          }
        ]
      }
    },
    "/v1/images/generations": {
      "post": {
        "operationId": "postV1ImagesGenerations",
        "responses": {
          "200": {
            "description": "OK"
          },
          "401": {
            "description": "Missing or invalid credential"
          }
        },
        "security": [
          {
            "relayKey": []
          }
        ],
        "x-massrelay-shape": "untyped"
      }
    },
    "/v1/key": {
      "get": {
        "operationId": "getV1Key",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "description": "Read against crates/mr-gateway/src/key_doors.rs `key_body`.",
                  "type": "object",
                  "required": [
                    "object",
                    "id",
                    "prefix",
                    "scopes",
                    "budgetEnvelopeId",
                    "expiresAt",
                    "createdAt",
                    "lastUsedAt",
                    "unit",
                    "spendMu",
                    "period"
                  ],
                  "properties": {
                    "object": {
                      "const": "key"
                    },
                    "id": {
                      "type": "string"
                    },
                    "prefix": {
                      "type": "string"
                    },
                    "scopes": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "budgetEnvelopeId": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "expiresAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "lastUsedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "unit": {
                      "const": "mu"
                    },
                    "spendMu": {
                      "type": "integer",
                      "description": "micro-dollars, the unit of account"
                    },
                    "period": {
                      "type": "object",
                      "required": [
                        "from",
                        "to"
                      ],
                      "properties": {
                        "from": {
                          "type": "string"
                        },
                        "to": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credential"
          }
        },
        "security": [
          {
            "relayKey": []
          }
        ]
      }
    },
    "/v1/management/keys": {
      "get": {
        "operationId": "getV1ManagementKeys",
        "responses": {
          "200": {
            "description": "OK"
          },
          "401": {
            "description": "Missing or invalid credential"
          }
        },
        "security": [
          {
            "relayKey": []
          }
        ],
        "x-massrelay-shape": "untyped"
      },
      "post": {
        "operationId": "postV1ManagementKeys",
        "responses": {
          "200": {
            "description": "OK"
          },
          "401": {
            "description": "Missing or invalid credential"
          }
        },
        "security": [
          {
            "relayKey": []
          }
        ],
        "x-massrelay-shape": "untyped"
      }
    },
    "/v1/management/keys/{id}": {
      "get": {
        "operationId": "getV1ManagementKeysId",
        "responses": {
          "200": {
            "description": "OK"
          },
          "401": {
            "description": "Missing or invalid credential"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "security": [
          {
            "relayKey": []
          }
        ],
        "x-massrelay-shape": "untyped"
      },
      "delete": {
        "operationId": "deleteV1ManagementKeysId",
        "responses": {
          "200": {
            "description": "OK"
          },
          "401": {
            "description": "Missing or invalid credential"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "security": [
          {
            "relayKey": []
          }
        ],
        "x-massrelay-shape": "untyped"
      },
      "patch": {
        "operationId": "patchV1ManagementKeysId",
        "responses": {
          "200": {
            "description": "OK"
          },
          "401": {
            "description": "Missing or invalid credential"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "security": [
          {
            "relayKey": []
          }
        ],
        "x-massrelay-shape": "untyped"
      }
    },
    "/v1/media/{id}": {
      "get": {
        "operationId": "getV1MediaId",
        "responses": {
          "200": {
            "description": "OK"
          },
          "401": {
            "description": "Missing or invalid credential"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "security": [
          {
            "relayKey": []
          }
        ],
        "x-massrelay-shape": "untyped"
      }
    },
    "/v1/media/{id}/content": {
      "get": {
        "operationId": "getV1MediaIdContent",
        "responses": {
          "200": {
            "description": "OK"
          },
          "401": {
            "description": "Missing or invalid credential"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "security": [
          {
            "relayKey": []
          }
        ],
        "x-massrelay-shape": "untyped"
      }
    },
    "/v1/messages": {
      "post": {
        "operationId": "postV1Messages",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "description": "Hand-written. Mirrors the public reference https://docs.anthropic.com/en/api/messages (read 2026-10-11), reduced to the fields this gateway reads: struct messages_body in crates/mr-gateway/src/wire.rs. Every other field is accepted and not read (streaming is not described here). Fields the gateway does not read are not documented as honoured.",
                  "type": "object",
                  "additionalProperties": true,
                  "required": [
                    "id",
                    "type",
                    "role",
                    "model",
                    "content",
                    "stop_reason",
                    "usage"
                  ],
                  "properties": {
                    "id": {
                      "type": "string",
                      "description": "msg_<decisionId>"
                    },
                    "type": {
                      "const": "message"
                    },
                    "role": {
                      "const": "assistant"
                    },
                    "model": {
                      "type": "string"
                    },
                    "content": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "type": {
                            "const": "text"
                          },
                          "text": {
                            "type": "string"
                          }
                        }
                      }
                    },
                    "stop_reason": {
                      "type": "string"
                    },
                    "stop_sequence": {
                      "type": "null"
                    },
                    "usage": {
                      "type": "object",
                      "properties": {
                        "input_tokens": {
                          "type": "number"
                        },
                        "output_tokens": {
                          "type": "number"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credential"
          }
        },
        "security": [
          {
            "relayKey": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "description": "Hand-written. Mirrors the public reference https://docs.anthropic.com/en/api/messages (read 2026-10-11), reduced to the fields this gateway reads: struct MessagesBody in crates/mr-gateway/src/wire.rs. Every other field is accepted and not read (for example top_p, top_k, stop_sequences, tools are not read on this surface). Fields the gateway does not read are not documented as honoured.",
                "type": "object",
                "required": [
                  "messages"
                ],
                "additionalProperties": true,
                "properties": {
                  "model": {
                    "type": "string"
                  },
                  "messages": {
                    "type": "array",
                    "minItems": 1,
                    "items": {
                      "type": "object",
                      "additionalProperties": true,
                      "properties": {
                        "role": {
                          "type": "string"
                        },
                        "content": {
                          "type": [
                            "string",
                            "array"
                          ]
                        }
                      }
                    }
                  },
                  "system": {
                    "description": "A string, or a list of {type:text,text} blocks (joined). An empty list contributes nothing.",
                    "type": [
                      "string",
                      "array"
                    ]
                  },
                  "max_tokens": {
                    "type": "number"
                  },
                  "temperature": {
                    "type": "number"
                  },
                  "stream": {
                    "type": "boolean"
                  },
                  "thinking": {
                    "description": "This gateway reads a plain effort string, or an object with an effort field; it does not translate Anthropic's budget_tokens block.",
                    "type": [
                      "string",
                      "object"
                    ]
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/models": {
      "get": {
        "operationId": "getV1Models",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "description": "Hand-written. Mirrors the OpenAI list-models shape (https://platform.openai.com/docs/api-reference/models/list, read 2026-10-11) plus the massrelay extension block, read against models_inner in crates/mr-gateway/src/routes.rs. Served for an L1 key; any other key layer answers 501 not_ported. The massrelay keys listed are those the handler inserts; a key appears only when its source row exists.",
                  "type": "object",
                  "required": [
                    "object",
                    "data"
                  ],
                  "properties": {
                    "object": {
                      "const": "list"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "id",
                          "object"
                        ],
                        "properties": {
                          "id": {
                            "type": "string",
                            "description": "A model id, or an alias name (after the models)."
                          },
                          "object": {
                            "const": "model"
                          },
                          "massrelay": {
                            "type": "object",
                            "additionalProperties": true,
                            "properties": {
                              "provider": {
                                "type": "string"
                              },
                              "custody": {
                                "type": "string"
                              },
                              "family": {
                                "type": "string"
                              },
                              "reasoning_options": {},
                              "price_bands": {
                                "type": "array"
                              },
                              "ownedBy": {
                                "const": "workspace",
                                "description": "Present only for the workspace's own model."
                              },
                              "inputUsdPerM": {
                                "type": "number"
                              },
                              "outputUsdPerM": {
                                "type": "number"
                              },
                              "alias": {
                                "const": true,
                                "description": "Present on an alias entry."
                              },
                              "startTier": {},
                              "preferOwnModels": {
                                "type": "boolean"
                              }
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credential"
          }
        },
        "security": [
          {
            "relayKey": []
          }
        ]
      }
    },
    "/v1/policy": {
      "get": {
        "operationId": "getV1Policy",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "description": "Hand-written, read against crates/mr-gateway/src/routes.rs `policy` -> authenticated_not_ported -> not_ported. Today the door authenticates the key and then answers 501; it returns no policy document. The shape below is that 501 body, stated so a caller does not expect more.",
                  "type": "object",
                  "required": [
                    "error",
                    "route"
                  ],
                  "properties": {
                    "error": {
                      "const": "not_ported"
                    },
                    "route": {
                      "const": "GET /v1/policy"
                    }
                  },
                  "x-massrelay-status": 501
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credential"
          }
        },
        "security": [
          {
            "relayKey": []
          }
        ]
      }
    },
    "/v1/responses": {
      "post": {
        "operationId": "postV1Responses",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "description": "Hand-written. Mirrors the public reference https://platform.openai.com/docs/api-reference/responses/object (read 2026-10-11), reduced to the fields this gateway reads: struct responses_body in crates/mr-gateway/src/wire.rs. Every other field is accepted and not read (streaming is not described here). Fields the gateway does not read are not documented as honoured.",
                  "type": "object",
                  "additionalProperties": true,
                  "required": [
                    "id",
                    "object",
                    "status",
                    "output",
                    "output_text",
                    "usage"
                  ],
                  "properties": {
                    "id": {
                      "type": "string",
                      "description": "resp_<decisionId>"
                    },
                    "object": {
                      "const": "response"
                    },
                    "created_at": {
                      "type": "integer"
                    },
                    "model": {
                      "type": "string"
                    },
                    "status": {
                      "const": "completed"
                    },
                    "output": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "type": {
                            "const": "message"
                          },
                          "id": {
                            "type": "string"
                          },
                          "status": {
                            "type": "string"
                          },
                          "role": {
                            "const": "assistant"
                          },
                          "content": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "type": {
                                  "const": "output_text"
                                },
                                "text": {
                                  "type": "string"
                                },
                                "annotations": {
                                  "type": "array"
                                }
                              }
                            }
                          }
                        }
                      }
                    },
                    "output_text": {
                      "type": "string"
                    },
                    "usage": {
                      "type": "object",
                      "properties": {
                        "input_tokens": {
                          "type": "number"
                        },
                        "output_tokens": {
                          "type": "number"
                        },
                        "total_tokens": {
                          "type": "number"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credential"
          }
        },
        "security": [
          {
            "relayKey": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "description": "Hand-written. Mirrors the public reference https://platform.openai.com/docs/api-reference/responses/create (read 2026-10-11), reduced to the fields this gateway reads: struct ResponsesBody in crates/mr-gateway/src/wire.rs. Every other field is accepted and not read (tools and previous_response_id are not read on this surface). Fields the gateway does not read are not documented as honoured.",
                "type": "object",
                "required": [
                  "input"
                ],
                "additionalProperties": true,
                "properties": {
                  "model": {
                    "type": "string"
                  },
                  "input": {
                    "description": "Required: a string or a list of {role?, content} items (role defaults to user).",
                    "type": [
                      "string",
                      "array"
                    ]
                  },
                  "instructions": {
                    "type": "string",
                    "description": "Becomes a leading system message; blank text contributes nothing."
                  },
                  "max_output_tokens": {
                    "type": "number"
                  },
                  "temperature": {
                    "type": "number"
                  },
                  "stream": {
                    "type": "boolean"
                  },
                  "reasoning": {
                    "type": "object",
                    "properties": {
                      "effort": {
                        "type": "string"
                      }
                    },
                    "additionalProperties": true,
                    "description": "Only reasoning.effort is read."
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/route/explain/{decisionId}": {
      "get": {
        "operationId": "getV1RouteExplainDecisionId",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "description": "Hand-written, read against explain_for_key in crates/mr-gateway/src/decisions.rs (the GatewayExplainDto plus the MC-1b/RT-2 additions). 404 decision_not_found for an unknown id or another workspace's id. The `explain` scope is required on the key.",
                  "type": "object",
                  "required": [
                    "decisionId",
                    "rationale",
                    "taskClass",
                    "chosenTier",
                    "createdAt"
                  ],
                  "properties": {
                    "decisionId": {
                      "type": "string"
                    },
                    "rationale": {
                      "type": "string",
                      "description": "Rendered from rationaleTemplateId."
                    },
                    "rationaleTemplateId": {
                      "type": "string"
                    },
                    "taskClass": {
                      "type": "string"
                    },
                    "classSource": {
                      "type": "string"
                    },
                    "chosenModel": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "chosenTier": {
                      "type": "string"
                    },
                    "effort": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "borrowLevel": {
                      "type": "string"
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "catalogVersion": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "dataClass": {
                      "type": "string"
                    },
                    "consequenceClass": {
                      "type": "string"
                    },
                    "intentSource": {
                      "type": "string"
                    },
                    "excluded": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "model": {
                            "type": "string"
                          },
                          "reason": {},
                          "policies": {
                            "type": "array"
                          },
                          "detail": {}
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credential"
          }
        },
        "parameters": [
          {
            "name": "decisionId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "security": [
          {
            "relayKey": []
          }
        ]
      }
    },
    "/v1/usage": {
      "get": {
        "operationId": "getV1Usage",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "description": "Read against crates/mr-gateway/src/key_doors.rs `usage_body`. Query: from, to (ISO date or datetime, default the UTC calendar month), end_user (one tag), group_by=end_user (one row per tag).",
                  "type": "object",
                  "required": [
                    "object",
                    "unit",
                    "period",
                    "requests",
                    "inputTokens",
                    "outputTokens",
                    "costMu"
                  ],
                  "properties": {
                    "object": {
                      "const": "usage"
                    },
                    "unit": {
                      "const": "mu"
                    },
                    "period": {
                      "type": "object",
                      "required": [
                        "from",
                        "to"
                      ],
                      "properties": {
                        "from": {
                          "type": "string"
                        },
                        "to": {
                          "type": "string"
                        }
                      }
                    },
                    "endUser": {
                      "type": "string"
                    },
                    "requests": {
                      "type": "integer"
                    },
                    "inputTokens": {
                      "type": "integer"
                    },
                    "outputTokens": {
                      "type": "integer"
                    },
                    "costMu": {
                      "type": "integer",
                      "description": "micro-dollars, the unit of account"
                    },
                    "byEndUser": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "endUser",
                          "requests",
                          "inputTokens",
                          "outputTokens",
                          "costMu"
                        ],
                        "properties": {
                          "endUser": {
                            "type": "string"
                          },
                          "requests": {
                            "type": "integer"
                          },
                          "inputTokens": {
                            "type": "integer"
                          },
                          "outputTokens": {
                            "type": "integer"
                          },
                          "costMu": {
                            "type": "integer",
                            "description": "micro-dollars, the unit of account"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credential"
          }
        },
        "security": [
          {
            "relayKey": []
          }
        ]
      }
    },
    "/v1/videos": {
      "post": {
        "operationId": "postV1Videos",
        "responses": {
          "200": {
            "description": "OK"
          },
          "401": {
            "description": "Missing or invalid credential"
          }
        },
        "security": [
          {
            "relayKey": []
          }
        ],
        "x-massrelay-shape": "untyped"
      }
    },
    "/v1/videos/{id}": {
      "get": {
        "operationId": "getV1VideosId",
        "responses": {
          "200": {
            "description": "OK"
          },
          "401": {
            "description": "Missing or invalid credential"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "security": [
          {
            "relayKey": []
          }
        ],
        "x-massrelay-shape": "untyped"
      }
    },
    "/v1/videos/{id}/content": {
      "get": {
        "operationId": "getV1VideosIdContent",
        "responses": {
          "200": {
            "description": "OK"
          },
          "401": {
            "description": "Missing or invalid credential"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "security": [
          {
            "relayKey": []
          }
        ],
        "x-massrelay-shape": "untyped"
      }
    }
  },
  "x-massrelay-generated": {
    "by": "tools/api/openapi.mjs",
    "inputSha256": "126a656a34ecd9b6"
  }
}
