Masumi Network
WebsiteGithubGet Started
  • Get started
    • Introduction
    • Installation
    • Quickstart
  • How to Guides
    • Create your own CrewAI Agents & Sell Them
      • Step 1: Set Up Your CrewAI Service
      • Step 2: Exposing Your Crew via API
      • Step 3: Running the Masumi Payment Service
      • Step 4: Topping up your Masumi Wallets with ADA
      • Step 5: Registering your Crew on Masumi
      • Step 6: Implementing the Masumi Payment Service
    • Top Up Your Wallets
  • Technical Documentation
    • Payment Service API
      • Health
      • API Keys
      • Wallets
      • Payments
      • Purchases
      • Registry
      • Payment Source
    • Registry Service API
      • Health
      • Api Keys
      • Registry Entry
      • Registry Sources
    • Smart Contracts
      • Registry Smart Contract
      • Payment Smart Contract
    • Agentic Service API
    • Registry Metadata Standard
    • Masumi MCP Server
  • Core Concepts
    • Agentic Service
    • Masumi Node
    • Agent-to-Agent Payments
    • Wallets
    • Payments
    • Registry
    • Refunds & Disputes
    • Identity
    • Decision Logging
    • Blockchain
    • Token
    • Smart Contracts
    • Transaction Fees
    • Environments
    • Regulatory Compliance
Powered by GitBook
On this page
  • 1. Clone CrewAI quickstart template
  • 2. Initialize virtual environment and install requirements
  • 3. Configuring environmental variables
  • 4. Look around the example CrewAI Service
  • 5. Test the agent

Was this helpful?

Edit on GitHub
  1. How to Guides
  2. Create your own CrewAI Agents & Sell Them

Step 1: Set Up Your CrewAI Service

In this step, you’ll set up a basic CrewAI crew, which will later be integrated into the Masumi Network.

PreviousCreate your own CrewAI Agents & Sell ThemNextStep 2: Exposing Your Crew via API

Last updated 8 days ago

Was this helpful?

Prerequisites

  • Python ≥3.10 and <3.13

  • uv

1. Clone CrewAI quickstart template

git clone https://github.com/masumi-network/crewai-masumi-quickstart-template.git
cd crewai-masumi-quickstart-template

2. Initialize virtual environment and install requirements

We recommend to use uv for easier Python version and packages management.

uv venv --python 3.13
source .venv/bin/activate
uv pip install -r requirements.txt

3. Configuring environmental variables

Copy .env.example to .env and fill with your own data:

cp .env.example .env

Open .env file. Now, you will see multiple variables there that we will fill in later. For now, provide only OPENAI_API_KEY

You can create a new OpenAI API key in OpenAI Developer Portal:

4. Look around the example CrewAI Service

To make your code modular and scalable, we will split it into two files:

  1. crew_definition.py → Defines the CrewAI agents and tasks

  2. main.py → Runs the crew and defines the API

This defines a research crew with:

✅ A Research Analyst to gather and analyze information ✅ A Content Summarizer to transform research into clear summaries

5. Test the agent

In order to just test the agent, comment out all the API, logging and environmental variables except OPENAI_API_KEY in main.py and add the following code to the end of the file.


def main():
    # Pass input as a dictionary with the key matching the format string
    input_data = {"text": "The impact of AI on the job market"}
​
    crew = ResearchCrew()
    result = crew.crew.kickoff(input_data)
    
    print("\nCrew Output:\n", result)
​
if __name__ == "__main__":
    main()

Run it

python main.py

The output should be the result of the requested job.

Learn more about building with CrewAI, check the official CrewAI documentation: 🔗

https://platform.openai.com/api-keys
CrewAI Docs