Skip to content
PALM SOUQ

Model provider

Mistral AI logoPALM SOUQ for Mistral AI

Meter Mistral Large, Medium, Small and Codestral per tenant through PALM SOUQ. Works with the official mistralai SDK or any OpenAI-compatible client, with EU data residency options at the gateway.

One base URL change · tenant headers · <5 ms added
mistral · setup
import os
from mistralai import Mistral

client = Mistral(
    api_key=os.environ["MISTRAL_API_KEY"],
    server_url="https://gateway.palmsouqltd.com/mistral",
)

resp = client.chat.complete(
    model="mistral-medium-latest",
    messages=[{"role": "user", "content": "Translate the release notes"}],
    http_headers={
        "X-PalmSouq-Key": os.environ["PALMSOUQ_KEY"],
        "X-PalmSouq-Tenant": tenant.id,
        "X-PalmSouq-Tier": tenant.plan,
    },
)

Connecting Mistral

Mistral's La Plateforme API uses a chat completions format close to OpenAI's. You can keep the official mistralai Python SDK by setting server_url to gateway.palmsouqltd.com/mistral, or use an OpenAI client pointed at the same path. Either way your Mistral key stays in the Authorization header and the PALM SOUQ headers identify the tenant.

Function calling, JSON mode and streaming are passed through as Mistral defines them. The gateway reads the usage object at the end of each response to price the call.

EU residency for European tenants

Many teams pick Mistral because their customers want processing to stay in the EU. PALM SOUQ can pin a tenant's traffic to the EU Central gateway region, so the request is handled by EU edge PoPs on the way to Mistral and the metering record for that tenant is stored in the EU. Under Zero Payload Retention the prompt and completion are streamed through memory and never written to disk in any region.

Residency is a tenant attribute in PALM SOUQ, not a separate account, so one integration serves EU and non-EU customers with different routing.

Codestral and coding agents

Codestral is built for code completion and coding agents, which are also the workloads most likely to loop. A coding agent stuck on a failing test or a merge conflict will call the same tool with almost the same arguments again and again. PALM SOUQ hashes tool name and arguments per session and trips the breaker when the same hash repeats past your threshold (15 by default).

Mistral does not report cached prompt tokens today, so the cache tracker shows Mistral tenants as uncached and prices all input at the standard rate.

Rolling it out safely

If EU residency is the reason you use Mistral, set the residency attribute on your EU tenants before routing any traffic, then confirm in the request log that those tenants are served by EU Central PoPs. The log records the PoP and region for every request without recording content.

For Codestral-based coding agents, start the tool thrashing heuristic in observe mode. Coding agents legitimately re-run tests several times, so look at the distribution of repeat counts for a week before choosing an enforcement threshold.

Teams that also use OpenAI or Anthropic often put Mistral Small or Medium in the same fallback chain as a cost floor for European tenants. Because the gateway records the serving model for each request, per-tenant reports stay correct after a switch, and residency rules are checked before any fallback is applied.

Govern Mistral AI usage per tenant, starting today.

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