API Reference
All API endpoints are available at /api and require authentication.
Authentication
Include your Clerk session token in the Authorization header:
All authenticated routes are protected by Clerk middleware. Unauthenticated requests receive a 401 response.
Response Format
All responses follow a consistent envelope:
Error Codes
| Code | HTTP Status | Description |
|---|---|---|
VALIDATION_ERROR | 400 | Invalid request body or parameters |
AUTH_ERROR | 401 | Missing or invalid authentication |
FORBIDDEN | 403 | Insufficient permissions |
NOT_FOUND | 404 | Resource does not exist |
CONFLICT | 409 | Resource already exists |
RATE_LIMIT | 429 | Too many requests |
INTERNAL_ERROR | 500 | Unexpected server error |
UPSTREAM_ERROR | 502 | Upstream API failure |
Specs
List Specs
Returns all specs belonging to the authenticated user.
Create Spec
Get Spec
Update Spec
Delete Spec
Servers
List Servers
Create Server (from Spec)
Get Server
Update Server
Delete Server
Tools
List Tools
Update Tool
Test Tool
Returns the tool execution result with timing information.
Credentials
Create Credential
The key is encrypted at rest and never returned in API responses.
Delete Credential
Logs
List Logs
Returns cursor-paginated request logs. Supports optional query parameters: method, statusCode, from, to.
Usage
Get Usage Stats
Returns aggregate usage statistics for the authenticated user.
Billing
Create Checkout Session
Creates a Stripe Checkout session for subscribing to a paid plan. planId must be "starter" or "pro".
Response:
Create Portal Session
Creates a Stripe Billing Portal session for managing subscriptions, payment methods, and invoices. Returns 404 if the user has no billing account.
Response:
Get Budget Cap
Returns the user's configured overage spending cap. A null value means no cap is set.
Set Budget Cap
Sets or removes the overage spending cap. Pass null to remove the cap. Value must be between 0 and 10,000 EUR.
Webhooks
Webhook endpoints use provider-specific signature verification (not Clerk Bearer tokens) and may return non-standard response payloads.
Stripe Webhook
Receives Stripe webhook events for subscription lifecycle management. Authenticated via stripe-signature header (not Bearer token). Returns { "received": true } on success.
Clerk Webhook
Receives Clerk webhook events for user lifecycle management. Authenticated via Clerk signature verification.