Integration

Fireworks AI through the Vigil proxy

Fireworks AI’s inference API at api.fireworks.ai for open-weight models, OpenAI-compatible. Point your SDK's base URL at Vigil, add one header, and every Fireworks AI call is logged with its cost, tokens, latency, errors and agent, then forwarded to https://api.fireworks.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 Fireworks AI call

Each Fireworks AI 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 Fireworks AI 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.

  • accounts/fireworks/models/deepseek-v4p1-flash
  • accounts/fireworks/models/deepseek-v4p1-flash-1017
  • accounts/fireworks/models/glm-5p3
  • accounts/fireworks/models/kimi-k3p1-pro
  • accounts/fireworks/models/minimax-m3p1-flash
  • fireworks/deepseek-v4-pro-0813
  • fireworks/kimi-k3

Price per token, by model: Kimi K3.

Setup

The Fireworks AI base URL is https://api.vigil.tools/{user_id}/fireworks; a request path such as /v1/chat/completions is forwarded unchanged, and your Fireworks AI key stays in FIREWORKS_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 Fireworks AI client
import OpenAI from "openai";

const client = new OpenAI({
  apiKey: process.env.FIREWORKS_API_KEY,   // unchanged
  baseURL: "https://api.vigil.tools/{user_id}/fireworks/v1",
  defaultHeaders: {
    // MUST be X-Vigil-Key: Authorization already carries your Fireworks AI 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 /fireworks unchanged to https://api.fireworks.ai. 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 Fireworks AI config: the part after https://api.fireworks.ai is exactly what belongs here.

your Fireworks AI client
from openai import OpenAI

client = OpenAI(
    api_key=os.environ["FIREWORKS_API_KEY"],  # unchanged
    base_url="https://api.vigil.tools/{user_id}/fireworks/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 /fireworks unchanged to https://api.fireworks.ai. 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 Fireworks AI config: the part after https://api.fireworks.ai is exactly what belongs here.

terminal
curl https://api.vigil.tools/{user_id}/fireworks/v1/chat/completions \
  -H "content-type: application/json" \
  -H "Authorization: Bearer $FIREWORKS_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 /fireworks unchanged to https://api.fireworks.ai. 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 Fireworks AI config: the part after https://api.fireworks.ai is exactly what belongs here.

Prompt caching on Fireworks AI

Vigil adds a routing hint so repeat calls are more likely to land on a machine that already holds your prompt. That raises the hit rate; it cannot mark a cache breakpoint, so there is no guaranteed saving and nothing here is reported as one.

With optimisation On: Vigil adds a cache-affinity hint, which can raise the hit rate but cannot place a cache marker. In Shadow, Vigil measures what caching would have saved and changes nothing. Off records the call and nothing more.

Questions

Which Fireworks AI models does Vigil price?
7 models with a published rate in the registry: accounts/fireworks/models/deepseek-v4p1-flash, accounts/fireworks/models/deepseek-v4p1-flash-1017, accounts/fireworks/models/glm-5p3, accounts/fireworks/models/kimi-k3p1-pro, accounts/fireworks/models/minimax-m3p1-flash, fireworks/deepseek-v4-pro-0813, fireworks/kimi-k3. A call to any other Fireworks AI 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 · Groq · Cerebras · Baseten · Moonshot · Z.ai · Cloudflare Workers AI · OpenRouter