Skip to content

Usage and cost

OpenPike records the tokens and cost of every request so you can see spend by agent, key, model and provider; this page explains where the numbers come from and when there is no cost.

For each request: the time, the requested and served model, the provider, the virtual key and tags, the HTTP status, input, cached input, cache write, output and reasoning tokens where the provider reports them, the cost, time to first token, total latency and OpenPike’s own overhead. Prompts and responses are not part of it; they are only stored by prompt logging, which is off unless an owner turns it on.

You see it in:

  • Logs: every request, filterable by time, agent, key, model, provider, status and tag, with a live tail. Select a row for all its details.
  • Activity: spend over time, grouped by model, agent or provider, with totals and the top agents and keys. When an organization has several workspaces, All workspaces shows them together.
  • Agents and Keys: spend this month per agent tag and per virtual key, with an error rate and a count of blocked requests.

The dashboard counts two kinds of failed request apart.

  • Blocked: OpenPike refused the request before any provider call: budget_exceeded, loop_detected, scope_paused, run_limit_exceeded, plan_limit_reached, plan_limit_throttled or organization_suspended. This is OpenPike doing its job, so blocked requests are not in the error rate. They show as, for example, “2 blocked” next to it, and as Blocked in Logs.
  • Errors: every other request that failed with status 400 or above: provider 4xx and 5xx, timeouts, connection failures, and request problems such as an unknown model or a missing provider key.

The error rate is errors divided by the requests that were not blocked. A correctly capped agent shows 0% and a count of blocked requests; a provider outage shows as errors. Days summarized before this change keep their old counts, which included blocked requests.

Logs are kept for the plan’s log retention: 3 days on Free, 30 on Team, 90 on Business. Older rows are deleted every night.

OpenPike’s overhead is the time OpenPike spends before the provider call starts, counted from your request body being fully received. It excludes the request upload, which a direct call to the provider waits for too; that is reported separately as body. The response then streams straight through without buffering, so OpenPike adds nothing to the time between tokens. The overhead is made of the key check, budgets and limits, routing and the provider key (not reading the request):

  • Key check: looking up your virtual key, its workspace and organization. Kept in memory for a minute, so it is usually well under a millisecond.
  • Budgets and limits: one call to your organization’s limits (budgets, pauses, loop detection and the plan’s request limit). It runs at the same time as reading the request, routing and preparing the provider key, and nothing is sent to the provider until it answers.
  • Routing: resolving the model name or alias.
  • Provider key: loading and decrypting your provider key.

Every response carries a server-timing header with these steps, for example auth;dur=0.3, body;dur=2.1, gate;dur=9.8, route;dur=0.1, key;dur=0.4, overhead;dur=10.6, connect;dur=412.0. overhead leaves out body, and the other steps overlap, so they do not add up to it. connect is the provider’s own time to send its response headers, not OpenPike’s. body is the time to receive and parse your request: it grows with the request size, and a direct call to the provider waits for the same upload. Logs shows the gateway overhead and the same steps for every request.

OpenPike never counts tokens itself. It reads the provider’s own usage data from the response: the usage object of an OpenAI-format response, the message_start and message_delta events of an Anthropic stream, and the final response.completed (or response.incomplete, response.failed) event of a Responses stream. For streamed chat completions it asks OpenAI-compatible providers to include usage in the last chunk (stream_options.include_usage), except providers known to reject that option.

Cost is the provider’s token counts times the prices in OpenPike’s price table, in US dollars:

  • Input tokens that were not read from or written to a prompt cache, at the input price.
  • Cached input (cache reads), at the cached input price.
  • Cache writes, at the cache write price. Anthropic’s 1-hour cache writes use the 1-hour price when the response reports them separately.
  • Output tokens, including reasoning tokens where the provider counts them as output, at the output price.

Some providers bill more or less depending on a service tier chosen per request: OpenAI’s priority (costs more) and flex (costs less), xAI’s priority (2x standard rates) and Fireworks’ priority. OpenPike reads the tier from the response (service_tier, including the last chunk of a stream), because a provider can downgrade a request: a request for priority that came back as default is costed at the standard rate. It falls back to the request’s service_tier only when the response does not report one. Logs shows the tier beside the cost. If a response reports a tier the price table does not have (for example scale), the request is costed at the standard rate and marked Estimated, and the tier is listed in the daily digest of unpriced models. A model with no priority or flex price (a model OpenAI does not offer them for, say) is treated the same way.

Some models have long-context prices: when the whole prompt is above a threshold, all its tokens use the higher rates. Some prices have dated changes announced by the provider: each request is priced at the rates in force when it started, so a change on the 1st of the month applies to requests from 00:00 UTC that day.

Prices come only from each provider’s own pricing page or published price data, with the source and the date it was read. For OpenRouter, the seller is OpenRouter itself, so its prices come from OpenRouter’s public models list. Each provider page shows its table.

When a model has no price of its own, OpenPike estimates its cost, so budgets and loop limits still count it:

  1. the price of the model the provider’s response names, which covers aliases such as mistral/mistral-large-latest (the response names the dated model it served);
  2. otherwise OpenRouter’s listed price for a model with the same name, as a guide.

Logs marks those requests Estimated. When the model gets a price, new requests use it. Activity and Budgets show a warning when requests in the period have an estimated or unknown cost, with a link to those requests in Logs (filter Cost).

A request shows no cost (- in Logs) when:

  • the model has no price in the table and no estimate could be made. Every enabled chat provider has prices for its main models, but a provider’s newest, preview or special-purpose models may not, and neither do Perplexity’s sonar-pro, sonar-reasoning-pro and sonar-deep-research (Perplexity publishes no per-token price for them). The Providers page shows how many models each provider has priced;
  • the provider returned no token counts, for example on an error or a stream that broke off. A successful response without token counts is marked Usage missing in Logs (error code usage_missing): the provider answered and probably billed you, but OpenPike could not read how much, so its cost is unknown rather than zero. Filter Logs by Usage missing to find them.

Those requests still count toward the plan’s monthly requests, but they add nothing to budgets. If you rely on a budget for an unpriced provider, use a request-per-minute loop limit as well.

On /v1/responses, OpenAI’s hosted tools (web search, file search, code interpreter and the like) are passed through and work as usual, but the provider bills them per call on top of tokens. OpenPike’s cost covers tokens only: tool call fees are not in Logs, Activity or budgets. Check them in your provider’s own billing.

The same goes for search fees charged per request: Perplexity’s search fees and OpenRouter’s web search fees are not in OpenPike’s cost, only the tokens.

The cost is OpenPike’s calculation from the provider’s public prices, not the provider’s invoice. Discounts, credits, batch pricing, priority tiers and regional pricing on your provider account are not applied. Temporary promotional discounts (for example on DeepInfra) are not applied either, so those requests show the list price. Fireworks Fast, Flex and US-only models are priced under their own model IDs; Fireworks Priority (service_tier: "priority") is priced at the Standard rate. DeepSeek’s off-peak discount is not applied either: DeepSeek requests are priced at its peak rates, so they show an upper bound.