API Overview#

The Rustbox API provides endpoints for submitting code, retrieving results, and receiving webhook notifications.

Base URL#

https://api.rustbox.sh/api

Authentication#

Every request must include your API key in the X-API-Key header:

X-API-Key: rb_live_your_key_here

Missing or invalid keys return 401 Unauthorized. See Authentication for details.

Endpoints#

MethodPathWhat it does
POST/api/submitSubmit code for execution
GET/api/result/{id}Poll execution result
GET/api/languagesList supported languages
GET/api/healthPlatform health + queue depth
GET/api/health/readyReadiness 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.