Skip to content

CrewAI apps

A CrewAI project runs as a script. To run it on request, put it behind one web endpoint.

requirements.txt adds fastapi and uvicorn[standard] to your crew’s own requirements. main.py:

from fastapi import FastAPI
from my_project.crew import MyProjectCrew # the class `crewai create` made
app = FastAPI()
@app.get("/health")
def health():
return {"ok": True}
@app.post("/kickoff")
def kickoff(inputs: dict):
result = MyProjectCrew().crew().kickoff(inputs=inputs)
return {"output": result.raw}

Then stillbox deploy --health /health in the project’s folder. Stillbox sees FastAPI and starts uvicorn main:app.

A crew can take minutes. The sandbox sleeps only after five minutes with no activity, so a crew that is working keeps it awake.