Skip to main content
Docs

One endpoint,
every model.

Tare is an OpenAI-compatible gateway in front of every model you use — ours and the ones you bring yourself. One base URL, one key, and every token accounted for.

Upstream channelsCost prices

Cost prices

What this solves: Enter the prices you pay your upstream vendors into Tare so cost attribution can be computed.

A cost price is the price you pay your upstream vendor. It plays no part in what you are charged: for your own channels you already pay the vendor directly for the tokens; what it decides is whether cost attribution can be computed.

Cost prices are used only for cost attribution and have nothing to do with whether a call is allowed. Not entering cost prices usually doesn't affect calls, but it leaves the cost column empty.

When you need to enter cost prices

The priority order for accounting:

  1. The real cost reported in the upstream response (the true value of each call).
  2. Only when the upstream doesn't report cost does it fall back to the cost price you enter here.

In other words:

  • The upstream reports real cost in every response: the cost price table is not used at all, and you get accurate attribution numbers without entering a single row.
  • The upstream reports only token counts, not cost: you need to enter cost prices.
  • Self-hosted inference services, some proxies, and local models: usually need cost prices entered.
Enter a cost price only when upstream omits cost Use the upstream's reported cost when the response includes it. Enter a cost price only when the upstream returns tokens and no fee. Leave a row out when the price is unknown. A blank is stored as 0. Enter a cost price only when upstream omits cost Where does this call's cost come from? Order: the cost in the upstream response, then the price you entered Upstream reports real cost every time The cost-price table is not used Attribution is right with no rows entered Tokens come back, a fee does not Self-hosted, some relays, local models Enter Input / Output by upstream name A blank is stored as 0, not as unknown Use 0 only when it is free. If the price is unknown, skip the row. A false 0 hides cost. Use the upstream model name, not the name you call on Tare. A mismatch rarely errors. Cost just stays empty. All four prices are per million tokens. There is no effective date. Backfill uses today's price.
When you need to enter cost prices: it only comes into play when the upstream doesn't report cost

What happens if you don't enter cost prices

Calls and billing are unaffected; what is affected is the cost column in cost analysis.

In Analytics, Cost attribution, or a generation query, you will see some calls with a token count but an empty cost. The system can only tell you:

Code / Terminal
Known cost this month: ¥1,234
Cost coverage: 62%

Coverage is given together with the amount. "Cost this month ¥1,234 (62% covered)" means 38% of calls still have no cost data. These calls do have a cost; the platform just has no way to know it. Calculating margin from numbers that aren't fully covered will be optimistic.

No cost price: coverage marks the other 38% When the upstream omits cost and no price matches, the call still works and the cost column is empty. The report shows the known amount and coverage together. The uncovered share had a cost the platform cannot see. No cost price: coverage marks the other 38% Known cost this month ¥1,234 · coverage 62% Coverage is shown with the amount. ¥1,234 is the known part, not the whole month. Covered 62% The platform can price these calls They enter Analytics, attribution, margin Uncovered 38% These calls had a cost the platform cannot see Margin on a partial figure comes out high The cost column is empty only when cost is omitted and no price matches. Calls, billing, and token counts remain. The channel page lists models missing a price. That list is GET /v1/providers/{id}/missing-costs.
What happens if you don't enter cost prices: coverage points out that 38%

The channel page lists models missing a cost price, and the same list is also available at GET /v1/providers/{id}/missing-costs.

Where to enter them

Console path:

Code / Terminal
Console → Tare → Channels → expand a channel → Cost prices

The Cost prices table is inside the channel's expanded area, not a separate page. That's because a cost price always belongs to a specific upstream channel.

How to fill in the fields

FieldMeaningNote
Upstream modelThe model name the upstream recognizesNot the model name used when calling Tare
InputPrice per million input tokensprompt/input price
OutputPrice per million output tokenscompletion/output price
Cache readPrice per million for cache readsDon't fill in randomly if unsure
Cache writePrice per million for cache writesDon't fill in randomly if unsure

All four values are per million tokens, and the cache read/write prices are optional.

For example, if the vendor writes:

