octav-api
它能做什么
这项技能说明如何使用 Octav API 追踪加密钱包和 DeFi 持仓。它适合开发投资组合或金融应用、需要多链余额和历史数据的开发者。
适用场景
- ✓当你想显示一个钱包在多条区块链上的余额和净资产时。
- ✓当你需要某个钱包经过筛选的交易历史的时候。
- ✓当你想追踪借贷或流动性池等 DeFi 协议中的仓位的时候。
技能链接
https://github.com/internet-court/internet-court-skill/blob/main/vendored/octav/octav-api/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“我想用 Octav API 做一个页面,显示我的钱包在所有链上的总价值。”
每周 5 个新技能,1 分钟读完。
工作原理
智能体会使用保存在环境变量中的 Bearer 令牌调用 Octav 端点。它会根据投资组合、钱包、交易或 DeFi 仓位,选择对应的端点,并注意每次调用的积分成本。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
Octav API Integration
API for cryptocurrency portfolio tracking, transaction history, and DeFi analytics.
Quick Reference
Base URL: https://api.octav.fi
Auth: Bearer token in Authorization header
Rate Limit: 360 requests/minute/key
Pricing: Credit-based ($0.02-0.025/credit)
Dev Portal: https://data.octav.fi
Authentication
curl -X GET "https://api.octav.fi/v1/credits" \
-H "Authorization: Bearer YOUR_API_KEY"
Store API key in environment variable OCTAV_API_KEY. Never hardcode.
Access methods
Default to the API-key REST API documented below. It covers all 25 endpoints.
Octav also exposes 5 endpoints over the x402 payment protocol at /v1/agent/{portfolio,wallet,nav,status,chains} — 0.025 USDC per call on Base, no API key. Use x402 only when:
- the user explicitly asked for x402 or pay-per-call access, or
- the agent has its own funded wallet and no API key is available.
Otherwise use /v1/* with a Bearer token, and mention x402 exists if one of those cases applies. Do not start from x402 by default.
There is no /v1/agent/transactions — transaction history requires an API key.
Endpoints Overview
| Endpoint | Method | Cost | Description |
|---|---|---|---|
/v1/portfolio |
GET | 1 credit | Portfolio holdings across chains/protocols |
/v1/portfolio/at-block |
GET | Add-on + 1 credit | Portfolio valued at a historical block (Ethereum) |
/v1/virtual-users |
GET | 1 credit | List virtual users (Pro) |
/v1/virtual-users/portfolio |
GET | 1 credit/address | Virtual user holdings (Pro) |
/v1/nav |
GET | 1 credit | Net Asset Value — {nav, currency, conversionPrice} |
/v1/wallet |
GET | 1 credit | Wallet token balances, excludes DeFi positions |
/v1/transactions |
GET | 1 credit | Transaction history with filtering |
/v1/approvals/{chain} |
GET | 1 credit | ERC-20 token approval records |
/v1/token-overview |
GET | 1 credit | Token breakdown by protocol (PRO only) |
/v1/airdrop |
GET | 1 credit | Claimable airdrops (Solana only) |
/v1/historical |
GET | 1 credit | Historical portfolio snapshots |
/v1/sync-transactions |
POST | 1+ credits | Trigger transaction sync |
/v1/contract-protocol |
GET | 5 credits | Resolve contract address to DeFi protocol (refunded on 404) |
/v1/beacon/validators/* |
GET | Add-on | ETH validator details, rewards, withdrawals, deposits |
/v1/chains |
GET | Free | List supported blockchain networks |
/v1/chains/{chainKey}/protocols |
GET | Free | List protocols on a chain |
/v1/status |
GET | Free | Check sync status |
/v1/credits |
GET | Free | Check credit balance |
Subscribe Snapshot (POST, 1200 credits) enables daily portfolio snapshots for an address, which /v1/historical then reads.
x402 endpoints (no API key — see Access methods above)
| Endpoint | Method | Cost | Description |
|---|---|---|---|
/v1/agent/portfolio |
GET | 0.025 USDC | Wallet and protocol holdings |
/v1/agent/wallet |
GET | 0.025 USDC | Wallet holdings only |
/v1/agent/nav |
GET | 0.025 USDC | Net Asset Value — {nav, currency, conversionPrice} |
/v1/agent/status |
GET | 0.025 USDC | Sync status |
/v1/agent/chains |
GET | 0.025 USDC | Supported chains |
An unpaid request returns HTTP 402 with a base64 payment-required header containing the payment challenge (USDC on Base, eip155:8453). An x402-capable HTTP client settles it and retries automatically.
Core Endpoints
Portfolio
Get holdings across wallets and DeFi protocols.
const response = await fetch(
`https://api.octav.fi/v1/portfolio?addresses=${address}`,
{ headers: { 'Authorization': `Bearer ${apiKey}` } }
);
const portfolio = await response.json();
// portfolio.networth, portfolio.assetByProtocols, portfolio.chains
Parameters:
addresses(required): EVM or Solana address. Comma-separate multiple addresses in one request to save credits.includeImages: Include asset/protocol image URLs (default: false)includeExplorerUrls: Include block explorer URLs (default: false)waitForSync: Wait for fresh data if stale (default: false)
Response structure:
{
"address": "0x...",
"networth": "45231.89",
"assetByProtocols": {
"wallet": { "key": "wallet", "name": "Wallet", "value": "12453.20", "assets": [...] },
"aave_v3": { "key"
常见问题
我应该把 API 密钥保存在哪里?
该技能要求把它保存在 OCTAV_API_KEY 环境变量中,绝不要硬编码。
有速率限制吗?
有。该技能列出每个密钥每分钟 360 次请求的限制。
我可以按次付费而不使用密钥吗?
该技能提到了按次付费选项,但要求只有在用户要求,或智能体拥有自己充值的钱包时才使用。
详情
作者的原始描述
Integrate with Octav API for cryptocurrency portfolio tracking, transaction history, and DeFi analytics across 50+ blockchain networks. Use when building applications that need to: (1) Track wallet balances and net worth across multiple chains, (2) Query transaction history with filtering and search, (3) Monitor DeFi protocol positions (Aave, Uniswap, etc.), (4) Access historical portfolio snapshots, (5) Analyze token distribution and holdings, (6) Pay per request as an autonomous agent via x402. Triggers on: "Octav API", "crypto portfolio API", "blockchain portfolio tracking", "DeFi analytics
热度
- GitHub 星标
- 7.0k
- 排名
- #13657
- 许可证
- —
- 更新时间
- 2026/10/26
评论
- …
同一仓库的更多技能
internet-court
7.0k帮你的智能体安全地向其他 AI 智能体或付费服务付款、雇用或进行交易,并指引它找到合适的专业指南。
genlayer-erc7710-connector
7.0k帮你的智能体把 AI 审核结果与权限系统连接起来,使不合格的审核可以限制或取消智能体的权限。
genlayer-intelligent-contracts
7.0k帮你的智能体定义 AI 裁判的规则、证据和输出,用于检查另一个智能体是否遵循了其授权范围。
x402-erc7710
7.0k帮你的智能体按次为网络服务付款,并设置在权限预算范围内的持续支出。