{"id":29642961,"url":"https://github.com/The-Swarm-Corporation/AgentAPIProduction","last_synced_at":"2025-07-21T23:02:10.101Z","repository":{"id":270672991,"uuid":"911109097","full_name":"The-Swarm-Corporation/AgentAPIProduction","owner":"The-Swarm-Corporation","description":"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.","archived":false,"fork":false,"pushed_at":"2025-01-20T14:03:05.000Z","size":81,"stargazers_count":4,"open_issues_count":1,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-24T02:07:40.975Z","etag":null,"topics":["agents","ai","api","cloudrun","docker","fastapi","ml","swarms"],"latest_commit_sha":null,"homepage":"https://swarms.ai","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/The-Swarm-Corporation.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null},"funding":{"github":["kyegomez"]}},"created_at":"2025-01-02T09:08:21.000Z","updated_at":"2025-04-09T11:49:50.000Z","dependencies_parsed_at":"2025-04-24T02:07:44.011Z","dependency_job_id":"2a1ea3fb-2b36-422d-835f-3898e0187922","html_url":"https://github.com/The-Swarm-Corporation/AgentAPIProduction","commit_stats":null,"previous_names":["the-swarm-corporation/agentapiproduction"],"tags_count":0,"template":false,"template_full_name":"The-Swarm-Corporation/Swarms-Example-1-Click-Template","purl":"pkg:github/The-Swarm-Corporation/AgentAPIProduction","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/The-Swarm-Corporation%2FAgentAPIProduction","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/The-Swarm-Corporation%2FAgentAPIProduction/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/The-Swarm-Corporation%2FAgentAPIProduction/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/The-Swarm-Corporation%2FAgentAPIProduction/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/The-Swarm-Corporation","download_url":"https://codeload.github.com/The-Swarm-Corporation/AgentAPIProduction/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/The-Swarm-Corporation%2FAgentAPIProduction/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266398442,"owners_count":23922461,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-07-21T11:47:31.412Z","response_time":64,"last_error":null,"robots_txt_status":null,"robots_txt_updated_at":null,"robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["agents","ai","api","cloudrun","docker","fastapi","ml","swarms"],"created_at":"2025-07-21T23:01:40.697Z","updated_at":"2025-07-21T23:02:10.065Z","avatar_url":"https://github.com/The-Swarm-Corporation.png","language":"Python","funding_links":["https://github.com/sponsors/kyegomez"],"categories":["🛠️ Development Tools \u0026 Platforms"],"sub_categories":["Core Platforms \u0026 Operating Systems"],"readme":"# Swarms Agent API\n\n[![Join our Discord](https://img.shields.io/badge/Discord-Join%20our%20server-5865F2?style=for-the-badge\u0026logo=discord\u0026logoColor=white)](https://discord.gg/agora-999382051935506503) [![Subscribe on YouTube](https://img.shields.io/badge/YouTube-Subscribe-red?style=for-the-badge\u0026logo=youtube\u0026logoColor=white)](https://www.youtube.com/@kyegomez3242) [![Connect on LinkedIn](https://img.shields.io/badge/LinkedIn-Connect-blue?style=for-the-badge\u0026logo=linkedin\u0026logoColor=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\u0026logo=x\u0026logoColor=white)](https://x.com/kyegomezb)\n\nA 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.\n\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n[![Python 3.11+](https://img.shields.io/badge/python-3.11+-blue.svg)](https://www.python.org/downloads/)\n[![Docker](https://img.shields.io/badge/docker-supported-brightgreen.svg)](https://www.docker.com/)\n\n## Features\n\n- 🚀 Create and manage multiple AI agents\n- 🔄 Process completions with rate limiting and error handling\n- 📊 Track agent metrics and performance\n- 🔒 Built-in security features\n- 🎯 Horizontal scaling support\n- 🛠️ Easy deployment with Docker\n- 💫 Graceful shutdown handling\n- 🔍 Comprehensive logging\n- ⚡ High-performance FastAPI backend\n\n## Quick Start\n\n### Prerequisites\n\n- Python 3.11+\n- Docker (optional)\n- OpenAI API key (or other LLM provider key)\n\n### Local Development Setup\n\n1. Clone the repository:\n```bash\ngit clone https://github.com/The-Swarm-Corporation/AgentAPIProduction.git\ncd agent-api\n```\n\n2. Create and activate a virtual environment:\n```bash\npython -m venv venv\nsource venv/bin/activate  # On Windows: .\\venv\\Scripts\\activate\n```\n\n3. Install dependencies:\n```bash\npip install -r requirements.txt\n```\n\n4. Create a `.env` file:\n```env\nOPENAI_API_KEY=your_api_key_here\nPORT=8080\nWORKSPACE_DIR=agent_workspace\n```\n\n5. Run the server:\n```bash\npython -m uvicorn api.api:app --host 0.0.0.0 --port 8080 --reload\n```\n\n### Docker Deployment\n\n1. Build the Docker image:\n```bash\ndocker build -t agent-api .\n```\n\n2. Run the container:\n```bash\ndocker run -d \\\n  -p 8080:8080 \\\n  -e OPENAI_API_KEY=your_api_key_here \\\n  -e PORT=8080 \\\n  --name agent-api \\\n  agent-api\n```\n\n## API Documentation\n\n### Base URL\n```\nhttp://localhost:8080/v1\n```\n\n### Endpoints\n\n#### Create Agent\n```http\nPOST /v1/agent\n```\n```json\n{\n  \"agent_name\": \"string\",\n  \"model_name\": \"string\",\n  \"description\": \"string\",\n  \"system_prompt\": \"string\",\n  \"temperature\": 0.1,\n  \"max_loops\": 1\n}\n```\n\n#### List Agents\n```http\nGET /v1/agents\n```\n\n#### Process Completion\n```http\nPOST /v1/agent/completions\n```\n```json\n{\n  \"prompt\": \"string\",\n  \"agent_id\": \"uuid\",\n  \"max_tokens\": null,\n  \"temperature_override\": 0.5\n}\n```\n\n#### Get Agent Metrics\n```http\nGET /v1/agent/{agent_id}/metrics\n```\n\nFor full API documentation, visit `/v1/docs` or `/v1/redoc` after starting the server.\n\n## Rate Limiting\n\nThe API implements rate limiting with the following defaults:\n- 2 requests per second\n- 30 requests per minute\n- 1000 requests per hour\n- 10000 requests per day\n\n## Deployment Considerations\n\n### Production Environment\n\nFor production deployment, consider:\n\n1. Using a reverse proxy (e.g., Nginx)\n2. Implementing SSL/TLS\n3. Setting up monitoring (e.g., Prometheus + Grafana)\n4. Using environment-specific configuration\n5. Implementing proper backup strategies\n\nExample `docker-compose.yml` for production:\n\n```yaml\nversion: '3.8'\n\nservices:\n  agent-api:\n    build: .\n    ports:\n      - \"8080:8080\"\n    environment:\n      - OPENAI_API_KEY=${OPENAI_API_KEY}\n      - PORT=8080\n    volumes:\n      - agent_data:/app/agent_workspace\n    healthcheck:\n      test: [\"CMD\", \"curl\", \"-f\", \"http://localhost:8080/health\"]\n      interval: 30s\n      timeout: 3s\n      retries: 3\n    restart: unless-stopped\n\nvolumes:\n  agent_data:\n```\n\n### Cloud Deployment\n\nThe API can be deployed to various cloud providers:\n\n#### AWS Elastic Beanstalk\n```bash\neb init -p docker agent-api\neb create production\n```\n\n#### Google Cloud Run\n```bash\ngcloud builds submit --tag gcr.io/PROJECT_ID/agent-api\ngcloud run deploy agent-api --image gcr.io/PROJECT_ID/agent-api\n```\n\n#### Azure Container Instances\n```bash\naz container create \\\n  --resource-group myResourceGroup \\\n  --name agent-api \\\n  --image your-registry.azurecr.io/agent-api \\\n  --dns-name-label agent-api \\\n  --ports 8080\n```\n\n## Error Handling\n\nThe API implements comprehensive error handling:\n- Rate limit exceeded: 429\n- Not found: 404\n- Internal server error: 500\n\nError responses follow this format:\n```json\n{\n  \"detail\": {\n    \"error\": \"string\",\n    \"message\": \"string\"\n  }\n}\n```\n\n## Contributing\n\n1. Fork the repository\n2. Create a feature branch\n3. Commit your changes\n4. Push to the branch\n5. Create a Pull Request\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n\n## Support\n\nFor support and questions:\n- Open an issue on GitHub\n- Join our Discord community\n- Email support@yourdomain.com\n\n## Acknowledgments\n\n- FastAPI for the excellent web framework\n- Swarms for the agent implementation\n- The open-source community\n\n---\n\nMade with ❤️ by [swarms.ai](https://www.swarms.ai)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FThe-Swarm-Corporation%2FAgentAPIProduction","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FThe-Swarm-Corporation%2FAgentAPIProduction","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FThe-Swarm-Corporation%2FAgentAPIProduction/lists"}