storrito.ai's API. You send a small Clojure program. The program asks for what it wants as data, and storrito.ai carries that out for the organization of your API key. POST https://storrito.ai/rep// Authorization: Bearer the body: the program, plain text, at most 32768 characters a UUID in small letters that you make. The runs of a session share an isolate, and nothing a program wrote. this request's id, 1 to 64 of A-Z a-z 0-9 . _ - . The same id with the same program answers the same run again and never starts a second one. curl -sS https://storrito.ai/rep/00000000-0000-4000-8000-000000000001/1 \ -H "Authorization: Bearer $STORRITO_KEY" --data-binary '{:next {:call (agents) :as :agents}}' The answer is EDN, one map: {:ended :done, :steps 1, :printed "" :state {:agents […]}}. :state is the final state. :ended says how the run ended: :done status 200 :error status 200, your program's error under :error :cap status 200, which cap under :cap :refused with a sentence under :error: 409 for an id that ran or runs, 429 for a bound, 401 for a key The header Rep-Outcome says the same word, and Rep-Replayed: true marks a repeat's answer. The bounds: 60 runs a minute for a key; 2000 runs and 100 new sessions in 24 hours for your organization, all its keys together. Without a paid top-up: 100 runs and 10 new sessions in 24 hours. A run asks for at most 50 calls and takes at most 60 seconds. A call is asked once in a run: the same call again is answered what the first was. Run again to see a change. A command is carried out once in a run too: for two agents of one template, send two requests. After a command that changed something the queries are asked anew. A run asks for the agents and the connections, (agents), (agent id) and (connections), at most 6 times. A command acts as your organization, and what it writes names your key. Agents: at most 3 at the same time, 20 hires in 24 hours, dismissed ones among them, and none at a balance of zero or less. Connections: at most 10 begun in an hour and 30 in a day. A call that failed has :error and :status under its key, and the program decides. :carried-out true beside them says that a command was carried out all the same: look before you send it again. A run that a cap ended in the middle of a call says :asked true with the :call: it may have been carried out. No key yet? An agent gets one for its person's organization by itself, with two calls that need no key: 1. POST https://storrito.ai/rep/register The body is nothing, or an EDN map: {:label "what the key is for" :email "your person's address"}, each optional. The answer: {:registration … :link … :secret … :fetch … :expires … :retry-after 5 :tell …}. 2. Show your person the :link, and nothing else of the answer. They open it, sign in or sign up, and press "Give this agent a key". The link is good for ten minutes. 3. Meanwhile POST the :fetch address every 5 seconds, with "Authorization: Bearer ": 202 {:registration :waiting} your person did not answer yet 200 {:registration :done :key "sai_key_…"} once: keep the key, it is not shown again 410 {:registration :over} it ran out, was refused or was fetched: begin a new one curl -sS -X POST https://storrito.ai/rep/register --data-binary '{:label "Agent on my laptop"}' curl -sS -X POST https://storrito.ai/rep/register/ -H "Authorization: Bearer " The key is an ordinary API key of the organization your person is signed in to. They see it under API keys on the dashboard and can delete it there. A machine: a Clojure program whose value is a map, its state. Nothing runs inside the program. 1. A function such as (templates) answers a call, a vector led by a keyword. It does nothing by itself. 2. One call goes under :next of the state, with the key its answer goes under: {:next {:call (templates) :as :templates}}. 3. The host carries the call out and puts the answer under that key; a failed call answers {:error "…"} there. 4. With (defn step [state] …) defined, the host calls step with the state after every answer and carries out the :next it returns, until a state with :done or without :next. One call per step. 5. The answer to the program is the final state, or which error or which cap ended the machine, with the state then. The calls: (templates) a query: An empty vector. Templates are gone: every hire is the standard agent, (hire!). The call stays, so that a program that asks goes on. (agents) a query: Your organization's agents, the oldest first: a vector of {:id :template :state :address}. :id is the agent's UUID, :template the id of the template an agent of before was hired from, nil for the standard agent, :state one of :ready, :starting, :failed and :unknown (its machine could not be asked), :address where the agent is, https://.storrito.run: its own REPL is at POST
/rep// with the same key. (agent id) a query: One agent of your organization by its id: {:id :template :state :address}, as (agents) has it. An id that is none of your organization's agents fails: {:error "There is no such agent." :status 404}. (balance) a query: Your organization's balance: {:amount :currency}. :amount is a whole number of millionths, 12500000 is 12.50; :currency is "USD". (connections) a query: Your organization's social connections, the oldest first: a vector of {:id :connected :platform :handle}. :id is the connection's UUID, :connected whether an account is connected in it now, :platform the account's platform as bundle.social names it ("INSTAGRAM", "TIKTOK", …) and :handle its user name, both nil while nothing is connected. bundle.social is asked when you ask; when it cannot be asked the call fails: {:error "…" :status 502}. (hire! [template]) a command: Hires an agent for your organization: (hire!) the standard agent. (hire! template) hires the same standard agent; the name is not looked at. One agent is the default and keeps billing and connections simple. The answer is {:id :template :state :address}, as (agents) has it, with :state :starting and :template nil. Its machine is made after the answer and takes two or three minutes: ask (agent id) in a later run until :state is :ready; :failed says that it did not start in half an hour. A refusal fails the call, a sentence under :error and a :status: 402 a balance of zero or less, 409 as many agents as your organization may have at the same time, 429 the hires of 24 hours, 403 your organization may not hire, 503 not right now. (dismiss! id) a command: Dismisses an agent of your organization for good: {:id :dismissed}, :dismissed true. Its machine is removed with everything on it, and nothing brings it back. An id that is none of your organization's agents fails as (agent id) does: {:error "There is no such agent." :status 404}. (connect-account! platform) a command: Begins a connection of your organization for one social account, and answers the link that a person opens to connect it: {:id :platform :url}. :id is the new connection's UUID, as (connections) has it; :platform as you named it; :url bundle.social's page for it, where the person signs in to the platform, and lands on storrito.ai's dashboard after. (connections) says :connected false for it until then. platform is one of BLUESKY, DISCORD, FACEBOOK, GOOGLE_BUSINESS, INSTAGRAM, LINKEDIN, MASTODON, PINTEREST, REDDIT, SLACK, SNAPCHAT, THREADS, TIKTOK, TWITTER, YOUTUBE. Beyond the connections your organization may begin in an hour and in a day the call fails: {:error "…" :status 429}. (help) and (doc f) answer maps, {:help "…"} and {:doc "…"}: a program that is just (help) is a machine that shows it. Mistakes: (templates) on a line of its own does nothing and is refused: put it under :next. (:id (templates)) is nil: the function answers the call, the answer is in the state of the next step. A value that is no map, such as (+ 1 2), is refused. A function, a pattern or an object in the state is refused. A def or an atom keeps nothing from one step to the next: the program is evaluated anew for every step. The language: Clojure's core for data, with clojure.edn as edn/, clojure.set as set/, clojure.string as str/, clojure.walk as walk/. No JavaScript, no file and no network: a machine has data and calls.