The-Swarm-Corporation

Agent API Example — AI skill for Claude Code

AI community

A production-grade REST API for deploying and managing AI agents in the cloud.

How to install Agent API Example

This entry records only its repository, not the path inside it, so there is no exact command to give. Open The-Swarm-Corporation/agent-api-example and copy the folder into ~/.claude/skills/, or the file into ~/.claude/agents/.

What Agent API Example does

A production-grade REST API for deploying and managing AI agents in the cloud. This API provides a scalable and secure way to create, manage, and interact with AI agents.

Alternatives in AI

  • AutoGroq — AutoGroq is a groundbreaking tool that revolutionizes the way users interact with Autogen™ and other AI assist 1.5k ★
  • Phantom — An AI co-worker with its own computer 1.3k ★
  • Openclaw Dashboard — 🔐 Secure, real-time monitoring dashboard for OpenClaw AI agents 654 ★

README

AgentAPI

[![Join our Discord](https://img.shields.io/badge/Discord-Join%20our%20server-5865F2?style=for-the-badge&logo=discord&logoColor=white)](https://discord.gg/agora-999382051935506503) [![Subscribe on YouTube](https://img.shields.io/badge/YouTube-Subscribe-red?style=for-the-badge&logo=youtube&logoColor=white)](https://www.youtube.com/@kyegomez3242) [![Connect on LinkedIn](https://img.shields.io/badge/LinkedIn-Connect-blue?style=for-the-badge&logo=linkedin&logoColor=white)](https://www.linkedin.com/in/kye-g-38759a207/) [![Follow on X.com](https://img.shields.io/badge/X.com-Follow-1DA1F2?style=for-the-badge&logo=x&logoColor=white)](https://x.com/kyegomezb)

[![Swarms Framework](https://img.shields.io/badge/Built%20with-Swarms-blue)](https://github.com/kyegomez/swarms)

AgentAPI is a reference implementation for serving a [Swarms](https://github.com/kyegomez/swarms) agent as an HTTP service. It provides a minimal FastAPI application, a container image, and the configuration required to deploy a single agent to production.

Overview

The service exposes one agent, constructed once at application startup, behind two endpoints: a health check and a task execution endpoint. The complete application is contained in `api/api.py`.

from fastapi import FastAPI
from swarms import Agent

app = FastAPI()

agent = Agent(agent_name="Researcher", model_name="claude-sonnet-4-5", max_loops=1)


@app.get("/health")
def health():
    return {"status": "ok"}


@app.post("/run")
def run(body: dict):
    task = body.get("task")
    if task is None:
        return {"error": "Missing 'task' in request body"}
    output = agent.run(task)
    return {"output": output}

Repository layout:

Path Description
api/api.py FastAPI application and agent definition
api/requirements.txt Python dependencie