REST API Reference
The RunRL REST API exposes every feature available in the product UI, allowing you to automate training runs, manage files and tools, deploy models, and integrate RunRL into your own workflows.
Base URL
Authentication
Every request must include an API key generated from Settings → API Keys. Present the key in the Authorization
header using the Bearer
scheme.
📌 Tip: Create separate keys for automation, CI, or teammates. Keys can be scoped to
read
,write
, oradmin
permissions.
Quick Health Check
API Keys
Create API Key
- Endpoint:
POST /keys
- Scope Required:
write
List / Inspect API Keys
- Endpoints:
GET /keys
(list)GET /keys/{id}/usage
(usage statistics)
- Scope Required:
read
Update / Delete API Keys
- Endpoints:
PUT /keys/{id}
(rename, toggle active, adjust scopes/limits)DELETE /keys/{id}
- Scope Required:
write
Files
Files drive training runs. You can manage prompts, reward/environment code, and SFT datasets directly via the API.
List Files
- Endpoint:
GET /files
- Scope:
read
Filters: type
(prompt
, reward_function
, environment
, sft
), search
, page
, per_page
, sort
, direction
.
Upload (Multipart)
Create from Content (Reward / Environment Code)
Retrieve, Preview, and Download
GET /files/{fileId}
– metadataGET /files/{fileId}/preview
– first lines or truncated code previewGET /files/{fileId}/content
– raw text content (prompt/SFT JSONL, Python code)GET /files/{fileId}/download
– download the original file
Update or Delete
PUT /files/{fileId}
to rename or update reward/environment codeDELETE /files/{fileId}
to remove an unused file (fails if active runs still reference it)- Scope:
write
Runs
Runs encapsulate RL training jobs. The API now exposes the same end-to-end control found in the UI.
List Runs
Create Run
Parameters mirror the run creation modal, including SFT datasets, package requirements, Hugging Face tokens, and tool attachments.
Inspect & Control
GET /runs/{id}
– detailed run state (including tools, files, hf_name)GET /runs/{id}/history
– status timelineGET /runs/{id}/logs
– paginated logs with redaction supportGET /runs/{id}/logs/stream
– Server-Sent Events stream for real-time logsGET /runs/{id}/metrics
– W&B metrics proxyGET /runs/{id}/completions
– completions captured in W&BPOST /runs/{id}/cancel
– cancel in-progress runs
Deployments
Deploy trained checkpoints to managed infrastructure directly via the API.
GET /deployments
– list your deploymentsGET /deployments/{id}
– details (linked run info, status)POST /deployments/check
– validate a run is deployable (HF checkpoint exists, not already deployed, etc.)POST /deployments
– trigger deployment (requires positive balance & active API key)DELETE /deployments/{id}
– remove deployment records
All deployment endpoints require the write
scope.
Validation
RunRL ships built-in validators for prompt, SFT, and reward code.
POST /validation/reward-function
POST /validation/prompt
POST /validation/sft
Each endpoint accepts the same payloads as the UI validation modals and returns structured validation feedback (valid
, errors
, counts, etc.).
Tools
Manage MCP tools via the API.
GET /tools
– list public tools + your private tools (filter withsearch
,verified
, etc.)POST /tools
– register a new tool (requires unique name per owner)GET /tools/{id}
– tool metadataPUT /tools/{id}
– update name/description/visibilityDELETE /tools/{id}
– remove a tool (owner or admin)POST /tools/test-mcp
– ping an MCP server URL and receive handshake diagnostics
Shared Configurations
Shared configurations capture reusable training setups.
GET /shared-configurations
– configurations you ownGET /shared-configurations/browse
– discover public/unlisted configurations (filter by model, reward mode, visibility)GET /shared-configurations/{uuid}
– detail view (requires owner or shared visibility)GET /shared-configurations/{uuid}/data
– includes prompt preview & reward code snippetsPOST /shared-configurations
– save the current run recipe (files are copied if they belong to another user)POST /shared-configurations/{uuid}/copy
– clone to your account (copies files & configuration)POST /shared-configurations/{uuid}/like
– toggle like statePUT /shared-configurations/{uuid}
– rename, edit description, toggle visibilityDELETE /shared-configurations/{uuid}
– remove configuration you own
Search
The global search endpoint mirrors the in-app quick search.
- Endpoint:
GET /search
- Scope:
read
Returns matching runs, tools, and files in a single response.
Response Format
Errors follow a similar schema with success: false
, an error
code, descriptive message
, and optional details
.
Rate Limiting
API keys enforce hourly request quotas (default: 10,000/hour). Limit information is reported in headers:
Scopes
Scope | Capabilities |
---|---|
read | Fetch runs, files, metrics, search, validation |
write | Create/update runs, files, tools, shared configurations, deployments |
admin | Reserved for platform administration (billing, user management) |
Error Codes
Code | HTTP | Description |
---|---|---|
bad_request | 400 | Invalid payload or parameters |
unauthorized | 401 | Missing/invalid API key |
forbidden | 403 | Key lacks required scope or resource ownership |
not_found | 404 | Resource doesn't exist or isn't accessible |
validation_error | 422 | Validation failed (see details ) |
rate_limit_exceeded | 429 | Hourly quota consumed |
internal_error | 500 | Unexpected server error |
Need a new endpoint? Something missing from the docs? Let us know at support@runrl.com and we’ll take it from there.