Current route, payload, timeout, and response guidance for the live Souma proxy API.
API Reference
The current Souma application exposes a small proxy layer for RtU validation. These routes sit in front of the upstream validation service and are the API surface reflected by the dashboard and docs.
Base origin
http://localhost:3000In production, use your deployed Souma app origin instead of localhost.
Authentication
Authenticate requests with a Souma API key:
Authorization: Bearer YOUR_API_KEYEndpoints
POST /api/validate
Submit one or more RtU validations.
Request body:
| Field | Type | Required | Description |
|---|---|---|---|
validations | array | Yes | List of validation jobs |
validations[].request_id | string | Yes | Your correlation ID |
validations[].url | string | Yes | Source URL to evaluate |
validations[].purpose | string | Yes | Usage to evaluate against policy |
Example request:
curl -X POST http://localhost:3000/api/validate \
-H "Authorization: Bearer sk_live_xxx" \
-H "Content-Type: application/json" \
-d '{
"validations": [
{
"request_id": "job-001",
"url": "https://example.com/article",
"purpose": "customer-facing publication"
}
]
}'Example response:
{
"results": [
{
"request_id": "job-001",
"validation_id": "val_abc123",
"status": "COMPLETED",
"url": "https://example.com/article",
"usage_purpose": "customer-facing publication",
"allowed_for_use": "PERMITTED",
"confidence_score": 0.92,
"llm_reasoning": "The site policy permits this use with attribution.",
"conditions": ["Retain attribution"],
"policy_source_urls": ["https://example.com/terms"],
"error_message": null,
"error_type": null,
"created_at": "2026-04-25T10:15:00Z",
"completed_at": "2026-04-25T10:15:03Z"
}
]
}GET /api/validate/result/:id
Poll a single validation by validation_id.
GET /api/validate/results
List existing results with pagination.
| Query param | Default | Description |
|---|---|---|
limit | 50 | Page size |
offset | 0 | Offset for pagination |
status | none | Optional status filter |
GET /api/validate/stream
Stream validation results for long-running checks.
GET /api/stats
Retrieve account-level statistics for the homepage and Pulse.
Timeouts
The current proxy uses hard timeouts:
| Route | Timeout |
|---|---|
POST /api/validate | 25s |
GET /api/validate/result/:id | 10s |
GET /api/validate/results | 12s |
Long-running workloads should use smaller batches plus polling or SSE instead of one blocking submission.
Error codes
| Code | Description |
|---|---|
400 | Bad request - invalid parameters |
401 | Unauthorized - invalid or missing API key |
500 | Unexpected proxy or upstream failure |
504 | Upstream timeout while the proxy was waiting |
Result statuses and judgments
| Type | Values |
|---|---|
| Status | PENDING, COMPLETED, ERROR_NOT_FOUND, ERROR_NO_POLICY, ERROR_LLM, ERROR_TIMEOUT, ERROR_NETWORK, ERROR_INVALID_URL |
| Judgment | PERMITTED, NOT_PERMITTED, UNCLEAR |