TexToolsAI

Documentation

Everything you need to integrate TexToolsAI into your application.

Quick Start

  1. Get an API key from the pricing page (or use the free playground).
  2. Send a POST request to /api/convert with your Markdown in the JSON body.
  3. Receive sanitized HTML in the response.

Authentication

Include your API key in the Authorization header as a Bearer token:

Authorization: Bearer tt_live_YOUR_API_KEY

POST /api/convert

Request body

{
  "markdown": "# Your Markdown here",
  "options": {
    "gfm": true
  }
}

options.gfm is optional. It turns GitHub-Flavored Markdown on or off, and defaults to true.

Response (200 OK)

{
  "success": true,
  "html": "<h1>Your Markdown here</h1>",
  "meta": {
    "latency_ms": 3.42,
    "sanitized": true
  }
}

Options

OptionTypeDefaultDescription
gfmbooleantrueEnable GitHub-Flavored Markdown (tables, strikethrough, task lists)

Error Codes

CodeReasonDescription
400Bad RequestMissing or invalid JSON body, or `markdown` is not a string.
401UnauthorizedMissing, empty, or invalid API key.
403ForbiddenAPI key is revoked or suspended.
413Payload Too LargeMarkdown input exceeds size limit (25 KB for playground, larger for Pro).
429Too Many RequestsRate limit exceeded for your plan.
500Internal Server ErrorUnexpected server error. Contact support if it persists.

Rate Limits

PlanLimit
Free100 requests / day
Pro50,000 requests per month

Code Samples

curl -X POST https://texttoolsai.org/api/convert \
  -H "Authorization: Bearer tt_live_YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"markdown": "# Hello\n\n**Bold text**", "options": {"gfm": true}}'