Developer Guide
Getting Started — Developers
Welcome to Swarmient. You’re about to submit your first distributed compute job to a peer-to-peer network of miners who’ll execute it, prove the result, and settle payment—all in minutes.
What You’ll Need
Before you start, make sure you have:
- A GitHub or Google account (for signup)
- A terminal or API client (curl, Postman, or your language’s HTTP library)
- A credit balance (we’ll cover how to add credits)
Create Your Account
Head to the registration page and sign up with GitHub or Google OAuth. You’ll land on your dashboard immediately—no email verification, no waiting.
What you get:
- A unique developer account
- An empty credit balance
- Access to API key management and job history
Add Credits
Navigate to your dashboard. You’ll see a “Add Credits” button in the top right. Click it to purchase credits using your preferred payment method. Credits are how you pay for computation—each job consumes credits based on how long it runs and what resources it uses.
Pricing is transparent: When you submit a job, you’ll see the estimated cost before execution begins.
Generate Your API Key
Visit Settings and scroll to “Developer API Keys”. Click “Generate New Key” and copy it immediately—you won’t see it again.
export SWARMIENT_API_KEY="sk_dev_1234567890abcdef..."
Your API key identifies you to the network. Treat it like a password—keep it secret, never commit it to version control.
Submit Your First Job
The simplest job is a single task. Create a file called hello.json:
{
"name": "hello-world",
"tasks": [
{
"id": "task-1",
"prompt": "Write a Python function that returns 'Hello, World!'",
"timeout_ms": 30000
}
]
}
Submit it via the API:
curl -X POST https://api.swarmient.com/v1/jobs/submit \
-H "Authorization: Bearer $SWARMIENT_API_KEY" \
-H "Content-Type: application/json" \
-d @hello.json
You’ll get back a job ID:
{
"job_id": "job_abc123def456",
"status": "PENDING",
"created_at": "2026-07-08T12:00:00Z"
}
Monitor Your Job
Check the status and results:
curl https://api.swarmient.com/v1/jobs/job_abc123def456 \
-H "Authorization: Bearer $SWARMIENT_API_KEY"
Response:
{
"job_id": "job_abc123def456",
"status": "COMPLETED",
"tasks": [
{
"id": "task-1",
"status": "COMPLETED",
"result": "def hello():\n return 'Hello, World!'\n",
"miner_id": "miner_xyz789",
"execution_time_ms": 1243,
"cost": 28
}
],
"total_cost": 28,
"cost_unit": "tokens"
}
Status values you’ll see:
PENDING— Waiting for a miner to acceptRUNNING— A miner is executing your jobCOMPLETED— Your job finished and results are readyFAILED— Something went wrong (see the error field for details)TIMEOUT— Your job exceeded the timeout limit
What’s Next?
You’re ready to explore more complex workflows:
- Core Concepts — Understand tasks, DAGs, and proofs
- Submit Jobs — Learn job structure, dependencies, and patterns
- Monitor & Debug — Track jobs, inspect failures, optimize costs
- Examples — Real-world use cases: ML pipelines, code generation, batch processing
- FAQ — Common questions and troubleshooting
Tips for Success
- Start small — A single task is faster and cheaper than a complex workflow
- Set realistic timeouts — Give miners enough time to complete tasks (30 seconds is usually safe)
- Check your balance — Jobs will fail if you run out of credits
- Read error messages — When a job fails, the error message tells you exactly what went wrong
- Use the dashboard — Your job history is searchable and sortable—great for debugging
Need Help?
- FAQ — Most questions are answered there
- Troubleshooting — Common issues and fixes
- Community — Join our Discord to chat with other developers and miners