{{TOOL_NAME}}

{{TOOL_DESCRIPTION}}

Manifest

The ERC-8257 tool manifest lives at:

GET /.well-known/ai-tool/{{TOOL_SLUG}}.json

Endpoint

POST to /api with a JSON body matching the manifest's inputs schema. See the manifest for the exact input format.

Authentication

This tool may use one or both of the following gates (check the manifest for details):

Agent quick start

Using @opensea/tool-sdk CLI:

# Predicate-gated tool (zero-value EIP-3009 auth)
PRIVATE_KEY=0x... RPC_URL=https://mainnet.base.org npx @opensea/tool-sdk auth \
  {{TOOL_ENDPOINT}}/api --body '{"query": "hello"}'

# x402-paid tool (USDC payment)
PRIVATE_KEY=0x... RPC_URL=https://mainnet.base.org npx @opensea/tool-sdk pay \
  {{TOOL_ENDPOINT}}/api --body '{"query": "hello"}'

# Smoke-test (auto-detects gate type)
PRIVATE_KEY=0x... RPC_URL=https://mainnet.base.org npx @opensea/tool-sdk smoke \
  --endpoint {{TOOL_ENDPOINT}}/api --expect 200

Or programmatically with wallet adapters:

import { createWalletFromEnv, walletAdapterToClient } from "@opensea/tool-sdk"
import { base } from "viem/chains"

// createWalletFromEnv auto-detects provider from env vars:
//   Privy > Fireblocks > Turnkey > PrivateKey
const adapter = createWalletFromEnv()
const client = await walletAdapterToClient(adapter, base)

For predicate-gated tools (zero-value EIP-3009 auth):

import { eip3009AuthenticatedFetch } from "@opensea/tool-sdk"

const res = await eip3009AuthenticatedFetch(
  "{{TOOL_ENDPOINT}}/api",
  { account: client.account, method: "POST", body: JSON.stringify({ query: "hello" }) },
)
const data = await res.json()

For x402-paid tools (USDC payment):

import { paidFetch } from "@opensea/tool-sdk"

const res = await paidFetch(
  "{{TOOL_ENDPOINT}}/api",
  { signer: adapter, method: "POST", body: JSON.stringify({ query: "hello" }) },
)
const data = await res.json()

For tools with both gates (predicate + x402):

import { paidAuthenticatedFetch } from "@opensea/tool-sdk"

const res = await paidAuthenticatedFetch(
  "{{TOOL_ENDPOINT}}/api",
  {
    account: client.account,
    signer: adapter,
    method: "POST",
    body: JSON.stringify({ query: "hello" }),
  },
)
const data = await res.json()

Wallet providers

The SDK supports multiple wallet providers via @opensea/wallet-adapters. Set the corresponding env vars and createWalletFromEnv() auto-detects the provider:

PRIVATE_KEY + RPC_URL — Local private key (simplest)
PRIVY_APP_ID          — Privy server wallet
TURNKEY_API_PUBLIC_KEY — Turnkey signing
FIREBLOCKS_API_KEY    — Fireblocks vault

CLI commands also accept --wallet-provider privy|turnkey|fireblocks|bankr|private-key.

Response

On success, returns 200 with a JSON body matching the manifest's outputs schema. Without an X-Payment header, returns 402 with a challenge: zero-value for predicate-gated tools, a USDC amount for x402-paid tools. A malformed or invalid X-Payment header returns 401, and a wallet the access predicate denies returns 403.

Built with @opensea/tool-sdk · Creator: {{CREATOR_ADDRESS}}