add-model-price

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Add Model Price

添加模型定价

Purpose

目的

Guide for adding new LLM model pricing entries to Langfuse's default model prices configuration. This enables accurate cost tracking across different model providers and deployment platforms.
本指南介绍如何向Langfuse的默认模型价格配置中添加新的LLM模型定价条目,以便在不同模型供应商和部署平台之间实现精准的成本追踪。

When to Use This Skill

何时使用本技能

Automatically activates when:
  • Adding a new model to the pricing database
  • Updating model pricing information
  • Working with
    default-model-prices.json
  • Creating model matchPattern regex
  • Configuring pricingTiers or tiered pricing
  • Adding prices for Claude, OpenAI, Anthropic, Google, Gemini, AWS Bedrock, Azure, or Vertex AI models

在以下场景下自动启用:
  • 向定价数据库添加新模型
  • 更新模型定价信息
  • 操作
    default-model-prices.json
    文件
  • 创建模型matchPattern正则表达式
  • 配置pricingTiers或分层定价
  • 添加Claude、OpenAI、Anthropic、Google、Gemini、AWS Bedrock、Azure或Vertex AI模型的定价

Quick Start Checklist

快速入门检查清单

  • Gather model info: Fetch official pricing from provider documentation URL
  • Generate UUID: Run
    uuidgen
    for the model entry ID (use lowercase)
  • Create matchPattern: Regex covering all provider formats
  • Define pricingTiers: At minimum, one default tier with standard prices
  • Add pricing entry: Insert into
    /worker/src/constants/default-model-prices.json
  • Add to LLM types: Add model to
    /packages/shared/src/server/llm/types.ts
    (for playground/LLM-as-judge)
  • Validate JSON: Run
    jq . default-model-prices.json
    to verify syntax

  • 收集模型信息:从供应商官方文档URL获取官方定价
  • 生成UUID:运行
    uuidgen
    命令生成模型条目ID(使用小写格式)
  • 创建matchPattern:编写覆盖所有供应商格式的正则表达式
  • 定义pricingTiers:至少包含一个带有标准价格的默认层级
  • 添加定价条目:将条目插入到
    /worker/src/constants/default-model-prices.json
    文件中
  • 添加到LLM类型定义:将模型添加到
    /packages/shared/src/server/llm/types.ts
    (供Playground和LLM-as-judge使用)
  • 验证JSON格式:运行
    jq . default-model-prices.json
    命令验证语法正确性

File Location

文件位置

Target File:
/worker/src/constants/default-model-prices.json
This JSON file contains an array of model pricing definitions used for cost calculation.

目标文件
/worker/src/constants/default-model-prices.json
该JSON文件包含一组用于成本计算的模型定价定义。

Data Structure

数据结构

Complete Model Entry Schema

完整模型条目 Schema

json
{
  "id": "uuid-generated-with-uuidgen",
  "modelName": "model-name-identifier",
  "matchPattern": "(?i)^regex-pattern$",
  "createdAt": "ISO-8601-timestamp",
  "updatedAt": "ISO-8601-timestamp",
  "tokenizerConfig": null,
  "tokenizerId": "claude|openai|null",
  "pricingTiers": [
    {
      "id": "model-uuid_tier_default",
      "name": "Standard",
      "isDefault": true,
      "priority": 0,
      "conditions": [],
      "prices": {
        "input": 0.000005,
        "output": 0.000025
      }
    }
  ]
}
json
{
  "id": "uuid-generated-with-uuidgen",
  "modelName": "model-name-identifier",
  "matchPattern": "(?i)^regex-pattern$",
  "createdAt": "ISO-8601-timestamp",
  "updatedAt": "ISO-8601-timestamp",
  "tokenizerConfig": null,
  "tokenizerId": "claude|openai|null",
  "pricingTiers": [
    {
      "id": "model-uuid_tier_default",
      "name": "Standard",
      "isDefault": true,
      "priority": 0,
      "conditions": [],
      "prices": {
        "input": 0.000005,
        "output": 0.000025
      }
    }
  ]
}

