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_cxxxxxxxxxxxxxxxxxxxxxxxxxCreate 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:
- List boards — find an available board type
- Create session — reserves a board and starts billing
- Flash firmware — upload a
.binfile to the board - Serial console — open a WebSocket for real-time serial I/O
- 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:
{
"error": "insufficient credits"
}| Status | Meaning |
|---|---|
400 | Bad request — check your parameters |
401 | Not authenticated — check your API key |
403 | Forbidden: account disabled, or email not verified |
404 | Resource not found |
409 | Conflict — e.g. board already in use |
429 | Rate limited — slow down |
500 | Server 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_cxxxxxxxxxxxxxxxxxxxxxxxxxData is exchanged as binary frames (raw serial bytes).
SDKs & tools
- CLI —
srigcommand-line tool - Python SDK —
pip install siliconrig - GitHub Action —
siliconrig/action
Browse the endpoints in the sidebar for full request/response details.