Repository

build-deploy-monetize-ai-agents

Build, deploy, and monetize AI agents

README

Build, deploy, and monetize AI agents

Build a real AI agent, ship it to the Apify platform, and turn it into something people (and
other agents) can pay to use - all from this one forked repo.

How it works

In about 40 minutes you will build an AI agent and take it through the full Apify Actor
lifecycle: build, deploy, and monetize.

This is a live, build-along workshop. We pick one example use case and build it together,
end to end, while explaining each step:

  • We scaffold a starter, build an AI agent on top of it, then run, deploy, and monetize it live.
  • You follow along in your own fork. This repo is your project root, so you scaffold and build
    your Actor right here, in place.
  • Each step ends with a "now do this for your own project" nudge, so by the end you can swap the
    example for your own idea and take it straight into your hackathon.

The example is chosen on the day. It is just a vehicle for the lifecycle, so anything you build
follows the same shape.

An Actor is a serverless program on
the Apify platform: it takes JSON input, does a task, and
writes results to a dataset. That simple
shape is all you need to build, deploy, monetize, and eventually run a full AI agent.

New to Apify? Skim What is Apify and
Actors before you start. A full link list lives in
Resources at the bottom.

Scope

What we cover, in order. Each step builds on the last.

  1. Step 1: Setup and your first Actor (~10 min)
  2. Step 2: Build your agent (~20 min)
  3. Step 3: Deploy (~10 min)
  4. Step 4: Monetize and publish (~10 min)
  5. Step 5: Use Apify in your hackathon project (~5 min)

Prerequisites

  • An Apify account and an API token (you create
    the token in Apify Console). You can sign
    up for free and most of the workshop runs on the free tier.
  • Node.js 22+ - the Apify CLI runs on
    Node.
  • Python 3.10+ - for your Actor and the AI agent in
    step 2.
  • An AI coding tool with Agent Skills support - Claude Code,
    Cursor, or similar. You will install an Apify skill into it.
  • An LLM API key for step 2 - Anthropic and/or OpenAI. Set ANTHROPIC_API_KEY and/or
    OPENAI_API_KEY in your environment.

Note: The Apify free tier includes monthly usage credits, which is plenty for this
workshop. This event also includes a coupon (AABW2026) for extra credits for your own
project - redeem it under Settings > Billing in
Apify Console early so the credits are ready when you need them (details in
step 5).


Step 1: Setup and your first Actor

Install your tools and create, run, and inspect your first Actor locally - no Apify
account needed yet.

Time: ~10 minutes

1. Install Node.js and Python

Make sure you have the runtimes the workshop needs:

node --version    # should be 22 or higher
python --version  # should be 3.10 or higher

If either is missing or too old, install it before continuing.

2. Install the Apify CLI

The Apify CLI is how you create, run, and deploy Actors from
your terminal. See the installation guide for
other install methods.

npm install -g apify-cli
apify --version

You should see a version number printed.

3. Set your LLM API key

You will need this in step 2, so set it now. Add one or both to your shell environment:

export ANTHROPIC_API_KEY="sk-ant-..."
export OPENAI_API_KEY="sk-..."

Tip: Add these to your shell profile (for example ~/.zshrc) so they persist across
sessions. Never commit keys to the repo.

4. Install the Apify Actor Development skill

This skill teaches your AI coding tool how to scaffold, build, and deploy Actors. It powers the
vibe-coding in step 2.

npx skills add https://github.com/apify/agent-skills --skill apify-actor-development

Pick the apify-actor-development skill when prompted. You can browse all available skills in
the apify/agent-skills repo, and read what this one
does in its SKILL.md.

5. Create your first Actor

From the root of this repo, scaffold a basic Python Actor:

apify create

When prompted, choose Python or JavaScript and the LangGraph AI agent template. The CLI
creates your Actor's files in place. Browse every starter at
Apify Actor templates, and read the
Python SDK docs or JavaScript SDK docs for how Actor code is structured.
JavaScript SDK docs for how Actor code is structured.

6. Tour the structure

Open the files the CLI created and find these (all defined in the
Actor definition docs):

  • .actor/actor.json -
    your Actor's metadata and configuration.
  • .actor/input_schema.json -
    the shape of the JSON input your Actor accepts.
  • src/ - your Actor's code (the main entry point lives here).
  • Dockerfile -
    how your Actor is built and run on the Apify platform.

7. Run it locally

apify run