Required Fields

必填字段

FieldTypeDescription
id
stringUnique UUID (use
uuidgen
command, lowercase)
modelName
stringPrimary model identifier
matchPattern
stringRegex for matching model names
createdAt
stringISO-8601 timestamp
updatedAt
stringISO-8601 timestamp
pricingTiers
arrayAt least one pricing tier
字段类型描述
id
string唯一UUID(使用
uuidgen
命令生成,小写格式)
modelName
string主要模型标识符
matchPattern
string用于匹配模型名称的正则表达式
createdAt
stringISO-8601格式时间戳
updatedAt
stringISO-8601格式时间戳
pricingTiers
array至少包含一个定价层级

Optional Fields

可选字段

FieldTypeDefaultDescription
tokenizerId
stringnull"claude", "openai", or null
tokenizerConfig
objectnullCustom tokenizer settings

字段类型默认值描述
tokenizerId
stringnull可选值为"claude"、"openai"或null
tokenizerConfig
objectnull自定义分词器设置

Pricing Tier Structure

定价层级结构

Default Tier (Required)

默认层级(必填)

Every model must have exactly one default tier:
json
{
  "id": "{model-id}_tier_default",
  "name": "Standard",
  "isDefault": true,
  "priority": 0,
  "conditions": [],
  "prices": { }
}
Rules for Default Tier:
  • isDefault
    : Must be
    true
  • priority
    : Must be
    0
  • conditions
    : Must be empty array
    []
每个模型必须恰好有一个默认层级:
json
{
  "id": "{model-id}_tier_default",
  "name": "Standard",
  "isDefault": true,
  "priority": 0,
  "conditions": [],
  "prices": { }
}
默认层级规则
  • isDefault
    :必须设置为
    true
  • priority
    :必须设置为
    0
  • conditions
    :必须为空数组
    []

Additional Tiers (Optional)

附加层级(可选)

For usage-based pricing (e.g., large context pricing):
json
{
  "id": "uuid-for-tier",
  "name": "Large Context (>200K)",
  "isDefault": false,
  "priority": 1,
  "conditions": [
    {
      "usageDetailPattern": "(input|prompt|cached)",
      "operator": "gt",
      "value": 200000,
      "caseSensitive": false
    }
  ],
  "prices": { }
}
Condition Operators:
gt
,
gte
,
lt
,
lte
,
eq
,
neq

针对基于使用量的定价(例如大上下文定价):
json
{
  "id": "uuid-for-tier",
  "name": "Large Context (>200K)",
  "isDefault": false,
  "priority": 1,
  "conditions": [
    {
      "usageDetailPattern": "(input|prompt|cached)",
      "operator": "gt",
      "value": 200000,
      "caseSensitive": false
    }
  ],
  "prices": { }
}
条件运算符
gt
gte
lt
lte
eq
neq

Gathering Pricing Information

收集定价信息

IMPORTANT: Always fetch pricing from official provider documentation. Never use heuristics or assumptions.
重要提示:始终从供应商官方文档获取定价信息,切勿使用推测或假设的数据。

Official Pricing Sources

官方定价来源

Required Information to Gather

需要收集的信息

  1. Base input token price (per MTok)
  2. Output token price (per MTok)
  3. Cache write price (if caching supported)
  4. Cache read price (if caching supported)
  5. Long context pricing (if different tiers exist)
  6. Model ID formats for all platforms (API, Bedrock, Vertex)

  1. 基础输入令牌价格(每百万令牌)
  2. 输出令牌价格(每百万令牌)
  3. 缓存写入价格(如果支持缓存)
  4. 缓存读取价格(如果支持缓存)
  5. 长上下文定价(如果存在不同层级)
  6. 所有平台的模型ID格式(API、Bedrock、Vertex)

Price Conversion

价格转换

