opsen
opsen

Client reference

Every method, with what it returns.

Client

methodreturns
Client(api_key, base_url=..., timeout=60.0)Client
session(task_id, budget_usd=None, runtime="auto", labels=None, ...)Session
get_session(session_id)Session
sessions()list[Session]
stuck_sessions()list[Session]
costs(group_by="labels.customer")list[dict]
task_cost(task_id)Cost
events(since=0.0)list[dict]
provider_keys()list[dict]
add_provider_key(provider, key, label=..., base_url=...)dict
close()None

Session

methodreturns
exec(cmd, timeout=600)dict — stdout, stderr, exit_code
fs.write(path, bytes)None
fs.read(path)bytes
cost()Cost
host(port)str — raises where the runtime has no public address
suspend() / resume() / kill()None
refresh()None
retag(task_id)dict
call_model(payload)dict — the gateway, called directly

Cost

total_usd  compute_usd  tokens_usd  tools_usd
calls  failed_calls  tool_calls
input_tokens  output_tokens
wall_seconds  active_seconds
per_call_usd()