{
  "openapi": "3.1.0",
  "info": {
    "title": "LLM Cutover API",
    "version": "1.0.0",
    "description": "Check whether a cheaper model (Sage 2) agrees with your current LLM on your own samples, and what a confidence-routed hybrid would cost per month. Anonymous tier: 3 audits/day per IP, 10 samples, shared daily pool; no key needed. Full tier: send the pass token from a $49 full audit as a Bearer key (5 runs, 30 days, up to 500 samples). Docs: https://llmcutover.com/docs/",
    "contact": {
      "email": "contact@llmcutover.com",
      "url": "https://llmcutover.com/docs/"
    },
    "termsOfService": "https://llmcutover.com/legal/"
  },
  "servers": [
    {
      "url": "https://api.llmcutover.com"
    }
  ],
  "components": {
    "securitySchemes": {
      "pass": {
        "type": "http",
        "scheme": "bearer",
        "description": "Full-audit pass token (shown after checkout on /full/). Optional: without it you get the anonymous tier."
      }
    }
  },
  "paths": {
    "/api/v1/audit": {
      "post": {
        "operationId": "runCutoverAudit",
        "summary": "Run a cutover audit on your samples",
        "security": [
          {},
          {
            "pass": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "mode",
                  "samples",
                  "current"
                ],
                "properties": {
                  "mode": {
                    "type": "string",
                    "enum": [
                      "yesno",
                      "extract"
                    ],
                    "description": "yesno: a yes/no decision per text. extract: fields pulled out of each text."
                  },
                  "question": {
                    "type": "string",
                    "maxLength": 600,
                    "description": "yesno only. The yes/no question your current model answers, e.g. \"Is this ticket about billing?\""
                  },
                  "fields": {
                    "type": "object",
                    "description": "extract only. Up to 12 fields: {\"name\": {\"type\": \"string|number|integer|boolean|date|money\", \"definition\": \"...\"}}",
                    "additionalProperties": {
                      "type": "object",
                      "properties": {
                        "type": {
                          "type": "string",
                          "enum": [
                            "string",
                            "number",
                            "integer",
                            "boolean",
                            "date",
                            "money"
                          ]
                        },
                        "definition": {
                          "type": "string",
                          "maxLength": 300
                        }
                      }
                    }
                  },
                  "samples": {
                    "description": "Real inputs with the answer your CURRENT model gave. Array of objects or a JSONL/CSV string. yesno: {\"text\",\"label\":\"yes|no\"}; extract: {\"text\",\"expected\":{...}}. Each text ≤ 4000 chars. Min 5. Max 10 anonymous, 25 free on the website, 500 yesno / 200 extract with a pass.",
                    "oneOf": [
                      {
                        "type": "array",
                        "minItems": 5,
                        "items": {
                          "type": "object",
                          "properties": {
                            "text": {
                              "type": "string"
                            },
                            "label": {
                              "type": "string",
                              "enum": [
                                "yes",
                                "no"
                              ]
                            },
                            "expected": {
                              "type": "object"
                            }
                          },
                          "required": [
                            "text"
                          ]
                        }
                      },
                      {
                        "type": "string"
                      }
                    ]
                  },
                  "current": {
                    "type": "object",
                    "description": "Your current model: {\"model\": \"<id from GET /api/models>\", \"effort\": \"<level>\"} or custom prices {\"in\": USD per 1M input tokens, \"out\": USD per 1M output tokens}.",
                    "properties": {
                      "model": {
                        "type": "string",
                        "enum": [
                          "claude-fable-5.1",
                          "claude-opus-5.5",
                          "claude-sonnet-5.5",
                          "claude-haiku-5.5",
                          "gpt-6-astra",
                          "gpt-5.6-sol",
                          "gpt-6.1-sol",
                          "gpt-6.1-terra",
                          "gpt-5-mini",
                          "gpt-6-luna",
                          "gemini-4-argon",
                          "gemini-3.8-flash",
                          "gemini-3.1-flash-lite"
                        ]
                      },
                      "effort": {
                        "type": "string"
                      },
                      "in": {
                        "type": "number",
                        "minimum": 0,
                        "maximum": 1000
                      },
                      "out": {
                        "type": "number",
                        "minimum": 0,
                        "maximum": 1000
                      }
                    }
                  },
                  "target": {
                    "type": "number",
                    "enum": [
                      0.95,
                      0.98,
                      0.99
                    ],
                    "default": 0.98,
                    "description": "Agreement you need on the calls the cheap model keeps."
                  },
                  "usage": {
                    "type": "object",
                    "properties": {
                      "monthlyCalls": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 1000000000,
                        "default": 100000
                      },
                      "promptOverheadTokens": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 20000,
                        "default": 400
                      },
                      "outputTokens": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 4000
                      },
                      "reasoningTokens": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 50000,
                        "description": "Measured reasoning tokens per call, if you know them; otherwise estimated from effort."
                      }
                    }
                  }
                }
              },
              "example": {
                "mode": "yesno",
                "question": "Is this support ticket about billing?",
                "current": {
                  "model": "gpt-6.1-sol",
                  "effort": "medium"
                },
                "usage": {
                  "monthlyCalls": 200000
                },
                "samples": [
                  {
                    "text": "I was charged twice this month",
                    "label": "yes"
                  },
                  {
                    "text": "App crashes on login",
                    "label": "no"
                  },
                  {
                    "text": "Refund for my last invoice?",
                    "label": "yes"
                  },
                  {
                    "text": "How do I export my data",
                    "label": "no"
                  },
                  {
                    "text": "Card declined at checkout",
                    "label": "yes"
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Audit report: agreement, routing threshold and coverage, monthly cost now vs hybrid.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "mode": {
                      "type": "string"
                    },
                    "metrics": {
                      "type": "object"
                    },
                    "cost": {
                      "type": "object"
                    },
                    "fullCutover": {
                      "type": "object"
                    },
                    "sampleNote": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "runsLeft": {
                      "type": "integer"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Pass token invalid or expired.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "type": {
                      "type": "string"
                    },
                    "title": {
                      "type": "string"
                    },
                    "status": {
                      "type": "integer"
                    },
                    "retry_after": {
                      "type": "integer"
                    }
                  }
                }
              }
            }
          },
          "413": {
            "description": "Body too large.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "type": {
                      "type": "string"
                    },
                    "title": {
                      "type": "string"
                    },
                    "status": {
                      "type": "integer"
                    },
                    "retry_after": {
                      "type": "integer"
                    }
                  }
                }
              }
            }
          },
          "415": {
            "description": "Send application/json.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "type": {
                      "type": "string"
                    },
                    "title": {
                      "type": "string"
                    },
                    "status": {
                      "type": "integer"
                    },
                    "retry_after": {
                      "type": "integer"
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Input problem (title says what).",
            "content": {
              "application/problem+json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "type": {
                      "type": "string"
                    },
                    "title": {
                      "type": "string"
                    },
                    "status": {
                      "type": "integer"
                    },
                    "retry_after": {
                      "type": "integer"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Rate limited: see Retry-After and RateLimit headers.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "type": {
                      "type": "string"
                    },
                    "title": {
                      "type": "string"
                    },
                    "status": {
                      "type": "integer"
                    },
                    "retry_after": {
                      "type": "integer"
                    }
                  }
                }
              }
            }
          },
          "503": {
            "description": "Daily capacity used up or service paused: see Retry-After.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "type": {
                      "type": "string"
                    },
                    "title": {
                      "type": "string"
                    },
                    "status": {
                      "type": "integer"
                    },
                    "retry_after": {
                      "type": "integer"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/models": {
      "get": {
        "operationId": "listModels",
        "summary": "Price table, effort levels, limits",
        "responses": {
          "200": {
            "description": "Models and limits",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/api/health": {
      "get": {
        "operationId": "health",
        "summary": "Liveness",
        "responses": {
          "200": {
            "description": "ok"
          }
        }
      }
    },
    "/mcp": {
      "post": {
        "operationId": "mcp",
        "summary": "Remote MCP server (Streamable HTTP, JSON responses). Tool: run_cutover_audit.",
        "responses": {
          "200": {
            "description": "JSON-RPC 2.0 response"
          }
        }
      }
    }
  }
}