Docs
vocab layer is a server-to-server REST API. Your backend holds the API key and calls us after speech-to-text — never the other way around.
Evaluating against built-in ASR custom vocabulary? Read why teams add a correction layer →
Architecture
[Mobile app / Browser mic]
│
▼ raw transcript (your existing flow)
[Your backend] ──HTTPS POST /api/correct──▶ [vocab layer]
│ │
│◀──────── { corrected, changes } ───────┘
▼
[Your app uses corrected text]1. Get an API key
Contact your vocab layer administrator to receive an API key, or issue one yourself if you run the instance:
npm run keys -- issue --owner "Your Company" --tier partner --rate-limit 120Store the raw key in your secrets manager. It is shown only once at creation.
2. API reference
POST /api/correct
Corrects a raw speech-to-text transcript.
| Header | Value |
|---|---|
Authorization | Bearer YOUR_API_KEY |
Content-Type | application/json |
Request body:
{
"transcript": "spray the axe on the north field",
"domain": "agronomy"
}domain selects the Layer (industry vocabulary). agronomy maps to the Agronomy Layer.
Response (200):
{
"corrected": "spray the AXXE on the north field",
"changes": [
{ "from": "axe", "to": "AXXE", "method": "fuzzy", "confidence": 0.94 }
],
"latency_ms": 12
}| Status | Meaning |
|---|---|
| 400 | Invalid input (missing transcript, too long, etc.) |
| 401 | Missing or invalid API key |
| 429 | Rate limit exceeded for your key |
GET /api/health
No auth required. Returns { "status": "ok" } for uptime monitoring.
3. Code examples
Replace the URL and API key with your deployment values.
// Node.js / TypeScript — call from YOUR backend only
const response = await fetch("https://vocablayer.com/api/correct", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.VOCABLAYER_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
transcript: rawAsrOutput,
domain: "agronomy",
}),
});
const { corrected, changes, latency_ms } = await response.json();
// Pass corrected to your app, not the raw transcript4. Browser / mic integration
If your product has a browser-based voice UI, the mic runs in the client but correction still goes through your backend:
- Browser captures speech → raw transcript (Web Speech API or your ASR)
- Browser sends transcript to your API endpoint
- Your endpoint calls
POST /api/correctwith the vocab layer key - Your endpoint returns the corrected text to the browser
/api/browser-proxy) so the key stays server-side. Your production app should follow the same pattern — a thin proxy in your backend, not a direct browser call to vocab layer.5. Where to plug it in
Call VocabLayer immediately after ASR, before any downstream logic:
rawTranscript = await speechToText(audio)
corrected = await vocablayer.correct(rawTranscript, domain: "agronomy")
await createFieldOrder({ product: corrected }) // your app logic6. Managing vocabulary
Vocabulary Layers are managed per industry (domain) in the admin panel. You can add entries manually, import a CSV, or export the current dataset. Changes take effect within ~60 seconds (cache TTL).
7. Test it now
Try the same correction flow your users will get: