Use with AI

Point Claude Code, Codex or Cursor at these docs and let it write the integration.

Every page of these docs is also plain markdown, written to be read by a coding agent as well as by you:

URLWhat it is
/llms.txtAn index of every page, with a one-line summary each.
/llms-full.txtAll of the docs in one file, the API reference included.
Any page's URL plus .mdThat page alone, such as /docs/quickstart.md.
/openapi/v1.yamlThe OpenAPI spec.

The buttons at the top of each page copy it as markdown, open it in Claude, or copy a Claude Code command that starts from it.

Point your agent at the docs

Run Claude Code in your project with the docs in the prompt:

claude "Read https://docs.sparkle.ai/llms-full.txt and help me integrate Sparkle into this project."

To keep the docs in every session, add the snippet below to your CLAUDE.md.

If your agent can't fetch URLs, download the file into the project and point it there:

curl -o sparkle-docs.md https://docs.sparkle.ai/llms-full.txt

A snippet for AGENTS.md or CLAUDE.md

Paste this into the file your agent reads at the start of every session. It holds what an agent gets wrong most often without the docs:

AGENTS.md
## Sparkle

This project uses Sparkle to detect moments in conversations: decisions, requests, questions,
knowledge gaps. Full docs: https://docs.sparkle.ai/llms-full.txt. Any docs page as markdown: its
URL plus `.md`.

- API base: https://api.sparkle.ai/public/v1, JSON. Authenticate with the header
  `X-API-Key: $SPARKLE_API_KEY` (`spk_test_…` in development, `spk_live_…` in production). The key
  stays on the server; never send it to a browser.
- Every POST and PUT needs an `Idempotency-Key` header: a new UUID per request, reused only to retry
  that same request.
- Flow: `POST /conversations` → `POST /conversations/{id}/turns` (up to 500 per batch) → moments on
  `GET /conversations/{id}/stream` (server-sent events) and as `moment.detected` webhooks →
  `POST /conversations/{id}/end`. Finished transcripts: `POST /conversations/import`.
- Turn: `{id, final, speaker, name?, channel: "mic" | "remote", start, end, text}`, times in seconds
  from the conversation's `started_at`. The same `id` replaces a turn; only final turns are
  detected on; order within a batch doesn't matter; `speaker` is a stable key, `name` is optional.
- Event: `{id: "evt_…", object: "event", type, livemode, created_at, data}`; `livemode` is false for a test
  key's conversations, whose events reach test subscriptions only. Deduplicate on the event `id`.
  Types: `conversation.created`, `moment.detected`, `conversation.ended`, `conversation.deleted`.
- Webhooks: verify `Sparkle-Signature` (`t=<unix seconds>,v1=<hex>`) before parsing: HMAC-SHA256 of
  `<t>.<raw body>` keyed with the secret, compared in constant time; reject a `t` more than 300
  seconds from now. Answer 2xx within 30 seconds and do slow work after.
- Moment kinds: `question.open`, `question.directed`, `knowledge_gap`, `reference`, `request.find`,
  `request.do`, `decision`, `work_item`, `next_steps`, `ideas_wanted`, plus custom moments by name.
- Errors are RFC 9457 problem details. Branch on `code`, not on `detail`.

Prompts to start from

Copy one, fill in what's in angle brackets, and run it in your project.

Integrate from scratch

Read https://docs.sparkle.ai/llms-full.txt. Integrate Sparkle into this project: create a
conversation when a call starts, send our transcript to it as turns under Sparkle's turn contract,
and end the conversation when the call ends. Read the API key from SPARKLE_API_KEY and send an
Idempotency-Key with every POST. Before writing code, show me where our transcript comes from and
how you'll map it to turns.

Handle webhooks

Read https://docs.sparkle.ai/docs/webhooks.md. Add an endpoint that receives Sparkle webhooks:
verify Sparkle-Signature on the raw body with SPARKLE_WEBHOOK_SECRET, reject timestamps more than
5 minutes old, drop event ids we've already handled, answer 204 at once and handle moment.detected
after responding. Add a test that sends a correctly signed sample event and one with a bad signature.

Stream moments into a UI

Read https://docs.sparkle.ai/docs/concepts/delivery.md. Show Sparkle moments live in our UI while a
call runs: open GET /conversations/{id}/stream from our server (the API key must never reach the
browser), resume with Last-Event-ID after a disconnect, and relay each moment to the client over
<our realtime channel>. Show each moment's kind, speaker name and text as it arrives.

Define a custom moment

Read https://docs.sparkle.ai/docs/guides/custom-moments.md. Help me define a Sparkle custom moment
named <snake_case_name> that fires when <describe it>. Draft when and not_when, and five fire and
five skip examples. Evaluate it with POST /moments/evaluate on the transcript in <file>, labelling
the turns it should fire on, then suggest wording changes from the misses and false fires before we
make it live.

On this page