Dicti integration guide
What is Dicti
Dicti adds voice input to existing HTML forms. Embed a single <script> tag,
mark the text fields you want to enhance with a data-dicti attribute, and your
visitors get a microphone button per field. Dicti transcribes their speech (and can produce a
short LLM summary on plans that include one) and writes the text into the field — the rest of your form,
validation and submit flow work exactly as before.
Quick start
- Create a project. Sign in to the dashboard and press New project — one project per site.
- Generate an API key. On the project page, press Generate API key. The raw key
(
tk_live_...) is shown once — copy it now, it is never shown again. The page also shows the exact<script>tag to embed. - Whitelist your site's origin. On the project page, add your page's exact origin
(scheme + host + port, e.g.
https://www.example.com) under Allowed origins (CORS). - Embed the widget. Paste the script tag (see Installing the widget) into your page.
- Mark the fields. Add the valueless
data-dictiattribute to each<input>/<textarea>you want to enhance. - Test. Open your page (over
httpsorlocalhost), click the mic, speak, click again — the transcript appears in the field.
Getting an API key
- Sign in to the Dicti dashboard (or sign up).
- On the project page, press the Generate API key button. The raw key
tk_live_...is displayed once — copy it immediately. It cannot be retrieved later; if it is lost, revoke the key and create a new one. - On the project page, under Allowed origins (CORS), add every origin your pages are served from —
the exact
scheme://host[:port], e.g.https://www.example.comorhttp://localhost:8008. The widget only works from whitelisted origins (browser CORS). - New accounts start on the free plan; plans are assigned by an administrator in v1 (see Plans and limits).
Installing the widget
<script src="https://cdn.dicti.me/v1/dicti.js"
data-dicti-key="tk_live_your_key_here"
data-dicti-api="https://dicti.me"></script>
The widget is a single dependency-free script. It injects its own <style> block
with namespaced .dicti-* classes and an inline SVG microphone icon; host-page CSS may
override it. The script can be placed in the <head> or at the end of
<body> — the widget waits for the DOM to be ready before scanning.
| Script attribute | Required | Purpose |
|---|---|---|
data-dicti-key | yes | Your raw API key (tk_live_...). If missing or rejected, the widget enhances no fields. |
data-dicti-api | no | API base URL. Defaults to https://dicti.me; set it when pointing the widget at a
different Dicti API deployment. |
Marking fields
<input type="text" name="street" data-dicti>
<textarea name="description" data-dicti data-dicti-lang="cs" data-dicti-summary-length="500" data-dicti-corrections="Dicti"></textarea>
The widget enhances fields marked with the valueless data-dicti attribute (any value is
ignored). Supported fields: input[type=text|search|tel|email|url] and textarea.
Fields that are password, readonly or disabled are skipped.
Field attributes
| Attribute | Values | Default | Purpose |
|---|---|---|---|
data-dicti | presence (value ignored) | — | Enables the field for voice input. |
data-dicti-lang | ISO language code, e.g. cs, en | auto-detect | Forces the transcription language instead of letting the API auto-detect it. |
data-dicti-audio-length | positive integer, seconds | 30 |
Per-field recording cap. Recording auto-stops at the effective cap
(min(this value, plan cap)). |
data-dicti-summary-length | positive integer, characters | absent | Requests an AI summary of at most that many characters. Absent → the exact transcript is
inserted. Only effective on plans with LLM summary; on other plans the attribute is ignored
(one console.warn per page) and the exact transcript is inserted. |
data-dicti-text-insert | replace | append | replace |
replace overwrites the field's current value; append adds the text after
the existing value, separated by a single space. |
data-dicti-position | inside | outside | inside |
inside: the mic button is injected into the field's container, right-aligned (the field
gains right padding). outside: the button is injected immediately after the field in the DOM. |
data-dicti-corrections | string of special words, ≤500 chars | absent | Biases recognition toward these words (sent as whisper hotwords). Takes precedence over the project-level corrections setting. |
How the widget behaves
- On load the widget calls
GET /v1/planwith your key. On401(invalid or unknown key) it enhances no fields and logsconsole.error. On network or5xxfailure it proceeds with free-plan limits (20 s audio, 2 fields) and logsconsole.warn. - Plan field cap: up to the plan's
max_fields_per_pagefields (first N in DOM order) are enhanced; the rest are skipped, aconsole.warnis emitted, and onefields_limit_exceededevent is reported viaPOST /v1/eventsper page load. Anullcap means unlimited. - Button states: idle → recording (red, pulsing) → processing (spinner) → idle. On error the button briefly shows an error state, then returns to idle. Exactly one recording is active per page at a time; the other buttons are visually disabled meanwhile.
- Recording cap:
min(data-dicti-audio-length, plan cap); when the plan cap isnull(unlimited-audio add-on) only the per-field value applies. The server remains the source of truth and can still reject over-length audio. - Insertion: the text is written through the field's native value setter, which fires a
standard
inputevent (so framework-controlled inputs update). The field also receives adicti:transcribedCustomEvent withdetail{text, language, duration_seconds, summarized}. - Errors: no
alert()or modals, ever. A short inline note appears near the field and auto-dismisses; details go toconsole.warn/console.error. Typical cases: microphone permission denied or no mic device, network failure, API error. - Audio handling: audio is held in memory only for the active recording and is uploaded
(multipart
filefield) during transcription; it is never persisted by the widget.
Plans and limits
| Plan | Price | Max audio per field | Fields per page | Concurrent requests | AI summary |
|---|---|---|---|---|---|
| free | $0 | 20 sec | 2 | 1 | no |
| tier5 | $5 | 60 sec | 5 | 2 | no |
| tier10 | $10 | 300 sec | 10 | 5 | yes |
| advanced | Custom | unlimited | unlimited | unlimited | yes |
| add-on: unlimited-audio | +$10 | unlimited (10 MB upload cap still applies) | — | — | — |
Plans are self-serve: pick one at sign-up or change it any time from Change plan. Billing comes later — nothing is charged for now.
API reference
Base URL https://dicti.me. All public endpoints authenticate with the
X-Api-Key header. In-browser requests are additionally constrained by the per-key origin
whitelist (CORS).
POST /v1/transcribe
Multipart form: file (audio, up to 10 MB), optional language (ISO code),
optional summary_length (integer, max summary characters), optional
corrections (string of special words, max 500 characters — recognition favors them;
overrides the project's corrections setting).
curl -F "file=@clip.webm;type=audio/webm;codecs=opus" \
-H "X-Api-Key: tk_live_..." https://dicti.me/v1/transcribe
Success 200:
{"text": "...", "language": "cs", "duration_seconds": 12.4, "summarized": false}
text is the exact transcript, or the AI summary when summary_length was sent (in
which case summarized is true).
| Status | Meaning |
|---|---|
| 401 | invalid or unknown API key |
| 403 | plan limit exceeded — audio longer than the plan cap, or summary_length sent on a plan without AI summary (free, tier5) |
| 413 | upload exceeds 10 MB |
| 415 | unsupported audio content type |
| 422 | audio empty or undecodable |
| 429 | rate limit exceeded (30 requests/min/key) |
GET /v1/plan
curl -H "X-Api-Key: tk_live_..." https://dicti.me/v1/plan
Success 200: {"plan": "tier10", "max_audio_seconds": 300, "max_fields_per_page": 10, "summary": true, "max_concurrent_requests": 5}.
max_audio_seconds / max_fields_per_page are null when the corresponding add-on is
active. max_concurrent_requests is null for unlimited plans (advanced). When more than
max_concurrent_requests transcriptions of one account run at once, extra requests queue until a slot
frees up — they are slowed down, never rejected. Error: 401.
POST /v1/events
Widget-side limit reporting — the widget calls this automatically; you normally do not.
Body: JSON {"event": "fields_limit_exceeded", "page_fields": 5, "allowed": 2}.
Success 200: {"ok": true}. Errors: 401, 422.
Troubleshooting
| Symptom | Likely cause |
|---|---|
| No mic button appears | Key rejected (check console.error), the field is password / readonly /
disabled or an unsupported type, or the page has more marked fields than the plan allows
(check console.warn; a fields_limit_exceeded event is sent once per page load). |
| Browser blocks recording / mic permission greyed out | Microphone access requires a secure context — serve the page over https (or
http://localhost) and make sure the user grants the permission prompt. |
Exact transcript even though data-dicti-summary-length is set |
The plan has no AI summary (free and tier5 plans) — the attribute is ignored on such plans. |
| CORS errors in the browser console | Your page's origin is not whitelisted on the key — add the exact
scheme://host[:port] under Allowed origins (CORS). |
429 responses | Rate limit (30 requests/min/key) exceeded. |
413 / 415 / 422 |
File over 10 MB / unsupported content type / empty or undecodable audio. |