Skip to main content

Solana Agent

PyPI - Version Python 3.13-3.14 PyPI - Downloads License: MIT codecov Build Status Ruff Style

Public SDK for the hosted Solana Agent platform.

The public package is intentionally small:

  • One agent per client instance.
  • Hosted chat and hosted wallet flows.
  • Hosted account and pricing APIs.
  • MCP plugin support for external tools.

Python Support

We support the current and previous CPython minor versions.

Today that means:

  • Python 3.14
  • Python 3.13

Install

pip install solana-agent

Quick Start

Use the Solana Agent CLI to get a new privy_user_id from the interactive menu:

uvx solana-agent@latest wallet menu

The generated privy_user_id is saved automatically in the user-local Solana Agent app data directory on Windows, macOS, and Linux. Passing privy_user_id= or config.ai.privy_user_id still overrides the saved value.

from solana_agent import SolanaAgent

agent = SolanaAgent(
    instructions="You are a Solana trading bot.",
    privy_user_id="my-privy-user-id",
)

context = await agent.context(
    conversation_id="my-conversation-id",
    model="chat",
)

response = await agent.message(
    message="What is the price of SOL?",
    **context
)

print(response)

Hosted Search

For live web and X results in hosted chat, enable the hosted search add-on:

uvx solana-agent@latest chat --search-enabled

When you start hosted chat without a local config.json, the CLI now asks once at startup whether to enable hosted search for that session.

Hosted Memory

context = await agent.context(
    conversation_id="my-conversation-id",
    model="memory",
    memory_ttl_tier="project",
)

Priority Service Tier

context = await agent.context(
    service_tier="priority",
)

MCP Tools

Connect Streamable HTTP MCP servers by enabling the mcp tool and adding server config:

import os
from solana_agent import SolanaAgent

agent = SolanaAgent(
    config={
        "ai": {
            "instructions": "Use connected MCP tools when they help the user.",
            "privy_user_id": os.environ["PRIVY_USER_ID"],
            "tools": ["mcp"],
        },
        "tools": {
            "mcp": {
                "servers": [
                    {
                        "url": os.environ["MCP_SERVER_URL"],
                        "headers": {
                            "Authorization": f"Bearer {os.environ['MCP_SERVER_TOKEN']}",
                        },
                    }
                ],
                "llm_provider": "openai",
                "api_key": os.environ["OPENAI_API_KEY"],
                "llm_model": "gpt-4.1-mini",
            }
        },
    }
)

context = await agent.context(
    conversation_id="mcp-demo",
    model="chat",
)

response = await agent.message(
    "Use the connected MCP tools to summarize my latest CRM tasks.",
    **context,
)

print(response)

Wallet and Billing Helpers

wallet_address = await agent.get_wallet_address()

summary = await agent.get_account_summary()

report = await agent.get_usage_report(
    "month"
)

forecast = await agent.get_usage_forecast(
    window_days=30,
)

pricing = await agent.get_pricing_info()

tooling_totals = summary.get("tooling", {}).get("lifetime", {}).get("totals", {})
tooling_projection = (
    forecast.get("tooling", {})
    .get("projected_month_end", {})
    .get("totals", {})
)

print(tooling_totals)
print(tooling_projection)

Private Key Export

Export the hosted wallet private key when you want self-custody:

uvx solana-agent@latest wallet export --yes

Pass --wallet-id to export an older rotated wallet from old_wallets.

Rotating Wallets

If a wallet needs to be retired, rotate it from the interactive menu: 2 3bash 4uvx solana-agent@latest wallet menu 5

Smoke Testing

For a live hosted smoke run from the CLI, use the dev-gated wallet smoke command or the dev-only wallet menu item:

uvx solana-agent@latest wallet smoke --dev
uvx solana-agent@latest wallet menu --dev

The smoke preview prints a funding estimate in USDC before the live chat checks run. Search-enabled checks are included by default; wallet rotation and private-key export checks are opt-in. Use --include-memory to add hosted memory recall checks for both the 7-day work tier and the 30-day project tier. Use --include-priority to add priority validation for chat and any enabled memory checks. Use --big to add the full expanded profile: memory 7-day and 30-day checks, priority chat and memory, Jupiter and Birdeye read checks, along with token math, technical analysis, swap, trigger, and earn checks. Use --include-transfer --transfer-recipient <wallet> [--transfer-amount-usdc 0.10] when you want the smoke run to execute a live USDC transfer. Add --json to wallet smoke when you want machine-readable output instead of tables.

For source-checkout debugging against a local hosted API, run one permanent step at a time with scripts/smoke_step_runner.py:

SOLANA_AGENT_SMOKE_PRIVY_USER_ID=did:privy:your-funded-user \
python scripts/smoke_step_runner.py trigger_limit_order --mode full-response

The runner loads ../solana-agent-agi/.env by default, targets http://127.0.0.1:8000/v1, and prints JSON including the wallet id, wallet address, step name, and response.

Metadata

Release files for solana-agent 34.0.13

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for solana-agent 34.0.13
File Size Uploaded
solana_agent-34.0.13.tar.gz 70.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for solana-agent 34.0.13
File Interpreter ABI Platform
solana_agent-34.0.13-py3-none-any.whl Python 3 none any Details

Total release size: 151.6 kB

Release files / solana_agent-34.0.13.tar.gz

