Quickstart
This guide shows how to use Notte with Steel to run a simple task in a live cloud browser, then shut everything down safely.
Requirements
-
Steel API key
-
Gemini API key
-
Python 3.11+
Step 1: Project Setup
Create a virtual environment and a minimal project:
python3 -m venv .venv && \source .venv/bin/activate && \mkdir notte-steel && cd notte-steel && \touch main.py .env
Step 2: Install Dependencies
pip install steel-sdk notte python-dotenv
Step 3: Environment Variables
Create a .env
file with your API keys and a default task:
1STEEL_API_KEY=your-steel-api-key-here2GEMINI_API_KEY=your-gemini-api-key-here3TASK="Go to Wikipedia and search for machine learning"
Step 4: Initialize Steel & Notte, then Connect via CDP
Set up Steel, load env vars, and prepare to start the Notte agent.
1import os2import time3import asyncio4from dotenv import load_dotenv5from steel import Steel6import notte78load_dotenv()910# Replace with your own API keys11STEEL_API_KEY = os.getenv("STEEL_API_KEY") or "your-steel-api-key-here"12GEMINI_API_KEY = os.getenv("GEMINI_API_KEY") or "your-gemini-api-key-here"1314# Replace with your own task15TASK = os.getenv("TASK") or "Go to Wikipedia and search for machine learning"
Step 5: Run a Notte Agent Task
Create a Steel session, connect Notte via CDP, run your task, and print the result.
1async def main():2print("๐ Steel + Notte Assistant")3print("=" * 60)45if STEEL_API_KEY == "your-steel-api-key-here":6print("โ ๏ธ WARNING: Please replace 'your-steel-api-key-here' with your actual Steel API key")7print(" Get your API key at: https://app.steel.dev/settings/api-keys")8return910if GEMINI_API_KEY == "your-gemini-api-key-here":11print("โ ๏ธ WARNING: Please replace 'your-gemini-api-key-here' with your actual Gemini API key")12print(" Get your API key at: https://console.cloud.google.com/apis/credentials")13return1415print("\nStarting Steel browser session...")1617client = Steel(steel_api_key=STEEL_API_KEY)1819try:20session = client.sessions.create()21print("โ Steel browser session started!")22print(f"View live session at: {session.session_viewer_url}")2324print(25f"\033[1;93mSteel Session created!\033[0m\n"26f"View session at \033[1;37m{session.session_viewer_url}\033[0m\n"27)2829cdp_url = f"{session.websocket_url}&apiKey={STEEL_API_KEY}"3031start_time = time.time()3233print(f"๐ฏ Executing task: {TASK}")34print("=" * 60)3536try:37with notte.Session(cdp_url=cdp_url) as notte_session:38agent = notte.Agent(39session=notte_session,40max_steps=5,41reasoning_model="gemini/gemini-2.0-flash"42)43response = agent.run(task=TASK)4445duration = f"{(time.time() - start_time):.1f}"4647print("\n" + "=" * 60)48print("๐ TASK EXECUTION COMPLETED")49print("=" * 60)50print(f"โฑ๏ธ Duration: {duration} seconds")51print(f"๐ฏ Task: {TASK}")52if response:53print(f"๐ Result:\n{response.answer}")54print("=" * 60)5556except Exception as e:57print(f"โ Task execution failed: {e}")58finally:59if session:60print("Releasing Steel session...")61client.sessions.release(session.id)62print(f"Session completed. View replay at {session.session_viewer_url}")63print("Done!")6465except Exception as e:66print(f"โ Failed to start Steel browser: {e}")67print("Please check your STEEL_API_KEY and internet connection.")686970if __name__ == "__main__":71asyncio.run(main())
Run It
Youโll see a session viewer URL in your console, open it to watch the automation live.
Full Example
Complete main.py
you can paste and run:
"""AI-powered browser automation using notte-sdk with Steel browsers.https://github.com/steel-dev/steel-cookbook/tree/main/examples/steel-notte-starter"""import osimport timeimport asynciofrom dotenv import load_dotenvfrom steel import Steelimport notteload_dotenv()# Replace with your own API keysSTEEL_API_KEY = os.getenv("STEEL_API_KEY") or "your-steel-api-key-here"GEMINI_API_KEY = os.getenv("GEMINI_API_KEY") or "your-gemini-api-key-here"# Replace with your own taskTASK = os.getenv("TASK") or "Go to Wikipedia and search for machine learning"async def main():print("๐ Steel + Notte Assistant")print("=" * 60)if STEEL_API_KEY == "your-steel-api-key-here":print("โ ๏ธ WARNING: Please replace 'your-steel-api-key-here' with your actual Steel API key")print(" Get your API key at: https://app.steel.dev/settings/api-keys")returnif GEMINI_API_KEY == "your-gemini-api-key-here":print("โ ๏ธ WARNING: Please replace 'your-gemini-api-key-here' with your actual Gemini API key")print(" Get your API key at: https://console.cloud.google.com/apis/credentials")returnprint("\nStarting Steel browser session...")client = Steel(steel_api_key=STEEL_API_KEY)try:session = client.sessions.create()print("โ Steel browser session started!")print(f"View live session at: {session.session_viewer_url}")print(f"\033[1;93mSteel Session created!\033[0m\n"f"View session at \033[1;37m{session.session_viewer_url}\033[0m\n")cdp_url = f"{session.websocket_url}&apiKey={STEEL_API_KEY}"start_time = time.time()print(f"๐ฏ Executing task: {TASK}")print("=" * 60)try:with notte.Session(cdp_url=cdp_url) as notte_session:agent = notte.Agent(session=notte_session,max_steps=5,reasoning_model="gemini/gemini-2.0-flash")response = agent.run(task=TASK)duration = f"{(time.time() - start_time):.1f}"print("\n" + "=" * 60)print("๐ TASK EXECUTION COMPLETED")print("=" * 60)print(f"โฑ๏ธ Duration: {duration} seconds")print(f"๐ฏ Task: {TASK}")if response:print(f"๐ Result:\n{response.answer}")print("=" * 60)except Exception as e:print(f"โ Task execution failed: {e}")finally:if session:print("Releasing Steel session...")client.sessions.release(session.id)print(f"Session completed. View replay at {session.session_viewer_url}")print("Done!")except Exception as e:print(f"โ Failed to start Steel browser: {e}")print("Please check your STEEL_API_KEY and internet connection.")if __name__ == "__main__":asyncio.run(main())
Next Steps
-
Steel Python SDK: https://github.com/steel-dev/steel-python
-
Cookbook example: https://github.com/steel-dev/steel-cookbook/tree/main/examples/steel-notte-starter
-
Notte Documentation: https://docs.notte.cc/intro/what-is-notte