Skip to main content

B10 - Model Pricing Registry

GroupTechnologyStatusServiceRoadmap phaseContracts
B - LLM management and Model GatewayDevelopedto developfinops2usage-event

Back to index - Français

Role and responsibilities​

Versioned price cards per provider, model, region, unit and currency.

Data model​

Tables (schema eai, every tenant table carries tenant_id uuid NOT NULL with an RLS policy on current_setting('app.tenant_id', true)::uuid): eai.usage_events, eai.price_cards, eai.fx_rates, eai.recon_imports, eai.audit_events.

API endpoints​

  • GET /v1/finops/price-cards
  • POST /v1/finops/price-cards
  • GET /v1/finops/price-cards/{id}
  • POST /v1/finops/price-cards/{id}/retire
  • GET /v1/finops/fx-rates
  • PUT /v1/finops/fx-rates
POST /v1/finops/price-cards HTTP/1.1
Host: <control-plane-host>
X-API-Key: eai_xxx_secret
Accept-Language: en
Content-Type: application/json

{"provider": "openai", "model_pattern": "gpt-4o*", "currency": "USD", "version": "2025-05", "prices": {"input_tokens": 2.5, "output_tokens": 10.0}, "effective_from": "2025-01-01T00:00:00Z"}
{"id": "a9f571c4-9c05-4254-8e25-e1d5273a9b3d", "scope": "tenant", "tenant_id": "18de5695-21f9-4053-a4ea-beb4bf2a5932", "status": "active", "provider": "openai", "model_pattern": "gpt-4o*", "region": "*", "usage_type": null, "currency": "USD", "version": "2025-05", "effective_from": "2025-01-01T01:00:00+01:00", "effective_to": null, "reasoning_billing": "included_in_output", "prices": {"input_tokens": "2.5", "output_tokens": "10.0"}, "image_prices": {}, "video_prices": {}, "tiers": [], "reference": false, "source": null, "notes": null, "created_at": "2026-10-30T02:38:04.091090+01:00"}

Errors use the common envelope {"error": {"code", "message", "message_i18n", "details", "request_id"}}; lists are paginated with limit and cursor.

SDK usage​

Python (enterprise_ai):

from enterprise_ai import EnterpriseAI

client = EnterpriseAI(base_url="<control-plane-url>", api_key="eai_xxx_secret")
items = client.finops.list_price_cards()

TypeScript (@enterprise-ai/sdk):

import { EnterpriseAI } from "@enterprise-ai/sdk";

const eai = new EnterpriseAI({ baseUrl: "<control-plane-url>", apiKey: process.env.EAI_API_KEY });
const items = await eai.finops.priceCards.list();

Java (enterprise-ai-java):

EnterpriseAIClient client = EnterpriseAIClient.builder()
.baseUrl("<control-plane-url>")
.apiKey(System.getenv("EAI_API_KEY"))
.build();
var items = client.finops().listPriceCards();

Go (enterprise-ai-go):

client, _ := eai.NewClient(eai.WithBaseURL("<control-plane-url>"), eai.WithAPIKey(os.Getenv("EAI_API_KEY")))
items, err := client.FinOps.ListPriceCards(ctx)

Configuration​

  • Environment: EAI_DATABASE_URL, EAI_OTEL_EXPORTER_OTLP_ENDPOINT.
  • Helm values: controlPlane.enabled, controlPlane.replicas, controlPlane.resources, controlPlane.config.

Security controls​

  • Authentication by OIDC JWT, tenant API key with scopes, or SPIFFE mTLS; tenant resolved from the credential, never from the body.
  • Authorization through OpenFGA and OPA decisions; every mutation and decision writes a hash-chained eai.audit_events row.
  • Secrets never returned by the API; TLS everywhere; Cilium network policies restrict who can reach the service.

Observability​

  • Metrics: eai_model_pricing_registry_requests_total, eai_model_pricing_registry_errors_total, eai_model_pricing_registry_latency_seconds (Prometheus).
  • Traces: OpenTelemetry spans eai.finops.* with W3C traceparent propagation, AI spans forwarded to Opik.
  • Audit actions: finops.price_card.create, finops.price_card.retire, finops.reconciliation.run, policy.evaluate.

FinOps aspects​

Operating cost is allocated per tenant and project through labels on Usage Events and Kubernetes resource requests; no direct per-call cost.

Failure modes and resilience​

  • Stateless replicas behind the API Gateway, PostgreSQL HA for state; readiness probe GET /readyz removes unhealthy pods.
  • External system unavailable: fail closed for security decisions, explicit error code, no silent bypass.

Standalone adoption (client of a client)​

A client of a client can adopt this brick alone with the Python SDK sub-client client.finops (TS eai.finops, Java client.finops(), Go client.FinOps). Minimal deployment: Control Plane API + PostgreSQL + Keycloak (or API keys), the Control Plane loads every domain of services/control-plane/src/eai/domains; the optional chart components are switched off in deploy/helm/enterprise-ai/values.yaml (vllm.enabled, qdrant.enabled, nats.enabled, workers.enabled).

Acceptance tests​

  1. A tenant cannot read or modify another tenant's resources (RLS test).
  2. Every mutation produces an audit event verifiable by GET /v1/audit/verify.
  3. Errors are returned in English and French according to Accept-Language.

Audio, image, video, GPU and storage prices (LLM_-011)​

eai.finops_media_prices (V137) keeps dated revisions per unit (audio_second, image, video_second, gpu_second, storage_gb_month), provider and resource, with their source. POST /v1/finops/media-costs/estimate applies the revision in force at the usage date and returns its provenance; without a revision the cost is null with status: unavailable and reason: price_unknown, never zero. Tests: tests/test_finops_media.py.