← mate.tools

mate.tools API

Free, programmatic access to mate.tools utilities. Designed for AI agents, automation scripts and frontend apps.

v1 No auth CORS open JSON in / JSON out 1 MB body cap OpenAPI 3.1

Try it in 30 seconds

curl -X POST https://mate.tools/api/v1/count-lines.php \
  -H "Content-Type: application/json" \
  -d '{"text":"line one\nline two\n\nline four"}'
import urllib.request, json

req = urllib.request.Request(
    "https://mate.tools/api/v1/count-lines.php",
    data=json.dumps({"text": "line one\nline two\n\nline four"}).encode(),
    headers={"Content-Type": "application/json"},
)
with urllib.request.urlopen(req) as r:
    print(json.load(r)["metrics"])
const res = await fetch("https://mate.tools/api/v1/count-lines.php", {
    method: "POST",
    headers: { "Content-Type": "application/json" },
    body: JSON.stringify({ text: "line one\nline two\n\nline four" }),
});
console.log((await res.json()).metrics);
fetch("https://mate.tools/api/v1/count-lines.php", {
    method: "POST",
    headers: { "Content-Type": "application/json" },
    body: JSON.stringify({ text: "line one\nline two\n\nline four" }),
})
  .then(r => r.json())
  .then(console.log);

Endpoints

EndpointWhat it does
GET/api/v1/health.php Liveness probe. Returns the API version and the full list of endpoints. Excluded from rate limits.
POST/api/v1/count-lines.php Sixteen text metrics: lines, words, sentences, paragraphs, characters, duplicates, line endings, longest word, reading time and more.
POST/api/v1/base64-encode.php Encode text to Base64. Optional URL-safe alphabet (RFC 4648 §5) without padding.
POST/api/v1/base64-decode.php Decode Base64 to text. Accepts both standard and URL-safe input. Returns hex when output is not valid UTF-8.
POST/api/v1/hash.php Compute hashes of a text input — defaults to MD5, SHA-1, SHA-256, SHA-384, SHA-512, CRC32, SHA3-256 and SHA3-512.
POST/api/v1/password.php Generate cryptographically random passwords. Configurable length, count, character classes and ambiguous-character exclusion. Reports entropy in bits.
POST/api/v1/json-format.php Validate, pretty-print, minify or analyse a JSON document. Returns a structural summary (node counts, max depth, top keys).
More endpoints coming. Tell us which tool you want next.

Rate limits

All endpoints (except /health.php) are subject to per-IP rate limits: 60 requests per minute and 600 requests per hour. Each response carries X-RateLimit-Limit-Minute, X-RateLimit-Remaining-Minute, X-RateLimit-Limit-Hour, X-RateLimit-Remaining-Hour and X-RateLimit-Reset headers. When exceeded the API returns 429 with a Retry-After header — back off for that many seconds.

For AI agents

Model Context Protocol (MCP)

Use mate.tools as an MCP server inside Claude Desktop, Claude Code, Cursor, Windsurf, or any other MCP-compatible client. Add to your client's config:

{
  "mcpServers": {
    "mate-tools": {
      "command": "npx",
      "args": ["-y", "@mate-tools/mcp-server"]
    }
  }
}

That's it. No global install, no git clone. npx fetches the latest version on first run and caches it.

npm: @mate-tools/mcp-server · Source & full install guide: /api/mcp/

OpenAPI 3.1 spec

For ChatGPT Custom GPT Actions, Microsoft Copilot Studio, Perplexity Spaces, or any agent framework that consumes OpenAPI:

https://mate.tools/api/openapi.json

llms.txt

Discoverable site manifest for crawling LLMs: https://mate.tools/llms.txt

Conventions

Base URLhttps://mate.tools/api/v1/
MethodsMost endpoints accept POST with JSON. Some allow GET for trivial probes.
EncodingUTF-8 only. Bodies are JSON or application/x-www-form-urlencoded.
Body sizeCapped at 1 MB per request. Returns 413 above that.
AuthNone. Anonymous traffic only. Rate limits enforced by Cloudflare.
CORSOpen: Access-Control-Allow-Origin: *.
IndexingAPI responses send X-Robots-Tag: noindex. The endpoint URLs are not advertised in sitemap.xml.
ErrorsNon-200 responses return {"error":{"code":N,"message":"...","field":"..."}}.
Note: The .php extension on endpoint URLs is intentional. v1 routes directly to PHP-FPM with no rewrite layer in front, which keeps the API dependency-free and rock-solid. Future versions may add clean URLs.

Fair use

This API is free and unlimited for honest use — automation, AI agents, personal projects, internal tooling, hobby apps and small commercial workloads are all welcome. Cloudflare protects the underlying infrastructure from abuse. Please don't:

Versioning

The path includes the major version (/v1/). Breaking changes ship under a new path. Within a major version, only additive changes (new fields, new endpoints) are permitted.