Help / Track spend

Connect usage sources

A usage source brings AI usage into Allcora. Connect the tools your team uses, then add rules so the usage lands on the right engagement.

Usage sources are managed by an Org admin on the Usage sources page. Finance owners can view them. Allcora reads usage and cost only: token counts, cost, model, key, person and workspace. It never collects prompts or responses.

The sources you can connect

SourceWhat you needHow oftenFeed
AnthropicAn Anthropic Admin API key (starts sk-ant-admin01-)HourlyRecord
OpenAIAn OpenAI Admin API key (starts sk-admin-)HourlyRecord
Claude CodeThe Allcora CLI on each developer's machine; optionally an Anthropic Admin API key for daily reconciliationWithin a minuteEstimate
LiteLLM proxyYour proxy's public https URL and a master or admin key that can read spendEvery 5 minutesEstimate
OpenRouterAn OpenRouter management API keyEvery 15 minutesEstimate
Allcora APIAn Allcora ingestion key, created when you connectWithin a minuteEstimate
CSV uploadA usage export from a tool without an APIWhen you uploadEstimate

Estimates arrive quickly. Anthropic and OpenAI usage reports are the financial record, and Allcora reconciles against them every morning.

Connect a source

  1. Open Usage sources and find the source under Add a source.
  2. Select Connect and paste the key or URL it asks for.
  3. Select Test and connect. Allcora checks the connection before saving it.

Keys are stored encrypted in AWS Secrets Manager and are never shown again. Sources that Allcora pulls from have a Test action. Pause stops Allcora pulling from Anthropic, OpenAI, LiteLLM or OpenRouter; it doesn't stop data sent with an ingestion key, so revoke the key for that. Disconnect stops new data and keeps the usage already recorded. Disconnecting Claude Code or the Allcora API also revokes its ingestion keys, so the CLI stops working until developers log in with a new key.

Starter plan: two usage connectors. Claude Code, LiteLLM, OpenRouter, Anthropic and OpenAI each count as one. The Allcora API and CSV upload don't count. Growth and Enterprise have no limit.

Notes on specific sources

Anthropic and OpenAI. The first pull reaches back 48 hours. Usage for an hour appears once the vendor has closed that hour, so expect a delay of an hour or two.

OpenRouter. Allcora reads each key's spend and records the change since the last reading. The first reading sets the starting point, so spend from before you connected isn't imported. OpenRouter doesn't report the model or tokens per key, so the model shows as "mixed" and tokens as zero. Key rules for OpenRouter use the key's hash as OpenRouter shows it.

LiteLLM. Tag requests with allcora:CODE in request_tags or metadata.tags and they go straight to that engagement.

Claude Code. See Claude Code and the Allcora CLI.

Send usage to the right engagement

The most reliable method is to tag usage with the engagement's job code at the source. Where you can't, add an attribution rule under Usage sources → Attribution rules. Rules match on:

RuleUse it when
API key idA key or virtual key is used for one engagement only.
Person (email)A person works on one engagement at a time.
Workspace or projectYou keep a vendor workspace or project per client.
Tag valueRequests carry an engagement tag whose value isn't the job code, for example your own matter number.

Org admins and Finance owners manage rules under Usage sources → Attribution rules. Engagement owners can create a rule while assigning unattributed usage.

Using a gateway and a vendor account for the same traffic? If requests pass through LiteLLM, OpenRouter or the Allcora API and you also connect the Anthropic or OpenAI account behind them, that spend would be counted twice. Contact us before connecting both, and don't tick This key's traffic also goes through LiteLLM, OpenRouter or the API on a rule without talking to us first. The same applies if your developers run Claude Code with an API key from the Anthropic organisation you've connected.

When a source goes quiet

Allcora checks every source every 15 minutes. Org admins get an email titled "No data from source for N hours" when:

  • a pulled source (Anthropic, OpenAI, LiteLLM or OpenRouter) has had no successful pull for 2 hours, or
  • a pushed source (Claude Code or the Allcora API) has sent nothing for 24 hours, after it has sent data at least once.

You get at most one email every 12 hours per source. Paused sources and CSV uploads never alert. A source shows error after three failed pulls in a row. Open Usage sources from the menu and use Test to see why.

The Allcora API

Send usage from your own gateway, scripts or tools. Connect Allcora API to create an ingestion key. The key is shown once: copy it into a secrets manager, because anyone holding it can send usage for your firm. You can create more keys with New key and revoke any of them.

curl -X POST https://ingest.allcora.ai/v1/usage \
  -H "Authorization: Bearer alc_live_YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '[{"timestamp":"2026-10-29T09:30:00Z","vendor":"anthropic",
        "model":"claude-sonnet-5-5","input_tokens":12000,
        "output_tokens":2400,"engagement":"NW-101",
        "user_email":"ana@yourfirm.com","request_id":"req-0001"}]'

Use GET /v1/ping with the same header to check a key. Accepted records appear on their engagement within a minute.

FieldNotes
timestampRequired. ISO 8601. Between 1 January 2020 and two days from now.
vendorRequired, for example anthropic or openai.
modelSend it whenever you don't send cost_usd; a record with neither isn't recorded, and no error is returned. Used to price records sent without a cost.
cost_usdCost in US dollars. If you send it, it's used as the cost. Always send it for vendors other than Anthropic and OpenAI, and for any model not listed under Settings → Model prices.
input_tokens, output_tokens, cache_read_tokens, cache_write_tokensToken counts. Without a cost, Allcora prices them from the model price table. A record with tokens but no cost, for a model the table doesn't price, isn't recorded.
engagementThe engagement's job code. Also accepted as engagement_code.
user_email, key, workspaceOptional. Used by attribution rules when there's no engagement.
request_idRecommended. Makes re-sending safe: duplicates are ignored.
tool, tagsOptional. tags is an object of up to 20 values.

A request can carry up to 5,000 records, either as a JSON array or as {"records": [...]}. If any record fails validation, none are accepted and the first 50 errors come back. Accepted records are priced as they're processed, which is why cost_usd matters for models outside the price table. Fields that could hold content, such as prompt, messages or response, are refused. CSV with the same columns can be posted to /v1/usage/csv.

Upload a CSV

For tools with no API, an Org admin can use Upload CSV on the Usage sources page. Include the columns timestamp, vendor, model and either cost_usd or token counts, and add engagement, user_email or key to attribute rows. An upload takes up to 20,000 rows. If any row has a missing or invalid value, nothing is imported and the rows to fix are listed; rows dated before 2020 or more than two days ahead are skipped. Send cost_usd for anything outside the price table, and check the totals on the engagement once the rows appear. Uploading the same rows again is safe.

Last reviewed 29 October 2026, Allcora platform version 15.