T3XTR API Documentation

Welcome to the T3XTR API documentation. Our API provides powerful text conversion capabilities with flexible hybrid billing. Convert between formats like Markdown, HTML, PDF, JSON, YAML, and CSV with simple HTTP requests.

Base URL: https://t3xtr.org/api
API Version: v1
Rate Limit: 300 requests per 15 minutes

Authentication

All conversion endpoints require authentication using an API key. Include your API key in the X-API-Key header with each request.

curl -H "X-API-Key: your_api_key_here" \ https://t3xtr.org/api/markdown-to-html

Registration

Get your free API key by registering with your email address. You'll immediately receive an API key with 100 free requests per month.

POST /api/register

Register for a free API key

Request Body

Parameter Type Required Description
email string Yes Your email address

Example

curl -X POST https://t3xtr.org/api/register \ -H "Content-Type: application/json" \ -d '{"email":"your@email.com"}' # Single-line version: curl -X POST https://t3xtr.org/api/register -H "Content-Type: application/json" -d '{"email":"your@email.com"}'

Response

{ "message": "User registered successfully", "api_key": "tk_abc123...", "user_id": "user_xyz789...", "plan": "free", "created_at": "2025-06-20T12:00:00.000Z" }

Usage Tracking

Check your current usage, remaining requests, and billing information.

GET /api/usage

Get usage statistics and billing information

Headers

Header Required Description
X-API-Key Yes Your API key

Example

curl -H "X-API-Key: your_api_key_here" \ https://t3xtr.org/api/usage

Response

{ "user_id": "user_xyz789...", "plan": "free", "monthly_limit": 100, "monthly_usage": 25, "monthly_remaining": 75, "credits_balance": 50, "current_period": "2025-06", "next_reset": "2025-07-01T00:00:00.000Z" }

Markdown ↔ HTML Conversion

Convert between Markdown and HTML formats with full syntax support.

POST /api/markdown-to-html

Convert Markdown text to HTML

Headers

Header Required Description
X-API-Key Yes Your API key
Content-Type Yes text/plain

Request Body

Send the Markdown content as plain text in the request body (max 10MB).

Example

curl -X POST https://t3xtr.org/api/markdown-to-html \ -H "X-API-Key: your_api_key_here" \ -H "Content-Type: text/plain" \ -d "# Hello World This is **bold** and *italic* text. - List item 1 - List item 2"

Response

{ "success": true, "result": "<h1>Hello World</h1>\n<p>This is <strong>bold</strong> and <em>italic</em> text.</p>\n<ul>\n<li>List item 1</li>\n<li>List item 2</li>\n</ul>", "processing_time": 25 }
POST /api/html-to-markdown

Convert HTML to Markdown text

Example

curl -X POST https://t3xtr.org/api/html-to-markdown \ -H "X-API-Key: your_api_key_here" \ -H "Content-Type: text/plain" \ -d "<h1>Hello World</h1><p>This is <strong>bold</strong> text.</p>"

HTML to PDF Conversion

POST /api/html-to-pdf

Generate PDF from HTML content

Example

curl -X POST https://t3xtr.org/api/html-to-pdf \ -H "X-API-Key: your_api_key_here" \ -H "Content-Type: text/plain" \ -d "<html><body><h1>My Document</h1><p>Content here</p></body></html>" \ --output document.pdf

PDF Text Extraction

POST /api/pdf-to-text

Extract text content from PDF files

Example

curl -X POST https://t3xtr.org/api/pdf-to-text \ -H "X-API-Key: your_api_key_here" \ -F "file=@document.pdf"

JSON ↔ YAML Conversion

POST /api/json-to-yaml

Convert JSON to YAML format

Example

curl -X POST https://t3xtr.org/api/json-to-yaml \ -H "X-API-Key: your_api_key_here" \ -H "Content-Type: application/json" \ -d '{"name": "John", "age": 30, "city": "New York"}'
POST /api/yaml-to-json

Convert YAML to JSON format

