The REST API exposes three public endpoints for scoring content, listing models, and inspecting a model's traits. This page documents the request and response shapes, failure modes, and examples for each endpoint.
| Base URL | https://u22a8.ai |
|---|---|
| Authentication | None required for the three public endpoints described below. |
| Request content type | application/json for structured requests. The score endpoint also accepts text/plain bodies containing raw text or a URL. |
| Response content type | application/json by default. text/plain is available on the score and traits endpoints via the Accept header. |
| Rate limit | 10 requests per 10 seconds per client. Requests beyond this limit receive HTTP 429. |
The following status codes are returned by all endpoints. Endpoint-specific failures are documented per endpoint in §3.
| Status | Condition |
|---|---|
404 | The model handle in the path does not exist. |
422 | The request body is malformed, empty (where a body is required), or contains a URL that cannot be fetched or extracted. |
429 | The client has exceeded the rate limit. |
503 | The service is temporarily unavailable. Retry after a short delay. |
Error responses carry a JSON body with a detail field describing the cause:
Score content against a profile's traits. The request body carries the content to score (literal text or a URL). The response contains per-trait scores with scoring context, the composite score, overall confidence, and headroom.
| Name | Type | Description |
|---|---|---|
handle | string | Model handle, e.g. u22a8.technical-writing. Required. See GET /profiles for the list. |
application/json| Field | Type | Description |
|---|---|---|
content | string | Required. Text to score, or a URL to fetch and score. URLs are detected automatically. |
compare_to | string | Optional. Baseline text or URL. When present, the response includes baseline scores and a delta. |
traits | array of strings | Optional. Restrict scoring to the named traits. Omit to score all traits on the model. |
text/plainThe endpoint also accepts a raw text/plain body containing either the content to score or a URL. This form is equivalent to a JSON body with only content set; compare_to and traits are not available in this form.
application/json (200)All per-trait fields are defined on the score card, tiers, confidence, headroom, and breaks pages. label and headroom are null when confidence is low.
List the public models available for scoring. Each entry identifies a model by handle and summarizes its traits.
No parameters. No request body.
application/json (200)Inspect the traits defined on a model. Returns each trait's name, description, polarity labels, and training sample counts.
| Name | Type | Description |
|---|---|---|
handle | string | Model handle. Required. |
application/json (200)A plain-text response, suitable for terminal display, is returned when the Accept header includes text/plain.
A machine-readable OpenAPI schema for all endpoints is served at /api-docs. The schema and this page describe the same endpoints; the schema is authoritative for field types and nullability.