narev

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Narev Skills Router

Narev技能路由

Check
package.json
(and the lockfile if versions disagree) for
@ai-billing/core
and any
@ai-billing/*
packages. Use the typedoc pages under
/sdk/ai-billing/reference/
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的权威来源。

Packages

Core

核心包

PackageWhat it covers
@ai-billing/core
Billing middleware, usage payloads, price resolvers, destinations, errors
涵盖内容
@ai-billing/core
计费中间件、使用量载荷、价格解析器、目标服务、错误处理

Provider middleware

提供商中间件

Billing destinations

计费目标服务

UI & SDKs

UI与SDK

PackageDescriptionDocs
@ai-billing/nextjs
Next.js UI components for displaying billing usage and managing top-upsNext.js integration
@ai-billing/ui
Internal headless UI components shared across
@ai-billing/*
packages
@ai-billing/narev
TypeScript SDK for the Narev billing APISDK index

描述文档
@ai-billing/nextjs
用于展示计费使用量和管理充值的Next.js UI组件Next.js集成文档
@ai-billing/ui
@ai-billing/*
包之间共享的内部无头UI组件
@ai-billing/narev
Narev计费API的TypeScript SDKSDK索引

By task

按任务分类

Model pricing (API reference) → Use
narev-lookup-llm-pricing
  • Live API only: public
    GET
    catalog (filters, pagination) and
    POST
    calculate for one call's USD total — no committed files.
  • Semantics: USD per token, required
    usage
    integers, when
    subprovider
    is required for the same
    model_id
    on different hosts.
  • Contracts and troubleshooting: request/response shapes,
    402
    /
    404
    /
    400
    , and the canonical spec at list-model-pricing and calculate-cost-for-a-model-call.
Model pricing (snapshots and automation) → Use
narev-update-llm-pricing
  • Pin rates in-repo: paginated
    GET
    only, map each row into your schema, write a tracked file or generated module for offline or deterministic billing.
  • 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
    narev-lookup-llm-pricing
    for
    POST
    calculate and fine-grained HTTP/error details.
Narev SDK (runtime in your app)sdk/ai-billing/index
  • @ai-billing/core
    and
    @ai-billing/<provider>
    middleware
  • 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
    ,
    streamText
    , or other Vercel AI SDK provider methods.
  • Server-only billing middleware setup with
    wrapLanguageModel
    , destinations, and
    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 conceptsplatform/concepts/usage-based-billing
  • Meters, products, how Narev Cloud fits the model
Billing integrations and revenueplatform/billing/overview
Other Narev Cloud HTTP APIsplatform/api-reference/introduction
  • Applications, custom metrics, pricing endpoints
Narev Self-Hosted (ThinOps)oss/thinops/index
Guidesguides/index
Blogblog/index

模型定价(API参考) → 使用
narev-lookup-llm-pricing
技能
  • 仅实时API: 公开的
    GET
    目录(含筛选、分页)和
    POST
    计算单次调用的美元总价——无已提交文件。
  • 语义说明: 每token美元计价,必填
    usage
    整数,当同一
    model_id
    在不同主机上时需指定**
    subprovider
    **。
  • 契约与故障排除: 请求/响应结构、
    402
    /
    404
    /
    400
    错误,以及list-model-pricingcalculate-cost-for-a-model-call处的规范说明。
模型定价(快照与自动化) → 使用
narev-update-llm-pricing
技能
  • 在仓库中固定费率: 仅支持分页
    GET
    请求,将每行数据映射至您的架构,写入跟踪文件或生成模块以实现离线或确定性计费。
  • 实现选择: 合并与替换、提供商/模型范围、单位转换(API按token计价 vs 本地按百万token计价)、多提供商模型的密钥。
  • 运维: 幂等脚本、可读差异、可选CI或定时刷新;如需
    POST
    计算和细粒度HTTP/错误详情,请使用**
    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
    streamText
    或其他Vercel AI SDK提供商方法的App Router路由处理器。
  • 使用
    wrapLanguageModel
    、目标服务和
    providerOptions['ai-billing-tags']
    设置仅服务器端的计费中间件。
  • 共享模型工厂、测试绕过、客户归因和Polar目标服务的生产模式。
  • 文档:Next.js计费集成
基于使用量的计费概念platform/concepts/usage-based-billing
  • 计量器、产品、Narev Cloud如何适配该模型
计费集成与营收platform/billing/overview
其他Narev Cloud HTTP APIplatform/api-reference/introduction
  • 应用、自定义指标、定价端点
Narev自托管版(ThinOps)oss/thinops/index
指南guides/index
博客blog/index

Quick navigation

快速导航

If you know your task, you can directly access:
  • narev-lookup-llm-pricing
    skill — Pricing API reference (list + calculate)
  • narev-update-llm-pricing
    skill — Applied workflows using that API (snapshots, registries)
  • narev-nextjs-patterns
    skill — Next.js App Router + Vercel AI SDK billing patterns
Or describe what you need and I'll recommend the right one.
如果您明确任务,可直接访问:
  • narev-lookup-llm-pricing
    技能 —— Pricing API 参考(列表+计算)
  • narev-update-llm-pricing
    技能 —— 基于该API的应用工作流(快照、注册表)
  • narev-nextjs-patterns
    技能 —— Next.js App Router + Vercel AI SDK计费模式
或者描述您的需求,我会推荐合适的路径。