Example

curl -X POST https://t3xtr.org/api/yaml-to-json \ -H "X-API-Key: your_api_key_here" \ -H "Content-Type: text/plain" \ -d "name: John age: 30 city: New York"

CSV ↔ JSON Conversion

POST /api/csv-to-json

Convert CSV data to JSON format

Example

curl -X POST https://t3xtr.org/api/csv-to-json \ -H "X-API-Key: your_api_key_here" \ -H "Content-Type: text/plain" \ -d "name,age,city John,30,New York Jane,25,Boston"
POST /api/json-to-csv

Convert JSON array to CSV format

Example

curl -X POST https://t3xtr.org/api/json-to-csv \ -H "X-API-Key: your_api_key_here" \ -H "Content-Type: application/json" \ -d '[{"name":"John","age":30,"city":"New York"},{"name":"Jane","age":25,"city":"Boston"}]'

Text Cleaning

POST /api/text-clean

Clean and normalize text content

Example

curl -X POST https://t3xtr.org/api/text-clean \ -H "X-API-Key: your_api_key_here" \ -H "Content-Type: text/plain" \ -d " This text has irregular spacing!!! "

Billing System

T3XTR uses a hybrid billing model combining monthly plans with pay-per-use credits:

  • Free Plan: 100 requests/month at no cost
  • Pro Plan: 10,000 requests/month for $10 (coming soon)
  • Pay-per-Use: $0.002 per request when monthly limit is exceeded
When you exceed your monthly limit, requests are automatically charged at $0.002 each from your credits balance. Add credits anytime to ensure uninterrupted service.

Adding Credits

POST /api/credits/add

Add pay-per-use credits to your account

Request Body

Parameter Type Required Description
amount number Yes Dollar amount to add (minimum $5)

Example

curl -X POST https://t3xtr.org/api/credits/add \ -H "X-API-Key: your_api_key_here" \ -H "Content-Type: application/json" \ -d '{"amount": 10.00}'

Response Headers

All API responses include usage information in the headers:

Header Description
X-Monthly-Usage Current monthly usage count
X-Monthly-Limit Monthly request limit for your plan
X-Credits-Remaining Remaining pay-per-use credits balance
X-RateLimit-Remaining Requests remaining in current rate limit window

Error Codes

Status Code Error Description
400 Bad Request Invalid request format or missing parameters
401 Unauthorized Missing or invalid API key
402 Payment Required Monthly limit exceeded and insufficient credits
413 Payload Too Large Request body exceeds 10MB limit
429 Too Many Requests Rate limit exceeded
500 Internal Server Error Server error during processing

SDKs & Libraries

While we don't have official SDKs yet, the API works with any HTTP client. Here are examples in popular languages:

JavaScript (Node.js)

const fetch = require('node-fetch'); async function convertMarkdownToHtml(markdown, apiKey) { const response = await fetch('https://t3xtr.org/api/markdown-to-html', { method: 'POST', headers: { 'X-API-Key': apiKey, 'Content-Type': 'text/plain' }, body: markdown }); const result = await response.json(); return result; }

Python

import requests def convert_markdown_to_html(markdown, api_key): response = requests.post( 'https://t3xtr.org/api/markdown-to-html', headers={ 'X-API-Key': api_key, 'Content-Type': 'text/plain' }, data=markdown ) return response.json()

PHP

function convertMarkdownToHtml($markdown, $apiKey) { $curl = curl_init(); curl_setopt_array($curl, [ CURLOPT_URL => 'https://t3xtr.org/api/markdown-to-html', CURLOPT_RETURNTRANSFER => true, CURLOPT_POST => true, CURLOPT_POSTFIELDS => $markdown, CURLOPT_HTTPHEADER => [ 'X-API-Key: ' . $apiKey, 'Content-Type: text/plain' ], ]); $response = curl_exec($curl); curl_close($curl); return json_decode($response, true); }
Need help? Check out our Getting Started Guide for step-by-step tutorials and examples.