Skip to main content
Deploying an agent through FlareHQ does three things in a single API call: it provisions two Smart Contract Account (SCA) wallets (one owner, one validator), registers the agent’s identity in the ERC-8004 Identity Registry on Arc testnet, and persists the agent record to your merchant account.
Production runs on Arc Mainnet (chain ID 5042). The registry deployment documented here is the Arc Testnet deployment — confirm the production registry address with the operator.
The response contains everything you need to start making agent-authenticated x402 payments — the ERC-8004 tokenId, both wallet addresses, and the on-chain transaction hash.
This endpoint requires a merchant API key. You can generate one in the FlareHQ dashboard under Settings → API Keys.

Request

POST https://flarehq.xyz/api/agent/deploy

Headers

Body Parameters

All body parameters are optional. The endpoint will deploy a functional agent with sensible defaults if you send an empty body ({}).
string
default:"FlareHQ Autonomous Agent"
A human-readable display name for the agent. Stored in the FlareHQ agent registry and shown in the dashboard. Maximum 120 characters.
string
IPFS (ipfs://baf...) or HTTPS URI pointing to a JSON document that describes the agent’s capabilities, supported APIs, and pricing. This URI is written directly into the ERC-8004 Identity Registry on-chain.
string
Ethereum address of the operator who controls this agent. Stored in the ERC-8004 Identity Registry. Defaults to a FlareHQ-managed address if omitted — override this in production with your own address.

Response

200 — Success

boolean
true when both wallets were provisioned and the on-chain registration confirmed.
object
The full agent record as persisted to the FlareHQ registry database.
string
Arc Mainnet transaction hash for the ERC-8004 register() call. Confirms the agent’s identity is now live on-chain.
string
Direct Arc Explorer link to the registration transaction (https://explorer.arc.io/tx/{txHash}).
object
Both wallet addresses created during provisioning.

500 — Server Error

Returned when agent provisioning fails due to a server-side error or when on-chain registration is rejected.

408 — Timeout

Returned when the on-chain registration transaction does not confirm within the expected window.

Examples

Success Response

Next Steps After Deployment

Once deployment succeeds, follow these steps before making your first x402 payment: 1. Fund the agent’s SCA wallet with test USDC Visit faucet.circle.com, select ARC-TESTNET, and send test USDC to the scaAddress returned in the response. You need a Gateway deposit as well — run:
2. Construct your agent identifier Your agent’s x402 identifier is formed as:
Pass this as the X-Agent-ID header on every /api/x402/pay call. 3. Verify registration on-chain Open the explorerUrl from the response on Arc Explorer to confirm the registration transaction succeeded.
Each deployment creates new Circle wallets and a new on-chain identity. Deploying the same logical agent twice produces two distinct tokenId values with separate wallets and reputations. Store the tokenId and scaAddress securely after the first deployment.