Integration

Mistral through the Vigil proxy

Mistral’s API at api.mistral.ai, OpenAI-compatible, with prompt caching keyed by a prompt_cache_key field. Point your SDK's base URL at Vigil, add one header, and every Mistral call is logged with its cost, tokens, latency, errors and agent, then forwarded to https://api.mistral.ai 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 Mistral call

Each Mistral 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 Mistral 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 7 models on this platform today. A model the registry has no row for is logged with its cost left empty, never estimated.

  • codestral-25-08inferred
  • ministral-3-14b-25-12inferred
  • ministral-3-3b-25-12inferred
  • ministral-3-8b-25-12inferred
  • mistral-large-3-25-12inferred
  • mistral-medium-3-5-26-04inferred
  • mistral-small-4-0-26-03inferred

Setup

The Mistral base URL is https://api.vigil.tools/{user_id}/mistral; a request path such as /v1/chat/completions is forwarded unchanged, and your Mistral key stays in MISTRAL_API_KEY. The two Vigil headers, the modes and the error codes are the same for every provider: see the LLM proxy setup.

your Mistral client
import MistralClient from "@mistralai/mistralai";

const client = new MistralClient({
  serverURL: "https://api.vigil.tools/{user_id}/mistral",
});

const response = await client.chat.complete({
  model: "mistral-large-latest",
  messages: [{ role: "user", content: "Hello!" }],
}, {
  // Authorization already carries your Mistral key — Vigil’s goes in its own header.
  fetchOptions: {
    headers: {
      "X-Vigil-Key": "vk_your_vigil_key",
      "X-Vigil-Agent": "my-agent",
    },
  },
});

The header name and value are certain; this SDK’s plumbing for setting them is not — it has not been smoke-tested against a live call. If it does not work, the curl format is the ground truth for exactly what Vigil expects.

Python: No verified Python example for Mistral yet — the SDK’s per-request header hook has not been verified here. Use the curl format: it is the exact request Vigil expects, and any client that lets you set a base URL and a header will work.

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

Prompt caching on Mistral

Vigil sets one field on the request — a cache key naming which cache this call belongs to — and Mistral discounts the reused tokens. This is NOT the breakpoint injection used on Anthropic: Vigil does not choose what gets cached here, only which cache it belongs to, so there is no prefix for the Optimise page to tune.

With optimisation On: Vigil sets a prompt_cache_key so repeated prompts can hit the cache. In Shadow, Vigil measures what caching would have saved and changes nothing. Off records the call and nothing more.

Questions

Which Mistral models does Vigil price?
The registry holds no verified rate for a Mistral model yet, so calls are logged and monitored with the cost left empty rather than guessed.

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