Skip to content
PALM SOUQ

PALM SOUQ vs Portkey

PALM SOUQ vs Portkey

Portkey is a broad AI gateway with routing, guardrails, prompt management and observability. PALM SOUQ is narrower: a per-tenant cost governor that kills runaway agent loops in the request path and ties every token to the revenue it earns.

Capabilities based on Portkey's public documentation. Corrections: legal@palmsouqltd.com
client.py (with PALM SOUQ)
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
    },
)
Portkey logo

AI gateway and LLMOps platform

What Portkey does well.

  • Portkey connects to a very large catalogue of models through one API, with load balancing, retries, conditional routing and fallbacks configured as gateway configs.
  • It has prompt management, guardrails and a polished observability console, and the core gateway is open source, so teams can self-host it.
  • Budget limits and rate limits can be attached to virtual keys or API keys, and metadata on each request lets you filter logs and cost by user.

Capability matrix

PALM SOUQ and Portkey, side by side.

Descriptions, not checkmarks: most rows are a question of emphasis rather than presence.

CapabilityPALM SOUQPortkey
Provider routing, retries and fallbacksYes, OpenAI-compatible with fallback chains per tierYes, very broad model catalogue and config-based routing
Budget and rate limitsPer tenant, tier, feature and user; soft and hard capsYes, on virtual keys and API keys
Runaway loop heuristics in the request pathFour heuristics: tool thrashing, token velocity, semantic echo, recursion depthRate limits and guardrails; no dedicated loop heuristics documented
Per-tenant gross margin (revenue vs COGS)Built in, hourly, per tier and per tenantCost analytics filterable by metadata
Usage sync to billing platformsStripe, Metronome, Orb, Lago with markup rulesCost data available via API and exports
Prompt cache read and write accountingPer tenant, with cache write premium pricedGateway-level simple and semantic caching
Prompt management and guardrailsNot a focus; bring your ownYes, a core product area
Payload retentionZero Payload Retention by defaultRequest logging is part of the observability product; configurable
Self-hostingVPC or self-hosted gateway on ScaleOpen-source gateway available

Where PALM SOUQ differs

Governance in the request path, keyed on your customer.

Loop detection is a first-class control, not a rate limit

A rate limit counts requests or tokens per window. A runaway agent often stays under that ceiling for hours, calling the same tool with the same arguments. PALM SOUQ fingerprints tool calls, watches token velocity, detects semantic echo between consecutive steps and caps recursion depth, then returns HTTP 429 with X-PalmSouq-Reason: circuit_breaker_triggered in under 50 ms. You can approximate this in any gateway with tight limits, at the cost of also throttling legitimate heavy users.

Tenant is the primary key, and margin is the metric

Portkey can attribute cost to metadata you send. PALM SOUQ is built around the tenant: it stores your plan price per tier, reconciles provider cost against that revenue, and reports gross margin per customer every hour. Finance teams get a margin table, not a log filter.

Usage flows into your invoices

PALM SOUQ streams metered usage to Stripe, Metronome, Orb and Lago, with markup rules per tier, so a hard cap can turn into a billable overage instead of a lockout.

Choose Portkey when

  • You want one platform for routing, prompt versioning, guardrails and request logs, and cost control is one need among many.
  • You need a very wide model catalogue behind a single API more than per-customer economics.
  • Your traffic is mostly single-shot completions without long-running agents.

Choose PALM SOUQ when

  • You sell AI features on flat or tiered plans and need gross margin per customer.
  • You run multi-step agents and want loops killed by behaviour, not by a blunt request ceiling.
  • You want caps that convert into billable overages in Stripe, Metronome, Orb or Lago.

Using both: Some teams keep Portkey for prompt management and route its upstream calls through PALM SOUQ for tenant governance. Chaining gateways adds a hop; PALM SOUQ's share is under 5 ms.

Migration

Moving from Portkey.

If you call Portkey through the OpenAI SDK, the move is a base URL and header swap. Portkey metadata such as a user or account ID maps onto X-PalmSouq-Tenant.

  1. 01Export 30 days of cost by metadata from Portkey to seed tenant baselines.
  2. 02Add your provider key to PALM SOUQ; it is held in KMS and never returned to the browser.
  3. 03Swap base_url and headers in a canary service, compare per-tenant cost for a week, then cut over.
  4. 04Recreate Portkey fallback configs as PALM SOUQ fallback chains per tier.
client.py (Portkey)
import os, json
from openai import OpenAI

client = OpenAI(
    base_url="https://api.portkey.ai/v1",
    api_key="unused",
    default_headers={
        "x-portkey-api-key": os.environ["PORTKEY_API_KEY"],
        "x-portkey-provider": "openai",
        "x-portkey-metadata": json.dumps({"_user": account.id}),
    },
)
client.py (with PALM SOUQ)
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 Portkey: questions

Does Portkey have budget limits?

Yes. Portkey supports budget and rate limits on keys. PALM SOUQ's difference is per-tenant margin reporting, billing sync and behavioural loop detection, not the existence of limits.

Can I run PALM SOUQ and Portkey together?

Yes. Point Portkey's upstream at gateway.palmsouqltd.com, or call PALM SOUQ directly for agent traffic and keep Portkey for other workloads. Each gateway adds its own latency; PALM SOUQ adds under 5 ms.

Will I lose request logs if I move to PALM SOUQ?

PALM SOUQ keeps token counts, costs, model, status and timing, but not prompt or completion text. If you need payload logs for debugging, keep them in your own store or an observability tool.

Portkey 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