Developer Guide
FAQ — Developers
Account & Access
Q: How do I sign up?
A: Visit the registration page and sign up with GitHub or Google. No email verification needed—you’ll be in your dashboard immediately.
Q: How do I generate an API key?
A: Visit Settings and click “Generate New Key” under Developer API Keys. Copy it immediately—you won’t see it again. Keep it secret!
Q: Can I have multiple API keys?
A: Yes. Generate as many as you need. You might use different keys for development, staging, and production.
Q: What if I lose my API key?
A: Generate a new one. Old keys become invalid immediately. You can also revoke old keys from Settings.
Q: Can I use Swarmient from a CI/CD pipeline?
A: Yes! Use your API key in environment variables. Every language has HTTP libraries—you can submit jobs from GitHub Actions, GitLab CI, Jenkins, etc.
Submitting Jobs
Q: What’s the difference between a task and a job?
A: A task is a single unit of work. A job is a collection of tasks. Jobs can have 1–1000 tasks.
Q: Can I submit a job with 1000 tasks?
A: Yes, but it might take a while. We recommend keeping jobs under 50 tasks.
Q: Do all tasks in a job execute on the same miner?
A: No. Each task can be assigned to a different miner. Use depends_on to enforce sequencing.
Q: Can I cancel a job after submitting it?
A: Yes. Call DELETE /v1/jobs/job_id. You’ll be charged for work completed before cancellation.
Q: What’s the maximum prompt length?
A: 100,000 characters. For larger prompts, consider splitting into multiple tasks.
Q: Can I use real files (not just strings) as job input?
A: Not yet. Include file content in the prompt as a string, or reference publicly accessible URLs.
Q: Can I submit a job from a web browser?
A: Not directly (CORS restrictions). Use a backend service or your dashboard to submit jobs.
Failures & Retries
Q: Why did my job timeout?
A: Your task exceeded the timeout_ms limit. Either increase the timeout or make the prompt simpler.
Q: Why does the miner keep disconnecting?
A: Enable retries: "max_retries": 2. Swarmient will retry on a different miner.
Q: My job says “INSUFFICIENT_RESOURCES”. What does that mean?
A: You requested resources (GPU, memory) that no available miner has. Either relax requirements or wait for more miners to join.
Q: Will I be charged if a job fails?
A: You’re charged for work that was executed. If a task fails before completion, you’re only charged for the time spent. Failed task retries cost extra.
Q: How do I know why a specific task failed?
A: Check the error field in the task response. It includes an error code and message.
Q: Can I resubmit a failed job?
A: Yes, just submit the job again. However, costs apply to the new submission.
API & Integration
Q: What languages does Swarmient support?
A: Any language with HTTP support (Python, JavaScript, Go, Rust, Java, etc.). We provide SDKs for Python and JavaScript.
Q: Can I use Swarmient with my existing CI/CD pipeline?
A: Yes. Submit jobs as part of your pipeline using your API key.
Q: Do you have rate limits?
A: Yes. Up to 100 job submissions/minute per API key. Contact support for higher limits.
Q: What’s the SLA for job execution?
A: We aim for 99.5% uptime. There’s no guaranteed execution time (depends on miner availability and queue depth).
Q: Can I get API webhook callbacks?
A: Not yet. Use streaming (SSE) or polling for now.
Q: Is there a GraphQL API?
A: Not yet. REST API only.
Troubleshooting
Q: I get “INVALID_API_KEY” errors.
A: Make sure your API key is correct. Check that you’re including the Authorization: Bearer header.
Q: My job says “NETWORK_ERROR”.
A: Usually temporary. Enable retries with max_retries: 2 to retry automatically.
Q: Results are truncated. How do I get the full result?
A: Use the full_result_url provided in the response to fetch the complete result.
Q: My job is stuck in PENDING for hours.
A: Usually means no miners have the resources you requested, or the queue is backed up. Try with fewer resource requirements, or contact support.
Q: I see “SANDBOX_ERROR” in the error message.
A: Miners run tasks in a sandboxed environment. Your prompt might be asking for something that’s not allowed (filesystem access, network, etc.). Simplify the prompt.
Q: How do I debug a failing task?
A: Check the task’s error field for the error code and message. If still unclear, contact support with the job ID.
More Questions?
- Check Core Concepts if you’re confused about tasks, DAGs, or proofs
- Review Submit Jobs for job syntax and patterns
- Read Monitor & Debug for troubleshooting
- Join our community Discord to chat with other developers