Base URL
All API requests should be made to:
Authentication
The Rubric API uses API keys to authenticate requests. You can view and manage your API keys in the Rubric Dashboard.
Authentication is performed via the Authorization header using Bearer token format:
curl https://api.rubric.ai/v1/datasets \
-H "Authorization: Bearer gr_live_xxxxxxxxxxxxxxxx"
Keep your API keys secureYour API keys carry many privileges. Do not share them in publicly accessible areas such as GitHub, client-side code, or browser storage.
For POST, PUT, and PATCH requests, encode parameters as JSON in the request body with Content-Type: application/json.
import requests
response = requests.post(
"https://api.rubric.ai/v1/datasets",
headers={
"Authorization": "Bearer gr_live_xxxxxxxx",
"Content-Type": "application/json"
},
json={
"name": "patient-triage-v2",
"description": "Production triage calls Q1 2024"
}
)
All responses are returned as JSON. Successful responses include the requested resource(s), while error responses include an error object with details.
Success Response
Error Response
{
"id": "ds_abc123",
"object": "dataset",
"name": "patient-triage-v2",
"description": "Production triage calls Q1 2024",
"created_at": "2024-01-15T09:30:00Z",
"sample_count": 0
}
{
"error": {
"type": "invalid_request_error",
"code": "missing_required_field",
"message": "The 'name' field is required",
"param": "name"
}
}
HTTP Status Codes
| Code | Description |
|---|
200 | OK — Request succeeded |
201 | Created — Resource created successfully |
400 | Bad Request — Invalid parameters |
401 | Unauthorized — Invalid or missing API key |
403 | Forbidden — Insufficient permissions |
404 | Not Found — Resource does not exist |
429 | Too Many Requests — Rate limit exceeded |
500 | Server Error — Something went wrong on our end |
List endpoints support cursor-based pagination using limit and after parameters.
# First page
response = client.datasets.list(limit=20)
# Next page using cursor
if response.has_more:
next_page = client.datasets.list(
limit=20,
after=response.data[-1].id
)
| Parameter | Type | Description |
|---|
limit | integer | Number of results to return (1-100, default 20) |
after | string | Cursor for pagination — ID of last item from previous page |
before | string | Return results before this ID |
Rate Limits
The API enforces rate limits to ensure fair usage. Rate limit information is included in response headers:
| Header | Description |
|---|
X-RateLimit-Limit | Maximum requests per minute |
X-RateLimit-Remaining | Requests remaining in current window |
X-RateLimit-Reset | Unix timestamp when limit resets |
Enterprise LimitsEnterprise plans include higher rate limits. Contact us for details.