Skip to content

API Reference ​

The SiliconRig API gives you programmatic access to remote embedded devices. Flash firmware, open serial consoles, and manage sessions — all over HTTPS and WebSocket.

Base URL ​

https://api.srig.io/v1/

All endpoints are prefixed with /v1/. Responses are JSON unless otherwise noted.

Authentication ​

Pass your API key in the Authorization header:

Authorization: Bearer key_cxxxxxxxxxxxxxxxxxxxxxxxxx

Create API keys in the web UI, on any tier, or with POST /v1/auth/keys. The CLI uses a key but does not create one. A key carries your account's credit balance and limits.

Common patterns ​

Sessions ​

The typical workflow is:

  1. List boards — find an available board type
  2. Create session — reserves a board and starts billing
  3. Flash firmware — upload a .bin file to the board
  4. Serial console — open a WebSocket for real-time serial I/O
  5. End session — releases the board and stops billing

Sessions transition through states: pending → allocating → active ⇄ idle → ended. A session created with a base_image_id starts in provisioning while that image is written to the board, and moves to idle when the board is ready.

Credits ​

Every session consumes credits from your account balance. Credits are deducted while a session is active. Writing a base image is not billed: a session that asked for one is in provisioning until the board is ready, and the first credit is taken then. Check your balance via the /v1/auth/me endpoint.

Power cycling ​

If your firmware hangs, you can power-cycle the board without ending the session. This toggles USB power to the physical device.

Errors ​

All errors return a JSON body with an error field:

json
{
  "error": "insufficient credits"
}
StatusMeaning
400Bad request — check your parameters
401Not authenticated — check your API key
403Forbidden: account disabled, or email not verified
404Resource not found
409Conflict — e.g. board already in use
429Rate limited — slow down
500Server error

Rate limits ​

Public endpoints are rate-limited to 2 requests/second with a burst of 10. Authenticated endpoints are not rate-limited.

WebSocket ​

The serial console uses a WebSocket connection:

wss://api.srig.io/v1/sessions/{id}/serial?token=key_cxxxxxxxxxxxxxxxxxxxxxxxxx

Data is exchanged as binary frames (raw serial bytes).

SDKs & tools ​

Browse the endpoints in the sidebar for full request/response details.