Integration

Baseten through the Vigil proxy

Baseten’s model-serving API at inference.baseten.co, OpenAI-compatible. Point your SDK's base URL at Vigil, add one header, and every Baseten call is logged with its cost, tokens, latency, errors and agent, then forwarded to https://inference.baseten.co unchanged unless you switch on an optimisation. Prompt caching never changes answers. History trimming and model routing can: both are opt-in, run in Shadow first, and stop automatically if errors, cut-off answers or failed answers rise.

What Vigil records per Baseten call

Each Baseten call is one record: model id, tokens, cache reads and writes, latency, status, error code and agent. What a record holds, what happens to your Baseten key and what the hop costs in latency are answered once in the FAQ: what Vigil sees, your provider key and added latency.

Cost is computed from the proxy's rate registry, which prices 2 models on this platform today. A model the registry has no row for is logged with its cost left empty, never estimated.

  • moonshotai/Kimi-K3
  • zai-org/GLM-5.3

Price per token, by model: Kimi K3.

Setup

The Baseten base URL is https://api.vigil.tools/{user_id}/baseten; a request path such as /v1/chat/completions is forwarded unchanged, and your Baseten key stays in BASETEN_API_KEY. The path after the segment is whatever your client already uses, /v1 for most OpenAI-compatible APIs. The two Vigil headers, the modes and the error codes are the same for every provider: see the LLM proxy setup.

your Baseten client
import OpenAI from "openai";

const client = new OpenAI({
  apiKey: process.env.BASETEN_API_KEY,   // unchanged
  baseURL: "https://api.vigil.tools/{user_id}/baseten/v1",
  defaultHeaders: {
    // MUST be X-Vigil-Key: Authorization already carries your Baseten key.
    "X-Vigil-Key": "vk_your_vigil_key",
    "X-Vigil-Agent": "my-agent",
  },
});

const completion = await client.chat.completions.create({
  model: "<your model id>",
  messages: [{ role: "user", content: "Hello!" }],
});

Vigil forwards everything after /baseten unchanged to https://inference.baseten.co. The path above is whatever your client already uses — /v1 is the OpenAI-compatible default and is right for most, but some providers prefix it with a product segment. If you get a 404, compare it against the base URL in your Baseten config: the part after https://inference.baseten.co is exactly what belongs here.

your Baseten client
from openai import OpenAI

client = OpenAI(
    api_key=os.environ["BASETEN_API_KEY"],  # unchanged
    base_url="https://api.vigil.tools/{user_id}/baseten/v1",
    default_headers={
        "X-Vigil-Key": "vk_your_vigil_key",
        "X-Vigil-Agent": "my-agent",
    },
)

completion = client.chat.completions.create(
    model="<your model id>",
    messages=[{"role": "user", "content": "Hello!"}],
)

Vigil forwards everything after /baseten unchanged to https://inference.baseten.co. The path above is whatever your client already uses — /v1 is the OpenAI-compatible default and is right for most, but some providers prefix it with a product segment. If you get a 404, compare it against the base URL in your Baseten config: the part after https://inference.baseten.co is exactly what belongs here.

terminal
curl https://api.vigil.tools/{user_id}/baseten/v1/chat/completions \
  -H "content-type: application/json" \
  -H "Authorization: Bearer $BASETEN_API_KEY" \
  -H "X-Vigil-Key: vk_your_vigil_key" \
  -H "X-Vigil-Agent: my-agent" \
  -d '{
    "model": "<your model id>",
    "messages": [{ "role": "user", "content": "Hello!" }]
  }'

Vigil forwards everything after /baseten unchanged to https://inference.baseten.co. The path above is whatever your client already uses — /v1 is the OpenAI-compatible default and is right for most, but some providers prefix it with a product segment. If you get a 404, compare it against the base URL in your Baseten config: the part after https://inference.baseten.co is exactly what belongs here.

Prompt caching on Baseten

This provider caches automatically, on its own terms. Vigil records what it reports and prices it — there is nothing for Vigil to add to the request.

With optimisation On: the provider caches automatically or not at all; Vigil records cache use and does not change the request. In Shadow, Vigil measures what caching would have saved and changes nothing. Off records the call and nothing more.

Questions

Which Baseten models does Vigil price?
2 models with a published rate in the registry: moonshotai/Kimi-K3, zai-org/GLM-5.3. A call to any other Baseten model is logged and monitored, with its cost left empty rather than guessed.

Other providers: Anthropic · AWS Bedrock · Google Vertex · OpenAI · Google Gemini · Mistral · xAI Grok · DeepSeek · Together AI · Fireworks AI · Groq · Cerebras · Moonshot · Z.ai · Cloudflare Workers AI · OpenRouter