API Reference
naxxen API endpoints, request format, and error codes.
Base URL
https://api.naxxen.aiProxy endpoint
POST /*The main proxy accepts any path and auto-detects the provider. Send the same request body you'd send to OpenAI, Anthropic, or Google.
Request headers
| Header | Required | Description |
|---|---|---|
X-Naxxen-Key | Yes (unless using URL path or composite method) | Your naxxen API key |
Content-Type | Yes | application/json |
Authorization | Depends on provider | Provider API key (OpenAI, Anthropic OAuth) |
x-api-key | Depends on provider | Anthropic API key |
x-goog-api-key | Depends on provider | Google API key |
anthropic-version | For Anthropic | Required by Anthropic (2023-06-01) |
anthropic-beta | Optional | Anthropic beta features |
Response
The response from the upstream provider is returned unchanged. Same status code, same headers, same body. For streaming requests, SSE chunks are piped through in real time.
Compression metadata
naxxen does not add headers or modify the response body. Compression stats are tracked server-side and visible in your dashboard.
Health check
GET /healthReturns the API status.
{
"status": "ok",
"version": "0.1.0",
"compression": "ready"
}Standalone compression
POST /v1/compressCompress text without forwarding to a provider. Useful for testing or inspecting compression output.
Request
{
"text": "Your long text to compress...",
"rate": 0.5
}| Field | Type | Default | Description |
|---|---|---|---|
text | string | required | Text to compress |
rate | number | 0.5 | Target ratio — fraction of tokens to keep (0.3 = aggressive, 0.5 = medium, 0.7 = light) |
Response
{
"compressed_text": "Your compressed text...",
"original_tokens": 500,
"compressed_tokens": 250,
"ratio": 0.5
}Requires a valid naxxen API key via any of the authentication methods.
Error codes
naxxen returns these error codes for its own errors. Provider errors (400, 401, 429, 500 from OpenAI/Anthropic/Google) are passed through unchanged.
| Status | Code | Description |
|---|---|---|
| 400 | unknown_provider | Could not detect provider from request path/headers/body |
| 401 | missing_key | No naxxen API key found in request |
| 401 | invalid_key | naxxen API key is invalid or revoked |
| 429 | rate_limited | Rate limit exceeded for this API key |
| 500 | compression_error | Internal compression failure (request is NOT forwarded) |
| 502 | provider_unreachable | Could not connect to upstream provider |