Code / Terminal
Input: $0.20 / 1M tokens
Output: $0.80 / 1M tokens

You enter:

Code / Terminal
Input = 0.2
Output = 0.8

The easiest thing to get wrong: the model name

Upstream model must be the model name on the upstream side, not the name used when calling Tare.

Example:

Code / Terminal
Caller requests model = GLM 5.1
Routing points to openrouter-prod / z-ai/glm-5.1
Cost prices must also record z-ai/glm-5.1

Don't enter GLM 5.1 into this channel's cost price table, unless that is really the name the upstream recognizes.

A wrong model name usually doesn't raise an error. It simply never matches, and that model's cost is permanently empty.

Prefer Browse upstream models on the Channels page (GET /v1/providers/{id}/upstream-models) to avoid manual entry. The model list you fetch is a suggested list, not an allowlist; when private models, canary models, or aliases can't be fetched, you can still enter them manually.

Where the upstream publishes prices, the browse list shows them per 1M tokens, in the currency the upstream quotes (OpenRouter quotes USD). Nothing is converted. If you negotiated other rates or are billed in another currency, edit the rows after adding them.

This endpoint fails gracefully (upstream doesn't support listing a catalog, address can't be derived, key only has chat permission) and always returns 200 with an explanatory sentence, not an error code.

Tiers, per-request prices and multipliers

Open Edit on a cost price for the parts that a flat per-million price cannot express:

SettingMeaning
Conditional rulesAnother set of prices for calls that match. A rule can look at the input length (above a threshold, at most an upper bound), the time of day (days of the week and a [from, to) range in a timezone; the end is exclusive and must be later than the start, 00:00 means end of day, and a cross-midnight window is split into two) and a validity period. When several rules match, the highest priority wins. A matching rule prices the whole call, not only the part above the threshold.
Image / audio pricesPer-million prices for image and audio tokens in the input or output. Leave them empty and those tokens are priced as ordinary input or output.
Per requestBill each call at a fixed USD amount instead of by tokens. Image generation multiplies it by the number of images. A rule can switch to per request too, for example short prompts at a flat price.
MultipliersMultiply the cost of a call when a request header or body parameter matches, for example anthropic-beta contains fast-mode ×6, or service_tier equals priority ×2. A multiplier can also apply to a time window or a validity period. Several matching multipliers multiply together. Tool fees are not multiplied.

The usage record shows which rule and multipliers priced a call, for example long_context*fast-mode.

The difference between empty and 0

In the form, leaving a field empty is saved as 0, not recorded as "unknown".

There's a trap here:

  • The vendor explicitly says something is free: entering 0 is correct.
  • You don't know the price: don't record the whole row.

A missing cost price is something the system can remind you about through "coverage"; a wrong 0 is hard to spot and will make the cost too low.

Saving, editing, deleting

Adding

Enter the model name and the four prices at the bottom of the Cost prices table, then click Save.

Editing

Click Edit on a row, make the changes, and save.

Saving an existing model name overwrites it. That is, if you only want to change the Input price, keep the other three at their original values rather than clearing them.

Deleting

Click Remove to delete a model's cost price. After deletion, later calls that don't match this model's price have an unknown cost again.

Bulk importing a vendor price list

The Channels page supports importing cost prices by reading a price list: a screenshot of a per-brand discount table from a reseller, or price table text you paste, so you don't have to enter models one by one manually.

Good for these cases:

  • The reseller gave you a per-brand discount table.
  • You have a screenshot of prices.
  • You have a chunk of price table text.
  • There are many models and you don't want to fill them in row by row manually.

How it works:

  1. Choose the vendor group to import into, or all channels.
  2. Choose a multimodal model on one of your own channels to parse the image or text.
  3. Upload the screenshot or paste the price table.
  4. Tare sends the image/text to the model you chose and has it extract structured prices.
  5. Tare compares them against existing cost prices and reference prices, and shows the differences.
  6. Nothing is written until you confirm.

This step reuses the Chat diagnostic endpoint from the channel page: it consumes real upstream tokens on the channel you chose to parse with, but this parse call itself is not billed by Tare and does not appear in Call Traces, the same rule as manually testing a channel.

