Skip to content

AutoGPT is the vision of accessible AI for everyone, to use and to build on. Our mission is to provide the tools, so that you can focus on what matters.

security(platform/backend): Add health endpoint (#8341)

Aarushi2d0e51fe28df
diff --git a/autogpt_platform/backend/backend/server/rest_api.py b/autogpt_platform/backend/backend/server/rest_api.py
index 4e84da2292..6860f3f60f 100644
--- a/autogpt_platform/backend/backend/server/rest_api.py
+++ b/autogpt_platform/backend/backend/server/rest_api.py
@@ -75,6 +75,14 @@ class AgentServer(AppService):
allow_headers=["*"], # Allows all headers
)
+ health_router = APIRouter()
+ health_router.add_api_route(
+ path="/health",
+ endpoint=self.health,
+ methods=["GET"],
+ tags=["health"],
+ )
+
# Define the API routes
api_router = APIRouter(prefix="/api")
api_router.dependencies.append(Depends(auth_middleware))
@@ -632,6 +640,9 @@ class AgentServer(AppService):
execution_scheduler = self.execution_scheduler_client
return execution_scheduler.get_execution_schedules(graph_id, user_id)
+ async def health(self):
+ return {"status": "healthy"}
+
@classmethod
def update_configuration(
cls,