{
  "openapi": "3.0.3",
  "info": {
    "title": "docsmith anonymous entry points",
    "version": "0.18.2",
    "description": "The part of the docsmith API a caller can use with no key, no card and no account: issue the free plan's key here, or convert one document anonymously first. The paid product, with 20MB uploads, 50 pages per call and 200 requests a month on the free plan, is documented at https://103-82-194-130.nip.io/openapi.json.",
    "termsOfService": "https://103-82-194-130.nip.io/terms"
  },
  "servers": [
    {
      "url": "https://103-82-194-130.nip.io",
      "description": "production"
    }
  ],
  "paths": {
    "/free-key": {
      "post": {
        "tags": [
          "anonymous"
        ],
        "summary": "Issue a free key with no account",
        "description": "Answers with an ordinary key on the free plan (200 requests a month). One key per address per 30 days. The key is returned once and is not retrievable afterwards.",
        "security": [],
        "responses": {
          "200": {
            "description": "A working key",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok",
                    "key",
                    "requests_per_month"
                  ],
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "key": {
                      "type": "string"
                    },
                    "plan": {
                      "type": "string"
                    },
                    "requests_per_month": {
                      "type": "integer"
                    },
                    "note": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "ok": true,
                  "key": "ds_free_example",
                  "plan": "free",
                  "plan_name": "Basic",
                  "requests_per_month": 200,
                  "note": "Send this as X-API-Key. It is shown once."
                }
              }
            }
          },
          "429": {
            "description": "This address has taken its key for the month, or the free keys for the month are gone"
          }
        }
      }
    },
    "/try/budget": {
      "get": {
        "tags": [
          "anonymous"
        ],
        "summary": "Read the anonymous budget without spending it",
        "security": [],
        "responses": {
          "200": {
            "description": "What is left today for this address",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok",
                    "allowed",
                    "remaining"
                  ],
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "allowed": {
                      "type": "boolean"
                    },
                    "limit": {
                      "type": "integer"
                    },
                    "remaining": {
                      "type": "integer"
                    },
                    "reset_at": {
                      "type": "integer"
                    },
                    "max_pages": {
                      "type": "integer"
                    },
                    "max_bytes": {
                      "type": "integer"
                    }
                  }
                },
                "example": {
                  "ok": true,
                  "allowed": true,
                  "limit": 3,
                  "remaining": 3,
                  "reset_at": 1793683200,
                  "max_pages": 5,
                  "max_bytes": 3145728
                }
              }
            }
          }
        }
      }
    },
    "/try/convert": {
      "post": {
        "tags": [
          "anonymous"
        ],
        "summary": "Convert the first pages of one PDF with no key",
        "description": "Takes one PDF up to 3MB and converts its first 5 pages to Markdown plus heading-aware chunks. Three conversions per address per day. A scanned page answers 422 no_text_layer rather than an empty document.",
        "security": [],
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "required": [
                  "file"
                ],
                "properties": {
                  "file": {
                    "type": "string",
                    "format": "binary"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Markdown, the heading list and the chunks",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok",
                    "markdown",
                    "chunks"
                  ],
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "pages": {
                      "type": "integer"
                    },
                    "pages_converted": {
                      "type": "integer"
                    },
                    "characters": {
                      "type": "integer"
                    },
                    "markdown": {
                      "type": "string"
                    },
                    "markdown_truncated": {
                      "type": "boolean"
                    },
                    "chunk_count": {
                      "type": "integer"
                    },
                    "headings": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "level": {
                            "type": "integer"
                          },
                          "page": {
                            "type": "integer"
                          },
                          "text": {
                            "type": "string"
                          }
                        }
                      }
                    },
                    "chunks": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "heading_path": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          },
                          "page_start": {
                            "type": "integer"
                          },
                          "page_end": {
                            "type": "integer"
                          },
                          "characters": {
                            "type": "integer"
                          },
                          "text": {
                            "type": "string"
                          },
                          "text_truncated": {
                            "type": "boolean"
                          }
                        }
                      }
                    },
                    "milliseconds": {
                      "type": "integer"
                    }
                  }
                },
                "example": {
                  "ok": true,
                  "pages": 15,
                  "pages_converted": 5,
                  "characters": 14892,
                  "markdown": "# Attention Is All You Need\n\n...",
                  "markdown_truncated": true,
                  "chunk_count": 19,
                  "headings": [
                    {
                      "level": 1,
                      "page": 1,
                      "text": "Attention Is All You Need"
                    }
                  ],
                  "chunks": [
                    {
                      "id": "c1a2b3c4d5e6",
                      "heading_path": [
                        "Attention Is All You Need"
                      ],
                      "page_start": 1,
                      "page_end": 2,
                      "characters": 780,
                      "text": "Abstract. The dominant sequence...",
                      "text_truncated": false
                    }
                  ],
                  "milliseconds": 266
                }
              }
            }
          },
          "422": {
            "description": "No text layer, so there is nothing to convert"
          },
          "429": {
            "description": "The anonymous budget for this address is spent"
          }
        }
      }
    }
  }
}
