Documentation
Everything you need to integrate TexToolsAI into your application.
Quick Start
- Get an API key from the pricing page (or use the free playground).
- Send a
POSTrequest to/api/convertwith your Markdown in the JSON body. - 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_KEYPOST /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
| Option | Type | Default | Description |
|---|---|---|---|
| gfm | boolean | true | Enable GitHub-Flavored Markdown (tables, strikethrough, task lists) |
Error Codes
| Code | Reason | Description |
|---|---|---|
| 400 | Bad Request | Missing or invalid JSON body, or `markdown` is not a string. |
| 401 | Unauthorized | Missing, empty, or invalid API key. |
| 403 | Forbidden | API key is revoked or suspended. |
| 413 | Payload Too Large | Markdown input exceeds size limit (25 KB for playground, larger for Pro). |
| 429 | Too Many Requests | Rate limit exceeded for your plan. |
| 500 | Internal Server Error | Unexpected server error. Contact support if it persists. |
Rate Limits
| Plan | Limit |
|---|---|
| Free | 100 requests / day |
| Pro | 50,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}}'