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.

Never put your API key in a mobile app, browser bundle, or Chrome extension. Store it in your secrets manager and call vocab layer from your own backend.

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 120

Store 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.

HeaderValue
AuthorizationBearer YOUR_API_KEY
Content-Typeapplication/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
}
StatusMeaning
400Invalid input (missing transcript, too long, etc.)
401Missing or invalid API key
429Rate 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 transcript

4. 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:

  1. Browser captures speech → raw transcript (Web Speech API or your ASR)
  2. Browser sends transcript to your API endpoint
  3. Your endpoint calls POST /api/correct with the vocab layer key
  4. Your endpoint returns the corrected text to the browser
This demo site uses an internal proxy route (/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 logic

6. 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:

Corrected output
Run a correction to see results

Questions?

Check the health endpoint, verify your key, and confirm the domain matches your industry dataset.

← Back to home