DocsGetting startedIntroduction

Introduction

Miko is an AI support layer for your product. It answers customer questions instantly from your own content — crawled pages, uploaded documents and manual answers — and hands the conversation to a human on Slack or the web panel the moment the AI is not enough.

Ingest

Crawl your site, upload PDFs & docs.

Answer

Grounded answers with citations.

Hand off

Escalate to Slack with context.

Quickstart

Create a workspace, point Miko at your documentation and drop the widget into your app. A typical setup takes under ten minutes.

  1. 1. Create a workspace and copy your public key from Settings → API.
  2. 2. Add at least one knowledge source (crawl or upload).
  3. 3. Install the widget script and set your brand colours.
  4. 4. Connect Slack so handoffs reach your team.

Install the widget

Paste the snippet before the closing </body> tag. It loads asynchronously and adds roughly 14 kB gzipped.

html
<script
  src="https://cdn.miko.dev/widget.js"
  data-key="pk_live_xxxxxxxxxxxx"
  data-position="bottom-right"
  defer
></script>

For React apps install the package instead:

bash
npm install @miko/widget
tsx
import { MikoWidget } from "@miko/widget";

export function App() {
  return <MikoWidget publicKey={process.env.NEXT_PUBLIC_MIKO_KEY!} />;
}

Crawl your website

The crawler follows same-origin links, respects robots.txt and re-indexes on the schedule you pick. Use include and exclude patterns to keep marketing noise out of the index.

bash
curl -X POST https://api.miko.dev/v1/sources/crawl \
  -H "Authorization: Bearer $MIKO_SECRET_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "url": "https://docs.example.com",
    "include": ["/docs/*", "/guides/*"],
    "exclude": ["/blog/*"],
    "schedule": "daily"
  }'
Pages larger than 2 MB are truncated. JavaScript-rendered pages are supported — enable Render JS on the source if your docs are client-side rendered.

Upload documents

Miko accepts PDF, DOCX, Markdown, TXT and CSV up to 50 MB per file. Files are chunked semantically, embedded and stored with the source metadata so answers can cite the exact page.

bash
curl -X POST https://api.miko.dev/v1/sources/upload \
  -H "Authorization: Bearer $MIKO_SECRET_KEY" \
  -F "[email protected]" \
  -F "title=Support handbook"

Answer quality

  • • Keep one canonical page per topic — duplicates split retrieval scores.
  • • Add manual answers for policies that never appear in your docs.
  • • Review the weekly “unanswered questions” digest and turn gaps into content.
  • • Miko never invents facts: with no matching source it offers a handoff instead.

How handoff works

A conversation escalates when the customer taps Talk to a human, when the retrieval confidence falls below your threshold, or when a rule matches (for example the words “refund” or “outage”). Miko creates a ticket with the full transcript, the cited sources and the customer’s metadata.

Slack routing

Connect Slack from Settings → Integrations. Each ticket opens a thread in the channel you choose; replies in the thread are streamed straight back into the customer’s chat window. Outside business hours Miko falls back to email.

json
{
  "routing": [
    { "if": "topic == 'billing'", "channel": "#support-billing" },
    { "if": "plan == 'enterprise'", "channel": "#support-vip", "sla": "15m" },
    { "default": true, "channel": "#support" }
  ]
}

Authentication

The public key (pk_live_…) is safe in the browser and only allows starting conversations. The secret key (sk_live_…) is server-only and required for every admin endpoint. Send it as a bearer token.

bash
Authorization: Bearer sk_live_xxxxxxxxxxxx

Chat API

Stream answers into your own interface. Responses are server-sent events; each message ends with the sources used to build it.

bash
POST https://api.miko.dev/v1/chat

{
  "conversation_id": "conv_8f21",
  "message": "How do I verify my domain?",
  "stream": true,
  "user": { "email": "[email protected]", "plan": "growth" }
}
json
{
  "answer": "Add the TXT record shown in Settings → Domains…",
  "confidence": 0.91,
  "sources": [
    { "title": "Verify your domain", "url": "https://docs.example.com/domains" }
  ],
  "handoff_offered": false
}

Webhooks

Subscribe to lifecycle events to sync tickets with your own helpdesk. Every payload is signed with X-Miko-Signature (HMAC-SHA256).

EventFires when
conversation.startedA visitor sends their first message
answer.createdMiko returns an AI answer
handoff.requestedThe conversation is escalated to a human
ticket.resolvedAn agent closes the ticket
Next: Guides

Practical walkthroughs for deflection tuning, migrations and SLAs.

Browse guides