Your AI agent shouldn't bankrupt your SaaS on a $49 plan.
PALM SOUQ attributes LLM spend to every customer, kills runaway agent loops in the request path, and protects gross margin before the invoice lands.
- 1-line SDK change
- <5 ms latency
- Zero payload logging
- Stripe & Metronome ready
- Spend today
- $547.90
- Loop calls
- 0 / 15
- Requests blocked
- 0
| Tenant | Tier | COGS today | Plan | Status |
|---|---|---|---|---|
| acme-legal | Pro | $18.40 | $99/mo | healthy |
| northwind-ops | Team | $212.60 | $299/mo | 80% soft cap |
| globex-ai | Enterprise | $304.10 | $1500/mo | healthy |
| initech | Pro | $11.90 | $99/mo | healthy |
| umbrella-hr | Free | $0.90 | free | fallback: haiku |
- 14:02:07umbrella-hr Free quota 100%: routed claude-sonnet-4.5 to claude-haiku-4.5
- 14:01:52northwind-ops Soft cap 80% reached: webhook quota.warning sent
Governs traffic to every major provider, framework and billing system
OpenAI
Anthropic
Google Gemini
AWS Bedrock
DeepSeek
Mistral
Groq
LangChain
CrewAI
Stripe
Metronome
Orb
The SaaS gross margin trap
Generative AI broke traditional SaaS unit economics.
In classic SaaS one more active user costs fractions of a cent. In GenAI a power user or a misconfigured agent can burn a month of subscription revenue in an afternoon, and flat-rate pricing hides it until the provider invoice arrives.
- One power user on a $99 plan
- -$301 /mo
- One stuck coding agent, 45 minutes
- $1,200
- Cache reads vs uncached input, Sonnet 4.5
- 10x
$99 of revenue minus $400 of raw model tokens. Multiply by the 25 heaviest accounts out of 500 and the whole plan is underwater.
2,500 Claude Sonnet calls at 150k input and 2k output tokens each: $0.48 per call, about $27 every minute nobody is watching.
$0.30 vs $3.00 per million tokens. Meter them as one number and you misprice every tenant with a long system prompt.
How it works
Four steps from first request to protected margin.
No sidecars, no agents to install, no prompt data leaving the request path.
POST https://gateway.palmsouqltd.com/v1/chat/completions
Authorization: Bearer $OPENAI_API_KEY
X-PalmSouq-Tenant: acme-legal
X-PalmSouq-Tier: pro
X-PalmSouq-Feature: contract-review
# body streams straight through, never written to diskActive circuit breaking vs passive alerting
Passive alerts tell you that you lost money. PALM SOUQ prevents the loss.
Most observability tools post a Slack alert 30 minutes after spend spikes. By then an agent trapped in a tool-calling recursion has made hundreds of requests. PALM SOUQ sits in the request path, scores token velocity and repetition on every call, and stops the run immediately.
See circuit breaker mechanics# before
client = OpenAI(api_key=os.environ["OPENAI_API_KEY"])# with PALM SOUQ: per-tenant governance and circuit breaking
client = OpenAI(
base_url="https://gateway.palmsouqltd.com/v1",
api_key=os.environ["OPENAI_API_KEY"],
default_headers={
"X-PalmSouq-Tenant": user.tenant_id,
"X-PalmSouq-Tier": user.plan_tier,
},
)Drop-in, zero latency tax
Swap a base URL. Keep your SDK, your keys and your code.
PALM SOUQ speaks the OpenAI and Anthropic wire formats natively and proxies Gemini, Bedrock, Azure OpenAI, Mistral, Groq and DeepSeek through the same edge.
- added p50 latency
- <5 ms
- added p50 latency
- gateway SLA
- 99.999%
- gateway SLA
- edge locations
- 280+
- edge locations
- SDK default
- Fail-open
- SDK default
Platform
Six capabilities, one gateway in the request path.
Per-tenant metering
Exact LLM COGS for every customer, down to the microcent.
Gross margin by tenant: plan revenue vs metered model cost, this month
Circuit breakers
Stop loops in under 50 ms.
call 15 search_docs args#9f3a21 (x15) → 429 breaker
Quotas & rate limits
Soft caps warn, hard caps hold.
Model fallbacks
Degrade gracefully, never lock out.
Billing sync
Overages on the invoice, automatically.
Prompt cache tracker
See which prompt templates miss the cache, and what each miss costs per tenant.
- hit rate
- 84%
- saved / mo
- $2,941
- cold templates
- 3
Who uses PALM SOUQ
Built for teams whose margin depends on someone else's token meter.
- B2B AI SaaSA few power users consume most of the tokens and turn flat-rate plans negative.Per-tenant caps, hybrid pricing, overage billing
- Agentic platformsMulti-step agents recurse, retry and spawn sub-agents with nobody watching the meter.Loop heuristics, budget envelopes per agent tree
- AI development agenciesOne client's runaway job must never land on another client's bill.Client isolation, markup telemetry, monthly statements
- FinOps & financeThe provider invoice arrives as one number with no customer breakdown.COGS per customer, plan and feature, synced to billing
Worked example · B2B support agent SaaS
500 customers at $99/mo is $49,500 MRR. 25 of them were costing you money.
| Power users | 25 |
| Raw model spend each, before | $400/mo |
| Margin each, before | -$301/mo |
| PALM SOUQ per-tenant cap | $35/mo |
| Recovered: 25 x ($400 - $35) | +$9,125/mo |
“PALM SOUQ caught an infinite tool loop in our agent during our second week. It saved us roughly $6,000 on a single Saturday.”
“We finally know our exact gross margin per customer. We moved 12 power users to usage overages and took SaaS gross margin from 48% to 76%.”
Zero Payload Retention
We meter the envelope, never the letter.
Prompts and completions stream through gateway memory and are never written to disk, logged or used for training. PALM SOUQ keeps headers, token counts, hashes and timings. SOC 2 Type II certified, GDPR aligned, HIPAA BAA available.
What PALM SOUQ stores
- tenant, tier, feature headers
- model and provider
- input / cached / output tokens
- cost in USD and latency
- tool name + salted args hash
- breaker and quota decisions
What never touches disk
- system and user prompts
- completions and reasoning
- tool call arguments (raw)
- retrieved documents
- end-user PII in payloads
- your provider API keys in plaintext
Questions, answered
How much latency does PALM SOUQ add?
Under 5 ms at p50 on the edge path. The gateway runs on 280+ Anycast points of presence, terminates TLS near your servers, and evaluates policies in memory. Token accounting happens on the streamed response, so it never holds a chunk back from your user.
What happens if PALM SOUQ goes down?
Our SDKs fail open by default: if the gateway does not answer within the configured budget, the request goes directly to the upstream provider with your own key and is reconciled later. You can switch a tenant or tier to fail-closed when budget containment matters more than uptime.
How does PALM SOUQ detect infinite loops without seeing prompt text?
The breaker works on metadata: tool names, a salted hash of tool arguments, token velocity per tenant, step counts per session and a locality-sensitive fingerprint of the completion computed in memory. Repetition is visible from hashes and counts alone, so raw prompts and completions never need to be stored.
Does PALM SOUQ support custom fine-tuned models?
Yes. Fine-tuned OpenAI models, Bedrock custom models and any OpenAI-compatible endpoint you host can be registered with your own per-token rates, so attribution and quotas work the same way as for list-price models.
How does prompt caching get billed?
PALM SOUQ meters cache writes, cache reads and uncached input separately for every tenant and prices each at the provider's rate. On Claude Sonnet 4.5 a cache read costs $0.30 per million tokens against $3.00 uncached, so lumping them together would overstate that tenant's COGS by up to ten times.
How does Stripe usage syncing work?
Each metered request becomes a usage event on the Stripe meter you choose, keyed by your customer ID. You decide whether to send raw tokens, dollars of COGS or a marked-up credit unit, and Stripe turns overages into invoice line items at the end of the period.
Don't wait for a surprise $10,000 OpenAI invoice.
Route your agent traffic through PALM SOUQ in 2 minutes. Change one base URL, pass a tenant header, and every token is attributed and governed.
14-day free production trial · 100k requests included · no card required