The caller pays an actor’s call fee, and the actor’s balance pays for its runner jobs and off-chain calls.
Actors
An actor is a Python class that holds state and money. Every handler must give the same result wherever it runs, so an actor doesn’t reach the network or its files itself: runners do that for it. Build your first actor builds one.Runner jobs
A runner job is one call to a model, a web API or an MCP tool, made on the actor’s behalf by a runner, a machine that does work for actors. To use one, write the handler asasync def and await the job:
Output
--stub-llm stands in for the model, and the state the run prints has answer set to 4.
Web and tool calls need the http.fetch permission at deploy, naming the hosts they may reach (Deploy it with web access). Call models, the web and tools covers the rest.
Off-chain functions
An off-chain function is your own code, run by a runner in a container, one call at a time. It can use any library, which makes it the place for work a handler can’t do. To add one to a project:Output
actors/fn/main.py, and a starter Python function in offchain/. The actor imports it and calls it like any async function:
--offchain-runtime node writes a Node function instead. cowboy check shows how one call is priced, and you can try a call on your machine with cowboy run fn --handler compute --payload-json 100.
Workloads
A workload is a long-running service that an actor owns, reachable at a URL. You can write it in Node, Python or Rust. To add one to a project:Output
[workloads.api] entry. Run a web app or service goes on from there.