The Actor runs on your machine. When it finishes, look in the storage/ folder: your output
is written to storage/datasets/default/, and any input it read is in
storage/key_value_stores/default/. See the
Storage docs for how datasets and key-value stores
work.

Note: The Actor model is just this: JSON input goes in, the Actor runs a task, and
results go out to a dataset. Everything else in this workshop builds on that shape.

Resources

Continue to Step 2: Build your agent.


Step 2: Build your agent

This is the heart of the workshop. Turn your starter Actor into a real AI agent: a reasoning
loop that calls tools and writes its results to a dataset.

Time: ~20 minutes

1. Understand the pattern

An AI agent on Apify is just an Actor with three parts:

  • The agent loop runs inside the Actor. The Actor's code drives an LLM that reasons, decides
    what to do next, and repeats until the task is done.
  • Apify Actors are the tools. When the agent needs real data or an action, it calls another
    Actor from Apify Store (a scraper, a search Actor, your own Actor)
    over the API.
  • The dataset is the output. Whatever the agent produces gets written to the dataset, just
    like in step 1.

You can hand-wire the loop yourself with
LangGraph (pip install langgraph), or let a
framework run it for you with the
OpenAI Agents SDK
(pip install openai-agents, from agents import Agent, Runner). Use whichever you prefer.
Either way, point it at the latest Claude
or OpenAI model and check the provider docs for the
current model id.

