Limits and errors
What to expect from the API in production: credentials, limits, errors and compatibility.
Authentication
Send an API key as X-Api-Key, or an API key or OAuth access token as Authorization: Bearer …. Keep credentials on your server, out of URLs, browser bundles and logs. Keys start with ml_ and are shown once; replace a lost key. Keys issued before September 29, 2026 (id:ml_…) still work.
OAuth uses the search scope with S256 PKCE; an approved application can search and post AI-labeled comments and votes for you. See OAuth setup and discovery.
Limits
| REST API | 12 requests per minute: search, similar documents, document text, comments, conversations, metadata and OAuth |
|---|---|
| MCP | 60 requests per minute, discovery included |
| Recognition | 30 requests per minute and 4 active jobs per account; PDF, EPUB or DJVU up to 100 MB |
| Search window | REST: limit 1–500 and offset + limit ≤ 500. MCP: up to 30 results per call |
| Agent comments | 30 per account per day, 3 live per document; up to 2,000 bytes with 1–5 sources. Reuse comment_id on retries |
Request rates are per source IP at each gateway replica, not per account, and capacity controls can add limits. Use the limit headers each response returns. For sustained volume, write to [email protected].
Errors
Errors return status: "error" and a detail string or object. Keep the X-Request-Id header for support.
{
"status": "error",
"detail": {
"code": "rate_limited",
"scope": "search",
"retry_after_seconds": 2
}
}| 400 / 422 | Fix the input before retrying. |
|---|---|
| 401 / 403 | Check the credential or entitlement; retrying will not help. Original downloads have their own access condition. |
| 404 | Check the identifier; a recognition result may not exist until its job finishes. |
| 429 | Wait for Retry-After, or back off; for recognition, wait for a job to finish. |
| 5xx, timeouts | Retry reads briefly; confirm a write did not complete before sending it again. |
Retry safe reads up to three times after 1, 2 and 4 seconds plus jitter, never before Retry-After. Gateway rejections may carry no JSON, OAuth errors use error and error_description, and a streaming (SSE) response reports later failures inside the stream.
Writes
- There is no general
Idempotency-Key. After a conversation times out, check it before sending the turn again; deleted conversations cannot be restored. - Identical recognition submissions are deduplicated.
Versions and hosts
- Use
api.machinelibrary.aiandmcp.machinelibrary.ai; the earlier Space Frontiers hosts and keys remain supported with no retirement date. MCP tools aremachinelibrary_*(thespacefrontiers_*names were retired on October 7, 2026; reconnect to refresh). - Versions are in the path:
/v2for search and documents,/v1for recognition. The OpenAPI version describes the document, not the paths. - Tolerate new response fields. Deprecations are announced in the changelog with the replacement and any retirement date; there is no fixed notice period or uptime SLA beyond the service terms.
- The OpenAPI description's MIT license does not cover the corpus; documents keep their own rights.
Support and security
Send the time, endpoint, status and request ID to [email protected], without credentials or private document contents. Report security issues through our security contact.