{
  "openapi": "3.1.0",
  "info": {
    "title": "CutKit API",
    "version": "1.0.0",
    "summary": "Manage the scripts the CutKit iPhone teleprompter reads.",
    "description": "Every script in a person's CutKit library, over HTTPS with an API key. Anything you create here shows up in the iPhone app the next time it opens, and anything they write on the phone shows up here. The same operations are available as a remote MCP server at https://getcutkit.com/mcp and as the cutkit-scripts CLI. Human docs: https://getcutkit.com/docs/api",
    "contact": {
      "email": "hello@getcutkit.com",
      "url": "https://getcutkit.com/docs/api"
    }
  },
  "externalDocs": {
    "url": "https://getcutkit.com/docs/api",
    "description": "Guide, examples and the MCP setup"
  },
  "servers": [
    {
      "url": "https://getcutkit.com"
    }
  ],
  "security": [
    {
      "apiKey": []
    },
    {
      "oauth2": [
        "scripts"
      ]
    }
  ],
  "tags": [
    {
      "name": "Scripts",
      "description": "The teleprompter scripts in one library."
    },
    {
      "name": "Templates",
      "description": "The library of opening lines and re-hooks to build on."
    },
    {
      "name": "Check",
      "description": "Scores script craft from 0 to 100. It doesn't predict views. Check, apply the failing fixes, check again."
    },
    {
      "name": "Keys",
      "description": "The library an API key opens, and the key itself."
    },
    {
      "name": "Profile",
      "description": "Who the creator is and who their videos are for. The check grades against it."
    },
    {
      "name": "Library",
      "description": "Logos, stock video, music, vintage footage, images and sounds a video can use, each with its licence and credit line."
    }
  ],
  "paths": {
    "/api/v1/templates": {
      "get": {
        "tags": [
          "Templates"
        ],
        "operationId": "listTemplates",
        "summary": "List the template library",
        "description": "The templates for a hook, each an opening line paired with its re-hook for the middle, with the families. Public, no key. MCP: list_templates.",
        "security": [],
        "parameters": [
          {
            "name": "family",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "promise",
                "diagnosis",
                "belief-break",
                "in-medias-res",
                "tribe",
                "artefact",
                "number",
                "question",
                "news",
                "contradiction",
                "warning"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The templates that match, and the family rows for them.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TemplateCatalog"
                }
              }
            }
          },
          "400": {
            "description": "An unknown family (invalid_family).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/templates/{id}": {
      "get": {
        "tags": [
          "Templates"
        ],
        "operationId": "getTemplate",
        "summary": "Read one template",
        "description": "One template and its family. Public, no key. MCP: get_template.",
        "security": [],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "A template id from GET /api/v1/templates."
          }
        ],
        "responses": {
          "200": {
            "description": "The template.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "template",
                    "family"
                  ],
                  "properties": {
                    "template": {
                      "$ref": "#/components/schemas/TemplateEntry"
                    },
                    "family": {
                      "$ref": "#/components/schemas/TemplateFamily"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "No template with that id (unknown_template).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/templates/{id}/scripts": {
      "post": {
        "tags": [
          "Templates",
          "Scripts"
        ],
        "operationId": "startFromTemplate",
        "summary": "Start a script from a template",
        "description": "Adds a script built on the template, the same draft the app makes: the opening line and its re-hook in place and a [bracket] for each beat to write. The body is optional. Fill the brackets with PATCH /api/v1/scripts/{id}, then POST /api/v1/check. MCP: start_from_template.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "A template id from GET /api/v1/templates."
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "title": {
                    "type": "string",
                    "description": "Defaults to the template's name."
                  },
                  "pinned": {
                    "type": "boolean"
                  },
                  "labels": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "status": {
                    "type": "string",
                    "enum": [
                      "draft",
                      "to_record",
                      "recorded",
                      "archived"
                    ]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The new script.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "script"
                  ],
                  "properties": {
                    "script": {
                      "$ref": "#/components/schemas/Script"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "A field is the wrong type, or a body was sent (invalid_body).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key (missing_key, invalid_key).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The free plan holds 1 script, archived ones included, and the library has it (script_limit). Pro or a trial has no limit, and edits, archives and deletes always go through.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "No template with that id (unknown_template).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "The library is full (library_full).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/plan": {
      "post": {
        "tags": [
          "Templates",
          "Scripts"
        ],
        "operationId": "planMonth",
        "summary": "Plan 30 days of scripts",
        "description": "Writes 30 draft scripts with AI, one a day, rotating through 1 to 6 topics and 5 hook shapes from different families. Each is titled Day N and labelled with its topic. Days still being written when the response returns carry the label Writing and fill in on the next sync; a day that failed keeps its template and carries Needs writing. A day still marked Writing 2 minutes on turns to Needs writing. Planning needs CutKit Pro or a trial on the account that owns the library, and a plan that wrote no day doesn't count against the quota. The response adds the plan quota. MCP: plan_month.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "topics"
                ],
                "additionalProperties": false,
                "properties": {
                  "topics": {
                    "type": "array",
                    "minItems": 1,
                    "maxItems": 6,
                    "items": {
                      "type": "string"
                    },
                    "description": "1 to 6 topics, each a non-empty string."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The 30 new scripts.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "scripts"
                  ],
                  "properties": {
                    "scripts": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Script"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Topics are missing or wrong (invalid_topics).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key (missing_key, invalid_key).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The library's account isn't on Pro or a trial, or no account owns the library (plan_needs_pro).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "The library has no room for 30 more scripts (library_full).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "5 plans in the last 24 hours (plan_limit).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Planning isn't available right now (plan_unavailable).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/library/search": {
      "get": {
        "operationId": "searchLibrary",
        "tags": [
          "Library"
        ],
        "summary": "Search one media library shelf",
        "description": "Pictures, footage, music and sounds a video can use, each with the licence that lets it be published and the credit line to show when that licence asks for one. Every item is licensed for a paid app and a published video: no NC, ND or share-alike. The pinterest and arena shelves are the exception: they hold the person's own saves from an account connected at /app/connect, with licence own-saves because the licence is unknown, and an empty q lists the latest saves. Needs CutKit Pro or a trial. Counts against a cap of 300 searches a rolling day; a failed search doesn't count.",
        "parameters": [
          {
            "name": "shelf",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "logos",
                "stock",
                "music",
                "vintage",
                "images",
                "sounds",
                "pinterest",
                "arena"
              ]
            }
          },
          {
            "name": "q",
            "in": "query",
            "required": false,
            "description": "Required with 1 or more characters, except on pinterest and arena, where it may be empty or left out.",
            "schema": {
              "type": "string",
              "minLength": 0,
              "maxLength": 100
            }
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 50,
              "default": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "One page of the shelf. `next` is the page to ask for next, absent on the last.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LibraryPage"
                }
              }
            }
          },
          "400": {
            "description": "A bad shelf, query or page (invalid_shelf, invalid_query, invalid_page).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid key, or no account owns the library (account_required).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The account isn't on Pro or a trial (library_needs_pro), or an Are.na search came from an account without Are.na Premium (arena_search_needs_premium).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "The shelf's Pinterest or Are.na account isn't connected, or was disconnected there (not_connected).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Today's searches are used (library_limit).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "The shelf's provider didn't answer (library_unavailable).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/library/file": {
      "get": {
        "operationId": "getLibraryFile",
        "tags": [
          "Library"
        ],
        "summary": "Download a library file that needs CutKit's key",
        "description": "A logo.dev logo as PNG. Use the thumbUrl or downloadUrl a search returned, as is: the signature in it is what lets the request in, so it takes no key.",
        "security": [],
        "parameters": [
          {
            "name": "provider",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "logo.dev"
              ]
            }
          },
          {
            "name": "domain",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "size",
            "in": "query",
            "required": true,
            "schema": {
              "type": "integer",
              "enum": [
                128,
                512
              ]
            }
          },
          {
            "name": "sig",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The image.",
            "content": {
              "image/png": {}
            }
          },
          "400": {
            "description": "A bad provider, domain or size (invalid_provider, invalid_file).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The signature doesn't match (invalid_signature).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "logo.dev has no logo for that brand (logo_not_found).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "logo.dev didn't answer (logo_unavailable).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "The logo is still being indexed, or logos are off (logo_pending, logo_unavailable).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/lint": {
      "post": {
        "tags": [
          "Check"
        ],
        "operationId": "lintScript",
        "summary": "Lint a script offline",
        "description": "Runs only the checks that need no model: first line length, a greeting or stalling opener, hedges, a flat stretch and AI-sounding text. No quota, instant, saves nothing. Lint until clean, then spend a real check. Send body or the id of a script in this library. MCP: lint_script.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "body": {
                    "type": "string"
                  },
                  "id": {
                    "type": "string"
                  }
                },
                "anyOf": [
                  {
                    "required": [
                      "body"
                    ]
                  },
                  {
                    "required": [
                      "id"
                    ]
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The lint result.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LintResult"
                }
              }
            }
          },
          "400": {
            "description": "A field is the wrong type or too long.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key (missing_key, invalid_key).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/contract": {
      "get": {
        "tags": [
          "Check"
        ],
        "operationId": "getContract",
        "summary": "The API contract version",
        "description": "The contract version, how many checks run and the hook shape. No key needed. `cutkit-scripts doctor` compares it with the version the CLI expects.",
        "responses": {
          "200": {
            "description": "The contract.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Contract"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/check": {
      "post": {
        "tags": [
          "Check"
        ],
        "operationId": "checkScript",
        "summary": "Check a script's craft",
        "description": "Needs CutKit Pro or a trial on the account that owns the library. Grades 14 things: first line length, opening speed, hook shape, second beat, re-hook, payoff, no self-promise, the ask, two points before the ask, a named idea, stakes, no hedges, no long flat stretch and no AI-sounding text. Answers a score out of 100 and, for each failing item a fix and templateIds from GET /api/v1/templates. It doesn't predict views and saves nothing. Send body (15 to 2,000 words) or the id of a script in this library. 100 a day, counted over a rolling 24 hours, and the answer carries quota with what's left and when the next slot opens. Identical text checked again within 24 hours returns the stored answer free (cached: true). Items under 0.6 confidence come back unsure and count 0 in the score. To improve a script: POST /api/v1/lint until clean, then check, apply the fixes, PATCH the script, check again. MCP: check_script.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "body": {
                    "type": "string"
                  },
                  "id": {
                    "type": "string"
                  }
                },
                "anyOf": [
                  {
                    "required": [
                      "body"
                    ]
                  },
                  {
                    "required": [
                      "id"
                    ]
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The script check.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ScriptCheck"
                }
              }
            }
          },
          "400": {
            "description": "A field is the wrong type or too long.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key (missing_key, invalid_key).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The script coach needs CutKit Pro or a trial: no account owns this library (401 account_required), or the account isn't on Pro (403 coach_needs_pro).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "The request was refused. See error.code.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "The request was refused. See error.code.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "The request was refused. See error.code.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/app/api/check": {
      "post": {
        "tags": [
          "Check"
        ],
        "operationId": "checkSignedInScript",
        "summary": "Check the signed-in editor's script",
        "description": "The web app route. It takes body and uses the signed-in session cookie.",
        "security": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "body"
                ],
                "properties": {
                  "body": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The script check.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ScriptCheck"
                }
              }
            }
          },
          "400": {
            "description": "A field is the wrong type or too long.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The script coach needs CutKit Pro or a trial: no account owns this library (401 account_required), or the account isn't on Pro (403 coach_needs_pro).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "The request was refused. See error.code.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "The request was refused. See error.code.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/rewrite": {
      "post": {
        "tags": [
          "Check"
        ],
        "operationId": "rewriteScript",
        "summary": "Rewrite a script so its failing checks pass",
        "description": "Needs CutKit Pro or a trial on the account that owns the library. Checks the script, then hands the result to a model that rewrites it to fix what failed, in the same voice and with the same facts. Answers the new text and saves nothing: PATCH the script to keep it, then check again. Send body (15 to 2,000 words) or the id of a script in this library. Uses one check. 50 a day.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "body": {
                    "type": "string"
                  },
                  "id": {
                    "type": "string"
                  }
                },
                "anyOf": [
                  {
                    "required": [
                      "body"
                    ]
                  },
                  {
                    "required": [
                      "id"
                    ]
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The rewrite.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ScriptRewrite"
                }
              }
            }
          },
          "400": {
            "description": "A field is the wrong type or too long.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key (missing_key, invalid_key).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The script coach needs CutKit Pro or a trial: no account owns this library (401 account_required), or the account isn't on Pro (403 coach_needs_pro).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "The request was refused. See error.code.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "The request was refused. See error.code.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "The request was refused. See error.code.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/app/api/rewrite": {
      "post": {
        "tags": [
          "Check"
        ],
        "operationId": "rewriteSignedInScript",
        "summary": "Rewrite the signed-in editor's script",
        "description": "The web app route. It takes body and uses the signed-in session cookie.",
        "security": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "body"
                ],
                "properties": {
                  "body": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The rewrite.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ScriptRewrite"
                }
              }
            }
          },
          "400": {
            "description": "A field is the wrong type or too long.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The script coach needs CutKit Pro or a trial: no account owns this library (401 account_required), or the account isn't on Pro (403 coach_needs_pro).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "The request was refused. See error.code.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "The request was refused. See error.code.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/scripts": {
      "get": {
        "tags": [
          "Scripts"
        ],
        "operationId": "listScripts",
        "summary": "List scripts, or the changes since an instant",
        "description": "Without since: the live scripts, pinned first, then newest. With since: every script that changed at or after that instant, deleted ones included (deleted: true), oldest first. Pass the server_time of your previous answer as since to sync.",
        "parameters": [
          {
            "name": "since",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "description": "ISO 8601 instant. Use server_time from the previous answer."
          }
        ],
        "responses": {
          "200": {
            "description": "The scripts, and the server clock to pass as since next time.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "scripts",
                    "server_time"
                  ],
                  "properties": {
                    "scripts": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Script"
                      }
                    },
                    "server_time": {
                      "type": "string",
                      "format": "date-time"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "A field is the wrong type or too long.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key (missing_key, invalid_key).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "Scripts"
        ],
        "operationId": "createScript",
        "summary": "Create a script",
        "description": "With no title, the first line of the body becomes the title. Send an id to make a retry safe: a second POST with the same id answers 409 rather than adding a copy.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/ScriptInput"
                  },
                  {
                    "type": "object",
                    "required": [
                      "body"
                    ],
                    "properties": {
                      "id": {
                        "type": "string",
                        "pattern": "^[A-Za-z0-9_-]{8,64}$"
                      }
                    }
                  }
                ]
              },
              "example": {
                "title": "Launch video intro",
                "body": "Hi, I'm Sam. Here is what we shipped."
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "script"
                  ],
                  "properties": {
                    "script": {
                      "$ref": "#/components/schemas/Script"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "A field is the wrong type or too long.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key (missing_key, invalid_key).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The free plan holds 1 script, archived ones included, and the library has it (script_limit). Pro or a trial has no limit, and edits, archives and deletes always go through.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "That id is taken (already_exists), or the library is full (library_full).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/scripts/{id}": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string",
            "pattern": "^[A-Za-z0-9_-]{8,64}$"
          },
          "description": "The script's id. The server makes a UUID when you don't choose one."
        }
      ],
      "get": {
        "tags": [
          "Scripts"
        ],
        "operationId": "getScript",
        "summary": "Read one script",
        "responses": {
          "200": {
            "description": "The script.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "script"
                  ],
                  "properties": {
                    "script": {
                      "$ref": "#/components/schemas/Script"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key (missing_key, invalid_key).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "No script with that id (not_found).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "Scripts"
        ],
        "operationId": "putScript",
        "summary": "Create or replace a script with this id",
        "description": "Replaces the title, body and pin. A missing or deleted script is made (201), within the free plan's 1 script. Omitting pinned sets it to false; omitting labels or status keeps what the script had.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/ScriptInput"
                  },
                  {
                    "type": "object",
                    "required": [
                      "body"
                    ]
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Replaced.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "script"
                  ],
                  "properties": {
                    "script": {
                      "$ref": "#/components/schemas/Script"
                    }
                  }
                }
              }
            }
          },
          "201": {
            "description": "Created.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "script"
                  ],
                  "properties": {
                    "script": {
                      "$ref": "#/components/schemas/Script"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "A field is the wrong type or too long.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key (missing_key, invalid_key).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The free plan holds 1 script, archived ones included, and the library has it (script_limit). Pro or a trial has no limit, and edits, archives and deletes always go through.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "The library is full (library_full).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "patch": {
        "tags": [
          "Scripts"
        ],
        "operationId": "updateScript",
        "summary": "Change some fields of a script",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ScriptInput"
              },
              "example": {
                "pinned": true
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "script"
                  ],
                  "properties": {
                    "script": {
                      "$ref": "#/components/schemas/Script"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "A field is the wrong type or too long.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key (missing_key, invalid_key).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "No script with that id (not_found).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "Scripts"
        ],
        "operationId": "deleteScript",
        "summary": "Delete a script",
        "description": "Leaves a tombstone, so a sync with since learns it went. Deleting twice is fine.",
        "responses": {
          "204": {
            "description": "Deleted."
          },
          "401": {
            "description": "Missing or invalid API key (missing_key, invalid_key).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "No script with that id (not_found).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/labels": {
      "get": {
        "tags": [
          "Labels"
        ],
        "operationId": "listLabels",
        "summary": "List the labels in use",
        "description": "Every label, how many live scripts carry it and its color, alphabetical.",
        "responses": {
          "200": {
            "description": "The labels.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "labels"
                  ],
                  "properties": {
                    "labels": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "label",
                          "scripts",
                          "color"
                        ],
                        "properties": {
                          "label": {
                            "type": "string"
                          },
                          "scripts": {
                            "type": "integer"
                          },
                          "color": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "enum": [
                              "red",
                              "orange",
                              "amber",
                              "green",
                              "teal",
                              "sky",
                              "blue",
                              "violet",
                              "pink",
                              null
                            ]
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key (missing_key, invalid_key).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/labels/{name}": {
      "parameters": [
        {
          "name": "name",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          },
          "description": "The label, matched without regard to case."
        }
      ],
      "patch": {
        "tags": [
          "Labels"
        ],
        "operationId": "renameLabel",
        "summary": "Rename a label on every script",
        "description": "Renaming onto a label that exists merges the two. Each script changed is stamped, so a phone syncing with since picks it up.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "name"
                ],
                "properties": {
                  "name": {
                    "type": "string",
                    "maxLength": 24
                  }
                }
              },
              "example": {
                "name": "Client work"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "How many scripts changed."
          },
          "400": {
            "description": "A field is the wrong type or too long.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key (missing_key, invalid_key).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "No script has that label (not_found).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "Labels"
        ],
        "operationId": "deleteLabel",
        "summary": "Take a label off every script",
        "description": "The scripts stay.",
        "responses": {
          "200": {
            "description": "How many scripts changed."
          },
          "401": {
            "description": "Missing or invalid API key (missing_key, invalid_key).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "No script has that label (not_found).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/labels/{name}/color": {
      "parameters": [
        {
          "name": "name",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          },
          "description": "The label, matched without regard to case."
        }
      ],
      "put": {
        "tags": [
          "Labels"
        ],
        "operationId": "setLabelColor",
        "summary": "Color a label",
        "description": "One color per label for the whole library, the same on the phone and the web. Send null to clear it. The label needn't be on a script yet.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "color"
                ],
                "properties": {
                  "color": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "enum": [
                      "red",
                      "orange",
                      "amber",
                      "green",
                      "teal",
                      "sky",
                      "blue",
                      "violet",
                      "pink",
                      null
                    ]
                  }
                }
              },
              "example": {
                "color": "teal"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The label and its color."
          },
          "400": {
            "description": "A field is the wrong type or too long.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key (missing_key, invalid_key).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/profile": {
      "get": {
        "tags": [
          "Profile"
        ],
        "operationId": "getProfile",
        "summary": "Read the creator profile",
        "description": "Who the creator is (about), who their videos are for (audience) and what they sell (offer). Empty strings when unset.",
        "responses": {
          "200": {
            "description": "The profile.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "profile"
                  ],
                  "properties": {
                    "profile": {
                      "$ref": "#/components/schemas/Profile"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key (missing_key, invalid_key).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "patch": {
        "tags": [
          "Profile"
        ],
        "operationId": "updateProfile",
        "summary": "Set the creator profile",
        "description": "Sets the fields you send, up to 1200 characters each. A field left out keeps its value and \"\" clears it. PUT does the same. Once audience is set, the check adds audience_fit, which fails when a script talks to somebody else.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ProfileInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The saved profile.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "profile"
                  ],
                  "properties": {
                    "profile": {
                      "$ref": "#/components/schemas/Profile"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "A field is the wrong type or too long.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key (missing_key, invalid_key).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/me": {
      "get": {
        "tags": [
          "Keys"
        ],
        "operationId": "getLibrary",
        "summary": "Check a key",
        "description": "Which library the key opens, how many live scripts it holds and how many checks are left today.",
        "responses": {
          "200": {
            "description": "The library.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "library",
                    "scripts"
                  ],
                  "properties": {
                    "library": {
                      "$ref": "#/components/schemas/Library"
                    },
                    "scripts": {
                      "type": "integer"
                    },
                    "quota": {
                      "type": "object",
                      "properties": {
                        "check": {
                          "$ref": "#/components/schemas/Quota"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key (missing_key, invalid_key).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "Keys"
        ],
        "operationId": "deleteLibrary",
        "summary": "Delete the library, its scripts and the key",
        "description": "The app calls this when somebody turns agent access off. Nothing is kept.",
        "responses": {
          "204": {
            "description": "Deleted."
          },
          "401": {
            "description": "Missing or invalid API key (missing_key, invalid_key).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "A connected app's token (insufficient_scope).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/keys": {
      "post": {
        "tags": [
          "Keys"
        ],
        "operationId": "createLibrary",
        "summary": "Make a new library and its key",
        "description": "The iPhone app calls this when somebody turns on agent access. It proves itself with App Attest, or sends its signed-in token. The key is shown once. At most 5 an hour from one address.",
        "security": [],
        "responses": {
          "201": {
            "description": "The new key. Store it now, it isn't shown again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/KeyIssued"
                }
              }
            }
          },
          "401": {
            "description": "No App Attest assertion or sign in (app_attest_required), or one that failed (app_attest_failed, invalid_token).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Too many keys from this address (rate_limited).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/keys/rotate": {
      "post": {
        "tags": [
          "Keys"
        ],
        "operationId": "rotateKey",
        "summary": "Replace the key",
        "description": "Same scripts, new key. The old key stops working in the same moment.",
        "responses": {
          "200": {
            "description": "The new key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/KeyIssued"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key (missing_key, invalid_key).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "A connected app's token (insufficient_scope).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "apiKey": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "ck_ followed by 43 characters",
        "description": "Authorization: Bearer ck_... The person finds it in the CutKit app under Settings, Agent access."
      },
      "oauth2": {
        "type": "oauth2",
        "description": "Sign in and press Allow, the flow ChatGPT and Claude use for the MCP server. Public clients, PKCE S256 required. Discovery: /.well-known/oauth-authorization-server.",
        "flows": {
          "authorizationCode": {
            "authorizationUrl": "https://getcutkit.com/app/authorize",
            "tokenUrl": "https://getcutkit.com/oauth/token",
            "refreshUrl": "https://getcutkit.com/oauth/token",
            "scopes": {
              "scripts": "Read and change the scripts in the person's library."
            }
          }
        }
      }
    },
    "schemas": {
      "Profile": {
        "type": "object",
        "required": [
          "about",
          "audience",
          "offer",
          "updated_at"
        ],
        "properties": {
          "about": {
            "type": "string",
            "description": "Who you are and what you've done, in a few lines. The check uses it to judge whether a claim sounds like you."
          },
          "audience": {
            "type": "string",
            "description": "Who your videos are for: their job, what they already know, what they want and what they'd never sit through. The check grades every script against this person."
          },
          "offer": {
            "type": "string",
            "description": "What you sell or want viewers to do next. The check uses it to judge whether the ask fits."
          },
          "updated_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        }
      },
      "ProfileInput": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "about": {
            "type": "string",
            "maxLength": 1200
          },
          "audience": {
            "type": "string",
            "maxLength": 1200
          },
          "offer": {
            "type": "string",
            "maxLength": 1200
          }
        }
      },
      "ScriptRewrite": {
        "type": "object",
        "required": [
          "body",
          "model"
        ],
        "properties": {
          "body": {
            "type": "string",
            "description": "The rewritten script. Nothing is saved."
          },
          "model": {
            "type": "string"
          },
          "check": {
            "$ref": "#/components/schemas/ScriptCheck"
          },
          "quota": {
            "$ref": "#/components/schemas/Quota"
          }
        }
      },
      "Quota": {
        "type": "object",
        "required": [
          "limit",
          "used",
          "remaining",
          "resetsAt"
        ],
        "description": "What's left of a daily cap, counted over a rolling 24 hours.",
        "properties": {
          "limit": {
            "type": "integer"
          },
          "used": {
            "type": "integer"
          },
          "remaining": {
            "type": "integer"
          },
          "resetsAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When the oldest use drops out and the next slot opens. Null while none are used."
          }
        }
      },
      "LintResult": {
        "type": "object",
        "required": [
          "pass",
          "passed",
          "total",
          "items"
        ],
        "properties": {
          "pass": {
            "type": "boolean"
          },
          "passed": {
            "type": "integer"
          },
          "total": {
            "type": "integer"
          },
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CheckItem"
            }
          }
        }
      },
      "Contract": {
        "type": "object",
        "required": [
          "contract",
          "checks",
          "hookShape"
        ],
        "properties": {
          "contract": {
            "type": "string",
            "description": "Semver of this API's contract. 1.2.0 added the craft ceiling, 1.3.0 the topic cap, 1.5.0 the creator profile and audience_fit, 1.6.0 the doubt and slop caps, 1.7.0 dropped no_self_promise and double_aha, 1.8.0 dropped the letter grade and the ceiling, 1.9.0 brought the letter back as a plain reading of the score, with no ceiling, 1.10.0 letters the score by its rank on the corpus."
          },
          "checks": {
            "type": "integer",
            "description": "How many checks the script check runs."
          },
          "hookShape": {
            "type": "string",
            "enum": [
              "rehook-field"
            ]
          }
        }
      },
      "ScriptCheck": {
        "type": "object",
        "required": [
          "passed",
          "total",
          "score",
          "grade",
          "estimatedSeconds",
          "openingFamily",
          "items",
          "platforms",
          "model",
          "checkedAt"
        ],
        "properties": {
          "passed": {
            "type": "integer"
          },
          "total": {
            "type": "integer",
            "description": "Items that count: every item minus the unsure ones."
          },
          "unsure": {
            "type": "integer",
            "description": "Items too close to call. They count 0 in the score."
          },
          "score": {
            "type": "integer",
            "minimum": 0,
            "maximum": 100
          },
          "grade": {
            "type": "string",
            "enum": [
              "A+",
              "A",
              "A-",
              "B+",
              "B",
              "B-",
              "C+",
              "C",
              "C-",
              "D+",
              "D",
              "D-",
              "F"
            ],
            "description": "The score's rank on about 4,500 competitor scripts as a school letter: B- beats 80% of them, A+ beats 97%, F beats under 60%."
          },
          "estimatedSeconds": {
            "type": "integer"
          },
          "openingFamily": {
            "type": [
              "string",
              "null"
            ]
          },
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CheckItem"
            }
          },
          "platforms": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PlatformNote"
            }
          },
          "model": {
            "type": "string"
          },
          "checkedAt": {
            "type": "string",
            "format": "date-time"
          },
          "quota": {
            "$ref": "#/components/schemas/Quota"
          },
          "cached": {
            "type": "boolean",
            "description": "True when identical text was checked in the last 24 hours and the stored answer came back free."
          }
        }
      },
      "CheckItem": {
        "type": "object",
        "required": [
          "id",
          "label",
          "pass",
          "confidence",
          "fix",
          "templateIds"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "label": {
            "type": "string"
          },
          "pass": {
            "type": "boolean"
          },
          "confidence": {
            "type": "number",
            "minimum": 0,
            "maximum": 1
          },
          "unsure": {
            "type": "boolean",
            "description": "True under 0.6 confidence. A guess: it counts 0 in the score."
          },
          "fix": {
            "type": [
              "string",
              "null"
            ]
          },
          "templateIds": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "PlatformNote": {
        "type": "object",
        "required": [
          "platform",
          "ok",
          "note"
        ],
        "properties": {
          "platform": {
            "type": "string",
            "enum": [
              "tiktok",
              "reels",
              "shorts"
            ]
          },
          "ok": {
            "type": "boolean"
          },
          "note": {
            "type": "string"
          }
        }
      },
      "TemplateEntry": {
        "type": "object",
        "required": [
          "id",
          "family",
          "name",
          "template",
          "rehook",
          "why",
          "examples",
          "watchOut",
          "onScreen"
        ],
        "properties": {
          "id": {
            "type": "string",
            "description": "Stable kebab-case id. The check's templateIds use it."
          },
          "family": {
            "type": "string",
            "enum": [
              "promise",
              "diagnosis",
              "belief-break",
              "in-medias-res",
              "tribe",
              "artefact",
              "number",
              "question",
              "news",
              "contradiction",
              "warning"
            ]
          },
          "name": {
            "type": "string"
          },
          "template": {
            "type": "string",
            "description": "The opening line. Every blank is [like this]."
          },
          "rehook": {
            "type": "string",
            "description": "The re-hook line for the middle, paired with it."
          },
          "why": {
            "type": "string"
          },
          "examples": {
            "type": "array",
            "items": {
              "type": "object",
              "required": [
                "opening",
                "rehook"
              ],
              "properties": {
                "opening": {
                  "type": "string"
                },
                "rehook": {
                  "type": "string"
                }
              }
            }
          },
          "watchOut": {
            "type": "string",
            "description": "The one way this shape goes wrong."
          },
          "onScreen": {
            "type": "string",
            "description": "What to show on screen in the first 3 seconds. Never holds a blank."
          }
        }
      },
      "TemplateFamily": {
        "type": "object",
        "required": [
          "id",
          "label",
          "blurb"
        ],
        "properties": {
          "id": {
            "type": "string",
            "enum": [
              "promise",
              "diagnosis",
              "belief-break",
              "in-medias-res",
              "tribe",
              "artefact",
              "number",
              "question",
              "news",
              "contradiction",
              "warning"
            ]
          },
          "label": {
            "type": "string"
          },
          "blurb": {
            "type": "string"
          }
        }
      },
      "TemplateCatalog": {
        "type": "object",
        "required": [
          "families",
          "templates"
        ],
        "properties": {
          "families": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TemplateFamily"
            }
          },
          "templates": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TemplateEntry"
            }
          }
        }
      },
      "LibraryItem": {
        "type": "object",
        "required": [
          "id",
          "shelf",
          "kind",
          "title",
          "thumbUrl",
          "downloadUrl",
          "licence",
          "credit",
          "sourceUrl",
          "provider"
        ],
        "properties": {
          "id": {
            "type": "string",
            "description": "`<provider>:<the provider's id>`, stable across searches."
          },
          "shelf": {
            "type": "string",
            "enum": [
              "logos",
              "stock",
              "music",
              "vintage",
              "images",
              "sounds",
              "pinterest",
              "arena"
            ]
          },
          "kind": {
            "type": "string",
            "enum": [
              "image",
              "video",
              "audio",
              "svg"
            ]
          },
          "title": {
            "type": "string"
          },
          "thumbUrl": {
            "type": "string",
            "format": "uri"
          },
          "downloadUrl": {
            "type": "string",
            "format": "uri",
            "description": "Always https. Download it and keep it with the project."
          },
          "width": {
            "type": "integer"
          },
          "height": {
            "type": "integer"
          },
          "duration": {
            "type": "number",
            "description": "Seconds."
          },
          "licence": {
            "type": "string",
            "enum": [
              "cc0",
              "cc-by",
              "pdm",
              "public-domain",
              "pexels",
              "logo-dev",
              "own-saves"
            ]
          },
          "credit": {
            "type": [
              "string",
              "null"
            ],
            "description": "The exact line to show when the licence asks for attribution, else null."
          },
          "sourceUrl": {
            "type": "string",
            "format": "uri",
            "description": "Where the licence can be read."
          },
          "provider": {
            "type": "string",
            "enum": [
              "logo.dev",
              "simple-icons",
              "pexels",
              "openverse",
              "internet-archive",
              "nasa",
              "pinterest",
              "arena"
            ]
          }
        }
      },
      "LibraryPage": {
        "type": "object",
        "required": [
          "items"
        ],
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/LibraryItem"
            }
          },
          "next": {
            "type": "integer",
            "description": "The next page's number. Absent on the last page."
          }
        }
      },
      "Script": {
        "type": "object",
        "required": [
          "id",
          "title",
          "body",
          "pinned",
          "labels",
          "status",
          "words",
          "created_at",
          "updated_at",
          "deleted"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "title": {
            "type": "string",
            "maxLength": 200
          },
          "body": {
            "type": "string",
            "maxLength": 200000,
            "description": "The words read out loud. Empty on a deleted script."
          },
          "pinned": {
            "type": "boolean"
          },
          "labels": {
            "type": "array",
            "maxItems": 20,
            "items": {
              "type": "string",
              "maxLength": 24
            },
            "description": "Groups shown in the library. Case-insensitively unique."
          },
          "status": {
            "type": "string",
            "enum": [
              "draft",
              "to_record",
              "recorded",
              "archived"
            ],
            "description": "draft, to_record, recorded or archived. Archived is hidden from the library, not deleted."
          },
          "words": {
            "type": "integer",
            "description": "What the phone counts to estimate reading time."
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "deleted": {
            "type": "boolean",
            "description": "Only ever true in an answer to ?since=."
          }
        }
      },
      "ScriptInput": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "title": {
            "type": "string",
            "maxLength": 200,
            "description": "One line. Empty or missing takes the body's first line."
          },
          "body": {
            "type": "string",
            "maxLength": 200000
          },
          "pinned": {
            "type": "boolean"
          },
          "labels": {
            "type": "array",
            "maxItems": 20,
            "items": {
              "type": "string",
              "maxLength": 24
            },
            "description": "Groups shown in the library. Case-insensitively unique."
          },
          "status": {
            "type": "string",
            "enum": [
              "draft",
              "to_record",
              "recorded",
              "archived"
            ],
            "description": "draft, to_record, recorded or archived. Archived is hidden from the library, not deleted."
          }
        }
      },
      "Library": {
        "type": "object",
        "required": [
          "id",
          "key_hint",
          "created_at"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "key_hint": {
            "type": "string",
            "description": "The key's first 7 and last 4 characters."
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "rotated_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        }
      },
      "KeyIssued": {
        "type": "object",
        "required": [
          "key",
          "library"
        ],
        "properties": {
          "key": {
            "type": "string"
          },
          "library": {
            "$ref": "#/components/schemas/Library"
          }
        }
      },
      "Error": {
        "type": "object",
        "required": [
          "error"
        ],
        "properties": {
          "error": {
            "type": "object",
            "required": [
              "code",
              "message"
            ],
            "properties": {
              "code": {
                "type": "string",
                "enum": [
                  "missing_key",
                  "invalid_key",
                  "invalid_json",
                  "invalid_body",
                  "missing_body",
                  "invalid_title",
                  "title_too_long",
                  "body_too_long",
                  "invalid_pinned",
                  "invalid_labels",
                  "too_many_labels",
                  "invalid_status",
                  "invalid_id",
                  "invalid_since",
                  "invalid_family",
                  "unknown_template",
                  "invalid_topic",
                  "invalid_topics",
                  "not_found",
                  "already_exists",
                  "library_full",
                  "rate_limited",
                  "too_short",
                  "too_long",
                  "check_limit",
                  "check_unavailable",
                  "not_configured",
                  "invalid_shelf",
                  "invalid_query",
                  "invalid_page",
                  "account_required",
                  "library_needs_pro",
                  "library_limit",
                  "library_unavailable",
                  "not_connected",
                  "arena_search_needs_premium",
                  "invalid_provider",
                  "invalid_file",
                  "invalid_signature",
                  "logo_not_found",
                  "logo_pending",
                  "logo_unavailable",
                  "internal"
                ]
              },
              "message": {
                "type": "string"
              },
              "docs": {
                "type": "string",
                "format": "uri"
              }
            }
          }
        }
      }
    }
  }
}