Migrate in two env vars
Switch any LLM tool to Newmen, no code changes.
Newmen speaks both OpenAI Chat Completions and Anthropic Messages on the wire. Set two environment variables and any tool you already use routes through Atlas. Same response shape, plus a delivery block telling you what was actually served and what it cost vs direct.
TL;DR
Pick your client’s shape and copy the two lines. Signed in? Hit Insert my key and the snippet fills in your real key.
export ANTHROPIC_BASE_URL="https://api.newmen.ai"
export ANTHROPIC_API_KEY="nm_live_..."openai/gpt-4o, anthropic/claude-sonnet-4, mistralai/mixtral-8x7b — all keep working. Atlas routes each call to a price-equivalent or cheaper variant and never charges more than direct would have. See pricing for the full math.OpenAI SDK
bashexport OPENAI_BASE_URL="https://api.newmen.ai/v1"
export OPENAI_API_KEY="nm_live_..."pythonfrom openai import OpenAI
client = OpenAI() # reads OPENAI_BASE_URL + OPENAI_API_KEY
client.chat.completions.create(
model="openai/gpt-4o",
messages=[{"role": "user", "content": "Hi"}],
)Anthropic SDK
Note: no /v1 suffix on the base URL — the Anthropic SDK appends paths itself.
bashexport ANTHROPIC_BASE_URL="https://api.newmen.ai"
export ANTHROPIC_API_KEY="nm_live_..."pythonfrom anthropic import Anthropic
client = Anthropic() # reads ANTHROPIC_BASE_URL + ANTHROPIC_API_KEY
client.messages.create(
model="anthropic/claude-sonnet-4",
max_tokens=512,
messages=[{"role": "user", "content": "Hi"}],
)Claude Code
bash# Claude Code uses the Anthropic SDK — same env vars.
export ANTHROPIC_BASE_URL="https://api.newmen.ai"
export ANTHROPIC_API_KEY="nm_live_..."
claude # all calls now route through NewmenCodex CLI
bash# Codex CLI uses the OpenAI SDK — same env vars.
export OPENAI_BASE_URL="https://api.newmen.ai/v1"
export OPENAI_API_KEY="nm_live_..."
codex # all calls now route through NewmenOpenRouter
OpenRouter clients are OpenAI-shape. Point them at Newmen and the same provider-prefixed model ids (anthropic/claude-sonnet-4, meta-llama/llama-3.1-70b-instruct, …) keep working.
bash# OpenRouter clients use the OpenAI shape under the hood.
export OPENAI_BASE_URL="https://api.newmen.ai/v1"
export OPENAI_API_KEY="nm_live_..."
# Existing OpenRouter model ids (provider/model) keep working —
# anthropic/claude-sonnet-4, openai/gpt-4o, mistralai/mixtral-8x7b, etc.Cursor
textSettings → Models → Add custom OpenAI-compatible endpoint
Base URL: https://api.newmen.ai/v1
API Key: nm_live_...
Model: openai/gpt-4o (any OpenRouter id, or atlas-1)Cline
textCline settings panel in VS Code:
Provider: OpenAI Compatible
Base URL: https://api.newmen.ai/v1
API Key: nm_live_...
Model: openai/gpt-4oAider
bash# Aider reads OPENAI_BASE_URL / OPENAI_API_KEY.
export OPENAI_BASE_URL="https://api.newmen.ai/v1"
export OPENAI_API_KEY="nm_live_..."
aider --model openai/gpt-4oLangChain
pythonimport os
os.environ["OPENAI_BASE_URL"] = "https://api.newmen.ai/v1"
os.environ["OPENAI_API_KEY"] = "nm_live_..."
from langchain_openai import ChatOpenAI
ChatOpenAI(model="openai/gpt-4o").invoke("Hi")LlamaIndex
pythonimport os
os.environ["OPENAI_BASE_URL"] = "https://api.newmen.ai/v1"
os.environ["OPENAI_API_KEY"] = "nm_live_..."
from llama_index.llms.openai import OpenAI
OpenAI(model="openai/gpt-4o").complete("Hi")Pro tier · optional
Tagging and feedback
Everything above gets you the pay-as-you-go guarantee: match-or-better rate, free models with no card, $5 credits, auto top-up, plus thumbs-down refunds. The two snippets below opt you into the Reliability Loop on top — per-operation tuning, eval-gated auto-refund, and LoRA adapters trained on your traffic. Pro plan; not required to ship.
Tag your calls with operation_id
Add metadata.operation_id to any chat completion (or messages request, or any other Atlas endpoint). Calls with the same operation id roll up together in /console/calls and become eligible for per-operation eval gates and adapters.
bashcurl https://api.newmen.ai/v1/chat/completions \
-H "Authorization: Bearer $OPENAI_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "openai/gpt-4o",
"messages": [{"role": "user", "content": "Summarize"}],
"metadata": { "operation_id": "summarize_ticket" }
}'See /docs/operations for binding evaluators, ship gates, and the full reliability loop.
Refund a bad call (any tier)
Send thumbs_down feedback against a recorded call_id and the call is credited back automatically, no questions asked (fair-use limits in the terms). Works on every plan; the Pro tier additionally adds eval-gated auto-refund that fires synchronously without anyone hitting thumbs-down.
bash# Refund the call — we credit it back automatically.
curl https://api.newmen.ai/v1/feedback \
-H "Authorization: Bearer $OPENAI_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"call_id": "chatcmpl-abc123",
"rating": "thumbs_down",
"correction": "Should have included the customer name."
}'See /docs/feedback for the full feedback contract, and /docs/evaluators for the Pro-tier eval gates that refund without manual flagging.
Card statement descriptor: NEWMEN.AI*CREDITS. Auto top-up keeps your balance above zero so calls never fail mid-flight; thresholds are configurable in /console/settings/billing.