Prices in the JSON are per token, not per million tokens.
Provider PricingJSON ValueCalculation
$5 / MTok
5e-6
$5 / 1,000,000
$25 / MTok
25e-6
$25 / 1,000,000
$0.50 / MTok
0.5e-6
$0.50 / 1,000,000
$6.25 / MTok
6.25e-6
$6.25 / 1,000,000
Formula:
price_per_token = price_per_mtok / 1_000_000
or
price_per_mtok * 1e-6

JSON文件中的价格是每个令牌的价格,而非每百万令牌的价格。
供应商定价JSON值计算方式
$5 / 百万令牌
5e-6
$5 / 1,000,000
$25 / 百万令牌
25e-6
$25 / 1,000,000
$0.50 / 百万令牌
0.5e-6
$0.50 / 1,000,000
$6.25 / 百万令牌
6.25e-6
$6.25 / 1,000,000
计算公式
price_per_token = price_per_mtok / 1_000_000
price_per_mtok * 1e-6

Common Price Keys by Provider

各供应商常见价格键

Anthropic Claude Models

Anthropic Claude 模型

json
{
  "input": <base_input_price>,
  "input_tokens": <base_input_price>,
  "output": <output_price>,
  "output_tokens": <output_price>,
  "cache_creation_input_tokens": <cache_write_price>,
  "input_cache_creation": <cache_write_price>,
  "cache_read_input_tokens": <cache_read_price>,
  "input_cache_read": <cache_read_price>
}
json
{
  "input": <base_input_price>,
  "input_tokens": <base_input_price>,
  "output": <output_price>,
  "output_tokens": <output_price>,
  "cache_creation_input_tokens": <cache_write_price>,
  "input_cache_creation": <cache_write_price>,
  "cache_read_input_tokens": <cache_read_price>,
  "input_cache_read": <cache_read_price>
}

OpenAI Models

OpenAI 模型

json
{
  "input": <input_price>,
  "input_cached_tokens": <cached_input_price>,
  "input_cache_read": <cached_input_price>,
  "output": <output_price>
}
json
{
  "input": <input_price>,
  "input_cached_tokens": <cached_input_price>,
  "input_cache_read": <cached_input_price>,
  "output": <output_price>
}

Google Gemini Models

Google Gemini 模型

json
{
  "input": <input_price>,
  "input_modality_1": <input_price>,
  "prompt_token_count": <input_price>,
  "promptTokenCount": <input_price>,
  "input_cached_tokens": <cached_price>,
  "cached_content_token_count": <cached_price>,
  "output": <output_price>,
  "output_modality_1": <output_price>,
  "candidates_token_count": <output_price>,
  "candidatesTokenCount": <output_price>
}

json
{
  "input": <input_price>,
  "input_modality_1": <input_price>,
  "prompt_token_count": <input_price>,
  "promptTokenCount": <input_price>,
  "input_cached_tokens": <cached_price>,
  "cached_content_token_count": <cached_price>,
  "output": <output_price>,
  "output_modality_1": <output_price>,
  "candidates_token_count": <output_price>,
  "candidatesTokenCount": <output_price>
}

Match Pattern Examples

匹配模式示例

Anthropic Claude (API + Bedrock + Vertex)

Anthropic Claude(API + Bedrock + Vertex)

regex
(?i)^(anthropic\/)?(claude-opus-4-6|(eu\\.|us\\.|apac\\.)?anthropic\\.claude-opus-4-6-v1(:0)?|claude-opus-4-6)$
Matches:
  • claude-opus-4-6
    (direct API)
  • anthropic/claude-opus-4-6
    (with prefix)
  • anthropic.claude-opus-4-6-v1:0
    (AWS Bedrock)
  • us.anthropic.claude-opus-4-6-v1:0
    (regional Bedrock)
  • claude-opus-4-6
    (GCP Vertex)
