mirror of
https://github.com/NoFxAiOS/nofx.git
synced 2026-07-28 22:42:52 +08:00
feat: show pay-as-you-go token pricing instead of flat per-call prices
Chat routes settle via x402 upto on actual usage, so the flat $/call labels were misleading. Model cards now show official $/1M-token input and output rates from the gateway pricing config; pay-per-call wording updated to pay-as-you-go.
This commit is contained in:
@@ -640,7 +640,7 @@ function Claw402ConfigForm({
|
||||
className="text-[10px] font-medium"
|
||||
style={{ color: '#2E8B57' }}
|
||||
>
|
||||
${m.price} / call
|
||||
${m.priceIn} in · ${m.priceOut} out /1M tok
|
||||
</div>
|
||||
</div>
|
||||
{isSelected && (
|
||||
|
||||
@@ -5,8 +5,9 @@ export interface Claw402Model {
|
||||
name: string
|
||||
provider: string
|
||||
desc: string
|
||||
brand: string // key for getModelIcon / getModelColor
|
||||
price: number // USD per call
|
||||
brand: string // key for getModelIcon / getModelColor
|
||||
priceIn: number // USD per 1M input tokens (upto pay-as-you-go)
|
||||
priceOut: number // USD per 1M output tokens
|
||||
isNew?: boolean
|
||||
}
|
||||
|
||||
@@ -40,15 +41,17 @@ export const DEFAULT_CLAW402_MODEL = 'gpt-5.6'
|
||||
|
||||
// Models available through Claw402 (x402 USDC payment protocol)
|
||||
// Must stay in sync with the claw402 catalog (GET /api/v1/catalog)
|
||||
// Prices are USD per 1M tokens (input / output), settled pay-as-you-go via
|
||||
// the x402 upto scheme — each call is charged on actual token usage.
|
||||
export const CLAW402_MODELS: Claw402Model[] = [
|
||||
{ id: 'gpt-5.6', name: 'GPT-5.6 Sol', provider: 'OpenAI', desc: 'Flagship', brand: 'openai', price: 0.06 },
|
||||
{ id: 'gpt-5.6-terra', name: 'GPT-5.6 Terra', provider: 'OpenAI', desc: 'Balanced', brand: 'openai', price: 0.03 },
|
||||
{ id: 'gpt-5.6-luna', name: 'GPT-5.6 Luna', provider: 'OpenAI', desc: 'Cost-efficient', brand: 'openai', price: 0.012 },
|
||||
{ id: 'claude-fable', name: 'Claude Fable 5', provider: 'Anthropic', desc: 'Most capable', brand: 'claude', price: 0.24 },
|
||||
{ id: 'claude-opus', name: 'Claude Opus 4.8', provider: 'Anthropic', desc: 'Coding & agents flagship', brand: 'claude', price: 0.12 },
|
||||
{ id: 'deepseek-v4-flash', name: 'DeepSeek-V4 Flash', provider: 'DeepSeek', desc: 'Fast general model', brand: 'deepseek', price: 0.003 },
|
||||
{ id: 'deepseek-v4-pro', name: 'DeepSeek-V4 Pro', provider: 'DeepSeek', desc: 'Advanced reasoning', brand: 'deepseek', price: 0.01 },
|
||||
{ id: 'glm-5', name: 'GLM-5', provider: 'Z.ai', desc: 'Deep reasoning flagship', brand: 'zhipu', price: 0.003 },
|
||||
{ id: 'gpt-5.6', name: 'GPT-5.6 Sol', provider: 'OpenAI', desc: 'Flagship', brand: 'openai', priceIn: 5, priceOut: 30 },
|
||||
{ id: 'gpt-5.6-terra', name: 'GPT-5.6 Terra', provider: 'OpenAI', desc: 'Balanced', brand: 'openai', priceIn: 2.5, priceOut: 15 },
|
||||
{ id: 'gpt-5.6-luna', name: 'GPT-5.6 Luna', provider: 'OpenAI', desc: 'Cost-efficient', brand: 'openai', priceIn: 1, priceOut: 6 },
|
||||
{ id: 'claude-fable', name: 'Claude Fable 5', provider: 'Anthropic', desc: 'Most capable', brand: 'claude', priceIn: 10, priceOut: 50 },
|
||||
{ id: 'claude-opus', name: 'Claude Opus 4.8', provider: 'Anthropic', desc: 'Coding & agents flagship', brand: 'claude', priceIn: 5, priceOut: 25 },
|
||||
{ id: 'deepseek-v4-flash', name: 'DeepSeek-V4 Flash', provider: 'DeepSeek', desc: 'Fast general model', brand: 'deepseek', priceIn: 0.14, priceOut: 0.28 },
|
||||
{ id: 'deepseek-v4-pro', name: 'DeepSeek-V4 Pro', provider: 'DeepSeek', desc: 'Advanced reasoning', brand: 'deepseek', priceIn: 1.74, priceOut: 3.48 },
|
||||
{ id: 'glm-5', name: 'GLM-5', provider: 'Z.ai', desc: 'Deep reasoning flagship', brand: 'zhipu', priceIn: 0.6, priceOut: 2 },
|
||||
]
|
||||
|
||||
// AI Provider configuration - default models and API links
|
||||
|
||||
@@ -1092,9 +1092,9 @@ export const translations = {
|
||||
otherApiEntry: 'Other API Providers',
|
||||
otherApiEntryDesc:
|
||||
'Use your own API key for OpenAI, Claude, Gemini, DeepSeek, and more.',
|
||||
payPerCall: 'Pay-per-call USDC · All AI Models · No API Key',
|
||||
payPerCall: 'Pay-as-you-go USDC · All AI Models · No API Key',
|
||||
recommended: 'Best',
|
||||
allModelsClaw: 'Pay-per-call with USDC — supports all major AI models',
|
||||
allModelsClaw: 'Pay-as-you-go with USDC — supports all major AI models',
|
||||
selectAiModel: 'Choose AI Model',
|
||||
allModelsUnified:
|
||||
'All models unified via Claw402. Switch anytime after setup.',
|
||||
@@ -2259,9 +2259,9 @@ export const translations = {
|
||||
otherApiEntry: '其他 API 模型',
|
||||
otherApiEntryDesc:
|
||||
'如果你已经有自己的 OpenAI、Claude、Gemini、DeepSeek 等 API Key,再从这里进入。',
|
||||
payPerCall: 'USDC 按次付费 · 支持全部 AI 模型 · 无需 API Key',
|
||||
payPerCall: 'USDC 按量付费 · 支持全部 AI 模型 · 无需 API Key',
|
||||
recommended: '推荐',
|
||||
allModelsClaw: '用 USDC 按次付费,支持所有主流 AI 模型',
|
||||
allModelsClaw: '用 USDC 按量付费,支持所有主流 AI 模型',
|
||||
selectAiModel: '① 选择 AI 模型',
|
||||
allModelsUnified: '所有模型通过 Claw402 统一调用,创建后可随时切换',
|
||||
setupWallet: '② 设置钱包',
|
||||
@@ -3377,7 +3377,7 @@ export const translations = {
|
||||
otherApiEntry: 'Penyedia API Lain',
|
||||
otherApiEntryDesc:
|
||||
'Gunakan API key Anda sendiri untuk OpenAI, Claude, Gemini, DeepSeek, dan lainnya.',
|
||||
payPerCall: 'Bayar per panggilan USDC · Semua Model AI · Tanpa API Key',
|
||||
payPerCall: 'Bayar sesuai pemakaian USDC · Semua Model AI · Tanpa API Key',
|
||||
recommended: 'Terbaik',
|
||||
allModelsClaw:
|
||||
'Bayar per panggilan dengan USDC — mendukung semua model AI utama',
|
||||
|
||||
Reference in New Issue
Block a user