Add rate limit headers to OpenAPI generation script
Some checks failed
Build & Deploy to Staging / Build & Deploy to Staging (push) Failing after 2m11s
Some checks failed
Build & Deploy to Staging / Build & Deploy to Staging (push) Failing after 2m11s
- Update generate-openapi.mjs to include header components - Ensure public/openapi.json has rate limit headers - Update rate limits description in generation script
This commit is contained in:
parent
70eb6908e3
commit
f0cb83a901
2 changed files with 63 additions and 1 deletions
|
|
@ -29,6 +29,8 @@ Try the API without signing up! Demo endpoints are public (no API key needed) bu
|
|||
- Demo: 5 PDFs/hour per IP (watermarked)
|
||||
- Pro tier: 5,000 PDFs/month, 30 req/min
|
||||
|
||||
All rate-limited endpoints return \`X-RateLimit-Limit\`, \`X-RateLimit-Remaining\`, and \`X-RateLimit-Reset\` headers. On \`429\`, a \`Retry-After\` header indicates seconds until the next allowed request.
|
||||
|
||||
## Getting Started
|
||||
1. Try the demo at \`POST /v1/demo/html\` — no signup needed
|
||||
2. Subscribe to Pro at [docfast.dev](https://docfast.dev/#pricing) for clean PDFs
|
||||
|
|
@ -64,6 +66,36 @@ Try the API without signing up! Demo endpoints are public (no API key needed) bu
|
|||
description: 'API key via X-API-Key header'
|
||||
}
|
||||
},
|
||||
headers: {
|
||||
'X-RateLimit-Limit': {
|
||||
description: 'The maximum number of requests allowed in the current time window',
|
||||
schema: {
|
||||
type: 'integer',
|
||||
example: 30
|
||||
}
|
||||
},
|
||||
'X-RateLimit-Remaining': {
|
||||
description: 'The number of requests remaining in the current time window',
|
||||
schema: {
|
||||
type: 'integer',
|
||||
example: 29
|
||||
}
|
||||
},
|
||||
'X-RateLimit-Reset': {
|
||||
description: 'Unix timestamp (seconds since epoch) when the rate limit window resets',
|
||||
schema: {
|
||||
type: 'integer',
|
||||
example: 1679875200
|
||||
}
|
||||
},
|
||||
'Retry-After': {
|
||||
description: 'Number of seconds to wait before retrying the request (returned on 429 responses)',
|
||||
schema: {
|
||||
type: 'integer',
|
||||
example: 60
|
||||
}
|
||||
}
|
||||
},
|
||||
schemas: {
|
||||
PdfOptions: {
|
||||
type: 'object',
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue