tutorial
Getting Started with PrimeSwarm: Your First Governed Agent
Grigori Korotkikh 2026-08-15 10 min
PrimeSwarmTutorialRustGetting Started
Getting Started with PrimeSwarm
Prerequisites
- Rust 1.85+ (2024 edition)
- Docker (for sandbox execution)
- An OpenAI API key
Installation
cd primeswarm-engine/primeswarm-cognitive-api
cargo build --release
Configuration
Set environment variables:
export OPENAI_API_KEY=sk-...
export JWT_SECRET=your-secret
export AGENT_CATALOG_DIR=agents
Starting the Server
cargo run --release
The API will be available at http://127.0.0.1:8000.
Your First Agent Call
# Get a JWT token
curl -X POST http://127.0.0.1:8000/auth/token \
-H "Content-Type: application/json" \
-d '{"subject":"user1","role":"admin"}'
# List available agents
curl http://127.0.0.1:8000/v1/agents
# Chat with an agent
curl -X POST http://127.0.0.1:8000/v1/chat/completions \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{"model":"gpt-4","messages":[{"role":"user","content":"Hello"}]}'
Back to Publications
Published by Only Institute