Docs API Reference

API Reference

The Meibel API is a REST API that accepts JSON bodies and returns JSON responses. Base URL: https://proxy.meibelai.org/v1

Authentication

All API requests require a Bearer token in the Authorization header:

Authorization: Bearer meibel_live_xxxxxxxxxxxxxxxx

API keys are prefixed meibel_live_ for production and meibel_test_ for development. Test-key calls are not billed and do not write to your production audit log.

POST /v1/proxy

The primary proxy endpoint. All LLM traffic passes through here. Headers determine tenant context and policy enforcement.

POST /v1/proxy

Request headers

HeaderRequiredDescription
X-Meibel-TenantYesTenant context ID. Determines which policy applies and scopes the audit record.
X-Meibel-PolicyNoOverride the tenant's default policy. Uses the tenant default if omitted.
X-Upstream-URLYesThe upstream model API URL Meibel will forward the (redacted) request to.
X-Upstream-AuthYesBearer token to pass to the upstream API. Meibel forwards this verbatim.

Response

The upstream model response is returned verbatim with additional Meibel headers:

HeaderDescription
X-Meibel-Request-IDUnique audit record ID for this call.
X-Meibel-Policy-VerdictOne of: ALLOWED, REDACTED, BLOCKED.
X-Meibel-Redaction-CountNumber of entities redacted in this call (0 if none).

GET /v1/audit

Query audit log records. All query parameters are optional; no parameters returns the last 20 records for all tenants.

GET /v1/audit

Query parameters

ParameterTypeDescription
tenant_idstringFilter to a specific tenant context.
fromISO-8601Start of date range. Example: 2025-11-01T00:00:00Z
toISO-8601End of date range.
policy_verdictenumALLOWED | REDACTED | BLOCKED
model_versionstringFilter by model version string (exact match).
limitintegerMax records to return (default 20, max 1000).
cursorstringPagination cursor from previous response's next_cursor.

Tenant management

POST/v1/tenantsCreate tenant
GET/v1/tenants/{tenant_id}Get tenant config
PUT/v1/tenants/{tenant_id}/policyUpdate policy
DELETE/v1/tenants/{tenant_id}Delete tenant + audit records

Error codes

HTTP statusError codeMeaning
401INVALID_API_KEYAPI key missing or invalid.
403TENANT_NOT_FOUNDThe X-Meibel-Tenant header value has no matching tenant.
422POLICY_BLOCKRequest blocked by policy. Body contains block_reason.
429RATE_LIMIT_EXCEEDEDTenant rate limit exceeded. See X-RateLimit-Reset header.
502UPSTREAM_ERRORUpstream model API returned an error. Forwarded verbatim.

Rate limit headers

All proxy responses include rate limit headers scoped to the tenant context:

X-RateLimit-Limit:     500        # configured RPM for this tenant
X-RateLimit-Remaining: 482        # remaining calls in current window
X-RateLimit-Reset:     1731600060 # unix timestamp of window reset