← Protocols
Virtuals Protocol
01Description

Agent tokenization platform on Base where every agent is an ERC-20 with a fixed supply, governed by token holders. The G.A.M.E (Goal-Action-Mind-Engine) SDK gives developers a planner/worker/function decomposition to build agents that can be co-owned and incentive-aligned with creators and users.

02Best for
  • 01tokenized agents (ERC-20 per agent)
  • 02agent co-ownership and revenue share
  • 03X/Twitter autonomous personas
  • 04Base-native agent economy
  • 05GAME planner/worker pattern
03Install
  • pip install virtuals_sdk
  • pip install game-sdk
04Environment variables
VariableScopeDescription
GAME_API_KEYServerAPI key from the GAME platform; authenticates SDK calls and counts toward LLM/tool quotas.
VIRTUALS_AGENT_IDServerOptional — token/agent ID for an existing on-chain Virtual you are extending.
TWITTER_BEARER_TOKENServerOptional — only needed when wiring an X/Twitter agent through GAME.
05Prompt snippet
Use the GAME SDK to compose a Virtuals agent from three layers: the high-level Agent (carries `goal` and `description`), one or more Workers (low-level planners with their own descriptions), and Functions (Python callables exposed as tools with names, descriptions, and arg schemas). Instantiate with `Agent(api_key=os.environ['GAME_API_KEY'], goal='...', description='...', workers=[worker])`, then `agent.compile()` and `agent.run()`. Functions can wrap any Python — onchain calls (web3.py / viem-py), API fetches, or pure compute — and the engine routes user input through worker selection to function execution. To launch a tokenized agent, deploy via the Virtuals app on Base; the SDK then runs the agent's compute layer while the ERC-20 governs ownership.
06Gotchas
  • GAME SDK is Python-first; the TypeScript SDK lags in feature parity — check feature support before committing.
  • Function descriptions are the only signal the planner has — vague descriptions cause wrong-tool selection and wasted LLM calls.
  • Agent ERC-20 supply is fixed at launch; once tokenomics ship, you cannot change distribution without a new token.
  • GAME platform meters LLM + tool calls against your `GAME_API_KEY` — set a per-run budget to cap cost.
  • Twitter agents under Virtuals can be rate-limited or suspended; persist outbound state and back-off on 429s.
  • Onchain custody for an agent's treasury must be a smart-account (Safe / 4337) — do not stash a hot key in the Function layer.
07Alternatives