if it's a cache HIT the cost will be 0. Even if you have passed a custom cost
if it's a cache HIT the cost will be 0. Even if you have passed a custom cost

p field in the stream response?
{model}:{keyword} syntax used by open router, the end of the model name is really critical to see when streaming or scanning the last


X
•3/16/25, 11:20 PM

Custom costs will appear in the logs with an underline, making it easy to identify when custom pricing has been applied.But that is no longer the case (I haven't used custom costs before so I don't know when it disappeared).


p "streamed_data": [
{
"response": "As",
"p": "abcde"
},
{
"response": " an",
"p": "ab"
},
{
"response": " artificial",
"p": "abcdefghijklmnopqrs"
},
{
"response": " intelligence",
"p": "abcdefghijklmnopqrstuvwxyz0123456789abcdefghi"
},
{
"response": " language",
"p": "abcdefghi"
},
{
"response": " model",
"p": "abcdefghijklmnopqr"
},
{
"response": ",",
"p": "abcdefghijklmn"
},
{
"response": " I",
"p": "abcd"
},
{
"response": " don",
"p": "abcdefghijklmnopqrstuvwxyz012"
},
{
"response": "'t",
"p": "abcdefghijklmn"
},
{
"response": " have",
"p": "abcdefgh"
},
{
"response": " a",
"p": "abcdefghijklmnopqrstuvwxyz0123456789abcde"
},
{
"response": " specific",
"p": "abcdefg"
},
{
"response": " name",
"p": "abcd"
},
{
"response": ".",
"p": "abcd"
},
{
"response": "",
"p": "abcdefghijklmnopqr"
},
{
"response": "",
"usage": {
"prompt_tokens": 24,
"completion_tokens": 17,
"total_tokens": 41
}
}
]
} [
{
"provider": "workers-ai",
"endpoint": "@cf/meta/llama-2-7b-chat-int8",
"headers": {
"Authorization": "Bearer CF_TOKEN-INVALID",
"Content-Type": "application/json"
},
"config":{
"skipCache": true
},
"query": {
"messages": [
{
"role": "system",
"content": "You are a friendly assistant"
},
{
"role": "user",
"content": "10+1=?"
}
]
}
},
{
"provider": "workers-ai",
"endpoint": "@cf/meta/llama-2-7b-chat-int8",
"headers": {
"Authorization": "Bearer CF_TOKEN",
"Content-Type": "application/json"
},
"config":{
"skipCache": true
},
"query": {
"messages": [
{
"role": "system",
"content": "You are a friendly assistant"
},
{
"role": "user",
"content": "10+10=?"
}
]
}
}
] {model}:{keyword}