What This Example Shows
- Setting up the Swarms API client
- Checking API health status
- Listing available models
- Monitoring rate limits
- Accessing swarm logs and availability
Installation
Get Your Swarms API Key
- Visit https://swarms.world/platform/api-keys
- Create an account or sign in
- Generate a new API key
- Store it securely in your environment variables
Code
Expected Output
The script will output JSON responses showing:- List of available AI models
- API health status
- Recent swarm execution logs
- Current rate limit usage
- Swarm service availability
Environment Setup
Create a.env
file in your project directory:
Next Steps
After running this example, you’ll be ready to:- Create single agents for specific tasks
- Build multi-agent swarms for complex workflows
- Implement batch processing for multiple requests
- Monitor and manage your API usage