Skip to main content
1

Generate your API key

Head to the Plato dashboard and copy your API key. Keep this secure - you’ll need it for all API requests.
Your API key provides access to your Plato environments. Never share it publicly or commit it to version control.
2

Install the SDK

Install the Plato SDK v2:
uv add plato-sdk-v2
Or with pip:
pip install plato-sdk-v2
3

Set up your environment variables

Set your API key in your environment:
export PLATO_API_KEY=your_api_key_here
The SDK will automatically use this environment variable.
4

Create your first session

Create a session with an environment and start interacting:
import asyncio
from plato.v2 import AsyncPlato, Env

async def main():
    # Initialize the client
    plato = AsyncPlato()

    # Create a session with an espocrm environment
    session = await plato.sessions.create(
        envs=[Env.simulator("espocrm")]
    )

    try:
        # Reset to initial state
        await session.reset()

        # Get the public URL to access the application
        urls = await session.get_public_url()
        print(f"Access your environment at: {urls}")

        # Execute a command
        result = await session.execute("whoami")
        print(f"Running as: {result}")

        # Get the current state
        state = await session.get_state()
        print(f"State: {state}")

    finally:
        # Always clean up
        await session.close()
        await plato.close()

asyncio.run(main())
5

Explore the API

Now that you have a working environment, explore the full API:
# Multiple environments
session = await plato.sessions.create(
    envs=[
        Env.simulator("espocrm", alias="crm"),
        Env.simulator("gitea", alias="git"),
    ]
)

# Access specific environments
crm = session.get_env("crm")
await crm.execute("ls -la /app")

# Create snapshots
snapshot = await session.snapshot()

# Evaluate task completion
result = await session.evaluate()

What’s Next?

Need Help?

  • Installation issues? Make sure you have Python 3.10+ and try uv --version to verify uv is installed
  • Authentication problems? Double-check your API key is set: echo $PLATO_API_KEY
  • Session not starting? Check your network connection and verify your API key has access