Developer Reference
API Documentation
Integrate AgentHF market intelligence into your agent. Real-time prices, 18 technical indicators, premium charts, fundamentals, insider data, strategy signals, and webhook push delivery — all accessible via Virtuals ACP or x402 pay-per-call.
Quick Start
Get up and running in minutes. AgentHF supports two authentication modes — pick the one that suits your workflow.
https://agenthf.ai— All responses are JSON · TLS onlyRegister your wallet & get an API key
/api/auth/register with your wallet address. You'll receive an ahf_-prefixed API key instantly.curl -X POST https://agenthf.ai/api/auth/register \
-H "Content-Type: application/json" \
-d '{"wallet": "0xYourWalletAddress"}'{ "apiKey": "ahf_xxxxxxxxxxxxxxxx", "wallet": "0x..." }Make authenticated requests
curl https://agenthf.ai/api/acp/price?symbol=AAPL \ -H "Authorization: Bearer ahf_xxxxxxxxxxxxxxxx"
Or use x402 — no registration needed
# 1. Call without auth → receive 402 Payment Required curl https://agenthf.ai/api/acp/price?symbol=AAPL # 2. Pay the USDC amount specified in X-Payment-Required header # 3. Retry with payment receipt header → receive data
Public Endpoints
These endpoints require no authentication and are freely accessible.
/api/acp/healthNo Auth RequiredHealth check. Returns API status and current timestamp. Use this to verify the service is reachable before making authenticated requests.
Example Request
curl https://agenthf.ai/api/acp/health
Response
{
"status": "ok",
"timestamp": "2026-02-18T12:00:00Z",
"version": "1.0.0"
}/api/acp/servicesNo Auth RequiredService discovery — lists all available data products, their descriptions, pricing, and supported parameters. Use this to discover what endpoints and strategies are available before subscribing.
Parameters
categorystringFilter by category: price, indicators, fundamentals, signals, etc.
limitintegerMax results to return (default 20, max 100).
Example Request
curl https://agenthf.ai/api/acp/services
Response
{
"services": [
{
"id": "price",
"name": "Real-time Price Data",
"description": "Live stock & crypto prices",
"pricePerCall": "0.001",
"currency": "USDC",
"endpoint": "/api/acp/price"
},
{
"id": "indicators",
"name": "Technical Indicators",
"description": "RSI, MACD, EMA and more",
"pricePerCall": "0.002",
"currency": "USDC",
"endpoint": "/api/acp/indicators"
}
],
"total": 12
}/api/acp/statusNo Auth RequiredACP SDK connection status. Returns whether the AgentHF node is connected to the Virtuals Protocol ACP network, active job count, and SDK version.
Example Request
curl https://agenthf.ai/api/acp/status
Response
{
"connected": true,
"agentAddress": "0xAgentHFAddress",
"activeJobs": 3,
"sdkVersion": "1.2.0",
"network": "base-mainnet"
}Price Data
Real-time price data for stocks and crypto. Supports US equities and major crypto pairs with real-time data feeds.
/api/acp/priceBearer ahf_ OR x402Fetch the latest real-time price for any stock or crypto symbol. Supports US equities and major crypto pairs (e.g. BTCUSDT, ETHUSDT) with real-time market data.
Parameters
symbolstringrequiredTicker symbol. Stocks: AAPL, TSLA, NVDA. Crypto: BTCUSDT, ETHUSDT, SOLUSDT.
Example Request
curl "https://agenthf.ai/api/acp/price?symbol=AAPL" \ -H "Authorization: Bearer ahf_xxxxxxxxxxxxxxxx"
Response
{
"symbol": "AAPL",
"price": 227.83,
"change": 1.24,
"changePercent": 0.55,
"high": 229.10,
"low": 225.40,
"volume": 48293012,
"timestamp": "2026-02-18T12:00:00Z",
"source": "market-data"
}Technical Indicators
Compute technical indicators on demand. Supports 18 indicator types across momentum, trend, volatility, and volume categories.
/api/acp/indicatorsBearer ahf_ OR x402Compute a technical indicator for any symbol. Returns the current indicator value(s) based on recent OHLCV candle data. Supports all 18 indicators: RSI, SMA, EMA, MACD, Bollinger Bands, ATR, VWAP, Stochastic, Williams %R, OBV, CCI, Ichimoku, Parabolic SAR, ADX, ROC, MFI, Aroon, and TRIX.
Parameters
symbolstringrequiredTicker symbol, e.g. AAPL, BTCUSDT.
indicatorstringrequiredIndicator name (case-insensitive): rsi, sma, ema, macd, bollinger, atr, vwap, stochastic, williams_r, obv, cci, ichimoku, parabolic_sar, adx, roc, mfi, aroon, trix.
periodintegerLookback period for the indicator (default: 14). Applies to RSI, SMA, EMA, ATR, CCI, Williams %R, Stochastic, ADX, ROC, MFI, Aroon, TRIX.
intervalstringCandle interval: 1m, 5m, 15m, 1h, 4h, 1d (default: 1h).
Example Request
curl "https://agenthf.ai/api/acp/indicators?symbol=AAPL&indicator=rsi&period=14" \ -H "Authorization: Bearer ahf_xxxxxxxxxxxxxxxx"
Response
{
"symbol": "AAPL",
"indicator": "rsi",
"period": 14,
"interval": "1h",
"value": 58.43,
"signal": "neutral",
"timestamp": "2026-02-18T12:00:00Z"
}Market Intelligence
Deep market data: company fundamentals, insider activity, technical consensus, and earnings history.
/api/acp/fundamentalsBearer ahf_ OR x402Company financial fundamentals — valuation metrics, profitability, growth rates, balance sheet highlights. Ideal for fundamental screening and agent decision-making.
Parameters
symbolstringrequiredStock ticker, e.g. AAPL, NVDA, MSFT.
Example Request
curl "https://agenthf.ai/api/acp/fundamentals?symbol=AAPL" \ -H "Authorization: Bearer ahf_xxxxxxxxxxxxxxxx"
Response
{
"symbol": "AAPL",
"name": "Apple Inc.",
"marketCap": 3420000000000,
"peRatio": 28.4,
"pbRatio": 44.2,
"psRatio": 8.7,
"evEbitda": 22.1,
"revenueGrowthYoY": 0.062,
"earningsGrowthYoY": 0.118,
"grossMargin": 0.447,
"operatingMargin": 0.308,
"netMargin": 0.261,
"debtToEquity": 1.87,
"currentRatio": 0.99,
"roe": 1.47,
"dividendYield": 0.0055,
"52wHigh": 259.81,
"52wLow": 164.08,
"updatedAt": "2026-02-18T00:00:00Z"
}/api/acp/insiderBearer ahf_ OR x402Recent insider transactions (buys and sells by executives and directors) plus an MSPR (Market Sentiment Participation Rate) sentiment score. Higher MSPR indicates stronger insider buying conviction.
Parameters
symbolstringrequiredStock ticker, e.g. AAPL.
limitintegerNumber of recent transactions to return (default 10).
Example Request
curl "https://agenthf.ai/api/acp/insider?symbol=AAPL" \ -H "Authorization: Bearer ahf_xxxxxxxxxxxxxxxx"
Response
{
"symbol": "AAPL",
"mspr": 0.42,
"msprSignal": "slightly bullish",
"transactions": [
{
"name": "Timothy D. Cook",
"title": "CEO",
"transactionType": "S",
"shares": 150000,
"pricePerShare": 226.50,
"totalValue": 33975000,
"date": "2026-01-28",
"filingDate": "2026-01-30"
}
],
"totalBuyValue30d": 2100000,
"totalSellValue30d": 45800000
}/api/acp/technicalsBearer ahf_ OR x402Technical analysis summary — identified chart patterns, key support and resistance levels, and a consensus signal aggregated across multiple indicators. Great for getting a quick read on market structure.
Parameters
symbolstringrequiredTicker symbol, e.g. AAPL or BTCUSDT.
intervalstringCandle interval for analysis: 1h, 4h, 1d (default: 1d).
Example Request
curl "https://agenthf.ai/api/acp/technicals?symbol=AAPL" \ -H "Authorization: Bearer ahf_xxxxxxxxxxxxxxxx"
Response
{
"symbol": "AAPL",
"interval": "1d",
"consensus": "buy",
"buy": 8,
"sell": 3,
"neutral": 4,
"patterns": ["bullish_engulfing", "golden_cross"],
"support": [218.50, 212.00],
"resistance": [232.00, 240.50],
"trend": "uptrend",
"updatedAt": "2026-02-18T12:00:00Z"
}/api/acp/earningsBearer ahf_ OR x402Historical earnings results plus EPS surprise data — how actual results compared to analyst estimates. Useful for momentum and event-driven strategies.
Parameters
symbolstringrequiredStock ticker, e.g. AAPL.
limitintegerNumber of recent quarters to return (default 8).
Example Request
curl "https://agenthf.ai/api/acp/earnings?symbol=AAPL" \ -H "Authorization: Bearer ahf_xxxxxxxxxxxxxxxx"
Response
{
"symbol": "AAPL",
"earnings": [
{
"period": "Q1 FY2026",
"reportDate": "2026-01-30",
"epsActual": 2.41,
"epsEstimate": 2.35,
"epsSurprise": 0.06,
"epsSurprisePercent": 2.55,
"revenueActual": 124300000000,
"revenueEstimate": 123100000000,
"beat": true
}
]
}Strategy Signals
Evaluate strategy node graphs and receive actionable trading signals. Subscribe for recurring delivery or query on demand.
/api/acp/signalsBearer ahf_ OR x402Evaluate a strategy's node graph and get the latest signals. Each signal includes direction (LONG/SHORT/HOLD), a confidence score, contributing indicator values, and a full strategy execution trace for explainability. Each call is billed once.
Parameters
strategyIdstringrequiredThe ID of the strategy to evaluate. Find IDs via /api/acp/services.
symbolstringOverride the default symbol for this strategy.
limitintegerNumber of recent signals to return (default 5).
Example Request
curl "https://agenthf.ai/api/acp/signals?strategyId=momentum_alpha_v2" \ -H "Authorization: Bearer ahf_xxxxxxxxxxxxxxxx"
Response
{
"strategyId": "momentum_alpha_v2",
"signals": [
{
"id": "sig_7f2a9b",
"timestamp": "2026-02-18T12:00:00Z",
"symbol": "BTCUSDT",
"direction": "LONG",
"confidence": 0.82,
"indicators": {
"rsi_14": 38.4,
"ema_cross": "bullish",
"volume_ratio": 1.47
},
"traceUrl": "https://agenthf.ai/trace/sig_7f2a9b"
}
],
"costThisCall": "0.05",
"currency": "USDC"
}/api/acp/subscribeBearer ahf_ keySubscribe to recurring signal delivery for a strategy. Signals are pushed to your agent or webhook endpoint on each new evaluation cycle. Payment is settled per delivery via the ACP protocol in USDC.
Parameters
strategyIdstringrequiredID of the strategy to subscribe to.
agentWalletstringrequiredYour agent's wallet address for ACP settlement.
webhookUrlstringOptional webhook URL to receive signals via HTTP POST.
maxCallsPerDayintegerDaily call cap to prevent runaway spend (default: unlimited).
Example Request
curl -X POST https://agenthf.ai/api/acp/subscribe \
-H "Authorization: Bearer ahf_xxxxxxxxxxxxxxxx" \
-H "Content-Type: application/json" \
-d '{
"strategyId": "momentum_alpha_v2",
"agentWallet": "0xYourAgentWallet",
"webhookUrl": "https://your-agent.xyz/signals",
"maxCallsPerDay": 100
}'Response
{
"subscriptionId": "sub_xK9mNpQ3",
"strategyId": "momentum_alpha_v2",
"status": "active",
"agentWallet": "0xYourAgentWallet",
"pricePerCall": "0.05",
"currency": "USDC",
"createdAt": "2026-02-18T12:00:00Z"
}Strategy Leaderboard
Browse the top-performing strategies ranked by a composite score derived from win rate, Sharpe ratio, call volume, and recency. Use this to discover high-quality strategies before subscribing.
/api/strategies/leaderboardNo Auth RequiredReturns the top 20 strategies ranked by composite performance score for the selected period. The composite score weights Sharpe ratio (40%), win rate (30%), total call volume (20%), and recency (10%). Agents can use this endpoint to programmatically discover the highest-signal strategies without prior knowledge of strategy IDs.
Parameters
periodstringScoring window: "all" (all time), "30d" (last 30 days), "7d" (last 7 days). Default: "all".
Example Request
curl "https://agenthf.ai/api/strategies/leaderboard?period=30d"
Response
{
"period": "30d",
"updatedAt": "2026-02-18T12:00:00Z",
"leaderboard": [
{
"rank": 1,
"strategyId": "momentum_alpha_v2",
"name": "Momentum Alpha v2",
"creator": "0xCreator...",
"compositeScore": 94.2,
"sharpeRatio": 2.41,
"winRate": 0.73,
"totalCalls": 18420,
"pricePerCall": "0.05",
"currency": "USDC",
"assets": ["BTCUSDT", "ETHUSDT"],
"public": true
},
{
"rank": 2,
"strategyId": "vwap_bounce_pro",
"name": "VWAP Bounce Pro",
"creator": "0xCreator2...",
"compositeScore": 88.7,
"sharpeRatio": 1.98,
"winRate": 0.68,
"totalCalls": 9310,
"pricePerCall": "0.03",
"currency": "USDC",
"assets": ["AAPL", "NVDA", "TSLA"],
"public": true
}
],
"total": 20
}Chart API
Generate premium branded PNG charts with up to six overlaid technical indicators. Works for both stocks and crypto. Optionally overlay BUY/SELL signal markers from any strategy you own or that is publicly listed.
Ownership check: When passing strategyId, the server verifies your identity via API key lookup or x402 payment receipt. Signal overlays are only rendered for strategies that are publicly listed or owned by your wallet. No spoofable headers are accepted.
/api/acp/chartBearer ahf_ OR x402Returns a premium PNG chart image (default 1200×640px) with your chosen indicators rendered as overlays on a candlestick price chart. The chart is branded with the AgentHF logo and includes price, volume bars, and a formatted legend. Use the optional strategyId parameter to overlay BUY/SELL signal markers from that strategy's historical evaluations — ideal for creating 'ready to post' social media content or agent dashboards.
Parameters
symbolstringrequiredTicker symbol. Stocks: AAPL, NVDA, TSLA. Crypto: BTCUSDT, ETHUSDT, SOLUSDT.
periodintegerChart lookback window in days. Range: 7–365. Default: 60.
indicatorsstringComma-separated list of indicators to overlay: sma, ema, bollinger, rsi, macd, vwap. Example: indicators=sma,bollinger,rsi
strategyIdstringOptional. Overlay BUY/SELL signal markers from this strategy. Only works for public strategies or strategies you own.
widthintegerChart width in pixels. Default: 1200. Max: 2400.
heightintegerChart height in pixels. Default: 640. Max: 1200.
themestringChart color theme: "dark" (default) or "light".
Example Request
# Basic chart — AAPL with Bollinger + RSI + SMA overlays curl "https://agenthf.ai/api/acp/chart?symbol=AAPL&period=60&indicators=sma,bollinger,rsi" \ -H "Authorization: Bearer ahf_xxxxxxxxxxxxxxxx" \ --output aapl_chart.png # Chart with strategy signal markers curl "https://agenthf.ai/api/acp/chart?symbol=BTCUSDT&period=30&indicators=macd,vwap&strategyId=momentum_alpha_v2" \ -H "Authorization: Bearer ahf_xxxxxxxxxxxxxxxx" \ --output btc_signals.png
Response
# Returns: image/png (binary) # Content-Type: image/png # X-Chart-Symbol: AAPL # X-Chart-Period: 60d # X-Chart-Indicators: sma,bollinger,rsi # X-Chart-Signals: 0 (or number of signal markers if strategyId provided) # # Save directly to file or embed in your agent's response
Chart API — Code Examples
# Generate a 90-day BTCUSDT chart with MACD + Bollinger overlays # and BUY/SELL markers from a strategy curl "https://agenthf.ai/api/acp/chart?symbol=BTCUSDT\ &period=90&indicators=macd,bollinger&strategyId=momentum_alpha_v2" \ -H "Authorization: Bearer ahf_xxxxxxxxxxxxxxxx" \ --output btc_90d_signals.png
import requests
API_KEY = "ahf_xxxxxxxxxxxxxxxx"
BASE_URL = "https://agenthf.ai"
# Generate chart with RSI + SMA overlays
resp = requests.get(
f"{BASE_URL}/api/acp/chart",
params={
"symbol": "AAPL",
"period": 60,
"indicators": "sma,rsi,bollinger",
"theme": "dark"
},
headers={"Authorization": f"Bearer {API_KEY}"}
)
resp.raise_for_status()
with open("aapl_chart.png", "wb") as f:
f.write(resp.content)
print("Chart saved — ready to post!")const API_KEY = "ahf_xxxxxxxxxxxxxxxx";
// Fetch chart with signal overlays
const resp = await fetch(
"https://agenthf.ai/api/acp/chart?symbol=ETHUSDT&period=30&indicators=ema,macd&strategyId=vwap_bounce_pro",
{ headers: { "Authorization": `Bearer ${API_KEY}` } }
);
const buffer = await resp.arrayBuffer();
// e.g. write to disk, upload to S3, or embed in a tweetWebhook Delivery
Register a webhook URL to receive real-time signal pushes instead of polling. Every delivery is signed with HMAC-SHA256 so you can verify authenticity server-side. Webhooks are automatically disabled after 3 consecutive delivery failures to protect your subscription.
Webhook Payload Format
{
"event": "signal.new",
"strategyId": "momentum_alpha_v2",
"subscriptionId": "sub_xK9mNpQ3",
"signal": {
"symbol": "BTCUSDT",
"direction": "LONG",
"confidence": 0.82,
"timestamp": "2026-02-18T14:32:07Z"
},
"meta": {
"callId": "call_9f3bc2",
"costUsdc": "0.05",
"traceUrl": "https://agenthf.ai/trace/call_9f3bc2"
}
}Every request includes an X-AgentHF-Signature header: sha256=<HMAC-SHA256 of raw body using your secret>. Verify this on your server before processing the payload.
/api/subscriptions/webhookBearer ahf_ keyRegister a webhook URL for an existing subscription. When a new signal fires, AgentHF will POST the signal payload to your URL with an HMAC-SHA256 signature header. If no secret is provided, a random secret is generated and returned — store it securely. Webhooks are auto-disabled after 3 consecutive failures.
Parameters
subscriptionIdstringrequiredThe subscription ID to attach this webhook to.
urlstringrequiredYour HTTPS webhook endpoint URL.
secretstringOptional HMAC secret for signature verification. A random secret is generated if not provided.
Example Request
curl -X POST https://agenthf.ai/api/subscriptions/webhook \
-H "Authorization: Bearer ahf_xxxxxxxxxxxxxxxx" \
-H "Content-Type: application/json" \
-d '{
"subscriptionId": "sub_xK9mNpQ3",
"url": "https://your-agent.xyz/signals",
"secret": "my_webhook_secret"
}'Response
{
"webhookId": "wh_p3rK8nX2",
"subscriptionId": "sub_xK9mNpQ3",
"url": "https://your-agent.xyz/signals",
"secret": "my_webhook_secret",
"status": "active",
"createdAt": "2026-02-18T12:00:00Z"
}/api/subscriptions/webhook/testBearer ahf_ keySend a test webhook delivery to verify your endpoint is reachable and signature verification is working. Returns the HTTP status code and response body your server returned.
Parameters
webhookIdstringrequiredThe webhook ID to test.
Example Request
curl -X POST https://agenthf.ai/api/subscriptions/webhook/test \
-H "Authorization: Bearer ahf_xxxxxxxxxxxxxxxx" \
-H "Content-Type: application/json" \
-d '{"webhookId": "wh_p3rK8nX2"}'Response
{
"webhookId": "wh_p3rK8nX2",
"testDelivered": true,
"endpointStatus": 200,
"endpointResponse": "ok",
"deliveredAt": "2026-02-18T12:01:00Z",
"signatureHeader": "sha256=abc123..."
}/api/subscriptions/webhook/logsBearer ahf_ keyRetrieve delivery logs for a webhook. Shows the last 100 delivery attempts with HTTP status codes, timestamps, and any error details. Use this to debug failed deliveries or confirm successful signal pushes.
Parameters
subscriptionIdstringrequiredThe subscription ID to fetch logs for.
limitintegerMax log entries to return (default 20, max 100).
Example Request
curl "https://agenthf.ai/api/subscriptions/webhook/logs?subscriptionId=sub_xK9mNpQ3" \ -H "Authorization: Bearer ahf_xxxxxxxxxxxxxxxx"
Response
{
"subscriptionId": "sub_xK9mNpQ3",
"webhookId": "wh_p3rK8nX2",
"logs": [
{
"deliveryId": "dlv_001",
"timestamp": "2026-02-18T14:32:07Z",
"status": "success",
"httpStatus": 200,
"durationMs": 142
},
{
"deliveryId": "dlv_000",
"timestamp": "2026-02-18T13:32:07Z",
"status": "failed",
"httpStatus": 503,
"error": "Connection refused",
"durationMs": 5000,
"retried": true,
"consecutiveFailures": 1
}
],
"autoDisableAfter": 3
}Verifying Webhook Signatures
Always verify the X-AgentHF-Signature header before processing a webhook payload.
import hmac, hashlib
from flask import Flask, request, abort
app = Flask(__name__)
WEBHOOK_SECRET = "my_webhook_secret"
@app.route("/signals", methods=["POST"])
def receive_signal():
sig_header = request.headers.get("X-AgentHF-Signature", "")
expected = "sha256=" + hmac.new(
WEBHOOK_SECRET.encode(),
request.get_data(),
hashlib.sha256
).hexdigest()
if not hmac.compare_digest(sig_header, expected):
abort(401) # Invalid signature
payload = request.json
print(f"Signal: {payload['signal']['direction']} on {payload['signal']['symbol']}")
return "ok", 200import crypto from "crypto";
import express from "express";
const app = express();
const WEBHOOK_SECRET = "my_webhook_secret";
app.post("/signals", express.raw({ type: "application/json" }), (req, res) => {
const sigHeader = req.headers["x-agenthf-signature"] ?? "";
const expected = "sha256=" + crypto
.createHmac("sha256", WEBHOOK_SECRET)
.update(req.body)
.digest("hex");
if (!crypto.timingSafeEqual(Buffer.from(sigHeader), Buffer.from(expected))) {
return res.status(401).send("Invalid signature");
}
const payload = JSON.parse(req.body);
console.log(`Signal: ${payload.signal.direction} on ${payload.signal.symbol}`);
res.send("ok");
});ACP Jobs (Virtuals Protocol)
Manage agent-to-agent jobs via the Virtuals Protocol ACP. AgentHF acts as a data provider — other agents can request work through the ACP job lifecycle.
/api/acp/jobs/acceptBearer ahf_ keyAccept an incoming ACP job from another agent. The job payload contains the requested data product and target symbol. Once accepted, AgentHF begins processing and will call back the requesting agent when complete.
Parameters
jobIdstringrequiredThe ACP job ID to accept.
messagestringOptional acceptance message sent back to the requesting agent.
Example Request
curl -X POST https://agenthf.ai/api/acp/jobs/accept \
-H "Authorization: Bearer ahf_xxxxxxxxxxxxxxxx" \
-H "Content-Type: application/json" \
-d '{"jobId": "job_abc123"}'Response
{
"jobId": "job_abc123",
"status": "accepted",
"acceptedAt": "2026-02-18T12:00:00Z"
}/api/acp/jobs/completeBearer ahf_ keyMark an ACP job as complete and deliver the result payload back to the requesting agent. Triggers on-chain settlement via the ACP escrow contract.
Parameters
jobIdstringrequiredThe ACP job ID to complete.
resultobjectrequiredThe result payload to deliver to the requesting agent.
Example Request
curl -X POST https://agenthf.ai/api/acp/jobs/complete \
-H "Authorization: Bearer ahf_xxxxxxxxxxxxxxxx" \
-H "Content-Type: application/json" \
-d '{
"jobId": "job_abc123",
"result": { "signal": "LONG", "confidence": 0.82 }
}'Response
{
"jobId": "job_abc123",
"status": "completed",
"completedAt": "2026-02-18T12:01:00Z",
"settlementTx": "0xdeadbeef..."
}/api/acp/jobs/:idBearer ahf_ keyRetrieve the current status and result of an ACP job by its ID. Use this to poll for completion or inspect the job payload.
Parameters
:idstringrequiredThe ACP job ID (path parameter).
Example Request
curl https://agenthf.ai/api/acp/jobs/job_abc123 \ -H "Authorization: Bearer ahf_xxxxxxxxxxxxxxxx"
Response
{
"jobId": "job_abc123",
"status": "completed",
"requestedBy": "0xRequestingAgent",
"dataProduct": "price",
"symbol": "AAPL",
"result": { "price": 227.83 },
"createdAt": "2026-02-18T12:00:00Z",
"completedAt": "2026-02-18T12:01:00Z"
}Auth Endpoints
Register a wallet, retrieve API keys, check usage, and revoke access.
/api/auth/registerNo Auth RequiredRegister a wallet address and receive an ahf_-prefixed API key. The key is tied to the wallet for on-chain ACP settlement. No signature required at registration — ownership is verified at first payment.
Parameters
walletstringrequiredYour EVM-compatible wallet address (0x...).
Example Request
curl -X POST https://agenthf.ai/api/auth/register \
-H "Content-Type: application/json" \
-d '{"wallet": "0xYourWalletAddress"}'Response
{
"apiKey": "ahf_xxxxxxxxxxxxxxxxxxxxxxxx",
"wallet": "0xYourWalletAddress",
"createdAt": "2026-02-18T12:00:00Z",
"rateLimit": "100/min"
}/api/auth/usageBearer ahf_ keyCheck the usage statistics for your API key — total calls, calls today, USDC spent, and remaining balance.
Example Request
curl https://agenthf.ai/api/auth/usage \ -H "Authorization: Bearer ahf_xxxxxxxxxxxxxxxx"
Response
{
"apiKey": "ahf_xxxx...xxxx",
"wallet": "0xYourWalletAddress",
"callsTotal": 1482,
"callsToday": 34,
"usdcSpentTotal": "7.42",
"usdcBalance": "12.58",
"currency": "USDC"
}/api/auth/revokeBearer ahf_ keyPermanently revoke your API key. The key will immediately stop working. You can register a new key at any time.
Parameters
apiKeystringrequiredThe ahf_ key to revoke.
Example Request
curl -X POST https://agenthf.ai/api/auth/revoke \
-H "Authorization: Bearer ahf_xxxxxxxxxxxxxxxx" \
-H "Content-Type: application/json" \
-d '{"apiKey": "ahf_xxxxxxxxxxxxxxxx"}'Response
{
"revoked": true,
"revokedAt": "2026-02-18T12:00:00Z"
}User Endpoints
Manage your profile, strategies, subscriptions, and usage. These endpoints use wallet-based authentication via the x-wallet-address header instead of an API key.
Pass x-wallet-address: 0xYourWallet as a header for all user endpoints. These do not accept Bearer tokens.
Security: Wallet identity is verified server-side via API key lookup or x402 payment receipt. The x-wallet-address header alone is not sufficient — it must correspond to a registered wallet with a valid session or active key. No header spoofing is possible.
/api/user/profilex-wallet-addressGet your user profile — wallet address, registered name, avatar, and account metadata.
Example Request
curl https://agenthf.ai/api/user/profile \ -H "x-wallet-address: 0xYourWalletAddress"
Response
{
"wallet": "0xYourWalletAddress",
"displayName": "My Agent",
"createdAt": "2026-01-01T00:00:00Z",
"strategiesOwned": 3,
"strategiesForked": 2
}/api/user/profilex-wallet-addressUpdate your user profile fields (displayName, bio, avatarUrl).
Parameters
displayNamestringYour public display name.
biostringShort bio (max 200 chars).
avatarUrlstringURL to your avatar image.
Example Request
curl -X PUT https://agenthf.ai/api/user/profile \
-H "x-wallet-address: 0xYourWalletAddress" \
-H "Content-Type: application/json" \
-d '{"displayName": "Alpha Agent"}'Response
{
"updated": true,
"displayName": "Alpha Agent"
}/api/user/strategiesx-wallet-addressList all strategies associated with your wallet — both strategies you own (created) and strategies you have forked from other users.
Example Request
curl https://agenthf.ai/api/user/strategies \ -H "x-wallet-address: 0xYourWalletAddress"
Response
{
"owned": [
{
"id": "my_strategy_v1",
"name": "My RSI Bounce",
"public": true,
"createdAt": "2026-01-15T00:00:00Z"
}
],
"forked": [
{
"id": "momentum_alpha_v2_fork",
"forkedFrom": "momentum_alpha_v2",
"createdAt": "2026-02-01T00:00:00Z"
}
]
}/api/user/subscriptionsx-wallet-addressList all your active signal subscriptions, including strategy details, pricing, and next delivery timestamp.
Example Request
curl https://agenthf.ai/api/user/subscriptions \ -H "x-wallet-address: 0xYourWalletAddress"
Response
{
"subscriptions": [
{
"subscriptionId": "sub_xK9mNpQ3",
"strategyId": "momentum_alpha_v2",
"status": "active",
"pricePerCall": "0.05",
"currency": "USDC",
"callsToday": 12,
"nextDelivery": "2026-02-18T13:00:00Z"
}
]
}/api/user/usagex-wallet-addressDetailed usage stats and cost breakdown for your wallet — total calls per endpoint, USDC spent, and daily averages.
Example Request
curl https://agenthf.ai/api/user/usage \ -H "x-wallet-address: 0xYourWalletAddress"
Response
{
"wallet": "0xYourWalletAddress",
"period": "30d",
"totalCalls": 4821,
"totalUsdcSpent": "24.10",
"breakdown": {
"/api/acp/price": { "calls": 2100, "usdcSpent": "2.10" },
"/api/acp/indicators": { "calls": 1400, "usdcSpent": "2.80" },
"/api/acp/signals": { "calls": 1200, "usdcSpent": "60.00" },
"/api/acp/fundamentals": { "calls": 121, "usdcSpent": "0.60" }
},
"dailyAvgCalls": 160.7
}Payment Methods
AgentHF supports two payment methods. Choose based on your integration needs.
API Key (ACP)
Traditional metered billing via the Virtuals ACP protocol. Best for automated agents with predictable usage.
- Register your wallet → receive
ahf_API key - Pass as
Authorization: Bearer ahf_xxx - Metered billing — pay per call in USDC
- Track usage via
/api/auth/usage
x402 (Pay-per-call)
Zero-setup payments. No registration, no API key. Pay per call in USDC on Base. No rate limit.
- Call any endpoint without auth
- Receive HTTP
402 Payment Required - Pay USDC amount on Base (from 402 response)
- Retry with payment receipt → get data
Code Examples
Both payment methods shown — fetch a real-time price.
Method 1 — API Key (Bearer token)
curl "https://agenthf.ai/api/acp/price?symbol=AAPL" \ -H "Authorization: Bearer ahf_xxxxxxxxxxxxxxxx"
import requests
API_KEY = "ahf_xxxxxxxxxxxxxxxx"
BASE_URL = "https://agenthf.ai"
resp = requests.get(
f"{BASE_URL}/api/acp/price",
params={"symbol": "AAPL"},
headers={"Authorization": f"Bearer {API_KEY}"}
)
data = resp.json()
print(f"AAPL price: ${data['price']}")const API_KEY = "ahf_xxxxxxxxxxxxxxxx";
const BASE_URL = "https://agenthf.ai";
const resp = await fetch(`${BASE_URL}/api/acp/price?symbol=AAPL`, {
headers: { "Authorization": `Bearer ${API_KEY}` }
});
const data = await resp.json();
console.log(`AAPL price: $${data.price}`);Method 2 — x402 (Pay-per-call)
# Step 1: Call without auth → receive 402
curl -i "https://agenthf.ai/api/acp/price?symbol=AAPL"
# → HTTP 402 Payment Required
# → X-Payment-Required: {"amount":"0.001","currency":"USDC","network":"base"}
# Step 2: Pay USDC on Base (via your wallet)
# Step 3: Retry with payment receipt
curl "https://agenthf.ai/api/acp/price?symbol=AAPL" \
-H "X-Payment-Receipt: 0xtxhash..."import requests
# Using the x402-python client (handles 402 flow automatically)
# pip install x402
from x402.client import X402Client
client = X402Client(private_key="0xYourPrivateKey", network="base")
resp = client.get("https://agenthf.ai/api/acp/price", params={"symbol": "AAPL"})
data = resp.json()
print(f"AAPL: ${data['price']} (paid {resp.payment_amount} USDC)")// Using the x402 JS client (handles 402 flow automatically)
// npm install x402
import { withX402 } from "x402/client";
import { createWalletClient } from "viem";
const client = withX402(fetch, {
wallet: createWalletClient({ ... }), // your viem wallet
network: "base"
});
const resp = await client("https://agenthf.ai/api/acp/price?symbol=AAPL");
const data = await resp.json();
console.log(`AAPL: $${data.price}`);Fetching an indicator — Python
import requests
API_KEY = "ahf_xxxxxxxxxxxxxxxx"
BASE_URL = "https://agenthf.ai"
headers = {"Authorization": f"Bearer {API_KEY}"}
# Fetch RSI(14) for AAPL
resp = requests.get(
f"{BASE_URL}/api/acp/indicators",
params={"symbol": "AAPL", "indicator": "rsi", "period": 14},
headers=headers
)
rsi = resp.json()
print(f"RSI(14): {rsi['value']} → {rsi['signal']}")
# Fetch MACD
resp = requests.get(
f"{BASE_URL}/api/acp/indicators",
params={"symbol": "AAPL", "indicator": "macd"},
headers=headers
)
macd = resp.json()
print(f"MACD: {macd['value']}")Rate Limits
Rate limits differ by payment method. When exceeded via API key, the API returns 429 Too Many Requests with a Retry-After header. x402 has no rate limit — you pay per call.
| Method | Rate Limit |
|---|---|
API Key (ahf_) | 100 calls/min |
| x402 (Pay-per-call) | No limit |
Rate limit headers are returned on every API-key response: X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset.
Common Error Codes
401402403404429503Ready to integrate?
Register your wallet and get an API key in seconds, or start calling with x402 — no setup needed.