# codefmt api
> topic file: calling codefmt's format api, mcp server, and agent endpoints. site-wide index: https://codefmt.dev/llms.txt

source last changed: 2026-11-14

everything is anonymous and rate limited per ip (60 requests/min). the format api takes code up to 51,200 characters, 50KB of ASCII (400 above it), request body up to 100KB, counted in bytes (413 above it). no accounts, api keys, or oauth; do not send authorization headers. POST { code, platform, formatOptions, lintOptions } to the format api (all four are required, and the two option blocks have no server-side defaults; see /llms-full.txt for complete bodies), or connect over mcp (streamable http, protocols 2026-07-28, 2025-11-25, 2025-06-18, 2025-03-26) and call format_code, format_json, or ask_codefmt. retries are safe: formatting is a pure transformation, and the format api accepts an Idempotency-Key header and echoes it back.

## Endpoints
- [Format API (OpenAPI spec)](https://codefmt.dev/api/openapi.json): POST json to /api/format to format and lint code for zapier, n8n, pipedream, make, hubspot, or hubl; markdown twin at https://codefmt.dev/api/openapi.json.md
- [MCP manifest](https://codefmt.dev/.well-known/mcp.json): server name, icon, description, and tool list; the endpoint is POST https://codefmt.dev/api/mcp with tools format_code, format_json, ask_codefmt
- [A2A agent card](https://codefmt.dev/.well-known/agent-card.json): the endpoint is POST /api/a2a, json-rpc message/send
- [Ask endpoint (NLWeb)](https://codefmt.dev/ask): grounded answers about codefmt with cited source urls
- [Agent auth statement](https://codefmt.dev/auth.md): no authentication anywhere
- [Health check](https://codefmt.dev/api/health): liveness

## Optional
- [Full documentation](https://codefmt.dev/llms-full.txt): request and response examples, recipes, troubleshooting
- [Site-wide index](https://codefmt.dev/llms.txt): every page and agent surface
