# AI gateways & observability

LiteLLM, Portkey, Helicone, Cloudflare, Vercel and Kong AI gateways, Datadog LLM Observability and Langfuse usage as request telemetry.

AI Spendbook documentation, Billing sources. Web page: https://www.aispendbook.com/docs/ai-gateways

If your AI traffic already goes through a gateway or an observability tool, AI Spendbook can read its request logs instead of you adding the SDK. Each request becomes a request telemetry record priced by us: an estimate, never a bill. The gateway's own cost figure is stored as “source-reported cost” for comparison and is never counted as spend. Billed cost still comes from the provider connectors.

| Connector | How data arrives | What it does |
| --- | --- | --- |
| [LiteLLM proxy](https://www.aispendbook.com/integrations/litellm) | Direct read with an API key | Per-request spend logs: model, provider, tokens, key, team, end user, tags. Optional budget push to virtual keys. |
| [Portkey](https://www.aispendbook.com/integrations/portkey) | Direct read with an API key | Request logs through the Logs Export API, one export per day. |
| [Helicone](https://www.aispendbook.com/integrations/helicone) | Direct read with an API key | Request usage including cache tokens, user and custom properties. |
| [Cloudflare AI Gateway](https://www.aispendbook.com/integrations/cloudflare-ai-gateway) | Direct read with an API token | Gateway request logs and cf-aig-metadata. Cached responses are skipped. |
| [Vercel AI Gateway](https://www.aispendbook.com/integrations/vercel-ai-gateway) | Direct read with an API key | Daily charges and tokens per model. The only gateway here that writes billed cost. |
| [Kong AI Gateway](https://www.aispendbook.com/integrations/kong-ai-gateway) | Kong pushes OpenTelemetry spans | Gen AI spans from Kong's OpenTelemetry plugin, sent to the OTLP receiver. No API connection. |
| [Datadog LLM Observability](https://www.aispendbook.com/integrations/datadog-llm-obs) | Direct read with API and application keys | LLM spans from the Export API. Workflow, agent and tool spans are not read. |
| [Langfuse (usage)](https://www.aispendbook.com/integrations/langfuse-usage) | Direct read with project keys | Generations with tokens, user, session and tags. Separate from the Langfuse evaluation connection. |

## Attribution

Every request-log connector reads customer, feature, environment and run from the row's metadata or `key:value` tags. The keys default to `customer_id`, `feature`, `environment` (Datadog: `env`) and `run_id`, and can be changed per connection.

## Vercel AI Gateway is billed differently

Its report returns the charged price, so it is recorded as billing for the provider `vercel_ai_gateway`, never for the upstream provider, and is not added to a direct OpenAI or Anthropic bill. BYOK requests cost 0 there and stay with the provider's own connection. It needs a Vercel Pro or Enterprise team, Vercel charges for each report query, and the connector runs one query per day of the window.

## Family limits

- LiteLLM has no prompt-cache split in its spend log, and LiteLLM cache hits (no provider call) are skipped.
- Portkey labels its export API beta. An export that takes more than about five minutes fails the sync and is retried on the next run.
- Cloudflare returns 50 logs per request, so very busy gateways sync slowly.
- Langfuse has no provider field. The provider is inferred from the model name or a default you set, and unknown models are skipped and counted.
- The LiteLLM budget push is off unless you turn it on. On Integrations, the LiteLLM connection's menu has Push budgets to LiteLLM (admins): the preview lists each linked budget, its LiteLLM key and the current and new `max_budget`, and Push N keys writes only after a preview. Every preview and push is in the audit log. LiteLLM resets key spend on its own monthly cycle.
- The LiteLLM connector refuses private addresses. For a proxy inside your network, set its delivery to push: a forwarder you run posts each `/spend/logs/v2` page to `POST /api/v1/ingest/push/<connection id>` with an ingestion key. Rows already written are not counted twice.

Each connector was built from the vendor's public API documentation and tested with recorded responses in the documented shape. None has been run against a live account yet. Check the first sync against the vendor's own console.
