Skip to main content

Base URL

All API requests should be made to:
https://api.rubric.ai/v1

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.

Request Format

For POST, PUT, and PATCH requests, encode parameters as JSON in the request body with Content-Type: application/json.
example_request.py
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"
    }
)

Response Format

All responses are returned as JSON. Successful responses include the requested resource(s), while error responses include an error object with details.
{
  "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
}

HTTP Status Codes

CodeDescription
200OK — Request succeeded
201Created — Resource created successfully
400Bad Request — Invalid parameters
401Unauthorized — Invalid or missing API key
403Forbidden — Insufficient permissions
404Not Found — Resource does not exist
429Too Many Requests — Rate limit exceeded
500Server Error — Something went wrong on our end

Pagination

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
    )
ParameterTypeDescription
limitintegerNumber of results to return (1-100, default 20)
afterstringCursor for pagination — ID of last item from previous page
beforestringReturn results before this ID

Rate Limits

The API enforces rate limits to ensure fair usage. Rate limit information is included in response headers:
HeaderDescription
X-RateLimit-LimitMaximum requests per minute
X-RateLimit-RemainingRequests remaining in current window
X-RateLimit-ResetUnix timestamp when limit resets
Enterprise LimitsEnterprise plans include higher rate limits. Contact us for details.