Skip to main content

Overview

game-plugin-oneshot is a Python package that exposes 7 OneShot tools as a Virtuals Protocol GAME worker. It handles x402 payment signing automatically so your GAME agents can send emails, make phone calls, run research, buy products, and build websites.
This plugin builds on langchain-oneshot under the hood — it reuses the same HTTP + x402 payment flow, so all payments are signed locally via eth-account.

Installation

pip install game-plugin-oneshot

Requirements

  • Python 3.10+
  • A wallet private key (for x402 payment signing)
  • USDC on Base Mainnet
  • A Virtuals GAME API key

Dependencies

PackagePurpose
game-sdkVirtuals GAME Agent / Worker interfaces
langchain-oneshotHTTP client + x402 payment signing
eth-accountEIP-712 typed data signing (via langchain-oneshot)

Quick Start

import os
from game_sdk.game.agent import Agent
from game_plugin_oneshot import OneShotPlugin

plugin = OneShotPlugin(
    private_key=os.environ["WALLET_PRIVATE_KEY"],
)

# Create a GAME agent
agent = Agent(
    api_key=os.environ["GAME_API_KEY"],
    name="my-agent",
    agent_description="An agent that can interact with the real world",
)

# Add OneShot tools as a worker
agent.add_worker(plugin.get_worker())
agent.run()
The SDK operates on Base Mainnet with real USDC. Fund your agent wallet before making paid tool calls.

Available Tools

See Pricing for current tool costs.
ToolDescription
oneshot_emailSend emails to real recipients
oneshot_smsSend SMS text messages
oneshot_voiceMake phone calls with AI voice
oneshot_researchDeep research reports with sources
oneshot_commerce_searchSearch for products
oneshot_commerce_buyPurchase products online
oneshot_buildGenerate and deploy websites
oneshot_browserAutonomous browser — navigate, click, extract
oneshot_browser_create_profileCreate persistent browser profile
oneshot_browser_list_profilesList all browser profiles
oneshot_browser_delete_profileDelete a browser profile
oneshot_get_balanceGet USDC wallet balance
The plugin exposes 12 OneShot tools — the ones most useful for autonomous GAME agents. Inbox and notification tools are omitted since GAME agents don’t typically need them.

How Payments Work

All paid tools use the x402 protocol. The flow is fully automatic:
  1. Your GAME agent invokes a tool (e.g. oneshot_email)
  2. The plugin POSTs to the OneShot API
  3. The API returns 402 Payment Required with a USDC quote
  4. The plugin signs a TransferWithAuthorization (EIP-3009) locally using your private key
  5. The plugin re-POSTs with the signed payment in the x-payment header
  6. The API processes the job and returns the result
Your private key never leaves your machine. All signing happens locally via eth-account.

Complex Arguments

GAME Argument only supports scalar types (string, int, float, bool). For tools that need structured input like commerce_buy and build, pass JSON strings:
# The GAME agent will generate these automatically,
# but for manual testing:
import json

shipping = json.dumps({
    "first_name": "John",
    "last_name": "Doe",
    "street": "123 Main St",
    "city": "Austin",
    "state": "TX",
    "zip_code": "78701",
    "phone": "+15551234567",
})

product = json.dumps({
    "name": "Acme SaaS",
    "description": "Project management for teams",
})
You don’t need to handle this manually — the GAME agent’s LLM will generate JSON strings for structured arguments automatically. This section is for debugging and manual testing.

Configuration

plugin = OneShotPlugin(private_key="0x...")

# Custom API URL
plugin = OneShotPlugin(private_key="0x...", base_url="https://custom-api.example.com")
ParameterDefaultDescription
private_keyrequiredHex-encoded Ethereum private key
base_urlNoneOverride API URL

Environment Variables

# Required
WALLET_PRIVATE_KEY=0x...    # Ethereum private key for x402 payments
GAME_API_KEY=...            # Virtuals GAME API key

# Optional
ONESHOT_BASE_URL=...        # Override API endpoint

PyPI Package

View on PyPI

Virtuals Protocol

Virtuals Protocol platform

TypeScript SDK

TypeScript SDK docs

LangChain SDK

LangChain integration