API documentation · v3
Introduction
The Acme API is a sample REST API used by this starter template. Replace the dummy "Widgets" endpoints with the real shape of your service.
The Acme API is a sample REST API used to demonstrate the API docs section of this starter template. Endpoints follow a conventional REST shape, return JSON, and authenticate with Bearer tokens.
When you adapt the starter for your own project, replace the OpenAPI spec at openapi/v3.yaml with your real schema and run npm run gen:api to rebuild the markdown.
Basic flow
- Create a token. Generate an API token from your account settings.
- Make a request. Set the
Authorization: Bearer <token>header on every request. - Handle the response. Successful requests return JSON with
2xxstatus codes; failures return4xxor5xxwith a JSONerrorbody.
Authentication
The API uses token-based authentication. Each request must include a valid token in the Authorization header.
- Tokens are generated through the web interface in your account’s API settings.
- Tokens never expire but can be revoked at any time.
Authentication header
Include your API token in all requests using the Bearer scheme:
Authorization: Bearer your-api-token
Rate limits
The starter template ships with a placeholder rate-limit policy. Adjust this section to match the limits your real API enforces.
- Default limit: 2 requests per second per account, shared across all endpoints.
- Detection: requests that exceed the limit get a
429 Too Many Requestsresponse. - Recovery: respect the
Retry-Afterresponse header before retrying. Use exponential backoff as a fallback ifRetry-Afteris missing.
Rate limit headers
X-RateLimit-Limit— the maximum number of requests allowed in the current window.X-RateLimit-Remaining— the number of requests left in the current window.Retry-After— sent on429responses; seconds to wait before retrying.
Support
For technical questions about the API, contact us.