Getting Started with SwarmStack
This guide will walk you through setting up SwarmStack and deploying your first AI agent in under 5 minutes.
Prerequisites
- A SwarmStack API key (get one by joining the beta)
curlor any HTTP client- Basic familiarity with REST APIs
Quick Start Guide
1
Get Your API Key
After joining the beta waitlist, you'll receive an API key via email. This key authenticates all your API requests.
2
Verify Your Connection
Test your API key by checking the health endpoint:
bash
curl https://api.swarmstack.net/api/health
Expected response:
json
{
"status": "ok",
"timestamp": "2024-12-10T12:00:00.000Z",
"uptime": 86400
}
3
Make Your First Authenticated Request
List files in the default directory:
bash
curl -H "Authorization: Bearer YOUR_API_KEY" \
"https://api.swarmstack.net/api/ls?path=/opt/swarm"
4
Boot a Swarm VM
Launch a Firecracker microVM with a single API call:
bash
curl -X POST \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"count": 1}' \
"https://api.swarmstack.net/api/swarm/boot"
This boots a VM with sub-10ms latency using snapshot restoration.
5
Check Swarm Status
View all running VMs:
bash
curl -H "Authorization: Bearer YOUR_API_KEY" \
"https://api.swarmstack.net/api/swarm/status"
💡 Pro Tip
Store your API key in an environment variable for convenience: export SWARM_API_KEY="your_key"
What's Next?
- Learn about authentication and token management
- Explore the full API reference
- Set up Git operations for your agents
- Create and manage work tickets
Example: Complete Workflow
Here's a full example that boots a VM, reads a file, and cleans up:
bash
# Set your API key
export SWARM_API_KEY="sk-swarm-..."
# Boot a VM
curl -X POST \
-H "Authorization: Bearer $SWARM_API_KEY" \
-H "Content-Type: application/json" \
-d '{"count": 1}' \
"https://api.swarmstack.net/api/swarm/boot"
# Read a file
curl -H "Authorization: Bearer $SWARM_API_KEY" \
"https://api.swarmstack.net/api/files/read?path=/opt/swarm/README.md"
# Clean up all VMs
curl -X POST \
-H "Authorization: Bearer $SWARM_API_KEY" \
"https://api.swarmstack.net/api/swarm/cleanup"