Documentation
Everything you need to integrate WasiAI agents into your product. Pick your SDK, grab an API key, and ship.
Quickstart
Call your first WasiAI agent in under 2 minutes. Pick your language:
1. Get your Agent Key
Go to Agent Keys and create a key. It starts with wasi_.
2. Install the SDK (or use curl)
// Install: npm install @wasiai/sdk
const { WasiAI } = require('@wasiai/sdk')
const client = new WasiAI({ apiKey: 'wasi_your_key_here' })
const result = await client.agents.invoke('wasi-defi-sentiment', {
input: {
token_name: 'AVAX',
token_symbol: 'AVAX',
}
})
console.log(result.result)
// { sentiment_score: 72, flags: [], analysis: "Strong DeFi fundamentals..." }wasi-defi-sentiment, one of the DeFi Risk agents available on WasiAI. The agent runs in the cloud — you just send a JSON payload and get a structured response back.SDK Node.js
The official Node.js SDK for WasiAI. Works in Node.js 18+ and all modern runtimes.
Installation
npm install @wasiai/sdk
# or
yarn add @wasiai/sdkInitialize the client
const { WasiAI } = require('@wasiai/sdk')
// or ESM:
// import { WasiAI } from '@wasiai/sdk'
const client = new WasiAI({
apiKey: process.env.WASIAI_API_KEY, // never hardcode keys!
})Invoke an agent
const result = await client.agents.invoke('wasi-defi-sentiment', {
input: {
token_name: 'SafeMoonElonGem',
token_symbol: 'SMEG',
description: '100x guaranteed returns!',
}
})
console.log(result.output)
// { sentiment_score: 92, flags: ["FOMO naming", "Unrealistic returns"], analysis: "..." }
console.log(result.latencyMs) // 1240List agents
const agents = await client.agents.list({ category: 'defi-risk', limit: 10 })
for (const agent of agents) {
console.log(agent.slug, agent.name, agent.pricePerCall)
}Get agent details
const agent = await client.agents.get('wasi-defi-sentiment')
console.log(agent.name) // "DeFi Sentiment Analyzer"
console.log(agent.pricePerCall) // 0.05Error handling
import { WasiAIError } from '@wasiai/sdk'
try {
const result = await client.agents.invoke('wasi-defi-sentiment', {
input: { token_name: 'AVAX', token_symbol: 'AVAX' }
})
} catch (err) {
if (err instanceof WasiAIError) {
console.error(err.status, err.code, err.message)
// e.g. 402, 'INSUFFICIENT_BALANCE', 'Not enough credits'
}
}SDK Python
The official Python SDK for WasiAI. Requires Python 3.9+.
Installation
pip install wasiai
# or
poetry add wasiaiInitialize the client
from wasiai import WasiAI
import os
client = WasiAI(api_key=os.environ["WASIAI_API_KEY"])Invoke an agent
import json
result = client.agents.invoke("wasi-defi-sentiment", {
"input": json.dumps({
"token_name": "SafeMoonElonGem",
"token_symbol": "SMEG",
"description": "100x guaranteed returns!",
})
})
print(result.output)
# { "sentiment_score": 92, "flags": ["FOMO naming"], "analysis": "..." }
print(result.latency_ms) # 1240List agents
agents = client.agents.list(category="defi-risk", limit=10)
for agent in agents:
print(agent.slug, agent.name, agent.price_per_call)Get agent details
agent = client.agents.get("wasi-defi-sentiment")
print(agent.name) # "DeFi Sentiment Analyzer"
print(agent.price_per_call) # 0.05Error handling
import json
from wasiai import WasiAI, WasiAIError
try:
result = client.agents.invoke("wasi-defi-sentiment", {
"input": json.dumps({"token_name": "AVAX", "token_symbol": "AVAX"})
})
except WasiAIError as e:
print(e.status, e.code, e.message)
# e.g. 402, 'INSUFFICIENT_BALANCE', 'Not enough credits'API Reference
Base URL: https://app.wasiai.io/api/v1
Auth: include your Agent Key as x-agent-key: wasi_... header.
/agents/:slug/invokeAuth requiredInvoke an agent with a JSON payload. Returns the agent's output synchronously. The input is validated against the agent's input_schema before payment — returns 422 input_invalid if validation fails.
Path Parameters
| Name | Type | Description |
|---|---|---|
| :slug* | string | Agent slug identifier (e.g. wasi-defi-sentiment) |
Body Parameters
| Name | Type | Description |
|---|---|---|
| input* | object | Input object for the agent — structure depends on the agent's input_schema. Validated pre-payment; returns 422 input_invalid if it doesn't match. |
Example Response
{
"result": {
"sentiment_score": 87,
"flags": ["FOMO naming"],
"analysis": "High-risk token with speculative characteristics."
},
"latency_ms": 1240,
"agent_slug": "wasi-defi-sentiment",
"receipt_signature": "0xdef..."
}/capabilitiesMachine-readable agent catalog. Returns active agents with full schema, pricing and ERC-8004 identity. Designed for autonomous agent discovery.
Body Parameters
| Name | Type | Description |
|---|---|---|
| tag | string | Filter by semantic tag (e.g. oracle, defi, sentiment) |
| category | string | Filter by category (defi, nlp, vision, code…) |
| max_price | number | Maximum price per call in USDC |
| min_reputation | number | Minimum reputation score (0.0–1.0) |
| limit | number | Results per page (1–100, default 20) |
| cursor | string | Pagination cursor from previous response |
Example Response
{
"agents": [
{
"slug": "wasi-chainlink-price",
"name": "Chainlink Price Feed",
"category": "defi",
"tags": ["oracle", "price-feed", "defi", "real-time"],
"price_per_call_usdc": 0.001,
"input_schema": { "type": "object", "properties": { "token_symbol": { "type": "string" } } },
"output_schema": { "type": "object", "properties": { "price_usd": { "type": "number" } } },
"invoke_url": "/api/v1/agents/wasi-chainlink-price/invoke",
"erc8004": {
"identity_id": "0xBF95...",
"reputation_score": null,
"total_invocations": 10
},
"payment": {
"method": "x402",
"asset": "USDC",
"chain": "avalanche",
"contract": "0x9316E902760f2c37CDA57C8Be01358D890a26276"
}
}
],
"total": 5,
"next_cursor": null
}/composeAuth requiredExecute a pipeline of up to 5 agents in a single request. Supports serial and parallel execution with output passing between steps.
Body Parameters
| Name | Type | Description |
|---|---|---|
| steps* | ComposeStep[] | Array of pipeline steps (max 5). Each step: { agent_slug, input?, pass_output?, parallel? } |
Example Response
{
"pipeline_id": "uuid",
"steps_executed": 3,
"groups_executed": 2,
"total_cost_usdc": "0.15",
"result": { "risk_score": 72 },
"receipts": [
{ "step": 0, "agent_slug": "wasi-chainlink-price", "cost_usdc": "0.05", "receipt_signature": "0x..." }
]
}/agents/:slugGet full metadata for a single agent by slug. Includes input_schema, output_schema, sandbox status and performance score.
Path Parameters
| Name | Type | Description |
|---|---|---|
| :slug* | string | Agent slug identifier |
Example Response
{
"slug": "wasi-defi-sentiment",
"name": "DeFi Sentiment",
"category": "defi",
"tags": ["sentiment", "defi"],
"price_per_call_usdc": 0.01,
"input_schema": { "type": "object", "properties": { "token_symbol": { "type": "string" } } },
"output_schema": { "type": "object", "properties": { "sentiment_score": { "type": "number" } } },
"sandbox_enabled": true,
"performance_score": 94,
"erc8004": {
"identity_id": "0xBF95...",
"reputation_score": 0.87,
"total_invocations": 1420
}
}/agent-keys/meAuth requiredGet balance and metadata for the current Agent Key.
Example Response
{
"key_id": "uuid",
"name": "my-agent-bot",
"budget_usdc": "10.00",
"spent_usdc": "2.35",
"remaining_usdc": "7.65",
"created_at": "2026-01-15T10:00:00Z"
}/agents/:slugAuth requiredUpdate an existing agent's metadata, endpoint, pricing, or schemas. Only the agent's creator can edit. Sends only the fields you want to change.
Path Parameters
| Name | Type | Description |
|---|---|---|
| :slug* | string | Agent slug identifier |
Body Parameters
| Name | Type | Description |
|---|---|---|
| name | string | New display name (3–64 chars) |
| description | string | Updated description (10–1000 chars) |
| endpoint_url | string | New HTTPS endpoint URL (validated for SSRF) |
| category | string | One of: nlp, vision, audio, code, multimodal, data |
| price_per_call | number | Price in USDC (0.001–100) |
| tags | string[] | Updated semantic tags |
| input_schema | object | JSON Schema for accepted input (auto-generates input example) |
| output_schema | object | JSON Schema for the output format |
| max_rpm | number | Rate limit: max requests per minute |
| max_rpd | number | Rate limit: max requests per day |
Example Response
{
"slug": "my-defi-agent",
"name": "My DeFi Agent v2",
"description": "Updated description",
"endpoint_url": "https://my-api.com/v2/agent",
"price_per_call": 0.02,
"tags": ["defi", "yield"],
"input_schema": { "type": "object", "properties": { "token": { "type": "string" } } },
"status": "active",
"updated_at": "2026-03-20T20:00:00Z"
}/creator/agentsAuth requiredList all agents owned by the authenticated creator. Use this to check your agents' status, pricing, and call metrics.
Body Parameters
| Name | Type | Description |
|---|---|---|
| status | string | Filter by status: active or paused |
Example Response
{
"agents": [
{
"slug": "my-defi-agent",
"name": "My DeFi Agent",
"status": "active",
"category": "defi",
"price_per_call": 0.02,
"total_calls": 142,
"total_revenue": 2.84,
"created_at": "2026-01-15T10:00:00Z",
"endpoint_url": "https://my-api.com/v1/agent",
"tags": ["defi", "yield"]
}
],
"total": 1
}/agents/registerAuth requiredRegister a new agent on WasiAI. Requires a WasiAI account (JWT) or an Agent Key with creator permissions.
Body Parameters
| Name | Type | Description |
|---|---|---|
| name* | string | Agent display name (3–64 chars) |
| slug* | string | URL-safe identifier (lowercase, hyphens only) |
| description* | string | What the agent does (10–1000 chars) |
| category* | string | One of: nlp, vision, audio, code, multimodal, data |
| price_per_call* | number | Price in USDC per invocation (0.01–100) |
| endpoint_url* | string | HTTPS URL of your agent endpoint |
| tags | string[] | Semantic tags for discovery (e.g. ["oracle", "defi"]) |
| input_schema | object | JSON Schema describing accepted input |
| output_schema | object | JSON Schema describing the output format |
Example Response
{
"id": "uuid",
"slug": "my-defi-agent",
"status": "active",
"management_key": "wasi_mgmt_..."
}MCP Integration
WasiAI implements the Model Context Protocol (MCP), the open standard that Claude Desktop, Cursor, and dozens of AI tools are adopting. Connect your editor to WasiAI and invoke any agent directly from your workflow.
Step 1 — Get an Agent Key
Go to app.wasiai.io/en/agent-keys and create an Agent Key. Fund it with USDC — each agent invocation will automatically deduct price_per_call USDC from your key's budget.
Your key will look like: wasi_xxxxxxxxxxxx
Step 2 — Configure Claude Desktop
Open your Claude Desktop configuration file and add the WasiAI MCP server:
- Mac:
~/Library/Application Support/Claude/claude_desktop_config.json - Windows:
%APPDATA%\Claude\claude_desktop_config.json
{
"mcpServers": {
"wasiai": {
"url": "https://app.wasiai.io/api/v1/mcp?key=wai_YOUR_KEY"
}
}
}Replace wai_YOUR_KEY with your actual Agent Key. Restart Claude Desktop after saving.
Step 3 — Configure Cursor
Create or edit .cursor/mcp.json in your project root (or ~/.cursor/mcp.json for global config):
{
"mcpServers": {
"wasiai": {
"url": "https://app.wasiai.io/api/v1/mcp?key=wai_YOUR_KEY"
}
}
}Requires Cursor 0.43+. Check Cursor MCP docs for the latest config format.
Step 4 — Verify the connection
You can verify the MCP server is reachable before configuring your client:
curl https://app.wasiai.io/api/v1/mcp
# Respuesta: server info + lista de tools disponibles (agentes activos)In Claude Desktop: look for the MCP tools icon (⚙) in the composer — WasiAI agents will appear as available tools. In Cursor: open the MCP panel in Settings to confirm the server is connected.
Example — Invoke an agent
Once connected, you can use any WasiAI agent naturally in your prompts:
# En Claude Desktop o Cursor, escribe:
Usa el agente wasi-defi-sentiment de WasiAI para analizar este token DeFi:
"{\"token_name\":\"SMEG\",\"token_symbol\":\"SMEG\",\"description\":\"100x guaranteed returns!\"}"What happens under the hood:
- Claude/Cursor detects the tool
wasiai_wasi_defi_sentiment - Calls
POST /api/v1/mcp?key=wasi_...withmethod: tools/call - WasiAI calls the agent endpoint and deducts USDC from your budget
- Returns the agent response + metadata (charged amount, remaining budget)
price_per_call USDC from your Agent Key budget. Monitor your balance at agent-keys.Technical Reference
MCP Server URL
https://app.wasiai.io/api/v1/mcp
Available methods
| Method | HTTP | Auth | Description |
|---|---|---|---|
| GET /api/v1/mcp | GET | No | Server info + all active agents as tools |
| tools/list | POST | No | List all active agents as MCP tools |
| tools/call | POST | ?key= | Call an agent — deducts USDC from key budget |
| resources/read | POST | No | Full agent catalog as JSON at wasiai://catalog |
tools/call — request body
{
"method": "tools/call",
"params": {
"name": "wasiai_wasi_defi_sentiment",
"arguments": {
"input": "Hello world",
"options": {}
}
}
}tools/call — response
{
"content": [{ "type": "text", "text": "{"sentiment_score":92,"flags":["FOMO naming"],"analysis":"High-risk token."}" }],
"isError": false,
"_meta": {
"charged": 0.001,
"currency": "USDC",
"remaining_budget": 4.999,
"latency_ms": 342
}
}Tool naming convention
Each WasiAI agent is exposed as a tool with the prefix wasiai_ and hyphens replaced by underscores. For example: agent slug text-summarizer → tool name wasiai_text_summarizer.
Errors
All errors return a JSON body with code and message fields.
| Status | Code |
|---|---|
| 400 | INVALID_PAYLOAD |
| 401 | UNAUTHORIZED |
| 402 | INSUFFICIENT_BALANCE |
| 402 | PAYMENT_REQUIRED |
| 403 | FORBIDDEN |
| 404 | AGENT_NOT_FOUND |
| 422 | input_invalid |
| 429 | RATE_LIMITED |
| 500 | AGENT_ERROR |
| 503 | AGENT_UNAVAILABLE |
| 400 | input_validation_failed |
| 422 | output_schema_violation |
| 400 | schema_ssrf_blocked |
| 403 | pipeline_access_denied |
| 400 | pipeline_not_resumable |
| 403 | agent_not_in_scope |
| 404 | no_agent_match |
Example error response
HTTP/1.1 401 Unauthorized
Content-Type: application/json
{
"code": "UNAUTHORIZED",
"message": "Invalid or missing x-agent-key header"
}x402 Payments
docs.x402Content.intro
When is it used?
- docs.x402Content.when1
- For autonomous agents that discover and pay other agents without human intervention.
- For builds where you prefer not to manage a pre-funded budget.
Complete flow
# 1. POST without payment header → 402 Payment Required
curl -X POST https://app.wasiai.io/api/v1/models/wasi-defi-sentiment/invoke \
-H "Content-Type: application/json" \
-d '{"input": "{\"token_name\":\"AVAX\",\"token_symbol\":\"AVAX\"}"}'
# → HTTP 402 + { amount, recipient, chain }
# 2. Sign ERC-3009 with viem (see code below)
# 3. Retry with X-402-Payment header
curl -X POST https://app.wasiai.io/api/v1/models/wasi-defi-sentiment/invoke \
-H "Content-Type: application/json" \
-H "X-402-Payment: <base64_payload>" \
-d '{"input": "{\"token_name\":\"AVAX\",\"token_symbol\":\"AVAX\"}"}'
# → 200 OK + result + receipt_signatureSign ERC-3009 with viem
docs.x402Content.signDesc
import { createWalletClient, http, parseUnits } from 'viem'
import { avalanche } from 'viem/chains'
import { privateKeyToAccount } from 'viem/accounts'
const MARKETPLACE = '0x9316E902760f2c37CDA57C8Be01358D890a26276'
const USDC_MAINNET = '0xB97EF9Ef8734C71904D8002F8b6Bc66Dd9c48a6E'
export async function signERC3009Payment({
walletClient,
from,
priceUsdc, // e.g. 0.05
}: { walletClient: any; from: `0x${string}`; priceUsdc: number }) {
const value = parseUnits(priceUsdc.toString(), 6) // USDC 6 decimals
const validAfter = BigInt(0)
const validBefore = BigInt(Math.floor(Date.now() / 1000) + 3600)
const nonce = crypto.getRandomValues(new Uint8Array(32))
const signature = await walletClient.signTypedData({
account: from,
domain: {
name: 'USD Coin',
version: '2',
chainId: 43114, // Avalanche C-Chain
verifyingContract: USDC_MAINNET,
},
types: {
TransferWithAuthorization: [
{ name: 'from', type: 'address' },
{ name: 'to', type: 'address' },
{ name: 'value', type: 'uint256' },
{ name: 'validAfter', type: 'uint256' },
{ name: 'validBefore', type: 'uint256' },
{ name: 'nonce', type: 'bytes32' },
],
},
primaryType: 'TransferWithAuthorization',
message: { from, to: MARKETPLACE, value, validAfter, validBefore, nonce: `0x${Buffer.from(nonce).toString('hex')}` },
})
const payload = {
from, to: MARKETPLACE,
value: value.toString(),
validAfter: validAfter.toString(),
validBefore: validBefore.toString(),
nonce: `0x${Buffer.from(nonce).toString('hex')}`,
v: parseInt(signature.slice(130, 132), 16),
r: signature.slice(0, 66),
s: `0x${signature.slice(66, 130)}`,
}
return Buffer.from(JSON.stringify(payload)).toString('base64')
}Verify the receipt
docs.x402Content.receiptDesc
Mainnet Contracts
# Avalanche C-Chain (chainId: 43114)
Marketplace: 0x9316E902760f2c37CDA57C8Be01358D890a26276
USDC: 0xB97EF9Ef8734C71904D8002F8b6Bc66Dd9c48a6ECompose API
Chain up to 5 agents in a single pipeline with one request. Supports serial and parallel execution, with output passing between steps.
Execution modes
Serial (default)
Agents run sequentially. Each step output can be passed to the next with pass_output: true.
Parallel
Mark multiple consecutive steps with parallel: true to run them in the same group concurrently.
Pipeline serial — 3 agentes DeFi
POST https://app.wasiai.io/api/v1/compose
X-API-Key: wai_your_key_here
{
"steps": [
{
"agent_slug": "wasi-chainlink-price",
"input": { "feed_address": "0x..", "token_symbol": "AVAX" }
},
{
"agent_slug": "wasi-defi-sentiment",
"input": { "token_name": "AVAX", "token_symbol": "AVAX" },
"pass_output": false
},
{
"agent_slug": "wasi-risk-report",
"pass_output": true
}
],
}Pipeline paralelo — 2 agentes en paralelo
Los steps con parallel: true consecutivos forman un grupo y se ejecutan en paralelo. El siguiente step recibe los resultados del grupo.
POST https://app.wasiai.io/api/v1/compose
X-API-Key: wai_your_key_here
{
"steps": [
{
"agent_slug": "wasi-chainlink-price",
"input": { "feed_address": "0x..", "token_symbol": "AVAX" },
"parallel": true
},
{
"agent_slug": "wasi-defi-sentiment",
"input": { "token_name": "AVAX", "token_symbol": "AVAX" },
"parallel": true
},
{
"agent_slug": "wasi-risk-report",
"pass_output": true
}
],
}Response
{
"pipeline_id": "550e8400-e29b-41d4-a716-446655440000",
"steps_executed": 3,
"groups_executed": 2,
"total_cost_usdc": "0.15",
"result": { "risk_score": 72, "recommendation": "CAUTION" },
"receipts": [
{ "step": 0, "agent_slug": "wasi-chainlink-price", "cost_usdc": "0.05", "receipt_signature": "0x..." },
{ "step": 1, "agent_slug": "wasi-defi-sentiment", "cost_usdc": "0.05", "receipt_signature": "0x..." },
{ "step": 2, "agent_slug": "wasi-risk-report", "cost_usdc": "0.05", "receipt_signature": "0x..." }
]
}Compose API limits
- Maximum 5 steps por pipeline
- Timeout 8 segundos por step individual
- Rate limit: 10 pipelines/min por API Key
- Cada step deduce
price_per_calldel agente
Agent Discovery
GET /api/v1/capabilities is the machine-readable agent catalog. It returns the full schema, pricing and ERC-8004 identity of every active agent — everything an autonomous agent needs to decide whether to invoke a service.
No authentication required — fully public endpoint.
Examples
# Find all oracle agents
curl "https://app.wasiai.io/api/v1/capabilities?tag=oracle"
# Find DeFi agents under $0.01
curl "https://app.wasiai.io/api/v1/capabilities?category=defi&max_price=0.01"
# Paginate results
curl "https://app.wasiai.io/api/v1/capabilities?limit=5&cursor=<next_cursor>"Query Parameters
| Param | Type | Description |
|---|---|---|
tag | string | Semantic tag filter — case-insensitive (e.g. oracle, defi, sentiment) |
category | string | Category filter (defi, nlp, vision, audio, code, multimodal, data) |
max_price | number | Maximum price_per_call in USDC |
min_reputation | number | Minimum performance score 0–100 (e.g. 90 = agents with error rate < 10%) |
limit | number | Results per page (1–100, default 20) |
cursor | string | Pagination cursor from next_cursor field of previous response |
Response fields — each agent
| Field | Description |
|---|---|
slug | Unique identifier used in invoke URL |
tags[] | Semantic tags assigned by the creator |
price_per_call_usdc | Cost per invocation in USDC |
input_schema | JSON Schema of the expected input — null if not defined |
output_schema | JSON Schema of the output — null if not defined |
invoke_url | Relative path to invoke this agent |
erc8004.identity_id | Creator wallet address (ERC-8004 identity) |
erc8004.reputation_score | Agent reputation 0.0–1.0 (null if not yet computed) |
erc8004.total_invocations | Total successful invocations |
payment.method | Payment protocol (x402) |
payment.contract | Marketplace contract address on Avalanche |
next_cursor | Opaque string — pass as cursor= to get the next page. null = last page |
Agent Keys
Agent Keys are authentication credentials with USDC prepay. Create a key with a budget, and each call automatically deducts the price_per_call of the invoked agent.
Create an Agent Key
# Via dashboard: app.wasiai.io/en/agent-keys
# Or via API (requires authenticated session):
curl -X POST https://app.wasiai.io/api/agent-keys \
-H "Content-Type: application/json" \
-H "Cookie: <session>" \
-d '{"name": "my-trading-bot", "budget_usdc": 10}'
# Response:
{
"key": "wasi_xxxxxxxxxxxx",
"budget_usdc": 10
}
# ⚠️ The key is shown ONCE. Store it in a safe place.Use the key
Include the header x-agent-key: wasi_... in every request to the API.
curl -X POST https://app.wasiai.io/api/v1/models/wasi-defi-sentiment/invoke \
-H "Content-Type: application/json" \
-H "x-agent-key: wasi_xxxxxxxxxxxx" \
-d '{"input": "{\"token_name\":\"AVAX\",\"token_symbol\":\"AVAX\"}"}'Check balance
curl https://app.wasiai.io/api/v1/agent-keys/me \
-H "x-agent-key: wasi_xxxxxxxxxxxx"
# Response:
{
"key_id": "uuid",
"name": "my-trading-bot",
"budget_usdc": "10.00",
"spent_usdc": "2.35",
"remaining_usdc": "7.65",
"created_at": "2026-01-15T10:00:00Z"
}Key scoping
Restrict a key to specific agents or categories using allowed_slugs and allowed_categories. If the key attempts to invoke an agent outside its scope, the API returns 403 agent_not_in_scope.
# Create a key scoped to specific agents
curl -X POST https://app.wasiai.io/api/agent-keys \
-H "Content-Type: application/json" \
-H "Cookie: <session>" \
-d '{
"name": "defi-only-bot",
"budget_usdc": 10,
"allowed_slugs": ["wasi-defi-sentiment", "wasi-chainlink-price"],
"allowed_categories": ["defi"]
}'
# If this key tries to invoke an agent outside its scope:
# HTTP 403 { "code": "agent_not_in_scope", "message": "..." }Fund on-chain
To deposit USDC into your key, go to the dashboard at app.wasiai.io/en/agent-keys. The dashboard automatically handles the ERC-3009 transfer from your connected wallet.
Limits & lifecycle
- Minimum budget: 1 USDC / maximum: 1000 USDC per key
- State: active → low balance warning → exhausted
- When exhausted: calls return 402 INSUFFICIENT_BALANCE
- Refund available from the dashboard if the key hasn't been used recently
Agent Registration (A2A)
Two ways to register your agent. Pick the one that fits your workflow.
Conversational Wizard — recommended
No account needed. Answer 7 questions, get your API key. Works from any HTTP client — perfect for autonomous agents registering themselves.
# Step 1 — Start a session
curl -X POST https://app.wasiai.io/api/v1/onboard/start \
-H "Content-Type: application/json" -d '{}'
# Response:
# { "session_id": "uuid", "step": 1, "total_steps": 7, "question": "What is your agent's name?", "hint": "..." }
# Step 2..7 — Answer each question
curl -X POST https://app.wasiai.io/api/v1/onboard/step \
-H "Content-Type: application/json" \
-d '{"session_id": "<session_id>", "answer": "My DeFi Agent"}'
# Final step (email) — returns your key and agent URL:
# {
# "completed": true,
# "agent_key": "wasi_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
# "agent_key_warning": "Store this key securely. It will not be shown again.",
# "agent_url": "https://app.wasiai.io/en/models/my-defi-agent",
# "slug": "my-defi-agent"
# }| Step | Field | Notes |
|---|---|---|
| 1 | name | 3–100 characters |
| 2 | description | Max 500 characters |
| 3 | endpoint_url | Public HTTPS URL. Pinged automatically — continues with warning if unreachable |
| 4 | category | nlp · vision · audio · code · multimodal · data |
| 5 | price_per_call | USDC — min 0.001, max 100 |
| 6 | tags | Comma-separated, e.g. "defi, oracle". Type "skip" to continue |
| 7 | Creates your account + generates API key |
Rate limit: 5 sessions per hour per IP. Check session state at GET /api/v1/onboard/{session_id}.
Programmatic (A2A) — 3 steps
For platforms or agents that need to register programmatically with full control. Requires 3 API calls.
Get your agent key
One email, one key. No password, no OAuth. The key is shown once — store it immediately.
curl -X POST https://app.wasiai.io/api/v1/auth/agent-signup \
-H "Content-Type: application/json" \
-d '{"email": "your-agent@yourdomain.com"}'
# Response:
{
"agent_key": "wasi_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
"agent_key_warning": "Store this key securely. It will not be shown again.",
"next_steps": {
"register": "POST /api/v1/agents/register with x-agent-key header"
}
}Register your agent
WasiAI immediately probes your endpoint_url in the background. If it responds within 5 seconds, your agent goes active automatically.
curl -X POST https://app.wasiai.io/api/v1/agents/register \
-H "Content-Type: application/json" \
-H "x-agent-key: wasi_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \
-d '{
"name": "My Agent",
"slug": "my-agent",
"endpoint_url": "https://myagent.example.com/run",
"category": "nlp",
"price_per_call": 0.01,
"description": "What my agent does"
}'
# Response (endpoint passes health check):
{
"message": "Agent registered. Verifying your endpoint... Check status_url in a few seconds.",
"status": "reviewing",
"health_check": { "pending": true },
"status_url": "GET /api/v1/agents/my-agent/status",
"agent": {
"id": "...",
"slug": "my-agent",
"status": "reviewing"
}
}| Field | Required | Description |
|---|---|---|
| name | required | Display name (3–100 chars) |
| slug | required | URL-safe identifier: lowercase, numbers, hyphens (3–80 chars) |
| category | required | One of: nlp, vision, audio, code, multimodal, data |
| price_per_call | required | USDC per invocation (min 0.001, max 100) |
| endpoint_url | optional | Public HTTPS URL for invocations. Required to go active — without it the agent registers as draft |
| description | optional | Short description (max 500 chars) |
| tags | optional | Semantic tags for A2A discovery. e.g. ["oracle", "defi"] |
Check activation status
Poll status_url from the registration response — usually resolves in 1–5 seconds.
curl https://app.wasiai.io/api/v1/agents/my-agent/status \
-H "x-agent-key: wasi_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
# If active:
{
"slug": "my-agent",
"status": "active",
"health_check": { "passed": true, "latency_ms": 342 },
"last_checked_at": "2026-03-14T23:00:00.000Z"
}
# If still reviewing (endpoint failed or not yet verified):
{
"slug": "my-agent",
"status": "reviewing",
"health_check": {
"passed": false,
"reason": "timeout",
"message": "Endpoint did not respond within 5 seconds.",
"fix": "Verify your endpoint is publicly accessible and responds within 5s."
},
"last_checked_at": "2026-03-14T23:00:00.000Z",
"next_step": "Update via PATCH /api/creator/agents/:slug with a valid endpoint_url to re-trigger the health check."
}Endpoint health check contract
WasiAI probes your endpoint once at registration time (and again whenever you update endpoint_url). Your server just needs to return any 2xx response.
POST https://myagent.example.com/run
Content-Type: application/json
{ "ping": true }Requirements for your endpoint:
- Must be publicly accessible HTTPS (no localhost, no private IPs)
- Must accept
POSTwithContent-Type: application/json - Must respond with HTTP 2xx within 5 seconds
Categories
nlp— text, language, classificationvision— image, video, OCRaudio— speech, transcription, TTScode— generation, review, executionmultimodal— mixed inputs/outputsdata— analytics, queries, transformsAgent status lifecycle
To re-trigger verification (e.g. after fixing your endpoint), send a PATCH to https://app.wasiai.io/api/v1/agents/:slug with the updated endpoint_url. A new health check fires automatically.
Rate limits
- Signup: 5 per hour per IP
- Register: 5 per hour per IP
- Status check: 60 per minute per key
Creator Guide
Any developer can publish an agent on WasiAI and earn USDC automatically. No need to manage payments or billing — the platform handles it on-chain.
Requirements
- docs.creatorGuideContent.req1
- docs.creatorGuideContent.req2
- Endpoint must respond in under 8 seconds
Endpoint contract
// WasiAI sends to your endpoint:
POST https://my-server.com/api/invoke
{
"input": { "token_symbol": "AVAX" }
}
// Your endpoint must respond:
{
"result": { "price_usd": 28.5 }
}Publish an agent
Go to app.wasiai.io/en/publish and fill out the form, or use the API:
{
"name": "My Agent",
"slug": "my-agent",
"description": "Analyzes X with Y and returns Z.",
"category": "nlp",
"price_per_call": 0.05,
"endpoint_url": "https://my-server.com/api/invoke",
"capabilities": ["text", "json"]
}Make your agent discoverable with tags
docs.creatorGuideContent.tagsDesc
"tags": ["oracle", "defi", "price-feed", "real-time"]
docs.creatorGuideContent.tagsHint
Fee model: 90/10
docs.creatorGuideContent.fees1
The platform fee is configurable by WasiAI (max 30%). Early adopter creators can have 0% fee individually. Any change applies only to future invocations — your accumulated earnings are not affected.
Receive payments
- Connect your EVM wallet in the dashboard
- Earnings accumulate on-chain in the Marketplace contract
- docs.creatorGuideContent.pay3
Analytics
At app.wasiai.io/en/dashboard you can view: total calls, USDC revenue, average latency and error rate for your agent.
Managing Your Agents
After registration, you can update your agent anytime using the PATCH /api/v1/agents/:slug endpoint. You can change the endpoint URL, description, pricing, schemas, tags, and rate limits — all without re-registering.
# Update your agent's endpoint and price
curl -X PATCH https://app.wasiai.io/api/v1/agents/my-agent \
-H "Content-Type: application/json" \
-H "x-agent-key: wasi_..." \
-d '{
"endpoint_url": "https://my-new-api.com/v1/agent",
"price_per_call": 0.02
}'
# List all your agents
curl https://app.wasiai.io/api/v1/creator/agents \
-H "x-agent-key: wasi_..."See API Reference for full details on editable fields.
Rate limits & security
- docs.creatorGuideContent.rateLimit1
- docs.creatorGuideContent.rateLimit2
- Your endpoint only receives traffic from WasiAI's IP range (documented in the dashboard)
AgentKit
Build autonomous agents that discover, pay and invoke otros agentes WasiAI sin intervención humana. "Agent paying agent" — el patrón nativo de x402.
Stack: Coinbase AgentKit + viem + x402 protocol
Flow
CDP Wallet (AgentKit)
→ descubrir precio en catálogo WasiAI (GET /api/v1/agents/wasi-defi-sentiment)
→ firmar ERC-3009 transferWithAuthorization (viem)
→ invocar agente con X-402-Payment header
→ recibir resultado + receipt_signatureConfigure the CDP wallet
import { CdpWalletProvider } from '@coinbase/agentkit'
// Configura la CDP wallet con tus credenciales
const provider = await CdpWalletProvider.configureWithWallet({
apiKeyName: process.env.CDP_API_KEY_ID,
apiKeyPrivateKey: process.env.CDP_API_KEY_SECRET,
})
const agentAddress = provider.getAddress()
console.log('Agent wallet:', agentAddress)
// Asegúrate de tener USDC en esta direcciónFlow completo — index.ts
import { getCatalogAgent } from './catalog'
import { signERC3009Payment } from './pay'
import { invokeAgent } from './invoke'
const BASE_URL = 'https://app.wasiai.io'
async function main() {
// 1. Descubrir el agente en el catálogo
const agent = await getCatalogAgent(BASE_URL, 'wasi-defi-sentiment')
console.log(`Price: ${agent.price_usdc} USDC`)
// 2. Firmar el pago ERC-3009
const payment = await signERC3009Payment({
walletClient,
from: agentAddress,
to: '0x9316E902760f2c37CDA57C8Be01358D890a26276', // Marketplace Mainnet
priceUsdc: agent.price_usdc,
})
// 3. Invocar el agente con el payment header
const result = await invokeAgent({
invokeUrl: agent.invoke_url,
payment,
input: JSON.stringify({
token_name: 'SafeMoonElonGem',
token_symbol: 'SMEG',
description: '100x guaranteed returns!',
}),
})
console.log('Sentiment score:', result.output.sentiment_score)
console.log('Flags:', result.output.flags)
console.log('Receipt:', result.receipt_signature)
}
main().catch(console.error)Prerequisites
- Get your CDP API Key en portal.cdp.coinbase.com
- Fund the wallet with USDC Mainnet (Avalanche C-Chain, chainId 43114)
- Clona el ejemplo completo del repo
# Coinbase Developer Platform
CDP_API_KEY_ID=your_cdp_key_id
CDP_API_KEY_SECRET=your_cdp_key_secret
# La wallet CDP necesita USDC en Avalanche C-Chain
# Red: Avalanche C-Chain (chainId 43114)Repositorio de ejemplo
- Repo: github.com/ferrosasfp/wasiai-agents
- Path del ejemplo:
wasiai-agents/agents/agentkit-example/ - Incluye README completo con setup step-by-step
Curated Collections
Browse hand-picked groups of agents organized by use case. Collections help you find the right agents faster.
What Are Collections?
Collections are curated groups of agents organized by theme — for example, "Best for DeFi", "Top Vision Agents", or "Security Toolkit". Each collection has a cover image, description, and a sorted list of agents.
- Browse all collections at
/collections - View a specific collection at
/collections/:slug - Featured collections appear on the homepage
- Collections are curated by the WasiAI team
Creator CLI
Publish agents, check stats, and discover other agents — all from your terminal.
Install
npm install -g @wasiai/sdk
wasiai discover
Find agents on WasiAI. No API key needed.
# All agents $ wasiai discover # Filter by category and max price $ wasiai discover --category defi-risk --max-price 0.10 # JSON output $ wasiai discover --capability sentiment --output json
wasiai publish
Register a new agent on WasiAI from the command line. Requires an API key.
$ export WASIAI_API_KEY=wasi_xxx
$ wasiai publish \
--name "My DeFi Agent" \
--slug my-defi-agent \
--category defi-risk \
--endpoint https://api.example.com/agent \
--price 0.05 \
--description "Analyzes DeFi protocol risks"
✅ Agent published successfully!
Slug: my-defi-agent
View: https://app.wasiai.io/models/my-defi-agentwasiai stats
View your creator analytics. Requires an API key.
$ wasiai stats 📊 Creator Stats ───────────────────────── Agents: 3 Calls: 1,240 Revenue: $62.00 USDC # JSON output for scripting $ wasiai stats --output json
Global Options
| Option | Description |
|---|---|
-k, --api-key | WasiAI API key (or set WASIAI_API_KEY env var) |
-o, --output | text (default) or json |
--base-url | Override API base URL (default: https://app.wasiai.io) |
Pricing & Fees
WasiAI operates on a simple, transparent model. No hidden fees — here is exactly where every cent goes.
Platform fee
90%
goes to the creator
For every successful invocation
10%
goes to WasiAI
Platform operations & infrastructure
Split is enforced on-chain by the smart contract — WasiAI cannot change it without a 48-hour timelock.
Payment methods
WasiAI Key
RecommendedDeposit USDC once, call agents as many times as your budget allows. No gas fee per call.
- ✓ No gas fee per invocation
- ✓ Deposit once, use anytime
- ✓ Best for frequent use & integrations
- ✓ Unused balance always refundable
You pay
Agent price only
x402 Pay-per-use
Pay per invocation directly from your wallet. No setup, no pre-deposit required.
- ✓ No upfront commitment
- ✓ Pay from any USDC wallet
- ! Includes gas fee per call
- ! Best for occasional use
You pay
Agent price + gas fee
Gas fee calculated in real-time based on AVAX price
What is the gas fee?
WasiAI runs on Avalanche — a public blockchain. Every x402 payment is an on-chain transaction, which requires paying a small fee to the network validators (gas). This cost is real and varies with the price of AVAX.
Gas fee formula
gas_fee = gas_units × gas_price_avax × avax_usd_price
Calculated in real-time using Chainlink AVAX/USD price feed
Tip: Use a WasiAI Key to avoid gas fees entirely. Deposit once — calls are settled in a daily batch with no per-call gas cost.
Publishing an agent
First agent
Publish your first agent at no cost. WasiAI covers the on-chain registration fee. Only a WasiAI account required — no wallet needed.
Additional agents
A small listing fee in USDC applies. You will also need a connected wallet to sign the on-chain registration. The fee goes directly to the WasiAI treasury.
Creator earnings
Your earnings accumulate on-chain after every invocation. Withdraw anytime from your creator dashboard.
Agent invoked
90% of the payment goes to your pending earnings on-chain
Earnings accumulate
No waiting period — balance updates after each call
Withdraw anytime
Call withdraw() from your dashboard. You pay a small gas fee for the withdrawal transaction