regex
(?i)^(anthropic\/)?(claude-opus-4-6|(eu\\.|us\\.|apac\\.)?anthropic\\.claude-opus-4-6-v1(:0)?|claude-opus-4-6)$
匹配以下内容
  • claude-opus-4-6
    (直接API调用格式)
  • anthropic/claude-opus-4-6
    (带前缀格式)
  • anthropic.claude-opus-4-6-v1:0
    (AWS Bedrock格式)
  • us.anthropic.claude-opus-4-6-v1:0
    (区域化Bedrock格式)
  • claude-opus-4-6
    (GCP Vertex格式)

With Version Date

带版本日期的模式

regex
(?i)^(anthropic\/)?(claude-opus-4-5-20251101|(eu\\.|us\\.|apac\\.)?anthropic\\.claude-opus-4-5-20251101-v1:0|claude-opus-4-5@20251101)$
regex
(?i)^(anthropic\/)?(claude-opus-4-5-20251101|(eu\\.|us\\.|apac\\.)?anthropic\\.claude-opus-4-5-20251101-v1:0|claude-opus-4-5@20251101)$

OpenAI

OpenAI

regex
(?i)^(openai\/)?(gpt-4o)$
regex
(?i)^(openai\/)?(gpt-4o)$

Google Gemini

Google Gemini

regex
(?i)^(google\/)?(gemini-2.5-pro)$
regex
(?i)^(google\/)?(gemini-2.5-pro)$

Pattern Components

模式组成部分

ComponentPurposeExample
(?i)
Case insensitiveMatches GPT-4o and gpt-4o
^...$
Full string matchPrevents partial matches
(provider\/)?
Optional provider prefix
openai/gpt-4o
`(eu\.\us\.\apac\.)?`
(:0)?
Optional version suffixBedrock model versions
@date
Vertex AI format
claude-3-5-sonnet@20240620

组件用途示例
(?i)
不区分大小写匹配GPT-4o和gpt-4o
^...$
全字符串匹配防止部分匹配
(provider\/)?
可选的供应商前缀
openai/gpt-4o
`(eu\.\us\.\apac\.)?`
(:0)?
可选的版本后缀Bedrock模型版本
@date
Vertex AI格式
claude-3-5-sonnet@20240620

Step-by-Step: Adding a New Model

分步指南:添加新模型

Step 1: Fetch Official Pricing

步骤1:获取官方定价

Use WebFetch to get pricing from official documentation:
WebFetch URL: https://platform.claude.com/docs/en/about-claude/pricing
Prompt: Extract pricing for [model name] including input, output, cache write, cache read prices per MTok
使用WebFetch工具从官方文档获取定价信息:
WebFetch URL: https://platform.claude.com/docs/en/about-claude/pricing
Prompt: Extract pricing for [model name] including input, output, cache write, cache read prices per MTok

Step 2: Generate UUID

步骤2:生成UUID

bash
uuidgen
bash
uuidgen

Output: 13458BC0-1C20-44C2-8753-172F54B67647

输出示例: 13458BC0-1C20-44C2-8753-172F54B67647

Convert to lowercase: 13458bc0-1c20-44c2-8753-172f54b67647

转换为小写: 13458bc0-1c20-44c2-8753-172f54b67647

undefined
undefined

Step 3: Create the Entry

步骤3:创建条目

