na{xx}en

Bring Your Own Endpoint

Use naxxen with curl, SDKs, or any HTTP client.

naxxen is a standard HTTP proxy. Anything that can make HTTP requests to OpenAI, Anthropic, or Google can use naxxen — just swap the base URL.

curl

See the Quickstart for curl examples. The pattern is always the same:

# Before (direct to provider)
curl -X POST https://api.openai.com/v1/chat/completions \
  -H "Authorization: Bearer sk-YOUR_KEY" \
  -d '...'

# After (through naxxen)
curl -X POST https://api.naxxen.ai/v1/chat/completions \
  -H "X-Naxxen-Key: nxn-sk-YOUR_NAXXEN_KEY" \
  -H "Authorization: Bearer sk-YOUR_KEY" \
  -d '...'

OpenAI Python SDK

from openai import OpenAI

client = OpenAI(
    api_key="sk-YOUR_OPENAI_KEY",
    base_url="https://api.naxxen.ai/nxn-sk-YOUR_NAXXEN_KEY/v1",
)

response = client.chat.completions.create(
    model="gpt-4o",
    messages=[
        {"role": "system", "content": "You are a helpful assistant."},
        {"role": "user", "content": "Hello"},
    ],
)

OpenAI Node.js SDK

import OpenAI from "openai";

const client = new OpenAI({
  apiKey: "sk-YOUR_OPENAI_KEY",
  baseURL: "https://api.naxxen.ai/nxn-sk-YOUR_NAXXEN_KEY/v1",
});

const response = await client.chat.completions.create({
  model: "gpt-4o",
  messages: [
    { role: "system", content: "You are a helpful assistant." },
    { role: "user", content: "Hello" },
  ],
});

Anthropic Python SDK

import anthropic

client = anthropic.Anthropic(
    api_key="sk-ant-YOUR_ANTHROPIC_KEY",
    base_url="https://api.naxxen.ai/nxn-sk-YOUR_NAXXEN_KEY",
)

message = client.messages.create(
    model="claude-sonnet-4-6",
    max_tokens=1024,
    system="You are a helpful assistant.",
    messages=[{"role": "user", "content": "Hello"}],
)

Anthropic TypeScript SDK

import Anthropic from "@anthropic-ai/sdk";

const client = new Anthropic({
  apiKey: "sk-ant-YOUR_ANTHROPIC_KEY",
  baseURL: "https://api.naxxen.ai/nxn-sk-YOUR_NAXXEN_KEY",
});

const message = await client.messages.create({
  model: "claude-sonnet-4-6",
  max_tokens: 1024,
  system: "You are a helpful assistant.",
  messages: [{ role: "user", content: "Hello" }],
});

Google (via REST)

The Google AI SDKs don't all support custom base URLs. Use REST directly or set the endpoint via environment variable where supported:

curl -X POST "https://api.naxxen.ai/nxn-sk-YOUR_NAXXEN_KEY/v1/models/gemini-2.5-flash:generateContent" \
  -H "Content-Type: application/json" \
  -H "x-goog-api-key: YOUR_GOOGLE_KEY" \
  -d '{
    "contents": [{"role": "user", "parts": [{"text": "Hello"}]}]
  }'

Alternative: Header-based auth

If you prefer not to put your naxxen key in the URL, use the X-Naxxen-Key header instead:

from openai import OpenAI

client = OpenAI(
    api_key="sk-YOUR_OPENAI_KEY",
    base_url="https://api.naxxen.ai/v1",
    default_headers={"X-Naxxen-Key": "nxn-sk-YOUR_NAXXEN_KEY"},
)

Alternative: Composite Bearer

For clients that only support a single API key field:

from openai import OpenAI

client = OpenAI(
    api_key="nxn-sk-YOUR_NAXXEN_KEY:sk-YOUR_OPENAI_KEY",
    base_url="https://api.naxxen.ai/v1",
)

naxxen splits on : — left side is your naxxen key, right side is forwarded to the provider.

Set up with an AI agent

Read https://docs.naxxen.ai/llms.txt and configure naxxen as a proxy
for my [OpenAI|Anthropic|Google] API calls. My naxxen key is nxn-sk-YOUR_KEY.
Update my code to use the naxxen base URL.