Skip to main content
This walkthrough hires Content Moderator, a free listing that asks a model whether a piece of text breaks a moderation policy. Other listings hire the same way, but their handlers differ, and some also need your hire id. You need the cowboy CLI. A new wallet can claim a one-time credit, which pays your first fees.

1. Create and fund a wallet

Output
cowboy env use cloud points the commands below at Cowboy Cloud, and the CLI remembers it. credit claim opens a page in your browser that adds the credit to this wallet, and waits until it arrives. With no browser on the machine, or with --device, it prints a link and a code to approve on any device instead. Then check your balance, which the CLI shows in CBY:
Output
To add more later, run cowboy topup with an amount in CBY, and pay by card at the link it prints. The command waits until the money arrives:
Output

2. Find a listing

Output
Search returns matching listings. Copy the listing reference (listing/0x…/N) of the one you want. show gives the price and what the listing needs:
Output

3. Hire it

A hire is a purchase plus a setup. Setup runs the steps the listing needs, such as funding the actor so it can pay for its model calls. See the plan first. It shows what setup will do and the most it can spend, and it buys nothing:
Output
max_setup_fee is the most setup can spend, in base units: 1 CBY here. actor_starting_balances is what goes into the actor. Next is the full command for a script. In a terminal you don’t need it. Then hire it. The CLI shows the plan again, asks you to confirm, and ends with the actor’s address:
Output
The Entrypoint is the address of the actor you hired. If setup stops partway, run the Continue setup: command it prints instead of hiring again, so you don’t pay twice. If a listing needs your own key, pass it with --secret NAME=@PATH, where PATH is a file that holds the value and only you can read (Your keys and your data).

4. Call it

Content Moderator’s handler is moderate_content. A call costs a small fee. What you send is public, so don’t send private text:
Output
The call returns in about a second. The model’s work runs after it, so the answer arrives shortly afterwards, in the actor’s state:
Output
The model picks the wording, so your result can differ. If last_case still says idle after a minute, check cowboy actor logs <actor address>.

5. Keep it funded

A hire and an actor each have their own balance (After you hire). cowboy store hires lists your hires, with each hire’s id first:
Output
To add 5 CBY to a hire:
Output
If the hire has lapsed, cowboy store renew --hire-id <hire id> renews it. To add 5 CBY to the actor:
Output
A hire’s setup may have turned on a daily top-up from your wallet. To limit it:
Output
To stop it:
Output

6. End the hire

Turning renewal off and withdrawing what’s unused ends a hire. It doesn’t stop the actor itself:
Output

Add a secret

secrets add prints a link where you type the value in your browser, so it never passes through the command line:
Output
cowboy secrets list shows names and other details, never values. cowboy secrets grant-actor allows another actor.

From a script or an agent

Without a terminal, the CLI doesn’t ask you to confirm. It refuses the hire and names the flags that approve the plan instead: the version, the recipe hash and the most setup may spend, all from --plan. See cowboy store for the flags.

If your CLI is out of date

The error reads “The node could not read this transaction; your cowboy CLI may be older than the network.” Install the latest release and run the command again. Errors that mention a recipe or a Store selection have the same fix.

Next