Skip to content

Repository files navigation

Web3GPT

Web3GPT is an AI-powered smart contract platform for chatting with onchain agents, deploying Solidity contracts, and running agent-driven workflows on EVM chains.

The current public integration surface is agent-first:

  • browser chat UI at w3gpt.ai
  • skill endpoint at https://w3gpt.ai/api/skill
  • public aggregate stats at https://w3gpt.ai/api/stats
  • skill guide at https://w3gpt.ai/skill.md
  • API reference at https://w3gpt.ai/api-docs

What Changed

  • the old Unkey-backed /api/v1 endpoints are removed
  • the SDK now targets the skill/chat flow instead of separate completions/deploy APIs
  • Polygon mainnet deployment is available through the agent and skill endpoint
  • server-side deployments are returned and recorded only after a successful contract-creation receipt
  • Polygon mainnet is not exposed through wallet connectors in the UI

Core Flows

  • chat with built-in or user-created Web3GPT agents
  • deploy contracts through the agent conversation
  • persist authenticated browser chats in Vercel KV
  • persist anonymous skill chats by chatId
  • verify deployments through the Vercel cron job

Supported Agent Deployment Chains

  • Polygon Mainnet
  • Polygon Amoy
  • Base Sepolia
  • Arbitrum Sepolia
  • Optimism Sepolia
  • Mantle Sepolia
  • Metis Sepolia
  • Celo Alfajores
  • Ethereum Sepolia

Getting Started

  1. Clone the repository.
  2. Copy .env.example and fill in the required variables.
  3. Install dependencies.
  4. Run the app.
bun install
bun dev

Local Sign-In

Create a GitHub OAuth app with the callback URL http://localhost:3000/api/auth/callback/github, then set AUTH_GITHUB_ID, AUTH_GITHUB_SECRET and AUTH_SECRET in .env.local. Sign-in works locally with no further configuration.

Important Environment Variables

  • OPENAI_API_KEY
  • DEPLOYER_PRIVATE_KEY
  • AUTH_GITHUB_ID
  • AUTH_GITHUB_SECRET
  • AUTH_SECRET
  • CRON_SECRET
  • KV_REST_API_URL
  • KV_REST_API_TOKEN
  • NEXT_PUBLIC_ALCHEMY_API_KEY
  • optional NEXT_PUBLIC_POLYGON_AMOY_RPC_URL wallet-client override
  • optional POLYGON_AMOY_RPC_URL and POLYGON_MAINNET_RPC_URL server deployment overrides
  • NEXT_PUBLIC_TENDERLY_API_KEY
  • NEXT_PUBLIC_WALLETCONNECT_PROJECT_ID
  • ETHERSCAN_API_KEY
  • BLOCKSCOUT_API_KEY
  • PINATA_JWT

Skill API

Start a chat:

curl https://w3gpt.ai/api/skill

Continue a chat:

curl -X POST "https://w3gpt.ai/api/skill?chatId=your-chat-id" \
  -H "Content-Type: application/json" \
  -d '{"message":"Deploy an ERC20 on Polygon mainnet"}'

Include full history:

curl "https://w3gpt.ai/api/skill?chatId=your-chat-id&history=true"

The chatId is the secret for continuing a thread outside the browser UI.

Successful deployment tool results include chainId, contractAddress, transactionHash, explorerUrl, and transactionExplorerUrl. Polygon mainnet uses chain ID 137; Polygon Amoy uses chain ID 80002.

Public Analytics

The aggregate reports custom agent records and deduplicated deployment records by chain. It includes its definitions and observation time so the values can be cited without treating testnet activity as mainnet activity.

Representative public custom agents include:

Development Commands

  • bun dev
  • bun run build
  • bun run start
  • bun run typecheck
  • bun run lint
  • bun run format

About

Develop and deploy smart contracts using natural language.

Topics

Resources

Stars

116 stars

Watchers

5 watching

Forks

Used by

Contributors

Languages