Build with MockBite in minutes.
Use API keys to access private endpoints, generate fake users and track usage per key. These examples target the local backend at http://localhost:8080.
Check if the API is online.
Capture an early access lead.
Internal BFF route to issue an API key for logged-in users.
Inspect the authenticated user and API key metadata.
Generate a fake user and track usage for the API key.
Read the total request count logged for the API key.
Create an API key
Keys are now securely generated via NextAuth. Follow these steps to provision your key:
- Log in to the MockBite platform.
- Navigate to your Dashboard.
- Open Settings (⚙️) and click Generate new API Key.
Call the private endpoint
Send your API key with the Bearer authorization scheme.
curl "http://localhost:8080/v1/fake-user?country=Brazil&role=Backend%20Engineer&company=MockBite&seed=lucas" \
-H "Authorization: Bearer df_your_api_key"Open the console
Paste the generated key in the dashboard to inspect account metadata and usage.
curl http://localhost:8080/v1/usage \
-H "Authorization: Bearer df_your_api_key"Customize fake users
Override the generated user country.
Override the generated user role.
Override the generated user company.
Select a deterministic name and email variation.
Example payloads
Each authenticated request to /v1/fake-user is logged for usage tracking.
{
"name": "Maya Chen",
"email": "maya@mockbite.dev",
"company": "MockBite",
"country": "Brazil",
"role": "Backend Engineer"
}The /v1/usage endpoint returns aggregate metrics for the authenticated API key.
{
"total_requests": 12,
"last_24h": 5,
"last_request_at": "2026-06-21T20:45:00Z",
"by_endpoint": [
{
"endpoint": "/v1/fake-user",
"requests": 12
}
]
}Abuse prevention
The API applies a fixed-window rate limit per client IP. Defaults are configured by environment variables and can be tuned per deploy.
Common failures
The request body could not be parsed.
A private endpoint was called without Authorization.
The provided API key was not found or did not match.
The client exceeded the configured request window.