narev-lookup-llm-pricing
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseLook up LLM pricing
查询LLM定价
This skill is the in-repo API reference for the Narev Cloud Pricing endpoints (same behavior as , tightened for agents). Use it for contracts and workflows; for patterns that write the catalog into the repo, see .
/platform/api-reference/endpoint/pricing/...update-llm-pricingTwo endpoints, both under .
https://www.narev.ai| Endpoint | Method | Purpose |
|---|---|---|
| | List the catalog. Filter by |
| | Compute the USD cost of one call given |
Token rates are USD per token (not per 1K, not per 1M).
本技能是Narev云定价端点的仓库内API参考文档(与的行为一致,专为Agent优化)。适用于合同与工作流场景;若需将定价目录写入仓库的模式,请查看。
/platform/api-reference/endpoint/pricing/...update-llm-pricing两个端点均位于域名下。
https://www.narev.ai| 端点地址 | 请求方法 | 用途 |
|---|---|---|
| | 列出定价目录。可通过 |
| | 根据 |
Token费率为每token对应的美元价格(非每千token或每百万token)。
When to use this skill
何时使用本技能
- "What does cost on OpenAI right now?"
gpt-4o - "Calculate how much this prompt cost me."
- "How much do cached input tokens cost on Anthropic for ?"
claude-sonnet-4 - "List the providers that serve and their rates."
llama-3.1-70b - Any flow that needs token-to-dollar conversion against a current catalog.
If the user wants to automate fetching the catalog and commit mapped prices (offline or deterministic billing), switch to — it builds on the behavior this page defines. If they want prices to resolve at runtime inside their app via the SDK, point them at .
update-llm-pricingGETadd-usage-based-billing- "当前OpenAI上的定价是多少?"
gpt-4o - "计算这个提示词调用花费了多少钱。"
- "Anthropic的中缓存输入token的成本是多少?"
claude-sonnet-4 - "列出提供的服务商及其费率。"
llama-3.1-70b - 任何需要基于当前目录进行token转美元换算的流程。
如果用户想要自动化获取定价目录并提交映射后的价格(用于离线或确定性计费),请切换至——它基于本页定义的行为构建。如果用户希望在应用运行时通过SDK解析价格,请引导他们使用。
update-llm-pricingGETadd-usage-based-billingInputs you need
所需输入
The pricing endpoints are public. No API key, bearer token, or authentication header is required — call them directly.
- For listing: optional ,
model_id,search,provider,subprovider(sort_by|model_id|provider),subprovider(order|asc),desc,page(maxlimit, default1000).100 - For calculation: ,
modelId, andproviderwithusage,promptTokens,completionTokens,cacheReadTokens,cacheWriteTokens(all required integers — passreasoningTokensif unused).0is required when one model is served by multiple providers (subprovider,bedrock,openrouter, etc.).togetherandwebSearchCountare optional.isByok
定价端点为公开接口,无需API密钥、Bearer令牌或认证头——可直接调用。
- 列表查询:可选参数包括、
model_id、search、provider、subprovider(可选值:sort_by|model_id|provider)、subprovider(可选值:order|asc)、desc、page(最大值limit,默认值1000)。100 - 成本计算:必填参数为、
modelId,以及包含provider、promptTokens、completionTokens、cacheReadTokens、cacheWriteTokens的reasoningTokens对象(所有参数均为必填整数——若未使用则传入usage)。当同一模型由多个服务商(如0、bedrock、openrouter等)提供时,together为必填参数。subprovider和webSearchCount为可选参数。isByok
Workflow: list pricing
工作流:查询定价列表
-
Confirm the model and (if needed) the provider. For "OpenAI's GPT-4o", filter byand
model_id=gpt-4o.provider=openai -
Call the listing endpoint:bash
curl -G 'https://www.narev.ai/api/models/pricing' \ --data-urlencode 'model_id=gpt-4o' \ --data-urlencode 'provider=openai' -
The response is. Each entry has
{ data: ModelPricingEntry[], meta: { page, limit, total, total_pages } },model_id,provider, and asubproviderobject. The fields you most likely care about:pricing- — USD per input token.
price_prompt - — USD per output token.
price_completion - ,
price_input_cache_read— USD per cached input token.price_input_cache_write - — USD per reasoning output token.
price_internal_reasoning - — flat USD per request.
pricing_request - — USD per web-search invocation.
price_web_search - — fractional discount (
pricing_discount–0) applied across all rates.1 - ,
price_image,price_image_output,price_audio,price_audio_output— USD per unit, when applicable.price_input_audio_cache
-
Surface the requested fields. Multiply byif the user expects "USD per million tokens".
1_000_000 -
If, page through with
meta.total_pages > 1,page=2, …. Filter rather than paginating the whole catalog whenever possible.page=3
-
确认模型及(如需)服务商。例如查询“OpenAI的GPT-4o”,需通过和
model_id=gpt-4o进行筛选。provider=openai -
调用列表查询端点:bash
curl -G 'https://www.narev.ai/api/models/pricing' \ --data-urlencode 'model_id=gpt-4o' \ --data-urlencode 'provider=openai' -
响应格式为。每个条目包含
{ data: ModelPricingEntry[], meta: { page, limit, total, total_pages } }、model_id、provider及subprovider对象。最常用的字段包括:pricing- —— 输入token对应的美元价格。
price_prompt - —— 输出token对应的美元价格。
price_completion - 、
price_input_cache_read—— 缓存输入token对应的美元价格。price_input_cache_write - —— 推理输出token对应的美元价格。
price_internal_reasoning - —— 每次请求的固定美元费用。
pricing_request - —— 每次网页搜索调用的美元费用。
price_web_search - —— 适用于所有费率的折扣比例(取值范围
pricing_discount–0)。1 - 、
price_image、price_image_output、price_audio、price_audio_output—— 对应单位的美元价格(适用时显示)。price_input_audio_cache
-
展示用户所需的字段。如果用户期望“每百万token的美元价格”,需将数值乘以。
1_000_000 -
若,需通过
meta.total_pages > 1、page=2……进行分页查询。尽可能优先筛选而非遍历整个目录。page=3
Workflow: calculate the cost of a call
工作流:计算单次调用成本
-
Collect token usage. Required integers:,
promptTokens,completionTokens,cacheReadTokens,cacheWriteTokens. If a category does not apply, passreasoningTokens.0 -
POST the request:bash
curl -X POST 'https://www.narev.ai/api/models/pricing/calculate' \ -H 'Content-Type: application/json' \ -d '{ "modelId": "gpt-4o", "provider": "openai", "subprovider": "OpenAI", "usage": { "promptTokens": 1000, "completionTokens": 500, "cacheReadTokens": 0, "cacheWriteTokens": 0, "reasoningTokens": 0 } }' -
The 200 response contains:
- — the rates Narev applied (
pricing,input,output,request,inputCacheRead,inputCacheWrite,internalReasoning).webSearch - — the final USD total.
costBreakdown.total - — echoed back so the caller can verify what was billed.
usage
-
Reportto the user. If they ask "where does that number come from?", show
costBreakdown.totaland explain that each token category was multiplied by its rate and summed.pricing
-
收集token使用数据。必填整数参数:、
promptTokens、completionTokens、cacheReadTokens、cacheWriteTokens。若某类别不适用,传入reasoningTokens。0 -
发送POST请求:bash
curl -X POST 'https://www.narev.ai/api/models/pricing/calculate' \ -H 'Content-Type: application/json' \ -d '{ "modelId": "gpt-4o", "provider": "openai", "subprovider": "OpenAI", "usage": { "promptTokens": 1000, "completionTokens": 500, "cacheReadTokens": 0, "cacheWriteTokens": 0, "reasoningTokens": 0 } }' -
200响应包含以下内容:
- —— Narev应用的费率(包括
pricing、input、output、request、inputCacheRead、inputCacheWrite、internalReasoning)。webSearch - —— 最终的美元总成本。
costBreakdown.total - —— 回传的使用数据,便于调用方验证计费依据。
usage
-
向用户展示。如果用户询问“这个数值是如何计算的?”,请展示
costBreakdown.total并说明每个token类别均乘以对应费率后求和。pricing
Constraints and edge cases
约束条件与边缘情况
- 402 Payment Required — model is enterprise-only. The error response has set and
error. Tell the user the model is not in the public catalog and point them at Narev for enterprise access.pricing: null - 404 Not Found — no public pricing for that +
modelId(+provider). Re-check IDs against the listing endpoint or dropsubprovider.subprovider - 400 Bad Request — failed validation. Most common cause: a missing required integer field. Pass
usage, not0or absent.null - Rates are USD per token. Do not divide or multiply on the way in. Convert only when displaying.
- matters. Models like
subproviderare hosted by Bedrock, OpenRouter, Together, etc. at different prices. If the user does not know the subprovider, list first to see options, then calculate.llama-3.1-70b - Do not hardcode rates. Prices change. If the user wants stable values they can commit and review, switch to .
update-llm-pricing
- 402 Payment Required —— 模型为企业专属。错误响应中字段会被设置,
error为pricing。告知用户该模型不在公开目录中,并引导他们联系Narev获取企业权限。null - 404 Not Found —— 该+
modelId(+provider)组合无公开定价。请通过列表查询端点重新核对ID,或移除subprovider参数重试。subprovider - 400 Bad Request —— 参数验证失败。最常见原因是缺少必填整数字段。请传入
usage,而非0或留空。null - 费率为每token美元价格。调用时请勿进行除法或乘法运算,仅在展示时进行转换。
- 至关重要。像
subprovider这样的模型由Bedrock、OpenRouter、Together等不同服务商托管,定价各不相同。如果用户不知道subprovider,先查询列表查看可选选项,再进行成本计算。llama-3.1-70b - 请勿硬编码费率。价格会发生变动。如果用户需要可提交并审核的稳定数值,请切换至。
update-llm-pricing
Reference
参考链接
- API overview:
/platform/api-reference/introduction - List endpoint:
/platform/api-reference/endpoint/pricing/list-model-pricing - Calculate endpoint:
/platform/api-reference/endpoint/pricing/calculate-cost-for-a-model-call
- API概览:
/platform/api-reference/introduction - 列表查询端点:
/platform/api-reference/endpoint/pricing/list-model-pricing - 成本计算端点:
/platform/api-reference/endpoint/pricing/calculate-cost-for-a-model-call