Txt / HTML / XML → Markdown
Text, HTML or XML to Markdown
Endpoint
POST
https://claix.dev/api/txt-markdownAccepts a content field with plain text, HTML or XML and normalizes it to Markdown locally. There is no file upload, no schema and no model call. The limit is 300,000 characters, the same as Text → JSON.
There is no schema_id. The Markdown is always returned. Send window_context=true to keep it for the window_time you choose; the response then includes document_id. space_id is optional and only applies when the document is kept: it attaches that document to the knowledge space.
1. Authentication
Same API key check as the JSON endpoints. The key must be active and the account status must be active.
x-api-key: <TU_API_KEY>
Or:
Authorization: Bearer <TU_API_KEY>
2. Parameters
| Field | Required | Description |
|---|---|---|
| content | Yes | Plain text, HTML or XML in the content field. 300,000 characters maximum. |
| window_context | No | true keeps the Markdown and returns document_id. Omit it or send false to only return the Markdown. |
| window_time | Required if window_context is true | Minutes: 5, 10, 15, 30, 45, 60, 90, 120, 180, 240, 360, 480, 720, 1440, or infinity. infinity requires Persistent Mode on the account. |
| space_id | No | UUID of a knowledge space owned by the API key. Only when window_context is true. The kept document is attached to that space. |
Model: No.
3. Example
curl -X POST "https://claix.dev/api/txt-markdown" \ -H "x-api-key: TU_API_KEY" \ -F "content=<p>Contrato firmado el 12 de marzo.</p>" \ -F "window_context=true" \ -F "window_time=1440" \ -F "space_id=SPACE_UUID"
{
"success": true,
"markdown": "# Title\n\nBody...",
"document_id": "DOCUMENT_UUID",
"log_id": "LOG_UUID"
}4. Status codes
| Code | When |
|---|---|
| 200 | Markdown produced. Stored only when window_context is true. |
| 400 | Missing file or content, bad format, invalid window_time, space_id without window_context, or infinity without Persistent Mode. |
| 401 | API key missing, invalid, inactive, or account not active. |
| 404 | space_id does not exist for this account. |
| 405 | Method other than POST. |
| 413 | File or text over the same limit as the JSON endpoint. |
| 422 | Scanned PDF, image or audio rejected as unreadable, or empty Markdown. |
| 502 | The model call failed. |