Lambent Probe API Documentation
Manage API KeysOverview
The Lambent Probe API provides programmatic access to aphasia simulation, recovery tuning, and robustness testing. All endpoints require a valid API key.
Base URL: https://api.example.com/v1
Authentication: Bearer token in the Authorization header.
Rate Limit: 30 requests per minute per API key.
Model: patho-nlp-base v0.1.0-stub (rule-based engine)
Authentication
Include your API key in the Authorization header:
Authorization: Bearer lmb_your_api_key_here
POST /v1/simulate_aphasia
Simulates aphasic speech from normal text input.
Request Body
{
"text": "Yesterday afternoon, I went to the grocery store to buy some fresh vegetables and fruit for dinner.",
"aphasia_type": "broca", // "broca" | "wernicke" | "conduction"
"severity": 0.6 // 0.0 (mild) to 1.0 (severe)
}Response
{
"request_id": "550e8400-e29b-41d4-a716-446655440000",
"model": "patho-nlp-base",
"model_version": "v0.1.0-stub",
"aphasia_type": "broca",
"severity": 0.6,
"original_text": "Yesterday afternoon...",
"simulated_text": "Yesterday... store. Buy... vegetables.",
"features": { "type": "broca", "agrammatism": true, "telegraphic": true },
"processing_time_ms": 12
}curl Example
curl -X POST https://api.example.com/v1/simulate_aphasia \
-H "Authorization: Bearer lmb_your_key" \
-H "Content-Type: application/json" \
-d '{"text":"I went to the store to buy vegetables","aphasia_type":"broca","severity":0.7}'Python Example
import requests
response = requests.post(
"https://api.example.com/v1/simulate_aphasia",
headers={"Authorization": "Bearer lmb_your_key"},
json={
"text": "I went to the store to buy vegetables",
"aphasia_type": "broca",
"severity": 0.7
}
)
print(response.json())POST /v1/recovery_tune
Simulates speech at a specific recovery stage from aphasia.
Request Body
{
"text": "Yesterday afternoon, I went to the store.",
"aphasia_type": "wernicke",
"recovery_level": 0.5 // 0.0 (no recovery) to 1.0 (full recovery)
}Response
{
"request_id": "...",
"model": "patho-nlp-base",
"model_version": "v0.1.0-stub",
"aphasia_type": "wernicke",
"recovery_level": 0.5,
"original_text": "Yesterday afternoon, I went to the store.",
"recovered_text": "Yesterday afternoon, I went to the glorpicle.",
"recovery_features": { "type": "wernicke", "recovery_level": 0.5 },
"processing_time_ms": 8
}POST /v1/robustness_test
Tests model robustness by applying various perturbations to input text.
Request Body
{
"text": "The patient went to the hospital for treatment.",
"perturbation_types": ["deletion", "substitution", "reorder"]
}Response
{
"request_id": "...",
"model": "patho-nlp-base",
"model_version": "v0.1.0-stub",
"original_text": "The patient went to the hospital for treatment.",
"perturbation_results": [
{ "perturbation_type": "deletion", "perturbed_text": "The went the for treatment.", "similarity_score": 0.72 },
{ "perturbation_type": "substitution", "perturbed_text": "The patienx went to the hospitax for treatment.", "similarity_score": 0.85 },
{ "perturbation_type": "reorder", "perturbed_text": "patient The to went hospital the treatment. for", "similarity_score": 0.68 }
],
"processing_time_ms": 5
}Error Codes
| Code | Meaning |
|---|---|
| 400 | Bad Request — Missing or invalid parameters |
| 401 | Unauthorized — Missing API key |
| 403 | Forbidden — Invalid or revoked API key |
| 429 | Rate Limited — Too many requests (30/min per key) |
| 500 | Internal Server Error |
FHIR/HL7 Interoperability
Lambent provides a FHIR R4-compatible capability statement at:
GET https://api.example.com/api/integrations/fhir
This includes data mapping documentation for Patient and Observation resources. See our Data Protection Statement for details.