Download URL solana_agent-34.0.13.tar.gz
Size 70.0 kB
Tags Source
SHA-256 checksum
How to use checksums
749a8f6c156c7e73eb7bf30f9c187c62f49b5f38e60dc1f69e276499f0b6443d
BLAKE2b-256 checksum
How to use checksums
68951c862d075c5ef275cf94026246298e8e4709215fbdf210f40f803bed7c8e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.9.25

Release files / solana_agent-34.0.13-py3-none-any.whl

Download URL solana_agent-34.0.13-py3-none-any.whl
Size 81.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
548eba6dfb9b451d57164dcea953cf294c4f4327f37c890c060c7a93760419ad
BLAKE2b-256 checksum
How to use checksums
c09bd7ee0dc12446eec6b5aa657c0435e5f5a33e24391f8c004a76447e069253
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.9.25

Release history Release notifications | RSS feed

This release

34.0.13 This release

2 release files

33.2.1

2 release files

33.2.0

2 release files

33.1.1

2 release files

33.1.0

2 release files

33.0.0

2 release files

32.1.0

2 release files

32.0.0

2 release files

31.7.0

2 release files

31.3.0

2 release files

31.2.6

2 release files

31.2.5

2 release files

31.2.4

2 release files

31.2.3

2 release files

31.1.5

2 release files

31.1.4

2 release files

31.1.3

2 release files

31.1.2

2 release files

31.1.1

2 release files

31.1.0

2 release files

30.0.9

2 release files

30.0.7

2 release files

30.0.2

2 release files

30.0.1

2 release files

30.0.0

2 release files

29.3.0

2 release files

29.2.3

2 release files

29.2.2

2 release files

29.2.1

2 release files

29.2.0

2 release files

29.1.5

2 release files

29.1.4

2 release files

29.1.3

2 release files

28.3.1

2 release files

28.3.0

2 release files

28.2.1

2 release files

28.2.0

2 release files

28.1.1

2 release files

28.1.0

2 release files

28.0.0

2 release files

27.5.0

2 release files

27.4.3

2 release files

27.4.2

2 release files

27.4.1

2 release files

27.4.0

2 release files

27.3.9

2 release files

27.3.8

2 release files

27.3.7

2 release files

27.3.6

2 release files

27.3.5

2 release files

27.3.4

2 release files

27.3.3

2 release files

27.3.2

2 release files

27.3.1

2 release files

27.3.0

2 release files

27.2.0

2 release files

27.1.0

2 release files

21.0.0

2 release files

20.1.5

2 release files

20.1.4

2 release files

20.1.3

2 release files

20.1.2

2 release files

20.1.1

2 release files

20.1.0

2 release files

20.0.0

2 release files

19.1.1

2 release files

19.1.0

2 release files

19.0.2

2 release files

19.0.1

2 release files

19.0.0

2 release files

18.0.1

2 release files

18.0.0

2 release files

17.1.9

2 release files

17.1.8

2 release files

17.1.7

2 release files

17.1.6

2 release files

17.1.5

2 release files

17.1.4

2 release files

17.1.3

2 release files

17.1.2

2 release files

17.1.1

2 release files

17.1.0

2 release files

17.0.8

2 release files

17.0.7

2 release files

17.0.6

2 release files

17.0.5

2 release files

17.0.4

2 release files

17.0.3

2 release files

17.0.2

2 release files

17.0.1

2 release files

17.0.0

2 release files

16.0.0

2 release files

15.1.3

2 release files

15.1.2

2 release files

15.1.1

2 release files

15.1.0

2 release files

15.0.0

2 release files

14.0.2

2 release files

14.0.1

2 release files

14.0.0

2 release files

12.0.0

2 release files

11.3.0

2 release files

11.2.0

2 release files

11.1.1

2 release files

11.1.0

2 release files

11.0.1

2 release files

11.0.0

2 release files

10.0.0

2 release files

8.1.0

2 release files

8.0.3

2 release files

8.0.2

2 release files

8.0.1

2 release files

8.0.0

2 release files

7.0.0

2 release files

6.0.1

2 release files

6.0.0

2 release files

5.0.0

2 release files

4.0.3

2 release files

4.0.2

2 release files

4.0.1

2 release files

4.0.0

2 release files

3.0.2

2 release files

3.0.1

2 release files

3.0.0

2 release files

2.1.3

2 release files

2.1.2

2 release files

2.1.1

2 release files

2.1.0

2 release files

2.0.1

2 release files

2.0.0

2 release files

1.4.4

2 release files

1.4.3

2 release files

1.4.2

2 release files

1.4.1

2 release files

1.4.0

2 release files

1.3.1

2 release files

1.3.0

2 release files

1.2.0

2 release files

1.1.2

2 release files

1.1.1

2 release files

1.1.0

2 release files

1.0.2

2 release files

1.0.1

2 release files

1.0.0

2 release files

0.0.22

2 release files

0.0.21

2 release files

0.0.20

2 release files

0.0.19

2 release files

0.0.18

2 release files

0.0.17

2 release files

0.0.16

2 release files

0.0.15

2 release files

0.0.14

2 release files

0.0.13

2 release files

0.0.12

2 release files

0.0.11

2 release files

0.0.10

2 release files

0.0.9

2 release files

0.0.8

2 release files

0.0.7

2 release files

0.0.6

2 release files

0.0.5

2 release files

0.0.4

2 release files

0.0.3

2 release files

0.0.2

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page