Skip to main content

Error Response Structure

{
  "error": {
    "type": "invalid_request_error",
    "code": "missing_required_field",
    "message": "The 'name' field is required",
    "param": "name",
    "request_id": "req_abc123"
  }
}

Error Types

TypeDescription
authentication_errorInvalid or missing API key
invalid_request_errorMalformed request
rate_limit_errorToo many requests
not_found_errorResource doesn’t exist
server_errorInternal error

Handling Errors

from rubric.exceptions import RubricException, ValidationError

try:
    client.datasets.create(name="")
except ValidationError as e:
    print(f"Field: {e.param}, Message: {e.message}")
except RubricException as e:
    print(f"Error: {e.message}")