Everything you need to know about using CiteFlowAI, whether you are researching topics or registering your own intellectual property.
CiteFlowAI is a decentralized AI research terminal designed to fix the creator compensation problem in generative AI. Currently, AI models are trained on millions of articles, but the original authors receive no compensation when their work is used to generate answers.
CiteFlowAI changes this by introducing Pay-Per-Prompt Citations. When our AI agent synthesizes an answer using a registered knowledge base, it explicitly cites its sources and uses Circle Programmable Wallets to instantly execute USDC nanopayments to the original creators on the Arc Testnet.
You don't need a crypto extension like MetaMask to use CiteFlowAI. We use Circle's User-Controlled Wallets to generate a secure Web3 wallet bound to your email address, which acts as your universal login!
Since CiteFlowAI currently operates on the Arc Testnet, you need free Testnet USDC to pay for AI prompts.
Once your wallet is funded, you can query the AI. You set a "Max Budget" for the prompt (e.g., $0.50).
There are no separate "user" or "creator" accounts, and absolutely no passwords. Your Circle Wallet is your entire identity. The moment you connect your wallet via the navbar, our backend automatically maps your address to your creator profile. You never have to manually configure payment settings!
Before you can register an article, you must prove you actually control where it lives. This exists so nobody else can register your work and collect the citation payments meant for you — CiteFlowAI will not create a source from a domain or platform handle you haven't verified, full stop.
/.well-known/citeflow.txt file with the code), an X account (post the code in a tweet), a Medium profile, a Substack, or an Arc House account (publish the code in a post on a public board) — then paste the link back into the panel.Navigate to the Register Work page. Here, you can upload the contents of your research, blog posts, or intellectual property.
The Dashboard provides a live view of your intellectual property.
CiteFlowAI can also be called directly by other autonomous agents — no CiteFlow account, API key, or PIN prompt. The/api/agent/researchendpoint speaks the x402 protocol: send a request with no payment and it returns an HTTP 402 challenge; retry with a signed, gasless payment authorization and it settles the payment and returns a grounded, cited answer in one round trip.
@circle-fin/x402-batching client library (or any client that implements Circle Gateway's batched signing scheme).A complete, standalone example — no CiteFlow code required. Run these in an empty folder:
mkdir citeflow-test && cd citeflow-test npm init -y npm install @circle-fin/x402-batching
Save this as test-x402.mjs in that folder — the .mjs extension runs it as ESM without needing to edit package.json:
import { GatewayClient } from '@circle-fin/x402-batching/client'
const client = new GatewayClient({
chain: 'arcTestnet',
privateKey: '0xYOUR_PRIVATE_KEY',
rpcUrl: 'https://rpc.drpc.testnet.arc.network', // the default RPC is rate-limited
})
await client.deposit('1.00') // one-time, funds your Gateway balance
const { data } = await client.pay(
'https://citeflowai.xyz/api/agent/research?q=' +
encodeURIComponent('your research question here')
)
console.log(data.answer) // grounded, cited answer
console.log(data.purchasedSources) // which creators just got paidReplace 0xYOUR_PRIVATE_KEY and 'your research question here' with your own values first — the script will still run and settle payment even if you forget, it just comes back with a response explaining no real question was asked, instead of an error.
Then run it:
node test-x402.mjs
Each call is a fixed $1.00 USDCbudget. Whatever isn't spent on citations is refunded back to the paying wallet — the same refund mechanism used for human researchers. Citation payments to creators are executed exactly as they are for human researchers too, regardless of which side paid.
Circle Agent Wallet provides a managed alternative to supplying a raw EVM private key. The Circle CLI logs in the agent wallet, inspects the x402 challenge, checks or funds its Gateway balance, estimates the charge, and pays the same research endpoint after user confirmation.
circle services pay "https://citeflowai.xyz/api/agent/research?q=YOUR_ENCODED_QUESTION" --address 0xYOUR_AGENT_WALLET_ADDRESS --chain ARC-TESTNET --estimate --output json
Estimate first and show the price, network, seller, and question before paying. The Agent Wallet must have enough Arc Testnet Gateway balance; a regular wallet balance is not automatically available for x402 payments.
Read the complete Circle Agent Wallet guideIf your agent runs on MCP (Claude, Codex, Antigravity, OpenCode, Cursor, or your own agent framework), you don't need to write any x402 signing code at all. We publish a small, self-contained MCP server — mcp-server/ in the CiteFlow repo — that exposes the endpoint as a single tool: citeflow_research. It handles the Gateway deposit, signing, and payment internally; your agent just calls the tool with a question.
Set a longer tool-call timeout.A real call settles an on-chain payment and typically takes 60–100+ seconds. Most MCP clients default to a 60-second tool-call timeout, right at the edge of that, so calls will intermittently fail with a timeout error even though nothing is wrong. Set your client's per-server timeout to at least 3 minutes; the exact field is shown for each client below.
Setup:
git clone https://github.com/vickman787/citeflowAI cd citeflowAI/mcp-server npm install export CITEFLOW_PRIVATE_KEY=0xYOUR_PRIVATE_KEY
Then point your MCP client at it, e.g. in Claude Desktop's config:
{
"mcpServers": {
"citeflow": {
"command": "node",
"args": ["/absolute/path/to/mcp-server/index.mjs"],
"timeout": 180000,
"env": {
"CITEFLOW_PRIVATE_KEY": "0xYOUR_PRIVATE_KEY",
"CITEFLOW_RESEARCH_URL": "https://citeflowai.xyz/api/agent/research"
}
}
}
}CITEFLOW_RESEARCH_URLis actually optional — it already defaults to this production endpoint — but it's shown explicitly here so the example is copy-pasteable as-is.
Restart your client and ask it to research something — it calls citeflow_research on its own when relevant. The MCP server auto-deposits into Gateway the first time it needs to, so there's no manual Gateway deposit step. You only need testnet USDC and Arc Testnet gas for that automatic deposit. Full details in mcp-server/README.md.
Same server, same tool — CLI, IDE extension, or desktop app all work. Only the config format and location differ, since each client is a separate, independently-built product.
Claude Code (CLI or VS Code extension) uses the identical .mcp.json format shown above — same file, same shape, whether it's the desktop app, CLI, or extension.
Codex (CLI or IDE extension — they share one config) uses TOML, not JSON, at ~/.codex/config.toml:
[mcp_servers.citeflow] command = "node" args = ["/absolute/path/to/mcp-server/index.mjs"] tool_timeout_sec = 180 [mcp_servers.citeflow.env] CITEFLOW_PRIVATE_KEY = "0xYOUR_PRIVATE_KEY" CITEFLOW_RESEARCH_URL = "https://citeflowai.xyz/api/agent/research"
Antigravity (desktop app or CLI) uses the same JSON shape as Claude, but a different file — global config at ~/.gemini/config/mcp_config.json, or workspace-local at .agents/mcp_config.json. In the desktop app you can also add it via MCP Servers → Manage MCP Servers → View raw config instead of editing the file directly. If Antigravity exposes a per-server timeout setting, set it to at least 3 minutes for the same reason as above.
One gotcha specific to Antigravity: adding the server isn't enough on its own — it also has a separate permissions screen (MCP Tools) where tools must be explicitly allowed before the agent can call them. If the tool connects but calls silently do nothing, add an Allow rule for citeflow_research there.
OpenCode (CLI) uses opencode.json or opencode.jsonc, either globally at ~/.config/opencode/opencode.jsonc or project-local in your working directory (project-local is the one OpenCode reliably picks up):
{
"$schema": "https://opencode.ai/config.json",
"mcp": {
"citeflow-research": {
"type": "local",
"command": ["node", "/absolute/path/to/mcp-server/index.mjs"],
"enabled": true,
"timeout": 180000,
"environment": {
"CITEFLOW_PRIVATE_KEY": "0xYOUR_PRIVATE_KEY"
}
}
}
}One gotcha specific to OpenCode: after editing the config, fully quit and relaunch OpenCode, not just start a new chat — MCP servers are loaded once at process startup.
CiteFlowAI is built on top of Circle Web3 Services to provide a seamless, gasless experience for non-crypto native users while maintaining decentralized settlement.