na{xx}en

API Reference

naxxen API endpoints, request format, and error codes.

Base URL

https://api.naxxen.ai

Proxy 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

HeaderRequiredDescription
X-Naxxen-KeyYes (unless using URL path or composite method)Your naxxen API key
Content-TypeYesapplication/json
AuthorizationDepends on providerProvider API key (OpenAI, Anthropic OAuth)
x-api-keyDepends on providerAnthropic API key
x-goog-api-keyDepends on providerGoogle API key
anthropic-versionFor AnthropicRequired by Anthropic (2023-06-01)
anthropic-betaOptionalAnthropic 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 /health

Returns the API status.

{
  "status": "ok",
  "version": "0.1.0",
  "compression": "ready"
}

Standalone compression

POST /v1/compress

Compress text without forwarding to a provider. Useful for testing or inspecting compression output.

Request

{
  "text": "Your long text to compress...",
  "rate": 0.5
}
FieldTypeDefaultDescription
textstringrequiredText to compress
ratenumber0.5Target 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.

StatusCodeDescription
400unknown_providerCould not detect provider from request path/headers/body
401missing_keyNo naxxen API key found in request
401invalid_keynaxxen API key is invalid or revoked
429rate_limitedRate limit exceeded for this API key
500compression_errorInternal compression failure (request is NOT forwarded)
502provider_unreachableCould not connect to upstream provider