{
  "openapi": "3.1.0",
  "info": {
    "title": "Caliper API",
    "version": "1.0.0",
    "summary": "Public HTTP API for caliper.run.",
    "description": "Caliper ships as an open-source Claude Code plugin (install with `/plugin marketplace add Cost-Caliper/caliper` then `/plugin install caliper@caliper`). The only public HTTP endpoint on caliper.run is the waitlist signup endpoint documented here. It accepts an email address (and an optional referral code) only — no other personal information. See https://caliper.run/developers and https://caliper.run/signup.txt.",
    "contact": {
      "name": "Caliper",
      "email": "hello@caliper.run",
      "url": "https://caliper.run/developers"
    },
    "license": {
      "name": "MIT",
      "url": "https://github.com/Cost-Caliper/caliper"
    }
  },
  "servers": [
    {
      "url": "https://caliper.run",
      "description": "Production"
    }
  ],
  "paths": {
    "/api/signup": {
      "post": {
        "operationId": "joinWaitlist",
        "security": [],
        "summary": "Join the Caliper waitlist",
        "description": "Adds an email address to the Caliper waitlist for the hosted product (automatic model routing and a custom model trained on your own usage). Accepts an email and an optional referral code only. The free, open-source plugin works today without any signup.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": { "$ref": "#/components/schemas/SignupRequest" },
              "examples": {
                "email": {
                  "summary": "Email only",
                  "value": { "email": "you@company.com" }
                },
                "withReferral": {
                  "summary": "With a referral code",
                  "value": { "email": "you@company.com", "ref": "abc123" }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Signed up (or already on the list).",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/SignupSuccess" },
                "example": { "ok": true, "referralCode": "abc123def0", "alreadyJoined": false }
              }
            }
          },
          "400": {
            "description": "Invalid request body or email.",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/SignupError" },
                "example": { "ok": false, "error": "Please enter a valid work email." }
              }
            }
          }
        }
      },
      "get": {
        "operationId": "signupUsage",
        "security": [],
        "summary": "Usage hint (method not allowed)",
        "description": "The signup endpoint only accepts POST. A GET returns 405 with instructions.",
        "responses": {
          "405": {
            "description": "Method not allowed. Use POST.",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/SignupError" },
                "example": {
                  "ok": false,
                  "error": "Use POST with a JSON body: { \"email\": \"you@company.com\" }. See /signup.txt for full instructions."
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "SignupRequest": {
        "type": "object",
        "required": ["email"],
        "additionalProperties": false,
        "properties": {
          "email": {
            "type": "string",
            "format": "email",
            "description": "Work email to add to the waitlist.",
            "example": "you@company.com"
          },
          "ref": {
            "type": "string",
            "description": "Optional referral code to credit whoever referred this signup.",
            "example": "abc123"
          }
        }
      },
      "SignupSuccess": {
        "type": "object",
        "required": ["ok", "referralCode", "alreadyJoined"],
        "properties": {
          "ok": { "type": "boolean", "const": true },
          "referralCode": {
            "type": "string",
            "description": "The referral code assigned to this signup. Share it to move up the list."
          },
          "alreadyJoined": {
            "type": "boolean",
            "description": "True if this email was already on the waitlist."
          }
        }
      },
      "SignupError": {
        "type": "object",
        "required": ["ok", "error"],
        "properties": {
          "ok": { "type": "boolean", "const": false },
          "error": { "type": "string", "description": "Human-readable error message." }
        }
      }
    }
  }
}
