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:

Terminal
python3 -m venv .venv && \
source .venv/bin/activate && \
mkdir notte-steel && cd notte-steel && \
touch main.py .env

Step 2: Install Dependencies

Terminal
pip install steel-sdk notte python-dotenv

Step 3: Environment Variables

Create a .env file with your API keys and a default task:

ENV
.env
1
STEEL_API_KEY=your-steel-api-key-here
2
GEMINI_API_KEY=your-gemini-api-key-here
3
TASK="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.

Python
main.py
1
import os
2
import time
3
import asyncio
4
from dotenv import load_dotenv
5
from steel import Steel
6
import notte
7
8
load_dotenv()
9
10
# Replace with your own API keys
11
STEEL_API_KEY = os.getenv("STEEL_API_KEY") or "your-steel-api-key-here"
12
GEMINI_API_KEY = os.getenv("GEMINI_API_KEY") or "your-gemini-api-key-here"
13
14
# Replace with your own task
15
TASK = 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.

Python
main.py
1
async def main():
2
print("๐Ÿš€ Steel + Notte Assistant")
3
print("=" * 60)
4
5
if STEEL_API_KEY == "your-steel-api-key-here":
6
print("โš ๏ธ WARNING: Please replace 'your-steel-api-key-here' with your actual Steel API key")
7
print(" Get your API key at: https://app.steel.dev/settings/api-keys")
8
return
9
10
if GEMINI_API_KEY == "your-gemini-api-key-here":
11
print("โš ๏ธ WARNING: Please replace 'your-gemini-api-key-here' with your actual Gemini API key")
12
print(" Get your API key at: https://console.cloud.google.com/apis/credentials")
13
return
14
15
print("\nStarting Steel browser session...")
16
17
client = Steel(steel_api_key=STEEL_API_KEY)
18
19
try:
20
session = client.sessions.create()
21
print("โœ… Steel browser session started!")
22
print(f"View live session at: {session.session_viewer_url}")
23
24
print(
25
f"\033[1;93mSteel Session created!\033[0m\n"
26
f"View session at \033[1;37m{session.session_viewer_url}\033[0m\n"
27
)
28
29
cdp_url = f"{session.websocket_url}&apiKey={STEEL_API_KEY}"
30
31
start_time = time.time()
32
33
print(f"๐ŸŽฏ Executing task: {TASK}")
34
print("=" * 60)
35
36
try:
37
with notte.Session(cdp_url=cdp_url) as notte_session:
38
agent = notte.Agent(
39
session=notte_session,
40
max_steps=5,
41
reasoning_model="gemini/gemini-2.0-flash"
42
)
43
response = agent.run(task=TASK)
44
45
duration = f"{(time.time() - start_time):.1f}"
46
47
print("\n" + "=" * 60)
48
print("๐ŸŽ‰ TASK EXECUTION COMPLETED")
49
print("=" * 60)
50
print(f"โฑ๏ธ Duration: {duration} seconds")
51
print(f"๐ŸŽฏ Task: {TASK}")
52
if response:
53
print(f"๐Ÿ“‹ Result:\n{response.answer}")
54
print("=" * 60)
55
56
except Exception as e:
57
print(f"โŒ Task execution failed: {e}")
58
finally:
59
if session:
60
print("Releasing Steel session...")
61
client.sessions.release(session.id)
62
print(f"Session completed. View replay at {session.session_viewer_url}")
63
print("Done!")
64
65
except Exception as e:
66
print(f"โŒ Failed to start Steel browser: {e}")
67
print("Please check your STEEL_API_KEY and internet connection.")
68
69
70
if __name__ == "__main__":
71
asyncio.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:

Python
main.py
"""
AI-powered browser automation using notte-sdk with Steel browsers.
https://github.com/steel-dev/steel-cookbook/tree/main/examples/steel-notte-starter
"""
import os
import time
import asyncio
from dotenv import load_dotenv
from steel import Steel
import notte
load_dotenv()
# Replace with your own API keys
STEEL_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 task
TASK = 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")
return
if 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")
return
print("\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