Base URL and versioning
- Production base URL:
https://api.safefetch.dev
- Local self-host default:
http://localhost:3000
- Versioned API prefix:
/v1
- Content type: JSON
- Field naming:
snake_case
- Authenticated routes:
/v1/*
Rate limiting
/v1/* routes are rate-limited per API key.
Default server limit is 100 requests/second per key (RATE_LIMIT_PER_SECOND).
Returned on 429, value is 1 second.
Request IDs
Every response includes X-Request-Id.
- Send your own
X-Request-Id to correlate client and server logs.
- If omitted, SafeFetch generates one.
Error codes
missing_body
validation_error
missing_field
invalid_request
invalid_query
invalid_content_type
unauthorized
rate_limited
payload_too_large
method_not_allowed
not_found
not_cancellable
not_approvable
not_retryable
Content-Type requirements
POST and PUT endpoints require Content-Type: application/json.
Payload size limit
Request bodies above 1MB are rejected with 413 payload_too_large.