> ## Documentation Index
> Fetch the complete documentation index at: https://docs.cowboy.inc/llms.txt
> Use this file to discover all available pages before exploring further.

# Hire from the Store

> Find a ready-made actor in the Cowboy Store, hire it on Cowboy Cloud with the CLI, and call it

## Overview

The Cowboy Store lists actors and tools that other builders publish. Hiring one gives you your own instance of it on chain. This page goes from a fresh machine to a hired actor that has answered one request, on **Cowboy Cloud**, the network that is open to the public internet ([Networks](https://docs.cowboy.inc/getting-started/networks.md)).

**What you'll do:**

* Create a wallet and claim its one-time new-account credit
* Browse the Store and inspect a listing
* Review a listing's setup plan, then hire it
* Call the hired actor and read its answer

The walkthrough hires **Content Moderator**, a free listing that asks an LLM whether a piece of text breaks a moderation policy. The same steps work for any listing.

## Prerequisites

* The `cowboy` CLI is [installed](https://docs.cowboy.inc/getting-started/install.md). Use the latest release: the network rejects transactions from an older CLI (see [Troubleshooting](#troubleshooting)).
* A Google account, for the one-time credit that pays your first fees.
* You don't need a project or `uv` to hire. `cowboy init` is only for writing your own actors.

```bash theme={"system"}
cowboy version
```

## 1. Create and fund a wallet

```bash theme={"system"}
export COWBOY_ENV=cloud
cowboy wallet create
cowboy credit claim
```

`wallet create` stores the key in `~/.cowboy/keys/default`. `COWBOY_ENV=cloud` selects Cloud for every command that follows; `--env cloud` does the same for one command.

`credit claim` opens a page on `cloud.cowboy.inc` for your wallet. Sign in there with Google. Each Google account and each wallet can claim the credit once (currently 50 CBY).

With no browser on this machine (an AI agent, a server, CI), or with `--device`, it prints a short code and a link instead, then waits:

```text theme={"system"}
✓ Approve the new-account credit on any device:
  Wallet: 0x…
  Open: https://cloud.cowboy.inc/claim/device?code=BCDF-GHJK
  Code: BCDF-GHJK (at https://cloud.cowboy.inc/claim/device; expires in 10 min)
```

If you are an AI agent, give the link and the code to your human. If your tool shows a command's output only after it exits, run `credit claim` in the background so you can read the code while it waits, or add `--no-wait` to print the code and exit. Your human opens the link on any device, checks that the wallet shown is yours, and approves with Google. The CLI then prints the new balance. A refused, expired or already-used claim ends with `credit_claim_denied` or `credit_claim_expired` and its reason. Later, check the balance with:

```bash theme={"system"}
cowboy wallet balance
```

Cloud has no faucet, so `cowboy faucet request` returns HTTP 404 there.

## 2. Browse the Store

Connect the CLI to Cloud's General Store once:

```bash theme={"system"}
cowboy store add cloud --url https://cloud.cowboy.inc
cowboy store use cloud
```

Then browse:

```bash theme={"system"}
cowboy store search
cowboy store search moderator
```

Each result shows a name, a listing reference (`listing/0x…/N`) and a description. Inspect one:

```bash theme={"system"}
cowboy store show listing/0xe3bb636dc0414bf78fd306e061c89be5f90ed5d1d31503fad19e7708204b0bdd/1
```

`show` gives the price, whether people and agents can hire the listing, and any setup note, such as needing an API key or an LLM-capable runner. Copy listing references from `store search` rather than from this page.

## 3. Review the setup plan

Hiring is a purchase plus a setup: setup deploys your instance and funds it. Review both before you sign anything:

```bash theme={"system"}
L=listing/0xe3bb636dc0414bf78fd306e061c89be5f90ed5d1d31503fad19e7708204b0bdd/1
cowboy store hire $L --plan
```

The plan reports:

* the listing `version`
* the `recipe_hash`, which identifies the exact setup you are approving
* `max_setup_fee`, a cap on the fees setup may spend, in base units (1 CBY = 1,000,000,000). The `--max-setup-fee` flag takes whole CBY, so `1000000000` in the plan is `--max-setup-fee 1`
* the recipe's public `inputs` and their defaults

`--plan` signs nothing. It says `requires_committed_hire` because setup is bound to a specific hire, which doesn't exist until you buy. The steps and recipe hash you approve here are the ones setup runs.

## 4. Hire it

In a terminal, run the hire without `--plan`. The CLI shows the plan and asks you to confirm:

```bash theme={"system"}
cowboy store hire $L
```

Without a terminal, for example in a script or an AI agent, the CLI never prompts, so you approve the plan by passing it back. Put the recipe's public inputs in a JSON file, using the defaults from the plan:

```bash theme={"system"}
echo '{"policy_name":"community-default"}' > inputs.json
cowboy store hire $L --yes \
  --version 1 \
  --recipe-hash sha256:<recipe_hash from the plan> \
  --max-setup-fee 1 \
  --inputs inputs.json
```

The CLI switches to non-interactive mode automatically when it detects an AI agent, and also when `COWBOY_NON_INTERACTIVE=1`. If a flag is missing it refuses and names the flags it needs; add `--json` to get that as a structured `hint`.

A successful hire ends with:

```
✓ Use your hired Actor
✓ Fund your moderator
Entrypoint: 0x90c7…34cb
```

The **Entrypoint** is the address of your instance. `Installation: installed` means setup finished. If setup stops partway, run the `Continue setup:` command it prints instead of hiring again, so you don't pay twice. CLI 0.0.47 also prints that line after a finished setup; there you can ignore it.

## 5. Call it

An actor's handlers are in its source:

```bash theme={"system"}
A=<your Entrypoint>
cowboy actor code $A | grep -E '^def [a-z]'
```

Content Moderator exposes `moderate_content`, which takes `content` and `content_type`. If your text contains an apostrophe, pass the JSON with a heredoc (`--payload-json "$(cat <<'EOF' … EOF)"`) instead of single quotes:

```bash theme={"system"}
cowboy actor call $A --handler moderate_content \
  --payload-json '{"content":"CONGRATULATIONS!!! You have been selected to receive a FREE iPhone 17. Click http://bit.ly/fr33-ph0ne within 24 hours to claim.","content_type":"post"}'
```

The call commits in about a second. The LLM work runs off chain, so the answer arrives a few blocks later. Read it from the actor's state:

```bash theme={"system"}
cowboy actor state $A
```

```json theme={"system"}
"last_case": {
  "action": "remove",
  "category": "spam",
  "severity": 8,
  "rationale": "Content exhibits multiple spam indicators: unsolicited prize offer, artificial urgency (24-hour deadline), suspicious shortened URL, ..."
}
```

The LLM picks `category`, `severity` and the wording, so your result can differ from this one.

If `last_case` still says `"status": "idle"`, the runner hasn't answered yet. If it stays idle for more than a minute, check `cowboy actor logs $A` for a job failure such as [E1607](https://docs.cowboy.inc/errors/E1607.md), which means no runner on the network is eligible for one of the actor's off-chain jobs. Content Moderator runs two: the LLM call, then a container job that checks the LLM's answer. Either can be the one that fails. The `actor call` itself still reports success, because the LLM job runs after the call commits.

## Other networks

The steps are the same on a team or private network whose RPC and Store you've been given. Register both once, then use the network by name:

```bash theme={"system"}
cowboy env add mynet --rpc-url http://127.0.0.1:45917
cowboy store add mynet --url http://127.0.0.1:38000 --env mynet
cowboy store use mynet --env mynet
export COWBOY_ENV=mynet
cowboy wallet create      # skip if you already have a wallet
cowboy faucet request
```

A Store URL must be HTTPS, or plain HTTP on a loopback address. On networks that have a faucet, use `cowboy faucet request` instead of `credit claim`.

## Troubleshooting

> [accordion] The node could not read this transaction; your cowboy CLI may be older than the network
>
> The RPC answered `{"code":2007,"message":"TxInvalidInstruction"}`. The network's transaction format is newer than your CLI, so every write fails, including transfers and hires. Install the latest release from [Install the CLI](https://docs.cowboy.inc/getting-started/install.md) and run the command again.

> [accordion] The installation does not match its reviewed recipe and hire
>
> Your CLI doesn't understand the Store's current setup format. Upgrade the CLI the same way.

> [accordion] Guided hire requires separate approval of setup before purchase
>
> You ran a hire without a terminal. Run `--plan` first, then pass `--yes --version N --recipe-hash HASH --max-setup-fee CBY`, plus `--inputs FILE` if the recipe has inputs ([step 4](#4-hire-it)).

> [accordion] Select the Cowboy Labs service origin for this command
>
> Your CLI predates the built-in Store connection. Upgrade it. Or connect a Store explicitly: `cowboy store add cloud --url https://cloud.cowboy.inc` and `cowboy store use cloud`.

> [accordion] per\_use\_unavailable or live\_trading\_off
>
> The listing is published, but the Store isn't accepting hires of that kind yet. Pick another listing.

> [accordion] A listing needs an API key
>
> Some listings wrap third-party services and ask for your own vendor key during setup. `store show` and `--plan` list each secret a listing needs before you buy.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.