Illustrative example · customer-support · identity cust_acme · Console-edited policy, no redeploy
Requested
- Modelopus-4
- ReasoningHigh
- ToolsOn
- Tokens8k
Executed
- —
Developer sends intent — Console policy has not run yet.
RUNTIME USAGE CONTROL
Identify the customer behind every request, measure what they consume, and enforce your business policies while the request is still running.
Metering tells you what happened. UsageFlow decides what happens next.
Free: 1 workflow with a live policy • No credit card
Runtime control
Your code says what it wants. UsageFlow checks who is asking and shapes what actually executes.
Illustrative example · customer-support · identity cust_acme · Console-edited policy, no redeploy
Requested
Executed
Developer sends intent — Console policy has not run yet.
Why UsageFlow
Today
Nothing connects them.
With UsageFlow
identity: 'cust_acme'1,284 requests · $42.18allow · transform · block
Metering tells you what happened.
UsageFlow decides what happens next.
Policy engine
Rules on who the customer is, their plan, and what they’ve used. Checked on every request.
Trigger
Tiers first match wins
Then
Then
Effects
Notify SlackReport to a Stripe meterThe same customer identity and ledger cover more than LLM calls.
Identity · usage · cost
Usage, cost, and policy decisions, tied to the customer behind them.
CUSTOMER
cust_acme
Acme Inc.
USAGE
1,284
requests
SPEND
$42.18
this month
BILLING
Stripe
Synced
Integration
Pass identity and workflow with each call. Policy lives in the Console.
import { usage } from '@usageflow/vibe';
usage.init({ apiKey: process.env.USAGEFLOW_API_KEY! });
const result = await usage.chat({
// Identity → scoped ledger (your customer, not an API key)
identity: 'cust_acme',
workflow: 'customer-support',
provider: 'anthropic',
model: 'claude-sonnet-5',
messages: [{ role: 'user', content: prompt }],
});
identity binds to the ledger
✓ Console may rematch model / tools / budget
✓ Trace shows requested vs executed
from usageflow.vibe import VibeClient, Message
client = VibeClient() # reads USAGEFLOW_API_KEY
result = client.chat(
# Identity → scoped ledger (your customer, not an API key)
identity="cust_acme",
workflow="customer-support",
model="claude-sonnet-5",
messages=[Message("user", prompt)],
)
identity and workflow fields
✓ Synchronous client; provider inferred from model
import "github.com/usageflow/usageflow-go-middleware/v2/pkg/vibe"
client, err := vibe.New(vibe.Options{APIKey: os.Getenv("USAGEFLOW_API_KEY")})
if err != nil {
log.Fatal(err)
}
defer client.Destroy()
res, err := client.Chat(ctx, vibe.ChatRequest{
// Identity → scoped ledger (your customer, not an API key)
Identity: "cust_acme",
Workflow: "customer-support",
Provider: vibe.ProviderAnthropic,
Model: "claude-sonnet-5",
Messages: []vibe.Message{{Role: "user", Content: prompt}},
})
identity and workflow fields
✓ Explicit client lifecycle: New / Destroy
FAQ
identity and workflow with each call; UsageFlow measures consumption, attributes it to that customer, and applies Console policies while the request runs. With the Vibe SDK for AI calls, policies can enforce budgets and route models. The Vibe SDK is the current integration for AI calls: usage.chat() and usage.prompt().
identity. UsageFlow scopes a ledger to that identity and can report (Console / Stripe) on identity and workflow dimensions, so spend reads in language your customers understand, not just API keys.
usage.wrap(nativeClient) alongside the unified path.
Start with one workflow. Know what every customer consumes, and decide what happens next.
Free: 1 workflow with a live policy • No credit card • TypeScript, Python & Go • OpenAI + Anthropic