Purpose: Web3GPT uses natural language to complete the writing, compilation, deployment, and verification of smart contracts. Users only need to describe the contract they want (such as ERC-20, NFT collections, vesting contracts, etc.), and the agent generates Solidity code, referencing OpenZeppelin and npm or GitHub dependencies when needed.\n\nMain capabilities:\n- Chat-to-deploy: each deployment returns the contract address, transaction hash, and block explorer link, and results are reported only after a successful contract creation receipt is received.\n- Two ways to pay for gas: agent deployments are signed by Web3GPT's own wallet, with no user wallet required; "Deploy with wallet" compiles on the server, and the user signs the transaction with their own wallet via RainbowKit.\n- Any Solidity version: the compiler is selected according to the contract pragma (0.4.11 and later), and downloaded compilers undergo checksum verification.\n- Verifiable and reproducible: source code, ABI, bytecode, and standard JSON input are pinned to IPFS, and a background task verifies the contract on Blockscout or Etherscan.\n- Custom agents: logged-in users can create agents with their own instructions and share them via link (w3gpt.ai/?a=<agentId>).\n- Agent-to-agent API: POST /api/skill allows other agents and scripts to converse with the Web3GPT agent, including deployments, without an account.\n- Save and share conversations: GitHub-logged-in users retain chat history (including deployment results) and can publish conversations as public links.\n\nHow to use: use directly in the browser; or call via the public HTTP Skill API. See w3gpt.ai/skill.md for the skill guide, w3gpt.ai/api-docs for the API reference, and w3gpt.ai/contracts and w3gpt.ai/api/stats for live deployments. When using the Skill API, first start a conversation to obtain a chatId, which serves as the key for continuing that conversation; subsequent messages carry that chatId, and adding history=true returns the full conversation. The agent may ask for confirmation before deploying, and you need to reply in the same conversation.\n\nLimits and quotas: public endpoints are rate-limited to prevent exhaustion of the shared deployment wallet and model budget. Agent messages: 20 per IP, 30 per conversation, every 10 minutes; logged-in browser users get 60 every 10 minutes. Web3GPT-paid deployments: 10 testnet deployments per caller per hour; Polygon mainnet 2 per caller per day, subject to a shared daily budget. Exceeding the limit returns HTTP 429 with a Retry-After header. "Deploy with wallet" has no gas limit because users pay gas themselves. Polygon mainnet is available only to the agent, not to the wallet connector; retired testnets (such as Celo Alfajores) can no longer be deployed to, but historical deployments still appear on the dashboard.\n\nSelf-hosting requirements: an OpenAI API key, Redis storage with a REST API (such as Upstash, available via the Vercel marketplace integration), a funded EVM private key for agent deployments (testnet funds are enough to start), a Pinata account for IPFS pinning, and a GitHub OAuth app for login. For local login, create a callback URL of http://localhost:3000/api/auth/callback/github GitHub OAuth app, and set AUTH_GITHUB_ID, AUTH_GITHUB_SECRET, and AUTH_SECRET. Optional rate-limit override variables and their defaults are in lib/rate-limit.ts; .env.example lists all variables. The app is built for Vercel; vercel.json schedules /api/cron every minute for contract verification and allows API routes up to 300 seconds.
Code structure: app/ contains pages and API routes; components/ contains the chat UI, sidebar, wallet, and deployment components; lib/ contains agent and chain constants, AI tools, persistence, Solidity compile-deploy-verify, and rate limiting; test/ contains unit tests. AGENTS.md is a detailed guide to the codebase. Please report security vulnerabilities privately via GitHub security advisories.