{
  "openapi": "3.1.0",
  "info": {
    "title": "Reinkly API",
    "version": "1.0.0-beta",
    "summary": "Check whether a text or a web page looks AI-written.",
    "description": "Send a text (60 words or more) or a public web address. The answer gives the share of the text that looks AI-written and human, a confidence level and each passage that looks AI-written. Free while in beta. A result is a signal to look closer, not proof of who wrote a text: show it that way. Guide: https://reinkly.com/developers.",
    "termsOfService": "https://reinkly.com/terms"
  },
  "externalDocs": {
    "description": "API guide",
    "url": "https://reinkly.com/developers"
  },
  "servers": [
    {
      "url": "https://reinkly.com"
    }
  ],
  "security": [
    {},
    {
      "bearer": []
    }
  ],
  "paths": {
    "/api/v1/check": {
      "post": {
        "operationId": "checkText",
        "summary": "Check a text or a web page for AI writing",
        "description": "Send `text` or `url`. Without a key, a per-address limit applies. With your account key (rk_...), it uses your words (1 for each word) and is saved in your history; when it has to wait in line the answer is 202 with a job to poll.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CheckRequest"
              },
              "examples": {
                "text": {
                  "value": {
                    "text": "Paste at least sixty words of the text you want to check here..."
                  }
                },
                "url": {
                  "value": {
                    "url": "https://example.com/an-article"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The result",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CheckResult"
                }
              }
            }
          },
          "202": {
            "description": "Waiting in line or running: poll `poll_url`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Job"
                }
              }
            }
          },
          "400": {
            "description": "No text or url, or an unknown model",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "The API key is not valid",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Out of words: `error.buy_url` is where to buy more",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "The text is too long",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "A field has the wrong type or is too long",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests, or the key used its daily allowance",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "The checker is busy or restarting; try again in a minute",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/rewrite": {
      "post": {
        "operationId": "rewriteText",
        "summary": "Rewrite or humanize a text (Beni)",
        "security": [
          {
            "bearer": []
          }
        ],
        "description": "Needs your account key. Uses 2 words for each word of the text. Waits up to `wait` seconds for the result, else answers 202 with a job to poll.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "text"
                ],
                "properties": {
                  "text": {
                    "type": "string",
                    "maxLength": 100000
                  },
                  "mode": {
                    "type": "string",
                    "enum": [
                      "rewriter",
                      "humanizer"
                    ],
                    "default": "rewriter",
                    "description": "rewriter: your own text in fresh words, facts kept. humanizer: an AI draft made to read more like a person."
                  },
                  "wait": {
                    "type": "number",
                    "minimum": 0,
                    "maximum": 25,
                    "default": 15
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The job, done (with its result) or failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Job"
                }
              }
            }
          },
          "202": {
            "description": "Waiting in line or running: poll `poll_url`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Job"
                }
              }
            }
          },
          "400": {
            "description": "No text or url, or an unknown model",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "The API key is not valid",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Out of words: `error.buy_url` is where to buy more",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "The text is too long",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "A field has the wrong type or is too long",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests, or the key used its daily allowance",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "The checker is busy or restarting; try again in a minute",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/web-matches": {
      "post": {
        "operationId": "findWebMatches",
        "summary": "Find pages on the web that share phrases with a text",
        "security": [
          {
            "bearer": []
          }
        ],
        "description": "Needs your account key. Uses 5 words for each word.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "text"
                ],
                "properties": {
                  "text": {
                    "type": "string",
                    "maxLength": 100000
                  },
                  "wait": {
                    "type": "number",
                    "minimum": 0,
                    "maximum": 25,
                    "default": 15
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The job, done (with its result) or failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Job"
                }
              }
            }
          },
          "202": {
            "description": "Waiting in line or running: poll `poll_url`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Job"
                }
              }
            }
          },
          "400": {
            "description": "No text or url, or an unknown model",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "The API key is not valid",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Out of words: `error.buy_url` is where to buy more",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "The text is too long",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "A field has the wrong type or is too long",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests, or the key used its daily allowance",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "The checker is busy or restarting; try again in a minute",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/fact-check": {
      "post": {
        "operationId": "factCheck",
        "summary": "Check the claims in a text against sources on the web",
        "security": [
          {
            "bearer": []
          }
        ],
        "description": "Needs your account key. Uses 5 words for each word.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "text"
                ],
                "properties": {
                  "text": {
                    "type": "string",
                    "maxLength": 100000
                  },
                  "wait": {
                    "type": "number",
                    "minimum": 0,
                    "maximum": 25,
                    "default": 15
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The job, done (with its result) or failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Job"
                }
              }
            }
          },
          "202": {
            "description": "Waiting in line or running: poll `poll_url`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Job"
                }
              }
            }
          },
          "400": {
            "description": "No text or url, or an unknown model",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "The API key is not valid",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Out of words: `error.buy_url` is where to buy more",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "The text is too long",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "A field has the wrong type or is too long",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests, or the key used its daily allowance",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "The checker is busy or restarting; try again in a minute",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/citations": {
      "post": {
        "operationId": "checkCitations",
        "summary": "Check that the references in a text are real",
        "security": [
          {},
          {
            "bearer": []
          }
        ],
        "description": "Free, with or without a key.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "text"
                ],
                "properties": {
                  "text": {
                    "type": "string",
                    "maxLength": 100000
                  },
                  "wait": {
                    "type": "number",
                    "minimum": 0,
                    "maximum": 25,
                    "default": 15
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The job, done (with its result) or failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Job"
                }
              }
            }
          },
          "202": {
            "description": "Waiting in line or running: poll `poll_url`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Job"
                }
              }
            }
          },
          "400": {
            "description": "No text or url, or an unknown model",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "The API key is not valid",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "The text is too long",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "A field has the wrong type or is too long",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests, or the key used its daily allowance",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "The checker is busy or restarting; try again in a minute",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/grammar": {
      "post": {
        "operationId": "checkGrammar",
        "summary": "Spelling and grammar mistakes, with fixes",
        "security": [
          {},
          {
            "bearer": []
          }
        ],
        "description": "Free. English, French and Spanish.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "text"
                ],
                "properties": {
                  "text": {
                    "type": "string",
                    "maxLength": 100000
                  },
                  "lang": {
                    "type": "string",
                    "enum": [
                      "en",
                      "fr",
                      "es"
                    ],
                    "default": "en"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The mistakes found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "No text or url, or an unknown model",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "The API key is not valid",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "The text is too long",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "A field has the wrong type or is too long",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests, or the key used its daily allowance",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "The checker is busy or restarting; try again in a minute",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/stats": {
      "post": {
        "operationId": "textStats",
        "summary": "Words, sentences, reading time and reading grade",
        "security": [
          {},
          {
            "bearer": []
          }
        ],
        "description": "Free.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "text"
                ],
                "properties": {
                  "text": {
                    "type": "string",
                    "maxLength": 100000
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The stats",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "No text or url, or an unknown model",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "The API key is not valid",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "The text is too long",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "A field has the wrong type or is too long",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests, or the key used its daily allowance",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "The checker is busy or restarting; try again in a minute",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/jobs/{id}": {
      "get": {
        "operationId": "getJob",
        "summary": "The state of a job: queued, running, done (with its result) or failed",
        "security": [
          {},
          {
            "bearer": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The job, done (with its result) or failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Job"
                }
              }
            }
          },
          "404": {
            "description": "Unknown or not yours",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/me": {
      "get": {
        "operationId": "getMe",
        "summary": "Your words, your line and the packs",
        "security": [
          {
            "bearer": []
          }
        ],
        "responses": {
          "200": {
            "description": "Words left, free words this week, bought words, when they refill, tier, rates and packs",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "description": "The API key is not valid",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/history": {
      "get": {
        "operationId": "listHistory",
        "summary": "Your latest checks or rewrites",
        "security": [
          {
            "bearer": []
          }
        ],
        "parameters": [
          {
            "name": "kind",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "checks",
                "rewrites"
              ],
              "default": "checks"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 30
            }
          },
          {
            "name": "before",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "The `more` value of the page before."
          }
        ],
        "responses": {
          "200": {
            "description": "{kind, items, more}",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "description": "The API key is not valid",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/billing/checkout": {
      "post": {
        "operationId": "buyWordsLink",
        "summary": "A payment link for a pack of words, for the person to open",
        "security": [
          {
            "bearer": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "pack"
                ],
                "properties": {
                  "pack": {
                    "type": "string",
                    "enum": [
                      "words-100k",
                      "words-500k",
                      "words-2m"
                    ]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "{url, pack, words, price_usd}",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "No text or url, or an unknown model",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "The API key is not valid",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "The text is too long",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "A field has the wrong type or is too long",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests, or the key used its daily allowance",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "The checker is busy or restarting; try again in a minute",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/share": {
      "post": {
        "operationId": "shareResult",
        "summary": "Make a share link for a check",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "id"
                ],
                "properties": {
                  "id": {
                    "type": "string",
                    "maxLength": 40,
                    "description": "The `id` of a check made through the API."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The link",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "id",
                    "url"
                  ],
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "url": {
                      "type": "string",
                      "format": "uri",
                      "description": "Anyone with this link sees the text and the result."
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "The check has expired or is unknown",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests, or the key used its daily allowance",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/models": {
      "get": {
        "operationId": "listModels",
        "summary": "The detectors you can pass as `model`",
        "security": [
          {}
        ],
        "responses": {
          "200": {
            "description": "The menu",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "default",
                    "models"
                  ],
                  "properties": {
                    "default": {
                      "type": "string"
                    },
                    "models": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "id",
                          "label",
                          "available"
                        ],
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "label": {
                            "type": "string"
                          },
                          "available": {
                            "type": "boolean"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "bearer": {
        "type": "http",
        "scheme": "bearer",
        "description": "Your account key (rk_...), made on your dashboard (https://reinkly.com/dashboard#account). It uses your words and saves to your history. Older beta keys (tw_...) keep a daily check allowance."
      }
    },
    "schemas": {
      "Job": {
        "type": "object",
        "required": [
          "job",
          "kind",
          "status"
        ],
        "properties": {
          "job": {
            "type": "string"
          },
          "kind": {
            "type": "string",
            "description": "check, rewrite, plagiarism, factcheck or citations"
          },
          "status": {
            "type": "string",
            "enum": [
              "queued",
              "running",
              "done",
              "failed"
            ]
          },
          "ahead": {
            "type": "integer"
          },
          "estimate_s": {
            "description": "A rough wait in seconds, as a range [low, high]"
          },
          "poll_url": {
            "type": "string",
            "format": "uri"
          },
          "result": {
            "description": "When done: the rewrite ({text, words_in, words_out, model, mode}), the check (CheckResult) or the source check."
          },
          "error": {
            "type": "string"
          }
        }
      },
      "CheckRequest": {
        "type": "object",
        "description": "Send `text` or `url`.",
        "properties": {
          "text": {
            "type": "string",
            "maxLength": 100000,
            "description": "The text to check: 60 words or more, up to about 15,000 words."
          },
          "url": {
            "type": "string",
            "maxLength": 2000,
            "pattern": "^https?://",
            "description": "A public article or blog post. Pages behind a paywall or a sign-in cannot be read."
          },
          "model": {
            "type": "string",
            "maxLength": 40,
            "description": "A detector id from /api/v1/models. Leave it out for the default."
          },
          "share": {
            "type": "boolean",
            "default": false,
            "description": "Also make a share link to the full result page."
          },
          "source_url": {
            "type": "string",
            "maxLength": 2000,
            "pattern": "^https?://",
            "description": "The page the text came from, if any (kept with the check)."
          }
        }
      },
      "CheckResult": {
        "type": "object",
        "required": [
          "id",
          "ai_percent",
          "human_percent",
          "result",
          "label",
          "confidence",
          "words",
          "language",
          "model",
          "passages",
          "share_url"
        ],
        "properties": {
          "id": {
            "type": [
              "string",
              "null"
            ],
            "description": "The check id, to make a share link later."
          },
          "ai_percent": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 0,
            "maximum": 100,
            "description": "Share of the words inside passages that look AI-written. Null when the text cannot be scored."
          },
          "human_percent": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 0,
            "maximum": 100
          },
          "result": {
            "type": "string",
            "enum": [
              "ai",
              "ai_passages",
              "human",
              "unclear",
              "too_short",
              "unsupported"
            ]
          },
          "label": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "ai",
              "mixed",
              "human",
              "unclear",
              null
            ],
            "description": "The word the checker shows."
          },
          "confidence": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "high",
              "medium",
              "low",
              null
            ]
          },
          "words": {
            "type": [
              "integer",
              "null"
            ]
          },
          "language": {
            "type": [
              "string",
              "null"
            ],
            "description": "Language code, such as en."
          },
          "model": {
            "type": [
              "string",
              "null"
            ],
            "description": "The detector used, such as Rara 0.3."
          },
          "passages": {
            "type": "array",
            "items": {
              "type": "object",
              "required": [
                "start",
                "end",
                "level",
                "text"
              ],
              "properties": {
                "start": {
                  "type": "integer",
                  "description": "Start, in characters of your text."
                },
                "end": {
                  "type": "integer"
                },
                "level": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "enum": [
                    "very_likely",
                    "possibly",
                    null
                  ]
                },
                "text": {
                  "type": "string"
                }
              }
            }
          },
          "share_url": {
            "type": [
              "string",
              "null"
            ],
            "format": "uri"
          }
        }
      },
      "Error": {
        "type": "object",
        "required": [
          "error"
        ],
        "properties": {
          "error": {
            "type": "object",
            "required": [
              "code",
              "message"
            ],
            "properties": {
              "code": {
                "type": "string",
                "enum": [
                  "bad_request",
                  "unauthorized",
                  "out_of_words",
                  "forbidden",
                  "not_found",
                  "conflict",
                  "gone",
                  "too_large",
                  "invalid",
                  "rate_limited",
                  "unavailable",
                  "upstream_error",
                  "error"
                ]
              },
              "buy_url": {
                "type": "string",
                "format": "uri",
                "description": "With out_of_words."
              },
              "message": {
                "type": "string"
              }
            }
          }
        }
      }
    }
  }
}
