REST API Route Reference
[!NOTE] Automated Documentation
This document is automatically generated from the FastAPI route definitions via pipe.api.openapi.
Any route, parameter, or docstring changes in src/pipe/api/routes.py are immediately reflected here.
API Version: 0.1.0 | OpenAPI Version: 3.1.0
Raw Schemas: openapi.json · openapi.yaml · Interactive Docs: /docs · /redoc
Endpoints Overview
Legal Expert Operations (legal)
POST /legal/detect — Legal Detect
Run one atomic legal op over text for a given jurisdiction.
op is one of the names from GET /legal/ops; jurisdiction is a
hierarchical code like us, us/ny, in/mh (optionally with
facets appended later). Returns the detections found.
Parameters
| Name |
In |
Type |
Required |
Default |
Description |
text |
query |
string |
✓ |
— |
|
jurisdiction |
query |
string |
— |
us |
|
op |
query |
string |
— |
detect_pii |
|
Responses
| Status Code |
Description |
Schema / Returns |
200 |
Successful Response |
object |
422 |
Validation Error |
HTTPValidationError |
Example Request
GET /legal/ops — Legal Ops
List the available atomic legal operations and rule categories.
Responses
| Status Code |
Description |
Schema / Returns |
200 |
Successful Response |
object |
Example Request
LLM & Speech-to-Text (llm)
POST /llm — Llm
Test route: send a prompt to OpenRouter and return the completion.
Reads the key from $OPENROUTER_API_KEY (injected in the deployment).
Returns a 4xx-shaped JSON error rather than a 500 when the LLM stack or
key is unavailable, so it’s safe to probe.
Parameters
| Name |
In |
Type |
Required |
Default |
Description |
prompt |
query |
string |
✓ |
— |
|
model |
query |
string |
— |
openai/gpt-4o-mini |
|
max_tokens |
query |
integer |
— |
256 |
|
Responses
| Status Code |
Description |
Schema / Returns |
200 |
Successful Response |
object |
422 |
Validation Error |
HTTPValidationError |
Example Request
POST /stt — Stt
Transcribe an uploaded audio file to text (audio bytes in, text out).
Accepts a multipart file upload; the audio format is inferred from the
filename extension (falls back to wav). Reads the key from
$OPENROUTER_API_KEY. Errors map like /llm (503 missing key, 502 upstream).
Parameters
| Name |
In |
Type |
Required |
Default |
Description |
model |
query |
string |
— |
openai/whisper-large-v3 |
|
language |
query |
string | null |
— |
— |
|
Request Body
- Content-Type:
multipart/form-data
Responses
| Status Code |
Description |
Schema / Returns |
200 |
Successful Response |
object |
422 |
Validation Error |
HTTPValidationError |
Example Request
Core Operations (ops)
GET /echo — Echo
Echo atomic op: returns the input unchanged (data in, data out).
Parameters
| Name |
In |
Type |
Required |
Default |
Description |
data |
query |
string |
— |
`` |
|
Responses
| Status Code |
Description |
Schema / Returns |
200 |
Successful Response |
object |
422 |
Validation Error |
HTTPValidationError |
Example Request
GET /echo/stream — Echo Stream
Streaming echo: sends the input back incrementally as a data stream.
Parameters
| Name |
In |
Type |
Required |
Default |
Description |
data |
query |
string |
— |
`` |
|
chunk_size |
query |
integer |
— |
16 |
|
Responses
| Status Code |
Description |
Schema / Returns |
200 |
Successful Response |
any |
422 |
Validation Error |
HTTPValidationError |
Example Request