Tip: You don't have to wire each tool by hand. Point your agent at the
Apify MCP server (https://mcp.apify.com)
and it can discover and call thousands of Apify Store Actors as
MCP tools, with no per-tool glue code.

2. Pick your agent

Pick the example we build together in this workshop, or bring your own. Keep it small enough to
finish in this step: one clear input, one tool Actor, one useful output.

3. Vibe-code it with your AI tool

You installed the apify-actor-development skill in step 1, so let your AI coding tool build it
for you. Describe the agent and let it scaffold and implement the code in this repo. For
example:

Build an AI agent inside this Actor. It takes a {your input} as input, uses the
{an Apify Store Actor} Actor as a tool to fetch data, runs an agent loop with
{LangGraph or the OpenAI Agents SDK} on the latest Claude model, and writes the
{your result} to the dataset. Add the LLM API key as a secret input in the input
schema so it works both locally and once deployed. Follow the Apify Actor
Development skill.

Let the tool update your input schema, add dependencies, and write the loop. Review what it
generates.

4. Run it locally

apify run

Pass your input, watch the agent loop in the logs, and check the result in
storage/datasets/default/. This is the payoff - a working agent on your machine before you
deploy anything.

Tip: If the agent calls another Actor as a tool, it needs an Apify API token at runtime.
The quickest way is to run apify login now (covered in step 3) - apify run then injects
your token automatically as APIFY_TOKEN, and the
Apify client for Python picks it up with no extra
setup. Or export APIFY_TOKEN manually if you run the script outside apify run.

Resources

Continue to Step 3: Deploy.


Step 3: Deploy

Your agent works locally. Now deploy it to the Apify platform so it runs in the cloud and can
be started by anyone, or any agent, over the API.

Time: ~10 minutes

1. Get your API token

In Apify Console, open Settings > API & Integrations and copy your personal API token. See
API integration for details.

2. Log in from the CLI

apify login

Paste your API token when prompted. This links the CLI to your Apify account. It also lets your
local apify run reach Actors you use as tools, so if you skipped logging in during step 2,
this covers it.

3. Add your LLM key to the platform

Your local runs read the LLM key from your shell, but the deployed Actor needs its own copy.
Store it as a secret, then reference it from your input schema or environment:

apify secrets add ANTHROPIC_API_KEY "sk-ant-..."

Note: Secrets you add with apify secrets live on the Apify platform and are injected at
runtime, encrypted at rest and redacted from logs. Without this, the deployed run fails at the
first model call - the key in your shell never leaves your machine. See
secret environment variables
and secret inputs.

4. Push your Actor

apify push

This builds your Actor on the Apify platform and uploads your code. When it finishes, the CLI
prints a link to your Actor in Apify Console.

5. Run it in Apify Console

Open the link, fill in the input, and click Start. When the run finishes, open the
Dataset tab to confirm your agent produces the same result it did locally, now on the Apify
platform. The Running Actors docs walk through
this in Apify Console.

6. Note the API endpoint

Every Actor has a run endpoint, so you (or another agent) can trigger it over HTTP from anywhere:

https://api.apify.com/v2/acts/<your-username>~<actor-name>/runs?token=<API_TOKEN>

This is how your agent gets called in production. See
Run Actor and retrieve data via API
and the Apify API reference.

7. Or start it over MCP

Your Actor is also reachable through the Apify MCP server, so any MCP client - Claude, Cursor,
or another agent - can discover and run it as a tool. Point the client at
https://mcp.apify.com (OAuth on first use). Combined with pay per event, this is how an
autonomous agent finds and pays for your Actor. See
Apify MCP server.

Resources

Continue to Step 4: Monetize and publish.


Step 4: Monetize and publish

Your agent runs on the platform. Now publish it to Apify Store and put a price on it, so other
people, and other agents, can discover, run, and pay for it.

Time: ~10 minutes

1. Add your billing details

Before you can monetize, add your billing and payout details in Apify Console under
Settings > Billing. This is a prerequisite for receiving payouts.

2. Publish to Apify Store

Open your Actor in Apify Console, go to the Publication tab, complete the publish checklist,
and submit it to Apify Store. A public Actor is what other people (and agents) can discover and
run. See Publish your Actor for the
full checklist.

3. Choose a pricing model

The Apify platform supports a few pricing models. For an AI agent, focus on:

  • Pay per usage - users pay only for the platform resources their run consumes.
  • Pay per event (PPE) - users pay for specific events you define, such as each result
    produced. This is the most flexible model for agents.

4. Set up monetization

In the Publication tab, open Monetization and follow the wizard (full walkthrough in
Monetize your Actor):

  1. Actor pricing - choose your pricing model and configure the events or rates.
  2. Primary event - pick the one event that best represents the value your Actor delivers
    (for example, one result returned).
  3. Review - confirm everything, then submit.

Note: Pay-per-event Actors with limited permissions automatically become eligible for
autonomous agent payment over protocols like x402 and Skyfire. There is no separate opt-in,
so an AI agent can discover and pay for your Actor on its own. Pay-per-usage Actors are not
eligible.

5. Track your earnings

Once your Actor has paying users, find your earnings in Apify Console under Insights. Payout
invoices are generated automatically each month.

Resources

Continue to Step 5: Use Apify in your hackathon project.


Step 5: Use Apify in your hackathon project

See how Apify speeds up your hackathon project - both as an AI agent you build from
this repo and as thousands of ready-made Actors you can plug straight in.

Build your own AI agent from this repo

You now have the full lifecycle working. Fork this repo and use it as the starting point for your
own agent: the pattern stays fixed (loop, tools, dataset), and you change only three parts:
the input, the tool Actor it calls, and the output it writes. Let your AI coding tool plus the
apify-actor-development skill scaffold and write it, and keep the LLM API key as a secret input
so it works locally and once deployed. When it works, deploy and publish it just like in steps
2 to 4.

Don't build from scratch - use ready-made Actors

You do not have to build everything yourself. Apify Store has
thousands of ready-made Actors - scrapers, data extractors, integrations, and AI tools - that
you can use in your project in three ways:

  • As MCP tools, with zero glue code - point your AI coding tool or agent at the
    Apify MCP server (https://mcp.apify.com)
    and every Store Actor becomes a tool it can discover and call. The fastest way to give an agent
    real capabilities during a hackathon.
  • As tools your agent calls directly - wire a Store Actor into your agent with the
    Apify client for Python, exactly like the workshop
    agent did.
  • As building blocks in any project - call a Store Actor over the
    API from any stack to get data or automation without writing
    the scraper or integration yourself. Even if your hackathon project is not an AI agent, this is
    the fastest way to get real data into it.

Browse Apify Store, find an Actor for your domain, and wire it in.

Your hackathon Apify credits

We are giving away Apify credits for this hackathon. Redeem the coupon code below under
Settings > Billing in Apify Console to top up your
account, then use it for your hackathon project - running Actors, deploying your agent, and
calling Store Actors.

Coupon code: AABW2026

Note: Redeem the coupon early so the credits are ready when you need them. Apify credits
cover Actor runs and platform usage; LLM API calls still bill your own Anthropic or OpenAI
account.

Resources

That is the full lifecycle, plus everything Apify gives you for your hackathon. Now go build. Back
to the top: Build, deploy, and monetize AI agents.


Resources

Everything linked across the steps, grouped for quick reference.

Platform and Actors

CLI and SDKs

Actor definition and storage

Running over the API and MCP

Publishing and monetization

AI agents and tooling

Back to the top: Build, deploy, and monetize AI agents.