Client work makes AI spend hard to see
An agency runs many products for many clients, often on one provider account. At the end of the month there is a single bill and no clean way to say which client used what. Sharing one key across projects also means one client's spike can exhaust everyone's rate limit.
An LLM gateway for agencies fixes the accounting. LLM Gateway separates usage by project and API key while every request still goes through one API.
Separate clients by project and key
Create a project per client and issue keys inside it. The code is the same for every client; only the key changes:
1import OpenAI from "openai";2
3const client = new OpenAI({4 baseURL: "https://api.llmgateway.io/v1",5 apiKey: process.env.LLM_GATEWAY_API_KEY,6});7
8const response = await client.chat.completions.create({9 model: "gpt-4o",10 messages: [{ role: "user", content: "Hello" }],11});1import OpenAI from "openai";2
3const client = new OpenAI({4 baseURL: "https://api.llmgateway.io/v1",5 apiKey: process.env.LLM_GATEWAY_API_KEY,6});7
8const response = await client.chat.completions.create({9 model: "gpt-4o",10 messages: [{ role: "user", content: "Hello" }],11});Bill back from real numbers
Each request is logged with its model, token counts, latency, and cost. Usage is grouped by API key, so a client's monthly AI cost is a report instead of an estimate.
Stop overruns before they happen
Set a usage limit on a client's key. When it is reached, requests are rejected until you raise the limit, which keeps a fixed-price engagement from losing money.
Use the client's own contracts
When a client has its own provider agreement, add their provider keys. Usage is billed on their account and LLM Gateway adds no platform fee.