venicex402
安装方式
先用 Prompt 核对来源与依赖。也可下载安装包。
用 AI 助手安装
复制提示词,让助手先核对固定版本和依赖。
查看 Prompt收起 Prompt
先检查当前 Agent 是否已安装 SkillPI Skill Finder。如果尚未安装,请按官方仓库的说明安装并启用:https://github.com/Findskills/skillpi。然后使用 Skill Finder 打开此 SkillPI 详情页并定位 "venicex402":https://skillpi.com/zh/skills/deepskill-80035c48a1a2032f3f759cd3190790efdaeb8799a3c7e4e4e951da1898c6571b。安装前核对上游来源和版本:https://skillhub.cn/skills/user_3c6cb52e/venice-x402-7sn6。来源不一致时停止并说明差异。核对通过后,用 Skill Finder 安装目标 Skill,并报告安装路径和来源版本。
来源与配置
skillhub.cn
配置方式待核实
请查看原始来源中的适用工具、依赖和权限要求。
安装实测待补充
VeniceX402 专用技能,帮助 AI Agent 高效完成相关任务。
介绍来源: third_party · user_3c6cb52e · 1.0.0 参考来源
SkillPi 解读
- 能完成的任务
- 翻译待完成,请参阅来源文档。
- 适合谁
- 来源文档未说明。
- 输入和输出
- 来源文档未说明。
- 软件、账号及付费要求
- 翻译待完成,请参阅来源文档。
- 限制与区别
- 来源文档未说明。
- 实测状态
- 未测试
文件浏览
Frontmatter
name: Venicex402
slug: venice-x402
version: 1.0.0
displayName: Venicex402
description: >
VeniceX402专用技能,帮助AI Agent高效完成相关任务。
summary: "VeniceX402专用技能,帮助AI Agent高效完成相关任务。"
license: MIT
category: 开发者工具
framework:
- Claude Code
- Codex
- Hermes Agent
- OpenClaw
- QClaw
- WorkBuddy
platform: multi-platform
homepage: "https://github.com/1991513ccie-png"
repository: "https://github.com/1991513ccie-png"Venice x402 (wallet credits)
x402 is Venice's wallet-based payment flow. Pay per request with USDC on Base, no account required. Three admin endpoints plus the protocol-level 402 response returned by every inference endpoint.
| Endpoint | Auth | Purpose |
|---|---|---|
POST /x402/top-up |
None (discovery) / X-402-Payment (settlement) |
Discover payment requirements, then settle a signed USDC transfer. |
GET /x402/balance/{walletAddress} |
SIWE (X-Sign-In-With-X) |
Current USD balance for a wallet. |
GET /x402/transactions/{walletAddress} |
SIWE | Paginated ledger: TOP_UP, CHARGE, REFUND. |
For the SIWE header format itself, see venice-auth.
Pay with a wallet: end-to-end
1. Call an inference endpoint with no balance → 402
Any inference endpoint (e.g. POST /chat/completions) returns a 402 with structured topUpInstructions and siwxChallenge when the wallet balance is too low. The PAYMENT-REQUIRED response header carries the x402 v2 paymentRequired object (base64-encoded JSON containing x402Version, error, resource, accepts[], and optional extensions) — it is not the same payload as the 402 body, which is a richer balance/top-up document.
{
"error": "Payment required",
"code": "PAYMENT_REQUIRED",
"message": "Insufficient x402 balance",
"suggestedTopUpUsd": 10,
"minimumTopUpUsd": 5,
"supportedTokens": ["USDC"],
"supportedChains": ["base"],
"topUpInstructions": {
"step1": "POST /api/v1/x402/top-up with no payment header to get payment requirements",
"step2": "Sign a USDC transfer authorization using the x402 SDK (createPaymentHeader)",
"step3": "POST /api/v1/x402/top-up with the signed X-402-Payment header",
"receiverWallet": "<RECEIVER_WALLET_ADDRESS>",
"tokenAddress": "<USDC_TOKEN_ADDRESS>",
"tokenDecimals": 6,
"network": "eip155:8453",
"minimumAmountUsd": 5
},
"siwxChallenge": {
"info": { "domain": "api.venice.ai", "statement": "Sign in to Venice AI", ... },
"supportedChains": ["eip155:8453"]
}
}
2. Discover payment requirements — POST /x402/top-up (no header)
curl -X POST https://api.venice.ai/api/v1/x402/top-up
Response 402:
{
"x402Version": 2,
"accepts": [{
"protocol": "x402",
"version": 2,
"network": "eip155:8453",
"asset": "<USDC_TOKEN_ADDRESS>",
"amount": "5000000", // base units; USDC = 6 decimals → 5 USDC
"payTo": "<RECEIVER_WALLET_ADDRESS>"
}]
}
3. Sign a USDC transfer → POST /x402/top-up with X-402-Payment
The x402 SDK does the EIP-712 USDC transferWithAuthorization signing for you:
npm install x402
import { createPaymentHeader } from 'x402'
import { Wallet } from 'ethers'
const wallet = new Wallet(process.env.WALLET_KEY!)
// 1. Discover
const discover = await fetch(`${base}/x402/top-up`, { method: 'POST' })
const { accepts: [req] } = await discover.json()
// 2. Sign payment for $10 (write your own amount in base units)
const amount = '10000000' // $10
const header = await createPaymentHeader({ ...req, amount }, wallet)
// 3. Settle
const settle = await fetch(`${base}/x402/top-up`, {
method: 'POST',
headers: { 'X-402-Payment': header },
})
const { data } = await settle.json()
console.log(data.newBalance, data.amountCredited, data.paymentId)
200 response:
{
"success": true,
"data": {
"walletAddress": "0x...",
"amountCredited": 10,
"newBalance": 22.5,
"paymentId": "payment_01HZ..."
}
}
4. Call inference again — credits are now debited from the wallet
The venice-x402-client SDK wraps steps 1–4: it catches 402, auto-tops-up to a configured amount, and retries.
GET /x402/balance/{walletAddress}
curl "https://api.venice.ai/api/v1/x402/balance/0xYOUR_WALLET" \
-H "X-Sign-In-With-X: <base64 siwe>"
{
"success": true,
"data": {
"walletAddress": "0x...",
"balanceUsd": 12.5,
"canConsume": true,
"minimumTopUpUsd": 5,
"suggestedTopUpUsd": 10,
"diemBalanceUsd": 5.25 // optional — present if the wallet is linked to a Venice account with DIEM
}
}
The SIWE signer must match the path wallet — 403 otherwise.
GET /x402/transactions/{walletAddress}
curl "https://api.venice.ai/api/v1/x402/transactions/0xYOUR_WALLET?limit=50&offset=0" \
-H "X-Sign-In-With-X: <base64 siwe>"
{
"success": true,
"data": {
"walletAddress": "0x...",
"currentBalance": 12.35,
"transactions": [
{
"id": "ledger_01H...",
"amount": -0.15,
"balanceAfter": 12.35,
"type": "CHARGE",
"createdAt": "2026-04-03T12:34:56.000Z",
"requestId": "chatcmpl-...",
"modelId": "zai-org-glm-5-1"
},
{
"id": "ledger_01H...",
"amount": 10,
"balanceAfter": 12.5,
"type": "TOP_UP",
"createdAt": "2026-04-03T12:00:00.000Z",
"requestId": null,
"modelId": null
}
],
"pagination": { "limit": 50, "offset": 0, "hasMore": false }
}
}
Transaction types
type |
Sign of amount |
Meaning |
|---|---|---|
TOP_UP |
positive | /x402/top-up settlement. |
CHARGE |
negative | Inference debit. requestId / modelId link back to the call. |
REFUND |
positive | Failed request refund or manual adjustment. |
Query parameters
/x402/transactions/{walletAddress}
| Param | Notes |
|---|---|
limit |
1–100. Default 50. |
offset |
Number of entries to skip. Default 0. |
Use offset + limit and pagination.hasMore for paging.
Constants
- Chain — Base mainnet, chain ID
8453(eip155:8453). - Token — USDC (6 decimals). Native USDC on Base; not USDbC.
- Minimum top-up —
$5by default. A small number of allow-listed wallets (e.g. internal test wallets) may have a lower per-wallet override — always use theminimumTopUpUsdreturned intopUpInstructions//x402/balancerather than hardcoding5. - x402 SDK —
npm install x402for raw payment header signing, orvenice-x402-clientfor the managed Venice flow. - Receiver wallet + token contract are returned in
topUpInstructions; don't hardcode them.
Errors
| Code | Meaning |
|---|---|
400 |
Below minimum top-up, invalid wallet format, or other validation. |
401 |
X-Sign-In-With-X header is present but invalid (bad signature, expired, nonce reuse, unsupported chain) — returned as X402_SIGN_IN_* error codes. |
402 |
Expected discovery response on /x402/top-up (no payment header), on /x402/balance and /x402/transactions when the SIWE header is absent, and on any inference endpoint when the wallet balance is insufficient. Settlement errors use INVALID_PAYMENT / INVALID_PAYMENT_FORMAT / INSUFFICIENT_FUNDS / EXPIRED_PAYMENT codes. |
403 |
SIWE wallet ≠ path wallet. |
429 |
Too many top-ups/balance checks. |
500 |
Settlement failure; retry with a fresh nonce. |
Gotchas
- Use the x402 SDK (
npm install x402) for signing. Hand-rolling the EIP-712transferWithAuthorizationis risky — nonce reuse ⇒INVALID_PAYMENT. - The SIWE signer wallet must match the
walletAddresspath param onbalance/transactions. Separate wallets can't inspect each other. /x402/top-upis unauthenticated on the discovery call — auth is implicit via the signedX-402-Paymentheader on settlement.balanceUsdon/x402/balanceis the USDC credit balance only.diemBalanceUsd, when present, is a separate linked-account number — sum them yourself if you need a combined figure.PAYMENT-REQUIRED(uppercase, hyphens) is the header with base64-encoded x402paymentRequiredobject; don't confuse it with the body fieldcode: "PAYMENT_REQUIRED"(which only appears on insufficient-balance bodies, not on auth-style 402s).- On
/x402/balanceand/x402/transactions, missing the SIWE header returns402(not 401). Only a present-but-invalid header returns401with aX402_SIGN_IN_*code. - The x402 v2
accepts[].amountis in base units (e.g."5000000"= 5 USDC). Don't multiply by decimals again. DIEM,BUNDLED_CREDITS, and Bearer-accountUSDare independent from wallet credits. For account balance, usevenice-billing.
当前收录版本
1.0.0
安全与评测信息
质量评测
满分100 · 来自 SkillPi LAB 实验室的评测报告。
亮点
- 提供完整的VeniceX402支付协议文档
- 包含端到端支付流程示例
- 详细的API端点说明和错误处理
待提升项
-
触发词过于宽泛 原报告严重程度:轻微
description中使用"相关任务"过于笼统,缺乏具体关键词
改进建议:建议在description中添加具体功能关键词如"wallet payment"、"USDC"、"x402"等
待提升项
-
文档过长 原报告严重程度:轻微
skill_body内容估计超过500行,影响可读性
改进建议:建议将部分内容拆分为单独文档或通过链接引用
亮点
- 结构清晰,步骤完整
- 包含丰富的代码示例
- frontmatter完整
待提升项
-
网络异常处理缺失 原报告严重程度:轻微
未覆盖网络超时、连接失败等客户端异常场景
改进建议:建议添加网络异常处理建议和重试机制说明
亮点
- 工具来源明确
- 参数说明详细
- 错误码覆盖全面
取前四项原始分值的算术平均,四舍五入取整。可通过收录报告核对各项评分与说明,运行记录需单独查证。
正文静态检测
100 / 100 · skillpi-20261123-no-r3-v1
正文未命中当前规则。
分数仅反映正文中的规则命中,供使用前参考。附件与运行行为不在此评分范围内。
权限与使用前检查
根据当前主文档自动整理,命中内容可能是示例或防护说明;不是实际权限声明,也未覆盖附件、外部依赖或运行行为。
-
安装或获取外部依赖
使用官方来源并锁定版本,在隔离环境检查安装脚本。当前文档检查不覆盖后续下载的代码。
主文档提及 · 第 96, 224, 240 行
文档引用的域名或地址
这些地址可能用于文档链接或示例,不是已批准的联网清单。使用前核对实际目的地及发送的数据。
- api.venice.ai
- github.com
安全评级与访问范围
safe · 静态证据核验,不代表运行安全保证。
翻译待完成,请参阅来源文档。
使用前请由宿主核对并授权实际文件读写、外部服务和联网目的地;本站的核验不会授予任何运行权限。
用户讨论
还没有已核实的点评。