{
  "openapi": "3.0.3",
  "info": {
    "title": "tty000 API",
    "version": "1.2.0",
    "description": "Text tools from tty000.com. Free. MIT license. No API key. Bodies are not stored. Serial endpoints exist only on python3 server.py --helper, not on tty000.com. Product: https://tty000.com/",
    "license": { "name": "MIT", "url": "https://tty000.com/LICENSE" }
  },
  "servers": [
    { "url": "https://tty000.com", "description": "Public text APIs" },
    { "url": "http://127.0.0.1:7682", "description": "Local helper (serial + text)" }
  ],
  "paths": {
    "/api/detect": {
      "post": {
        "summary": "Identify a serial dump",
        "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "required": ["text"], "properties": { "text": { "type": "string" }, "baud": { "type": "integer", "nullable": true } } } } } },
        "responses": { "200": { "description": "Detection report" } }
      }
    },
    "/api/explain": {
      "post": {
        "summary": "Explain a dump or live capture",
        "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "required": ["text"], "properties": { "text": { "type": "string" } } } } } },
        "responses": { "200": { "description": "Findings" } }
      }
    },
    "/api/batch": {
      "post": {
        "summary": "Detect, explain, and ANSI stats in one call",
        "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "required": ["text"], "properties": { "text": { "type": "string" }, "baud": { "type": "integer" } } } } } },
        "responses": { "200": { "description": "Combined report" } }
      }
    },
    "/api/baud": {
      "get": { "summary": "Bit time and cable rule of thumb", "parameters": [{ "name": "baud", "in": "query", "schema": { "type": "integer" } }], "responses": { "200": { "description": "Timing" } } },
      "post": { "summary": "Bit time and cable rule of thumb", "responses": { "200": { "description": "Timing" } } }
    },
    "/api/diff": { "post": { "summary": "Diff two dumps", "responses": { "200": { "description": "Hunks" } } } },
    "/api/strip": { "post": { "summary": "Strip ANSI", "responses": { "200": { "description": "Plain text" } } } },
    "/api/stats": { "post": { "summary": "Count CSI / OSC / SGR", "responses": { "200": { "description": "Counts" } } } },
    "/api/hex": { "post": { "summary": "Hex dump or decode", "responses": { "200": { "description": "Dump" } } } },
    "/api/nmea": { "post": { "summary": "Parse NMEA sentences", "responses": { "200": { "description": "Sentences" } } } },
    "/api/at": { "post": { "summary": "Parse AT dialogue", "responses": { "200": { "description": "Commands and replies" } } } },
    "/api/crc": { "post": { "summary": "CRC8 / CRC16 / CRC32", "responses": { "200": { "description": "Checksum" } } } },
    "/api/profiles": { "get": { "summary": "Board baud profiles", "responses": { "200": { "description": "Profiles" } } } },
    "/api/families": { "get": { "summary": "Detect families and error rules", "responses": { "200": { "description": "Catalog" } } } },
    "/api/health": { "get": { "summary": "Liveness", "responses": { "200": { "description": "Health" } } } },
    "/api/version": { "get": { "summary": "API version", "responses": { "200": { "description": "Version" } } } }
  }
}
