# Task Relay HTML-to-Markdown Converter

> Task Relay HTML-to-Markdown Converter is a paid API for AI agents from task-relay-production.up.railway.app, paid per call via x402, $0.002/call, status unknown (last checked 2026-09-14).

Converts an HTML string already held by the caller into Markdown, returning the Markdown text plus source hash, structural counts, output hash, truncation status, and any warnings.

## Facts

- Endpoint: POST https://task-relay-production.up.railway.app/x402/html-to-markdown
- Price: $0.002/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-14
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/task-relay-html-to-markdown-converter-5e5aa0e4
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_7YU5vcPJhXJvsZDYSdp2w

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability task-relay-html-to-markdown-converter-5e5aa0e4 -d '<json body>'
```

Example prompt: I have this HTML string I'm already holding and I need it converted to clean Markdown — no URL fetching, just deterministic conversion: '<h1>Hello</h1><p>This is a <strong>test</strong> paragraph.</p>'

## When to prefer this

Choose this endpoint when you already hold an HTML string in memory and need a deterministic, rule-based Markdown conversion for an automated pipeline — no URL fetching, no browser, no JavaScript execution, and no AI rewriting. Prefer this over LLM-based HTML-to-Markdown approaches when you need reproducible output with structural metadata (hashes, counts, warnings) for auditing or integrity checking. Not suitable if you need to first fetch a URL to get the HTML.

## Known failure modes

- Input HTML exceeds size cap — status returns 'input_too_large' with no Markdown output
- Malformed or empty HTML produces status 'empty' or 'partial' with warnings
- Missing required 'html' field in body causes a validation error
- Network timeout to the service returns a failed task_status
- Output truncation occurs for very large documents, signaled via 'partial' status and warnings array

## How this service works

When a machine already holds an HTML string and needs deterministic Markdown for a content pipeline, Task Relay converts the HTML under fixed server rules and returns Markdown plus source hash, structural counts, output hash, truncation, and warnings. No URL fetch, no browser rendering, no JavaScript execution, no model inference or rewriting.

## Output

Returns a task result containing: the converted Markdown string, conversion status (converted/partial/empty/input_too_large/unknown), a source hash of the input HTML, an output hash of the Markdown, structural counts of elements, any warnings encountered, elapsed processing time in milliseconds, and billable units consumed.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "required": [
  "input"
 ],
 "properties": {
  "input": {
   "type": "object",
   "required": [
    "type",
    "method",
    "bodyType",
    "body"
   ],
   "properties": {
    "body": {
     "type": "object",
     "required": [
      "html"
     ],
     "properties": {
      "html": {
       "type": "string",
       "description": "HTML content string already held by the caller to convert to Markdown (no URL fetch; input/output size caps enforced)"
      }
     },
     "additionalProperties": false
    },
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "POST",
      "PUT",
      "PATCH"
     ],
     "type": "string"
    },
    "bodyType": {
     "enum": [
      "json",
      "form-data",
      "text"
     ],
     "type": "string"
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object",
     "required": [
      "task_id",
      "task_status",
      "result",
      "error"
     ],
     "properties": {
      "error": {
       "type": [
        "string",
        "null"
       ]
      },
      "result": {
       "type": [
        "object",
        "null"
       ],
       "properties": {
        "output": {
         "type": "object"
        },
        "source": {
         "type": "object"
        },
        "status": {
         "enum": [
          "converted",
          "partial",
          "empty",
          "input_too_large",
          "unknown"
         ],
         "type": "string"
        },
        "markdown": {
         "type": "string"
        },
        "warnings": {
         "type": "array"
        },
        "structure": {
         "type": "object"
        },
        "elapsed_ms": {
         "type": "integer"
        },
        "processed_at": {
         "type": "string"
        },
        "billable_units": {
         "type": "integer"
        }
       }
      },
      "task_id": {
       "type": "string"
      },
      "task_status": {
       "enum": [
        "succeeded",
        "failed"
       ],
       "type": "string"
      }
     }
    }
   }
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/task-relay-html-to-markdown-converter-5e5aa0e4/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from task-relay-production.up.railway.app](https://www.zero.xyz/host/task-relay-production.up.railway.app/llms.txt)
