API Overview#
The Rustbox API provides endpoints for submitting code, retrieving results, and receiving webhook notifications.
Base URL#
https://api.rustbox.sh/apiAuthentication#
Every request must include your API key in the X-API-Key header:
X-API-Key: rb_live_your_key_hereMissing or invalid keys return 401 Unauthorized. See Authentication for details.
Endpoints#
| Method | Path | What it does |
|---|---|---|
POST | /api/submit | Submit code for execution |
GET | /api/result/{id} | Poll execution result |
GET | /api/languages | List supported languages |
GET | /api/health | Platform health + queue depth |
GET | /api/health/ready | Readiness probe |
Three ways to get results#
Get it later (default): Send the code, get back an id, and check /api/result/{id} until it is done.
Wait for it: Add ?wait=true to the request. The connection stays open and the result comes back on it when the code finishes (or after 30 s at most).
Webhooks: Add webhook URLs to a project in the dashboard. Every run sent with an API key from that project sends its result to those webhooks.
Each way has its place. Checking back is the simplest to build. Waiting is best for live playgrounds, where every millisecond shows. Webhooks are best for big batches, where you send hundreds of runs and don't want to keep connections open.