Lamdy
PricingDocs
Sign inStart free
  • Quickstart
  • Connect a provider
  • Data freshness and accuracy
  • Alerts and notifications
  • Revenue and margins
  • Send usage per customer
  • Workspaces and team
  • Plans and limits
  • Security and privacy
  • Troubleshooting
Lamdy docs

Start here

  • Quickstart
  • Connect a provider
  • Data freshness and accuracy

Using Lamdy

  • Alerts and notifications
  • Revenue and margins
  • Send usage per customer

Your account

  • Workspaces and team
  • Plans and limits
  • Security and privacy
  • Troubleshooting

Using Lamdy

Send usage per customer

Split cost by customer and feature when everyone shares one provider key: OpenRouter, OpenTelemetry or the usage events API.

Provider bills say which API key or project spent the money, not which of your customers it was for. When every customer shares one key, your app has to say who each AI call was for. Lamdy then splits that cost by customer, feature and team, priced at the rates on your own provider bill, and shows it on Customers and Features.

If each customer already has their own key or project, you don't need any of this: Attribution rules do it from billing alone.

1. Create an ingest key

In the dashboard, open API keys under Connect and create a key for each app or environment. Owners and admins can create keys. A key is shown once; Lamdy stores only its fingerprint.

Ingest keys can only add usage. They can't read spend, revenue or anything else in your workspace, and you can revoke one at any time, which stops it at once. Keep them on your server, never in a browser or mobile app.

2. Choose how to send usage

Your setupUseCode changes
You call models through OpenRouterOpenRouter BroadcastNone, beyond passing your customer's id as user
Vercel AI SDK, or any app with OpenTelemetryOpenTelemetry tracesRegister an exporter once
Anything elseUsage events APIOne request per AI call

OpenRouter Broadcast

In OpenRouter, open Settings, then Observability. Turn on Broadcast and add an OpenTelemetry Collector with the endpoint https://lamdy.ai/api/otel/v1/traces and the header {"Authorization": "Bearer YOUR_INGEST_KEY"}. Then send your customer's id as user on each request, and optionally the feature in trace:

{
  "model": "openai/gpt-4o-mini",
  "messages": [...],
  "user": "cus_123",
  "trace": { "feature": "support-chat" }
}

Lamdy uses the cost OpenRouter reports for each call.

OpenTelemetry and the Vercel AI SDK

Point a trace exporter at https://lamdy.ai/api/otel/v1/traces using OTLP over HTTP, as protobuf or JSON, and send the ingest key as a bearer token. With the standard variables, which every OpenTelemetry SDK reads:

OTEL_EXPORTER_OTLP_TRACES_ENDPOINT=https://lamdy.ai/api/otel/v1/traces
OTEL_EXPORTER_OTLP_TRACES_HEADERS=Authorization=Bearer%20YOUR_INGEST_KEY

Lamdy counts each span that describes one model call and reads these attributes:

Lamdy fieldAttributes read, first match wins
Customerlamdy.customer_id, trace.metadata.customer_id, user.id, enduser.id
Featurelamdy.feature, trace.metadata.feature, the AI SDK's functionId
Teamlamdy.team, trace.metadata.team
Model and providergen_ai.response.model, gen_ai.request.model, gen_ai.provider.name
Tokensgen_ai.usage.input_tokens, output_tokens, cache_read.input_tokens, cache_creation.input_tokens

A model call without a customer, feature or team of its own takes them from the span that wraps it, so you can tag a whole request once, as long as the wrapping span is exported in the same batch, which the default batch exporter does. Agent and wrapper spans that add up their children's usage are not counted twice. The API keys page has a ready-made setup for Next.js.

Usage events API

After each AI call, send the model, the tokens and at least one of customer_id, feature or team to https://lamdy.ai/api/v1/events:

curl -X POST https://lamdy.ai/api/v1/events \
  -H "Authorization: Bearer $LAMDY_INGEST_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model": "gpt-4o-mini", "customer_id": "cus_123", "feature": "support-chat",
       "input_tokens": 1200, "output_tokens": 340, "request_id": "req_abc"}'

Up to 1,000 events fit in one request as { "events": [...] }. Optional fields are provider, cache_read_tokens, cache_write_tokens, cost_usd and timestamp (up to 35 days back). Unknown fields are refused with a message naming them, so a typo never drops attribution silently.

Retries, limits and privacy

  • A retried request is counted once: spans dedupe on their trace and span id, and events on request_id, so send one with every event.
  • Each key can make 600 event requests or 3,000 trace exports a minute. Requests can be up to 1 MB for events and 4 MB for traces, gzip allowed.
  • Lamdy keeps the model, token counts, cost and your customer, feature and team names. It never stores prompts or responses, even when a trace contains them.

Where the numbers show up

Customers and Features use these events ahead of Attribution rules. Tokens for a model with no billed history in Lamdy yet are listed as unpriced until the provider's bill catches up.

PreviousRevenue and marginsNextWorkspaces and team
Lamdy

AI cost & margin intelligence

Product

  • Cost dashboard
  • Model comparison
  • Margin intelligence
  • Alerts & forecasting

Company

  • About
  • Docs
  • Security
  • Terms
  • Privacy

Pricing

  • Plans & pricing
  • Start free

© 2026 Lamdy

X (Twitter)LinkedIn