Skip to content

Rate limits

Each API token can send 120 requests a minute to the REST API. Every token has its own count, so one busy script doesn’t slow down another that uses a different token.

The same token can also make 300 calls a minute to Lyra’s MCP server at /mcp, counted apart from the REST API. Agents make many small calls, so MCP gets more.

Every answer says where the token stands, from the REST API and from /mcp:

Header Meaning
X-RateLimit-Limit How many requests the token can send in a minute: 120, or 300 on /mcp
X-RateLimit-Remaining How many it has left this minute
X-RateLimit-Reset Seconds until the count starts again

Lyra answers 429 with the code rate_limited, and a Retry-After header with the seconds to wait:

HTTP/1.1 429 Too Many Requests
x-ratelimit-limit: 120
x-ratelimit-remaining: 0
x-ratelimit-reset: 59
retry-after: 59
{"error":{"code":"rate_limited","message":"Too many requests. Try again in 59 seconds."}}

Wait that long, then go on. In JavaScript:

async function withRetry(send) {
for (let attempt = 1; ; attempt += 1) {
const response = await send()
if (response.status !== 429 || attempt === 5) return response
const seconds = Number(response.headers.get('retry-after') ?? '1')
await new Promise((resolve) => setTimeout(resolve, seconds * 1000))
}
}
const response = await withRetry(() =>
fetch('https://app.lyra-docs.com/api/v1/me', {
headers: { Authorization: `Bearer ${process.env.LYRA_TOKEN}` },
}),
)
  • Ask for up to 100 items at a time with limit when you page through pages or rows.
  • Add, change or trash many rows in one request: up to 100 rows to add or update, and 500 to trash.
  • Send up to 100 edits to a page in one POST /pages/{pageId}/edits.
  • Read one part of a long page with heading or blockId on GET /pages/{pageId}/markdown, instead of the whole page.
  • Keep ids you already have, rather than searching for the same page again.
What Limit
Markdown of a new page, or of PUT /pages/{pageId}/markdown 200,000 characters
Markdown of one edit 100,000 characters
::: containers inside each other, or quotes inside quotes 20 deep
Edits in one request 100
Rows to add or update in one request 100
Rows to trash in one request 500
A comment 10,000 characters
A page title 500 characters
A file 50 MB
Files an organization can store on Lyra Cloud 1 GB on the Free plan, 100 GB on Team. A self-hosted server has no limit
Files one person can upload in 24 hours 5,000 MB by default. A self-hosted server sets it with UPLOAD_MB_PER_DAY

A request over one of these answers 400 invalid_request or 413. See Errors.