Back to GuidesLLM FinOps

OpenAI-Compatible AI Gateway for FinOps

8 min readUpdated June 2026

Why compatibility matters

The fastest AI FinOps rollout starts with client compatibility. If teams keep familiar request shapes, platform teams can add governance without forcing every application into a migration project.

Point your OpenAI client at Cloptima

Set the OpenAI base URL to Cloptima's OpenAI-compatible endpoint and authenticate with a Cloptima virtual key (not a provider key). Add x-cloptima-* headers to attribute spend. Cloptima applies policy and records usage, then forwards to the upstream provider.

python
from openai import OpenAI

client = OpenAI(
    base_url="https://api.cloptima.ai/v1/ai",   # OpenAI-compatible gateway
    api_key="clop_vk_dPXO67p…",                     # Cloptima virtual key -> Authorization: Bearer
)

resp = client.chat.completions.create(
    model="gpt-4o",
    messages=[{"role": "user", "content": "Summarize this ticket"}],
    extra_headers={
        "x-cloptima-team": "support-ai",
        "x-cloptima-app": "helpdesk",
        "x-cloptima-environment": "production",
    },
)

Use the Anthropic surface too — even for non-Anthropic models

Cloptima also exposes an Anthropic-compatible surface and translates between protocols. That means tools and SDKs that speak the Anthropic Messages API can run OpenAI, Gemini, or Bedrock models through one governed endpoint. Point an Anthropic client at https://api.cloptima.ai (it appends /v1/messages) and pass the virtual key as x-api-key.

python
from anthropic import Anthropic

client = Anthropic(
    base_url="https://api.cloptima.ai",   # Anthropic-compatible; client appends /v1/messages
    api_key="clop_vk_dPXO67p…",              # sent as x-api-key
)

msg = client.messages.create(
    model="gpt-4o",                        # upstream can be OpenAI, Gemini, Bedrock, ...
    max_tokens=512,
    messages=[{"role": "user", "content": "Summarize this ticket"}],
)
One governed endpoint, either protocol. Use the request shape your stack already speaks and still get policy, budgets, and attribution.

What to govern first

Start with provider access, model allowlists, monthly budgets, environment-level limits, and required attribution. These give finance and engineering useful reporting before deeper routing policy is needed.

How Cloptima fits

Cloptima provides the OpenAI- and Anthropic-compatible gateway paths, virtual keys, BYOK credential management, low-latency budget checks, model spend analytics, no-retention prompt policies, and reconciliation-ready usage records.

Rollout pattern

Pick one high-volume app, create a virtual key, point the client base URL at Cloptima, attach team and app metadata, and compare gateway usage against provider billing before expanding coverage.

Put This Guide Into Practice

Cloptima automates the strategies described in this guide.

No credit card required
5-minute setup
Free trial