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

  1. Create a project. Sign in to the dashboard and press New project — one project per site.
  2. 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.
  3. 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).
  4. Embed the widget. Paste the script tag (see Installing the widget) into your page.
  5. Mark the fields. Add the valueless data-dicti attribute to each <input> / <textarea> you want to enhance.
  6. Test. Open your page (over https or localhost), click the mic, speak, click again — the transcript appears in the field.

Getting an API key

  1. Sign in to the Dicti dashboard (or sign up).
  2. 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.
  3. 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.com or http://localhost:8008. The widget only works from whitelisted origins (browser CORS).
  4. New accounts start on the free plan; plans are assigned by an administrator in v1 (see Plans and limits).
Copy the raw key immediately. It is displayed once and cannot be retrieved later — if lost, revoke the key and create a new one.

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 attributeRequiredPurpose
data-dicti-keyyes Your raw API key (tk_live_...). If missing or rejected, the widget enhances no fields.
data-dicti-apino 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

AttributeValuesDefaultPurpose
data-dictipresence (value ignored)— Enables the field for voice input.
data-dicti-langISO language code, e.g. cs, enauto-detect Forces the transcription language instead of letting the API auto-detect it.
data-dicti-audio-lengthpositive integer, seconds30 Per-field recording cap. Recording auto-stops at the effective cap (min(this value, plan cap)).
data-dicti-summary-lengthpositive integer, charactersabsent 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-insertreplace | appendreplace replace overwrites the field's current value; append adds the text after the existing value, separated by a single space.
data-dicti-positioninside | outsideinside 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-correctionsstring of special words, ≤500 charsabsent 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/plan with your key. On 401 (invalid or unknown key) it enhances no fields and logs console.error. On network or 5xx failure it proceeds with free-plan limits (20 s audio, 2 fields) and logs console.warn.
  • Plan field cap: up to the plan's max_fields_per_page fields (first N in DOM order) are enhanced; the rest are skipped, a console.warn is emitted, and one fields_limit_exceeded event is reported via POST /v1/events per page load. A null cap 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 is null (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 input event (so framework-controlled inputs update). The field also receives a dicti:transcribed CustomEvent with detail {text, language, duration_seconds, summarized}.
  • Errors: no alert() or modals, ever. A short inline note appears near the field and auto-dismisses; details go to console.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 file field) during transcription; it is never persisted by the widget.

Plans and limits

PlanPriceMax audio per fieldFields per pageConcurrent requestsAI summary
free$020 sec21no
tier5$560 sec52no
tier10$10300 sec105yes
advancedCustomunlimitedunlimitedunlimitedyes
add-on: unlimited-audio+$10unlimited (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).

StatusMeaning
401invalid or unknown API key
403plan limit exceeded — audio longer than the plan cap, or summary_length sent on a plan without AI summary (free, tier5)
413upload exceeds 10 MB
415unsupported audio content type
422audio empty or undecodable
429rate 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

SymptomLikely 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 responsesRate limit (30 requests/min/key) exceeded.
413 / 415 / 422 File over 10 MB / unsupported content type / empty or undecodable audio.