opsen
opsen

Quickstart

An agent on a real machine, and what it cost, in about two minutes.

1. Get a key

Create an account and copy a key from the keys page. It starts osk_ and is shown once.

export OPSEN_API_KEY=osk_...

2. Install

pip install opsen

Zero runtime dependencies. The client uses only the standard library, so it cannot conflict with whatever your agent framework already pins.

3. Run something

import os
from opsen_client import Client

opsen = Client(os.environ["OPSEN_API_KEY"])

with opsen.session(task_id="hello", budget_usd=1.00) as s:
    s.fs.write("agent.py", b"print('hello from a real machine')")
    out = s.exec("python3 agent.py")
    print(out["stdout"])
    print(s.cost())

The with block matters: leaving it stops the machine. A sandbox nobody stopped bills until the reaper catches it.

4. Or from the command line

opsen run agent.py

Output goes to stdout and the cost to stderr, so opsen run agent.py > result.txt gives you the result and not the accounting. The exit code is your agent's, not ours.

Runs draw from your balance. Machine time is typically a fraction of a percent of a run — the model bill is almost all of it — but it is real money, and /costs shows the split.