Example for a model with $5 input, $25 output, $6.25 cache write, $0.50 cache read:
json
{
  "id": "13458bc0-1c20-44c2-8753-172f54b67647",
  "modelName": "claude-opus-4-6",
  "matchPattern": "(?i)^(anthropic\/)?(claude-opus-4-6|(eu\\.|us\\.|apac\\.)?anthropic\\.claude-opus-4-6-v1(:0)?|claude-opus-4-6)$",
  "createdAt": "2026-02-09T00:00:00.000Z",
  "updatedAt": "2026-02-09T00:00:00.000Z",
  "tokenizerConfig": null,
  "tokenizerId": "claude",
  "pricingTiers": [
    {
      "id": "13458bc0-1c20-44c2-8753-172f54b67647_tier_default",
      "name": "Standard",
      "isDefault": true,
      "priority": 0,
      "conditions": [],
      "prices": {
        "input": 5e-6,
        "input_tokens": 5e-6,
        "output": 25e-6,
        "output_tokens": 25e-6,
        "cache_creation_input_tokens": 6.25e-6,
        "input_cache_creation": 6.25e-6,
        "cache_read_input_tokens": 0.5e-6,
        "input_cache_read": 0.5e-6
      }
    }
  ]
}
以下是一个模型的示例,输入价格为$5/百万令牌,输出为$25/百万令牌,缓存写入为$6.25/百万令牌,缓存读取为$0.50/百万令牌:
json
{
  "id": "13458bc0-1c20-44c2-8753-172f54b67647",
  "modelName": "claude-opus-4-6",
  "matchPattern": "(?i)^(anthropic\/)?(claude-opus-4-6|(eu\\.|us\\.|apac\\.)?anthropic\\.claude-opus-4-6-v1(:0)?|claude-opus-4-6)$",
  "createdAt": "2026-02-09T00:00:00.000Z",
  "updatedAt": "2026-02-09T00:00:00.000Z",
  "tokenizerConfig": null,
  "tokenizerId": "claude",
  "pricingTiers": [
    {
      "id": "13458bc0-1c20-44c2-8753-172f54b67647_tier_default",
      "name": "Standard",
      "isDefault": true,
      "priority": 0,
      "conditions": [],
      "prices": {
        "input": 5e-6,
        "input_tokens": 5e-6,
        "output": 25e-6,
        "output_tokens": 25e-6,
        "cache_creation_input_tokens": 6.25e-6,
        "input_cache_creation": 6.25e-6,
        "cache_read_input_tokens": 0.5e-6,
        "input_cache_read": 0.5e-6
      }
    }
  ]
}

Step 4: Insert Entry

步骤4:插入条目

Add the entry to the JSON array in
/worker/src/constants/default-model-prices.json
.
Placement: Insert near related models (e.g., other Claude models together).
将该条目添加到
/worker/src/constants/default-model-prices.json
文件的JSON数组中。
放置位置:将其插入到相关模型附近(例如,与其他Claude模型放在一起)。

Step 5: Add to LLM Types (for Playground & LLM-as-Judge)

步骤5:添加到LLM类型定义(供Playground和LLM-as-judge使用)

To make the model available in the Langfuse playground and for LLM-as-a-judge evaluations, add it to the appropriate model array in
/packages/shared/src/server/llm/types.ts
.
File:
/packages/shared/src/server/llm/types.ts
Model Arrays by Provider:
  • anthropicModels
    - Anthropic Claude models
  • openAIModels
    - OpenAI GPT models
  • vertexAIModels
    - Google Vertex AI models
  • googleAIStudioModels
    - Google AI Studio models
IMPORTANT: Do NOT add new models as the first entry in the array. The first entry is used as the default model for test LLM API calls, and newer models may not be available to all users yet.
Example for Anthropic:
typescript
export const anthropicModels = [
  "claude-sonnet-4-5-20250929",  // Keep existing first entry
  "claude-haiku-4-5-20251001",
  "claude-opus-4-6",              // Add new model here (not first!)
  "claude-opus-4-5-20251101",
  // ... rest of models
] as const;
要使模型在Langfuse Playground和LLM-as-judge评估中可用,请将其添加到
/packages/shared/src/server/llm/types.ts
文件中对应的模型数组中。
文件路径
/packages/shared/src/server/llm/types.ts
按供应商划分的模型数组
  • anthropicModels
    - Anthropic Claude模型
  • openAIModels
    - OpenAI GPT模型
  • vertexAIModels
    - Google Vertex AI模型
  • googleAIStudioModels
    - Google AI Studio模型
