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
| Header | Required | Description |
|---|---|---|
X-Meibel-Tenant | Yes | Tenant context ID. Determines which policy applies and scopes the audit record. |
X-Meibel-Policy | No | Override the tenant's default policy. Uses the tenant default if omitted. |
X-Upstream-URL | Yes | The upstream model API URL Meibel will forward the (redacted) request to. |
X-Upstream-Auth | Yes | Bearer token to pass to the upstream API. Meibel forwards this verbatim. |
Response
The upstream model response is returned verbatim with additional Meibel headers:
| Header | Description |
|---|---|
X-Meibel-Request-ID | Unique audit record ID for this call. |
X-Meibel-Policy-Verdict | One of: ALLOWED, REDACTED, BLOCKED. |
X-Meibel-Redaction-Count | Number 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
| Parameter | Type | Description |
|---|---|---|
tenant_id | string | Filter to a specific tenant context. |
from | ISO-8601 | Start of date range. Example: 2025-11-01T00:00:00Z |
to | ISO-8601 | End of date range. |
policy_verdict | enum | ALLOWED | REDACTED | BLOCKED |
model_version | string | Filter by model version string (exact match). |
limit | integer | Max records to return (default 20, max 1000). |
cursor | string | Pagination 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 status | Error code | Meaning |
|---|---|---|
| 401 | INVALID_API_KEY | API key missing or invalid. |
| 403 | TENANT_NOT_FOUND | The X-Meibel-Tenant header value has no matching tenant. |
| 422 | POLICY_BLOCK | Request blocked by policy. Body contains block_reason. |
| 429 | RATE_LIMIT_EXCEEDED | Tenant rate limit exceeded. See X-RateLimit-Reset header. |
| 502 | UPSTREAM_ERROR | Upstream 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