Bulk import is not "trust everything automatically". You must look at the difference preview before importing, especially the currency, unit, discount multiplier, and cache prices.

Cost prices have no effective period

The platform keeps only the current price and the time it was entered; it does not keep historical price ranges.

After a price change, recomputing historical calls uses the new price, not the price at the time. This is a clear source of deviation in monthly reconciliation.

This means:

  • After you change a price today, recomputing historical calls uses the new price.
  • Historical calls that previously had no price will also use the current price when they are backfilled.
  • If the vendor changes prices mid-way, monthly reconciliation may deviate.

Before effective periods are supported, it's best to do this:

  1. Record the time of the price change on the day it happens.
  2. When reconciling, split before and after the change date and check the two segments separately.
  3. For upstreams where you can use the real cost reported in the upstream response, prefer the real cost, because that path is unaffected and every call records the true value for that call.

There is no confirmed date for effective period support.

What recorded_at is

The cost price read endpoint returns recorded_at (ISO 8601, e.g. 2026-08-21T17:30:00), which is refreshed on every price change.

It means "when the current price was entered", not the creation time of the record, not when the price takes effect, and certainly not when the model first appeared.

Its use is reconciliation. Cost prices have no effective period, so backfilling historical cost always uses the current price; with this field, you can at least tell which version of the price was used when reconciling a given month. A price entered after the change date is used to backfill calls before the change date, and that segment of numbers is off; without this field, that is completely invisible on a report.

For historical data this field is null (this column was added later). null means the entry time is unknown, so don't default it to today's date on your side, which would make an unverified deviation look verified.

What automatic backfill can do

The platform has two kinds of automatic behavior:

  • Backfill calls that already happened after you enter a cost price. Calls that previously had no price get a cost added, so you don't lose this history just because you entered the cost price late.
  • Read the upstream price list once an hour. Backfill models you have used but not priced.

Backfilling historical calls uses the current price, not the price at the time the call happened (see "Cost prices have no effective period" above).

What it reads automatically is the vendor's published list price:

  • In the currency the vendor publishes, with no exchange rate conversion.
  • It may not include your contract discount.
  • It never overwrites prices you entered manually.

So if you have a contract price, a discounted price, or a special channel price, manual entry should take precedence.

How the endpoints relate to the console

These endpoints all use a console login session, not an inference API key:

ActionEndpoint
Read cost pricesGET /v1/providers/{id}/costs
Save cost pricesPUT /v1/providers/{id}/costs
Delete a cost pricePOST /v1/providers/{id}/costs/delete
Check models missing a cost priceGET /v1/providers/{id}/missing-costs
Fetch the upstream model listGET /v1/providers/{id}/upstream-models

SOP: filling in cost prices for one channel

  1. Open Channels.
  2. Expand the channel to configure.
  3. Click Browse upstream models.
  4. Choose the models to use from the list; if you can't fetch it, enter the upstream model name manually.
  5. Fill in Input, Output, Cache read, and Cache write against the vendor's price list.
  6. Don't enter models you are unsure about.
  7. After saving, check whether the missing cost warning is gone.
  8. Send one real request.
  9. In Analytics or a generation query, confirm the cost is no longer empty.

Minimal acceptance checklist

  • You have confirmed which upstreams report real cost in their response and which need cost prices entered manually.
  • Every BYOK channel that will carry traffic has its corresponding upstream model names entered.
  • Model names use the upstream names, not the external Tare model names.
  • All four prices are per million tokens.
  • Unknown prices were not entered as 0.
  • When changing a price you recorded the change date, knowing that historical backfill uses the current price.
  • In the cost attribution page or a generation query, the cost of the target calls is not empty.

Next steps

These three articles are one chain; read them in order: connect a channel → enter cost prices → configure routing. You have just finished the second step.

  • Previous: if you don't have a channel yet, read channels first.
  • Next: point the external model name at this channel, read Routing.
  • To find out where the cost goes: read Cost attribution.
  • For a word you don't recognize: look it up in the glossary.
Docs last updated Nov 27, 2026, 12:56 (UTC+8)