Header format
Bearer wvs_... and bare wvs_... are accepted.
| Prefix | Environment | Notes |
|---|---|---|
wvs_live_* | Production | Real billing |
wvs_test_* | Sandbox | No Stripe billing — safe for CI |
wvs_dev_* | Development | Internal use |
wvs_trial_* | Trial | 30-min TTL, 10-op limit |
POST /api/v1/onboarding/temp-key
Issue a 30-minute trial key. No authentication required, IP rate-limited
to 5 keys/minute.
Request
Response — 200 OK
Response — 429 Too Many Requests
DELETE /api/v1/onboarding/temp-key/{key_prefix}
Revoke a trial key immediately. No auth required.
Request
key_prefix is the first 16+ characters of the trial key (the suffix is the
secret part).
Response — 200 OK
POST /api/v1/keys/apikey/rotate
Rotate the calling API key. Returns a new key; the old key remains valid for
24 hours grace.
Request
Response — 200 OK
key_rotated webhook event fires when rotation completes.
GET /api/v1/user/api-keys
List API keys for the authenticated user. Requires Clerk JWT (dashboard
session token), not a WAVIS API key.
Request
Response — 200 OK
POST /api/v1/user/api-keys
Create a new API key. Requires Clerk JWT.
Request
| Field | Type | Required | Default | Notes |
|---|---|---|---|---|
environment | string | Yes | — | "live", "test", or "dev" |
role | string | No | "developer" | "viewer", "developer", "account_admin" |
Response — 201 Created
key field is shown once only. Rate-limited to 10 creations per
user per hour.
DELETE /api/v1/user/api-keys/{key_id}
Revoke an API key. Requires Clerk JWT. Revocation is immediate.
Request
Response — 204 No Content
No body.POST /api/v1/user/logout
Signal logout intent — invalidates session-bound caches. Requires Clerk JWT.
Request
Response — 200 OK
RBAC roles
| Role | Capabilities |
|---|---|
viewer | Read keys/usage/status only (GET) |
developer | Manage keys/webhooks, run compute (default) |
account_admin | Everything developer can + billing/invoices/subscription |
trial | Limited to 10 ops total (assigned to wvs_trial_* keys) |
403 Forbidden.
Error codes
| Code | Status | Cause |
|---|---|---|
MISSING_AUTH_HEADER | 401 | No Authorization header |
INVALID_API_KEY | 401 | Key revoked, expired, or malformed |
INSUFFICIENT_ROLE | 403 | Role doesn’t permit this endpoint |
BRUTE_FORCE_LOCKOUT | 429 | Too many invalid attempts; wait 15 min |
IP_RATE_LIMITED | 429 | Too many trial keys from this IP |
TRIAL_OPS_EXHAUSTED | 402 | Trial key has used its 10 operations |
Brute-force protection
Two automatic lockouts protect the system:| Trigger | Lockout |
|---|---|
| 10 invalid attempts on the same key in 5 min | 15-min lockout for that key |
| 20 invalid attempts from the same IP in 5 min | 15-min lockout for that IP |
429 Too Many Requests with Retry-After header.
Wait or use a different IP.
Next Steps
Keys API
FHE key (not API key) management
Billing
Subscription and budget management