重要提示:请勿将新模型添加为数组的第一个条目。第一个条目用作测试LLM API调用的默认模型,而较新的模型可能尚未对所有用户开放。
Anthropic模型示例
typescript
export const anthropicModels = [
  "claude-sonnet-4-5-20250929",  // 保留现有第一个条目
  "claude-haiku-4-5-20251001",
  "claude-opus-4-6",              // 在此处添加新模型(不要放在第一个位置!)
  "claude-opus-4-5-20251101",
  // ... 其他模型
] as const;

Step 6: Validate

步骤6:验证

bash
undefined
bash
undefined

Check JSON syntax

检查JSON语法

jq . /path/to/default-model-prices.json > /dev/null && echo "Valid JSON"
jq . /path/to/default-model-prices.json > /dev/null && echo "Valid JSON"

Verify entry exists

验证条目是否存在

jq '.[] | select(.modelName == "claude-opus-4-6")' /path/to/default-model-prices.json

---
jq '.[] | select(.modelName == "claude-opus-4-6")' /path/to/default-model-prices.json

---

Multi-Tier Pricing Example

多层级定价示例

For models with long context pricing (e.g., different rates above 200K tokens):
json
{
  "id": "uuid-here",
  "modelName": "model-name",
  "matchPattern": "...",
  "pricingTiers": [
    {
      "id": "uuid-here_tier_default",
      "name": "Standard",
      "isDefault": true,
      "priority": 0,
      "conditions": [],
      "prices": {
        "input": 5e-6,
        "output": 25e-6
      }
    },
    {
      "id": "uuid-for-large-context-tier",
      "name": "Large Context (>200K)",
      "isDefault": false,
      "priority": 1,
      "conditions": [
        {
          "usageDetailPattern": "(input|prompt|cached)",
          "operator": "gt",
          "value": 200000,
          "caseSensitive": false
        }
      ],
      "prices": {
        "input": 10e-6,
        "output": 37.5e-6
      }
    }
  ]
}

对于具有长上下文定价的模型(例如,令牌数超过200K时使用不同费率):
json
{
  "id": "uuid-here",
  "modelName": "model-name",
  "matchPattern": "...",
  "pricingTiers": [
    {
      "id": "uuid-here_tier_default",
      "name": "Standard",
      "isDefault": true,
      "priority": 0,
      "conditions": [],
      "prices": {
        "input": 5e-6,
        "output": 25e-6
      }
    },
    {
      "id": "uuid-for-large-context-tier",
      "name": "Large Context (>200K)",
      "isDefault": false,
      "priority": 1,
      "conditions": [
        {
          "usageDetailPattern": "(input|prompt|cached)",
          "operator": "gt",
          "value": 200000,
          "caseSensitive": false
        }
      ],
      "prices": {
        "input": 10e-6,
        "output": 37.5e-6
      }
    }
  ]
}

Validation Rules

验证规则

The system validates pricing tiers with these rules:
  1. Exactly one default tier with
    isDefault: true
  2. Default tier must have
    priority: 0
    and empty
    conditions: []
  3. Non-default tiers must have
    priority > 0
    and at least one condition
  4. All priorities must be unique within a model
  5. All tier names must be unique within a model
  6. Each tier must have at least one price
  7. All tiers must have identical usage type keys
  8. Regex patterns must be valid and safe (no catastrophic backtracking)

系统使用以下规则验证定价层级:
  1. 恰好有一个默认层级,且
    isDefault: true
  2. 默认层级必须设置
    priority: 0
    和空
    conditions: []
  3. 非默认层级必须设置
    priority > 0
    且至少包含一个条件
  4. 所有优先级在一个模型内必须唯一
  5. 所有层级名称在一个模型内必须唯一
  6. 每个层级必须至少包含一个价格
  7. 所有层级必须具有相同的使用类型键
  8. 正则表达式模式必须有效且安全(无灾难性回溯)

Common Mistakes

常见错误

Using heuristics instead of official pricing:
json
// Wrong - assuming cache is 1.25x input
"cache_creation_input_tokens": input_price * 1.25

