narev
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseNarev Skills Router
Narev技能路由
Check (and the lockfile if versions disagree) for and any packages. Use the typedoc pages under that match the installed packages for code samples and option shapes. If there is no SDK in the project, treat the docs site as source of truth for the latest APIs.
package.json@ai-billing/core@ai-billing/*/sdk/ai-billing/reference/查看(如果版本不一致则查看锁文件)中的及所有包。使用与已安装包匹配的下的typedoc页面获取代码示例和选项结构。如果项目中没有SDK,则将文档站点视为最新API的权威来源。
package.json@ai-billing/core@ai-billing/*/sdk/ai-billing/reference/Packages
包
Core
核心包
| Package | What it covers |
|---|---|
| Billing middleware, usage payloads, price resolvers, destinations, errors |
| 包 | 涵盖内容 |
|---|---|
| 计费中间件、使用量载荷、价格解析器、目标服务、错误处理 |
Provider middleware
提供商中间件
| Provider | Package | Docs |
|---|---|---|
| OpenRouter | | Reference |
| OpenAI | | Reference |
| Vercel AI Gateway | | Reference |
| OpenAI Compatible | | Reference |
| Groq | | Reference |
| Google Generative AI | | Reference |
| Anthropic | | Reference |
| xAI Grok | | Reference |
| MiniMax | | Reference |
| DeepSeek | | Reference |
| Chutes | | Reference |
| 提供商 | 包 | 文档 |
|---|---|---|
| OpenRouter | | 参考文档 |
| OpenAI | | 参考文档 |
| Vercel AI Gateway | | 参考文档 |
| OpenAI 兼容 | | 参考文档 |
| Groq | | 参考文档 |
| Google 生成式AI | | 参考文档 |
| Anthropic | | 参考文档 |
| xAI Grok | | 参考文档 |
| MiniMax | | 参考文档 |
| DeepSeek | | 参考文档 |
| Chutes | | 参考文档 |
Billing destinations
计费目标服务
| Destination | Package | Docs |
|---|---|---|
| Polar.sh | | Reference |
| Stripe | | Reference |
| OpenMeter (Kong) | | Reference |
| Lago | | Reference |
| 目标服务 | 包 | 文档 |
|---|---|---|
| Polar.sh | | 参考文档 |
| Stripe | | 参考文档 |
| OpenMeter (Kong) | | 参考文档 |
| Lago | | 参考文档 |
UI & SDKs
UI与SDK
| Package | Description | Docs |
|---|---|---|
| Next.js UI components for displaying billing usage and managing top-ups | Next.js integration |
| Internal headless UI components shared across | — |
| TypeScript SDK for the Narev billing API | SDK index |
| 包 | 描述 | 文档 |
|---|---|---|
| 用于展示计费使用量和管理充值的Next.js UI组件 | Next.js集成文档 |
| | — |
| Narev计费API的TypeScript SDK | SDK索引 |
By task
按任务分类
Model pricing (API reference) → Use
narev-lookup-llm-pricing- Live API only: public catalog (filters, pagination) and
GETcalculate for one call's USD total — no committed files.POST - Semantics: USD per token, required integers, when
usageis required for the samesubprovideron different hosts.model_id - Contracts and troubleshooting: request/response shapes, /
402/404, and the canonical spec at list-model-pricing and calculate-cost-for-a-model-call.400
Model pricing (snapshots and automation) → Use
narev-update-llm-pricing- Pin rates in-repo: paginated only, map each row into your schema, write a tracked file or generated module for offline or deterministic billing.
GET - Implementation choices: merge vs replace, provider/model scope, unit conversion (API per token vs local per-1M), keys for multi-provider models.
- Ops: idempotent scripts, readable diffs, optional CI or scheduled refresh; use for
narev-lookup-llm-pricingcalculate and fine-grained HTTP/error details.POST
Narev SDK (runtime in your app) → sdk/ai-billing/index
- and
@ai-billing/coremiddleware@ai-billing/<provider> - Destinations, price resolvers, usage payloads, errors
- Prefer this over raw Pricing HTTP when billing runs inside the app
Next.js apps → Use
narev-nextjs-patterns- App Router route handlers that call ,
generateText, or other Vercel AI SDK provider methods.streamText - Server-only billing middleware setup with , destinations, and
wrapLanguageModel.providerOptions['ai-billing-tags'] - Production patterns for shared model factories, test bypasses, customer attribution, and Polar destinations.
- Docs: Next.js billing integration
Usage-based billing concepts → platform/concepts/usage-based-billing
- Meters, products, how Narev Cloud fits the model
Billing integrations and revenue → platform/billing/overview
- Polar, Stripe, Lago, OpenMeter, frameworks (Next.js, Express, Fastify, NestJS, Hono, Nuxt)
- Polar-specific setup: platform/billing/integrations/billing-platforms/polar
Other Narev Cloud HTTP APIs → platform/api-reference/introduction
- Applications, custom metrics, pricing endpoints
Narev Self-Hosted (ThinOps) → oss/thinops/index
- Deployment: oss/thinops/getting-started/deployment
- FOCUS format: oss/thinops/focus-specification
- Connect providers (AWS, Azure, GCP, OpenAI): oss/thinops/connect-providers/index
Guides → guides/index
- FinOps for AI: guides/finops-for-ai/index
- Model choice, prompt cost deep dives, DeepSeek billing
Blog → blog/index
模型定价(API参考) → 使用技能
narev-lookup-llm-pricing- 仅实时API: 公开的目录(含筛选、分页)和
GET计算单次调用的美元总价——无已提交文件。POST - 语义说明: 每token美元计价,必填整数,当同一
usage在不同主机上时需指定**model_id**。subprovider - 契约与故障排除: 请求/响应结构、/
402/404错误,以及list-model-pricing和calculate-cost-for-a-model-call处的规范说明。400
模型定价(快照与自动化) → 使用技能
narev-update-llm-pricing- 在仓库中固定费率: 仅支持分页请求,将每行数据映射至您的架构,写入跟踪文件或生成模块以实现离线或确定性计费。
GET - 实现选择: 合并与替换、提供商/模型范围、单位转换(API按token计价 vs 本地按百万token计价)、多提供商模型的密钥。
- 运维: 幂等脚本、可读差异、可选CI或定时刷新;如需计算和细粒度HTTP/错误详情,请使用**
POST**。narev-lookup-llm-pricing
Narev SDK(应用运行时) → sdk/ai-billing/index
- 和
@ai-billing/core中间件@ai-billing/<provider> - 目标服务、价格解析器、使用量载荷、错误处理
- 当计费在应用内部运行时,优先使用此SDK而非原生Pricing HTTP接口
Next.js应用 → 使用技能
narev-nextjs-patterns- 调用、
generateText或其他Vercel AI SDK提供商方法的App Router路由处理器。streamText - 使用、目标服务和
wrapLanguageModel设置仅服务器端的计费中间件。providerOptions['ai-billing-tags'] - 共享模型工厂、测试绕过、客户归因和Polar目标服务的生产模式。
- 文档:Next.js计费集成
基于使用量的计费概念 → platform/concepts/usage-based-billing
- 计量器、产品、Narev Cloud如何适配该模型
计费集成与营收 → platform/billing/overview
- Polar、Stripe、Lago、OpenMeter、框架(Next.js、Express、Fastify、NestJS、Hono、Nuxt)
- Polar特定设置:platform/billing/integrations/billing-platforms/polar
其他Narev Cloud HTTP API → platform/api-reference/introduction
- 应用、自定义指标、定价端点
Narev自托管版(ThinOps) → oss/thinops/index
- 部署:oss/thinops/getting-started/deployment
- FOCUS格式:oss/thinops/focus-specification
- 连接提供商(AWS、Azure、GCP、OpenAI):oss/thinops/connect-providers/index
指南 → guides/index
- AI FinOps:guides/finops-for-ai/index
- 模型选择、提示成本深度解析、DeepSeek计费
博客 → blog/index
Quick navigation
快速导航
If you know your task, you can directly access:
- skill — Pricing API reference (list + calculate)
narev-lookup-llm-pricing - skill — Applied workflows using that API (snapshots, registries)
narev-update-llm-pricing - skill — Next.js App Router + Vercel AI SDK billing patterns
narev-nextjs-patterns
Or describe what you need and I'll recommend the right one.
如果您明确任务,可直接访问:
- 技能 —— Pricing API 参考(列表+计算)
narev-lookup-llm-pricing - 技能 —— 基于该API的应用工作流(快照、注册表)
narev-update-llm-pricing - 技能 —— Next.js App Router + Vercel AI SDK计费模式
narev-nextjs-patterns
或者描述您的需求,我会推荐合适的路径。