Get started in 5 minutes

Outcap is a proxy: your official SDK keeps working as-is — only the baseURL and one header change. Everything starts in dry-run: no request is modified until you enable something.

1. Create an account and a key

Create an account then generate a Outcap key (oc_…) from the dashboard. This key identifies your project — your provider key stays yours (BYOK).

2. Plug in your SDK

OpenAI — JavaScript / TypeScript

import OpenAI from "openai";

const openai = new OpenAI({
  baseURL: "https://proxy-production-8c61.up.railway.app/v1",
  apiKey: process.env.OUTCAP_KEY,            // oc_…
  defaultHeaders: {
    "x-provider-key": process.env.OPENAI_API_KEY,  // sk-… (never stored)
    "x-outcap-route": "support-bot",             // recommended: feature tag
  },
});

OpenAI — Python

from openai import OpenAI

client = OpenAI(
    base_url="https://proxy-production-8c61.up.railway.app/v1",
    api_key=os.environ["OUTCAP_KEY"],
    default_headers={
        "x-provider-key": os.environ["OPENAI_API_KEY"],
        "x-outcap-route": "support-bot",
    },
)

Anthropic — JavaScript / TypeScript

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

const anthropic = new Anthropic({
  baseURL: "https://proxy-production-8c61.up.railway.app",
  apiKey: process.env.OUTCAP_KEY,
  defaultHeaders: {
    "x-provider-key": process.env.ANTHROPIC_API_KEY,
    "x-outcap-route": "extractor",
  },
});

Anthropic — Python

import anthropic

client = anthropic.Anthropic(
    base_url="https://proxy-production-8c61.up.railway.app",
    api_key=os.environ["OUTCAP_KEY"],
    default_headers={
        "x-provider-key": os.environ["ANTHROPIC_API_KEY"],
        "x-outcap-route": "extractor",
    },
)

Agent frameworks (LangChain, CrewAI…)

No Outcap SDK to install: these frameworks all accept a custom base_url and headers, so Outcap plugs in by just changing the LLM config. Perfect for capping autonomous agents.

LangChain — ChatOpenAI

from langchain_openai import ChatOpenAI

llm = ChatOpenAI(
    model="gpt-4o-mini",
    base_url="https://proxy-production-8c61.up.railway.app/v1",
    api_key=os.environ["OUTCAP_KEY"],
    default_headers={
        "x-provider-key": os.environ["OPENAI_API_KEY"],
        "x-outcap-route": "agent-research",
    },
)

LangChain — ChatAnthropic

from langchain_anthropic import ChatAnthropic

llm = ChatAnthropic(
    model="claude-haiku-4-5",
    base_url="https://proxy-production-8c61.up.railway.app",
    api_key=os.environ["OUTCAP_KEY"],
    default_headers={
        "x-provider-key": os.environ["ANTHROPIC_API_KEY"],
        "x-outcap-route": "agent-research",
    },
)

CrewAI — LLM

from crewai import LLM

# CrewAI route via le format OpenAI — Outcap se place devant
llm = LLM(
    model="openai/gpt-4o-mini",
    base_url="https://proxy-production-8c61.up.railway.app/v1",
    api_key=os.environ["OUTCAP_KEY"],
    extra_headers={
        "x-provider-key": os.environ["OPENAI_API_KEY"],
        "x-outcap-route": "crew-agents",
    },
)
# puis : Agent(..., llm=llm)

Same pattern for LlamaIndex, AutoGen, Vercel AI SDK, etc.: any client that exposes base_url + headers works. You stay in dry-run until you enable anything — zero risk on your production agents.

3. Header reference

Header (request)Role
authorization / x-api-keyYour Outcap key (oc_…) — set automatically by the SDK via apiKey
x-provider-keyYour provider key (required). Never logged, never stored.
x-outcap-routeFeature tag (optional). Without it, the route is detected from a fingerprint of the system prompt.
x-outcap-userYour end user's identifier (optional) — enables per-customer tracking and budgets.
Header (response)Meaning
x-outcap-routeRoute detected for this request
x-outcap-simulated-capCap that would be applied (dry-run)
x-outcap-cap-appliedCap actually sent to the provider (active mode)
x-outcap-routed-toModel actually served when routing is enabled
x-outcap-clean-cutsentence | json_repaired — the cut response was finished cleanly

4. Budgets: the 429 error

When a hard budget is exceeded (or the kill switch is on), the request is refused before any provider call:

HTTP 429 — response body (OpenAI format)

{
  "error": {
    "message": "Outcap budget exceeded (global guardrail): $10.000312 spent of $10 per day [scope: project].",
    "type": "insufficient_quota",
    "code": "outcap_budget_exceeded"
  }
}
// Headers : retry-after: <seconds> · x-should-retry: false

Official SDKs won't retry (x-should-retry header) — handle this like an exhausted quota. Possible code: outcap_kill_switch.

5. What's next?

  • Let it run in dry-run: ≥ 10 responses per route to learn the cap.
  • Check Routes in the dashboard: simulated caps and $ you could save.
  • Enable the cap route by route — reversible in one click.
  • Check the model-routing suggestions in each route's detail: “−80% on gpt-5-mini”, simulated on your real tokens, enabled in one click.
  • Set a global budget (“never more than $X/day”) and sleep well.
Documentation · Outcap