opsen
opsen

The command line

For running something now, and for pipelines that need an exit code that means what it looks like.

pip install opsen
export OPSEN_API_KEY=osk_...

Run a file

opsen run agent.py
opsen run agent.py --budget 2.00 --task invoice-extract
opsen run agent.py --json

Three properties that make this safe in a pipeline:

  • Output on stdout, cost on stderr. opsen run x.py > result.txt contains the result.
  • The exit code is your agent's. opsen run x.py && deploy reads the way it looks.
  • Our own failures use 2, so "the script returned 1" and "opsen could not run it" are distinguishable.

Tasks and cost

opsen tasks
opsen cost invoice-extract

Run over many inputs

opsen batch invoice-extract inputs.txt --cap 5.00 --width 5
ls *.pdf | opsen batch invoice-extract -

--cap is the ceiling on the whole batch, not per run. A hundred inputs at the task's own cap is a number nobody does in their head while typing.