PALM SOUQ vs Cloudflare AI Gateway
PALM SOUQ vs Cloudflare AI Gateway
Cloudflare AI Gateway gives any Cloudflare account analytics, logging, caching, rate limiting and fallbacks for AI traffic on Cloudflare's network. PALM SOUQ adds the tenant layer: budgets per customer, behavioural loop breakers and margin you can bill on.
import os
from openai import OpenAI
client = OpenAI(
base_url="https://gateway.palmsouqltd.com/v1",
api_key=os.environ["OPENAI_API_KEY"],
default_headers={
"X-PalmSouq-Tenant": account.id, # your customer ID
"X-PalmSouq-Tier": account.plan, # starter | team | enterprise
"X-PalmSouq-Feature": "support-agent", # optional cost center
},
)import os, json
from openai import OpenAI
ACCOUNT, GATEWAY = os.environ["CF_ACCOUNT_ID"], "prod-ai"
client = OpenAI(
base_url=f"https://gateway.ai.cloudflare.com/v1/{ACCOUNT}/{GATEWAY}/openai",
api_key=os.environ["OPENAI_API_KEY"],
default_headers={"cf-aig-metadata": json.dumps({"customer": account.id})},
)Edge AI gateway
What Cloudflare AI Gateway does well.
- It runs on Cloudflare's global network and is available on every Cloudflare plan, so the cost of trying it is close to zero.
- Analytics, logging, caching, rate limiting, retries and model fallback are configured per gateway in the dashboard, with custom metadata on requests for filtering.
- Teams already on Workers and Cloudflare's developer platform get AI traffic in the same place as the rest of their edge.
Capability matrix
PALM SOUQ and Cloudflare AI Gateway, side by side.
Descriptions, not checkmarks: most rows are a question of emphasis rather than presence.
| Capability | PALM SOUQ | Cloudflare AI Gateway |
|---|---|---|
| Edge network | 280+ PoPs, under 5 ms added | Cloudflare global network |
| Analytics and logging | Token and cost metadata; Zero Payload Retention | Yes, request logs and analytics |
| Caching | Tracks provider prompt cache reads and writes per tenant | Yes, response caching at the gateway |
| Rate limiting | Per tenant and tier, tokens and dollars | Yes, configured per gateway |
| Runaway loop heuristics | Four heuristics, HTTP 429 halt | Rate limits; no dedicated loop heuristics documented |
| Per-tenant budgets and margin | Built in | Filter analytics by custom metadata |
| Billing platform sync | Stripe, Metronome, Orb, Lago | Logs and analytics export |
| Price | From $99 a month plus usage | Available on all Cloudflare plans; some features metered |
Where PALM SOUQ differs
Governance in the request path, keyed on your customer.
Per-gateway settings versus per-tenant policy
Cloudflare's controls are configured per gateway. If you sell three tiers to 1,000 customers, you need limits that follow each customer and each tier. PALM SOUQ's policies key on X-PalmSouq-Tenant and X-PalmSouq-Tier.
Loops, not just volume
Rate limits cap volume. PALM SOUQ's heuristics recognise the shape of a runaway agent and halt it, even when its request rate looks normal.
Finance-grade output
Gross margin per tenant, cache read and write accounting per tenant, and metered usage streamed to Stripe, Metronome, Orb or Lago.
Choose Cloudflare AI Gateway when
- You need visibility, caching and a global rate limit with minimal setup, and you are already on Cloudflare.
- Your app has one pricing tier or does not resell AI usage.
- Response caching of identical requests is your main saving.
Choose PALM SOUQ when
- Each customer and tier needs its own budget and its own fallback.
- You run agents that can loop without spiking request volume.
- You bill AI usage and need overages in your billing system.
Using both: PALM SOUQ itself runs at the edge, and teams on Workers call it as an OpenAI-compatible upstream from their Worker.
Migration
Moving from Cloudflare AI Gateway.
Replace the Cloudflare gateway URL with gateway.palmsouqltd.com and move the customer ID from custom metadata into X-PalmSouq-Tenant.
- 01Export 30 days of analytics filtered by customer metadata to seed budgets.
- 02Move the customer ID from cf-aig-metadata to X-PalmSouq-Tenant and the plan to X-PalmSouq-Tier.
- 03Recreate fallbacks as per-tier fallback chains.
- 04Keep Cloudflare response caching in front of PALM SOUQ if you rely on it.
import os, json
from openai import OpenAI
ACCOUNT, GATEWAY = os.environ["CF_ACCOUNT_ID"], "prod-ai"
client = OpenAI(
base_url=f"https://gateway.ai.cloudflare.com/v1/{ACCOUNT}/{GATEWAY}/openai",
api_key=os.environ["OPENAI_API_KEY"],
default_headers={"cf-aig-metadata": json.dumps({"customer": account.id})},
)import os
from openai import OpenAI
client = OpenAI(
base_url="https://gateway.palmsouqltd.com/v1",
api_key=os.environ["OPENAI_API_KEY"],
default_headers={
"X-PalmSouq-Tenant": account.id, # your customer ID
"X-PalmSouq-Tier": account.plan, # starter | team | enterprise
"X-PalmSouq-Feature": "support-agent", # optional cost center
},
)PALM SOUQ vs Cloudflare AI Gateway: questions
Does Cloudflare AI Gateway have rate limiting?
Yes, configured per gateway. PALM SOUQ applies limits and budgets per tenant and tier, and adds loop heuristics and billing sync.
Is PALM SOUQ slower than Cloudflare's gateway?
Both run at the edge. PALM SOUQ adds under 5 ms to a request, and SDKs fail open if the gateway is unreachable.
Can I use both?
Yes. A Worker or Cloudflare gateway can use PALM SOUQ as its OpenAI-compatible upstream.
Cloudflare AI Gateway is a trademark of its owner and is referenced here for comparison only. Spotted something out of date? Email legal@palmsouqltd.com.
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