Skip to content

Commit bf9a1cd

Browse files
trentfowlercohereTrent Fowler
andauthored
Explaining billed tokens and why they're different. (#399)
* Explaining billed tokens and why they're different. * Minor Michael-suggested edits. * Minor Michael-suggested edits. --------- Co-authored-by: Trent Fowler <trentfowler@Trent-Fowler.local>
1 parent bb86604 commit bf9a1cd

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

fern/pages/going-to-production/how-does-cohere-pricing-work.mdx

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,25 @@ Our Rerank models are priced based on the quantity of searches, and our Embeddin
1919

2020
You can find up-to-date prices on our [dedicated pricing page](https://cohere.com/pricing).
2121

22+
### What's the Difference Between "billed" Tokens and Generic Tokens?
23+
24+
When using the [Chat API endpoint](https://docs.cohere.com/reference/chat), the response will contain the total count of input and output tokens, as well as the count of _billed_ tokens. Here's an example:
25+
26+
```json JSON
27+
{
28+
"billed_units": {
29+
"input_tokens": 6772,
30+
"output_tokens": 248
31+
},
32+
"tokens": {
33+
"input_tokens": 7596,
34+
"output_tokens": 645
35+
}
36+
}
37+
```
38+
39+
The rerank and embed models have their own, slightly different versions, and it may not be obvious why there are separate input and output values under `billed_units`. To clarify, the _billed_ input and output tokens are the tokens that you're actually _billed_ for. The reason these values can be different from the overall `"tokens"` value is that there are situations in which Cohere adds tokens under the hood, and there are others in which a particular model has been trained to do so (i.e. when outputting special tokens). Since these are tokens *you don't have control over, you are not charged for them.*
40+
2241
## Trial Usage and Production Usage
2342

2443
Cohere makes a distinction between "trial" and "production" usage of an API key.

0 commit comments

Comments
 (0)