// Correct - use exact value from official docs
"cache_creation_input_tokens": 6.25e-6
Incorrect Price Format:
json
// Wrong - using MTok price directly
"input": 5

// Correct - price per token
"input": 5e-6
Missing Tier ID Suffix:
json
// Wrong
"id": "some-uuid"

// Correct for default tier
"id": "model-uuid_tier_default"
Invalid Regex Escaping:
json
// Wrong - unescaped dots
"matchPattern": "anthropic.claude"

// Correct - escaped dots
"matchPattern": "anthropic\\.claude"

使用推测而非官方定价
json
// 错误 - 假设缓存价格是输入价格的1.25倍
"cache_creation_input_tokens": input_price * 1.25

// 正确 - 使用官方文档中的精确值
"cache_creation_input_tokens": 6.25e-6
价格格式错误
json
// 错误 - 直接使用每百万令牌的价格
"input": 5

// 正确 - 使用每个令牌的价格
"input": 5e-6
缺少层级ID后缀
json
// 错误
"id": "some-uuid"

// 正确的默认层级ID
"id": "model-uuid_tier_default"
正则表达式转义错误
json
// 错误 - 未转义点号
"matchPattern": "anthropic.claude"

// 正确 - 转义点号
"matchPattern": "anthropic\\.claude"

Testing Model Matching

测试模型匹配

After adding a model, test that the regex matches expected inputs:
javascript
const pattern = new RegExp(matchPattern);
console.log(pattern.test("claude-opus-4-6")); // true
console.log(pattern.test("anthropic/claude-opus-4-6")); // true
console.log(pattern.test("anthropic.claude-opus-4-6-v1:0")); // true
console.log(pattern.test("us.anthropic.claude-opus-4-6-v1:0")); // true

添加模型后,测试正则表达式是否能匹配预期输入:
javascript
const pattern = new RegExp(matchPattern);
console.log(pattern.test("claude-opus-4-6")); // true
console.log(pattern.test("anthropic/claude-opus-4-6")); // true
console.log(pattern.test("anthropic.claude-opus-4-6-v1:0")); // true
console.log(pattern.test("us.anthropic.claude-opus-4-6-v1:0")); // true

Reference: Existing Model Entries

参考:现有模型条目

Look at these existing entries as templates:
Model TypeExample EntryNotes
Anthropic Claude
claude-opus-4-5-20251101
Full multi-provider pattern
OpenAI GPT
gpt-4o
Simple pattern
Google Gemini
gemini-2.5-pro
Multi-tier with large context

可以参考以下现有条目作为模板:
模型类型示例条目说明
Anthropic Claude
claude-opus-4-5-20251101
完整的多供应商匹配模式
OpenAI GPT
gpt-4o
简单匹配模式
Google Gemini
gemini-2.5-pro
带长上下文的多层级定价

Related Files

相关文件

  • Pricing JSON:
    /worker/src/constants/default-model-prices.json
  • LLM Types:
    /packages/shared/src/server/llm/types.ts
    (model arrays for playground/LLM-as-judge)
  • Validation:
    /packages/shared/src/server/pricing-tiers/validation.ts
  • Matcher:
    /packages/shared/src/server/pricing-tiers/matcher.ts
  • Tests:
    /web/src/__tests__/async/model-pricing-tiers.servertest.ts

Skill Status: COMPLETE Line Count: ~340 lines
  • 定价JSON
    /worker/src/constants/default-model-prices.json
  • LLM类型定义
    /packages/shared/src/server/llm/types.ts
    (供Playground和LLM-as-judge使用的模型数组)
  • 验证逻辑
    /packages/shared/src/server/pricing-tiers/validation.ts
  • 匹配器
    /packages/shared/src/server/pricing-tiers/matcher.ts
  • 测试用例
    /web/src/__tests__/async/model-pricing-tiers.servertest.ts

技能状态:已完成 行数统计:约340行