# Welcome to ButterIX > ButterIX is a platform that builds API documentation sites from OpenAPI and MDX. This page covers what it can do, who it's for, and where to start. ButterIX builds a project made of `docs.yml`, MDX pages, and OpenAPI specs into **a set of plain static files**: every page is HTML that search engines can index directly, plus a Markdown version for AI to read. The ButterIX hosted platform builds and hosts it, and adds Ask AI, MCP, and analytics. The site you're reading is itself a biti project (source in the repository's `apps/docs/`), and it uses almost every feature described in these docs. ## Start here [**Quickstart**](https://docs.butterix.com/en/guides/get-started/quickstart.md) Install the CLI, preview on your computer, and publish your first docs site in five minutes. [**Core concepts**](https://docs.butterix.com/en/guides/get-started/concepts.md) Projects, navigation, variants (version × locale), static output, and the runtime. [**docs.yml reference**](https://docs.butterix.com/en/guides/configuration/docs-yml.md) Site configuration field by field: branding, layout, navigation, versions, locales, SEO, AI. [**Components**](https://docs.butterix.com/en/components/overview.md) 40+ MDX components, used directly in your pages with no imports. ## Why ButterIX **Fully static output** Every page is plain HTML / CSS / JS, with zero hydration and a very fast first paint. **API reference** Generate endpoint pages, code samples in 9 languages, and an interactive playground from OpenAPI 3.x / Swagger 2. **Versions and locales** Version switching, the `translations//` directory convention, incremental AI translation, and hreflang. **Agent-friendly** Every page has a `.md` version, `llms.txt` is generated automatically, and every site ships with its own MCP server. **Ask AI** Answers questions from your docs with citations, powered by Anthropic, DeepSeek, or OpenRouter. **Safe MDX** No author code is ever executed: props accept literals only, so it's safe even for multi-tenant hosting. ## What a project looks like ``` my-docs/ docs.yml pages/ introduction.mdx quickstart.mdx openapi.yml assets/ logo.svg ``` The smallest `docs.yml` needs only a title and navigation: ```yaml title="docs.yml" title: Acme Docs navigation: - section: Get started contents: - page: Introduction path: pages/introduction.mdx slug: introduction ``` Run `biti dev` to preview on your computer and `biti deploy` to publish to the hosted platform. See the [Quickstart](https://docs.butterix.com/en/guides/get-started/quickstart.md) for details. ## Already using Fern or Mintlify? **Fern** ButterIX keeps its `docs.yml` fields consistent with Fern (kebab-case), reads `fern/docs.yml` directly, and supports compatible component names and props. See [Migrate from Fern](https://docs.butterix.com/en/guides/reference/migrate-from-fern.md). **Mintlify** A `docs.json` / `mint.json` at the project root is automatically converted to ButterIX configuration on load, and components like ``, ``, and `` work out of the box. See [Migrate from Mintlify](https://docs.butterix.com/en/guides/reference/migrate-from-mintlify.md). > **Hand your docs to AI** > > Append `.md` to the URL of any page on this site to get its Markdown; [`/llms.txt`](https://docs.butterix.com/en/llms.txt) at the site root lists every page. You can also connect this site's MCP server to Claude Code or Cursor — see [Agent-friendly](https://docs.butterix.com/en/guides/features/agents.md). --- # Quickstart > Install the biti CLI and ship your first docs site with biti init, biti login, biti dev, and biti deploy. ## Prerequisites - Node.js **22.13** or later (check with `node -v`). - An empty directory, or an existing Fern / Mintlify docs project. - A ButterIX account and an organization API key: previewing, checking, and publishing all happen on the platform. ## Live in four steps ### Install the CLI The CLI package is named `bitidocs`, and the command is `biti`. ```bash npm npm install -g bitidocs ``` ```bash pnpm pnpm add -g bitidocs ``` ```bash Inside the ButterIX repo # The root package.json provides a biti script, so no global install is needed pnpm biti --help ``` Run `biti --version` after installing to confirm. ### Create a project ```bash biti init my-docs --title "Acme Docs" ``` `biti init` generates the following files (it refuses to overwrite if the target directory already has a `docs.yml`): ``` my-docs/ docs.yml pages/ introduction.mdx quickstart.mdx assets/ logo.svg AGENTS.md .gitignore ``` Already have an OpenAPI spec? Add `--openapi` to copy it to `openapi.yml` and generate an "API Reference" tab: ```bash biti init my-docs --openapi ./openapi.yaml ``` ### Sign in and preview ```bash cd my-docs biti login --token biti_xxxxxxxxxxxxxxxx biti dev ``` Create the API key in the dashboard; see [CLI deployment and API keys](https://docs.butterix.com/en/guides/deploy/cli-deploy.md). Open the address printed in the terminal (`http://localhost:3000` by default): pages are rendered by the ButterIX platform, biti syncs your changes to it, and the browser reloads when you save a file; CSS-only changes swap the stylesheet without a full reload. The preview opens on your computer only; search and Ask AI work on the published site. > **Note** > > If the port is taken, use `biti dev --port 3100`. ### Publish ```bash biti deploy --site acme-payments ``` The CLI uploads the project to the platform and prints the live URL once the build finishes. See [CLI deployment and API keys](https://docs.butterix.com/en/guides/deploy/cli-deploy.md). ## Write your first page Create `guides/authentication.mdx` under `pages/`: ````mdx title="pages/guides/authentication.mdx" --- title: Authentication subtitle: Every request must include an API key in the Authorization header. --- Never commit API keys to your repository. ## Get a key Create a key under **Settings → API Keys** in the dashboard, then: ```bash curl https://api.example.com/v1/me \ -H "Authorization: Bearer $ACME_KEY" ``` ```` Then add it to the navigation in `docs.yml`: ```yaml title="docs.yml" {7-9} navigation: - section: Get started contents: - page: Introduction path: pages/introduction.mdx - page: Quickstart path: pages/quickstart.mdx - page: Authentication path: pages/guides/authentication.mdx slug: authentication ``` > **Info** > > By default, a page's URL is generated from its title in the navigation. If the title contains non-ASCII characters (such as Chinese), set `slug` explicitly, or the URL will contain those characters. See [Navigation](https://docs.butterix.com/en/guides/configuration/navigation.md#slug-rules) for the rules. ## Check before committing ```bash biti check ``` `biti check` loads the configuration on the platform, parses and renders every page, and reports configuration errors, missing pages, broken links, unknown components, and missing asset files. In CI or coding agents, use `--json` for machine-readable results and `--strict` to treat warnings as errors: ```bash biti check --json --strict ``` ## Next steps [**Project structure**](https://docs.butterix.com/en/guides/get-started/project-structure.md) What each directory and file is for. [**Writing**](https://docs.butterix.com/en/guides/writing/markdown.md) Markdown, code blocks, images, and components. [**Import OpenAPI**](https://docs.butterix.com/en/guides/api/openapi.md) Generate an API reference from a spec. --- # Core concepts > The ButterIX rendering pipeline, the site model (tabs, sections, pages), variants (product × version × locale), and the split between static output and the dynamic runtime. ## Rendering pipeline A build starts by reading `docs.yml` and ends by writing a static directory. The whole process **never executes any author code**. ```mermaid flowchart LR A["docs.yml
pages/*.mdx
openapi.yml"] --> B["@bitidocs/core
config · navigation · MDX safe subset"] B --> C["@bitidocs/builder
Shiki pre-highlighting · per-page rendering"] C --> D["@bitidocs/ui
React server rendering → HTML"] D --> E["Static output
HTML · .md · llms.txt
sitemap · search index"] E --> F["Runtime
Ask AI · MCP · playground proxy
feedback · analytics"] ``` | Stage | Package | What it does | | ------- | ------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | Parse | `@bitidocs/core` | Loads and validates `docs.yml` (`docs.json` is read too), resolves navigation, parses MDX into a syntax tree, and safely evaluates props | | API | `@bitidocs/openapi` | Parses, upgrades (Swagger 2 / OAS 3.0 → 3.1), and dereferences OpenAPI, and generates examples and code snippets in 9 languages | | Build | `@bitidocs/builder` | Pre-highlights every code block with Shiki (light / dark themes), renders each page, and writes HTML, Markdown, `llms.txt`, the sitemap, and the Pagefind search index | | Render | `@bitidocs/ui` | React server rendering (`renderToStaticMarkup`) that outputs zero-hydration static HTML | | Browser | `@bitidocs/client` | A tiny entry script: client-side navigation, theme switching, interactive components; heavy overlays like search, Ask AI, and the playground load on demand | | Runtime | `@bitidocs/runtime` | Static file serving plus dynamic endpoints, provided by the hosted platform | ## Site model Navigation has three layers:
Tabs Top-level entries shown in the header, such as this site's "Guides", "Components", "API Reference", and "Changelog". Declare them under `tabs:` in `docs.yml` and reference them in `navigation:` with `- tab: `. A tab can have its own URL segment (`slug`) or omit it with `skip-slug: true`.
Sections Groups in the sidebar, nestable to any depth. A section can have an overview page (`path`), can be collapsed by default (`collapsed`), and by default contributes a URL segment to the pages under it.
Pages and other nodes `page` (one MDX file), `link` (an external or internal link), `folder` (generated automatically from a directory), `api` (a set of endpoint pages generated from OpenAPI), and `changelog` (a changelog generated from dated files).
See [Navigation](https://docs.butterix.com/en/guides/configuration/navigation.md) for the full syntax. ## Variants: product × version × locale The same navigation can be expanded into multiple **variants**. Each variant has its own URL prefix: | Dimension | Config | Example URL prefix | Default | | --------- | -------------------------------------------- | ------------------ | ------------------------------------------ | | Locale | `languages:` | `/en` | The default locale has no prefix | | Product | `products:` | `/sdk` | The first product also has its own segment | | Version | `versions:` (or `versions:` under a product) | `/v0` | The first version has no prefix | Prefixes are joined in the order `basepath → locale → product → version`. For example, on this site: - Chinese v1: `/guides/get-started/quickstart` - English v1: `/en/guides/get-started/quickstart` - Chinese v0: `/v0/guides/get-started/quickstart` Pages that have **the same tab id, section titles, and page title** across variants are treated as the same page: the locale and version switchers jump straight to the corresponding page, and the builder uses this to output `hreflang` and canonical tags for older versions. ## Static output and the runtime ### Static output (always present) - One `index.html` and one `.md` per page - `llms.txt` and `llms-full.txt` (one per locale) - `sitemap.xml`, `robots.txt`, `_redirects`, `404.html` - Pagefind search index, OpenAPI specs and the API catalog, skills - RSS for the changelog - Pre-compressed `.br` / `.gz` ### Runtime - `/_biti/ai/chat`: Ask AI (SSE streaming answers) - `/_mcp/server`: the site's MCP server - `/_biti/proxy`: API playground proxy - `/_biti/feedback`: "Was this page helpful?" - `/_biti/e`: page analytics events - Returns Markdown for `Accept: text/markdown`, and Markdown 404s for missing pages The static output handles browsing and search, and the runtime layers dynamic features on top. The hosted platform provides the runtime for every site. ## Security model ButterIX is a multi-tenant platform: docs uploaded by anyone are built on the same set of services. MDX therefore supports only a **safe subset**: you can use components and literal props, but you can't `import` arbitrary modules, write functions, or run scripts. See [Safe subset](https://docs.butterix.com/en/guides/writing/safe-mdx.md) for the reasons and details. > **Note** > > Site-level custom `css` / `js` (declared in `docs.yml`) still work. They're output to the page as plain `` and ` ``` | Output | Source | | ----------------------- | -------------------------------------------------------------------------------------------------------------------- | | `` | `seo.title-template` (default `{page} \| {site}`); the page title can be overridden with frontmatter `og:title` | | description | frontmatter `description` → `og:description` → `subtitle` → body excerpt | | keywords | frontmatter `keywords` | | `og:image` | frontmatter `og:image` → `seo.og-image`; with an image, the Twitter card automatically becomes `summary_large_image` | | `article:modified_time` | frontmatter `last-updated` | | `robots` | `noindex, nofollow` is output for page `noindex`, `noindex` in the navigation, `seo.noindex`, or preview deployments | See [Page metadata](https://docs.butterix.com/en/guides/configuration/frontmatter.md#seo) and [docs.yml › SEO](https://docs.butterix.com/en/guides/configuration/docs-yml.md#seo) for field details. ## canonical - Defaults to the page's own absolute URL, on the site's [primary domain](https://docs.butterix.com/en/guides/deploy/custom-domains.md#after-activation). - **Older version pages** point canonical to the same page in the default version, so similar content across versions doesn't compete for ranking. See [Versions](https://docs.butterix.com/en/guides/features/versions.md#matching-the-same-page-across-versions). - Set it manually with frontmatter `canonical-url`. ## Structured data Every page outputs two JSON-LD blocks: - `TechArticle`: title, description, URL, language (`inLanguage`), `dateModified` (when `last-updated` is set), and the parent `WebSite`. - `BreadcrumbList`: generated from the section path in the navigation, matching the breadcrumbs on the page. ## sitemap.xml `/sitemap.xml` contains every page (all languages and versions, except `noindex` pages and changelog date detail pages), and each URL carries `xhtml:link` entries for its other language versions: ```xml title="sitemap.xml (excerpt)" <url> <loc>https://acme-payments-sites.butterix.com/guides/features/seo</loc> <xhtml:link rel="alternate" hreflang="zh" href="https://acme-payments-sites.butterix.com/guides/features/seo"/> <xhtml:link rel="alternate" hreflang="en" href="https://acme-payments-sites.butterix.com/en/guides/features/seo"/> </url> ``` ## robots.txt and AI crawlers The default `robots.txt` allows all crawlers and declares the sitemap: ```text title="robots.txt" User-agent: * Allow: / Sitemap: https://acme-payments-sites.butterix.com/sitemap.xml ``` ### Declare content use `seo.content-signal` outputs `Content-Signal` in `robots.txt`, saying what your content may be used for. All three are optional booleans; ones you leave out aren't output: ```yaml title="docs.yml" seo: content-signal: search: true # building a search index ai-input: true # input for AI answers ai-train: false # training models ``` ```text title="robots.txt" User-agent: * Content-Signal: search=yes, ai-input=yes, ai-train=no Allow: / ``` ### Block AI crawlers With `seo.ai-crawlers: disallow`, the following AI training and retrieval crawlers are additionally blocked: - GPTBot - ChatGPT-User - OAI-SearchBot - ClaudeBot - Claude-User - Claude-SearchBot - anthropic-ai - PerplexityBot - Google-Extended - Applebot-Extended - CCBot - Bytespider - meta-externalagent ### Use your own robots.txt ```yaml title="docs.yml" agents: robots-txt: robots.txt # relative to docs.yml ``` The file is published as it is; `ai-crawlers` and `content-signal` no longer apply. With `seo.noindex: true` or on preview deployments, `robots.txt` is always `Disallow: /`, even with your own file. > **Info** > > Docs usually want to be read by AI: developers increasingly learn about an API through ChatGPT, Claude, and Cursor. ButterIX allows AI crawlers by default and provides `.md` and `llms.txt` so they read more accurately; see [Agent-friendly](https://docs.butterix.com/en/guides/features/agents.md). ## Redirects When restructuring, use `redirects` to keep the ranking of old links: ```yaml title="docs.yml" redirects: - source: /docs/getting-started destination: /guides/get-started/quickstart - source: /api/v1/:endpoint destination: /api-reference/:endpoint ``` - 301 permanent redirects by default; `permanent: false` gives 302. - Redirects keep the query string; `.md` and `.mdx` URLs go to the Markdown of the target page. - When the home page isn't `/`, the root URL automatically 302-redirects to the home page. ## URL normalization - Page URLs have no trailing slash; the runtime 308-redirects `/guides/` to `/guides` to avoid duplicate URLs. - Nonexistent URLs return a real **404 status code** and `404.html` (with `noindex`); requests for Markdown get a [Markdown 404](https://docs.butterix.com/en/guides/features/agents.md#redirects-and-missing-pages). ## Performance Speed is itself a ranking factor: - Zero hydration: pages don't need to re-render in the browser. - Code highlighting happens at build time, and icons are combined into an in-page SVG sprite with no icon fonts loaded. - `.br` and `.gz` are precompressed at build time, and the runtime returns them directly based on `Accept-Encoding`. - Hashed static assets (styles, scripts, fonts) use a one-year `immutable` cache; HTML is revalidated every time. ## Preview deployments Every page of a preview deployment (pull requests, editor previews, `biti deploy --preview`) carries `noindex`, `robots.txt` blocks crawling, and a "Preview" banner appears at the top of the page, so previews never compete with the production site for indexing. --- # Agent-friendly > ButterIX features for AI and coding agents — the .mdx source and clean Markdown of every page with a page directive, Accept content negotiation, Markdown 404s, page actions with one-click MCP setup, llms.txt and llms-full.txt, the site MCP server (search_docs, get_page, list_pages, send_feedback), hosted skills, API specs and the API catalog, link parameters, and the writing skill and biti check --json for agents that edit docs. More and more developers read docs through AI assistants and write integration code with coding agents. ButterIX treats these readers as first-class citizens: [**Markdown for every page**](#markdown-for-every-page) The `.mdx` source or `Accept: text/markdown` [**llms.txt**](#llmstxt) Site-wide index and full text [**MCP server**](#site-mcp-server) Search the docs right from your IDE [**Skills**](#hosted-skills) One command installs them in a coding agent ## Markdown for every page At build time every page also outputs a clean Markdown version: components are converted to equivalent Markdown structures (callouts become blockquotes, code groups expand into multiple code blocks, tabs expand into subsections…). API endpoint pages include field tables for parameters and the request body, a cURL example, the response fields of every status code, and a response example; [snippet components](https://docs.butterix.com/en/components/endpoint-request-snippet.md) that reference endpoints expand into the actual code and field tables. Links to other pages of the site, in text and in components, become absolute URLs to the `.md` of the target page (e.g. `https://docs.acme.com/prices/basic.md`), and images and files are absolute too, so an AI given a single page can keep reading. How to get it: **Add a .mdx suffix** Append `.mdx` to any page URL to get the page's source as its author wrote it, with components left as MDX: ```bash curl https://acme-payments-sites.butterix.com/guides/features/agents.mdx ``` The site root page maps to `/index.mdx`, and the `.md` suffix redirects to `.mdx`. Generated pages such as endpoint pages and the changelog have no source: both `.md` and `.mdx` return their clean Markdown. **Content negotiation** When the `Accept` request header prefers `text/markdown`, the runtime returns Markdown directly for the same URL: ```bash curl https://acme-payments-sites.butterix.com/guides/features/agents \ -H "Accept: text/markdown" ``` HTML responses also carry a `Link: </guides/features/agents.md>; rel="alternate"; type="text/markdown"` header, and the page `<head>` has a matching `<link rel="alternate" />`, so agents can discover the Markdown version. **Page actions** Below every page title is a set of buttons: - **Copy page**: copies the Markdown to the clipboard to paste into any AI. - **View Markdown**: opens the `.md` in a new tab. - **More**: open in ChatGPT or Claude (the prompt includes the full URL of the page's `.md`); connect Claude Code (copies the install command), Cursor, or VS Code (opens the editor to install it); or copy the MCP URL. Choose which ones show with [`theme.page-actions`](https://docs.butterix.com/en/guides/configuration/docs-yml.md#theme). The connect and copy MCP entries are hidden when the site's MCP is off or the site is password protected. ### Page directive The clean Markdown starts with a blockquote that tells agents how to read on: ```markdown > For the MDX source of any page, append .mdx to the page URL. > For a complete documentation index, see https://docs.acme.com/llms.txt. > For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.acme.com/_mcp/server. > If something on this page is wrong or missing, POST JSON {"page": "<page URL>", "message": "<what is wrong>"} to https://docs.acme.com/_biti/feedback/agent. ``` All pages have it, including endpoint pages and the changelog. The index URL follows the page's language, the MCP line appears only when the site has an MCP server, and the last line only on hosted sites with [page feedback](https://docs.butterix.com/en/guides/configuration/docs-yml.md#page-feedback) on; for what is sent, see [Analytics › Feedback](https://docs.butterix.com/en/guides/features/analytics.md#feedback). Replace it with your own text in `agents.page-directive`; an empty string leaves it out: ```yaml title="docs.yml" agents: page-directive: | Read https://docs.acme.com/llms.txt first. Prefer TypeScript in code samples. ``` With several [versions or products](https://docs.butterix.com/en/guides/features/versions.md), the directive is preceded by a note on which version or product the page belongs to, with the index URLs of the others. The directive is only in the clean Markdown: page sources, web pages, Copy page, `llms-full.txt`, and Ask AI don't include it. ### Redirects and missing pages - [Redirects](https://docs.butterix.com/en/guides/features/seo.md#redirects) apply to `.md` and `.mdx` URLs too, ending at the target page's source and keeping the query string. - A request for Markdown that doesn't exist gets a 404 status and a Markdown body listing the pages with the most similar URLs and the index of all pages. ## llms.txt At build time two files are generated for each language (following the [llmstxt.org](https://llmstxt.org) convention): | File | Contents | | -------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | `/llms.txt` | Site title, summary (`agents.llms-txt.description` or `description`), and links to all pages grouped by tab (pointing to `.md`) with one-line descriptions | | `/llms-full.txt` | The full Markdown of all pages concatenated, suitable for putting into context in one go | | `/en/llms.txt`, `/en/llms-full.txt` | English version | | `/v0/llms.txt` and so on | One index per other version and product, at its path plus `/llms.txt` (except hidden versions) | | `/changelog.md`, `/changelog/llms.txt` | One pair per changelog (or blog): the latest 20 entries in full Markdown, and an index of every entry; see [Changelog](https://docs.butterix.com/en/guides/configuration/changelog.md#agent-friendly-output) | The `llms.txt` at the root and of each language only includes default-version pages that aren't hidden or set to `noindex`. On sites with an API, a final **Specifications** section lists where to download each spec. `llms-full.txt` also leaves out `noindex` pages. ### Take only what you need Add parameters to the address to leave out what you don't need and save the AI some context: | Parameter | On | Leaves out | | ------------------------ | --------------------------- | ------------------------------ | | `?excludeSpec=true` | `llms.txt` | The **Specifications** section | | `?excludeChangelog=true` | `llms.txt`, `llms-full.txt` | Changelogs and blogs | The two can be combined. `true`, `1` or the bare name all turn a parameter on. When the site has nothing to leave out, `llms.txt` doesn't mention the parameter and returns the whole file even with it. This site's [`/llms.txt`](https://docs.butterix.com/en/llms.txt) starts like this: ```markdown title="llms.txt" # ButterIX > Official ButterIX documentation: docs.yml configuration, MDX components, OpenAPI reference, versions and internationalization… For the MDX source of any page, append `.mdx` to its URL. Full content: https://docs.butterix.com/llms-full.txt ## Guides - [ButterIX Docs](https://docs.butterix.com/guides/get-started/introduction.md): ButterIX is a platform that builds API documentation sites from OpenAPI and MDX… - [Quickstart](https://docs.butterix.com/guides/get-started/quickstart.md): Install the biti CLI… ``` ## Site MCP server Every hosted site provides a [Model Context Protocol](https://modelcontextprotocol.io) server at `/_mcp/server`, using the Streamable HTTP transport (JSON responses). Public sites need no authentication; for password-protected sites see [Access control](https://docs.butterix.com/en/guides/deploy/access-control.md#ai-tools-and-programs). It provides these tools: - `search_docs` (tool): Searches the site and returns the most relevant passages with their URLs. Parameters: `query` (required, natural language or keywords), `limit` (1–20, default 6), `locale` (a language code such as `en`). - `get_page` (tool): Gets a page's full Markdown by URL. Parameters: `path` (page path or full URL, for example `/guides/get-started/quickstart`). - `list_pages` (tool): Lists the title, URL, and description of every page in one language. Parameters: `locale`. - `send_feedback` (tool): Tells the docs team that a page is wrong, out of date, or missing something. Parameters: `page` (the page's URL), `message` (required, up to 2000 characters). Only on hosted sites with page feedback on; at most 5 per address per minute. The `locale` parameter exists only on sites with several languages. Without it, `search_docs` goes by the language of the query, or the default language when that can't be told, and returns other languages only when that one has no results; `list_pages` lists the default language. A language the site doesn't have returns an error listing the available ones. The search index only includes default-version pages. Each IP is limited to 120 calls per minute. ### Set it up in coding tools Replace the URL below with your docs site's URL (for hosted sites, get it from "Copy MCP URL" on the site overview page in the dashboard): ```bash Claude Code claude mcp add --transport http acme-docs https://docs.acme.com/_mcp/server ``` ```jsonc Cursor // ~/.cursor/mcp.json or .cursor/mcp.json in your project { "mcpServers": { "acme-docs": { "url": "https://docs.acme.com/_mcp/server" } } } ``` ```jsonc VS Code // .vscode/mcp.json { "servers": { "acme-docs": { "type": "http", "url": "https://docs.acme.com/_mcp/server" } } } ``` Once configured, just ask in the conversation (for example, "Use acme-docs to find out how to verify webhook signatures"), and the agent calls `search_docs` first, then reads the full page with `get_page`. ### Call it manually ```bash curl -X POST https://docs.acme.com/_mcp/server \ -H "Content-Type: application/json" \ -d '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"search_docs","arguments":{"query":"custom domain","limit":3}}}' ``` See [MCP server](https://docs.butterix.com/en/api-reference/runtime/mcp.md) in the API reference for the full request and response format. ### Turn MCP off ```yaml title="docs.yml" agents: mcp: false ``` `/_mcp/server` then returns 404, and the page menu, page directive, and Ask AI no longer mention it. > **Info** > > To let a coding assistant look up your sites' deployments, analytics, questions, and feedback, use the [organization MCP server](https://docs.butterix.com/en/guides/deploy/platform.md#organization-mcp-server). **Have an agent write code from your docs** ```text Using the ButterIX docs MCP server, find out how to create a preview deployment through the platform API, then write a Node.js script that packages the current directory, uploads it as a preview deployment, polls until the deployment finishes, and prints the preview URL. ``` ## Hosted skills Put skills in `.well-known/agent-skills/` at the project root (next to `docs.yml`) to publish them with the site: ``` docs/ docs.yml .well-known/ agent-skills/ acme-payments/ SKILL.md references/ errors.md ``` ```markdown title="SKILL.md" --- name: acme-payments description: Create and look up payments with the Acme Payments API. Use when writing payment integration code. --- # Integrating Acme Payments … ``` Readers install them with one command: ```bash npx skills add https://docs.acme.com ``` The build generates an index at `/.well-known/agent-skills/index.json`, and each `SKILL.md` is at `/.well-known/agent-skills/<name>/SKILL.md`. A skill with other files is also packed as a `.tar.gz` that the index points to. If you provide an `index.json`, yours is used. `biti check` and the build verify that: - Each skill is a folder with a `SKILL.md`; one without gets a warning and is left out of the index; - `name` matches the folder and uses only lowercase letters, digits, and single hyphens, up to 64 characters; - `description` is present, up to 1024 characters; - All skill files together are at most 20 MB; - Your own `index.json` is valid JSON with a `skills` list. ## API specs and catalog Sites with an API reference publish their spec at `/openapi.json` and `/openapi.yaml`, and an API catalog at `/.well-known/api-catalog`, so agents can find every endpoint without parsing pages. See [Download the spec](https://docs.butterix.com/en/guides/api/openapi.md#download-the-spec). ## Link parameters | Parameter | Effect | | ------------------ | -------------------------------------------------------------------------------------------------------------------------------- | | `?ask-ai` | Opens the page with the [chat panel](https://docs.butterix.com/en/guides/features/ask-ai.md#open-the-panel-from-a-link) expanded | | `?ask-ai=question` | The same, with the question written in the box for the reader to send | | `?search=words` | Opens search with these words | Values must be URL-encoded, and work on any page URL. ## Let coding agents edit your docs ButterIX is designed so that agents like Claude Code and Cursor can safely modify a docs project: - **Writing skill**: `biti init --skill` writes it to `.claude/skills/butterix-docs`, or install it with `npx skills add https://docs.butterix.com`. It contains writing rules, a workflow, and references for the configuration and every component. - `biti init` generates `AGENTS.md`, explaining where content lives and what to do after making changes. - `biti check --json` outputs machine-readable diagnostics (error code, file, line, hint) that agents can use to correct themselves; `--strict` treats warnings as errors too. - `biti components --json` lists every component and its props, so agents don't have to guess component names. - MDX only allows literal props (see [Safe subset](https://docs.butterix.com/en/guides/writing/safe-mdx.md)), so content written by agents can't execute arbitrary code. ```json title="biti check --json output (excerpt)" { "ok": false, "pages": 94, "diagnostics": [ { "severity": "warning", "code": "link/broken", "message": "Link target not found: ./quickstrat.mdx", "file": "pages/introduction.mdx" } ] } ``` ## Understand AI traffic The hosted platform distinguishes visits from humans, AI crawlers, and AI assistants, and counts `.md` requests, requests for index and spec files, and MCP calls separately; see [Analytics](https://docs.butterix.com/en/guides/features/analytics.md). --- # Ask AI > Ask AI in ButterIX — what readers can ask, what answers are based on, choosing a model and adding a key, extra instructions, custom answers, content sources, the ai config in docs.yml, hiding personal data, usage limits, and the question log and resolution rate. ## What readers see Hosted sites have an **Ask AI** button in the header, and an "Ask about this page" action below every page title. In the chat panel: - Answers stream in word by word and can be stopped at any time; - `[1]`, `[2]` after a sentence link to the cited doc passages, and sources are listed below the answer; - Follow-up questions are supported, and the conversation is kept as you move between pages; - Each answer can be rated with a thumbs up or down, which is saved in the [question log](#question-log). You can also put the same assistant on your own website or in your product; see [Embed](https://docs.butterix.com/en/guides/features/ask-ai-embed.md). ### Open the panel from a link Add `?ask-ai` to any page URL to open the page with the chat panel expanded. This works well on your website, inside your product, or in emails: ```text https://docs.example.com/?ask-ai https://docs.example.com/guides/quickstart?ask-ai ``` `?ask-ai=question` writes a question in the box (up to 512 characters, URL-encoded) for the reader to check and send: ```text https://docs.example.com/?ask-ai=How%20do%20I%20verify%20webhooks%3F ``` ## How it answers Ask AI works out what the reader means, searches your docs, and answers from what it finds: - **Understands everyday wording**: readers don't need to know the docs' own terms, and can ask in another language; - **Reworks documented content**: translates, summarizes, or ports it to another programming language or tool — a Codex version when the docs only show Cursor, for example. Such answers say they aren't from the docs; - **Helps readers connect**: it knows the address of the site's [MCP server](https://docs.butterix.com/en/guides/features/agents.md#site-mcp-server) and can give the command to add it; - **Doesn't make things up**: when the docs don't cover something it says so and links the closest page; - **Stays on topic**: questions unrelated to your product and docs are politely declined, and other subjects asked for as sample data, file names, or templates get placeholders. Answers use **default-version**, non-hidden pages, plus the [custom answers](#custom-answers) and [content sources](#content-sources) you add. > **Tip** > > Write a clear `description` in each page's frontmatter and put the other names readers use in `keywords`, so the AI can find the page. ### Showing images in answers Answers are text by default. To let readers see an image right in the answer (a support group QR code or an architecture diagram, for example), add `askAi` to its `<img />`: ```mdx <img src="/assets/support-qr.png" alt="User group QR code" width="240" askAi /> ``` - When an answer uses the passage the image is in and the reader needs to see it, the image appears in the answer; - Say what the image shows in its `alt` (or `caption`): the AI decides from that whether to use it. With neither, the build warns and the image isn't used; - An image with a `width` is shown at that width; clicking it opens the original in a new tab; - Images without `askAi` are never shown. An answer shows at most 4, and only images are supported for now. For an image written in Markdown, put `askAi` where its title goes, in single or double quotes. It is only a marker and is never shown as the image's title: ```mdx ![User group QR code](/assets/support-qr.png 'askAi') ``` In the visual editor, click an `<img />` image and check “Ask AI can show it in answers”. The same applies to the [embedded](https://docs.butterix.com/en/guides/features/ask-ai-embed.md) assistant. ## Providers and models **Anthropic** Default model: `claude-opus-5-5`. | Model | id | Context | Price (input / output, per million tokens) | | ----------------------------- | ------------------- | ------- | ------------------------------------------ | | Claude Opus 5.5 (recommended) | `claude-opus-5-5` | 1M | \$4 / \$20 | | Claude Sonnet 5.5 | `claude-sonnet-5-5` | 1M | \$2 / \$10 | | Claude Haiku 5.5 | `claude-haiku-5-5` | 1M | \$0.1 / \$0.5 | | Claude Fable 5.2 | `claude-fable-5-2` | 1M | \$8 / \$40 | **DeepSeek** Default model: `deepseek-flash`; `deepseek-v4-pro` is also available. **OpenRouter** Any model on OpenRouter; the default is `~deepseek/deepseek-flash-latest`, which always points to the latest DeepSeek Flash. The dashboard lists the models and prices available to your key; you can also type the id of a model that isn't listed. ## Configure it in the dashboard Open the **Ask AI** section in the site's Settings: ### Enable it and choose a provider and model Once enabled, the ways to ask appear on the pages; when switched off they hide. Neither needs a redeploy. ### Add a key Enter the provider's API key, or use one set up by the platform administrator. Keys are verified, stored encrypted, and used only for this site's Ask AI and AI translation. ### Adjust reasoning effort and instructions Higher effort gives more thorough answers but is slower and costs more; Low is recommended for docs. Extra instructions can set the tone, stress product names, or narrow or widen the scope, for example "general HTTP questions are fine too". ### Ask a test question Ask the live docs a question and check the answer, sources, and response time. You can do the same through the [Ask AI settings API](https://docs.butterix.com/en/api-reference/ai/update-ai-settings.md). ## Contact when AI has no answer Turn on **Contact when AI has no answer** in the site's Settings, and enter a support page, a support email, or both. It's off by default and can't be turned on without contact details. Changes take effect right away, without a new deployment; you can also use the [Ask AI settings API](https://docs.butterix.com/en/api-reference/ai/update-ai-settings.md) (admin role). Readers then see your contact details below an answer when: - the docs have no answer, or only part of it; - the answer failed, or the day's questions are used up; - they rate the answer down. | Button | What it does | | ----------------- | --------------------------------------------------------------------------------------------------- | | Contact support | Opens the support page: an `https://` address, or a path that starts with `/` | | Send an email | Opens the reader's own mail app with the question and the page filled in; they check it and send it | | Copy conversation | Copies the whole conversation and the page address, to paste into a ticket or chat | Unrelated questions that were declined don't show it. The platform sends nothing on the reader's behalf. With [personal data hidden](#hide-personal-data-and-secrets), the same applies to the email and the copied text. ## Custom answers Some questions need a fixed answer, such as pricing, support channels, or a limitation the docs don't cover yet. Add them under "Ask AI → Custom answers" of the site, or create one straight from a reader's question under "Conversations": - **Questions**: 1–20 example questions, up to 500 characters each. The answer is used when a reader's question is close to any of them; - **Answer**: Markdown, up to 8000 characters. When one fits, the AI answers from what you wrote first, even where the docs differ, and without a citation. A site can have up to 200, each of which can be switched off; changes apply shortly after saving, without a redeploy. Requires the editor role. You can also manage them through the [API](https://docs.butterix.com/en/api-reference/ai/create-guidance.md): ```bash curl -X POST https://api.butterix.com/v1/sites/acme-payments/guidance \ -H "Authorization: Bearer $BITI_TOKEN" \ -H "Content-Type: application/json" \ -d '{"context":["How do I contact support?","Is there customer service?"],"document":"Email support@acme.com; we reply within 4 hours on business days."}' ``` ## Content sources Under "Ask AI → Content sources" of the site, add content outside your docs for Ask AI to draw on. Citations link to the source's address. Sources are used by Ask AI only and don't appear in site search or MCP. **Markdown document** Paste a Markdown document or load it from a file (up to 500,000 characters), with a title and a link to cite. **Website** Enter the start URL of a public website, and the platform follows the links on its pages: - Only pages on the same host, in the start URL's directory; you can set paths instead (such as `/help/`) and exclude others; - It respects the website's `robots.txt` (as `ButterIXBot`) and the `noindex` and `nofollow` of its pages; - The page limit is 1–500, 100 by default; - It's fetched again on a schedule: never, daily, weekly (default), or monthly, or by hand at any time. If fetching fails, the last content stays in use. Only public addresses that need no sign-in can be fetched. A site can have up to 20 sources, with up to 5 million characters of text per website. Requires the editor role; also available through the [API](https://docs.butterix.com/en/api-reference/ai/create-source.md). ## Configure content in docs.yml The greeting, suggested questions and the like go in `docs.yml`, versioned along with the docs: ```yaml title="docs.yml" ai: enabled: true greeting: Hi! I can answer questions about the Acme API. suggestions: - How do I create my first payment? - How do I verify webhook signatures? system-prompt: Prefer TypeScript examples in answers; when amounts come up, remind readers the unit is cents. disclaimer: Answers are generated by AI. For contract terms, the signed documents apply. mask-pii: true ``` `ai.system-prompt` and the "extra instructions" in the dashboard both apply. `ai.enabled: false` turns Ask AI off. `ai.disclaimer` replaces the notice at the top of the panel. The greeting, suggested questions, and notice can be translated in [`labels.yml`](https://docs.butterix.com/en/guides/features/i18n.md#labelsyml-translate-navigation-and-site-texts). ### Hide personal data and secrets With `ai.mask-pii: true`, personal data and secrets in a question are replaced with placeholders such as `[EMAIL]` before it's sent, and the reader is asked to check it and send it again. To hide only some kinds, list them: ```yaml title="docs.yml" ai: mask-pii: [email, phone, secret] ``` | Kind | What it covers | | ----------- | -------------------------------------------------------------------------- | | `email` | Email addresses | | `phone` | Phone numbers | | `id-number` | Chinese resident ID numbers | | `bank-card` | Bank card numbers | | `secret` | API keys, tokens, private keys, and values labeled as a password or secret | What goes to the model and into the question log is treated the same way. ## Usage limits | Item | Limit | | ------------ | ---------------------------------------------------------------------------------------------------------------------------- | | Per visitor | 12 per minute, 200 per day | | Per question | Up to 512 characters. Ask AI answers questions about the docs; for a long error or code, ask about the key part | | Per site | 200 in 24 hours, adjustable or removable in the Ask AI settings. Once reached, readers still get links to the relevant pages | | Organization | When the "AI questions / month" quota runs out, Ask AI pauses until next month | Abuse protection is built in, and only questions from your site's own pages are accepted. A reader who keeps asking unrelated things gets answers without the earlier conversation, and then has to wait. The organization's [scheduled tasks](https://docs.butterix.com/en/guides/features/automations.md) use the same quota; each run counts as 10. ## Question log Each question's text, answer, sources, page, and country are under "Ask AI → Conversations" of the site (hover a page for its full address, open an entry for every detail), where you can filter by outcome, rating, and whether there are sources, and export as CSV. Each entry has: - **An outcome**: Resolved, Partly, Not in docs, Off-topic, Off-scope answer, or Incomplete. An off-scope answer covers subjects the site is not about, and isn't carried into follow-ups; - **The reader's rating**: up, down, or none. **Resolution rate** = Resolved ÷ (Resolved + Partly + Not in docs). Off-topic questions, off-scope answers, and incomplete ones are left out. Look first at "Not in docs", "Partly", answers rated down, and answers without any source: they show what to write, or what suits a [custom answer](#custom-answers). [Documentation gaps](https://docs.butterix.com/en/guides/features/console-agent.md#documentation-gaps) group them by topic. The same data is available through the API; see [Ask AI questions](https://docs.butterix.com/en/api-reference/analytics/list-questions.md), [Export CSV](https://docs.butterix.com/en/api-reference/analytics/export-questions.md), and [Resolution rate](https://docs.butterix.com/en/api-reference/analytics/question-summary.md). --- # Embed Ask AI > Embed ButterIX Ask AI in other websites — allowed origins, the button and input bar entries, light and dark accent colors and color mode, panel size and position, opening it and changing options from code with window.ButterIX, sending the address and breadcrumb of the reader's page with each question, the Content Security Policy directives to allow, and where it's available. The embedded assistant is the same [Ask AI](https://docs.butterix.com/en/guides/features/ask-ai.md) as on your docs site: the same model, instructions, custom answers, and content sources. Questions go to the same [question log](https://docs.butterix.com/en/guides/features/ask-ai.md#question-log) and count toward the same limits. ## Get started ### Add the allowed origins Under "Ask AI → Embed" of the site, enter the websites that may embed the site's assistant (requires the admin role), for example `https://app.acme.com`; `https://*.acme.com` covers any subdomain. Up to 20, https only except for `localhost`. Changes apply right away. You can also set them through the [API](https://docs.butterix.com/en/api-reference/ai/update-embed.md). Without any origins, the assistant can't be embedded. ### Add the script Copy the embed code on the same page and paste it before `</body>` on your pages: ```html <script src="https://docs.acme.com/_biti/embed.js" async></script> ``` The default entry set in the console appears on the page (a button in the bottom-right corner until you choose otherwise) and opens the panel. To use a button or an input bar on this page regardless, add `data-trigger="button"` or `data-trigger="bar"`. ## Entry styles `data-trigger` sets where readers open the panel from: - `button`: a floating button in the bottom-right corner, with an icon and "Ask AI". - `bar`: an input bar at the bottom center of the screen. Readers type their question right there; Enter expands the panel and answers at once. When there's already a conversation, clicking into the bar opens the panel; when there isn't, up to three suggested questions (from [`ai.suggestions`](https://docs.butterix.com/en/guides/features/ask-ai.md)) float up above the bar, ready to ask with one click. - `none`: no entry; you open it [from code](#open-it-from-code). - A CSS selector (such as `#ask-docs`): opens it when a matching element on the page is clicked. Without `data-trigger`, the default entry style set under the site's "Ask AI → Embed → Appearance" applies (a button until you choose otherwise). When set, the page's choice applies, whatever the console says. For example, to keep the button across your website but use the input bar on your help center: ```html <script src="https://docs.acme.com/_biti/embed.js" data-trigger="bar" async></script> ``` The panel opens where the entry is. Readers can: - Drag its top edge, its sides, or its top corners to resize it, and double-click an edge to bring back the default size and position. - Hold the panel's header to move it. - Use the buttons in the panel's top-right corner to switch between light and dark, or to enlarge it to nearly the full height of the screen. - Drag the entry anywhere on the screen: hold and drag the button itself, or hold the stars at the left of the input bar. Double-click the button or the stars to put it back where the website places it. These adjustments stay in the reader's browser for a day and apply whenever they open the panel again in that time. On phones and other narrow screens, the panel slides up from the bottom instead. ## Skins There are two skins: - **Classic** (default): a clean, solid entry and panel. - **Aurora**: the entry and panel are frosted glass, with colored light flowing slowly along the edges. The light brightens when a reader focuses the input bar and flares once when the panel opens. In both skins, rotating neon light glows inward from the panel's edges while the AI answers, and fades out when the answer is done. The light stands still when the system's "reduce motion" setting is on. The skin, along with the entry style, color mode, and accent colors below, can be set under "Ask AI → Embed → Appearance" of the site. It applies as soon as you save, with no new deployment and no change to your website's code. ## Options You can also set them on the page with data attributes on the script tag. Attributes you write take priority; the rest follow the appearance set in the console: ```html <script src="https://docs.acme.com/_biti/embed.js" data-trigger="bar" data-skin="aurora" data-theme="light" data-color="#7c5cff" data-color-dark="#9e8aff" data-width="520" data-height="680" data-left="50" data-bottom="32" data-breadcrumb="Console / Buckets / Settings" async ></script> ``` - `data-trigger` ("button" | "bar" | "none" | string): Entry style: `button` for a button, `bar` for an input bar; see [Entry styles](#entry-styles). When set, it takes priority; when missing, the default entry style from the console applies. - `data-skin` ("classic" | "aurora"): Skin; see [Skins](#skins). Defaults to `classic`. - `data-theme` ("dark" | "light" | "auto", default: dark): Color mode. `auto` follows the visitor's system setting. Once a reader switches it in the panel, their choice applies until the website changes this attribute again. - `data-color` (string): Accent color for light mode, in hex, such as `#7c5cff`. Used for the entry's icon, the send button, and the accents in the panel. Defaults to the docs site's light-mode accent. - `data-color-dark` (string): Accent color for dark mode, in hex. Without it, it's derived from `data-color` when that's set (lightened if too dark), or else the docs site's dark-mode accent is used. - `data-width` (number, default: 480): Default width of the open panel in pixels, 360 to 1600. - `data-height` (number, default: 640): Default height of the open panel in pixels, 440 to 1600. Shrinks to fit smaller screens; where even the smallest size doesn't fit, it opens as a sheet from the bottom. - `data-left` (number, default: 100 for the button, 50 for the bar): Where the entry sits from the left of the screen, as a percentage of the screen width from 0 to 100: `0` far left, `50` centered, `100` far right. The entry always stays fully on screen. You can also fill it in under "Ask AI → Embed → Embed code", and the code you copy includes it. - `data-bottom` (number, default: 20): How far the entry sits from the bottom of the screen, in pixels, at least 16. Use it to keep clear of a bar fixed to the bottom of your page or another floating button; the suggested questions and the panel move up with the entry. On a screen too short for it, the entry moves down so it always stays fully on screen. You can also fill it in under "Ask AI → Embed → Embed code", and the code you copy includes it. - `data-label` (string): Text on the button, or the placeholder in the input bar, up to 40 characters. An empty string shows the button's icon only. - `data-lang` (string): Language of the panel, one of the docs site's languages. Defaults to the language in the page's `<html lang>`, or the docs site's default language when neither matches. - `data-breadcrumb` (string): Breadcrumb of the page the reader is on, such as `Console / Buckets / Settings`, up to 200 characters. Defaults to the page's current title. See [The reader's page](#the-readers-page). Where the accent is used for icons and outlines, a color that's too pale or too deep is adjusted so it stays visible on the current background. You can change these attributes at any time, and the change applies right away. For example, to follow your website's own theme switch: ```js document.querySelector('script[src$="/_biti/embed.js"]').dataset.theme = "dark"; // or ButterIX.configure({ theme: "dark" }); ``` ## Open it from code Once loaded, the script provides `window.ButterIX`: ```js ButterIX.open(); // open the panel ButterIX.open({ question: "How do I verify webhook signatures?" }); // open with a question written in; the reader sends it ButterIX.close(); ButterIX.toggle(); ButterIX.configure({ theme: "light", color: "#0ea5e9", left: 20 }); // change options; null restores the default ``` `configure` takes the same keys as the data attributes, without `data-` and in camelCase: `trigger`, `skin`, `theme`, `color`, `colorDark`, `width`, `height`, `left`, `bottom`, `label`, `lang`, and `breadcrumb`. ## The reader's page With every question, the panel sends the address and breadcrumb of the page the reader is on at that moment. The AI uses them to understand what "here", "this page" or "this setting" means, and answers with what is relevant to that page first. The breadcrumb defaults to the page's current title (in a single-page app, a new title after navigation is picked up too). When the title doesn't say where the reader is, pass a clearer path with `data-breadcrumb` and update it on navigation: ```js router.afterEach((to) => { ButterIX.configure({ breadcrumb: ["Console", ...to.matched.map((r) => r.meta.title)].join(" / ") }); }); ``` In the console's Ask AI question log, the channel shows as "Embed"; hover the page to see the breadcrumb and the full address, and expand a question to see the full question, answer and all details. Parameters in the address that look like keys or tokens are masked. ## Content Security Policy If your website sets a CSP, allow the docs site's address: ```text script-src https://docs.acme.com; frame-src https://docs.acme.com; font-src https://docs.acme.com; ``` Add these values to the directives you already have. ## Limits - [Password-protected](https://docs.butterix.com/en/guides/deploy/access-control.md) sites can't be embedded. - Embedding is unavailable when Ask AI is off (`ai.enabled: false`). - Source links in the panel open in a new tab. --- # Console agent > The ButterIX console agent — what it does, drafts and review, changes that need your approval, suggestions, documentation gaps, chats, permissions and switches, usage and limits, how it differs from your readers' Ask AI, and its security boundaries. ## What it does Click "Ask anything" at the bottom of any console page, or open the agent at the top right of the [visual editor](https://docs.butterix.com/en/guides/deploy/editor.md). It works on the current site only: | Ability | How | | ------------------------- | --------------------------------------------------------------------------------------------------------------------------------------- | | Write docs | Create, edit, and delete pages, adjust navigation and appearance; changes go to a draft that you review and publish | | Analyze data | Traffic, referrers, countries, devices, searches, 404s, AI traffic; compare with the period before | | Handle readers' questions | Look at questions and answers, the resolution rate, and feedback; draft fixes from [documentation gaps](#documentation-gaps) | | Manage the site | Change content and appearance in `docs.yml`; suggest custom answers and scheduled tasks; for everything else it shows the page to go to | **From data to draft** ```text Find the question that went unanswered most in the last 7 days, draft a page that answers it, and add it to the navigation. ``` **Compare traffic** ```text How did traffic change in the last 7 days compared with the 7 before? Which pages account for it? ``` There are two modes above the input: **Edit (drafts)** and **Analyze only**. In analyze mode it has no way to change anything. ## Drafts and review In the console, the changes of a chat are kept in one draft. After each turn you see the changed files; choose "Review in the editor" to look at, edit, publish, or discard them, or undo the turn. In the editor, changes become unsaved content right away. - The agent can't publish, merge, or push; - if it is stopped, fails, or your access is withdrawn, the turn writes nothing; - if someone changed the same file in the meantime, nothing is overwritten: the turn writes nothing and lists the conflicting files. ### Changes that need your approval When a change introduces any of the following, it is listed for your approval first. Nothing is written until you approve: - external addresses that load on their own, such as images, videos, and fonts; - links to new external sites; - content that can run or embed, such as scripts, `iframe`s, and forms; - settings in `docs.yml` other than content and appearance, such as scripts, analytics, Ask AI instructions, and indexing; - addresses whose target can't be determined; - deleting a page. Addresses you wrote yourself in the chat, and addresses already in the docs, need no approval. When there is too much to approve at once, ask the agent to make the changes in smaller steps. ## Suggestions For things like custom answers or a weekly report, the agent shows a **suggestion** card with everything it contains. "Confirm" carries it out as you; without that, nothing happens. The agent can't touch domains, access, members, keys, billing, Git connections, publishing, or unpublishing. It only shows a button to the right page. ## Documentation gaps "Ask AI → Documentation gaps" groups by topic where readers didn't get an answer: unanswered or downvoted questions, searches without results, negative feedback with a comment, and recurring 404s. Each gap has a summary, a suggestion, a severity, and all its evidence. You can: - **Draft a fix**: have the agent write it up as a draft; - **Add a fixed answer**: write the answer yourself; - **Mark it resolved or ignored**: a resolved gap reopens when the same kind of question comes up again. Choose "Sort" at any time, or turn on daily sorting under "Console AI" in the site's settings. When a question is deleted after its [retention period](https://docs.butterix.com/en/guides/features/ask-ai.md), its evidence goes with it. ## Chats Chats are kept per site, visible only to you, for 30 days after the last update. Open them from the panel's title or under "Agents" in the sidebar. A turn in the console keeps running after you close the page. ## Permissions and switches You need the editor role or above and must be signed in to the console; API keys can't use the agent. "Settings → Console AI" turns off the agent, scheduled tasks, AI translation, and documentation gaps as a whole, separately from your readers' Ask AI. It uses the provider, model, and key from the [Ask AI settings](https://docs.butterix.com/en/guides/features/ask-ai.md). ## Usage and limits | Item | Limit | | ---------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | Quota | With a key provided by the platform, usage counts toward the [AI questions per month](https://docs.butterix.com/en/guides/deploy/platform.md); your own key doesn't count | | One turn | Up to 10 minutes and 40 changed files | | At the same time | 1 turn per person, 3 per organization | ## Security boundaries The AI your readers can reach is completely separate from the console agent: | | Readers' Ask AI and the site MCP | Console agent | | -------------- | ----------------------------------------------- | --------------------------------------------------------- | | Who can use it | Anyone who can open the docs site | Members of the organization with the editor role or above | | What it sees | Published docs, custom answers, content sources | Source files and data of the current site | | What it can do | Answer questions and read docs | Write drafts and make suggestions | Ask AI has no management abilities and no access to the console, source files, analytics, or settings. The console agent: - reaches the current site only, and can't publish, go online, or run commands; - doesn't see keys or who your visitors are; - treats what readers write as data, not as instructions; - needs your approval for changes that could carry data out. > **Note** > > AI can still write wrong content or misread data. Review drafts before publishing. --- # Scheduled tasks > Scheduled tasks in ButterIX — write instructions, run them daily or weekly in your time zone, report only or allow changes to the docs, draft branches and review, the run history, AI quota and limits, and the matching API. ## What it does A scheduled task is a set of instructions and a schedule. When it's due, AI reads the site's docs along with top pages, searches, 404s, negative feedback, and unanswered questions, does the task, and writes a report. For example: **Find documentation gaps every week** ```text Look at unanswered questions and searches without results from the last 7 days, group them by topic, list the 5 gaps most worth filling, and say which page each belongs on. ``` **Check for outdated content every week** ```text Check that the commands and options in the quickstart and the CLI reference agree, and list where they don't. Fix clear typos directly. ``` ## Create a task Click "New task" under "Scheduled tasks" of the site (requires the editor role), or use the [API](https://docs.butterix.com/en/api-reference/automations/create-automation.md): - `Name` (string, required): Up to 100 characters. - `Instructions` (string, required): What to do, up to 2000 characters. The report is written in the language of the instructions. - `Schedule` (object, required): Every day, or one day of the week, at a time and in a time zone you choose. - `Allow edits` (boolean, default: false): By default it only reports and can't change any file. - `Enabled` (boolean, default: true): When off, it no longer runs on schedule but can still be run by hand. You can also run a task by hand at any time without affecting the next scheduled run. ## Changing the docs With "Allow edits" on, AI edits files only where the task explicitly asks for it. All changes are committed to a new draft branch, `automation/…`, and never published directly. Nobody is there to approve, so changes with [content that needs approval](https://docs.butterix.com/en/guides/features/console-agent.md#changes-that-need-your-approval) are not saved; the report says so. Click "Open in the editor" in the run history to review it in the [visual editor](https://docs.butterix.com/en/guides/deploy/editor.md), then publish or discard it. ## Run history Every run is recorded: its status, report, changed files and draft branch, start and end times, token usage, and the reason if it failed. Records are kept for 30 days. ## Usage and limits | Item | Limit | | --------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------ | | Per site | 20 tasks | | Frequency | At most once a day on schedule; by hand up to 10 times an hour, and never two runs of the same task at once | | Per run | Up to 15 minutes | | Quota | Each run counts as 10 [AI questions per month](https://docs.butterix.com/en/guides/deploy/platform.md#quotas-and-usage); runs fail once the quota is used up | Tasks use the provider, model, and key from the site's [Ask AI settings](https://docs.butterix.com/en/guides/features/ask-ai.md#configure-it-in-the-dashboard) and can't run without them. The site's source files must be on the platform. --- # Docs eval > Docs eval in ButterIX — writing evals.yml, answering and grading with your own model key using biti eval, a pass mark in CI, questions from what readers asked, and the history of results in the dashboard. The more often docs change, the easier it is to lose a sentence that matters. Docs eval guards them like a test suite: questions are kept with the docs, AI answers them from the docs alone after every change, and each point is checked. For a wrong answer you see which point is missing and whether search found the page it should have. ## Write questions Create `evals.yml` next to `docs.yml`: ```yaml title="evals.yml" pass: 80 questions: - id: refund-time question: How long does a refund take? expect: - It arrives within three business days - It goes back to the original payment method avoid: - It can be paid to another account pages: [/guides/refund] - question: How do I get an invoice? expect: - Request it under Billing in the dashboard ``` - `pass` (number, default: 80): Pass mark: the share of questions answered correctly, in percent. - `questions[].question` (string, required): The question, in the words readers use. - `questions[].expect` (string[], required): Points a correct answer makes; all of them have to be there. One fact each. - `questions[].avoid` (string[]): What the answer must not say. - `questions[].pages` (string[]): Pages the answer should come from. For diagnosis only; doesn't affect the result. - `questions[].id` (string): Name of the question, for `--only`. `q1`, `q2`… by default. - `questions[].locale` (string): Language of the question; the site's default language if left out. - `questions[].draft` (boolean): A draft isn't asked. Neither are questions without points. ## Run it Run [`biti login`](https://docs.butterix.com/en/guides/reference/cli.md#biti-login) first (or set `BITI_TOKEN`): the questions are answered from the docs as the platform renders them for readers. Answering and grading use your own model key. ```bash export DEEPSEEK_API_KEY=sk-… biti eval ``` Questions are answered the way [Ask AI](https://docs.butterix.com/en/guides/features/ask-ai.md) answers readers: search the docs, then answer from what was found only, with `ai.system-prompt` applied. Each question takes 3 model calls: search terms, the answer, and grading. They are billed to your own key; the tokens used are shown at the end. - `--provider` (string): `anthropic`, `deepseek` or `openrouter`; by default the one whose key is set. - `--model` (string): Model that answers. - `--judge-model` (string): Model that grades; the same one by default. - `--min` (number): Pass mark, in place of `pass` in `evals.yml`. - `--only` (string): Ask these questions only; separate several `id`s with commas. - `--concurrency` (number, default: 4): Questions at a time, up to 16. - `--report` (string): Write the result as Markdown. - `--json` (boolean): Machine-readable output. - `--site` (string): Upload the result to this site. The exit code is 1 below the pass mark, or when a question couldn't be graded. > **Note** > > Models don't answer the same way every time, and grading is done by a model too. Don't set the pass mark to 100%, and write points that are specific and can be checked. [Custom answers](https://docs.butterix.com/en/guides/features/ask-ai.md#custom-answers) and [content sources](https://docs.butterix.com/en/guides/features/ask-ai.md#content-sources) from the dashboard aren't used: this tests the docs themselves. ## In CI ```yaml title=".github/workflows/docs.yml" - run: biti check docs env: BITI_TOKEN: ${{ secrets.BITI_TOKEN }} - run: biti eval docs --site acme-docs --report eval.md env: DEEPSEEK_API_KEY: ${{ secrets.DEEPSEEK_API_KEY }} BITI_TOKEN: ${{ secrets.BITI_TOKEN }} ``` ## Questions from readers ```bash biti eval --import --site acme-docs --days 30 --limit 20 ``` Adds what readers asked most to `evals.yml` as drafts, skipping questions that are already there. Write the points and remove `draft` to include them. In the dashboard you can also select **Copy as an eval question** next to a question under **Ask AI → Conversations**, and paste it under `questions`. > **Warning** > > Readers wrote these questions, and they may contain personal data. Check them before you commit the file. ## History Results uploaded with `--site` are under **Ask AI → Docs eval** in the dashboard: the score over time, each question's result, missing points, the answer, and its sources. The last 100 runs of a site are kept; you can also read them through the [API](https://docs.butterix.com/en/api-reference/ai/list-evals.md). --- # Page review > Page review in ButterIX — owner, verified and review-every in frontmatter, review periods and statuses, the list of pages to review in the dashboard, dates for readers and AI tools, and reminders with biti check --review and scheduled tasks. When many people maintain docs over time, it becomes hard to say what can still be trusted. Page review lets every page state who is responsible and when it was last confirmed, and reminds you to look again when its period is over. ## In a page ```mdx title="pages/quickstart.mdx" --- title: Quickstart owner: alice verified: 2026-11-01 review-every: 90d --- ``` - `owner` (string | string[]): Who is responsible. Only your team sees it; it's never part of anything published. - `verified` (date | false): When the content was last confirmed (`YYYY-MM-DD`). `false` marks the page as possibly outdated. - `review-every` (string): Review period: a number with `d` (days), `w` (weeks), `m` (months) or `y` (years), such as `90d` or `6m`. In the [visual editor](https://docs.butterix.com/en/guides/deploy/editor.md), fill in **Review** in the page settings, or select **Verified today**. ## Default period and readers ```yaml title="docs.yml" page-review: every: 180d show: true ``` - `page-review.every` (string): Period for pages without `review-every`. With neither, a verification doesn't expire. - `page-review.show` (boolean, default: false): Show the verification date at the bottom of pages, with "This page may be out of date." on pages that are overdue or marked as outdated. Whether a page is overdue depends on the day it is read; no new deployment is needed. Shown to readers or not, the [Markdown version](https://docs.butterix.com/en/guides/features/agents.md#markdown-for-every-page) of a page starts with its verification and review dates, so AI tools can judge how far to trust it. Copied pages, `llms-full.txt` and search leave it out. ## Pages to review **Content checks → Page review** in the dashboard lists the owner, dates and status of each page, with overdue and outdated pages first. Select a page to open and change it in the editor. | Status | Meaning | | ------------ | ------------------------------------- | | Outdated | `verified: false` | | Due | The review date has passed | | Verified | Has a verification date and isn't due | | Not verified | No verification date | Sites in several languages list the original pages; translations can have their own `verified`. ## Reminders - **Scheduled tasks**: create a [scheduled task](https://docs.butterix.com/en/guides/features/automations.md) that lists pages to review and their owners every week: **Weekly review reminder** ```text List the pages that are due for review or marked as outdated, grouped by owner, and say what to look at on each. ``` - **Command line**: [`biti check --review`](https://docs.butterix.com/en/guides/reference/cli.md#biti-check) lists pages to review, for example in CI; with `--json` they are in `reviews`. - **API**: [Page review](https://docs.butterix.com/en/api-reference/analytics/list-page-reviews.md). --- # Analytics > Analytics on the ButterIX hosted platform — server-side access logs, classification rules for human and AI traffic, Markdown requests, index and spec files, MCP calls, top pages, AI agents, referrers, 404s, search terms, the AI question log and page feedback, plus integrating third-party analytics such as GA4, Plausible, and PostHog. ## Why AI traffic needs to be distinguished Traditional analytics scripts only count browsers that execute JavaScript. AI crawlers and AI assistants (ChatGPT browsing, Claude web search, Cursor doc lookups…) usually don't run scripts and are completely invisible in tools like GA — yet they may already be the largest audience for your docs. ButterIX records every page and Markdown request **on the server** and classifies it by User-Agent, with no configuration and no cookies. A human view counts once the page's script reports back, so scripts and scanners posing as browsers don't get mixed in. ## Traffic classification | Category | Rule (User-Agent contains) | | -------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | AI assistants | ChatGPT-User, OAI-SearchBot, Claude-User, Claude-SearchBot, Perplexity-User, Gemini, MistralAI-User, DuckAssistBot, Cursor, Windsurf, Claude-Code, copilot, and so on; or the `Accept` request header contains `text/markdown` | | AI crawlers | GPTBot, ClaudeBot, anthropic-ai, CCBot, Google-Extended, Applebot-Extended, Bytespider, meta-externalagent, Amazonbot, PerplexityBot, cohere-ai, and so on | | Search engines | Googlebot, Bingbot, DuckDuckBot, Baiduspider, YandexBot, Sogou, Applebot | | Other crawlers | Contains bot / crawler / spider, or programmatic clients such as curl, wget, python-requests, and axios; plus headless browsers, scanners, and requests with no User-Agent | | Humans | All other requests | In the dashboard, "AI visits" = AI assistants + AI crawlers, and "Crawlers" = search engines + other crawlers. ## Data in the dashboard The site's **Analytics** tab (last 30 days by default, up to 365 days): **Overview** Total visits, human visits, AI visits, crawlers, Markdown requests, requests for index and spec files, MCP calls, AI questions, searches, and the feedback helpfulness rate. **Human vs. AI traffic** Daily trends for human, AI, and crawler visits (including `.md` requests). **Top pages and 404s** The pages humans visit most, and the most-requested nonexistent URLs — often redirects you should add. **AI agent sources** Exactly which AIs are reading: ClaudeBot, GPTBot, Cursor… **Referrers and regions** Referring sites (Referer hostnames), and countries / regions (looked up from the visitor's IP with the DB-IP country database). **Searches and questions** Top on-site search terms, the Ask AI [question log](https://docs.butterix.com/en/guides/features/ask-ai.md#question-log) (question, answer, sources, outcome, reader rating) and resolution rate, and "Was this page helpful?" feedback and comments. The same data is available through the API: [Access stats](https://docs.butterix.com/en/api-reference/analytics/get-analytics.md), [AI question log](https://docs.butterix.com/en/api-reference/analytics/list-questions.md), [Resolution rate](https://docs.butterix.com/en/api-reference/analytics/question-summary.md), [Page feedback](https://docs.butterix.com/en/api-reference/analytics/list-feedback.md). ## Feedback The **Feedback** page keeps three kinds apart: - **Pages**: readers answer "Was this page helpful?" at the bottom of a page, with a reason if they like. - **Code issues**: readers click the flag next to a code block and pick **Doesn't run**, **Has a mistake** or **Out of date**. Each report says which code block it was, its language and first line. - **AI tools**: AI tools that find a mistake or a gap while reading your docs report it through the site's [MCP server](https://docs.butterix.com/en/guides/features/agents.md#site-mcp-server) or the address at the top of each page's Markdown. It is written by AI: check it before changing the docs. Feedback is collected only while `feedback.enabled` is on in `docs.yml` (the default). ## Suggested redirects for 404s **Content checks → 404 redirects** lists the addresses readers visited in the last 30 days that don't exist, with the page whose address is most like each. Select **Add** to accept one: - It **works right away**, without a deployment. - It **only applies while the address has no page**: if the address gets a page again, readers see the page and the rule stops applying. - When several addresses moved together (say every `/docs/old/…` now lives at `/docs/new/…`), they are offered as one wildcard rule, `/docs/old/*` → `/docs/new/:splat`. Addresses scanners probe for (such as `/wp-login.php`) don't show up here. To keep redirects with your docs, put them in [`redirects`](https://docs.butterix.com/en/guides/features/seo.md#redirects) in `docs.yml`. > **Tip** > > Check the AI question log and "not helpful" feedback regularly: questions readers ask that your docs can't answer are the next docs you should write. ## Live visitors **Live visitors** on the **Analytics** page lists each page request from the last 30 minutes and refreshes every 10 seconds, with the number of human visitors in the last 5 and 30 minutes at the top. Show everything, or only humans, AI, or crawlers. Each entry has: - The time, request method, page, and referrer; hover over the page to see query parameters (tokens, passwords and the like are masked); - Who it was: a human, or the name of the AI agent or crawler; - The browser and system, and whether the page was opened in an iframe; - A flag and country name, and the masked network (the first three parts of the IP), which helps you recognize your own team or a cloud provider's scans; - Whether it counts as a view. "Prefetch" means the page was fetched ahead while the reader hovered over a link and wasn't opened. "No JS" means the page's script never reported back: a script, a scanner, or a browser that blocks analytics. "Not counted" means it came from the dashboard or was a 404 page. ## Live risk requests **Live risk requests** lists probes, attacks, and rejected requests separately, so they stay out of visitor and page statistics. It shows the last 24 hours, keeps 7 days, and needs the editor role or above: | Type | What it is | | -------- | ------------------------------------------------------------------------------------------------------------------------------- | | Probes | Scans for paths such as `.env` or `wp-login.php`, calls that try internal endpoints, or `POST`, `PUT` and similar sent to pages | | Attacks | Signs of injection, cross-site scripting, path traversal and the like in the path or parameters | | Rejected | Cross-site calls, rate-limited requests, or a wrong access password | Hover to see the full parameters, User-Agent, and request content. Up to the first 4 KB of `POST`, `PUT` and similar requests is recorded; binary content and access passwords are not. Search engines also try addresses they find in page source, so being listed here doesn't always mean an attack. ## How things are counted - **Human views**: a request for an HTML page whose script then runs in the browser and reports back. Views from the dashboard, previews, and 404 pages aren't counted. - **AI and crawler visits**: requests for HTML pages and `.md` (recorded on the server, since they usually don't run scripts). Static assets and the search index aren't counted. - **Markdown requests**: requests for `.md` URLs, or requests that return Markdown via `Accept: text/markdown` content negotiation. - **Index and spec files**: requests for `llms.txt`, `llms-full.txt`, and API spec files (`/openapi.json` and so on), counted on their own and not included in total visits, AI visits, or crawlers. - **MCP calls**: JSON-RPC requests to `/_mcp/server`. - **Searches**: on-site search events reported by the browser (only the search term is recorded). - Visits to preview deployments count toward the same site. ## Third-party analytics To connect with your existing analytics stack, configure it in `docs.yml`; the scripts are injected into every page and report page views on client-side navigation: ```yaml title="docs.yml" analytics: ga4: measurement-id: G-XXXXXXXXXX plausible: domain: docs.acme.com posthog: api-key: phc_xxxxxxxx endpoint: https://eu.i.posthog.com ``` GA4, Google Tag Manager, Plausible, PostHog, and Segment are supported; see [docs.yml › Analytics](https://docs.butterix.com/en/guides/configuration/docs-yml.md#analytics). These scripts are not injected in preview deployments or editor previews. --- # Export and print > Exporting and printing with ButterIX: printing a page, PDFs of a section or the whole site, a ZIP of Markdown with images, and the options of biti export. ## Print a page Readers choose **Print / Save as PDF** in a page's **More actions** menu, or press Ctrl / ⌘ + P. Only the page itself is on the paper: - tabs, code groups, accordions, nested API fields and the example of every response are opened up; - long code lines wrap instead of being cut off; - dark mode prints in light colors; - videos and embedded pages become their address. To leave the entry out, use [`theme.page-actions`](https://docs.butterix.com/en/guides/configuration/docs-yml.md#theme). ## Export a section or the whole site In the console, open the site's overview and select **PDF or Markdown…** under **Export**, then pick the language, the version and the contents (everything, a tab, or a section). What you get is the live version, without hidden pages. **PDF** Opens the site's print page: a cover, the contents, then every page in the order of the navigation. Once it's ready, choose **Save as PDF** in the browser's print dialog. The contents and the links between pages work in the PDF. With a lot of pages, exporting tab by tab or section by section is faster. **Markdown** Downloads a ZIP with one `.md` per page; `README.md` is the table of contents. Links between pages and images point to files in the ZIP, so everything works offline once unpacked. Links to pages outside it keep their address on the site, and so do images and files beyond 50 MB in total. If there is too much content, export tab by tab or section by section. > **Warning** > > If the site is password protected, the exported file isn't: anyone who gets it can read it. ## Command line `biti export` exports the version published on the platform, for example to archive it in CI. Run `biti login` first (in CI, set `BITI_TOKEN`): ```bash biti export --format markdown --out docs.zip biti export --format pdf --only "API Reference" --lang en ``` - `--site` (string): Site slug; defaults to the first subdomain label of `instances[0].url` in `docs.yml`. - `--format` ("markdown" | "pdf", default: markdown): Markdown is packaged by the platform. PDFs are made by the Chrome, Chromium or Edge on your machine, which opens the site's print page; if it isn't in the usual place, set the `CHROME_PATH` environment variable. PDF works for public sites only; for a password-protected site, [open the print page](#export-a-section-or-the-whole-site) in your browser and print it there. - `-o, --out` (string): A `.zip`, a `.pdf`, or an empty folder (Markdown). By default the file is named after the site, in the current directory. - `--only` (string): Export one tab or section, by its title. - `--list` (boolean): List the languages, versions, tabs and sections. - `--lang, --product, --docs-version` (string): Language, product and version; the site's defaults if left out. - `--paper` ("a4" | "letter", default: a4): Paper size of the PDF. PDFs made by `biti export` have bookmarks. --- # Hosted platform > Overview of the ButterIX hosted platform — host layout, organizations and roles, quotas and usage, site templates, the three content sources (hosted repository, Git, CLI upload), the build queue and deployment retention, and the system console. ## Host layout ButterIX uses hostnames to separate its services: | Host | Purpose | | ------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------ | | `butterix.com` (`www.butterix.com`) | Marketing site | | `console.butterix.com` | Organization console | | `api.butterix.com` | Platform API (`https://api.butterix.com/v1`) | | `managements.butterix.com` | System console, for platform administrators only | | `<subdomain>-sites.butterix.com` | Production deployment of a docs site | | `<subdomain>--<deployment short id>-sites.butterix.com` | Preview deployment | | Your domain (e.g. `docs.acme.com`) | CNAME to `sites.butterix.com`; mapped to a site after verification. See [Custom domains](https://docs.butterix.com/en/guides/deploy/custom-domains.md) | For example, this docs site lives at `https://docs.butterix.com`, and the example site at `https://acme-payments-sites.butterix.com`. Docs sites are served only from the platform addresses above. When a page is opened at any other address (for example, when the whole site is mirrored), a notice at the top points to the official address, and search, Ask AI, and the API playground don't work. ## Organizations and roles Every user gets a personal organization at sign-up, and can create more organizations and invite members. Sites, API keys, quotas, and audit logs all belong to an organization. | Role | Permissions | | ------ | --------------------------------------------------------------------------------------------------------- | | owner | Everything; an organization must keep at least one | | admin | Members and invites, API keys, creating and deleting sites, domains, Git, access control, Ask AI settings | | editor | Deploy, switch production, edit and publish content, test Ask AI | | viewer | Read-only | When you invite an email address that isn't registered yet, the dashboard generates a one-time invite link for you to send. Even when the platform has self-service sign-up turned off, people with an invite link can still sign up and join the organization. Each member can turn on two-factor authentication, register passkeys, and manage sign-in sessions for their own account. See [Account security](https://docs.butterix.com/en/guides/deploy/account-security.md). ## Quotas and usage Every organization is on a plan, which sets the limits for the quotas below. New organizations start on the default plan; platform administrators can change an organization's plan or adjust individual quotas for it: | Quota | How it's counted | When the limit is reached | | ---------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | Sites | Total sites in the organization | No more sites can be created | | Members | Total members of the organization | No more members can be invited or added | | Custom domains | Total domains connected to all of the organization's sites | No more domains can be added | | Deployments per day | Deployments created today (UTC) | No more deployments today | | Storage (MB) | Combined output size of all successful deployments | No more deployments can be created | | AI questions per month | Ask AI questions this month (UTC); each [scheduled task](https://docs.butterix.com/en/guides/features/automations.md) run counts as 10; on sites that use a key provided by the platform, the [agent](https://docs.butterix.com/en/guides/features/console-agent.md), documentation gaps, AI translation, and test questions in the console count too, by how much they are used | Ask AI stops answering and scheduled tasks stop running for the rest of the month; with the platform's key, the agent, documentation gaps, AI translation and test questions stop too | | Page views per month | Docs-site page views this month (UTC) | **Counted only, never blocked** — sites stay available | Open the **Usage** page in the organization console to see current usage, the limit, and recent trends for each quota. When a limit is reached, the corresponding action returns a "quota reached" message; contact your platform administrator for a higher quota. The platform cleans up old deployments automatically (see below), so storage usually doesn't grow without bound. > **Note** > > When a platform administrator suspends an organization, write operations such as creating sites or deployments are rejected until it's restored. ## Create a site In the dashboard, click "New site", enter a name and subdomain, and pick a template: **Starter** Three pages — introduction, quickstart, writing guide. Good for starting from scratch. **Blank** Just a home page. **OpenAPI** Paste or upload an OpenAPI 3.x spec to generate an API reference directly. The subdomain determines the site's default URL, `https://<subdomain>-sites.butterix.com`. Rules: - 5–40 characters: lowercase letters, digits, and hyphens, not starting or ending with a hyphen; - no consecutive `--` (preview URLs use it as a separator); - `console`, `managements`, `butterix`, `sites`, `dashboard`, `support`, `billing`, `assets`, `static`, `status`, and others are reserved. After creation, the platform initializes a hosted Git repository and starts the first deployment right away. ## Content sources Each site's content comes from one of three sources: | Source | How it updates | Visual editor | Best for | | ------------------------------- | -------------------------------------------------------------------------------- | ---------------------------------------- | ------------------------------------------------------ | | **Hosted repository** (default) | Edit and publish in the dashboard editor | Yes | Docs maintained by non-technical teammates | | **Git repository** | Pushes to the production branch deploy automatically; pull requests get previews | Yes (publishing pushes back to the repo) | Teams that keep docs next to code | | **CLI upload** | `biti deploy` packs and uploads | No | Building in CI, or not giving the platform repo access | - For a hosted site **without a production deployment yet**, the first production deployment published with the CLI switches the source to "CLI upload". After that, the dashboard's "Redeploy" and the editor are unavailable (the platform has no source code); keep using `biti deploy`. - A hosted site that already has a production deployment can also accept CLI uploads, but its source stays the hosted repository: redeploying from the dashboard or publishing in the editor later rebuilds from the hosted repository and replaces the CLI-uploaded version. Stick to one source per site. - To connect a Git repository see [Git deployments](https://docs.butterix.com/en/guides/deploy/git.md); for the CLI see [CLI deployment and API keys](https://docs.butterix.com/en/guides/deploy/cli-deploy.md). ## Deployments - Every build produces an **immutable** deployment (`queued → building → ready / failed`; queued ones can be canceled), with a build log, page count, output size, and duration. - The production URL points at one deployment; switching production just moves the pointer and takes effect instantly. See [Previews and rollbacks](https://docs.butterix.com/en/guides/deploy/previews-and-rollbacks.md). - When a build that started later finishes first, it won't be overwritten by a build that started earlier but finished later. - The platform keeps the 20 most recent successful deployments per site (the current production deployment is always kept); files of older deployments are cleaned up. - Builds are incremental: only pages whose content changed are rendered again. Editing one article renders that article; changing what every page shows, such as navigation, titles or site settings, renders them all. - Unchanged pages are byte-for-byte the same in every deployment and keep their ETag, so browsers and CDNs don't download them again. - With object storage and a CDN enabled, styles, scripts, fonts, images, and other assets are named by their content: an address changes only when the content does, so CDN caches stay valid across deployments and existing files aren't uploaded again. Theme and client scripts are shared by all sites. Cleaning up old deployments only deletes files that no retained deployment uses. - Custom styles and scripts that refer to other files by relative path (such as `url(../a.png)` or `import "./b.js"`), as well as HTML, JSON, and similar files, are still served from the site's domain. - A single build times out after 10 minutes. ## What the platform provides for every site - Custom domains and automatic routing - Preview deployments and one-click rollback - Password protection and access tokens - Visual editor and AI translation - Scheduled tasks - Ask AI (site key or platform key) and embedding - MCP server at `/_mcp/server` - API playground proxy - Analytics that separate humans from AI, page feedback ## Organization MCP server Connect your organization to coding assistants such as Claude Code to look up sites, deployments, analytics, and readers' questions and feedback in conversation. The address is the platform API address plus `/mcp`, which you can copy in the organization settings, authenticated with an organization API key: ```bash claude mcp add --transport http butterix https://api.butterix.com/v1/mcp \ --header "Authorization: Bearer $BITI_TOKEN" ``` All tools are read-only and limited to the organization the API key belongs to: | Tool | Content | | ------------------ | ----------------------------------------------------------------------------- | | `list_sites` | All sites of the organization | | `get_site` | One site's address, domains, source, production deployment, and access mode | | `list_deployments` | Recent deployments with status and errors | | `get_deployment` | One deployment with its build log | | `get_analytics` | Views, visitors, AI and crawler traffic, top pages, searches, 404s, referrers | | `list_searches` | What readers searched for | | `list_questions` | Readers' questions and answers, filterable by outcome and rating | | `question_summary` | Counts by outcome and the resolution rate | | `list_feedback` | Page feedback | | `list_automations` | Scheduled tasks and their last run | Each API key is limited to 120 calls per minute. This is separate from a site's own [MCP server](https://docs.butterix.com/en/guides/features/agents.md#site-mcp-server), which lets readers search the docs. ## System console The system console (`https://managements.butterix.com`) is available only to platform administrators and is used to run the whole platform: **Organizations** Suspend and restore organizations, change plans, adjust quotas for individual organizations, and allow an organization to remove the "Powered by ButterIX" badge from its site footers. **Users** See each user's plans and quota usage (the total of the organizations they own), make users platform administrators, suspend accounts, and reset two-factor authentication for users who lost their authenticator. **Plans** Create and edit plans and their quotas, choose the default plan for new organizations, and see how many organizations use each plan. **Platform settings** Whether self-service sign-up is allowed, whether administrators must use two-factor authentication, object storage, and CDN. **Analytics and audit** Platform-wide traffic and usage analytics, plus the platform-level audit log. With "Require two-factor authentication for administrators" on, platform administrators must turn on two-factor authentication before they can enter the system console, and can't turn it off afterward. ### Plans Choose **Plans** on the left to manage all plans: ### Create or edit a plan Click **New plan** and enter a name, an ID, and the quotas; leave a quota empty for unlimited. Changing the quotas of an existing plan applies right away to the organizations on it, except items overridden for an organization. ### Choose the default plan Pick **Make default** from the menu on the right of the plan. New organizations start on it; existing organizations don't change. ### Change an organization's plan Choose **Organizations** on the left, open the organization, and pick a plan in the top-right corner. If usage is over a new limit, existing content is kept but nothing more can be added. The default plan and plans still used by organizations can't be deleted. ### Quota usage per user The **Users** list shows each user's plans and quota usage. Usage and limits are the totals of the organizations the user **owns** (role owner): if any of them is unlimited for a quota, the total is shown as unlimited, and an organization with several owners counts toward each of them. Click the usage to see every quota and the breakdown by organization. ### Powered by badge Every site shows the "Powered by ButterIX" badge in its footer by default, and organizations can't remove it themselves. To let an organization remove it: ### Open the organization Sign in to the system console as a platform administrator, choose **Organizations** on the left, then search for the organization and open it. ### Turn on the switch On the organization's page, find **Allow removing the "Powered by ButterIX" badge** and turn on the switch next to it. The change is saved right away and recorded in the platform audit log. ### The organization turns the badge off Members of that organization turn off **Show Powered by ButterIX** under **Docs settings → Header and footer** in the editor (or set `powered-by: false` in `docs.yml`). Once they commit and publish, the badge no longer appears in their site's footer. Turning the switch off again brings the badge back on all of that organization's sites with their next deployment, even if their `docs.yml` says `powered-by: false`. --- # CLI deployment and API keys > Create a ButterIX organization API key, authenticate with biti login or BITI_TOKEN, biti deploy options, packing rules and preview deployments, plus example configs for GitHub Actions and other CI. ## Create an API key ### Open organization settings In the dashboard, go to "Organization settings → API Keys" (requires the admin role). ### Generate a key Enter a recognizable name (for example "GitHub Actions") and click generate. The key starts with `biti_` and is **shown only once** — save it to your password manager or CI secret store right away. API keys belong to the organization and act with the `editor` role: they can deploy, switch production, and edit content, but can't manage members, domains, or other keys. Deleting a key immediately revokes every CLI and CI that uses it. The list shows each key's prefix and when it was last used. ## Log in **Interactive** ```bash biti login ``` The CLI prompts you to paste the key, verifies it against the platform's `/api/v1/whoami`, and saves the credentials to `~/.config/bitidocs/credentials.json` (under `XDG_CONFIG_HOME` if set, with file mode 600). **Non-interactive** ```bash biti login --token biti_xxxxxxxxxxxxxxxx ``` The CLI connects to the ButterIX hosted platform by default. **Environment variables (CI)** No login needed — just set environment variables: ```bash export BITI_TOKEN=biti_xxxxxxxxxxxxxxxx ``` When `BITI_TOKEN` is set, it takes precedence over saved credentials. ## Deploy ```bash biti deploy --site acme-payments --message "Publish v1.2 docs" ``` ```text title="Output" ButterIX · biti ◆ Packing .… ◆ Uploading 412 KB to https://console.butterix.com… queued building ✔ Published 94 pages in 6.1s https://acme-payments-sites.butterix.com ``` - `[dir]` (string, default: .): Project directory. - `--site` (string): Site slug. If omitted, infers it from the hostname of `instances[0].url` in `docs.yml` (`acme-payments-sites.butterix.com` → `acme-payments`). - `--preview` (boolean): Create a preview deployment that doesn't affect the production URL and gets its own `<site>--<short id>` URL. - `--message` (string, default: Deployed with biti CLI): Deployment message, shown in the dashboard's deployment list. ### What happens ### Validate config Reads `docs.yml`; if the config has errors, stops and suggests running `biti check` first. ### Pack Packs the project directory into a gzip tarball, skipping `node_modules`, `.git`, `.biti`, `dist`, `.DS_Store`, and files that may hold credentials, such as `.env`, `.npmrc`, and SSH private keys (they are listed). The platform accepts uploads up to 200 MB. ### Upload `POST /api/v1/sites/<site>/deployments`, which returns the deployment id. ### Wait for the build Polls the deployment status every second and prints status changes; on success prints the URL, if it fails or is canceled, prints the error and exits with a non-zero status. Network errors, rate limits, and platform restarts (5xx) while polling are retried automatically. The command gives up only after 2 minutes without a valid response. By then the upload has already succeeded and the build may still be running, so check the deployment list in the dashboard before deploying again. > **Tip** > > Builds run on the platform, so you don't need build output on your machine. Running `biti check --strict` locally before deploying catches problems in seconds instead of waiting for a platform build to fail. ## Sync with the online editor `biti deploy` checks whether changes were published from the online editor since your last deploy or pull. | Situation | Result | | -------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | | No new online changes | Deploys right away | | None of the files changed online were changed locally | Lists the changes, merges them into your folder, and continues deploying | | The same file changed on both sides, in different places | Merges line by line into your folder, keeping both sides' changes, and continues deploying | | The same place changed on both sides | Stops, marks those files with `!`, and leaves your files alone. Run `biti pull` and settle the conflicts | | No sync record (`.biti/sync.json`, for example in CI) | Stops without merging | `biti pull --dry-run` only lists what would change. `biti deploy --force` overwrites the online changes with your local content. ### Settle conflicts `biti pull` marks both versions in files that conflict and merges everything else: ```yaml <<<<<<< local - url: https://api.example.com/v1 ======= - url: https://api.example.com/v2 >>>>>>> online ``` Edit the text to what you want and remove the marker lines, or take one side: ```bash biti resolve . --online # take the online side everywhere biti resolve . openapi/api.yml --local # keep your side of this file ``` Files that can't be merged by line, such as images, and files deleted online but edited locally keep your version; the online version is in `.biti/conflicts/`. Choose a side with `biti resolve`; without an option, the files are kept as they are now. Until every conflict is settled, `biti deploy` won't publish and `biti pull` won't pull again. `biti deploy --force` publishes your side. In the editor, the number on the **Files** button counts uncommitted drafts. An orange dot next to it means changes published online haven't been pulled to the command line yet; open the menu to see the files. ## Deploy from CI ### GitHub Actions Publish to production on pushes to `main`, and create previews for pull requests: ```yaml title=".github/workflows/docs.yml" name: Docs on: push: branches: [main] pull_request: jobs: deploy: runs-on: ubuntu-latest env: BITI_TOKEN: ${{ secrets.BITI_TOKEN }} BITI_API: https://console.butterix.com steps: - uses: actions/checkout@v4 - uses: actions/setup-node@v4 with: node-version: 22 - run: npm install -g bitidocs - run: biti check --strict - if: github.event_name == 'push' run: biti deploy --site acme-payments --message "${{ github.event.head_commit.message }}" - if: github.event_name == 'pull_request' run: biti deploy --site acme-payments --preview --message "PR #${{ github.event.number }}" ``` ### GitLab CI ```yaml title=".gitlab-ci.yml" docs: image: node:22 variables: BITI_API: https://console.butterix.com script: - npm install -g bitidocs - biti check --strict - biti deploy --site acme-payments --message "$CI_COMMIT_TITLE" rules: - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH ``` Add `BITI_TOKEN` to your CI secrets. > **Note** > > If your repository is on GitHub, you can skip CI entirely and let the platform connect to the repo — pushes and pull requests trigger builds automatically. See [Git deployments](https://docs.butterix.com/en/guides/deploy/git.md). ## Call the API directly The CLI is just a thin wrapper around the platform API. In environments without Node.js, you can do the same thing with `curl`: ```bash tar --exclude=node_modules --exclude=.git --exclude=dist -czf site.tgz . curl -X POST https://api.butterix.com/v1/sites/acme-payments/deployments \ -H "Authorization: Bearer $BITI_TOKEN" \ -H "Content-Type: application/gzip" \ -H "x-biti-preview: 1" \ --data-binary @site.tgz ``` Then poll [Get deployment](https://docs.butterix.com/en/api-reference/deployments/get-deployment.md) until `status` is `ready`. --- # Git deployments > Connect a ButterIX site to a Git repository — repository URL, branch, and access token; configure a GitHub webhook (Payload URL, Secret, events); deployment rules for pushes and pull requests, signature verification, working with the visual editor, and disconnecting. ## Connect a repository ### Prepare the repository The repository needs a `docs.yml` (at the repo root, or in a `fern/` or `biti/` subdirectory; the CLI and platform look for `docs.yml` → `docs.yaml` → `fern/docs.yml` → `biti/docs.yml` → `docs.json` → `mint.json` in that order). ### Fill in the dashboard Open the site's "Settings → Git repository" and enter: - **Repository URL**: starts with `https://`, e.g. `https://github.com/acme/docs.git`. - **Branch**: the production branch, default `main`. - **Access token**: private repositories need a token with read access; to publish from the visual editor (pushing back to the repo) it also needs write access. Tokens are stored encrypted; leave the field empty later to keep the current one. Click "Connect repository". The platform pulls the repo and starts a production deployment right away. ### Configure the webhook After connecting, the settings page shows a **Payload URL** and **Secret**. In your GitHub repo, go to Settings → Webhooks → Add webhook: | Field | Value | | ------------ | -------------------------------------------------------------------------------------------------- | | Payload URL | The URL shown on the settings page, like `https://api.butterix.com/v1/webhooks/github/site_2m4k8p` | | Content type | `application/json` | | Secret | The Secret shown on the settings page | | Events | Select **Pushes** and **Pull requests** | You can also connect via the API: [Connect Git repository](https://docs.butterix.com/en/api-reference/git/connect-git.md). ## What triggers a deployment ```mermaid flowchart LR P[push] -->|production branch| A[Production deployment] P -->|other branches| I[Ignored] PR[pull_request] -->|opened / synchronize / reopened| B[Preview deployment of that branch] PING[ping] --> OK[Returns ok] ``` | GitHub event | Condition | Result | | -------------- | --------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | | `push` | Pushed to the production branch set when connecting | Production deployment; the message is the first line of the commit message, and the commit SHA is recorded | | `pull_request` | Action is `opened`, `synchronize`, or `reopened` | Preview deployment from the PR's source branch, with message `PR #number: title` | | `ping` | Sent by GitHub when the webhook is added | Returns `{ "ok": true }` | | Other | | Returns `{ "ignored": true }` | Once a preview deployment finishes, open its own URL from the dashboard's deployment list. See [Previews and rollbacks](https://docs.butterix.com/en/guides/deploy/previews-and-rollbacks.md). ## Security - Every request must carry an `X-Hub-Signature-256` header. The platform computes HMAC-SHA256 with the site's Secret and compares in constant time, returning 401 on mismatch. - The webhook URL uses the site id (not the slug), and only sites connected to Git accept requests. - The platform only **reads** content from the repository and builds it in a separate worker thread; MDX never executes any code (see [Safe subset](https://docs.butterix.com/en/guides/writing/safe-mdx.md)). ## Working with the visual editor You can still use the visual editor after connecting Git: - Edits happen on a draft branch and **can't modify the production branch directly**; - "Publish" merges the draft into the production branch, **pushes to the remote repository**, and then triggers a production deployment (requires a token with write access); - Team members can commit from their IDE or edit in the editor; both are merged through Git. ## Manual redeploys The dashboard's "Redeploy" and "Create preview deployment" buttons rebuild from the latest commit in the repository. You can also call [Create deployment](https://docs.butterix.com/en/api-reference/deployments/create-deployment.md) with `{ "branch": "feature/x", "preview": true }` to build any branch. ## Disconnect After "Disconnect", the site goes back to the ButterIX hosted repository; later pushes no longer trigger deployments, and webhook requests return 404. --- # Previews and rollbacks > The ButterIX deployment model — immutable deployments and the production pointer, deployment statuses, where preview deployments come from and their URLs, noindex and banner on previews, promote to production (rollback), canceling queued deployments, and the deployment retention policy. ## Deployment model ```mermaid flowchart LR subgraph history [Deployment history] D1[dpl_…a1<br/>ready] D2[dpl_…b2<br/>ready] D3[dpl_…c3<br/>ready · preview] D4[dpl_…d4<br/>failed] end P((Production pointer)) --> D2 D2 -. Promote to production .-> D1 ``` - Each deployment is a complete directory of static output that is **never modified** after it's built. - A site's production URL is just a **pointer** to one deployment. Publishing a new version, rolling back, and promoting a preview to production all just move this pointer — **instantly**, with no rebuild. - A failed build never affects the live site. ### Deployment statuses ```mermaid stateDiagram-v2 [*] --> queued queued --> building queued --> canceled: cancel building --> ready building --> failed ``` | Status | Description | | ---------- | ---------------------------------------------------------------- | | `queued` | Waiting to build; can be canceled | | `building` | Building; the dashboard shows a live log | | `ready` | Succeeded; can be visited and promoted to production | | `failed` | Failed; `error` holds the reason and the log has the full output | | `canceled` | Canceled (or cleaned up for exceeding the retention limit) | ### Triggered by The deployments list in the console shows who triggered each deployment. For deployments made with an API key (`biti deploy`, CI), it shows the member who created the key, plus the key's name and its start and end, such as `biti_a1B2c••••Kd82mQx0Zt`, so you can tell which key it was. Deployments triggered by a Git push show their source instead. ## Preview deployments A preview deployment is identical to a production deployment, except it doesn't move the production pointer and has its own URL: ```text https://<subdomain>--<last 8 chars of deployment id>-sites.butterix.com ``` Where preview deployments come from: [**Pull requests**](https://docs.butterix.com/en/guides/deploy/git.md) With Git connected, created automatically when a PR is opened or updated. [**CLI**](https://docs.butterix.com/en/guides/deploy/cli-deploy.md) `biti deploy --preview` [**Visual editor**](https://docs.butterix.com/en/guides/deploy/editor.md) Create a preview of your draft from the editor. **Dashboard** "Create preview deployment" on the site overview page. In a preview deployment: - A "Preview" banner appears at the top of the page; - Every page has `noindex` and `robots.txt` disallows crawling, so search engines won't index it; - Canonical URLs, the sitemap, and `llms.txt` use the preview URL as the origin; - Ask AI, MCP, and the playground proxy work just like on the live site, so you can review everything; - If the site has password protection, the preview URL requires the password too. The preview URL of each build is kept for 30 days; after that, opening it shows that the preview has expired. A draft's fixed preview URL follows the draft and isn't affected by this limit. ## Rollback: promote to production On the dashboard's "Deployments" page, every deployment with status `ready` (including preview deployments and older production deployments) has a "Promote to production" button. Once confirmed, the production URL switches to that deployment immediately, and you can switch back at any time. Via the API: ```bash curl -X POST https://api.butterix.com/v1/deployments/dpl_01jd8x2k7q/promote \ -H "Authorization: Bearer <token>" ``` ```typescript const response = await fetch("https://api.butterix.com/v1/deployments/dpl_01jd8x2k7q/promote", { method: "POST", headers: { "Authorization": "Bearer <token>" } }); const data = await response.json(); console.log(data); ``` > **Info** > > Promoting a preview deployment to production means "ship exactly what was reviewed" — what goes live is the very output you reviewed, with no rebuild. ## Cancel a deployment Queued (`queued`) deployments can be canceled. A deployment that has started building can't be stopped midway; builds running longer than 10 minutes are marked as failed. ## Retention policy The platform keeps files for the 20 most recent successful deployments per site (the current production deployment is always kept). Older deployments are cleaned up and marked `canceled`; their records stay in the list but can no longer be promoted to production. When the platform restarts, deployments that were queued or building are marked as failed and need to be redeployed. --- # Custom domains > Set up a custom domain for a ButterIX hosted site — adding the domain, the CNAME to sites.butterix.com, _butterix TXT ownership verification, automatic HTTPS certificates and renewal, multiple domains, deploying under a subpath, and FAQ. Every site already has a default URL, `https://<subdomain>-sites.butterix.com`. Once you connect a custom domain (such as `docs.acme.com`), both addresses work and point to the same production deployment. ## Setup ### Add the domain In the organization console (`https://console.butterix.com`), open the site's "Domains" tab, click "Add domain", and enter the full domain, e.g. `docs.acme.com` (requires the admin role). Pasting a URL with `https://` or a path also works — the platform strips the extra parts. A domain can be connected to only one site, and the total number of domains an organization can connect is limited by its [quota](https://docs.butterix.com/en/guides/deploy/platform.md#quotas-and-usage). ### Add the CNAME record At your DNS provider, add a CNAME record pointing the domain at ButterIX: | Type | Name | Value | | ----- | ----------------------------- | -------------------- | | CNAME | `docs` (i.e. `docs.acme.com`) | `sites.butterix.com` | ### Add the TXT record Then add a TXT record to prove you own the domain. Use the token shown in the console: | Type | Name | Value | | ---- | ------------------------- | ------------------------------- | | TXT | `_butterix.docs.acme.com` | `butterix-verify=a1b2c3d4e5f6…` | Some DNS providers only want the part before your root domain in the "Name" field; in that case, enter `_butterix.docs`. ### Verify Back in the console, click "Verify". The platform looks up the TXT record at `_butterix.<your domain>`; when it matches, the domain is marked "Verified" and starts serving the site immediately. DNS changes can take anywhere from a few minutes to a few hours to propagate; if verification fails, just try again later. ### HTTPS is enabled automatically After verification, the platform issues an HTTPS certificate for the domain through Let's Encrypt, usually within a minute or two — you don't need to upload or configure anything. Certificates renew automatically 30 days before they expire. ## Via the API ```bash curl -X POST https://api.butterix.com/v1/sites/acme-payments/domains \ -H "Authorization: Bearer <token>" \ -H "Content-Type: application/json" \ -d '{ "domain": "docs.acme.com" }' ``` 201: New domain (unverified) ```json { "domain": "docs.acme.com", "verified": false, "primary": false, "verifyRecord": { "type": "TXT", "name": "_butterix.docs.acme.com", "value": "butterix-verify=a1b2c3d4e5f6" }, "cname": "sites.butterix.com", "createdAt": 1 } ``` In the response, `verifyRecord` is the TXT record to add and `cname` is the CNAME target. Once the records are in place, call [Verify domain](https://docs.butterix.com/en/api-reference/domains/verify-domain.md). ## After activation - The custom domain and the default `<subdomain>-sites.butterix.com` address both work and point to the same production deployment. - A site can have several custom domains; each one is verified separately. - **Primary domain**: canonical URLs, the sitemap, `robots.txt`, `llms.txt`, feeds, and `.md` pages use the primary domain for absolute URLs. By default it is the most recently verified custom domain, once its HTTPS certificate is active. To use another one, click "Make primary" in the "Domains" tab (or call [Set primary domain](https://docs.butterix.com/en/api-reference/domains/set-primary-domain.md)); domains you add later then no longer take over. Without a custom domain, the default URL is used. - When the primary domain changes, the platform redeploys the version that is live, and absolute URLs update when it finishes. Deployments uploaded directly to a Git-connected site from your own CI have no source to rebuild from and update with the next deployment. - If the site has password protection, the custom domain requires the password too. - Once you remove a domain, it stops serving the site immediately; you can then delete the CNAME and TXT records from your DNS. ## Deploy under a subpath To serve the docs under a subpath of your main site (e.g. `acme.com/docs`): 1. Set `basepath: /docs` in `docs.yml` (or write `acme.com/docs` in `instances[0].custom-domain`, and it's inferred automatically). Every page, asset, and `llms.txt` gets this prefix. 2. On your main site's reverse proxy, forward `/docs/*` to the docs site's default URL. ```nginx title="nginx: forward /docs to the hosted docs site" location /docs/ { proxy_pass https://acme-payments-sites.butterix.com; proxy_set_header Host acme-payments-sites.butterix.com; proxy_ssl_server_name on; } ``` ## FAQ <details> <summary>What if I can't set a CNAME on the apex domain (acme.com)?</summary> Most DNS specs don't allow a CNAME on the apex domain. Use a subdomain (such as `docs.acme.com`), or use your DNS provider's ALIAS / ANAME / CNAME flattening feature to point the apex at `sites.butterix.com`. </details> <details> <summary>Verification keeps failing</summary> Run `dig TXT _butterix.docs.acme.com +short` to check that the TXT record has propagated and that the value matches the console exactly (including the `butterix-verify=` prefix). Also make sure your DNS provider didn't append the root domain again, turning the name into `_butterix.docs.acme.com.acme.com`. </details> <details> <summary>What do visitors see before the domain is verified?</summary> Once the CNAME is live but before verification, opening the domain over `http://` shows a page explaining whether it still needs to be added to a site or only needs the TXT check. The certificate is issued after verification, so until then `https://` reports that a secure connection can't be established. </details> <details> <summary>How long until HTTPS works? Do I need to upload a certificate?</summary> No upload needed. Once the domain is verified, the platform issues a certificate through Let's Encrypt, usually within a minute or two, and renews it automatically 30 days before it expires. If the browser still reports an invalid certificate after a few minutes, check that the CNAME points at `sites.butterix.com` and that no CAA record on the domain blocks Let's Encrypt. </details> <details> <summary>Can I put my own CDN or proxy in front of the domain?</summary> Certificate issuance requires Let's Encrypt to reach ButterIX directly, so keep the domain's CNAME record in "DNS only" mode. If traffic must go through your own CDN, configure a certificate for the domain on the CDN and set the origin to `sites.butterix.com`. </details> <details> <summary>Error: “This domain is already connected”</summary> The domain is already connected to a site (possibly one in another organization). Remove it from that site first. </details> --- # Access control > Access control for ButterIX hosted sites — public and password-protected modes, the visitor experience, what changing the password does, coverage of preview deployments and custom domains, access tokens and MCP sign-in, and visibility to search engines and AI. ## Two modes **Public** Anyone can visit (default). **Password protected** Visitors must enter a shared password first. Switch modes in the site's "Settings → Access control" (requires the admin role), or call [Update access control](https://docs.butterix.com/en/api-reference/sites/update-access.md): ```bash curl -X PUT https://api.butterix.com/v1/sites/acme-payments/access \ -H "Authorization: Bearer $TOKEN" \ -H "Content-Type: application/json" \ -d '{"mode":"password","password":"preview-2026"}' ``` > **Note** > > Changing access control requires the admin role. Organization API keys act as editor and can't call this endpoint; use the dashboard, or an admin's logged-in session. ## Visitor experience 1. Unverified visitors opening any page of the site in a browser see a simple password page (HTTP 401, with `noindex`, following the system light/dark mode). After several wrong attempts they have to wait a moment. 2. After entering the correct password, the platform sets an HttpOnly access cookie (valid for 30 days, with `Secure` over HTTPS) and redirects to the home page. 3. Return visits within 30 days don't ask for the password again. Passwords must be at least 6 characters; the platform stores only their hash. ## Changing the password and removing protection - **Changing the password** immediately signs out every visitor and MCP sign-in; [access tokens](#access-tokens) aren't affected. - If a password was set before, switching from "Public" back to "Password protected" can leave the password empty to reuse the previous one. - Switching back to "Public" opens the site to everyone immediately. ## Coverage Password protection applies to **every host** of the site: | URL | Protected | | ----------------------------------------------------------------- | --------- | | Production URL `<subdomain>-sites.butterix.com` | Yes | | Preview URL `<subdomain>--<short id>-sites.butterix.com` | Yes | | Verified custom domains | Yes | | Static files such as `.md`, `llms.txt`, `sitemap.xml` | Yes | | Dynamic endpoints: Ask AI, MCP server, playground proxy, feedback | Yes | Unverified clients can neither see pages nor retrieve content through MCP or Ask AI. Protected sites can't be [embedded](https://docs.butterix.com/en/guides/features/ask-ai-embed.md), and their page menu doesn't offer to connect MCP. ## AI tools and programs Requests that aren't a browser opening a page (`.md`, `llms.txt`, spec files, MCP, or requests that don't ask for HTML) get 401 and a short Markdown explanation when unauthorized, with a `WWW-Authenticate` header on how to sign in. There are two ways to authorize: ### Access tokens Create an access token in the site's Settings (requires the admin role; the token is shown once) and send it with every request: ```bash curl https://docs.acme.com/guides/quickstart.md \ -H "Authorization: Bearer $DOCS_TOKEN" ``` - The same token works for pages, `.md`, `llms.txt`, and the MCP server; - It can expire (after 1–3650 days) or stay valid; - A site can have up to 50 and revoke them at any time; the list shows when each was last used; - Changing the site password doesn't affect tokens. Connect a protected MCP server in Claude Code: ```bash claude mcp add --transport http acme-docs https://docs.acme.com/_mcp/server \ --header "Authorization: Bearer $DOCS_TOKEN" ``` For the matching API see [Access tokens](https://docs.butterix.com/en/api-reference/sites/create-access-token.md). ### MCP sign-in MCP clients that support OAuth don't need a token: after adding the MCP URL, the client opens a browser, where the reader enters the site password and clicks Allow. It stays valid for 30 days. After the site password changes, they sign in again. ## Search engines and AI Protected sites return 401 to crawlers, so they aren't indexed by search engines; AI crawlers and MCP clients without a token or sign-in can't read the content either. ## Finer-grained access control Currently only a site-wide shared password is supported; per-user login (SSO) and role-based content aren't available yet. --- # Account security > ButterIX account security settings — turning on two-factor authentication (TOTP authenticator apps), saving and regenerating recovery codes, registering multiple passkeys and signing in with a passkey instead of a password, reviewing sessions and signing out other sessions, and what to do if you lose your authenticator. All account security settings live in the organization console (`https://console.butterix.com`): click your account in the bottom-left corner and choose **Security**. These settings belong to your personal account and apply across every organization you've joined; platform administrators use the same settings when signing in to the system console. **Two-factor authentication** Sign-in asks for a 6-digit code from your authenticator app in addition to your password. **Passkeys** Sign in with your fingerprint, face, or device PIN — no email or password to type. **Sessions** See which devices are signed in to your account and sign out the others in one click. ## Two-factor authentication Two-factor authentication uses time-based one-time passwords (TOTP) and works with any standard authenticator app, such as Google Authenticator, Microsoft Authenticator, 1Password, or Authy. ### Start setup Under **Two-factor authentication** on the Security page, click **Turn on**. The page shows a QR code and a secret key. ### Add it to your authenticator app Scan the QR code with your authenticator app, or enter the secret key below it manually if you can't scan. The app then shows a 6-digit code that refreshes every 30 seconds. ### Confirm with a code Enter the app's current 6-digit code on the page and confirm. Two-factor authentication takes effect as soon as the code is accepted. ### Save your recovery codes After it's turned on, the page shows **10 recovery codes**. Download or write them down right away and keep them somewhere safe, such as a password manager — they're shown only once. From then on, signing in with your email and password adds one more step: entering the code from your authenticator app. If you've registered a passkey, you can complete this step with the passkey instead. ### Recovery codes Recovery codes let you sign in if you lose your phone or delete your authenticator app: - At the code step, enter any one of your recovery codes instead of an authenticator code. - Each recovery code works only once. The Security page shows how many you have left. - When you're running low or suspect the codes have leaked, click **Regenerate recovery codes** (requires your current password). You get 10 new codes, and all the old ones stop working. ### Turn off two-factor authentication On the Security page, click **Turn off two-factor authentication** and confirm with your current password. The entry in your authenticator app and any unused recovery codes stop working; to turn it back on later, you'll scan a new QR code. > **Note** > > If the platform has "Require two-factor authentication for administrators" turned on, platform administrator accounts can't turn off two-factor authentication. ## Passkeys A passkey is a WebAuthn sign-in credential stored on your device or in your password manager (for example iCloud Keychain, Google Password Manager, 1Password, or a hardware security key) and unlocked with your fingerprint, face, or device PIN. Passkeys can't be phished, and there's nothing to remember. ### Add a passkey 1. Under **Passkeys** on the Security page, click **Add passkey**. 2. Follow your browser's or operating system's prompt (fingerprint, face, PIN, or insert a security key). 3. Give it a recognizable name, such as "Work MacBook" or "iPhone". Each account can have multiple passkeys (up to 20). We recommend registering one on at least two devices so that losing one doesn't lock you out. You can rename or delete a passkey at any time; a deleted passkey can no longer be used to sign in. ### Sign in with a passkey - **Sign in directly**: on the sign-in page, click **Sign in with a passkey**, choose your passkey, and complete the prompt — no email or password needed. - **As the second step**: with two-factor authentication on, after entering your password you can use a passkey instead of the 6-digit code. The organization console and the system console share the same passkeys, so a passkey added in either console works in the other. ## Sessions **Sessions** on the Security page lists the devices and browsers currently signed in to your account, with their sign-in and expiry times; the session you're using right now is marked. - Click **Sign out** next to a session to sign that device out immediately. - Click **Sign out other sessions** to sign out every device except the current one. - When you change your password, the platform signs out all your other sessions automatically. If you see a device you don't recognize, sign it out right away, change your password, and turn on two-factor authentication. ## FAQ <details> <summary>I lost my phone and can't find my recovery codes. What now?</summary> If you've registered a passkey, sign in with it, then turn two-factor authentication off and on again on the Security page. If you have neither a passkey nor a recovery code, contact your platform administrator: they can reset two-factor authentication for your account in the system console, after which you sign in with your password and set it up again. </details> <details> <summary>My codes keep being rejected</summary> TOTP depends on accurate time, so make sure your phone sets its clock automatically. Each code can be used only once within its time window; if a code fails, wait for the next one and try again. </details> <details> <summary>Can I use my passkey on another computer?</summary> It depends on where the passkey is stored. Passkeys in iCloud Keychain, Google Password Manager, or 1Password sync across devices signed in to the same account; on a computer without sync, the browser usually lets you complete the prompt by scanning a QR code with your phone. </details> <details> <summary>Does two-factor authentication affect organization API keys?</summary> No. API keys belong to the organization, not to a personal account, so the CLI and CI don't need two-factor authentication when using them. Keep API keys safe and delete unused ones under "Organization settings → API Keys". See [CLI deployment and API keys](https://docs.butterix.com/en/guides/deploy/cli-deploy.md). </details> --- # Visual editor > The visual editor in the ButterIX dashboard — draft branch workflow, file tree and navigation, live rendering and diagnostics, the component props panel, image uploads, concurrent edit conflicts, preview deployments, publishing and AI translation, and which sites it works with. ## Workflow ```mermaid flowchart LR M[(main)] -->|new draft| D[draft/…] D -->|save = commit| D D -->|preview| P[Preview deployment] D -->|publish: merge| M M -->|automatic| PROD[Production deployment] ``` ### Create a draft Open the site's "Editor" tab and create a draft branch `draft/<your id>-<time>` from the production branch. Everyone's changes live in their own draft without interfering with each other; multiple drafts can exist at once. ### Edit Edit right on the page: the canvas looks exactly like the live site, so click anything and type, and type `/` to insert a component. Use the sidebar navigation to switch pages. **Source** at the top right opens the MDX source panel: changes on the canvas show up there immediately, and edits to the source take effect with **Update**. ### Save Every save is a Git commit on the draft branch, authored by your account. ### Preview Create a preview deployment of the draft to get its own URL you can send to teammates for review (the full site, including search, Ask AI, and the API playground). ### Publish Add a message and publish: the draft is merged into the production branch and a production deployment is triggered. Drafts you don't need can simply be discarded. - The top left of the editor shows the current state: No changes, Uncommitted (changes are only in your browser), Ready to publish (committed to the draft branch but not live), Publishing, or Published. - When something is committed but not published, **Commit** at the top right becomes **Publish**, so you can come back and publish at any time. - After publishing, the editor returns to the live content; opening the link of an already published draft also opens the latest live content. ## Live rendering The preview uses the same rendering pipeline as a real build: the same components, the same code highlighting, the same theme and `docs.yml` config (including colors, fonts, and custom CSS). There are only two differences: - It renders in safe mode and **doesn't load** custom `js` from `docs.yml`, because the preview runs on the dashboard's domain; - Images and other assets are read straight from the draft branch, so uploads are visible immediately. Files that aren't in the navigation can be edited too, but the preview notes that "this file isn't in the docs.yml navigation, so it won't be published". ## Components and the props panel The editor reads each component's props, types, allowed values, and defaults from the platform's component manifest (the same as `biti components --json`) to insert components and edit props. Because MDX only allows literal props (see [Safe subset](https://docs.butterix.com/en/guides/writing/safe-mdx.md)), the editor can read and rewrite components losslessly without breaking anything else you wrote by hand. - The **body of components is edited on the canvas** — callouts, accordions, updates, cards and so on — and looks the same as when published. Components whose structure comes from their children (such as tabs and code groups) are selected as a whole and edited in the props popover. - Double-click a component (click an inline one) to open its props popover: switches, dropdowns, color pickers, number fields and so on by prop type, previewed as you change them. Cancel restores everything, and each prop is its own undo step. - Icon fields open a [searchable icon picker](https://docs.butterix.com/en/components/icon.md#available-icons). - The image popover has the image URL, alt text, [caption](https://docs.butterix.com/en/guides/writing/media.md#captions), width and height, and whether a click zooms the image. ## Inserting between blocks Hold `⌘` (`Ctrl` on Windows) and move the mouse: a line appears at the nearest place where something can be inserted, and a click inserts it there. | Where | Inserts | | -------------------------------------------------------------------------- | ------------------ | | Between two blocks in the page, a component's body, or a quote | An empty paragraph | | Between list items | A list item | | Above or below the content or an image in a table cell, or at a line break | A line in the cell | | On a row border of a table (except above the header) | A table row | The line stays hidden over links. Without `⌘`: - Click the space between two blocks: next to a paragraph or heading the cursor goes there; between callouts, tables, code blocks and the like a line opens. Moving there with the arrow keys does the same. - Click below an image, or select it and press Enter, to open a line after it. An empty paragraph or cell line opened this way closes again when you move away without typing and doesn't count as a change; Backspace closes it too. Type `/` in an empty paragraph to insert a component. Backspace next to an image selects it first and deletes it on the second press. Typing with an image selected writes after it. ## Tables Edit tables right on the canvas: cells take bold, links and inline code; `Tab` / `Shift+Tab` move between cells (`Tab` in the last cell adds a row), and Enter adds a line break inside the cell. - The “…” above each column header opens the column menu: insert a column before / after, alignment, reset width, delete the column. The “⋮” left of each row opens the row menu: insert a row above / below, delete the row. - Hold the “…” and drag sideways to move the column, or hold the “⋮” and drag up or down to move the row; a line shows where it lands, and `Esc` cancels. The menus have move left / right and up / down too. The header row stays put, and rows can’t go above it. Rows or columns joined by merged cells move as a group. - The “⊕” bar on the right adds a column at the end; the dashed “⊕” bar below adds a row. - Drag the border between two columns to resize them; widths are saved as `<Table widths="…">`. - Drag across cells and choose “Merge Cells”; with the cursor in a merged cell, “Split Cell” undoes it. Merges are saved with the Markdown `>>` / `^^` syntax; layouts it can't express (such as a header cell merged downward) are written as an HTML `<table>`. - The “⋮” on the right of the table opens the table menu: skin (hover to try it on the table), width layout, minimum width, sticky header / first column, search, pagination, delete table. - Dragging a column border scales the columns to its right proportionally, keeping the total width; hold `Shift` to resize only the two adjacent columns. These settings map to the props of the [Table component](https://docs.butterix.com/en/components/table.md); in source mode it's plain MDX. ## Columns [Columns](https://docs.butterix.com/en/components/columns.md) have drag handles between columns: drag to resize, with the columns to the right scaling proportionally and snapping to equal widths when close (hold `Alt` to skip snapping). The result is saved as `<Columns widths="60 40">`; double-click a handle to go back to equal widths. ## Docs settings **Docs settings** in the top right reads and writes `docs.yml`, organized in these categories: Brand, Navigation, Layout, Style, Header and footer, Pages, API reference, Search, Ask AI, Social, Analytics and Redirects. Changes keep the comments and formatting in your YAML, show up under **Files**, and are saved with your next commit. - **Colors**: color fields you haven't set show the default the site actually uses (computed with the same palette algorithm as the site, following the accent color and light / dark mode). The color picker has a saturation / brightness area, a hue slider and HEX / RGB / HSL inputs, and can reset to the default. - **Layout**: page width (`full` for wide mode), content width, sidebar width, header height, and header opacity and background blur. See [Customize the look](https://docs.butterix.com/en/guides/configuration/appearance.md). - **Header and footer**: header links, social links, the announcement bar (text, link, background, text color), footer links and copyright text, and the **Show Powered by ButterIX** switch. Until the platform administrator allows your organization to remove the badge, the switch is grayed out and can't be turned off. If the site uses a [custom footer](https://docs.butterix.com/en/guides/configuration/docs-yml.md#custom-footer) file, this section just tells you which file defines the footer. ## Page settings **Page settings** in the top right edits the current page's frontmatter: title, subtitle, URL, icon (click to [search and pick](https://docs.butterix.com/en/components/icon.md#available-icons)), layout (`guide` / `overview` / `reference` / `page` / `custom`), table of contents, SEO and more, plus **Hero image**: upload light and dark images, saved as the frontmatter's `background-image`. Clearing the last field removes the frontmatter block entirely. ## Endpoint pages On endpoint pages generated from OpenAPI, click text to edit it; it is saved back to the spec file, or to the translation when the preview is in another language. See [Edit text in the editor](https://docs.butterix.com/en/guides/api/openapi.md#edit-text-in-the-editor). ## Changelogs and blogs [Changelogs and blogs](https://docs.butterix.com/en/guides/configuration/changelog.md) appear as a group in the navigation tree on the left, listing the overview page and the entries by date, with drafts and hidden entries marked. - **Add changelog / blog** in the navigation tree creates a changelog or a blog: pick the type and enter a navigation title and entries folder, and it creates the overview page and a first entry and adds it to the navigation in `docs.yml`. - The group's menu has **New entry** (**New post** for blogs), **Edit overview** and **Layout & authors**. When creating an entry, pick a date and enter tags; the file name is generated from the date. You can also choose a changelog as the destination in the **New page** dialog. - With an entry open, **Page settings** shows entry-specific settings: date, tags (press Enter to add), draft and hidden; blog posts also have author, thumbnail and a custom URL. The overview page's settings switch between the `timeline`, `classic` and `blog` layouts and manage the author registry. ## Versions and languages - On sites with versions or products, **Viewing version** and **Viewing product** dropdowns above the navigation tree switch which navigation you view and edit; new pages go into the current version. - **Docs settings → Navigation** manages versions (turn on versions, add, rename, URL segment, status, make default, reorder, hide, delete) and languages (turn on languages, add, display name, make default, reorder, delete). See [Versions](https://docs.butterix.com/en/guides/features/versions.md#manage-versions-in-the-console) and [Languages](https://docs.butterix.com/en/guides/features/i18n.md#manage-languages-in-the-console). ## Reviewing and reverting changes **Files** at the top right lists the files changed in your draft, each with its added and removed line counts (`+added -removed`). - Hover over a file for about 2 seconds to see a preview of its changes. - Click it to open the full diff: old and new line numbers, deletions in red and additions in green, with unchanged stretches collapsed and expandable. - Each change has a **Revert this change** button that undoes just that change and keeps the rest; reverting can itself be undone. ## Uploading fonts Under **Docs settings → Brand → Fonts**, body text, headings and code can each use their own font: upload WOFF2, WOFF, TTF or OTF files (up to 20 MB), or type a Google Fonts name. A variable font covers every weight with one file; otherwise pick several files at once — the editor reads each file's weight and italics and writes them to [`typography`](https://docs.butterix.com/en/guides/configuration/docs-yml.md#fonts) in docs.yml. Files are kept in `assets/fonts/` and published with the change request. You'll see a note when the fonts are large; prefer WOFF2, or a subset with only the characters you need. ## Uploading images and media Drag in or pick files to upload images, videos, or PDFs (up to 20 MB). Files are committed to the draft branch as `assets/<timestamp>-<filename>`, and you get back a URL you can drop straight into Markdown: ```mdx ![Architecture diagram](/assets/mf2x8k-architecture.png) ``` ## Collaboration and conflicts - When a file your draft is based on has changed on the branch since, a notice above the canvas lets you discard those drafts and use the latest version, or keep them. - When you open a file, the editor records its version (sha). If someone else has changed the file on the same draft by the time you save, the platform refuses to overwrite and returns the latest content for you to merge before saving again. - If the draft has conflicts with the production branch that can't be merged automatically, publishing fails with a conflict message and the production site is unaffected. ## AI translation When a site has multiple languages configured, you can translate the whole site from the editor in one click. The platform creates a `translate/…` branch and uses the site's Ask AI config to incrementally translate all pages and navigation labels (reusing the translation memory in the repo); when it's done, review and edit in the editor, then publish. See [Internationalization](https://docs.butterix.com/en/guides/features/i18n.md#ai-translation-on-the-platform). ## Arranging the interface The buttons at the top right open the source, page settings, docs settings, and the [agent](https://docs.butterix.com/en/guides/features/console-agent.md) panel. Drag the border between the canvas and the panel on the right to resize it; double-click to reset. ## Which sites it works with | Site source | Editor | | ----------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | Hosted repository | Available. Publishing merges into the hosted repository's production branch | | Connected Git | Available. Can't edit the production branch directly; publishing merges and **pushes to the remote repository** (the token needs write access) | | CLI upload | Available. `biti deploy` syncs your source files to the platform; fetch changes published online with `biti pull`, or let the next deploy [merge them line by line](https://docs.butterix.com/en/guides/deploy/cli-deploy.md#sync-with-the-online-editor) | Saving, previewing, and publishing require the editor role or higher; viewers can browse files and rendered results. ## Drive the editor with the API Everything the editor can do is available through the platform API, so you can also batch-edit docs with scripts or AI agents: read files, save with `baseSha`, validate with `editor/check`, create previews, and publish. See the [Visual editor](https://docs.butterix.com/en/api-reference/editor/list-branches.md) group in the API reference for the endpoint list. #### Request body Content type: `application/json` | Field | Type | Required | Description | |---|---|---|---| | `branch` | string | yes | | | `path` | string | yes | | | `content` | string | yes | | | `message` | string | no | | | `baseSha` | string | no | | --- # CLI reference > biti CLI reference — options and examples for init, dev, check, eval, export, login, deploy, pull, translate, and components, plus exit codes and environment variables. ```bash npm npm install -g bitidocs ``` ```bash pnpm pnpm add -g bitidocs ``` ```bash yarn yarn global add bitidocs ``` ```bash biti --help # list commands biti <command> --help # show a command's options biti --version ``` Every command that accepts `[dir]` defaults to the current directory. ## biti init Create a new docs project. ```bash biti init [dir] [--title <title>] [--openapi <file>] [--skill] ``` - `--title` (string): Site title; generated from the directory name by default. - `--openapi` (string): Copies this OpenAPI file to `openapi.yml` and generates two tabs, "Guides" and "API Reference". - `--from` (string): Directory of an existing Fern / Mintlify project, copied whole into the new project. biti reads its `fern/docs.yml` or `docs.json` directly. See [Migrate from Fern](https://docs.butterix.com/en/guides/reference/migrate-from-fern.md). - `--skill` (boolean): Writes the writing skill to `.claude/skills/butterix-docs` for coding agents such as Claude Code to use when editing the docs. In an existing project it only adds the skill, and leaves one that's already there as it is. See [Let coding agents edit your docs](https://docs.butterix.com/en/guides/features/agents.md#let-coding-agents-edit-your-docs). Generates `docs.yml`, `pages/introduction.mdx`, `pages/quickstart.mdx`, `assets/logo.svg`, `AGENTS.md`, and `.gitignore`. Exits with an error if the directory already contains `docs.yml` and `--skill` isn't given. ## biti dev Preview the docs on your computer, with automatic reload when you edit. Run `biti login` first (or set `BITI_TOKEN`). ```bash biti dev [dir] [-p, --port <port>] ``` - `-p, --port` (number, default: 3000): Port. - Pages are rendered by the ButterIX platform: biti syncs changes in your docs folder to the platform incrementally and serves the pages at `http://localhost:<port>`. Pages reload once a change has synced; CSS-only changes hot-swap styles without a full reload. - The preview opens on your computer only. Every page carries a footer note saying it is a development-only preview, not for readers. - Search and Ask AI work on the published site; in the development preview, clicking them shows a notice. [API playground](https://docs.butterix.com/en/guides/api/try-it.md) requests work, but only to the public servers listed in your OpenAPI spec. - Use `biti check` for a full check. ## biti check Validate the config, navigation, MDX, links, API specs, and [skills](https://docs.butterix.com/en/guides/features/agents.md#hosted-skills) without writing any files. The check runs on the platform, so run `biti login` first; in CI, set `BITI_TOKEN`. ```bash biti check [dir] [--json] [--strict] [--review] ``` - `--json` (boolean): Output machine-readable JSON: `{ ok, pages, diagnostics: [{ severity, code, message, file, line, column, hint }] }`. Suited to CI and coding agents. - `--strict` (boolean): Treat warnings as errors too. - `--review` (boolean): Also list pages to [review](https://docs.butterix.com/en/guides/features/page-review.md); with `--json` they are in `reviews`. Doesn't affect the exit code. The exit code is 1 when there are errors (or warnings under `--strict`). Common diagnostics: | Code | Level | Meaning | | ----------------------- | --------------- | -------------------------------------------------------------------------------------------------------------------------------------------- | | `config/schema` | Error | Wrong field type in `docs.yml`; the message includes the field path | | `config/tab` | Error | The navigation references an undeclared tab | | `nav/missing-page` | Error | A page file in the navigation doesn't exist | | `nav/duplicate-slug` | Error | Two pages end up with the same URL | | `api/load` | Error | The OpenAPI file doesn't exist or can't be parsed | | `mdx/parse` | Error | MDX syntax error (unclosed tag, unescaped `{` / `<`) | | `mdx/attribute` | Error | A prop value isn't a literal | | `asset/missing` | Error | A referenced image or file doesn't exist | | `link/broken` | Warning | Link to a nonexistent source file | | `mdx/unknown-component` | Warning | Unknown component; only its children are rendered | | `mdx/required-prop` | Warning | A component is missing a required prop | | `mdx/tag` | Warning | A disallowed HTML tag was removed | | `md/table-merge` | Warning | `>` / `^` in a table cell is neither written as a [merge](https://docs.butterix.com/en/guides/writing/markdown.md#merged-cells) nor escaped | | `page/review` | Warning | `owner`, `verified` or `review-every` is written wrongly, see [Page review](https://docs.butterix.com/en/guides/features/page-review.md) | | `icon/unknown` | Warning | No [icon](https://docs.butterix.com/en/components/icon.md#available-icons) has that name | | `skill/invalid` | Error / warning | A skill in `.well-known/agent-skills/` doesn't meet the [requirements](https://docs.butterix.com/en/guides/features/agents.md#hosted-skills) | | `api/unsupported` | Warning | The file isn't OpenAPI or Swagger (for example AsyncAPI or OpenRPC), so this section has no content | | `openapi/spec` | Warning | A problem in the OpenAPI spec (such as an unresolvable `$ref`) | ## biti eval Lets AI answer the questions in `evals.yml` from the docs alone and grades the answers, see [Docs eval](https://docs.butterix.com/en/guides/features/evals.md). Run `biti login` first; answering and grading use your own model key (see [Environment variables](#environment-variables)). ```bash biti eval [dir] [--model <id>] [--min <percent>] [--site <slug>] [--report <file>] [--json] biti eval [dir] --import --site <slug> ``` The exit code is 1 below the pass mark. ## biti export Exports the docs published on the platform as Markdown or PDF. Run `biti login` first. See [Export and print](https://docs.butterix.com/en/guides/features/export.md#command-line). ```bash biti export [dir] [--site <slug>] [--format markdown|pdf] [--out <path>] [--only <name>] [--lang <code>] [--paper a4|letter] biti export [dir] --list ``` ## biti migrate Prints the steps to move docs from another platform, or compares the old project with the new one. See [Migration tool](https://docs.butterix.com/en/guides/reference/migrate.md). ```bash biti migrate <source> [--check <dir>] [--report <file>] [--base <path>] [--ignore <glob>] [--json] ``` `<source />` is the folder of the old project, or the `https://` address of the old site. With `--check`, the exit code is 1 while something is missing. ## biti login Save platform credentials. ```bash biti login [--api <url>] [--token <token>] ``` - `--api` (string, default: https://console.butterix.com): Platform URL; the ButterIX hosted platform by default. - `--token` (string): Organization API key; prompted interactively when omitted. Credentials are verified against `/api/v1/whoami` and saved to `~/.config/bitidocs/credentials.json`. ## biti deploy Package the project, upload it, and publish it to the hosted platform. ```bash biti deploy [dir] [--site <slug>] [--preview] [--message <msg>] ``` - `--site` (string): Site slug; defaults to the first subdomain label of `instances[0].url`. - `--preview` (boolean): Create a preview deployment. - `--message` (string): Deployment message. See [CLI deployment and API keys](https://docs.butterix.com/en/guides/deploy/cli-deploy.md) for details. ## biti pull Pull the source files online into a local folder. A folder that doesn't exist is created; a folder synced before is merged line by line, keeping changes from both sides. ```bash biti pull [dir] [--site <slug>] [--clean | --merge] [--force] [--dry-run] ``` - `--site` (string): Site slug; defaults to the first subdomain label of `instances[0].url`. Required when pulling into a new folder. - `--clean` (boolean): If the folder holds something else, empty it first (keeps `.git`). It is emptied only after the download succeeds. - `--merge` (boolean): If the folder holds something else, pull into it anyway. Files with the same path but different content become conflicts; the rest stays and is uploaded by the next deploy. - `--force` (boolean): Take the online version of every file, overwriting local edits. - `--dry-run` (boolean): List what would change without writing anything. When the folder isn't empty and isn't this site's docs (never synced, and its `docs.yml` doesn't match), you're asked whether to empty it first, pull into it, or cancel. Where nobody can answer, such as in CI, pass `--clean` or `--merge`. See [Sync with the online editor](https://docs.butterix.com/en/guides/deploy/cli-deploy.md#sync-with-the-online-editor) for merging and conflicts. ## biti translate Incrementally translate pages into `translations/<lang>/` with AI. ```bash biti translate [dir] [--to <langs>] [--provider <provider>] [--model <model>] [--only <path>] ``` - `--to` (string): Target languages, comma-separated; defaults to every language other than the source. - `--provider` (anthropic | deepseek | openrouter, default: anthropic): Model provider. - `--model` (string): Model id; defaults to the provider's default model. - `--only` (string): Only translate pages whose path contains this string. See [Internationalization](https://docs.butterix.com/en/guides/features/i18n.md#translate-automatically-with-biti-translate) for details. ## biti components List every MDX component, alias, and prop. ```bash biti components [--json] ``` ```text title="Output (excerpt)" <Callout> (<Note> <Info> <Warning> <Success> <Error> <Danger> <Tip> <Check> <Launch>) callout Highlights important information. Aliases set the intent: … intent enum: note | info | warning | success | error | tip | check | launch | danger — Color and default icon. title string — Bold heading above the content. icon icon — Icon spec (Font Awesome / lucide:name / URL / <svg>). icon={false} hides the icon. ``` ## Environment variables | Variable | Used by | Description | | -------------------- | -------------------------------------------------- | ------------------------------------------------------------------------------------ | | `BITI_TOKEN` | `dev`, `check`, `eval`, `export`, `deploy`, `pull` | Organization API key; takes precedence over saved credentials | | `BITI_API` | `login` and commands that need a login | Platform URL; the ButterIX hosted platform `https://console.butterix.com` by default | | `XDG_CONFIG_HOME` | `login` and commands that need a login | Directory containing the credentials file; defaults to `~/.config` | | `ANTHROPIC_API_KEY` | `translate`, `eval` | Anthropic key | | `DEEPSEEK_API_KEY` | `translate`, `eval` | DeepSeek key | | `OPENROUTER_API_KEY` | `translate`, `eval` | OpenRouter key | | `BITI_AI_PROVIDER` | `eval` | Provider for answering and grading; defaults to the one whose key is set | | `BITI_AI_MODEL` | `eval` | Model that answers | --- # Migration tool > How to use biti migrate — recognize Mintlify, Fern, Docusaurus, GitBook, ReadMe, Starlight, VitePress, Nextra, Fumadocs and MkDocs projects, print migration steps for a coding agent, and compare pages, text, code, images, addresses, redirects and API operations with the new project. The risk in moving docs is losing something: a page, a code sample, an address that people link to. `biti migrate` works in two steps: it gives a coding agent the steps to follow, and then compares the old and the new project and lists everything that didn't make it. It only reads the old project, never changes it, and sends its content nowhere. ## Steps ### Print the steps ```bash biti migrate ../old-docs > migrate.md ``` Recognizes the platform, counts pages, redirects and API operations, and lists the markup to convert. ### Hand them to a coding agent Give `migrate.md` to Claude Code, Cursor, Codex or another tool, and let it work in a new folder. ### Compare ```bash biti check docs biti migrate ../old-docs --check docs --report migration.md ``` The exit code is 1 while something is missing. Give the report to the agent and repeat. ### Check addresses that are online While the old site is online, its sitemap shows which addresses must keep working: ```bash biti migrate https://docs.example.com --check docs ``` ### Review and publish Look through the preview, then run [`biti deploy`](https://docs.butterix.com/en/guides/reference/cli.md#biti-deploy). ## Sources | Source | Recognized by | Notes | | ---------------------------------------------- | ----------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | | Mintlify | `docs.json`, `mint.json` | Can be imported directly, see [Migrate from Mintlify](https://docs.butterix.com/en/guides/reference/migrate-from-mintlify.md) | | Fern | `fern/docs.yml` | Can be imported directly, see [Migrate from Fern](https://docs.butterix.com/en/guides/reference/migrate-from-fern.md) | | Docusaurus | `docusaurus.config.*` | Sidebars and config are code; they aren't run, the agent reads them | | GitBook | `.gitbook.yaml`, `SUMMARY.md` | Content synced to a Git repository | | ReadMe | `_order.yaml` | An exported project | | Starlight, VitePress, Nextra, Fumadocs, MkDocs | Their config files | | | Anything else | `.md` and `.mdx` files | General steps only | | Any website | An `https://` address | Checks the addresses in its sitemap only | ## What is compared | Item | How | | ---------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- | | Pages and text | How much of the old text the new project contains. Pages may be split, merged and renamed, and markup may differ; text that many pages share counts less | | Code blocks | Whether each is still there, ignoring whitespace | | Headings | Listed for incomplete pages | | Images and files | By content, so renaming and moving don't matter | | Navigation | Files with content that no page shows | | Addresses | Old addresses have a page or a redirect. Derived from the files by each platform's rules; addresses that can't be derived aren't checked | | Redirects | Whether each old one still works | | API | Every operation in the OpenAPI files | The comparison says whether content is still there, not how it looks or reads. Have a person look through it before publishing. ## Options - `--check` (string): Folder of the new project to compare with. - `--report` (string): Write the report to a Markdown file. - `--base` (string): Path the old site was served under, such as `/docs`. - `--ignore` (string): Old pages left out on purpose; supports `*` and `**`, and can be repeated. - `--json` (boolean): Machine-readable output. Without `--check`, the inventory of the old project. --- # Migrate from Fern > Migrate Fern docs to ButterIX — reading fern/docs.yml directly, config field mapping, the openapi path needed for API sections, supported x-fern extensions, component compatibility, syntax to adjust (line-number props, custom components, snippet variables), and a migration checklist. ## Use fern/docs.yml directly biti looks for config in the order `docs.yml` → `docs.yaml` → `fern/docs.yml` → `biti/docs.yml` → `docs.json` → `mint.json`. After signing in (`biti login`), run this in the root of your Fern repository: ```bash biti check # find what needs adjusting biti dev # preview locally ``` The `fern/` directory containing the config file is the project root, and paths in `docs.yml` (`pages/…`, `assets/…`) keep resolving relative to it — no files need to move. ## Config field mapping These Fern fields work as-is: | Category | Fields | | ---------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | Site | `title`, `instances` (`url`, `custom-domain`), `logo` (`light`, `dark`, `height`, `href`, `right-text`), `favicon` | | Theme | `colors` (`accent-primary`, `background`, `border`, `sidebar-background`, `header-background`, `card-background`; `accentPrimary` is also accepted), `typography`, `layout`, `css`, `js` | | Navigation | `tabs`, `navigation` (`section`, `page`, `link`, `api`, `changelog` (and its `blog` alias), `folder`), `navbar-links`, `landing-page` | | Dimensions | `versions`, `products`, `languages` / `translations`, and per-language `docs.yml` and navigation files under `translations/<lang>/` (see [Per-language navigation files](https://docs.butterix.com/en/guides/features/i18n.md#per-language-navigation-files)) | | Other | `redirects`, `announcement`, `analytics`, `footer` | `slug`, `skip-slug`, `icon`, `hidden`, `collapsed`, `availability`, and `noindex` on navigation nodes mean the same as in Fern. See the [docs.yml reference](https://docs.butterix.com/en/guides/configuration/docs-yml.md) for full field details. A few more things carry over as they are: - A top-level `footer-links` map (platform → URL) is merged into `footer.socials` on load; if a platform appears in both, `footer.socials` wins. Editing social links in the dashboard moves them all under `footer.socials`. - `translations/<lang>/fern/<file>` is read too, so per-language config files don't need to move. - Changelogs: the `changelog` node and its `blog:` alias, file names in all three date formats, `overview.mdx`, `##` sections with `<ChangelogTags>`, `tags`, `draft` / `hidden`, the top-level `changelog` of multi-product sites, the `timeline` / `classic` / `blog` layouts (including `blog-layout`, `authors`, and the post fields `author`, `thumbnail`, `slug`, and `description` / `subtitle` / `excerpt`), the `.rss` / `.atom` / `.json` feed URLs, and `/changelog.md` and `/changelog/llms.txt` all match Fern; see [Changelog](https://docs.butterix.com/en/guides/configuration/changelog.md). > **Note** > > A few Fern fields are accepted but not yet used (for example `background-image` and `layout.disable-header`); see [docs.yml reference › Accepted but not yet used fields](https://docs.butterix.com/en/guides/configuration/docs-yml.md#accepted-but-not-yet-used-fields) for the list. ## API sections: add the openapi path Fern's `- api: API Reference` usually uses `api-name` to reference definitions under `fern/apis/<name>/` described by generators.yml. ButterIX doesn't read Fern Definitions or generators.yml, so **you need to write the OpenAPI file path directly on the api node**: ```yaml title="fern/docs.yml" {4} navigation: - api: API Reference api-name: plants openapi: apis/plants/openapi/openapi.yml ``` If your API is written in Fern Definition (`definition/*.yml`) rather than OpenAPI, export it to OpenAPI first. ### Supported x-fern extensions | Extension | Effect | | ------------------------ | -------------------------------- | | `x-fern-display-name` | Endpoint title | | `x-fern-sdk-method-name` | Endpoint URL segment | | `x-fern-availability` | Status badge (beta, deprecated…) | | `x-fern-ignore` | No page is generated | | `x-fern-streaming` | Marks a streaming response | | `x-fern-enum` | Descriptions for enum values | Redocly-style `x-codeSamples`, `x-displayName`, `x-hidden`, and `x-internal` are supported too. See [Import OpenAPI](https://docs.butterix.com/en/guides/api/openapi.md). ## Component compatibility Every Fern MDX component has an implementation with the same name and the same props: - `Callout` and `Note` / `Info` / `Warning` / `Success` / `Error` / `Tip` / `Check` / `Launch` - `Card`, `CardGroup`, `Tile` - `Tabs` / `Tab` (with `language` sync) - `Steps` / `Step` - `Accordion`, `AccordionGroup` - `CodeBlock`, `CodeBlocks`, `Code` - `Frame`, `Icon`, `Badge`, `Button` - `Tooltip`, `Indent`, `Anchor`, `Aside` - `ParamField`, `ResponseField` - `EndpointRequestSnippet`, `EndpointResponseSnippet`, `EndpointSchemaSnippet`, `WebhookPayloadSnippet`, `Schema`, `RunnableEndpoint` - `Files` / `Folder` / `File` - `Prompt`, `ScrollWalkthrough`, `Update`, `ChangelogTags` (changelog section tags) - `Versions` / `Version`, `If` - `Markdown` (snippets), `Color`, `Copy`, `Download` - `GitHub.Repo`, `StickyTable` Code fence meta syntax (title, `{1-3}`, `focus`, `startLine`, `maxLines`, `wordWrap`, `for`) also matches Fern; see [Code blocks](https://docs.butterix.com/en/guides/writing/code-blocks.md). ## Syntax to adjust <details open> <summary>Write line-number props as strings</summary> In Fern docs, the `1-3` in `lines={[1-3]}` and `highlight={[1-3, 5]}` is a subtraction expression. ButterIX's [safe subset](https://docs.butterix.com/en/guides/writing/safe-mdx.md) only allows literals and reports an `mdx/attribute` error. Change it to: ```mdx <Code src="snippets/example.ts" lines="1-3" /> <EndpointRequestSnippet endpoint="POST /plants" highlight="1-3, 5" /> ``` </details> <details> <summary>Footers written as React components</summary> The platform doesn't run component code from authors, so a `.tsx` / `.jsx` footer produces a build warning and the default footer is shown. Rewrite the footer as MDX; see [Custom footer](https://docs.butterix.com/en/guides/configuration/docs-yml.md#custom-footer). </details> <details> <summary>Custom React components</summary> ButterIX doesn't execute JavaScript in MDX, and `import` can only import `.md` / `.mdx` snippets. Replace custom components with the closest built-in component, or rewrite the content as a snippet. `biti check` gives an `mdx/unknown-component` warning for every unknown component. </details> <details> <summary>Variable placeholders in snippets</summary> MDX treats `{name}` in snippet body text as an expression; write it as `\{name\}` instead. See [Reusable snippets and variables](https://docs.butterix.com/en/guides/writing/snippets.md#parameterized-snippets). </details> <details> <summary>Role-based content</summary> `<If roles>` is accepted, but a static site has no logged-in user, so the condition is never true. To control access per user, see [Access control](https://docs.butterix.com/en/guides/deploy/access-control.md). </details> ## Migration checklist ### Add the openapi path to api nodes Run `biti check` and fix every `api/load` and `nav/api` error. ### Fix MDX diagnostics Handle `mdx/attribute`, `mdx/import`, and `mdx/unknown-component`. ### Check URLs ButterIX's slug rules match Fern's (tab, section, and page segments joined in order, with `slug` and `skip-slug` support). Compare the URLs against your old sitemap with [`biti migrate https://old-site --check .`](https://docs.butterix.com/en/guides/reference/migrate.md#steps) and add `redirects` where needed. ### Deploy Use `biti deploy`, or connect your repository in the dashboard for automatic deployments on push. --- # Migrate from Mintlify > Migrate Mintlify docs to ButterIX — what docs.json / mint.json auto-conversion covers, how page URLs change, mapping for rewriting as docs.yml, Mintlify component and prop compatibility, and migrating snippets and OpenAPI. ## Step 1: Preview directly After signing in (`biti login`), run this in the root of your Mintlify project (when there's no `docs.yml`): ```bash biti dev ``` biti reads `docs.json` (or the older `mint.json`) and converts it into ButterIX config on load. Pages, images, and snippets all stay where they are. ## What auto-conversion covers | Mintlify | ButterIX | | ---------------------------------------------------------------- | ------------------------------------------------------- | | `name` | `title` | | `logo` (string or `{ light, dark }`) | `logo` | | `favicon` | `favicon` | | `colors.primary` / `colors.light` | Light / dark values of `colors.accent-primary` | | `group` / `pages` in `navigation.groups` or a `navigation` array | Sections (`section`) and pages, with `icon` preserved | | `navigation.tabs` | Tabs (`tab0`, `tab1`…) and their groups | | Page string `"guides/quickstart"` | `{ page: "Quickstart", path: "guides/quickstart.mdx" }` | Auto-conversion is best-effort: OpenAPI, versions, languages, anchors (except `navigation.global.anchors`, which become [`sidebar-links`](https://docs.butterix.com/en/guides/configuration/docs-yml.md#sidebar-links)), redirects, footer, navbar links, and so on are **not** converted. For a real migration, rewrite the config as `docs.yml`. > **Warning** > > URLs will change: ButterIX sections contribute a URL segment by default, and page segments are generated from titles. A Mintlify page like `/quickstart` may become `/get-started/quickstart` after conversion. When rewriting `docs.yml`, use `skip-slug: true` and `slug` to keep the original URLs, or add `redirects`. ## Step 2: Rewrite as docs.yml ```json docs.json (Mintlify) { "name": "Acme", "logo": { "light": "/logo/light.svg", "dark": "/logo/dark.svg" }, "colors": { "primary": "#7C5CFF", "light": "#9E8AFF" }, "navigation": { "tabs": [ { "tab": "Guides", "groups": [ { "group": "Get started", "pages": ["index", "quickstart"] } ] }, { "tab": "API reference", "openapi": "openapi.json" } ] }, "redirects": [{ "source": "/old", "destination": "/quickstart" }] } ``` ```yaml docs.yml (ButterIX) title: Acme logo: light: logo/light.svg dark: logo/dark.svg colors: accent-primary: light: "#7C5CFF" dark: "#9E8AFF" tabs: guides: display-name: Guides skip-slug: true api: display-name: API reference slug: api-reference navigation: - tab: guides layout: - section: Get started skip-slug: true # keep Mintlify's flat URLs contents: - page: Introduction path: index.mdx slug: index - page: Quickstart path: quickstart.mdx slug: quickstart - tab: api layout: - api: API reference openapi: openapi.json redirects: - source: /old destination: /quickstart ``` When `docs.yml` exists it takes precedence over `docs.json`. Once everything checks out, you can delete `docs.json`. ## Component compatibility Mintlify's components and props all have matching implementations: | Mintlify | Notes | | ----------------------------------------------------------- | ----------------------------------------------------------------------------------------- | | `<Note>` `<Info>` `<Warning>` `<Tip>` `<Check>` `<Danger>` | Callouts; `color` in `<Callout icon color iconType>` maps to the closest style | | `<Card>` `<CardGroup>` `<Columns>` | Supports `img`, `horizontal`, `cta`, `arrow`, `iconType`, `color` | | `<Accordion>` `<AccordionGroup>` `<Expandable>` | Supports `description`, `icon`, `defaultOpen` | | `<Tabs>` `<Tab>` | Supports `icon` and `sync` | | `<Steps>` `<Step>` | Supports `stepNumber`, `titleSize`, `icon` | | `<CodeGroup>` | Same name | | `<ParamField>` | Supports the `query` / `path` / `body` / `header="name"` syntax; `placeholder` is ignored | | `<ResponseField>` | Supports `pre`, `post` | | `<Frame>` | Supports `caption`, `hint` | | `<Tooltip>` | Supports `headline`, `cta`, `href` | | `<Badge>` | Supports `color`, `size`, `shape`, `stroke` (mapped to `outlined`), `icon`, `disabled` | | `<Tree>` `<Tree.Folder>` `<Tree.File>` | Mapped to a file tree | | `<Panel>` `<Banner>` `<Update>` `<Icon>` `<Tile>` `<Color>` | Same name | See the [Components overview](https://docs.butterix.com/en/components/overview.md) for every component. ## Snippets Importing with `import Snippet from "/snippets/x.mdx"` and using it as `<Snippet />` is fully supported. Defining JSX components or functions in snippets with `export const X = () => …` is **not supported** — ButterIX doesn't execute JavaScript in MDX. Rewrite such components as plain snippets or switch to built-in components; see [Safe subset](https://docs.butterix.com/en/guides/writing/safe-mdx.md). ## OpenAPI The OpenAPI files Mintlify references in `docs.json` work as-is; just write their paths in the `api` node of `docs.yml`. The separate `.mdx` page Mintlify uses for each endpoint (`openapi: "POST /users"` in frontmatter) is no longer needed, since ButterIX generates a page for every endpoint automatically; to reference an endpoint in a guide, use `<EndpointRequestSnippet endpoint="POST /users" />`. ## Checklist ### biti check Fix every error, especially `mdx/import` (importing a non-MDX module) and `mdx/esm` (exporting a function). ### Rewrite docs.yml Add the config that isn't auto-converted, such as OpenAPI, redirects, navbar links, and the footer. ### Check URLs Compare against your old sitemap and keep the original URLs with `slug` / `skip-slug` or `redirects`. ### Publish Run `biti deploy`, or connect a Git repository in the dashboard. --- # FAQ > ButterIX FAQ — the relationship to other docs platforms, components not rendering, non-English URLs, hidden pages, site search, OpenAPI versions, search and Ask AI in the development preview, AI index updates, analytics, RTL, and asset paths. <details open> <summary>How is ButterIX related to Fern and Mintlify?</summary> ButterIX is an independently built docs platform with no affiliation to Fern, Postman, or Mintlify. To lower migration costs, `docs.yml` fields match Fern's, components support both Fern and Mintlify syntax, and both `fern/docs.yml` and `docs.json` can be read directly. See [Migrate from Fern](https://docs.butterix.com/en/guides/reference/migrate-from-fern.md) and [Migrate from Mintlify](https://docs.butterix.com/en/guides/reference/migrate-from-mintlify.md). </details> <details> <summary>My component doesn't render</summary> Run `biti check`: - `mdx/unknown-component`: the component name is misspelled, or you used a component ButterIX doesn't have (including custom React components). `biti components` lists every available component. - `mdx/attribute`: a prop value isn't a literal, for example `lines={[1-3]}` or an arrow function. - `mdx/parse`: an MDX syntax error, usually an unclosed tag or an unescaped `{` or `<` in body text. See [Safe subset](https://docs.butterix.com/en/guides/writing/safe-mdx.md) for why. </details> <details> <summary>Why do my page URLs contain Chinese characters?</summary> Page and section URL segments are generated from navigation titles by default, and Chinese characters are preserved. Add a `slug` to every page and section in the navigation; see [Navigation › Slug rules](https://docs.butterix.com/en/guides/configuration/navigation.md#slug-rules). For OpenAPI endpoints, use `x-fern-sdk-method-name` to set an English URL. </details> <details> <summary>How do I make a page reachable but hidden from the sidebar?</summary> Add `hidden: true` to the page in the navigation. The page is still built and reachable by URL, but doesn't appear in the sidebar, previous / next links, or `llms.txt`. If you also don't want search engines to index it, add `noindex: true`. </details> <details> <summary>Does site search need a server?</summary> No. The search index is generated by Pagefind at build time (`/_biti/pagefind/`) and shards are loaded on demand in the browser. Press / or Ctrl + K to open search. </details> <details> <summary>Which OpenAPI versions are supported?</summary> OpenAPI 3.1, 3.0, and Swagger 2.0, in YAML or JSON. Specs are upgraded to 3.1 on load and `$ref`s are dereferenced. OpenAPI 3.1 `webhooks` generate webhook pages, and `text/event-stream` responses are shown as event streams. </details> <details> <summary>Search and Ask AI don't work in the biti dev preview</summary> `biti dev` is a development-only preview, so clicking search or Ask AI just shows a notice; both work on the published site. To try Ask AI before you publish, [ask a test question](https://docs.butterix.com/en/guides/features/ask-ai.md#configure-it-in-the-dashboard) in the site's settings in the dashboard. </details> <details> <summary>After I change the docs, when do Ask AI and MCP see the new content?</summary> The search index is generated on every build and ships with the deployment, so it takes effect as soon as the new production deployment goes live. Note that only default-version pages are indexed. </details> <details> <summary>How do I add Google Analytics?</summary> Set `analytics.ga4.measurement-id` in `docs.yml`. Google Tag Manager, Plausible, PostHog, and Segment are supported too. The hosted platform also offers server-side analytics that distinguishes human and AI traffic; see [Analytics](https://docs.butterix.com/en/guides/features/analytics.md). </details> <details> <summary>Are right-to-left languages like Arabic supported?</summary> Yes. Languages such as `ar`, `he`, and `fa` in `languages` automatically output `dir="rtl"` on the page and are laid out right to left. </details> <details> <summary>Images don't show up in the English translation</summary> Translations live in `translations/en/pages/…`, so relative paths point to locations that don't exist. Use project-root paths starting with `/` instead, for example `/assets/diagram.svg`. See [Images and media](https://docs.butterix.com/en/guides/writing/media.md#asset-paths). </details> <details> <summary>Will older version pages compete with newer versions in search rankings?</summary> No. Older version pages automatically point canonical to the same page in the default version; see [Versions](https://docs.butterix.com/en/guides/features/versions.md). </details> <details> <summary>biti deploy says Not logged in</summary> Run `biti login` first, or set `BITI_TOKEN` in CI (and `BITI_API` to your platform URL when self-hosting). See [CLI deployment and API keys](https://docs.butterix.com/en/guides/deploy/cli-deploy.md). </details> Have another question? Click **Ask AI** on any page, or connect this site's [MCP server](https://docs.butterix.com/en/guides/features/agents.md#site-mcp-server) to your editor. --- # Components overview > Categorized index of every ButterIX MDX component — callouts and labels, layout, tabs and disclosure, content, buttons and links, code, API, and utility components, one page each, plus conventions shared by all components. Components are written directly in MDX — **no `import` needed**. Every component renders to static HTML at build time, and interactivity (switching tabs, copying, collapsing…) is provided by ButterIX' browser script. ```mdx <Note>This is a note.</Note> <CardGroup cols={2}> <Card title="Quickstart" icon="lucide:rocket" href="/guides/get-started/quickstart">Up and running in five minutes</Card> <Card title="API reference" icon="lucide:code" href="/api-reference">Every endpoint</Card> </CardGroup> ``` > **Note** > > This is a note. [**Quickstart**](https://docs.butterix.com/en/guides/get-started/quickstart.md) Up and running in five minutes [**API reference**](https://docs.butterix.com/en/api-reference.md) Every endpoint ## Index by category ### Callouts and labels [**Callouts**](https://docs.butterix.com/en/components/callout.md) `<Callout>` [**Banner**](https://docs.butterix.com/en/components/banner.md) `<Banner>` [**Badge**](https://docs.butterix.com/en/components/badge.md) `<Badge>` [**Tooltip**](https://docs.butterix.com/en/components/tooltip.md) `<Tooltip>` ### Layout [**Cards**](https://docs.butterix.com/en/components/card.md) `<Card>` [**Tile**](https://docs.butterix.com/en/components/tile.md) `<Tile>` [**Columns**](https://docs.butterix.com/en/components/columns.md) `<Columns>` [**Aside**](https://docs.butterix.com/en/components/aside.md) `<Aside>` [**Indent**](https://docs.butterix.com/en/components/indent.md) `<Indent>` [**Frame**](https://docs.butterix.com/en/components/frame.md) `<Frame>` ### Tabs and disclosure [**Tabs**](https://docs.butterix.com/en/components/tabs.md) `<Tabs>` [**Steps**](https://docs.butterix.com/en/components/steps.md) `<Steps>` [**Accordion**](https://docs.butterix.com/en/components/accordion.md) `<Accordion>` [**Expandable**](https://docs.butterix.com/en/components/expandable.md) `<Expandable>` [**Versions**](https://docs.butterix.com/en/components/versions.md) `<Versions>` [**Scroll walkthrough**](https://docs.butterix.com/en/components/scroll-walkthrough.md) `<ScrollWalkthrough>` ### Content [**Table**](https://docs.butterix.com/en/components/table.md) `<Table>` [**Files**](https://docs.butterix.com/en/components/files.md) `<Files>` [**Prompt**](https://docs.butterix.com/en/components/prompt.md) `<Prompt>` [**Update**](https://docs.butterix.com/en/components/update.md) `<Update>` [**Color**](https://docs.butterix.com/en/components/color.md) `<Color>` [**Icon**](https://docs.butterix.com/en/components/icon.md) `<Icon>` [**Video**](https://docs.butterix.com/en/components/video.md) `<Video>` [**Live Photo**](https://docs.butterix.com/en/components/live-photo.md) `<LivePhoto>` [**Image compare**](https://docs.butterix.com/en/components/image-compare.md) `<ImageCompare>` [**Embed**](https://docs.butterix.com/en/components/embed.md) `<Embed>` ### Buttons and links [**Button**](https://docs.butterix.com/en/components/button.md) `<Button>` [**GitHub repo**](https://docs.butterix.com/en/components/github-repo.md) `<GitHub.Repo>` [**Copy**](https://docs.butterix.com/en/components/copy.md) `<Copy>` [**Download**](https://docs.butterix.com/en/components/download.md) `<Download>` [**Anchor**](https://docs.butterix.com/en/components/anchor.md) `<Anchor>` ### Code [**Code group**](https://docs.butterix.com/en/components/code-group.md) `<CodeGroup>` [**Code block**](https://docs.butterix.com/en/components/code-block.md) `<CodeBlock>` [**Code from files**](https://docs.butterix.com/en/components/code.md) `<Code>` ### API [**Parameter field**](https://docs.butterix.com/en/components/param-field.md) `<ParamField>` [**Response field**](https://docs.butterix.com/en/components/response-field.md) `<ResponseField>` [**Endpoint request snippet**](https://docs.butterix.com/en/components/endpoint-request-snippet.md) `<EndpointRequestSnippet>` [**Endpoint response snippet**](https://docs.butterix.com/en/components/endpoint-response-snippet.md) `<EndpointResponseSnippet>` [**Endpoint schema snippet**](https://docs.butterix.com/en/components/endpoint-schema-snippet.md) `<EndpointSchemaSnippet>` [**Webhook payload snippet**](https://docs.butterix.com/en/components/webhook-payload-snippet.md) `<WebhookPayloadSnippet>` [**Schema**](https://docs.butterix.com/en/components/schema.md) `<Schema>` [**Runnable endpoint**](https://docs.butterix.com/en/components/runnable-endpoint.md) `<RunnableEndpoint>` ### Utilities [**Markdown snippets**](https://docs.butterix.com/en/components/markdown.md) `<Markdown>` [**Conditional rendering**](https://docs.butterix.com/en/components/if.md) `<If>` ## Shared conventions <details open> <summary>Props must be literals</summary> Strings go in quotes (`title="Quickstart"`), other values in braces (`cols={2}`, `defaultOpen`, `tags={["AI"]}`). Functions and variable expressions aren't allowed (except `+` concatenation and constants declared with `export const`). See [Safe subset](https://docs.butterix.com/en/guides/writing/safe-mdx.md). </details> <details> <summary>Common aliases work</summary> Every component registers its common aliases, e.g. `<CodeGroup>` / `<CodeBlocks>` / `<CodeTabs>`, `<Files>` / `<Tree>`, `<Accordion>` / `<Collapse>`. Props accept common aliases too, e.g. `<Card src>` and `<Card img>`. </details> <details> <summary>Icons</summary> Every `icon` prop accepts a Font Awesome name (`rocket`, `fa-solid fa-bolt`, `fa-brands fa-github`), `lucide:<name>`, an image URL, or an inline `<svg>`; see [Available icons](https://docs.butterix.com/en/components/icon.md#available-icons). Icons are bundled into a per-page sprite at build time. </details> <details> <summary>className</summary> Most components accept `className`, for custom styling together with `css` in `docs.yml`. </details> <details> <summary>Markdown versions</summary> Every component defines a conversion to Markdown (for example, callouts become blockquotes and tabs expand into subsections), so each page's `.md` version and `llms-full.txt` stay readable. </details> ## View from the terminal ```bash biti components # list components, aliases, and props by category biti components --json # machine-readable, good for coding agents ``` The dashboard's visual editor uses the same manifest to generate its props panel; the API is [`GET /components`](https://docs.butterix.com/en/api-reference/editor/list-components.md). --- # Callouts > <Callout> and its aliases <Note>, <Info>, <Warning>, <Tip>… highlight important information with color and an icon. Highlight important information with color and an icon. Most of the time you'll use an alias directly: ```mdx <Note>Note: additional context.</Note> <Info>Info: general information.</Info> <Tip>Tip: a practical tip.</Tip> <Check>Check: done, or the recommended approach.</Check> <Success>Success: the operation succeeded.</Success> <Warning>Warning: a risk to watch out for.</Warning> <Error>Error: an error or destructive operation.</Error> <Launch>Launch: a new feature release.</Launch> ``` > **Note** > > Note: additional context. > **Info** > > Info: general information. > **Tip** > > Tip: a practical tip. > **Check** > > Check: done, or the recommended approach. > **Success** > > Success: the operation succeeded. > **Warning** > > Warning: a risk to watch out for. > **Error** > > Error: an error or destructive operation. > **Launch** > > Launch: a new feature release. ## Titles, icons, and rich content Callouts can contain any Markdown and components: ````mdx <Callout intent="warning" title="Deleting a site can't be undone" icon="lucide:trash-2"> Once deleted, all deployments, domain mappings, and analytics data are permanently erased. ```bash curl -X DELETE https://api.butterix.com/v1/sites/acme-payments -H "Authorization: Bearer $TOKEN" ``` </Callout> ```` > **Deleting a site can't be undone** > > Once deleted, all deployments, domain mappings, and analytics data are permanently erased. > > ```bash > curl -X DELETE https://api.butterix.com/v1/sites/acme-payments -H "Authorization: Bearer $TOKEN" > ``` Write `icon={false}` when you don't want an icon: ```mdx <Info icon={false}>A callout without an icon.</Info> ``` > **Info** > > A callout without an icon. ## Props - `intent` (note | info | warning | success | error | tip | check | launch | danger, default: info): Color and default icon. `type` and `variant` are also accepted as the prop name. `danger` is the same as `error`. Set automatically when you use an alias. - `title` (string): Bold title above the content. - `icon` (icon): Custom icon; `icon={false}` hides it. Chosen by `intent` by default. - `iconType` (solid | regular | brands, default: solid): The Font Awesome style to use when `icon` is just a name: `solid`, `regular` (outline) or `brands`; `light`, `thin` and `duotone` show as outline. No effect when `icon` has full class names (such as `fa-regular fa-bell`) or is a `lucide:` icon. - `color` (color): Custom color (`#hex`), mapped to the closest `intent`. - `className` (string): Extra CSS classes. ## Aliases | Syntax | Equivalent to | | ----------- | ------------------------------------------- | | `<Note>` | `<Callout intent="note">` | | `<Info>` | `<Callout intent="info">` | | `<Warning>` | `<Callout intent="warning">` | | `<Tip>` | `<Callout intent="tip">` | | `<Check>` | `<Callout intent="check">` | | `<Success>` | `<Callout intent="success">` | | `<Error>` | `<Callout intent="error">` | | `<Danger>` | `<Callout intent="danger">` (same as error) | | `<Launch>` | `<Callout intent="launch">` | In the page's Markdown version, callouts are converted to blockquotes with a title. --- # Banner > <Banner> is an in-page notice bar for deprecations and migrations. An in-page notice bar, good for flagging deprecations or migrations at the top of a page. For site-wide announcements, use [`announcement`](https://docs.butterix.com/en/guides/configuration/docs-yml.md#announcement-bar) in `docs.yml`. ```mdx <Banner dismissible variant="subtle"> This in-page notice can be dismissed, and it stays hidden after a page refresh. </Banner> ``` > This in-page notice can be dismissed, and it stays hidden after a page refresh. - `dismissible` (boolean, default: false): Show a close button; the dismissed state is saved in the browser. - `variant` (solid | subtle, default: solid): `subtle` uses a light background. - `id` (string): Key for remembering the dismissed state; defaults to a hash of the content (so it reappears when the content changes). --- # Badge > <Badge> (alias <Pill>) is a small inline label for status, versions or methods. A small inline label (alias `<Pill>`): ```mdx <Badge intent="success">Stable</Badge> <Badge intent="warning" minimal>Beta</Badge> <Badge intent="error" outlined>Deprecated</Badge> <Badge intent="violet" icon="lucide:sparkles">AI</Badge> <Badge color="blue" shape="pill" size="sm">Pill</Badge> <Badge mono>v1.2.0</Badge> ``` `Stable` `Beta` `Deprecated` `AI` `Pill` `v1.2.0` - `intent` (success | note | tip | warning | error | info | launch | check | violet | orange, default: info): Color. - `color` (blue | green | yellow | orange | red | purple | gray | white | surface | …): Color name, mapped to the closest `intent` (blue→note, green→success, yellow→warning, red→error, purple→violet, gray / white / surface→info). - `minimal` (boolean, default: false): Light background. - `outlined` (boolean, default: false): Outlined style (`stroke` also works). - `size` (xs | sm | md | lg, default: md): Size. - `shape` (rounded | pill, default: rounded): Shape: `rounded` or `pill`. - `icon` (icon): Leading icon. - `mono` (boolean, default: false): Monospace font, good for version numbers. - `disabled` (boolean, default: false): Dimmed appearance. --- # Tooltip > <Tooltip> shows extra context on hover or keyboard focus. Shows a hint on mouse hover or keyboard focus, and on tap on touch screens: ```mdx Deployments are <Tooltip tip="A directory of static output that is never modified after it's built">immutable</Tooltip>, so rolling back just switches the <Tooltip tip="The deployment the site URL points to" headline="Production pointer" cta="Learn more" href="/guides/deploy/previews-and-rollbacks">production pointer</Tooltip>. ``` Deployments are immutable (A directory of static output that is never modified after it's built), so rolling back just switches the production pointer (The deployment the site URL points to). - `tip` (string | JSX, required): Tooltip content (`content` and `text` also work). - `side` (top | right | bottom | left, default: top): Preferred side; flips automatically near the viewport edge. - `sideOffset` (number, default: 6): Distance from the trigger text (pixels). - `headline` (string): Bold first line. - `cta` (string): Link text inside the tooltip. - `href` (url): Link target for `cta`. --- # Cards > <Card> and <CardGroup> for navigation and overviews, with icons, images and links. Cards are for navigation and overviews. Set `href` to make the whole card clickable; `<CardGroup>` (alias `<Cards>`) lays cards out in a 1–4 column grid that collapses to a single column on narrow screens. ```mdx <CardGroup cols={3}> <Card title="Quickstart" icon="lucide:rocket" href="/guides/get-started/quickstart"> Publish your first site in five minutes. </Card> <Card title="Components" icon="lucide:blocks" iconPosition="left"> Icon on the left. </Card> <Card title="Brand color" icon="lucide:palette" color="#7C5CFF"> Custom icon color. </Card> </CardGroup> ``` [**Quickstart**](https://docs.butterix.com/en/guides/get-started/quickstart.md) Publish your first site in five minutes. **Components** Icon on the left. **Brand color** Custom icon color. ## Images and horizontal cards ```mdx <CardGroup cols={2}> <Card title="Build pipeline" src="/assets/pipeline.svg" href="/guides/get-started/concepts"> From source files to static output. </Card> <Card title="Horizontal card" icon="lucide:terminal" horizontal arrow href="/guides/reference/cli" cta="View CLI"> horizontal, arrow, and cta. </Card> </CardGroup> ``` [**Build pipeline**](https://docs.butterix.com/en/guides/get-started/concepts.md) From source files to static output. [**Horizontal card**](https://docs.butterix.com/en/guides/reference/cli.md) horizontal, arrow, and cta. ## Card props - `title` (string): Card title. - `icon` (icon): Icon; can also be JSX (such as `<img />`). - `href` (url): Makes the whole card a link. Source file paths (`./quickstart.mdx`) are recommended. - `target` (string): Link target; external links default to `_blank`. - `iconPosition` (top | left, default: top): Icon position. - `iconSize` (number, default: 8): Icon size in 4px steps (default 8 = 32px). - `color` (color): Icon color (for both light and dark mode). - `lightModeColor / darkModeColor` (color): Icon color for light / dark mode respectively. - `src` (url): Card image (`img` and `image` also work). - `imagePosition` (top | left | right | bottom, default: top): Image position. - `imageWidth / imageHeight` (string): Image size, e.g. `200px`, `50%`. - `horizontal` (boolean, default: false): Compact horizontal layout: icon and title on one line. - `cta` (string): Call-to-action text at the bottom of the card, such as "Read the docs". - `arrow` (boolean): Show an arrow in the top-right corner. - `iconType` (solid | regular | brands, default: solid): The Font Awesome style to use when `icon` is just a name: `solid`, `regular` (outline) or `brands`; `light`, `thin` and `duotone` show as outline. No effect when `icon` has full class names (such as `fa-regular fa-bell`) or is a `lucide:` icon. ## CardGroup props - `cols` (number, default: 2): Number of columns, 1–4 (`columns` also works). --- # Tile > <Tile> is a link card with a preview area, for showcasing examples, templates or integrations. A link card with a preview area, good for showcasing examples, templates, or integrations: ```mdx <Columns cols={2}> <Tile href="/guides/features/agents" title="Agent-friendly" description=".md, llms.txt, and MCP"> ![](/assets/favicon.svg) </Tile> <Tile href="/api-reference" title="Platform API" img="/assets/pipeline.svg" description="Generated from OpenAPI" /> </Columns> ``` [**Agent-friendly**](https://docs.butterix.com/en/guides/features/agents.md) — .md, llms.txt, and MCP [**Platform API**](https://docs.butterix.com/en/api-reference.md) — Generated from OpenAPI - `href` (url, required): Link target. - `title` (string): Title below the preview. - `description` (string): Description text. - `img` (url): Preview image (`src` and `image` also work). When not set, the children become the preview area. --- # Columns > <Columns> (alias <Grid>) and <Column> form a 1–4 column layout that stacks on narrow screens. A general-purpose multi-column layout (alias `<Grid>`), 1–4 columns, collapsing on narrow screens: ```mdx <Columns cols={2}> <Column> **Left column**: any Markdown and components. </Column> <Column> **Right column**: code blocks, images… </Column> </Columns> ``` **Left column**: any Markdown and components. **Right column**: code blocks, images… - `cols` (number, default: 2): Number of columns, 1–4 (`columns` also works). - `widths` (string): Column widths separated by spaces: numbers are proportions (`2 1` → two thirds / one third), `*` an equal share, or lengths such as `40%` / `320px`. Applies from 768px wide; narrower screens stack as usual. In the visual editor, drag the gap between columns to resize (columns to the right scale proportionally); double-click for equal widths. ## Custom column widths ```mdx <Columns widths="2 1"> <Column>**Two thirds**: body text, code samples…</Column> <Column>**One third**: side notes</Column> </Columns> ``` **Two thirds**: body text, code samples… **One third**: side notes --- # Aside > <Aside> and <Panel> place content beside the text on wide screens and keep it in view while scrolling. `<Aside>` (aliases `<Panel>`, `<RightPanel>`) places content to the right of the body and keep it visible while scrolling (on wide screens); on narrow screens it shows in place. Good for code or notes that accompany the body text. ````mdx <Aside> ```bash biti deploy --preview ``` </Aside> ```` --- # Indent > <Indent> indents a block of content, optionally with a guide line. Indents content by 16px; `line` shows a guide line: ```mdx <Indent line> Indented content, often used to show hierarchy. </Indent> ``` Indented content, often used to show hierarchy. - `line` (boolean, default: false): Show a guide line on the left. --- # Frame > <Frame> (alias <Figure>) adds a border and caption to images, videos or embeds. For more on image paths, sizing, and asset copying, see [Images and media](https://docs.butterix.com/en/guides/writing/media.md). Adds a border and caption to an image, video, or embed (alias `<Figure>`): ```mdx <Frame caption="The ButterIX build pipeline" hint="Click the image to zoom"> ![Build pipeline](/assets/pipeline.svg) </Frame> ``` > Click the image to zoom ![Build pipeline](https://docs.butterix.com/_biti/files/assets/pipeline.svg) _The ButterIX build pipeline_ - `caption` (string): Caption below the media. - `background` (default | subtle, default: default): `subtle` uses a soft background color. - `hint` (string): Hint above the frame. --- # Tabs > <Tabs> (alias <TabGroup>) and <Tab> put parallel content into tabs, with the selection synced across pages. Put parallel content in tabs (alias `<TabGroup>`). Switching works even without JavaScript. ````mdx <Tabs> <Tab title="macOS" icon="fa-brands fa-apple"> ```bash brew install node ``` </Tab> <Tab title="Windows" icon="fa-brands fa-windows"> Download the installer from nodejs.org. </Tab> <Tab title="Linux" icon="fa-brands fa-linux"> Use your distribution's package manager, or nvm. </Tab> </Tabs> ```` **macOS** ```bash brew install node ``` **Windows** Download the installer from nodejs.org. **Linux** Use your distribution's package manager, or nvm. ## Cross-page sync There are three ways to sync. The selection is saved in the browser and still applies when you visit other pages: | Syntax | Sync scope | | ------------------------- | -------------------------------------------------------------------------------------- | | `<Tab language="python">` | Syncs with every code group, API example, and tab of the same language across the site | | `<Tabs group="os">` | Syncs with tabs across the site that have the same `group` and the same title | | `<Tabs sync>` | Syncs by title with every tab that sets `sync` | The two tab sets below share `group="os"`; switch one and the other follows: **macOS** First set: macOS **Linux** First set: Linux **macOS** Second set: macOS **Linux** Second set: Linux ## Tabs props - `group` (string): Sync group (`syncKey` and `groupId` also work). - `sync` (boolean, default: false): Sync by title with every tab that sets `sync`. - `defaultTabIndex` (number, default: 0): Initially selected tab (zero-based; `defaultIndex` also works). ## Tab props - `title` (string, required): Tab label. - `language` (string): Shares a sync key with code blocks of the same language across the site. - `icon` (icon): Icon before the label. - `id` (string): Panel id; visiting `#id` selects this tab automatically. --- # Steps > <Steps> and <Step> are numbered procedures that can be listed in the table of contents. Numbered procedural steps: ````mdx <Steps> <Step title="Install"> ```bash npm install -g bitidocs ``` </Step> <Step title="Create a project"> Run `biti init my-docs`. </Step> <Step title="Deploy" icon="lucide:rocket"> Run `biti deploy`. The icon replaces the number. </Step> </Steps> ```` ### Install ```bash npm install -g bitidocs ``` ### Create a project Run `biti init my-docs`. ### Deploy Run `biti deploy`. The icon replaces the number. ## Steps from headings When you write Markdown headings directly inside `<Steps>`, each heading starts a new step, and these steps appear in the table of contents on the right: ```mdx <Steps> ### Set up your environment Install Node.js 22.13 or later. ### Initialize Run `biti init`. </Steps> ``` ### Set up your environment Install Node.js 22.13 or later. ### Initialize Run `biti init`. ## Steps props - `titleSize` (p | h2 | h3): Size of step titles, default `p` (same size as body text). - `toc` (boolean, default: false): Also list `<Step title>` steps in the table of contents. Heading-based steps always appear in the table of contents. - `tocDepth` (number): Level of steps in the table of contents, 1–3. ## Step props - `title` (string): Step title. - `id` (string): Anchor id; generated from the title by default. - `icon` (icon): Use an icon instead of the number. - `stepNumber` (number): Explicit step number. - `titleSize` (p | h2 | h3): Size of this step's title. --- # Accordion > <Accordion> and <AccordionGroup> are content blocks that start collapsed. Collapsible content built on native `<details>`, so it works without JavaScript. `<AccordionGroup>` merges several accordions into one bordered group. ```mdx <AccordionGroup> <Accordion title="Which package managers are supported?" icon="lucide:package" defaultOpen> npm, pnpm, and yarn can all install `bitidocs` globally. </Accordion> <Accordion title="Which Node.js version do I need?" description="A line of text below the title"> 22.13 or later. </Accordion> <Accordion title="Can only one be open at a time?" name="faq"> Give accordions in the same group the same `name`; opening one automatically closes the others. </Accordion> </AccordionGroup> ``` <details open> <summary>Which package managers are supported?</summary> npm, pnpm, and yarn can all install `bitidocs` globally. </details> <details> <summary>Which Node.js version do I need?</summary> 22.13 or later. </details> <details> <summary>Can only one be open at a time?</summary> Give accordions in the same group the same `name`; opening one automatically closes the others. </details> ## Accordion props - `title` (string, required): Title. - `description` (string): Subtitle below the title. - `defaultOpen` (boolean, default: false): Open by default (`open` also works). - `icon` (icon): Icon before the title. - `id` (string): Anchor id, generated from the title by default; visiting `#id` opens it automatically. - `name` (string): Exclusive group name: only one accordion with the same name is open at a time. Alias: `<Collapse>`. --- # Expandable > <Expandable> collapses nested fields or secondary content. Collapses a list of nested fields, usually inside `<ParamField>` or `<ResponseField>`: ```mdx <ResponseField name="domain" type="object"> The domain object. <Expandable title="Properties"> <ResponseField name="domain" type="string">Full domain name.</ResponseField> <ResponseField name="verified" type="boolean">Whether it's verified.</ResponseField> </Expandable> </ResponseField> ``` - `domain` (object): The domain object. - `domain` (string): Full domain name. - `verified` (boolean): Whether it's verified. - `title` (string): Button text; defaults to "Show N properties". - `defaultOpen` (boolean, default: false): Open by default (`open` also works). --- # Versions > <Versions> and <Version> add an in-page version switcher. An in-page version switcher; the selected version is stored in the `?v=` parameter. For examples and details see [Versions › In-page versions](https://docs.butterix.com/en/guides/features/versions.md#in-page-versions-the-versions-component). - `Versions › paramName` (string, default: v): Name of the query parameter that stores the selection. - `Version › version` (string, required): Unique id, shown in the URL. - `Version › title` (string): Name in the dropdown; defaults to `version`. - `Version › default` (boolean, default: false): Shown when the URL has no version parameter. --- # Scroll walkthrough > <ScrollWalkthrough> (alias <Walkthrough>) explains code as the reader scrolls; the code panel follows the current step. A scroll-driven walkthrough (alias `<Walkthrough>`): steps on the left, and on the right a code panel that highlights along with the current step. Each fenced code block is a file in the panel (the text after the language is the file name). ````mdx <ScrollWalkthrough> <Step title="Create the client" file="deploy.ts" focus="1-3"> Read the API key and platform URL. </Step> <Step title="Upload" focus="5-10"> Upload the source as a gzip tarball and get back a deployment id. </Step> <Step title="Wait for completion" focus="12-17"> Poll the status every second until it's ready or failed. </Step> ```ts deploy.ts const api = process.env.BITI_API ?? "https://console.butterix.com"; … ``` </ScrollWalkthrough> ```` ### Create the client Read the API key and platform URL. ### Upload Upload the source as a gzip tarball and get back a deployment id. ### Wait for completion Poll the status every second until it's ready or failed. ```ts deploy.ts const api = process.env.BITI_API ?? "https://console.butterix.com"; const token = process.env.BITI_TOKEN!; const headers = { authorization: `Bearer ${token}` }; const res = await fetch(`${api}/api/v1/sites/acme-payments/deployments`, { method: "POST", headers: { ...headers, "content-type": "application/gzip", "x-biti-preview": "1" }, body: await readFile("site.tgz"), }); const { id } = await res.json(); for (;;) { await new Promise((r) => setTimeout(r, 1000)); const d = await (await fetch(`${api}/api/v1/deployments/${id}`, { headers })).json(); if (d.status === "ready") { console.log(d.url); break; } if (d.status === "failed") throw new Error(d.error); } ``` - `layout` (default | wide, default: default): `wide` makes the code panel wider. - `panelHeight` (string): Height of the code panel, e.g. `32rem`. - `stickyHeaders` (boolean, default: true): Keep step titles fixed while substeps scroll. - `dim` (boolean, default: true): Dim steps that aren't current. - `substepStyle` (step | bullet, default: step): Number substeps or use bullets. Here `<Step>` additionally supports `file` (a file name or zero-based index), `focus`, `highlight`, and `startLine`; inside a step you can nest `<Substep title file focus highlight startLine id>` (alias `<SubStep>`) for finer breakdowns. --- # Table > <Table> and Markdown tables: column widths, horizontal scrolling, sticky header and first column, search and pagination. Wraps a Markdown table (or an HTML table) to control column widths, minimum width, and a sticky header / first column. Tables work without it too: Markdown tables estimate column widths from their content and scroll horizontally when they don't fit. ## Column widths `widths` lists one width per column, separated by spaces: numbers are px, and `12rem`, `30%` or `auto` work too; `*` leaves a column unspecified. Columns not listed share the remaining width. `layout="equal"` makes all columns the same width; `layout="content"` lets the browser lay them out by content. ```mdx <Table widths="160px * 80px 80px"> | Status | Meaning | Cancelable | Promotable | |---|---|---|---| | queued | Waiting | Yes | No | | building | Building | No | No | | ready | Succeeded | No | Yes | | failed | Failed | No | No | | canceled | Canceled | No | No | </Table> ``` | Status | Meaning | Cancelable | Promotable | | -------- | --------- | ---------- | ---------- | | queued | Waiting | Yes | No | | building | Building | No | No | | ready | Succeeded | No | Yes | | failed | Failed | No | No | | canceled | Canceled | No | No | ## Skins `skin` gives a table another look; all of them work in light and dark mode. Without it, tables are plain: no frame and no background, just row lines. You can also choose one in the visual editor's table settings, where hovering a skin tries it on the table in the page. ```mdx <Table skin="framed"> | Parameter | Type | Default | |---|---|---| | `region` | string | `ap-sh` | </Table> ``` **Framed** | Parameter | Type | Default | | --------- | ------ | ------- | | `region` | string | `ap-sh` | | `timeout` | number | `30` | | `retries` | number | `3` | **Striped** | Parameter | Type | Default | | --------- | ------ | ------- | | `region` | string | `ap-sh` | | `timeout` | number | `30` | | `retries` | number | `3` | **Grid** | Parameter | Type | Default | | --------- | ------ | ------- | | `region` | string | `ap-sh` | | `timeout` | number | `30` | | `retries` | number | `3` | **Card** | Parameter | Type | Default | | --------- | ------ | ------- | | `region` | string | `ap-sh` | | `timeout` | number | `30` | | `retries` | number | `3` | **Minimal** | Parameter | Type | Default | | --------- | ------ | ------- | | `region` | string | `ap-sh` | | `timeout` | number | `30` | | `retries` | number | `3` | **Three rules** | Parameter | Type | Default | | --------- | ------ | ------- | | `region` | string | `ap-sh` | | `timeout` | number | `30` | | `retries` | number | `3` | **Accent** | Parameter | Type | Default | | --------- | ------ | ------- | | `region` | string | `ap-sh` | | `timeout` | number | `30` | | `retries` | number | `3` | **Inverted header** | Parameter | Type | Default | | --------- | ------ | ------- | | `region` | string | `ap-sh` | | `timeout` | number | `30` | | `retries` | number | `3` | **Soft** | Parameter | Type | Default | | --------- | ------ | ------- | | `region` | string | `ap-sh` | | `timeout` | number | `30` | | `retries` | number | `3` | ## Tables wider than the page `minWidth` makes the table wider than the page column so it scrolls horizontally; the side that can still scroll shows a shadow. ```mdx <Table minWidth="960px"> | Parameter | Type | Required | Default | Range | Since | Description | |---|---|:---:|---|---|---|---| | `timeout` | number | No | `30` | 1–600 | v1.2 | Per-request timeout in seconds; retried automatically on timeout | | `region` | string | Yes | – | `cn` / `us` / `eu` | v1.0 | Data region; cannot be changed after creation | | `retries` | number | No | `3` | 0–10 | v1.4 | Maximum retries after a failure, with exponential backoff | </Table> ``` | Parameter | Type | Required | Default | Range | Since | Description | | --------- | ------ | :------: | ------- | ------------------ | ----- | ---------------------------------------------------------------- | | `timeout` | number | No | `30` | 1–600 | v1.2 | Per-request timeout in seconds; retried automatically on timeout | | `region` | string | Yes | – | `cn` / `us` / `eu` | v1.0 | Data region; cannot be changed after creation | | `retries` | number | No | `3` | 0–10 | v1.4 | Maximum retries after a failure, with exponential backoff | ## Sticky header and first column ```mdx <Table stickyHeader stickyFirstColumn maxHeight="240px"> | Status | Meaning | Cancelable | Promotable | |---|---|---|---| | queued | Waiting | Yes | No | | building | Building | No | No | | ready | Succeeded | No | Yes | | failed | Failed | No | No | | canceled | Canceled | No | No | </Table> ``` | Status | Meaning | Cancelable | Promotable | | -------- | --------- | ---------- | ---------- | | queued | Waiting | Yes | No | | building | Building | No | No | | ready | Succeeded | No | Yes | | failed | Failed | No | No | | canceled | Canceled | No | No | ## Search and pagination `searchable` adds a search box above the table that filters rows as you type (case-insensitive); `paginate` splits rows into pages of `pageSize`, and `expandable` swaps the page controls for a “Show all / Show fewer” toggle. Filtering happens before pagination. ```mdx <Table searchable paginate pageSize={4} placeholder="Search regions"> | Region | Location | |---|---| | cn-north | North China | | cn-east | East China | | cn-south | South China | | ap-hk | Hong Kong | | ap-sg | Singapore | | us-west | US West | | us-east | US East | | eu-central | Frankfurt | </Table> ``` | Region | Location | | ---------- | ----------- | | cn-north | North China | | cn-east | East China | | cn-south | South China | | ap-hk | Hong Kong | | ap-sg | Singapore | | us-west | US West | | us-east | US East | | eu-central | Frankfurt | - `widths` (string): Column widths separated by spaces, e.g. `160px 30% auto *`. Numbers are px, `*` leaves a column unspecified; once set, unlisted columns share the remaining width. - `layout` (smart | equal | content, default: smart): `smart` estimates from content (same content, same width); `equal` gives equal widths; `content` uses the browser's automatic layout. - `minWidth` (string): Minimum table width, e.g. `960px`. Wider than the page column → horizontal scrolling (also accepts `min-width`). - `stickyHeader` (boolean, default: false): Keep the header row visible while scrolling vertically (also accepts `sticky`). - `stickyFirstColumn` (boolean, default: false): Keep the first column visible while scrolling horizontally (also accepts `sticky-first`). - `maxHeight` (string): Scroll viewport height when the header is sticky, default `min(70vh, 600px)`. - `searchable` (boolean, default: false): Show a search box above the table that filters rows. - `placeholder` (string, default: Search...): Search box placeholder. - `paginate` (boolean, default: false): Split rows into pages with previous / next controls. - `pageSize` (number, default: 10): Rows per page. - `expandable` (boolean, default: false): With `paginate`: a “Show all / Show fewer” toggle instead of page controls. - `skin` (default | framed | striped | bordered | card | minimal | academic | accent | contrast | soft, default: default): Look: `framed` frame with a tinted header, `striped` zebra rows, `bordered` full grid, `card` raised card, `minimal` only the header rule, `academic` three rules, `accent` header in the brand color, `contrast` inverted header, `soft` rows as rounded bars. > **Note** > > `<StickyTable>`, `<SearchableTable>`, `<StickySearchableTable>`, `<PaginatedTable>` and `<PaginatedSearchableTable>` all work and equal `<Table>` with the matching switches on; the HTML form `<table sticky searchable paginate pageSize={6} expandable>` works too. For merged cells, see [Markdown syntax › Merged cells](https://docs.butterix.com/en/guides/writing/markdown.md#merged-cells). --- # Files > <Files> (alias <Tree>) is a collapsible file tree. A collapsible file tree (aliases `<Tree>`, `<FileTree>`; `<Tree.Folder>` and `<Tree.File>` work too): ```mdx <Files> <Folder name="my-docs" defaultOpen> <File name="docs.yml" highlighted comment="site config" /> <Folder name="pages" defaultOpen> <File name="introduction.mdx" href="/guides/get-started/introduction" /> </Folder> <Folder name="assets"> <File name="logo.svg" /> </Folder> </Folder> </Files> ``` ``` my-docs/ docs.yml pages/ introduction.mdx assets/ logo.svg ``` Props shared by `<Folder>` and `<File>`: - `name` (string, required): Displayed name. - `href` (url): Makes the name a link. - `highlighted` (boolean, default: false): Accent-colored background. - `comment` (string): Monospace comment after the name (shown starting with `#`). - `icon` (icon): Custom icon. - `defaultOpen` (boolean, default: false): `<Folder>` only: open by default (`open` also works). --- # Prompt > <Prompt> is a prompt block readers can copy or open in AI tools. A prompt that readers can copy or open in an AI tool in one click: ```mdx <Prompt title="Have AI write your docs.yml" actions={["claude", "chatgpt", "cursor"]}> Read https://docs.butterix.com/llms.txt and generate a ButterIX docs.yml for my Express API project with two tabs: "Guides" and "API reference". </Prompt> ``` **Have AI write your docs.yml** ```text Read <https://docs.butterix.com/llms.txt> and generate a ButterIX docs.yml for my Express API project with two tabs: "Guides" and "API reference". ``` - `title` (string): Title row; when set, the action buttons move into the title row. - `icon` (icon): Icon to the left of the prompt. - `actions` (array): The built-in `"claude"`, `"chatgpt"`, `"cursor"`, or `{ label, url, icon }` (`url` can use a `{prompt}` placeholder). The first is the primary button and the rest go into a dropdown; the copy button is always present. - `hidePrompt` (boolean, default: false): Show only the title row (requires `title`). - `singleLine` (boolean, default: false): Truncate the body to one line. --- # Update > <Update> is a single changelog entry with a sticky label column. A single update entry with a fixed label column on the left. Good for version history on regular pages; for a full changelog (timeline, tag filtering, RSS), use the [changelog](https://docs.butterix.com/en/guides/configuration/changelog.md). ```mdx <Update label="2026-11-20" description="v1.0" tags={["AI", "MCP"]}> Every site comes with its own MCP server. </Update> <Update label="2026-10-15" description="v0.9" tags={["i18n"]}> Added incremental translation with `biti translate`. </Update> ``` ## 2026-11-20 _v1.0_ Every site comes with its own MCP server. ## 2026-10-15 _v0.9_ Added incremental translation with `biti translate`. - `label` (string, required): Date or version; also the default anchor. - `description` (string): Description below the label. - `tags` (string[]): Tags shown as badges. - `id` (string): Custom anchor. - `rss` (object): Accepted, but has no effect. --- # Color > <Color> (alias <Colors>) shows color swatches that copy on click. A color palette; click a value to copy it (alias `<Colors>`): ```mdx <Color> <Color.Item name="Brand purple" value="#7C5CFF" /> <Color.Item name="Dark mode" value="#9E8AFF" /> <Color.Item name="Adaptive" value={{ light: "#16131F", dark: "#EDEDF0" }} /> </Color> ``` - **Brand purple**: `#7C5CFF` - **Dark mode**: `#9E8AFF` - **Adaptive**: `#16131F` / `#EDEDF0` With `variant="table"`, colors are organized into titled rows: ```mdx <Color variant="table"> <Color.Row title="Accent"> <Color.Item name="Light" value="#7C5CFF" /> <Color.Item name="Dark" value="#9E8AFF" /> </Color.Row> </Color> ``` **Accent** - **Light**: `#7C5CFF` - **Dark**: `#9E8AFF` - `Color › variant` (compact | table, default: compact): Grid, or titled rows. - `Color.Row › title` (string): Row title. - `Color.Item › value` (string | { light, dark }, required): A CSS color, or separate values for light and dark mode. - `Color.Item › name` (string): Name below the swatch. --- # Icon > <Icon> renders an inline icon from Font Awesome, Lucide, an image or SVG. An inline icon that scales with the text: ```mdx <Icon icon="lucide:rocket" /> <Icon icon="fa-solid fa-bolt" color="#F5A524" /> <Icon icon="lucide:heart" size={6} lightModeColor="#E5484D" darkModeColor="#FF6369" /> <Icon icon="fa-brands fa-github" size={32} /> ``` ## Available icons Every `icon` prop, and the `icon` of navigation entries and pages, is written the same way: | Source | Written as | Count | | ----------------------------------------------------------------- | -------------------------------------------------------------------- | ----------- | | [Lucide](https://lucide.dev/icons) | `lucide:rocket` | About 2,100 | | [Font Awesome Free](https://fontawesome.com/search?ic=free) Solid | `fa-solid fa-rocket`, or just `rocket` | About 1,400 | | Font Awesome Free Regular | `fa-regular fa-bell` | About 170 | | Font Awesome Free Brands | `fa-brands fa-github` | About 570 | | Image | `https://…`, or a file in the repository such as `./assets/icon.svg` | — | | SVG | `<svg …>…</svg>` | — | A name on its own is looked up in Solid, Regular, Brands and then Lucide. Icons in the navigation can also sit in an outlined square; see [Icon style](https://docs.butterix.com/en/guides/configuration/navigation.md#icon-style). In the visual editor there are no names to remember: click the icon field, search, narrow by source and pick one, or paste an image URL or SVG. ## Props - `icon` (icon, required): A Font Awesome name, `lucide:<name>`, an image URL, or `<svg>`. - `size` (number | string): Up to 12 it counts in 4px steps (`4` = 16px); above 12 it's pixels; CSS lengths are used as is. - `color` (color): Color (for both light and dark mode). - `lightModeColor / darkModeColor` (color): Color for light / dark mode respectively. - `iconType` (solid | regular | brands, default: solid): The Font Awesome style to use when `icon` is just a name: `solid`, `regular` (outline) or `brands`; `light`, `thin` and `duotone` show as outline. No effect when `icon` has full class names (such as `fa-regular fa-bell`) or is a `lucide:` icon. --- # Video > <Video> embeds local files or YouTube, Vimeo, Loom and other hosted videos. For more on image paths, sizing, and asset copying, see [Images and media](https://docs.butterix.com/en/guides/writing/media.md). Video files use the native player; YouTube, Vimeo, and Loom links are converted to embedded players automatically: ```mdx <Video src="/assets/demo.mp4" poster="/assets/poster.png" /> <Video src="https://www.youtube.com/watch?v=VIDEO_ID" title="Product demo" ratio="16/9" /> <Video src="/assets/loop.mp4" autoplay loop controls={false} /> ``` - `src` (url, required): A video file or a YouTube / Vimeo / Loom URL. - `poster` (url): Poster image. - `title` (string): Accessible title. - `controls` (boolean, default: true): Show the controls. - `autoplay` (boolean, default: false): Autoplay (muted automatically; `autoPlay` also works). - `loop` (boolean, default: false): Loop playback. - `muted` (boolean, default: false): Muted. - `ratio` (string): Aspect ratio of the embedded player, e.g. `16/9`. --- # Live Photo > <LivePhoto> works like a Live Photo on iPhone: it shows the photo, and plays the video when you press and hold it or click the badge. Pair a photo with a short video (usually about 3 seconds). The photo is shown with a Live badge in the top-left corner: - **Press and hold the photo**: the video plays from the start, stops when you let go, and fades back to the photo. - **Click the badge**: plays the video once; click again to stop. You can also focus the badge with the keyboard and press Enter or Space. ```mdx <LivePhoto src="/assets/media/live.jpg" video="/assets/media/live.mp4" alt="A fractal slowly zooming in" /> ``` ![A fractal slowly zooming in](/assets/media/live.jpg) [Live Photo video](/assets/media/live.mp4) Take the photo from a frame in the middle of the video so the fade back at the end looks natural. The video loads as the component scrolls near, so it plays the moment you press. If the browser doesn't allow playback with sound, it plays muted. - `src` (url, required): The photo (`photo` and `image` also work). - `video` (url, required): The video file; MP4 (H.264) of a few seconds is best. - `alt` (string): Alternative text for the photo. - `width` (string): Display width: a number in pixels or a CSS length. Defaults to the full content width. - `muted` (boolean, default: false): Play without sound. --- # Image compare > <ImageCompare> stacks two images and lets you drag the divider left and right to compare them. The two images sit on top of each other: `before` is left of the divider, `after` is right of it. Drag the handle or click anywhere on the image to move the divider; on phones, drag sideways to compare and swipe up or down to scroll the page as usual. ```mdx <ImageCompare before="/assets/media/compare-before.jpg" after="/assets/media/compare-after.jpg" beforeLabel="Low-res" afterLabel="High-res" alt="The same image in low and high resolution" /> ``` ![Low-res](/assets/media/compare-before.jpg) ![High-res](/assets/media/compare-after.jpg) Both images should have the same aspect ratio; if they don't, `after` sets the size and `before` is cropped to fill it. The handle works with the keyboard: arrow keys move it 1%, with Shift 10%, and Home and End move it to either edge. When printed, the two images appear side by side. - `before` (url, required): The image left of the divider (`left` also works). - `after` (url, required): The image right of the divider (`right` also works). - `beforeLabel` (string): Label in the top-left corner; fades out as the divider gets close. - `afterLabel` (string): Label in the top-right corner; fades out as the divider gets close. - `alt` (string): Describes what the images compare; screen readers read it with the labels. - `position` (number, default: 50): Where the divider starts, in percent from the left (0–100). - `width` (string): Display width: a number in pixels or a CSS length. Defaults to the full content width. --- # Embed > <Embed> (alias <IFrame>) is a responsive iframe for live demos, designs or PDFs. A responsive iframe for embedding live demos, design files, or PDFs (alias `<IFrame>`), 16:9 by default: ```mdx <Embed src="https://example.com/demo" title="Live demo" ratio="4/3" /> <Embed src="/assets/whitepaper.pdf" title="Whitepaper" height="640px" /> ``` - `src` (url, required): URL of a page, video, or PDF (`url` also works). - `title` (string): Accessible title. - `ratio` (string): Aspect ratio, e.g. `16/9`, `4:3` (`aspectRatio` also works). - `height` (string): Fixed height, instead of an aspect ratio. - `allow` (string): The iframe's `allow` permission list. --- # Button > <Button> and <ButtonGroup> render link buttons or display-only buttons. A link button (with `href`) or a display-only button: ```mdx <ButtonGroup> <Button intent="primary" href="/guides/get-started/quickstart" rightIcon="lucide:arrow-right">Quickstart</Button> <Button outlined href="/api-reference" icon="lucide:code">API reference</Button> <Button minimal href="https://github.com" >GitHub</Button> </ButtonGroup> ``` [Quickstart](https://docs.butterix.com/en/guides/get-started/quickstart.md) [API reference](https://docs.butterix.com/en/api-reference.md) [GitHub](https://github.com) More styles: ```mdx <Button intent="success" small>Success</Button> <Button intent="warning" rounded>Warning</Button> <Button intent="danger" outlined>Danger</Button> <Button mono>biti deploy</Button> <Button disabled>Unavailable</Button> ``` Success Warning Danger biti deploy Unavailable - `intent` (none | primary | success | warning | danger): Color. Neutral when not set. - `href` (url): When set, renders as a link button. - `target` (string): Link target; external links default to `_blank`. - `text` (string): Button text (can also be written as children). - `icon / rightIcon` (icon): Left / right icon. - `outlined` (boolean, default: false): Outlined style. - `minimal` (boolean, default: false): Transparent background. - `small / large` (boolean, default: false): Size. - `rounded` (boolean, default: false): Fully rounded. - `mono` (boolean, default: false): Monospace font. - `full` (boolean, default: false): Full width. - `active` (boolean, default: false): Pressed state. - `disabled` (boolean, default: false): Disabled. `<ButtonGroup>` lays out several buttons in a row, wrapping when space runs out. --- # GitHub repo > <GitHub.Repo> is a card linking to a GitHub repository, without calling the GitHub API. A card linking to a GitHub repository (aliases `<GitHubRepo>`, `<GithubRepo>`). It doesn't call the GitHub API, so builds stay reproducible: ```mdx <GitHub.Repo repo="octocat/Hello-World" description="GitHub's example repository" /> ``` [octocat/Hello-World](https://github.com/octocat/Hello-World) - `repo` (string, required): `owner/name` or the full `https://github.com/owner/name`. - `variant` (inset | flat, default: inset): `flat` removes the shadow. - `description` (string): Description text. --- # Copy > <Copy> (alias <CopyText>) is inline text that copies on click. Inline text that copies on click (alias `<CopyText>`): ```mdx Platform API URL: <Copy icon>https://api.butterix.com/v1</Copy> Copy a command: <Copy clipboard="npm install -g bitidocs" icon>Install the CLI</Copy> ``` Platform API URL: `<https://api.butterix.com/v1>` Copy a command: `npm install -g bitidocs` - `clipboard` (string): Text to copy; defaults to the displayed text (`text` and `value` also work). - `icon` (boolean, default: false): Show a copy icon after the text. --- # Download > <Download> downloads a single file, or several files bundled as a ZIP. Download a single file, or bundle multiple files into a ZIP in the browser: ```mdx <Download src="/assets/logo.svg" filename="butterix-logo.svg"> <Button icon="lucide:download" outlined>Download logo (light)</Button> </Download> <Download sources={["/assets/logo.svg", "/assets/logo-dark.svg", "/assets/favicon.svg"]} filename="butterix-brand.zip"> <Button icon="lucide:package" outlined>Download brand kit</Button> </Download> ``` [Download logo (light)](https://docs.butterix.com/_biti/files/assets/logo.svg) [logo.svg](https://docs.butterix.com/_biti/files/assets/logo.svg), [logo-dark.svg](https://docs.butterix.com/_biti/files/assets/logo-dark.svg), [favicon.svg](https://docs.butterix.com/_biti/files/assets/favicon.svg) - `src` (url): A single file, relative to the current page or an absolute URL. Use either this or `sources`. - `sources` (string[]): Multiple URLs (or project paths), bundled into a ZIP in the browser; with only one, it downloads directly. - `filename` (string): Download file name; ZIPs default to `download.zip`. --- # Anchor > <Anchor> gives any content a linkable id that briefly highlights when targeted. Adds a linkable id to any content, briefly highlighted when targeted: ```mdx <Anchor id="api-key-format"> API keys start with `biti_` and have a fixed length. </Anchor> [Jump to the key format](#api-key-format) ``` API keys start with `biti_`. [Jump to the key format](#api-key-format) - `id` (string, required): Anchor id; link to it with `#id`. --- # Code group > <CodeGroup> (aliases <CodeBlocks>, <CodeTabs>) groups code blocks into tabs; the chosen language syncs site-wide. A tab group of multiple code blocks (aliases `<CodeBlocks>`, `<CodeTabs>`). Each code block's title becomes its tab label; the language a reader picks is synced across the site and remembered. ````mdx <CodeGroup> ```bash npm npm install -g bitidocs ``` ```bash pnpm pnpm add -g bitidocs ``` </CodeGroup> ```` ```bash npm npm install -g bitidocs ``` ```bash pnpm pnpm add -g bitidocs ``` `<CodeGroup>` has no props. The sync key defaults to the code block's language; use `for="…"` in the fence meta to define a custom sync group. --- # Code block > <CodeBlock> controls a code block's title, highlighting, focus, line numbers and collapsing with props. Most of the time a plain fenced code block is all you need; for meta syntax (titles, line highlighting, focus, max lines…) see [Code blocks](https://docs.butterix.com/en/guides/writing/code-blocks.md). Uses props instead of fence meta — handy when there are many options or you need `links`: ````mdx <CodeBlock title="client.ts" highlight="2" maxLines={0} links={{ "createClient": "/api-reference", "/get\\w+/": "/api-reference" }}> ```ts import { createClient } from "@acme/sdk"; const client = createClient({ apiKey: process.env.ACME_KEY }); const me = await client.getMe(); ``` </CodeBlock> ```` **client.ts** ```ts import { createClient } from "@acme/sdk"; const client = createClient({ apiKey: process.env.ACME_KEY }); const me = await client.getMe(); ``` - `title` (string): Title (`filename` also works). - `language` (string): Language (`lang` also works); defaults to the fence's language. - `highlight` (string): Lines to highlight, e.g. `"2-4, 6"`. - `focus` (string): Lines to focus; the rest are dimmed. - `startLine` (number): Starting line number. - `maxLines` (number, default: 20): Maximum visible lines; `0` means no limit. - `wordWrap` (boolean): Wrap long lines. - `showLineNumbers` (boolean): Show / hide line numbers (`lineNumbers` also works). - `for` (string): Custom sync group. - `links` (object): Map text in the code (or a `/regex/`) to links. - `collapsible` (boolean): When the block exceeds the max lines, collapse it behind "Show more" instead of scrolling. --- # Code from files > <Code> reads a project file or URL at build time and highlights it. Reads a file from your project (or a URL) at build time and highlights it, keeping docs in sync with real code: ```mdx <Code src="/docs.yml" lines="1-6" title="docs.yml (this site, first 6 lines)" /> ``` `/docs.yml` - `src` (string, required): File path (a leading `/` means the project root; otherwise relative to the project root or the current page), or a public `https://` URL (downloaded at build time, 8-second timeout; local and private-network addresses aren't allowed). - `lines` (string | array): Show only these lines, e.g. `"1-6"`, `{["1-3", 8]}`. - `language` (string): Language; inferred from the extension by default. All `CodeBlock` props are supported too (`title`, `highlight`, `focus`, `startLine`, `maxLines`, `wordWrap`, `showLineNumbers`, `for`, `links`, `collapsible`). A missing file produces a `code/src` warning. > **Warning** > > Use a string or an array of strings for line props. In `lines={[1-3]}`, `1-3` is a subtraction expression and is rejected by the safe subset (an `mdx/attribute` error). --- # Parameter field > <ParamField> documents one parameter or setting. Documents a parameter or config option. This site's docs.yml reference is written with it. ```mdx Name in path <ParamField path="slug" type="string" required default="generated from the name"> Site subdomain: 5–40 lowercase letters, digits, or hyphens. </ParamField> ``` ```mdx Name by location <ParamField body="slug" type="string" required> Site subdomain. </ParamField> <ParamField query="limit" type="integer" default="50">Number of results to return.</ParamField> <ParamField header="Authorization" type="string" required>Bearer token.</ParamField> ``` - `slug` (string, required, default: generated from the name): Site subdomain: 5–40 lowercase letters, digits, or hyphens. - `limit` (query, integer, default: 50): Number of results to return. - `Authorization` (header, string, required): Bearer token. - `template` (string, deprecated): An example of a deprecated parameter. ## Props - `path` (string): Parameter name. Alongside `query`, `body` or `header`, it's a path parameter. - `query / body / header` (string): Name of a query parameter / body field / header, also shown as a location label. - `name` (string): Explicit parameter name, used together with `in`. - `in` (query | body | header | cookie | path): Location label when using `name`. - `type` (string): Type label, e.g. `string`, `integer`, `object[]`. - `required` (boolean, default: false): Show "required". - `default` (string): Default value. - `deprecated` (boolean, default: false): Show "deprecated". - `id` (string): Anchor id; defaults to `param-<name>`. - `placeholder` (string): Accepted, but has no effect. - `toc` (boolean, default: false): List in the table of contents (not yet supported). Alias: `<Param>`. --- # Response field > <ResponseField> documents one field of a response. Documents a response field; a dotted prefix in the name is shown in a lighter color: ```mdx <ResponseField name="deployment.status" type="string" required pre={["enum"]}> `queued`, `building`, `ready`, `failed`, or `canceled`. </ResponseField> <ResponseField name="deployment.url" type="string" post={["read-only"]}> Deployment URL, available only after success. </ResponseField> ``` - `deployment.status` (string, required): `queued`, `building`, `ready`, `failed`, or `canceled`. - `deployment.url` (string): Deployment URL, available only after success. - `name` (string, required): Field name. - `type` (string): Type label. - `pre / post` (string[]): Extra labels before / after the type. - `required / default / deprecated / id`: Same as `ParamField`; the anchor defaults to `resp-<name>`. Collapse nested fields with [`<Expandable>`](https://docs.butterix.com/en/components/expandable.md). --- # Endpoint request snippet > <EndpointRequestSnippet> embeds an endpoint's request example from the API reference. This component pulls data from the API reference, so it updates automatically with the OpenAPI spec. The examples below reference this site's [platform API](https://docs.butterix.com/en/api-reference.md). A request example card for an endpoint, with multi-language code and a "Try it" button (alias `<RequestSnippet>`): ```mdx <EndpointRequestSnippet endpoint="POST /orgs/{org}/api-keys" languages={["curl", "python", "javascript"]} /> ``` ```bash curl -X POST https://api.butterix.com/v1/orgs/acme/api-keys \ -H "Content-Type: application/json" \ -d '{}' ``` ```python import requests url = "https://api.butterix.com/v1/orgs/acme/api-keys" payload = {} headers = { "Content-Type": "application/json" } response = requests.post(url, json=payload, headers=headers) print(response.json()) ``` ```typescript const response = await fetch("https://api.butterix.com/v1/orgs/acme/api-keys", { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify({}) }); const data = await response.json(); console.log(data); ``` - `endpoint` (string, required): `METHOD /path`, e.g. `"POST /orgs/{org}/api-keys"`; with multiple APIs, write `api-name::METHOD /path`. - `example` (string): Pick a named example from the spec (by name or `summary`). - `languages` (string[]): Languages to show, in order; may include `"payload"` (request body only). Aliases such as `typescript`, `ts`, and `shell` work too. - `highlight` (string | array): Lines to highlight, e.g. `"1-3"`. - `hideTryItButton` (boolean): Hide the "Try it" button. In the page's `.md` version it's the request example as code blocks: one per language when `languages` is set, otherwise only the site's first language. --- # Endpoint response snippet > <EndpointResponseSnippet> embeds an endpoint's response example from the API reference. This component pulls data from the API reference, so it updates automatically with the OpenAPI spec. The examples below reference this site's [platform API](https://docs.butterix.com/en/api-reference.md). A response example card for an endpoint (alias `<ResponseSnippet>`), switchable when there are multiple status codes: ```mdx <EndpointResponseSnippet endpoint="POST /orgs/{org}/members" example="invited" /> ``` 201: Added, or invite created ```json { "invite": { "url": "https://console.butterix.com/invite/q8Zt3vXc2bN0LmA4pR7sKd1e" } } ``` Props: `endpoint` (required), `example`, `highlight`, with the same meaning as above. In the page's `.md` version it's the status, its description, and a code block with the response example. --- # Endpoint schema snippet > <EndpointSchemaSnippet> embeds an endpoint's request or response schema from the API reference. This component pulls data from the API reference, so it updates automatically with the OpenAPI spec. The examples below reference this site's [platform API](https://docs.butterix.com/en/api-reference.md). A field table for one part of an endpoint: ```mdx <EndpointSchemaSnippet endpoint="PUT /sites/{site}/access" selector="request.body" /> ``` #### Request body Content type: `application/json` | Field | Type | Required | Description | |---|---|---|---| | `mode` | enum | yes | Allowed: `public`, `password`. | | `password` | string | no | | - `endpoint` (string, required): Same as above. - `selector` (string): The part to show: `request`, `request.path`, `request.query`, `request.header`, `request.cookie`, `request.body`, `response`, `response.body`, `response.errors` (or `errors`). Defaults to `request`. In the page's `.md` version it's a field table, with nested fields written as `a.b` and `list[].c`. --- # Webhook payload snippet > <WebhookPayloadSnippet> embeds a webhook's payload example from the API reference. This component pulls data from the API reference, so it updates automatically with the OpenAPI spec. A webhook payload example: ```mdx <WebhookPayloadSnippet webhook="payment.succeeded" example="Refunded" /> ``` - `webhook` (string, required): Webhook name, `operationId`, or a key of the form `WEBHOOK <name>`. - `example` (string): Named example. - `highlight` (string | array): Lines to highlight. In the page's `.md` version it's a JSON code block with the payload example. This site's platform API doesn't define any webhooks, so no rendered example is shown here; for how to write them in the spec, see [Webhooks and SSE](https://docs.butterix.com/en/guides/api/webhooks-and-sse.md). --- # Schema > <Schema> and <SchemaSnippet> render a data structure defined in OpenAPI. This component pulls data from the API reference, so it updates automatically with the OpenAPI spec. The examples below reference this site's [platform API](https://docs.butterix.com/en/api-reference.md). Displays a type by its name in `components.schemas`: `<Schema>` (alias `<SchemaFields>`) shows a field table, and `<SchemaSnippet>` shows a JSON example. ```mdx <Schema type="Deployment" /> <SchemaSnippet type="Deployment" title="Deployment example" /> ``` | Field | Type | Required | Description | |---|---|---|---| | `id` | string | no | | | `siteId` | string | no | | | `kind` | enum | no | Allowed: `production`, `preview`. | | `status` | enum | no | Allowed: `queued`, `building`, `ready`, `failed`, `canceled`. | | `source` | string | no | `cli` (upload), `hosted` (hosted repository), or `git` | | `branch` | string | no | | | `commitSha` | string | no | | | `message` | string | no | | | `createdBy` | object | no | Who triggered it; with an API key, the person who created the key | | `createdBy.id` | string | no | | | `createdBy.name` | string | no | | | `apiKey` | object | no | The name, start and end of the key, when triggered with an API key (CLI / CI) | | `apiKey.name` | string | no | | | `apiKey.prefix` | string | no | First 10 characters of the key | | `apiKey.suffix` | string | no | Last 10 characters of the key | | `error` | string | no | Reason for failure | | `pageCount` | integer | no | | | `sizeBytes` | integer | no | | | `durationMs` | integer | no | | | `url` | URL | no | Present after success. Production deployments have the site's URL; previews use a `<site>--<last 8 characters of the id>` subdomain | | `isCurrent` | boolean | no | Whether this is the current production deployment | | `createdAt` | integer | no | | | `finishedAt` | integer | no | | **Deployment example** ```json { "id": "dpl_01jd8x2k7q", "siteId": "site_2m4k8p", "kind": "production", "status": "queued", "source": "git", "branch": "main", "commitSha": "9fceb02d0ae598e95dc970b74767f19372d61af8", "message": "docs: update quickstart", "createdBy": { "id": "string", "name": "string" }, "apiKey": { "name": "GitHub Actions", "prefix": "biti_a1B2c", "suffix": "Kd82mQx0Zt" }, "error": "string", "pageCount": 94, "sizeBytes": 5832110, "durationMs": 6120, "url": "https://acme-payments--8x2k7q-sites.butterix.com", "isCurrent": true, "createdAt": 1, "finishedAt": 1 } ``` - `type` (string, required): Schema name. - `title` (string): `SchemaSnippet` only: card title. - `highlight` (string | array): `SchemaSnippet` only: lines to highlight. In the page's `.md` version, `<Schema>` is a field table and `<SchemaSnippet>` a JSON code block. --- # Runnable endpoint > <RunnableEndpoint> is an in-page API explorer that sends real requests. This component pulls data from the API reference, so it updates automatically with the OpenAPI spec. The examples below reference this site's [platform API](https://docs.butterix.com/en/api-reference.md). An in-page explorer that sends requests directly (in the page's `.md` version, the request and response examples); for usage and props see [Try it and proxy](https://docs.butterix.com/en/guides/api/try-it.md#in-page-explorer-runnableendpoint): ```mdx <RunnableEndpoint endpoint="GET /ai/models" collapsed /> ``` `GET /ai/models` ```bash curl https://api.butterix.com/v1/ai/models \ -H "Authorization: Bearer <token>" ``` 200: Models (recommended ones first) ```json { "models": [ { "id": "claude-opus-5-5", "label": "Claude Opus 5.5", "contextWindow": 1000000, "pricing": { "input": 4, "output": 20 }, "recommended": true, "reasoning": { "efforts": [ "none" ], "suggested": "low", "default": "high" } } ], "live": true, "error": "string" } ``` --- # Markdown snippets > <Markdown> (aliases <Snippet>, <Include>) inserts a reusable snippet file. Inserts a reusable snippet file into the page (aliases `<Snippet>`, `<Include>`). Any extra props replace placeholders in the snippet: ```mdx <Markdown src="/snippets/install-cli.mdx" /> <Snippet file="node-requirement.mdx" node="22.13" cli="0.1.0" /> ``` > **环境要求 · Requirements** > > Node.js ≥ 22.13 · `biti --version` ≥ 0.1.0 - `src` (string): Snippet path (`file` and `path` also work): `/snippets/x.mdx` is relative to the project root, `./x.mdx` is relative to the current file, and a bare file name is looked up under `snippets/` at the project root. - `Other props` (string | number): Replace `\{name\}` placeholders in the snippet body. A missing snippet raises a `snippet/missing` error. For path rules, `import` syntax, and escaping requirements for placeholders, see [Reusable snippets and variables](https://docs.butterix.com/en/guides/writing/snippets.md). --- # Conditional rendering > <If> (alias <Conditional>) renders content only for certain languages, versions or products. Renders its children only for the current page's locale, version, or product (alias `<Conditional>`), without adding any wrapper element: ```mdx <If locales={["zh"]}>Only on Chinese pages.</If> <If locales={["en"]}>Only on English pages.</If> <If versions={["v0"]}>Only in v0.</If> <If products={["sdk"]} not>Everywhere except the SDK product.</If> ``` > **Tip** > > 这条提示只在中文页面显示。 > **Tip** > > This tip only appears on English pages. - `locales` (string[]): Locale codes (`languages` and `lang` also work). - `versions` (string[]): Version ids, slugs, or display names. - `products` (string[]): Product ids, slugs, or display names. - `not` (boolean, default: false): Negate the condition. - `roles` (string[]): Show content by reader role. Static builds have no logged-in user, so it never matches. When multiple conditions are set, all of them must match. --- # Platform API > Overview of the ButterIX hosted platform's REST API — base URLs, authentication, roles, error format, and common workflows. Everything the ButterIX console and the `biti` CLI can do goes through this REST API: managing organizations and members, creating sites, uploading and switching deployments, configuring domains and Git, setting up Ask AI, reading analytics, and driving the visual editor. [**Download the spec**](https://docs.butterix.com/openapi.yaml) OpenAPI 3.1 (YAML) [**Create API key**](https://docs.butterix.com/en/api-reference/api-keys/create-api-key.md) Organization keys for the CLI and CI [**Create deployment**](https://docs.butterix.com/en/api-reference/deployments/create-deployment.md) Upload source or rebuild from the repository ## Base URLs The platform API's base URL is `https://api.butterix.com/v1`. Endpoints in the "Docs site runtime" group (Ask AI, MCP, explorer proxy, feedback) go to the **docs site's own domain**, for example `https://acme-payments-sites.butterix.com/_mcp/server`. ## Authentication **API key (CLI / CI)** Create a key in the console under **Organization settings → API Keys** and pass it in the `Authorization` header: ```bash curl https://api.butterix.com/v1/whoami \ -H "Authorization: Bearer $BITI_TOKEN" ``` API keys belong to an organization and act as `editor`: they can deploy, edit content, and read data, but can't do anything that requires `admin` (members, domains, key management, and so on). **Session cookie (browser)** After `POST /auth/login` succeeds, the platform sets an HttpOnly `biti_session` cookie (30 days), valid only on the host you signed in to. Requests that change data with cookie authentication must be same-origin: the platform checks the `Origin` header and answers cross-origin requests with 403. ## Roles | Role | What it can do | | -------- | ----------------------------------------------------------------------------------------------- | | `owner` | Everything; an organization needs at least one owner | | `admin` | Manage members, site settings, domains, Git, access control, Ask AI, and API keys; delete sites | | `editor` | Deploy, switch the production deployment, edit and publish content, test Ask AI | | `viewer` | Read only | ## Conventions - Requests and responses are JSON; deployment uploads use `application/gzip`, and editor uploads use `multipart/form-data`. - Timestamps are Unix **milliseconds**. - The `:site` and `:org` parameters can be a slug or an id. - Errors return a matching HTTP status code and `{ "error": "…" }`. ```json title="Error response" { "error": "That subdomain is taken." } ``` ## Common workflows ### Deploy from CI ### Upload source `POST /sites/{site}/deployments` with the project's tar.gz as the request body. Returns `{ id }`. ### Poll the status `GET /deployments/{id}` until `status` is `ready` or `failed`. `biti deploy` polls once per second. ### (Optional) Roll back `POST /deployments/{id}/promote` makes any successful deployment the production one, immediately. ```bash tar --exclude=node_modules --exclude=.git --exclude=dist -czf site.tgz . curl -X POST https://api.butterix.com/v1/sites/acme-payments/deployments \ -H "Authorization: Bearer $BITI_TOKEN" \ -H "Content-Type: application/gzip" \ -H "x-biti-preview: 1" \ --data-binary @site.tgz ``` ### Edit a page with the editor API ### Create a draft `POST /sites/{site}/editor/branches` → `{ name }` ### Read the file `GET /sites/{site}/editor/file?branch=…&path=…` → `{ content, sha }` ### Save `PUT /sites/{site}/editor/file` with `baseSha`, so you don't overwrite someone else's changes ### Publish `POST /sites/{site}/editor/publish` merges into the production branch and deploys See the groups below or the navigation on the left for the full list of endpoints. --- # Sign up `POST /auth/signup` Creates an account and logs in (sets the `biti_session` cookie), and creates a personal organization for the new user. Returns 403 when the platform has closed self-service sign-up; people with an invite link can still sign up. Base URL: https://api.butterix.com/v1 ## Request body Content type: `application/json` | Field | Type | Required | Description | |---|---|---|---| | `name` | string | yes | Display name | | `email` | email | yes | | | `password` | string | yes | At least 8 characters | ## Example request ```bash curl -X POST https://api.butterix.com/v1/auth/signup \ -H "Content-Type: application/json" \ -d '{ "name": "Lin Xiao", "email": "lin@example.com", "password": "correct-horse-battery" }' ``` ## Responses ### 201 Signed up Content type: `application/json` | Field | Type | Required | Description | |---|---|---|---| | `user` | object | no | | | `user.id` | string | no | | | `user.email` | email | no | | | `user.name` | string | no | | | `user.avatarUrl` | URL | no | | | `user.isAdmin` | boolean | no | Platform administrator | ### 400 Invalid request parameters Content type: `application/json` | Field | Type | Required | Description | |---|---|---|---| | `error` | string | yes | Human-readable error message | | `code` | string | no | Machine-readable error code (some endpoints) | ### 403 Insufficient role, or not allowed with an API key Content type: `application/json` | Field | Type | Required | Description | |---|---|---|---| | `error` | string | yes | Human-readable error message | | `code` | string | no | Machine-readable error code (some endpoints) | ### 409 Conflict (name taken, already added, or merge conflict) Content type: `application/json` | Field | Type | Required | Description | |---|---|---|---| | `error` | string | yes | Human-readable error message | | `code` | string | no | Machine-readable error code (some endpoints) | ### Example response (201) ```json { "user": { "id": "usr_3k9d2a", "email": "lin@example.com", "name": "Lin Xiao", "avatarUrl": "https://example.com", "isAdmin": false } } ``` --- # Log in `POST /auth/login` Logs in with email and password and sets the HttpOnly session cookie `biti_session` (valid for 30 days). Repeated failures are temporarily rate limited. Base URL: https://api.butterix.com/v1 ## Request body Content type: `application/json` | Field | Type | Required | Description | |---|---|---|---| | `email` | email | yes | | | `password` | string | yes | | ## Example request ```bash curl -X POST https://api.butterix.com/v1/auth/login \ -H "Content-Type: application/json" \ -d '{ "email": "lin@example.com", "password": "correct-horse-battery" }' ``` ## Responses ### 200 Logged in Content type: `application/json` | Field | Type | Required | Description | |---|---|---|---| | `user` | object | no | | | `user.id` | string | no | | | `user.email` | email | no | | | `user.name` | string | no | | | `user.avatarUrl` | URL | no | | | `user.isAdmin` | boolean | no | Platform administrator | ### 401 Not logged in, or invalid credentials Content type: `application/json` | Field | Type | Required | Description | |---|---|---|---| | `error` | string | yes | Human-readable error message | | `code` | string | no | Machine-readable error code (some endpoints) | ### Example response (200) ```json { "user": { "id": "usr_3k9d2a", "email": "lin@example.com", "name": "Lin Xiao", "avatarUrl": "https://example.com", "isAdmin": false } } ``` --- # Log out `POST /auth/logout` Ends the current session and clears the cookie. Base URL: https://api.butterix.com/v1 Authentication: API key in cookie `biti_session` ## Example request ```bash curl -X POST https://api.butterix.com/v1/auth/logout ``` ## Responses ### 200 Success Content type: `application/json` | Field | Type | Required | Description | |---|---|---|---| | `ok` | true | no | Allowed: `true`. | ### Example response (200) ```json { "ok": true } ``` --- # Get current user `GET /me` Returns the logged-in user and every organization they belong to (with their role in each). Session authentication only. Base URL: https://api.butterix.com/v1 Authentication: API key in cookie `biti_session` ## Example request ```bash curl https://api.butterix.com/v1/me ``` ## Responses ### 200 Current user Content type: `application/json` | Field | Type | Required | Description | |---|---|---|---| | `user` | object | no | | | `user.id` | string | no | | | `user.email` | email | no | | | `user.name` | string | no | | | `user.avatarUrl` | URL | no | | | `user.isAdmin` | boolean | no | Platform administrator | | `orgs` | list of objects | no | | | `orgs[].id` | string | no | | | `orgs[].slug` | string | no | | | `orgs[].name` | string | no | | | `orgs[].plan` | string | no | | | `orgs[].planName` | string | no | | | `orgs[].role` | enum | no | Organization role Allowed: `owner`, `admin`, `editor`, `viewer`. | | `orgs[].createdAt` | integer | no | | ### 401 Not logged in, or invalid credentials Content type: `application/json` | Field | Type | Required | Description | |---|---|---|---| | `error` | string | yes | Human-readable error message | | `code` | string | no | Machine-readable error code (some endpoints) | ### Example response (200) ```json { "user": { "id": "usr_3k9d2a", "email": "lin@example.com", "name": "Lin Xiao", "avatarUrl": "https://example.com", "isAdmin": false }, "orgs": [ { "id": "org_8f2k1c", "slug": "acme", "name": "Acme", "plan": "free", "planName": "Free", "role": "owner", "createdAt": 1763596800000 } ] } ``` --- # Update current user `PATCH /me` Changes the display name or password. Changing the password requires the current one. Base URL: https://api.butterix.com/v1 Authentication: API key in cookie `biti_session` ## Request body Content type: `application/json` | Field | Type | Required | Description | |---|---|---|---| | `name` | string | no | | | `currentPassword` | string | no | | | `newPassword` | string | no | | ## Example request ```bash curl -X PATCH https://api.butterix.com/v1/me \ -H "Content-Type: application/json" \ -d '{}' ``` ## Responses ### 200 Updated user Content type: `application/json` | Field | Type | Required | Description | |---|---|---|---| | `user` | object | no | | | `user.id` | string | no | | | `user.email` | email | no | | | `user.name` | string | no | | | `user.avatarUrl` | URL | no | | | `user.isAdmin` | boolean | no | Platform administrator | ### 400 Invalid request parameters Content type: `application/json` | Field | Type | Required | Description | |---|---|---|---| | `error` | string | yes | Human-readable error message | | `code` | string | no | Machine-readable error code (some endpoints) | ### Example response (200) ```json { "user": { "id": "usr_3k9d2a", "email": "lin@example.com", "name": "Lin Xiao", "avatarUrl": "https://example.com", "isAdmin": false } } ``` --- # Get the API key's organization `GET /whoami` Call it with an API key to get the organization the key belongs to. `biti login` uses it to verify keys. Base URL: https://api.butterix.com/v1 Authentication: bearer token in Authorization header ## Example request ```bash curl https://api.butterix.com/v1/whoami \ -H "Authorization: Bearer <token>" ``` ## Responses ### 200 The organization Content type: `application/json` | Field | Type | Required | Description | |---|---|---|---| | `org` | object | no | | | `org.id` | string | no | | | `org.slug` | string | no | | | `org.name` | string | no | | ### 401 Not logged in, or invalid credentials Content type: `application/json` | Field | Type | Required | Description | |---|---|---|---| | `error` | string | yes | Human-readable error message | | `code` | string | no | Machine-readable error code (some endpoints) | ### Example response (200) ```json { "org": { "id": "org_8f2k1c", "slug": "acme", "name": "Acme" } } ``` --- # Create organization `POST /orgs` Creates an organization; the caller becomes its `owner`. Base URL: https://api.butterix.com/v1 Authentication: API key in cookie `biti_session` ## Request body Content type: `application/json` | Field | Type | Required | Description | |---|---|---|---| | `name` | string | yes | | | `slug` | string | no | Organization identifier, generated from the name by default. It can't be changed later | ## Example request ```bash curl -X POST https://api.butterix.com/v1/orgs \ -H "Content-Type: application/json" \ -d '{ "name": "Acme" }' ``` ## Responses ### 201 New organization Content type: `application/json` | Field | Type | Required | Description | |---|---|---|---| | `id` | string | no | | | `slug` | string | no | | | `name` | string | no | | | `plan` | string | no | | | `planName` | string | no | | | `role` | enum | no | Organization role Allowed: `owner`, `admin`, `editor`, `viewer`. | | `createdAt` | integer | no | | ### 409 Conflict (name taken, already added, or merge conflict) Content type: `application/json` | Field | Type | Required | Description | |---|---|---|---| | `error` | string | yes | Human-readable error message | | `code` | string | no | Machine-readable error code (some endpoints) | ### Example response (201) ```json { "id": "org_8f2k1c", "slug": "acme", "name": "Acme", "plan": "free", "planName": "Free", "role": "owner", "createdAt": 1763596800000 } ``` --- # Get organization `GET /orgs/{org}` Base URL: https://api.butterix.com/v1 Authentication: bearer token in Authorization header or API key in cookie `biti_session` ## Path parameters | Name | Type | Required | Description | |---|---|---|---| | `org` | string | yes | Organization slug or id | ## Example request ```bash curl https://api.butterix.com/v1/orgs/acme \ -H "Authorization: Bearer <token>" ``` ## Responses ### 200 Organizations Content type: `application/json` | Field | Type | Required | Description | |---|---|---|---| | `id` | string | no | | | `slug` | string | no | | | `name` | string | no | | | `plan` | string | no | | | `planName` | string | no | | | `role` | enum | no | Organization role Allowed: `owner`, `admin`, `editor`, `viewer`. | | `createdAt` | integer | no | | ### 404 The resource doesn't exist, or you don't have access to it Content type: `application/json` | Field | Type | Required | Description | |---|---|---|---| | `error` | string | yes | Human-readable error message | | `code` | string | no | Machine-readable error code (some endpoints) | ### Example response (200) ```json { "id": "org_8f2k1c", "slug": "acme", "name": "Acme", "plan": "free", "planName": "Free", "role": "owner", "createdAt": 1763596800000 } ``` --- # Rename organization `PATCH /orgs/{org}` Requires the `admin` role. Base URL: https://api.butterix.com/v1 Authentication: bearer token in Authorization header or API key in cookie `biti_session` ## Path parameters | Name | Type | Required | Description | |---|---|---|---| | `org` | string | yes | Organization slug or id | ## Request body Content type: `application/json` | Field | Type | Required | Description | |---|---|---|---| | `name` | string | no | | ## Example request ```bash curl -X PATCH https://api.butterix.com/v1/orgs/acme \ -H "Authorization: Bearer <token>" \ -H "Content-Type: application/json" \ -d '{}' ``` ## Responses ### 200 Updated organization Content type: `application/json` | Field | Type | Required | Description | |---|---|---|---| | `id` | string | no | | | `slug` | string | no | | | `name` | string | no | | | `plan` | string | no | | | `planName` | string | no | | | `role` | enum | no | Organization role Allowed: `owner`, `admin`, `editor`, `viewer`. | | `createdAt` | integer | no | | ### 403 Insufficient role, or not allowed with an API key Content type: `application/json` | Field | Type | Required | Description | |---|---|---|---| | `error` | string | yes | Human-readable error message | | `code` | string | no | Machine-readable error code (some endpoints) | ### Example response (200) ```json { "id": "org_8f2k1c", "slug": "acme", "name": "Acme", "plan": "free", "planName": "Free", "role": "owner", "createdAt": 1763596800000 } ``` --- # Audit log `GET /orgs/{org}/audit` The latest 200 important actions (creating and deleting sites, switching deployments, domains, members, keys, Ask AI settings, and so on). Requires the `admin` role. Base URL: https://api.butterix.com/v1 Authentication: bearer token in Authorization header or API key in cookie `biti_session` ## Path parameters | Name | Type | Required | Description | |---|---|---|---| | `org` | string | yes | Organization slug or id | ## Example request ```bash curl https://api.butterix.com/v1/orgs/acme/audit \ -H "Authorization: Bearer <token>" ``` ## Responses ### 200 Audit entries, newest first Content type: `application/json` | Field | Type | Required | Description | |---|---|---|---| | `[].ts` | integer | no | | | `[].action` | string | no | | | `[].target` | string | no | | | `[].user` | object | no | | | `[].user.name` | string | no | | | `[].user.email` | string | no | | ### Example response (200) ```json [ { "ts": 1, "action": "deployment.promote", "target": "dpl_01jd8x2k7q", "user": { "name": "string", "email": "string" } } ] ``` --- # Organization MCP server `POST /mcp` The organization's MCP server (Streamable HTTP transport, JSON responses), read-only. Accepts organization API keys only; for the tools see [Hosted platform](https://docs.butterix.com/en/guides/deploy/platform.md#organization-mcp-server). `GET` requests get 405; each API key is limited to 120 calls per minute, beyond which you get 429. Base URL: https://api.butterix.com/v1 Authentication: bearer token in Authorization header ## Request body Content type: `application/json` | Field | Type | Required | Description | |---|---|---|---| | `jsonrpc` | "2.0" | yes | Allowed: `2.0`. | | `id` | string | no | | | `method` | enum | yes | Allowed: `initialize`, `ping`, `tools/list`, `tools/call`. | | `params` | object | no | | ## Example request ```bash curl -X POST https://api.butterix.com/v1/mcp \ -H "Authorization: Bearer <token>" \ -H "Content-Type: application/json" \ -d '{ "jsonrpc": "2.0", "id": 1, "method": "tools/call", "params": { "name": "list_sites", "arguments": {} } }' ``` ## Responses ### 200 JSON-RPC response Content type: `application/json` | Field | Type | Required | Description | |---|---|---|---| | `jsonrpc` | string | no | | | `id` | string | no | | | `result` | object | no | | | `error` | object | no | | | `error.code` | integer | no | | | `error.message` | string | no | | ### 202 Notification, no response body ### 401 Not logged in, or invalid credentials Content type: `application/json` | Field | Type | Required | Description | |---|---|---|---| | `error` | string | yes | Human-readable error message | | `code` | string | no | Machine-readable error code (some endpoints) | ### Example response (200) ```json { "jsonrpc": "string", "id": "string", "result": {}, "error": { "code": 1, "message": "string" } } ``` --- # List members and invites `GET /orgs/{org}/members` Base URL: https://api.butterix.com/v1 Authentication: bearer token in Authorization header or API key in cookie `biti_session` ## Path parameters | Name | Type | Required | Description | |---|---|---|---| | `org` | string | yes | Organization slug or id | ## Example request ```bash curl https://api.butterix.com/v1/orgs/acme/members \ -H "Authorization: Bearer <token>" ``` ## Responses ### 200 Members and pending invites Content type: `application/json` | Field | Type | Required | Description | |---|---|---|---| | `members` | list of objects | no | | | `members[].user` | object | no | | | `members[].user.id` | string | no | | | `members[].user.name` | string | no | | | `members[].user.email` | string | no | | | `members[].user.avatarUrl` | string | no | | | `members[].role` | enum | no | Organization role Allowed: `owner`, `admin`, `editor`, `viewer`. | | `members[].createdAt` | integer | no | | | `invites` | list of objects | no | | | `invites[].id` | string | no | | | `invites[].email` | string | no | | | `invites[].role` | enum | no | Organization role Allowed: `owner`, `admin`, `editor`, `viewer`. | | `invites[].createdAt` | integer | no | | ### Example response (200) ```json { "members": [ { "user": { "id": "string", "name": "string", "email": "string", "avatarUrl": "string" }, "role": "owner", "createdAt": 1 } ], "invites": [ { "id": "inv_7cd2e1", "email": "chen@example.com", "role": "owner", "createdAt": 1 } ] } ``` --- # Add or invite a member `POST /orgs/{org}/members` Requires the `admin` role. If the email is already registered, the user joins the organization right away and the response is `{ "added": true }`; otherwise a one-time invite link is created and returned as `{ "invite": { "url" } }` for you to send. Base URL: https://api.butterix.com/v1 Authentication: bearer token in Authorization header or API key in cookie `biti_session` ## Path parameters | Name | Type | Required | Description | |---|---|---|---| | `org` | string | yes | Organization slug or id | ## Request body Content type: `application/json` | Field | Type | Required | Description | |---|---|---|---| | `email` | email | yes | | | `role` | enum | no | Organization role Allowed: `owner`, `admin`, `editor`, `viewer`. | ## Example request ```bash curl -X POST https://api.butterix.com/v1/orgs/acme/members \ -H "Authorization: Bearer <token>" \ -H "Content-Type: application/json" \ -d '{ "email": "chen@example.com", "role": "editor" }' ``` ## Responses ### 201 Added, or invite created Content type: `application/json` | Field | Type | Required | Description | |---|---|---|---| | _Added_ | variant | | | | `added` | true | no | Allowed: `true`. | | _Invited_ | variant | | | | `invite` | object | no | | | `invite.url` | URL | no | | ### 409 Conflict (name taken, already added, or merge conflict) Content type: `application/json` | Field | Type | Required | Description | |---|---|---|---| | `error` | string | yes | Human-readable error message | | `code` | string | no | Machine-readable error code (some endpoints) | ### Example response (201) ```json { "invite": { "url": "https://console.butterix.com/invite/q8Zt3vXc2bN0LmA4pR7sKd1e" } } ``` --- # Change a member's role `PATCH /orgs/{org}/members/{userId}` Requires the `admin` role. An organization must keep at least one `owner`. Base URL: https://api.butterix.com/v1 Authentication: bearer token in Authorization header or API key in cookie `biti_session` ## Path parameters | Name | Type | Required | Description | |---|---|---|---| | `org` | string | yes | Organization slug or id | | `userId` | string | yes | | ## Request body Content type: `application/json` | Field | Type | Required | Description | |---|---|---|---| | `role` | enum | yes | Organization role Allowed: `owner`, `admin`, `editor`, `viewer`. | ## Example request ```bash curl -X PATCH https://api.butterix.com/v1/orgs/acme/members/usr_3k9d2a \ -H "Authorization: Bearer <token>" \ -H "Content-Type: application/json" \ -d '{ "role": "owner" }' ``` ## Responses ### 200 Success Content type: `application/json` | Field | Type | Required | Description | |---|---|---|---| | `ok` | true | no | Allowed: `true`. | ### 400 Invalid request parameters Content type: `application/json` | Field | Type | Required | Description | |---|---|---|---| | `error` | string | yes | Human-readable error message | | `code` | string | no | Machine-readable error code (some endpoints) | ### Example response (200) ```json { "ok": true } ``` --- # Remove member `DELETE /orgs/{org}/members/{userId}` Requires the `admin` role. The last `owner` can't be removed. Base URL: https://api.butterix.com/v1 Authentication: bearer token in Authorization header or API key in cookie `biti_session` ## Path parameters | Name | Type | Required | Description | |---|---|---|---| | `org` | string | yes | Organization slug or id | | `userId` | string | yes | | ## Example request ```bash curl -X DELETE https://api.butterix.com/v1/orgs/acme/members/usr_3k9d2a \ -H "Authorization: Bearer <token>" ``` ## Responses ### 200 Success Content type: `application/json` | Field | Type | Required | Description | |---|---|---|---| | `ok` | true | no | Allowed: `true`. | ### 400 Invalid request parameters Content type: `application/json` | Field | Type | Required | Description | |---|---|---|---| | `error` | string | yes | Human-readable error message | | `code` | string | no | Machine-readable error code (some endpoints) | ### Example response (200) ```json { "ok": true } ``` --- # Revoke invite `DELETE /orgs/{org}/invites/{inviteId}` Base URL: https://api.butterix.com/v1 Authentication: bearer token in Authorization header or API key in cookie `biti_session` ## Path parameters | Name | Type | Required | Description | |---|---|---|---| | `org` | string | yes | Organization slug or id | | `inviteId` | string | yes | | ## Example request ```bash curl -X DELETE https://api.butterix.com/v1/orgs/acme/invites/inv_7cd2e1 \ -H "Authorization: Bearer <token>" ``` ## Responses ### 200 Success Content type: `application/json` | Field | Type | Required | Description | |---|---|---|---| | `ok` | true | no | Allowed: `true`. | ### Example response (200) ```json { "ok": true } ``` --- # Accept invite `POST /invites/{token}/accept` The logged-in user accepts the invite and joins the organization with the invited role. Each invite can be used once. Base URL: https://api.butterix.com/v1 Authentication: API key in cookie `biti_session` ## Path parameters | Name | Type | Required | Description | |---|---|---|---| | `token` | string | yes | The token in the invite link | ## Example request ```bash curl -X POST https://api.butterix.com/v1/invites/string/accept ``` ## Responses ### 200 The organization joined Content type: `application/json` | Field | Type | Required | Description | |---|---|---|---| | `org` | object | no | | | `org.id` | string | no | | | `org.slug` | string | no | | | `org.name` | string | no | | | `org.plan` | string | no | | | `org.planName` | string | no | | | `org.role` | enum | no | Organization role Allowed: `owner`, `admin`, `editor`, `viewer`. | | `org.createdAt` | integer | no | | ### 404 The resource doesn't exist, or you don't have access to it Content type: `application/json` | Field | Type | Required | Description | |---|---|---|---| | `error` | string | yes | Human-readable error message | | `code` | string | no | Machine-readable error code (some endpoints) | ### Example response (200) ```json { "org": { "id": "org_8f2k1c", "slug": "acme", "name": "Acme", "plan": "free", "planName": "Free", "role": "owner", "createdAt": 1763596800000 } } ``` --- # List API keys `GET /orgs/{org}/api-keys` Requires the `admin` role (so it only works with session authentication). Returns only the start and end of each key, never full keys. Base URL: https://api.butterix.com/v1 Authentication: API key in cookie `biti_session` ## Path parameters | Name | Type | Required | Description | |---|---|---|---| | `org` | string | yes | Organization slug or id | ## Example request ```bash curl https://api.butterix.com/v1/orgs/acme/api-keys ``` ## Responses ### 200 Keys Content type: `application/json` | Field | Type | Required | Description | |---|---|---|---| | `[].id` | string | no | | | `[].name` | string | no | | | `[].prefix` | string | no | First 10 characters of the key | | `[].suffix` | string | no | Last 10 characters of the key | | `[].createdAt` | integer | no | | | `[].lastUsedAt` | integer | no | | ### Example response (200) ```json [ { "id": "key_5h2m8q", "name": "GitHub Actions", "prefix": "biti_Q2xha", "suffix": "Kd82mQx0Zt", "createdAt": 1, "lastUsedAt": 1 } ] ``` --- # Create API key `POST /orgs/{org}/api-keys` Requires the `admin` role. The full `token` is **returned only once, in this response**; save it right away. Base URL: https://api.butterix.com/v1 Authentication: API key in cookie `biti_session` ## Path parameters | Name | Type | Required | Description | |---|---|---|---| | `org` | string | yes | Organization slug or id | ## Request body Content type: `application/json` | Field | Type | Required | Description | |---|---|---|---| | `name` | string | no | | ## Example request ```bash curl -X POST https://api.butterix.com/v1/orgs/acme/api-keys \ -H "Content-Type: application/json" \ -d '{}' ``` ## Responses ### 201 New key Content type: `application/json` | Field | Type | Required | Description | |---|---|---|---| | `id` | string | no | | | `token` | string | no | | ### Example response (201) ```json { "id": "key_5h2m8q", "token": "biti_Q2xhdWRlIGlzIGF3ZXNvbWUh9x" } ``` --- # Delete API key `DELETE /orgs/{org}/api-keys/{keyId}` The CLI and CI using this key stop working immediately. Base URL: https://api.butterix.com/v1 Authentication: API key in cookie `biti_session` ## Path parameters | Name | Type | Required | Description | |---|---|---|---| | `org` | string | yes | Organization slug or id | | `keyId` | string | yes | | ## Example request ```bash curl -X DELETE https://api.butterix.com/v1/orgs/acme/api-keys/key_5h2m8q ``` ## Responses ### 200 Success Content type: `application/json` | Field | Type | Required | Description | |---|---|---|---| | `ok` | true | no | Allowed: `true`. | ### Example response (200) ```json { "ok": true } ``` --- # List sites `GET /orgs/{org}/sites` Base URL: https://api.butterix.com/v1 Authentication: bearer token in Authorization header or API key in cookie `biti_session` ## Path parameters | Name | Type | Required | Description | |---|---|---|---| | `org` | string | yes | Organization slug or id | ## Example request ```bash curl https://api.butterix.com/v1/orgs/acme/sites \ -H "Authorization: Bearer <token>" ``` ## Responses ### 200 The organization's sites, newest first Content type: `application/json` | Field | Type | Required | Description | |---|---|---|---| | `[].id` | string | no | | | `[].slug` | string | no | | | `[].name` | string | no | | | `[].url` | URL | no | | | `[].sourceType` | enum | no | Content source: hosted repository, external Git repository, or CLI upload Allowed: `hosted`, `git`, `upload`. | | `[].status` | enum | no | Status of the latest deployment; `none` when there isn't one Allowed: `queued`, `building`, `ready`, `failed`, `canceled`, `none`. | | `[].updatedAt` | integer | no | | | `[].pageCount` | integer | no | Number of pages in the production deployment | ### Example response (200) ```json [ { "id": "site_2m4k8p", "slug": "acme-payments", "name": "Acme Docs", "url": "https://acme-payments-sites.butterix.com", "sourceType": "hosted", "status": "queued", "updatedAt": 1, "pageCount": 94 } ] ``` --- # Create site `POST /orgs/{org}/sites` Requires the `admin` role. The platform creates a hosted Git repository for the site, writes the template, and starts the first production deployment right away. - `starter`: three pages: introduction, quickstart, and a writing guide. - `blank`: a single home page. - `openapi`: an API reference generated from `openapiText`, which is required. `slug` is the site's subdomain: 5–40 lowercase letters, numbers, or single hyphens, not starting or ending with a hyphen, and without `--` (preview URLs use `--` as a separator). Some reserved words (such as `console`, `managements`, and `butterix`) aren't available. The site's URL is `https://<slug>-sites.butterix.com`. Base URL: https://api.butterix.com/v1 Authentication: bearer token in Authorization header or API key in cookie `biti_session` ## Path parameters | Name | Type | Required | Description | |---|---|---|---| | `org` | string | yes | Organization slug or id | ## Request body Content type: `application/json` | Field | Type | Required | Description | |---|---|---|---| | `name` | string | yes | | | `slug` | string | no | Generated from the name by default | | `template` | enum | no | Allowed: `starter`, `blank`, `openapi`. | | `openapiText` | string | no | Required when `template` is `openapi`: OpenAPI 3.x as YAML or JSON text | ## Example request ```bash curl -X POST https://api.butterix.com/v1/orgs/acme/sites \ -H "Authorization: Bearer <token>" \ -H "Content-Type: application/json" \ -d '{ "name": "Acme Docs", "slug": "acme-payments", "template": "starter" }' ``` ## Responses ### 201 New site Content type: `application/json` | Field | Type | Required | Description | |---|---|---|---| | `id` | string | no | | | `slug` | string | no | | | `name` | string | no | | | `url` | URL | no | | | `sourceType` | enum | no | Content source: hosted repository, external Git repository, or CLI upload Allowed: `hosted`, `git`, `upload`. | | `status` | enum | no | Status of the latest deployment; `none` when there isn't one Allowed: `queued`, `building`, `ready`, `failed`, `canceled`, `none`. | | `updatedAt` | integer | no | | | `pageCount` | integer | no | Number of pages in the production deployment | | `orgSlug` | string | no | | | `git` | object | no | Present when a Git repository is connected | | `git.url` | string | no | | | `git.branch` | string | no | | | `git.hasToken` | boolean | no | | | `git.webhookUrl` | string | no | | | `git.webhookSecret` | string | no | | | `production` | object | no | | | `production.id` | string | no | | | `production.siteId` | string | no | | | `production.kind` | enum | no | Allowed: `production`, `preview`. | | `production.status` | enum | no | Allowed: `queued`, `building`, `ready`, `failed`, `canceled`. | | `production.source` | string | no | `cli` (upload), `hosted` (hosted repository), or `git` | | `production.branch` | string | no | | | `production.commitSha` | string | no | | | `production.message` | string | no | | | `production.createdBy` | object | no | Who triggered it; with an API key, the person who created the key | | `production.createdBy.id` | string | no | | | `production.createdBy.name` | string | no | | | `production.apiKey` | object | no | The name, start and end of the key, when triggered with an API key (CLI / CI) | | `production.apiKey.name` | string | no | | | `production.apiKey.prefix` | string | no | First 10 characters of the key | | `production.apiKey.suffix` | string | no | Last 10 characters of the key | | `production.error` | string | no | Reason for failure | | `production.pageCount` | integer | no | | | `production.sizeBytes` | integer | no | | | `production.durationMs` | integer | no | | | `production.url` | URL | no | Present after success. Production deployments have the site's URL; previews use a `<site>--<last 8 characters of the id>` subdomain | | `production.isCurrent` | boolean | no | Whether this is the current production deployment | | `production.createdAt` | integer | no | | | `production.finishedAt` | integer | no | | | `domains` | list of objects | no | | | `domains[].domain` | string | no | | | `domains[].verified` | boolean | no | | | `domains[].primary` | boolean | no | Whether this is the primary domain | | `domains[].verifyRecord` | object | no | TXT record to add | | `domains[].verifyRecord.type` | "TXT" | no | Allowed: `TXT`. | | `domains[].verifyRecord.name` | string | no | | | `domains[].verifyRecord.value` | string | no | | | `domains[].cname` | string | no | CNAME target | | `domains[].createdAt` | integer | no | | | `access` | object | no | | | `access.mode` | enum | no | Allowed: `public`, `password`. | | `ai` | object | no | | | `ai.enabled` | boolean | no | | | `ai.provider` | enum | no | Allowed: `anthropic`, `deepseek`, `openrouter`. | | `ai.model` | string | no | | | `ai.hasKey` | boolean | no | Whether a site key is set | | `ai.keyMasked` | string | no | | | `ai.platformKeyAvailable` | boolean | no | Whether the platform has a default key for the current provider | | `ai.platformKeys` | map from strings to booleans | no | Whether each provider has a platform key | | `ai.guidance` | string | no | | | `ai.effort` | enum | no | Reasoning effort; `null` uses the model's suggested level May be null. Allowed: `none`, `minimal`, `low`, `medium`, `high`, `xhigh`, `max`. | | `ai.retentionDays` | integer | no | Days to keep questions; `null` keeps them forever May be null. | | `ai.dailyLimit` | integer | no | Maximum questions that call the model in a rolling 24 hours; `null` means no limit May be null. | | `ai.agent` | boolean | no | Whether console AI is on | | `ai.gaps` | boolean | no | Whether documentation gaps are sorted every day | | `ai.support` | object | no | Contact when AI has no answer | | `ai.support.enabled` | boolean | no | | | `ai.support.url` | string | no | | | `ai.support.email` | string | no | | | `primaryUrl` | URL | no | The address on the primary domain; the same as `url` without a custom domain | | `mcpUrl` | URL | no | | ### 400 Invalid request parameters Content type: `application/json` | Field | Type | Required | Description | |---|---|---|---| | `error` | string | yes | Human-readable error message | | `code` | string | no | Machine-readable error code (some endpoints) | ### 409 Conflict (name taken, already added, or merge conflict) Content type: `application/json` | Field | Type | Required | Description | |---|---|---|---| | `error` | string | yes | Human-readable error message | | `code` | string | no | Machine-readable error code (some endpoints) | ### Example response (201) ```json { "id": "site_2m4k8p", "slug": "acme-payments", "name": "Acme Docs", "url": "https://acme-payments-sites.butterix.com", "sourceType": "hosted", "status": "queued", "updatedAt": 1, "pageCount": 94, "orgSlug": "acme", "git": { "url": "https://github.com/acme/docs.git", "branch": "main", "hasToken": true, "webhookUrl": "https://api.butterix.com/v1/webhooks/github/site_2m4k8p", "webhookSecret": "string" }, "production": { "id": "dpl_01jd8x2k7q", "siteId": "site_2m4k8p", "kind": "production", "status": "queued", "source": "git", "branch": "main", "commitSha": "9fceb02d0ae598e95dc970b74767f19372d61af8", "message": "docs: update quickstart", "createdBy": { "id": "string", "name": "string" }, "apiKey": { "name": "GitHub Actions", "prefix": "biti_a1B2c", "suffix": "Kd82mQx0Zt" }, "error": "string", "pageCount": 94, "sizeBytes": 5832110, "durationMs": 6120, "url": "https://acme-payments--8x2k7q-sites.butterix.com", "isCurrent": true, "createdAt": 1, "finishedAt": 1 }, "domains": [ { "domain": "docs.acme.com", "verified": false, "primary": false, "verifyRecord": { "type": "TXT", "name": "_butterix.docs.acme.com", "value": "butterix-verify=a1b2c3d4e5f6" }, "cname": "sites.butterix.com", "createdAt": 1 } ], "access": { "mode": "public" }, "ai": { "enabled": true, "provider": "anthropic", "model": "claude-opus-5-5", "hasKey": true, "keyMasked": "sk-a…9f2c", "platformKeyAvailable": true, "platformKeys": { "key": true }, "guidance": "string", "effort": "none", "retentionDays": 1, "dailyLimit": 200, "agent": true, "gaps": false, "support": { "enabled": false, "url": "", "email": "" } }, "primaryUrl": "https://docs.acme.com", "mcpUrl": "https://docs.acme.com/_mcp/server" } ``` --- # Get site `GET /sites/{site}` Base URL: https://api.butterix.com/v1 Authentication: bearer token in Authorization header or API key in cookie `biti_session` ## Path parameters | Name | Type | Required | Description | |---|---|---|---| | `site` | string | yes | Site slug or id | ## Example request ```bash curl https://api.butterix.com/v1/sites/acme-payments \ -H "Authorization: Bearer <token>" ``` ## Responses ### 200 Site details Content type: `application/json` | Field | Type | Required | Description | |---|---|---|---| | `id` | string | no | | | `slug` | string | no | | | `name` | string | no | | | `url` | URL | no | | | `sourceType` | enum | no | Content source: hosted repository, external Git repository, or CLI upload Allowed: `hosted`, `git`, `upload`. | | `status` | enum | no | Status of the latest deployment; `none` when there isn't one Allowed: `queued`, `building`, `ready`, `failed`, `canceled`, `none`. | | `updatedAt` | integer | no | | | `pageCount` | integer | no | Number of pages in the production deployment | | `orgSlug` | string | no | | | `git` | object | no | Present when a Git repository is connected | | `git.url` | string | no | | | `git.branch` | string | no | | | `git.hasToken` | boolean | no | | | `git.webhookUrl` | string | no | | | `git.webhookSecret` | string | no | | | `production` | object | no | | | `production.id` | string | no | | | `production.siteId` | string | no | | | `production.kind` | enum | no | Allowed: `production`, `preview`. | | `production.status` | enum | no | Allowed: `queued`, `building`, `ready`, `failed`, `canceled`. | | `production.source` | string | no | `cli` (upload), `hosted` (hosted repository), or `git` | | `production.branch` | string | no | | | `production.commitSha` | string | no | | | `production.message` | string | no | | | `production.createdBy` | object | no | Who triggered it; with an API key, the person who created the key | | `production.createdBy.id` | string | no | | | `production.createdBy.name` | string | no | | | `production.apiKey` | object | no | The name, start and end of the key, when triggered with an API key (CLI / CI) | | `production.apiKey.name` | string | no | | | `production.apiKey.prefix` | string | no | First 10 characters of the key | | `production.apiKey.suffix` | string | no | Last 10 characters of the key | | `production.error` | string | no | Reason for failure | | `production.pageCount` | integer | no | | | `production.sizeBytes` | integer | no | | | `production.durationMs` | integer | no | | | `production.url` | URL | no | Present after success. Production deployments have the site's URL; previews use a `<site>--<last 8 characters of the id>` subdomain | | `production.isCurrent` | boolean | no | Whether this is the current production deployment | | `production.createdAt` | integer | no | | | `production.finishedAt` | integer | no | | | `domains` | list of objects | no | | | `domains[].domain` | string | no | | | `domains[].verified` | boolean | no | | | `domains[].primary` | boolean | no | Whether this is the primary domain | | `domains[].verifyRecord` | object | no | TXT record to add | | `domains[].verifyRecord.type` | "TXT" | no | Allowed: `TXT`. | | `domains[].verifyRecord.name` | string | no | | | `domains[].verifyRecord.value` | string | no | | | `domains[].cname` | string | no | CNAME target | | `domains[].createdAt` | integer | no | | | `access` | object | no | | | `access.mode` | enum | no | Allowed: `public`, `password`. | | `ai` | object | no | | | `ai.enabled` | boolean | no | | | `ai.provider` | enum | no | Allowed: `anthropic`, `deepseek`, `openrouter`. | | `ai.model` | string | no | | | `ai.hasKey` | boolean | no | Whether a site key is set | | `ai.keyMasked` | string | no | | | `ai.platformKeyAvailable` | boolean | no | Whether the platform has a default key for the current provider | | `ai.platformKeys` | map from strings to booleans | no | Whether each provider has a platform key | | `ai.guidance` | string | no | | | `ai.effort` | enum | no | Reasoning effort; `null` uses the model's suggested level May be null. Allowed: `none`, `minimal`, `low`, `medium`, `high`, `xhigh`, `max`. | | `ai.retentionDays` | integer | no | Days to keep questions; `null` keeps them forever May be null. | | `ai.dailyLimit` | integer | no | Maximum questions that call the model in a rolling 24 hours; `null` means no limit May be null. | | `ai.agent` | boolean | no | Whether console AI is on | | `ai.gaps` | boolean | no | Whether documentation gaps are sorted every day | | `ai.support` | object | no | Contact when AI has no answer | | `ai.support.enabled` | boolean | no | | | `ai.support.url` | string | no | | | `ai.support.email` | string | no | | | `primaryUrl` | URL | no | The address on the primary domain; the same as `url` without a custom domain | | `mcpUrl` | URL | no | | ### 404 The resource doesn't exist, or you don't have access to it Content type: `application/json` | Field | Type | Required | Description | |---|---|---|---| | `error` | string | yes | Human-readable error message | | `code` | string | no | Machine-readable error code (some endpoints) | ### Example response (200) ```json { "id": "site_2m4k8p", "slug": "acme-payments", "name": "Acme Docs", "url": "https://acme-payments-sites.butterix.com", "sourceType": "hosted", "status": "queued", "updatedAt": 1, "pageCount": 94, "orgSlug": "acme", "git": { "url": "https://github.com/acme/docs.git", "branch": "main", "hasToken": true, "webhookUrl": "https://api.butterix.com/v1/webhooks/github/site_2m4k8p", "webhookSecret": "string" }, "production": { "id": "dpl_01jd8x2k7q", "siteId": "site_2m4k8p", "kind": "production", "status": "queued", "source": "git", "branch": "main", "commitSha": "9fceb02d0ae598e95dc970b74767f19372d61af8", "message": "docs: update quickstart", "createdBy": { "id": "string", "name": "string" }, "apiKey": { "name": "GitHub Actions", "prefix": "biti_a1B2c", "suffix": "Kd82mQx0Zt" }, "error": "string", "pageCount": 94, "sizeBytes": 5832110, "durationMs": 6120, "url": "https://acme-payments--8x2k7q-sites.butterix.com", "isCurrent": true, "createdAt": 1, "finishedAt": 1 }, "domains": [ { "domain": "docs.acme.com", "verified": false, "primary": false, "verifyRecord": { "type": "TXT", "name": "_butterix.docs.acme.com", "value": "butterix-verify=a1b2c3d4e5f6" }, "cname": "sites.butterix.com", "createdAt": 1 } ], "access": { "mode": "public" }, "ai": { "enabled": true, "provider": "anthropic", "model": "claude-opus-5-5", "hasKey": true, "keyMasked": "sk-a…9f2c", "platformKeyAvailable": true, "platformKeys": { "key": true }, "guidance": "string", "effort": "none", "retentionDays": 1, "dailyLimit": 200, "agent": true, "gaps": false, "support": { "enabled": false, "url": "", "email": "" } }, "primaryUrl": "https://docs.acme.com", "mcpUrl": "https://docs.acme.com/_mcp/server" } ``` --- # Rename site `PATCH /sites/{site}` Requires the `admin` role. The subdomain (slug) can't be changed after creation. Base URL: https://api.butterix.com/v1 Authentication: bearer token in Authorization header or API key in cookie `biti_session` ## Path parameters | Name | Type | Required | Description | |---|---|---|---| | `site` | string | yes | Site slug or id | ## Request body Content type: `application/json` | Field | Type | Required | Description | |---|---|---|---| | `name` | string | no | | ## Example request ```bash curl -X PATCH https://api.butterix.com/v1/sites/acme-payments \ -H "Authorization: Bearer <token>" \ -H "Content-Type: application/json" \ -d '{}' ``` ## Responses ### 200 Site details Content type: `application/json` | Field | Type | Required | Description | |---|---|---|---| | `id` | string | no | | | `slug` | string | no | | | `name` | string | no | | | `url` | URL | no | | | `sourceType` | enum | no | Content source: hosted repository, external Git repository, or CLI upload Allowed: `hosted`, `git`, `upload`. | | `status` | enum | no | Status of the latest deployment; `none` when there isn't one Allowed: `queued`, `building`, `ready`, `failed`, `canceled`, `none`. | | `updatedAt` | integer | no | | | `pageCount` | integer | no | Number of pages in the production deployment | | `orgSlug` | string | no | | | `git` | object | no | Present when a Git repository is connected | | `git.url` | string | no | | | `git.branch` | string | no | | | `git.hasToken` | boolean | no | | | `git.webhookUrl` | string | no | | | `git.webhookSecret` | string | no | | | `production` | object | no | | | `production.id` | string | no | | | `production.siteId` | string | no | | | `production.kind` | enum | no | Allowed: `production`, `preview`. | | `production.status` | enum | no | Allowed: `queued`, `building`, `ready`, `failed`, `canceled`. | | `production.source` | string | no | `cli` (upload), `hosted` (hosted repository), or `git` | | `production.branch` | string | no | | | `production.commitSha` | string | no | | | `production.message` | string | no | | | `production.createdBy` | object | no | Who triggered it; with an API key, the person who created the key | | `production.createdBy.id` | string | no | | | `production.createdBy.name` | string | no | | | `production.apiKey` | object | no | The name, start and end of the key, when triggered with an API key (CLI / CI) | | `production.apiKey.name` | string | no | | | `production.apiKey.prefix` | string | no | First 10 characters of the key | | `production.apiKey.suffix` | string | no | Last 10 characters of the key | | `production.error` | string | no | Reason for failure | | `production.pageCount` | integer | no | | | `production.sizeBytes` | integer | no | | | `production.durationMs` | integer | no | | | `production.url` | URL | no | Present after success. Production deployments have the site's URL; previews use a `<site>--<last 8 characters of the id>` subdomain | | `production.isCurrent` | boolean | no | Whether this is the current production deployment | | `production.createdAt` | integer | no | | | `production.finishedAt` | integer | no | | | `domains` | list of objects | no | | | `domains[].domain` | string | no | | | `domains[].verified` | boolean | no | | | `domains[].primary` | boolean | no | Whether this is the primary domain | | `domains[].verifyRecord` | object | no | TXT record to add | | `domains[].verifyRecord.type` | "TXT" | no | Allowed: `TXT`. | | `domains[].verifyRecord.name` | string | no | | | `domains[].verifyRecord.value` | string | no | | | `domains[].cname` | string | no | CNAME target | | `domains[].createdAt` | integer | no | | | `access` | object | no | | | `access.mode` | enum | no | Allowed: `public`, `password`. | | `ai` | object | no | | | `ai.enabled` | boolean | no | | | `ai.provider` | enum | no | Allowed: `anthropic`, `deepseek`, `openrouter`. | | `ai.model` | string | no | | | `ai.hasKey` | boolean | no | Whether a site key is set | | `ai.keyMasked` | string | no | | | `ai.platformKeyAvailable` | boolean | no | Whether the platform has a default key for the current provider | | `ai.platformKeys` | map from strings to booleans | no | Whether each provider has a platform key | | `ai.guidance` | string | no | | | `ai.effort` | enum | no | Reasoning effort; `null` uses the model's suggested level May be null. Allowed: `none`, `minimal`, `low`, `medium`, `high`, `xhigh`, `max`. | | `ai.retentionDays` | integer | no | Days to keep questions; `null` keeps them forever May be null. | | `ai.dailyLimit` | integer | no | Maximum questions that call the model in a rolling 24 hours; `null` means no limit May be null. | | `ai.agent` | boolean | no | Whether console AI is on | | `ai.gaps` | boolean | no | Whether documentation gaps are sorted every day | | `ai.support` | object | no | Contact when AI has no answer | | `ai.support.enabled` | boolean | no | | | `ai.support.url` | string | no | | | `ai.support.email` | string | no | | | `primaryUrl` | URL | no | The address on the primary domain; the same as `url` without a custom domain | | `mcpUrl` | URL | no | | ### Example response (200) ```json { "id": "site_2m4k8p", "slug": "acme-payments", "name": "Acme Docs", "url": "https://acme-payments-sites.butterix.com", "sourceType": "hosted", "status": "queued", "updatedAt": 1, "pageCount": 94, "orgSlug": "acme", "git": { "url": "https://github.com/acme/docs.git", "branch": "main", "hasToken": true, "webhookUrl": "https://api.butterix.com/v1/webhooks/github/site_2m4k8p", "webhookSecret": "string" }, "production": { "id": "dpl_01jd8x2k7q", "siteId": "site_2m4k8p", "kind": "production", "status": "queued", "source": "git", "branch": "main", "commitSha": "9fceb02d0ae598e95dc970b74767f19372d61af8", "message": "docs: update quickstart", "createdBy": { "id": "string", "name": "string" }, "apiKey": { "name": "GitHub Actions", "prefix": "biti_a1B2c", "suffix": "Kd82mQx0Zt" }, "error": "string", "pageCount": 94, "sizeBytes": 5832110, "durationMs": 6120, "url": "https://acme-payments--8x2k7q-sites.butterix.com", "isCurrent": true, "createdAt": 1, "finishedAt": 1 }, "domains": [ { "domain": "docs.acme.com", "verified": false, "primary": false, "verifyRecord": { "type": "TXT", "name": "_butterix.docs.acme.com", "value": "butterix-verify=a1b2c3d4e5f6" }, "cname": "sites.butterix.com", "createdAt": 1 } ], "access": { "mode": "public" }, "ai": { "enabled": true, "provider": "anthropic", "model": "claude-opus-5-5", "hasKey": true, "keyMasked": "sk-a…9f2c", "platformKeyAvailable": true, "platformKeys": { "key": true }, "guidance": "string", "effort": "none", "retentionDays": 1, "dailyLimit": 200, "agent": true, "gaps": false, "support": { "enabled": false, "url": "", "email": "" } }, "primaryUrl": "https://docs.acme.com", "mcpUrl": "https://docs.acme.com/_mcp/server" } ``` --- # Delete site `DELETE /sites/{site}` Requires the `admin` role. Permanently deletes the site, all deployment files, the hosted repository, domain mappings, and analytics data. **This can't be undone.** Base URL: https://api.butterix.com/v1 Authentication: bearer token in Authorization header or API key in cookie `biti_session` ## Path parameters | Name | Type | Required | Description | |---|---|---|---| | `site` | string | yes | Site slug or id | ## Example request ```bash curl -X DELETE https://api.butterix.com/v1/sites/acme-payments \ -H "Authorization: Bearer <token>" ``` ## Responses ### 200 Success Content type: `application/json` | Field | Type | Required | Description | |---|---|---|---| | `ok` | true | no | Allowed: `true`. | ### Example response (200) ```json { "ok": true } ``` --- # Set access control `PUT /sites/{site}/access` Requires the `admin` role. In `password` mode, visitors see a password page on their first visit and get an access cookie valid for 30 days once verified. If a password was set before, you can switch to `password` mode without `password` (the old one is kept). Changing the password signs out every visitor and MCP sign-in; access tokens aren't affected. Base URL: https://api.butterix.com/v1 Authentication: bearer token in Authorization header or API key in cookie `biti_session` ## Path parameters | Name | Type | Required | Description | |---|---|---|---| | `site` | string | yes | Site slug or id | ## Request body Content type: `application/json` | Field | Type | Required | Description | |---|---|---|---| | `mode` | enum | yes | Allowed: `public`, `password`. | | `password` | string | no | | ## Example request ```bash curl -X PUT https://api.butterix.com/v1/sites/acme-payments/access \ -H "Authorization: Bearer <token>" \ -H "Content-Type: application/json" \ -d '{ "mode": "password", "password": "preview-2026" }' ``` ## Responses ### 200 Current mode Content type: `application/json` | Field | Type | Required | Description | |---|---|---|---| | `mode` | enum | no | Allowed: `public`, `password`. | ### 400 Invalid request parameters Content type: `application/json` | Field | Type | Required | Description | |---|---|---|---| | `error` | string | yes | Human-readable error message | | `code` | string | no | Machine-readable error code (some endpoints) | ### Example response (200) ```json { "mode": "public" } ``` --- # List access tokens `GET /sites/{site}/access-tokens` Requires the `admin` role. Includes access tokens and MCP sign-ins that are still valid; the tokens themselves aren't returned. Base URL: https://api.butterix.com/v1 Authentication: bearer token in Authorization header or API key in cookie `biti_session` ## Path parameters | Name | Type | Required | Description | |---|---|---|---| | `site` | string | yes | Site slug or id | ## Example request ```bash curl https://api.butterix.com/v1/sites/acme-payments/access-tokens \ -H "Authorization: Bearer <token>" ``` ## Responses ### 200 Access tokens Content type: `application/json` | Field | Type | Required | Description | |---|---|---|---| | `[].id` | string | no | | | `[].kind` | enum | no | `token` for access tokens, `oauth` for MCP sign-ins Allowed: `token`, `oauth`. | | `[].name` | string | no | | | `[].prefix` | string | no | Beginning of the token | | `[].expiresAt` | integer | no | When it expires; `null` means it stays valid May be null. | | `[].createdAt` | integer | no | | | `[].lastUsedAt` | integer | no | May be null. | ### Example response (200) ```json [ { "id": "tok_01jd8x2k7q", "kind": "token", "name": "Internal assistant", "prefix": "bxt_a1b2c3", "expiresAt": 1, "createdAt": 1, "lastUsedAt": 1 } ] ``` --- # Create access token `POST /sites/{site}/access-tokens` Requires the `admin` role. For reading the pages, `.md`, `llms.txt`, and MCP server of a password-protected site with `Authorization Bearer`. The token is returned only once, on creation. A site can have up to 50. Base URL: https://api.butterix.com/v1 Authentication: bearer token in Authorization header or API key in cookie `biti_session` ## Path parameters | Name | Type | Required | Description | |---|---|---|---| | `site` | string | yes | Site slug or id | ## Request body Content type: `application/json` | Field | Type | Required | Description | |---|---|---|---| | `name` | string | yes | | | `expiresInDays` | integer | no | Days until it expires; left out or `null` means it stays valid May be null. | ## Example request ```bash curl -X POST https://api.butterix.com/v1/sites/acme-payments/access-tokens \ -H "Authorization: Bearer <token>" \ -H "Content-Type: application/json" \ -d '{ "name": "Internal assistant" }' ``` ## Responses ### 201 New token Content type: `application/json` | Field | Type | Required | Description | |---|---|---|---| | `id` | string | no | | | `token` | string | no | The full token, returned only this once | ### 400 Invalid request parameters Content type: `application/json` | Field | Type | Required | Description | |---|---|---|---| | `error` | string | yes | Human-readable error message | | `code` | string | no | Machine-readable error code (some endpoints) | ### Example response (201) ```json { "id": "tok_01jd8x2k7q", "token": "bxt_xxxxxxxxxxxxxxxx" } ``` --- # Revoke access token `DELETE /sites/{site}/access-tokens/{id}` Requires the `admin` role. Base URL: https://api.butterix.com/v1 Authentication: bearer token in Authorization header or API key in cookie `biti_session` ## Path parameters | Name | Type | Required | Description | |---|---|---|---| | `site` | string | yes | Site slug or id | | `id` | string | yes | Token id | ## Example request ```bash curl -X DELETE https://api.butterix.com/v1/sites/acme-payments/access-tokens/tok_01jd8x2k7q \ -H "Authorization: Bearer <token>" ``` ## Responses ### 200 Success Content type: `application/json` | Field | Type | Required | Description | |---|---|---|---| | `ok` | true | no | Allowed: `true`. | ### 404 The resource doesn't exist, or you don't have access to it Content type: `application/json` | Field | Type | Required | Description | |---|---|---|---| | `error` | string | yes | Human-readable error message | | `code` | string | no | Machine-readable error code (some endpoints) | ### Example response (200) ```json { "ok": true } ``` --- # Suggested redirects for 404s `GET /sites/{site}/redirects` Addresses readers visited in the last 30 days that don't exist, with suggested pages, moved sections that can become one rule, and the redirects already added. Base URL: https://api.butterix.com/v1 Authentication: bearer token in Authorization header or API key in cookie `biti_session` ## Path parameters | Name | Type | Required | Description | |---|---|---|---| | `site` | string | yes | Site slug or id | ## Example request ```bash curl https://api.butterix.com/v1/sites/acme-payments/redirects \ -H "Authorization: Bearer <token>" ``` ## Responses ### 200 Suggestions and redirects Content type: `application/json` | Field | Type | Required | Description | |---|---|---|---| | `suggestions` | list of objects | no | | | `suggestions[].path` | string | no | | | `suggestions[].count` | integer | no | | | `suggestions[].last` | integer | no | | | `suggestions[].target` | object | no | 地址最像的页面;没有把握时不给 | | `suggestions[].target.path` | string | no | | | `suggestions[].target.title` | string | no | | | `suggestions[].target.score` | number | no | | | `groups` | list of objects | no | | | `groups[].from` | string | no | | | `groups[].to` | string | no | | | `groups[].paths` | list of strings | no | | | `groups[].count` | integer | no | | | `rules` | list of objects | no | | | `rules[].from` | string | no | | | `rules[].to` | string | no | | | `rules[].status` | enum | no | Allowed: `301`, `302`. | | `rules[].at` | integer | no | | | `rules[].active` | boolean | no | 原地址有了页面时为 false,不再跳转 | ### Example response (200) ```json { "suggestions": [ { "path": "/gide", "count": 12, "last": 1, "target": { "path": "/guide", "title": "string", "score": 1.1 } } ], "groups": [ { "from": "/docs/old/*", "to": "/docs/new/:splat", "paths": [ "string" ], "count": 1 } ], "rules": [ { "from": "string", "to": "string", "status": 301, "at": 1, "active": true } ] } ``` --- # Add a redirect `POST /sites/{site}/redirects` Requires the `editor` role. Works right away, without a deployment, and only while the address has no page. The source starts with `/` and may end with `/*`; the target must be an address on this site and may use `:splat`. Up to 200. Base URL: https://api.butterix.com/v1 Authentication: bearer token in Authorization header or API key in cookie `biti_session` ## Path parameters | Name | Type | Required | Description | |---|---|---|---| | `site` | string | yes | Site slug or id | ## Request body Content type: `application/json` | Field | Type | Required | Description | |---|---|---|---| | `from` | string | yes | | | `to` | string | yes | | | `status` | enum | no | Allowed: `301`, `302`. | ## Example request ```bash curl -X POST https://api.butterix.com/v1/sites/acme-payments/redirects \ -H "Authorization: Bearer <token>" \ -H "Content-Type: application/json" \ -d '{ "from": "/docs/old/*", "to": "/docs/new/:splat" }' ``` ## Responses ### 201 All redirects now --- # Remove a redirect `DELETE /sites/{site}/redirects` Requires the `editor` role. Base URL: https://api.butterix.com/v1 Authentication: bearer token in Authorization header or API key in cookie `biti_session` ## Path parameters | Name | Type | Required | Description | |---|---|---|---| | `site` | string | yes | Site slug or id | ## Query parameters | Name | Type | Required | Description | |---|---|---|---| | `from` | string | yes | | ## Example request ```bash curl -X DELETE https://api.butterix.com/v1/sites/acme-payments/redirects?from=%2Fgide \ -H "Authorization: Bearer <token>" ``` ## Responses ### 200 All redirects now --- # List what can be exported `GET /sites/{site}/export` The languages, versions, tabs and sections of the live version, and how many pages each has. `outline` is `null` while there is nothing to export. Base URL: https://api.butterix.com/v1 Authentication: bearer token in Authorization header or API key in cookie `biti_session` ## Path parameters | Name | Type | Required | Description | |---|---|---|---| | `site` | string | yes | Site slug or id | ## Example request ```bash curl https://api.butterix.com/v1/sites/acme-payments/export \ -H "Authorization: Bearer <token>" ``` ## Responses ### 200 What can be exported Content type: `application/json` | Field | Type | Required | Description | |---|---|---|---| | `outline` | object | no | May be null. | | `outline.title` | string | no | | | `outline.variants` | list of objects | no | | | `outline.variants[].key` | string | no | | | `outline.variants[].locale` | string | no | | | `outline.variants[].version` | string | no | | | `outline.variants[].product` | string | no | | | `outline.variants[].default` | boolean | no | | | `outline.variants[].pages` | integer | no | | | `outline.variants[].tabs` | list of objects | no | | | `outline.variants[].tabs[].id` | string | no | | | `outline.variants[].tabs[].title` | string | no | | | `outline.variants[].tabs[].pages` | integer | no | | | `outline.variants[].tabs[].sections` | list of objects | no | | ### Example response (200) ```json { "outline": { "title": "Acme", "variants": [ { "key": "zh||v1", "locale": "zh", "version": "v1", "product": "string", "default": true, "pages": 194, "tabs": [ { "id": "guides", "title": "指南", "pages": 44, "sections": [ {} ] } ] } ] } } ``` --- # Export Markdown `GET /sites/{site}/export/markdown` A ZIP of the live version's Markdown: one file per page, with images (up to 50 MB in total; the rest keep their address on the site) and relative links between pages. One export per member at a time, and up to 10 in ten minutes (30 for the organization). Downloads that are too slow are cut off. Base URL: https://api.butterix.com/v1 Authentication: bearer token in Authorization header or API key in cookie `biti_session` ## Path parameters | Name | Type | Required | Description | |---|---|---|---| | `site` | string | yes | Site slug or id | ## Query parameters | Name | Type | Required | Description | |---|---|---|---| | `variant` | string | no | Language and version, a `key` from what can be exported; the default language and version if left out | | `part` | string | no | The `id` of a tab or section; everything if left out | ## Example request ```bash curl https://api.butterix.com/v1/sites/acme-payments/export/markdown \ -H "Authorization: Bearer <token>" ``` ## Responses ### 200 The ZIP Content type: `application/zip` Type: file ### Example response (200) ```json "<file>" ``` --- # List deployments `GET /sites/{site}/deployments` Base URL: https://api.butterix.com/v1 Authentication: bearer token in Authorization header or API key in cookie `biti_session` ## Path parameters | Name | Type | Required | Description | |---|---|---|---| | `site` | string | yes | Site slug or id | ## Query parameters | Name | Type | Required | Description | |---|---|---|---| | `limit` | integer | no | Number of items, 200 at most | ## Example request ```bash curl https://api.butterix.com/v1/sites/acme-payments/deployments \ -H "Authorization: Bearer <token>" ``` ## Responses ### 200 Deployments, newest first Content type: `application/json` | Field | Type | Required | Description | |---|---|---|---| | `[].id` | string | no | | | `[].siteId` | string | no | | | `[].kind` | enum | no | Allowed: `production`, `preview`. | | `[].status` | enum | no | Allowed: `queued`, `building`, `ready`, `failed`, `canceled`. | | `[].source` | string | no | `cli` (upload), `hosted` (hosted repository), or `git` | | `[].branch` | string | no | | | `[].commitSha` | string | no | | | `[].message` | string | no | | | `[].createdBy` | object | no | Who triggered it; with an API key, the person who created the key | | `[].createdBy.id` | string | no | | | `[].createdBy.name` | string | no | | | `[].apiKey` | object | no | The name, start and end of the key, when triggered with an API key (CLI / CI) | | `[].apiKey.name` | string | no | | | `[].apiKey.prefix` | string | no | First 10 characters of the key | | `[].apiKey.suffix` | string | no | Last 10 characters of the key | | `[].error` | string | no | Reason for failure | | `[].pageCount` | integer | no | | | `[].sizeBytes` | integer | no | | | `[].durationMs` | integer | no | | | `[].url` | URL | no | Present after success. Production deployments have the site's URL; previews use a `<site>--<last 8 characters of the id>` subdomain | | `[].isCurrent` | boolean | no | Whether this is the current production deployment | | `[].createdAt` | integer | no | | | `[].finishedAt` | integer | no | | ### Example response (200) ```json [ { "id": "dpl_01jd8x2k7q", "siteId": "site_2m4k8p", "kind": "production", "status": "queued", "source": "git", "branch": "main", "commitSha": "9fceb02d0ae598e95dc970b74767f19372d61af8", "message": "docs: update quickstart", "createdBy": { "id": "string", "name": "string" }, "apiKey": { "name": "GitHub Actions", "prefix": "biti_a1B2c", "suffix": "Kd82mQx0Zt" }, "error": "string", "pageCount": 94, "sizeBytes": 5832110, "durationMs": 6120, "url": "https://acme-payments--8x2k7q-sites.butterix.com", "isCurrent": true, "createdAt": 1, "finishedAt": 1 } ] ``` --- # Create deployment `POST /sites/{site}/deployments` Requires the `editor` role. There are two ways to use it: 1. **Upload source** (used by `biti deploy`): the request body is a gzip tarball of the project directory (`Content-Type: application/gzip`, up to 200 MB). The `x-biti-preview: 1` header creates a preview deployment, and `x-biti-message` is the URL-encoded deployment message. 2. **Rebuild from the repository**: JSON `{ preview?, branch? }`, building from the hosted repository or the connected Git repository. Not available for sites that have been uploaded with the CLI. Returns 202 and the deployment id; poll its status with [Get deployment](https://docs.butterix.com/en/api-reference/deployments/get-deployment.md). Base URL: https://api.butterix.com/v1 Authentication: bearer token in Authorization header or API key in cookie `biti_session` ## Path parameters | Name | Type | Required | Description | |---|---|---|---| | `site` | string | yes | Site slug or id | ## Header parameters | Name | Type | Required | Description | |---|---|---|---| | `x-biti-preview` | enum | no | When uploading source: `1` for a preview deployment Allowed: `0`, `1`. | | `x-biti-message` | string | no | When uploading source: URL-encoded deployment message | ## Request body Content type: `application/json` | Field | Type | Required | Description | |---|---|---|---| | `preview` | boolean | no | Create a preview deployment instead of a production one | | `branch` | string | no | Branch to build; the site's production branch by default | ## Example request ```bash tar --exclude=node_modules --exclude=.git --exclude=dist -czf site.tgz . curl -X POST https://api.butterix.com/v1/sites/acme-payments/deployments \ -H "Authorization: Bearer $BITI_TOKEN" \ -H "Content-Type: application/gzip" \ -H "x-biti-preview: 1" \ --data-binary @site.tgz ``` ## Responses ### 202 Queued Content type: `application/json` | Field | Type | Required | Description | |---|---|---|---| | `id` | string | no | | ### 400 Invalid request parameters Content type: `application/json` | Field | Type | Required | Description | |---|---|---|---| | `error` | string | yes | Human-readable error message | | `code` | string | no | Machine-readable error code (some endpoints) | ### 413 Upload larger than 200 MB Content type: `application/json` | Field | Type | Required | Description | |---|---|---|---| | `error` | string | yes | Human-readable error message | | `code` | string | no | Machine-readable error code (some endpoints) | ### Example response (202) ```json { "id": "dpl_01jd8x2k7q" } ``` --- # Get deployment `GET /deployments/{id}` Deployment details and build log. While a build is running, `log` is live. Base URL: https://api.butterix.com/v1 Authentication: bearer token in Authorization header or API key in cookie `biti_session` ## Path parameters | Name | Type | Required | Description | |---|---|---|---| | `id` | string | yes | | ## Example request ```bash curl https://api.butterix.com/v1/deployments/dpl_01jd8x2k7q \ -H "Authorization: Bearer <token>" ``` ## Responses ### 200 Deployments Content type: `application/json` | Field | Type | Required | Description | |---|---|---|---| | `id` | string | no | | | `siteId` | string | no | | | `kind` | enum | no | Allowed: `production`, `preview`. | | `status` | enum | no | Allowed: `queued`, `building`, `ready`, `failed`, `canceled`. | | `source` | string | no | `cli` (upload), `hosted` (hosted repository), or `git` | | `branch` | string | no | | | `commitSha` | string | no | | | `message` | string | no | | | `createdBy` | object | no | Who triggered it; with an API key, the person who created the key | | `createdBy.id` | string | no | | | `createdBy.name` | string | no | | | `apiKey` | object | no | The name, start and end of the key, when triggered with an API key (CLI / CI) | | `apiKey.name` | string | no | | | `apiKey.prefix` | string | no | First 10 characters of the key | | `apiKey.suffix` | string | no | Last 10 characters of the key | | `error` | string | no | Reason for failure | | `pageCount` | integer | no | | | `sizeBytes` | integer | no | | | `durationMs` | integer | no | | | `url` | URL | no | Present after success. Production deployments have the site's URL; previews use a `<site>--<last 8 characters of the id>` subdomain | | `isCurrent` | boolean | no | Whether this is the current production deployment | | `createdAt` | integer | no | | | `finishedAt` | integer | no | | | `log` | string | no | Build log | ### 404 The resource doesn't exist, or you don't have access to it Content type: `application/json` | Field | Type | Required | Description | |---|---|---|---| | `error` | string | yes | Human-readable error message | | `code` | string | no | Machine-readable error code (some endpoints) | ### Example response (200) ```json { "id": "dpl_01jd8x2k7q", "siteId": "site_2m4k8p", "kind": "production", "status": "queued", "source": "git", "branch": "main", "commitSha": "9fceb02d0ae598e95dc970b74767f19372d61af8", "message": "docs: update quickstart", "createdBy": { "id": "string", "name": "string" }, "apiKey": { "name": "GitHub Actions", "prefix": "biti_a1B2c", "suffix": "Kd82mQx0Zt" }, "error": "string", "pageCount": 94, "sizeBytes": 5832110, "durationMs": 6120, "url": "https://acme-payments--8x2k7q-sites.butterix.com", "isCurrent": true, "createdAt": 1, "finishedAt": 1, "log": "string" } ``` --- # Promote to production (roll back) `POST /deployments/{id}/promote` Requires the `editor` role. Makes any `ready` deployment (including previews and earlier production deployments) the production one. It only switches a pointer: it takes effect immediately, without a rebuild. Base URL: https://api.butterix.com/v1 Authentication: bearer token in Authorization header or API key in cookie `biti_session` ## Path parameters | Name | Type | Required | Description | |---|---|---|---| | `id` | string | yes | | ## Example request ```bash curl -X POST https://api.butterix.com/v1/deployments/dpl_01jd8x2k7q/promote \ -H "Authorization: Bearer <token>" ``` ## Responses ### 200 New production deployment Content type: `application/json` | Field | Type | Required | Description | |---|---|---|---| | `id` | string | no | | | `siteId` | string | no | | | `kind` | enum | no | Allowed: `production`, `preview`. | | `status` | enum | no | Allowed: `queued`, `building`, `ready`, `failed`, `canceled`. | | `source` | string | no | `cli` (upload), `hosted` (hosted repository), or `git` | | `branch` | string | no | | | `commitSha` | string | no | | | `message` | string | no | | | `createdBy` | object | no | Who triggered it; with an API key, the person who created the key | | `createdBy.id` | string | no | | | `createdBy.name` | string | no | | | `apiKey` | object | no | The name, start and end of the key, when triggered with an API key (CLI / CI) | | `apiKey.name` | string | no | | | `apiKey.prefix` | string | no | First 10 characters of the key | | `apiKey.suffix` | string | no | Last 10 characters of the key | | `error` | string | no | Reason for failure | | `pageCount` | integer | no | | | `sizeBytes` | integer | no | | | `durationMs` | integer | no | | | `url` | URL | no | Present after success. Production deployments have the site's URL; previews use a `<site>--<last 8 characters of the id>` subdomain | | `isCurrent` | boolean | no | Whether this is the current production deployment | | `createdAt` | integer | no | | | `finishedAt` | integer | no | | ### 400 Invalid request parameters Content type: `application/json` | Field | Type | Required | Description | |---|---|---|---| | `error` | string | yes | Human-readable error message | | `code` | string | no | Machine-readable error code (some endpoints) | ### Example response (200) ```json { "id": "dpl_01jd8x2k7q", "siteId": "site_2m4k8p", "kind": "production", "status": "queued", "source": "git", "branch": "main", "commitSha": "9fceb02d0ae598e95dc970b74767f19372d61af8", "message": "docs: update quickstart", "createdBy": { "id": "string", "name": "string" }, "apiKey": { "name": "GitHub Actions", "prefix": "biti_a1B2c", "suffix": "Kd82mQx0Zt" }, "error": "string", "pageCount": 94, "sizeBytes": 5832110, "durationMs": 6120, "url": "https://acme-payments--8x2k7q-sites.butterix.com", "isCurrent": true, "createdAt": 1, "finishedAt": 1 } ``` --- # Cancel deployment `POST /deployments/{id}/cancel` Only deployments still in the queue (`queued`) can be canceled. Base URL: https://api.butterix.com/v1 Authentication: bearer token in Authorization header or API key in cookie `biti_session` ## Path parameters | Name | Type | Required | Description | |---|---|---|---| | `id` | string | yes | | ## Example request ```bash curl -X POST https://api.butterix.com/v1/deployments/dpl_01jd8x2k7q/cancel \ -H "Authorization: Bearer <token>" ``` ## Responses ### 200 Success Content type: `application/json` | Field | Type | Required | Description | |---|---|---|---| | `ok` | true | no | Allowed: `true`. | ### 400 Invalid request parameters Content type: `application/json` | Field | Type | Required | Description | |---|---|---|---| | `error` | string | yes | Human-readable error message | | `code` | string | no | Machine-readable error code (some endpoints) | ### Example response (200) ```json { "ok": true } ``` --- # List domains `GET /sites/{site}/domains` Base URL: https://api.butterix.com/v1 Authentication: bearer token in Authorization header or API key in cookie `biti_session` ## Path parameters | Name | Type | Required | Description | |---|---|---|---| | `site` | string | yes | Site slug or id | ## Example request ```bash curl https://api.butterix.com/v1/sites/acme-payments/domains \ -H "Authorization: Bearer <token>" ``` ## Responses ### 200 Domains Content type: `application/json` | Field | Type | Required | Description | |---|---|---|---| | `[].domain` | string | no | | | `[].verified` | boolean | no | | | `[].primary` | boolean | no | Whether this is the primary domain | | `[].verifyRecord` | object | no | TXT record to add | | `[].verifyRecord.type` | "TXT" | no | Allowed: `TXT`. | | `[].verifyRecord.name` | string | no | | | `[].verifyRecord.value` | string | no | | | `[].cname` | string | no | CNAME target | | `[].createdAt` | integer | no | | ### Example response (200) ```json [ { "domain": "docs.acme.com", "verified": false, "primary": false, "verifyRecord": { "type": "TXT", "name": "_butterix.docs.acme.com", "value": "butterix-verify=a1b2c3d4e5f6" }, "cname": "sites.butterix.com", "createdAt": 1 } ] ``` --- # Add domain `POST /sites/{site}/domains` Requires the `admin` role. Returns the TXT verification record and CNAME target to configure. A domain can be connected to one site only. Base URL: https://api.butterix.com/v1 Authentication: bearer token in Authorization header or API key in cookie `biti_session` ## Path parameters | Name | Type | Required | Description | |---|---|---|---| | `site` | string | yes | Site slug or id | ## Request body Content type: `application/json` | Field | Type | Required | Description | |---|---|---|---| | `domain` | string | yes | | ## Example request ```bash curl -X POST https://api.butterix.com/v1/sites/acme-payments/domains \ -H "Authorization: Bearer <token>" \ -H "Content-Type: application/json" \ -d '{ "domain": "docs.acme.com" }' ``` ## Responses ### 201 New domain (unverified) Content type: `application/json` | Field | Type | Required | Description | |---|---|---|---| | `domain` | string | no | | | `verified` | boolean | no | | | `primary` | boolean | no | Whether this is the primary domain | | `verifyRecord` | object | no | TXT record to add | | `verifyRecord.type` | "TXT" | no | Allowed: `TXT`. | | `verifyRecord.name` | string | no | | | `verifyRecord.value` | string | no | | | `cname` | string | no | CNAME target | | `createdAt` | integer | no | | ### 400 Invalid request parameters Content type: `application/json` | Field | Type | Required | Description | |---|---|---|---| | `error` | string | yes | Human-readable error message | | `code` | string | no | Machine-readable error code (some endpoints) | ### 409 Conflict (name taken, already added, or merge conflict) Content type: `application/json` | Field | Type | Required | Description | |---|---|---|---| | `error` | string | yes | Human-readable error message | | `code` | string | no | Machine-readable error code (some endpoints) | ### Example response (201) ```json { "domain": "docs.acme.com", "verified": false, "primary": false, "verifyRecord": { "type": "TXT", "name": "_butterix.docs.acme.com", "value": "butterix-verify=a1b2c3d4e5f6" }, "cname": "sites.butterix.com", "createdAt": 1 } ``` --- # Verify domain `POST /sites/{site}/domains/{domain}/verify` Looks up the TXT record of `_butterix.<domain>`. When it matches, the domain is marked verified and starts pointing to the site, and the platform then issues an HTTPS certificate from Let's Encrypt automatically. Base URL: https://api.butterix.com/v1 Authentication: bearer token in Authorization header or API key in cookie `biti_session` ## Path parameters | Name | Type | Required | Description | |---|---|---|---| | `site` | string | yes | Site slug or id | | `domain` | string | yes | | ## Example request ```bash curl -X POST https://api.butterix.com/v1/sites/acme-payments/domains/docs.acme.com/verify \ -H "Authorization: Bearer <token>" ``` ## Responses ### 200 Verification result Content type: `application/json` | Field | Type | Required | Description | |---|---|---|---| | `domain` | string | no | | | `verified` | boolean | no | | | `primary` | boolean | no | Whether this is the primary domain | | `verifyRecord` | object | no | TXT record to add | | `verifyRecord.type` | "TXT" | no | Allowed: `TXT`. | | `verifyRecord.name` | string | no | | | `verifyRecord.value` | string | no | | | `cname` | string | no | CNAME target | | `createdAt` | integer | no | | | `checked` | true | no | Allowed: `true`. | ### Example response (200) ```json { "domain": "docs.acme.com", "verified": false, "primary": false, "verifyRecord": { "type": "TXT", "name": "_butterix.docs.acme.com", "value": "butterix-verify=a1b2c3d4e5f6" }, "cname": "sites.butterix.com", "createdAt": 1, "checked": true } ``` --- # Set primary domain `POST /sites/{site}/domains/{domain}/primary` Requires the `admin` role. Canonical URLs, the sitemap, `llms.txt`, and `.md` pages switch to this domain, and the live version is redeployed automatically. The domain must be verified and its HTTPS certificate active. Base URL: https://api.butterix.com/v1 Authentication: bearer token in Authorization header or API key in cookie `biti_session` ## Path parameters | Name | Type | Required | Description | |---|---|---|---| | `site` | string | yes | Site slug or id | | `domain` | string | yes | | ## Example request ```bash curl -X POST https://api.butterix.com/v1/sites/acme-payments/domains/docs.acme.com/primary \ -H "Authorization: Bearer <token>" ``` ## Responses ### 200 Primary domain Content type: `application/json` | Field | Type | Required | Description | |---|---|---|---| | `domain` | string | no | | | `verified` | boolean | no | | | `primary` | boolean | no | Whether this is the primary domain | | `verifyRecord` | object | no | TXT record to add | | `verifyRecord.type` | "TXT" | no | Allowed: `TXT`. | | `verifyRecord.name` | string | no | | | `verifyRecord.value` | string | no | | | `cname` | string | no | CNAME target | | `createdAt` | integer | no | | | `deployment` | string | no | 因此开始的部署;不需要或无法重新部署时没有 | ### 400 Invalid request parameters Content type: `application/json` | Field | Type | Required | Description | |---|---|---|---| | `error` | string | yes | Human-readable error message | | `code` | string | no | Machine-readable error code (some endpoints) | ### Example response (200) ```json { "domain": "docs.acme.com", "verified": false, "primary": false, "verifyRecord": { "type": "TXT", "name": "_butterix.docs.acme.com", "value": "butterix-verify=a1b2c3d4e5f6" }, "cname": "sites.butterix.com", "createdAt": 1, "deployment": "string" } ``` --- # Remove domain `DELETE /sites/{site}/domains/{domain}` Base URL: https://api.butterix.com/v1 Authentication: bearer token in Authorization header or API key in cookie `biti_session` ## Path parameters | Name | Type | Required | Description | |---|---|---|---| | `site` | string | yes | Site slug or id | | `domain` | string | yes | | ## Example request ```bash curl -X DELETE https://api.butterix.com/v1/sites/acme-payments/domains/docs.acme.com \ -H "Authorization: Bearer <token>" ``` ## Responses ### 200 Success Content type: `application/json` | Field | Type | Required | Description | |---|---|---|---| | `ok` | true | no | Allowed: `true`. | ### Example response (200) ```json { "ok": true } ``` --- # Connect Git repository `PUT /sites/{site}/git` Requires the `admin` role. Replaces the hosted repository with a remote one, pulls it right away, and starts a production deployment. Private repositories need an access token with read permission (stored encrypted); publishing from the visual editor also needs write permission. After connecting, configure a webhook in the repository (its URL and secret are in `git` in the response). Base URL: https://api.butterix.com/v1 Authentication: bearer token in Authorization header or API key in cookie `biti_session` ## Path parameters | Name | Type | Required | Description | |---|---|---|---| | `site` | string | yes | Site slug or id | ## Request body Content type: `application/json` | Field | Type | Required | Description | |---|---|---|---| | `url` | string | yes | https URL | | `branch` | string | no | | | `token` | string | no | Access token; leave empty to keep the current one | ## Example request ```bash curl -X PUT https://api.butterix.com/v1/sites/acme-payments/git \ -H "Authorization: Bearer <token>" \ -H "Content-Type: application/json" \ -d '{ "url": "https://github.com/acme/docs.git" }' ``` ## Responses ### 200 Site details Content type: `application/json` | Field | Type | Required | Description | |---|---|---|---| | `id` | string | no | | | `slug` | string | no | | | `name` | string | no | | | `url` | URL | no | | | `sourceType` | enum | no | Content source: hosted repository, external Git repository, or CLI upload Allowed: `hosted`, `git`, `upload`. | | `status` | enum | no | Status of the latest deployment; `none` when there isn't one Allowed: `queued`, `building`, `ready`, `failed`, `canceled`, `none`. | | `updatedAt` | integer | no | | | `pageCount` | integer | no | Number of pages in the production deployment | | `orgSlug` | string | no | | | `git` | object | no | Present when a Git repository is connected | | `git.url` | string | no | | | `git.branch` | string | no | | | `git.hasToken` | boolean | no | | | `git.webhookUrl` | string | no | | | `git.webhookSecret` | string | no | | | `production` | object | no | | | `production.id` | string | no | | | `production.siteId` | string | no | | | `production.kind` | enum | no | Allowed: `production`, `preview`. | | `production.status` | enum | no | Allowed: `queued`, `building`, `ready`, `failed`, `canceled`. | | `production.source` | string | no | `cli` (upload), `hosted` (hosted repository), or `git` | | `production.branch` | string | no | | | `production.commitSha` | string | no | | | `production.message` | string | no | | | `production.createdBy` | object | no | Who triggered it; with an API key, the person who created the key | | `production.createdBy.id` | string | no | | | `production.createdBy.name` | string | no | | | `production.apiKey` | object | no | The name, start and end of the key, when triggered with an API key (CLI / CI) | | `production.apiKey.name` | string | no | | | `production.apiKey.prefix` | string | no | First 10 characters of the key | | `production.apiKey.suffix` | string | no | Last 10 characters of the key | | `production.error` | string | no | Reason for failure | | `production.pageCount` | integer | no | | | `production.sizeBytes` | integer | no | | | `production.durationMs` | integer | no | | | `production.url` | URL | no | Present after success. Production deployments have the site's URL; previews use a `<site>--<last 8 characters of the id>` subdomain | | `production.isCurrent` | boolean | no | Whether this is the current production deployment | | `production.createdAt` | integer | no | | | `production.finishedAt` | integer | no | | | `domains` | list of objects | no | | | `domains[].domain` | string | no | | | `domains[].verified` | boolean | no | | | `domains[].primary` | boolean | no | Whether this is the primary domain | | `domains[].verifyRecord` | object | no | TXT record to add | | `domains[].verifyRecord.type` | "TXT" | no | Allowed: `TXT`. | | `domains[].verifyRecord.name` | string | no | | | `domains[].verifyRecord.value` | string | no | | | `domains[].cname` | string | no | CNAME target | | `domains[].createdAt` | integer | no | | | `access` | object | no | | | `access.mode` | enum | no | Allowed: `public`, `password`. | | `ai` | object | no | | | `ai.enabled` | boolean | no | | | `ai.provider` | enum | no | Allowed: `anthropic`, `deepseek`, `openrouter`. | | `ai.model` | string | no | | | `ai.hasKey` | boolean | no | Whether a site key is set | | `ai.keyMasked` | string | no | | | `ai.platformKeyAvailable` | boolean | no | Whether the platform has a default key for the current provider | | `ai.platformKeys` | map from strings to booleans | no | Whether each provider has a platform key | | `ai.guidance` | string | no | | | `ai.effort` | enum | no | Reasoning effort; `null` uses the model's suggested level May be null. Allowed: `none`, `minimal`, `low`, `medium`, `high`, `xhigh`, `max`. | | `ai.retentionDays` | integer | no | Days to keep questions; `null` keeps them forever May be null. | | `ai.dailyLimit` | integer | no | Maximum questions that call the model in a rolling 24 hours; `null` means no limit May be null. | | `ai.agent` | boolean | no | Whether console AI is on | | `ai.gaps` | boolean | no | Whether documentation gaps are sorted every day | | `ai.support` | object | no | Contact when AI has no answer | | `ai.support.enabled` | boolean | no | | | `ai.support.url` | string | no | | | `ai.support.email` | string | no | | | `primaryUrl` | URL | no | The address on the primary domain; the same as `url` without a custom domain | | `mcpUrl` | URL | no | | ### 400 Invalid request parameters Content type: `application/json` | Field | Type | Required | Description | |---|---|---|---| | `error` | string | yes | Human-readable error message | | `code` | string | no | Machine-readable error code (some endpoints) | ### Example response (200) ```json { "id": "site_2m4k8p", "slug": "acme-payments", "name": "Acme Docs", "url": "https://acme-payments-sites.butterix.com", "sourceType": "hosted", "status": "queued", "updatedAt": 1, "pageCount": 94, "orgSlug": "acme", "git": { "url": "https://github.com/acme/docs.git", "branch": "main", "hasToken": true, "webhookUrl": "https://api.butterix.com/v1/webhooks/github/site_2m4k8p", "webhookSecret": "string" }, "production": { "id": "dpl_01jd8x2k7q", "siteId": "site_2m4k8p", "kind": "production", "status": "queued", "source": "git", "branch": "main", "commitSha": "9fceb02d0ae598e95dc970b74767f19372d61af8", "message": "docs: update quickstart", "createdBy": { "id": "string", "name": "string" }, "apiKey": { "name": "GitHub Actions", "prefix": "biti_a1B2c", "suffix": "Kd82mQx0Zt" }, "error": "string", "pageCount": 94, "sizeBytes": 5832110, "durationMs": 6120, "url": "https://acme-payments--8x2k7q-sites.butterix.com", "isCurrent": true, "createdAt": 1, "finishedAt": 1 }, "domains": [ { "domain": "docs.acme.com", "verified": false, "primary": false, "verifyRecord": { "type": "TXT", "name": "_butterix.docs.acme.com", "value": "butterix-verify=a1b2c3d4e5f6" }, "cname": "sites.butterix.com", "createdAt": 1 } ], "access": { "mode": "public" }, "ai": { "enabled": true, "provider": "anthropic", "model": "claude-opus-5-5", "hasKey": true, "keyMasked": "sk-a…9f2c", "platformKeyAvailable": true, "platformKeys": { "key": true }, "guidance": "string", "effort": "none", "retentionDays": 1, "dailyLimit": 200, "agent": true, "gaps": false, "support": { "enabled": false, "url": "", "email": "" } }, "primaryUrl": "https://docs.acme.com", "mcpUrl": "https://docs.acme.com/_mcp/server" } ``` --- # Disconnect Git repository `DELETE /sites/{site}/git` Goes back to the ButterIX hosted repository; later pushes no longer trigger deployments. Base URL: https://api.butterix.com/v1 Authentication: bearer token in Authorization header or API key in cookie `biti_session` ## Path parameters | Name | Type | Required | Description | |---|---|---|---| | `site` | string | yes | Site slug or id | ## Example request ```bash curl -X DELETE https://api.butterix.com/v1/sites/acme-payments/git \ -H "Authorization: Bearer <token>" ``` ## Responses ### 200 Site details Content type: `application/json` | Field | Type | Required | Description | |---|---|---|---| | `id` | string | no | | | `slug` | string | no | | | `name` | string | no | | | `url` | URL | no | | | `sourceType` | enum | no | Content source: hosted repository, external Git repository, or CLI upload Allowed: `hosted`, `git`, `upload`. | | `status` | enum | no | Status of the latest deployment; `none` when there isn't one Allowed: `queued`, `building`, `ready`, `failed`, `canceled`, `none`. | | `updatedAt` | integer | no | | | `pageCount` | integer | no | Number of pages in the production deployment | | `orgSlug` | string | no | | | `git` | object | no | Present when a Git repository is connected | | `git.url` | string | no | | | `git.branch` | string | no | | | `git.hasToken` | boolean | no | | | `git.webhookUrl` | string | no | | | `git.webhookSecret` | string | no | | | `production` | object | no | | | `production.id` | string | no | | | `production.siteId` | string | no | | | `production.kind` | enum | no | Allowed: `production`, `preview`. | | `production.status` | enum | no | Allowed: `queued`, `building`, `ready`, `failed`, `canceled`. | | `production.source` | string | no | `cli` (upload), `hosted` (hosted repository), or `git` | | `production.branch` | string | no | | | `production.commitSha` | string | no | | | `production.message` | string | no | | | `production.createdBy` | object | no | Who triggered it; with an API key, the person who created the key | | `production.createdBy.id` | string | no | | | `production.createdBy.name` | string | no | | | `production.apiKey` | object | no | The name, start and end of the key, when triggered with an API key (CLI / CI) | | `production.apiKey.name` | string | no | | | `production.apiKey.prefix` | string | no | First 10 characters of the key | | `production.apiKey.suffix` | string | no | Last 10 characters of the key | | `production.error` | string | no | Reason for failure | | `production.pageCount` | integer | no | | | `production.sizeBytes` | integer | no | | | `production.durationMs` | integer | no | | | `production.url` | URL | no | Present after success. Production deployments have the site's URL; previews use a `<site>--<last 8 characters of the id>` subdomain | | `production.isCurrent` | boolean | no | Whether this is the current production deployment | | `production.createdAt` | integer | no | | | `production.finishedAt` | integer | no | | | `domains` | list of objects | no | | | `domains[].domain` | string | no | | | `domains[].verified` | boolean | no | | | `domains[].primary` | boolean | no | Whether this is the primary domain | | `domains[].verifyRecord` | object | no | TXT record to add | | `domains[].verifyRecord.type` | "TXT" | no | Allowed: `TXT`. | | `domains[].verifyRecord.name` | string | no | | | `domains[].verifyRecord.value` | string | no | | | `domains[].cname` | string | no | CNAME target | | `domains[].createdAt` | integer | no | | | `access` | object | no | | | `access.mode` | enum | no | Allowed: `public`, `password`. | | `ai` | object | no | | | `ai.enabled` | boolean | no | | | `ai.provider` | enum | no | Allowed: `anthropic`, `deepseek`, `openrouter`. | | `ai.model` | string | no | | | `ai.hasKey` | boolean | no | Whether a site key is set | | `ai.keyMasked` | string | no | | | `ai.platformKeyAvailable` | boolean | no | Whether the platform has a default key for the current provider | | `ai.platformKeys` | map from strings to booleans | no | Whether each provider has a platform key | | `ai.guidance` | string | no | | | `ai.effort` | enum | no | Reasoning effort; `null` uses the model's suggested level May be null. Allowed: `none`, `minimal`, `low`, `medium`, `high`, `xhigh`, `max`. | | `ai.retentionDays` | integer | no | Days to keep questions; `null` keeps them forever May be null. | | `ai.dailyLimit` | integer | no | Maximum questions that call the model in a rolling 24 hours; `null` means no limit May be null. | | `ai.agent` | boolean | no | Whether console AI is on | | `ai.gaps` | boolean | no | Whether documentation gaps are sorted every day | | `ai.support` | object | no | Contact when AI has no answer | | `ai.support.enabled` | boolean | no | | | `ai.support.url` | string | no | | | `ai.support.email` | string | no | | | `primaryUrl` | URL | no | The address on the primary domain; the same as `url` without a custom domain | | `mcpUrl` | URL | no | | ### Example response (200) ```json { "id": "site_2m4k8p", "slug": "acme-payments", "name": "Acme Docs", "url": "https://acme-payments-sites.butterix.com", "sourceType": "hosted", "status": "queued", "updatedAt": 1, "pageCount": 94, "orgSlug": "acme", "git": { "url": "https://github.com/acme/docs.git", "branch": "main", "hasToken": true, "webhookUrl": "https://api.butterix.com/v1/webhooks/github/site_2m4k8p", "webhookSecret": "string" }, "production": { "id": "dpl_01jd8x2k7q", "siteId": "site_2m4k8p", "kind": "production", "status": "queued", "source": "git", "branch": "main", "commitSha": "9fceb02d0ae598e95dc970b74767f19372d61af8", "message": "docs: update quickstart", "createdBy": { "id": "string", "name": "string" }, "apiKey": { "name": "GitHub Actions", "prefix": "biti_a1B2c", "suffix": "Kd82mQx0Zt" }, "error": "string", "pageCount": 94, "sizeBytes": 5832110, "durationMs": 6120, "url": "https://acme-payments--8x2k7q-sites.butterix.com", "isCurrent": true, "createdAt": 1, "finishedAt": 1 }, "domains": [ { "domain": "docs.acme.com", "verified": false, "primary": false, "verifyRecord": { "type": "TXT", "name": "_butterix.docs.acme.com", "value": "butterix-verify=a1b2c3d4e5f6" }, "cname": "sites.butterix.com", "createdAt": 1 } ], "access": { "mode": "public" }, "ai": { "enabled": true, "provider": "anthropic", "model": "claude-opus-5-5", "hasKey": true, "keyMasked": "sk-a…9f2c", "platformKeyAvailable": true, "platformKeys": { "key": true }, "guidance": "string", "effort": "none", "retentionDays": 1, "dailyLimit": 200, "agent": true, "gaps": false, "support": { "enabled": false, "url": "", "email": "" } }, "primaryUrl": "https://docs.acme.com", "mcpUrl": "https://docs.acme.com/_mcp/server" } ``` --- # Receive GitHub webhook `POST /webhooks/github/{siteId}` Called by GitHub (or a compatible Git service). No API authentication, but it must carry a valid `X-Hub-Signature-256` signature (HMAC-SHA256 with the site's webhook secret). - `push` to the production branch → production deployment. - `pull_request` with `opened` / `synchronize` / `reopened` → preview deployment of that branch. - `ping` → `{ ok: true }`; other events → `{ ignored: true }`. Base URL: https://api.butterix.com/v1 ## Path parameters | Name | Type | Required | Description | |---|---|---|---| | `siteId` | string | yes | Site id (not the slug) | ## Header parameters | Name | Type | Required | Description | |---|---|---|---| | `X-GitHub-Event` | enum | yes | Allowed: `push`, `pull_request`, `ping`. | | `X-Hub-Signature-256` | string | yes | | ## Request body Content type: `application/json` | Field | Type | Required | Description | |---|---|---|---| | `ref` | string | no | | | `after` | string | no | | | `head_commit` | object | no | | | `head_commit.message` | string | no | | | `action` | string | no | | | `pull_request` | object | no | | | `pull_request.number` | integer | no | | | `pull_request.title` | string | no | | | `pull_request.head` | object | no | | | `pull_request.head.ref` | string | no | | | `pull_request.head.sha` | string | no | | ## Example request ```bash curl -X POST https://api.butterix.com/v1/webhooks/github/site_2m4k8p \ -H "X-GitHub-Event: push" \ -H "X-Hub-Signature-256: sha256=4f1c…" \ -H "Content-Type: application/json" \ -d '{}' ``` ## Responses ### 200 A ping, or an ignored event Content type: `application/json` | Field | Type | Required | Description | |---|---|---|---| | `ok` | boolean | no | | | `ignored` | boolean | no | | ### 202 Deployment created Content type: `application/json` | Field | Type | Required | Description | |---|---|---|---| | `deploymentId` | string | no | | ### 401 Invalid signature Content type: `application/json` | Field | Type | Required | Description | |---|---|---|---| | `error` | string | yes | Human-readable error message | | `code` | string | no | Machine-readable error code (some endpoints) | ### Example response (200) ```json { "ok": true, "ignored": true } ``` --- # Get Ask AI settings `GET /sites/{site}/ai` Base URL: https://api.butterix.com/v1 Authentication: bearer token in Authorization header or API key in cookie `biti_session` ## Path parameters | Name | Type | Required | Description | |---|---|---|---| | `site` | string | yes | Site slug or id | ## Example request ```bash curl https://api.butterix.com/v1/sites/acme-payments/ai \ -H "Authorization: Bearer <token>" ``` ## Responses ### 200 Current settings (keys are masked) Content type: `application/json` | Field | Type | Required | Description | |---|---|---|---| | `enabled` | boolean | no | | | `provider` | enum | no | Allowed: `anthropic`, `deepseek`, `openrouter`. | | `model` | string | no | | | `hasKey` | boolean | no | Whether a site key is set | | `keyMasked` | string | no | | | `platformKeyAvailable` | boolean | no | Whether the platform has a default key for the current provider | | `platformKeys` | map from strings to booleans | no | Whether each provider has a platform key | | `guidance` | string | no | | | `effort` | enum | no | Reasoning effort; `null` uses the model's suggested level May be null. Allowed: `none`, `minimal`, `low`, `medium`, `high`, `xhigh`, `max`. | | `retentionDays` | integer | no | Days to keep questions; `null` keeps them forever May be null. | | `dailyLimit` | integer | no | Maximum questions that call the model in a rolling 24 hours; `null` means no limit May be null. | | `agent` | boolean | no | Whether console AI is on | | `gaps` | boolean | no | Whether documentation gaps are sorted every day | | `support` | object | no | Contact when AI has no answer | | `support.enabled` | boolean | no | | | `support.url` | string | no | | | `support.email` | string | no | | ### Example response (200) ```json { "enabled": true, "provider": "anthropic", "model": "claude-opus-5-5", "hasKey": true, "keyMasked": "sk-a…9f2c", "platformKeyAvailable": true, "platformKeys": { "key": true }, "guidance": "string", "effort": "none", "retentionDays": 1, "dailyLimit": 200, "agent": true, "gaps": false, "support": { "enabled": false, "url": "", "email": "" } } ``` --- # Update Ask AI settings `PUT /sites/{site}/ai` Requires the `admin` role. Only the fields you pass are updated. - When `provider` changes without `model`, the model resets to that provider's default; without `apiKey`, the old key is removed (keys belong to a provider). - `apiKey: null` removes the site's key and falls back to the platform key, if there is one. Keys are stored encrypted with AES-256-GCM. - The levels `effort` can take come from the model (see `reasoning` in the [model list](https://docs.butterix.com/en/api-reference/ai/list-models.md)); an unsupported level is moved to the nearest one, and `null` uses the model's suggested level. - `dailyLimit` caps questions that call the model in a rolling 24 hours (1–1000000); `null` means no limit, and the default is 200. Base URL: https://api.butterix.com/v1 Authentication: bearer token in Authorization header or API key in cookie `biti_session` ## Path parameters | Name | Type | Required | Description | |---|---|---|---| | `site` | string | yes | Site slug or id | ## Request body Content type: `application/json` | Field | Type | Required | Description | |---|---|---|---| | `enabled` | boolean | no | | | `provider` | enum | no | Allowed: `anthropic`, `deepseek`, `openrouter`. | | `model` | string | no | | | `apiKey` | string | no | New key; `null` removes it May be null. | | `guidance` | string | no | Guidance added to the system prompt | | `effort` | enum | no | Reasoning effort; `null` uses the model's suggested level May be null. Allowed: `none`, `minimal`, `low`, `medium`, `high`, `xhigh`, `max`. | | `dailyLimit` | integer | no | Maximum questions that call the model in a rolling 24 hours; `null` means no limit May be null. | | `agent` | boolean | no | Switch for console AI (agent, scheduled tasks, AI translation, documentation gaps), independent of Ask AI | | `gaps` | boolean | no | Sort documentation gaps every day | | `support` | object | no | Contact when AI has no answer. Only the fields you send change; turning it on needs at least one way to reach you | | `support.enabled` | boolean | no | | | `support.url` | string | no | Support page: an `https://` address or a path that starts with `/`; an empty string removes it | | `support.email` | string | no | Support email; an empty string removes it | ## Example request ```bash curl -X PUT https://api.butterix.com/v1/sites/acme-payments/ai \ -H "Authorization: Bearer <token>" \ -H "Content-Type: application/json" \ -d '{ "provider": "deepseek", "model": "deepseek-flash", "apiKey": "sk-xxxxxxxxxxxxxxxx" }' ``` ## Responses ### 200 Updated settings Content type: `application/json` | Field | Type | Required | Description | |---|---|---|---| | `enabled` | boolean | no | | | `provider` | enum | no | Allowed: `anthropic`, `deepseek`, `openrouter`. | | `model` | string | no | | | `hasKey` | boolean | no | Whether a site key is set | | `keyMasked` | string | no | | | `platformKeyAvailable` | boolean | no | Whether the platform has a default key for the current provider | | `platformKeys` | map from strings to booleans | no | Whether each provider has a platform key | | `guidance` | string | no | | | `effort` | enum | no | Reasoning effort; `null` uses the model's suggested level May be null. Allowed: `none`, `minimal`, `low`, `medium`, `high`, `xhigh`, `max`. | | `retentionDays` | integer | no | Days to keep questions; `null` keeps them forever May be null. | | `dailyLimit` | integer | no | Maximum questions that call the model in a rolling 24 hours; `null` means no limit May be null. | | `agent` | boolean | no | Whether console AI is on | | `gaps` | boolean | no | Whether documentation gaps are sorted every day | | `support` | object | no | Contact when AI has no answer | | `support.enabled` | boolean | no | | | `support.url` | string | no | | | `support.email` | string | no | | ### Example response (200) ```json { "enabled": true, "provider": "anthropic", "model": "claude-opus-5-5", "hasKey": true, "keyMasked": "sk-a…9f2c", "platformKeyAvailable": true, "platformKeys": { "key": true }, "guidance": "string", "effort": "none", "retentionDays": 1, "dailyLimit": 200, "agent": true, "gaps": false, "support": { "enabled": false, "url": "", "email": "" } } ``` --- # Ask a test question `POST /sites/{site}/ai/test` Requires the `editor` role. Answers one question with the saved settings and the production deployment's search index (not streamed). Base URL: https://api.butterix.com/v1 Authentication: bearer token in Authorization header or API key in cookie `biti_session` ## Path parameters | Name | Type | Required | Description | |---|---|---|---| | `site` | string | yes | Site slug or id | ## Request body Content type: `application/json` | Field | Type | Required | Description | |---|---|---|---| | `question` | string | no | | ## Example request ```bash curl -X POST https://api.butterix.com/v1/sites/acme-payments/ai/test \ -H "Authorization: Bearer <token>" \ -H "Content-Type: application/json" \ -d '{}' ``` ## Responses ### 200 Answer Content type: `application/json` | Field | Type | Required | Description | |---|---|---|---| | `answer` | string | no | | | `sources` | list of objects | no | | | `sources[].title` | string | no | | | `sources[].url` | string | no | | | `model` | string | no | | | `provider` | enum | no | Allowed: `anthropic`, `deepseek`, `openrouter`. | | `ms` | integer | no | | ### 400 Invalid request parameters Content type: `application/json` | Field | Type | Required | Description | |---|---|---|---| | `error` | string | yes | Human-readable error message | | `code` | string | no | Machine-readable error code (some endpoints) | ### 502 The model provider returned an error Content type: `application/json` | Field | Type | Required | Description | |---|---|---|---| | `error` | string | yes | Human-readable error message | | `code` | string | no | Machine-readable error code (some endpoints) | ### Example response (200) ```json { "answer": "Create a key in the console under Organization settings → API Keys [1].", "sources": [ { "title": "CLI deploys and API keys", "url": "/guides/deploy/cli-deploy" } ], "model": "claude-opus-5-5", "provider": "anthropic", "ms": 2380 } ``` --- # List available models `GET /ai/models` Fetches the model list from the provider (cached for 10 minutes). With `site`, the site's key is used first; otherwise the platform key. If the list can't be fetched, a built-in list is returned with `live: false` and `error`. Base URL: https://api.butterix.com/v1 Authentication: bearer token in Authorization header or API key in cookie `biti_session` ## Query parameters | Name | Type | Required | Description | |---|---|---|---| | `provider` | enum | no | Allowed: `anthropic`, `deepseek`, `openrouter`. | | `site` | string | no | Site slug or id | ## Example request ```bash curl https://api.butterix.com/v1/ai/models \ -H "Authorization: Bearer <token>" ``` ## Responses ### 200 Models (recommended ones first) Content type: `application/json` | Field | Type | Required | Description | |---|---|---|---| | `models` | list of objects | no | | | `models[].id` | string | no | | | `models[].label` | string | no | | | `models[].contextWindow` | integer | no | | | `models[].pricing` | object | no | US dollars per million tokens (when the provider reports it) | | `models[].pricing.input` | number | no | | | `models[].pricing.output` | number | no | | | `models[].recommended` | boolean | no | | | `models[].reasoning` | object | no | Reasoning effort the model supports; missing when it has none | | `models[].reasoning.efforts` | list of enums | no | Levels from low to high, `none` turns thinking off; empty when the model thinks but has no levels to choose from | | `models[].reasoning.suggested` | string | no | Level used when none is set | | `models[].reasoning.default` | string | no | The model's own default level | | `live` | boolean | no | | | `error` | string | no | | ### Example response (200) ```json { "models": [ { "id": "claude-opus-5-5", "label": "Claude Opus 5.5", "contextWindow": 1000000, "pricing": { "input": 4, "output": 20 }, "recommended": true, "reasoning": { "efforts": [ "none" ], "suggested": "low", "default": "high" } } ], "live": true, "error": "string" } ``` --- # List custom answers `GET /sites/{site}/guidance` Base URL: https://api.butterix.com/v1 Authentication: bearer token in Authorization header or API key in cookie `biti_session` ## Path parameters | Name | Type | Required | Description | |---|---|---|---| | `site` | string | yes | Site slug or id | ## Example request ```bash curl https://api.butterix.com/v1/sites/acme-payments/guidance \ -H "Authorization: Bearer <token>" ``` ## Responses ### 200 Custom answers, newest first Content type: `application/json` | Field | Type | Required | Description | |---|---|---|---| | `[].id` | string | no | | | `[].context` | list of strings | no | Example questions | | `[].document` | string | no | Answer (Markdown) | | `[].enabled` | boolean | no | | | `[].createdAt` | integer | no | | | `[].updatedAt` | integer | no | | ### Example response (200) ```json [ { "id": "gd_01jd8x2k7q", "context": [ "How do I contact support?" ], "document": "string", "enabled": true, "createdAt": 1, "updatedAt": 1 } ] ``` --- # Create custom answer `POST /sites/{site}/guidance` Requires the `editor` role. When a reader's question is close to one of the example questions, Ask AI answers from `document` first. A site can have up to 200. Base URL: https://api.butterix.com/v1 Authentication: bearer token in Authorization header or API key in cookie `biti_session` ## Path parameters | Name | Type | Required | Description | |---|---|---|---| | `site` | string | yes | Site slug or id | ## Request body Content type: `application/json` | Field | Type | Required | Description | |---|---|---|---| | `context` | list of strings | yes | Example questions | | `document` | string | yes | Answer (Markdown) | | `enabled` | boolean | no | | ## Example request ```bash curl -X POST https://api.butterix.com/v1/sites/acme-payments/guidance \ -H "Authorization: Bearer <token>" \ -H "Content-Type: application/json" \ -d '{ "context": [ "How do I contact support?", "Is there customer service?" ], "document": "Email support@acme.com; we reply within 4 hours on business days." }' ``` ## Responses ### 201 New entry Content type: `application/json` | Field | Type | Required | Description | |---|---|---|---| | `id` | string | no | | | `context` | list of strings | no | Example questions | | `document` | string | no | Answer (Markdown) | | `enabled` | boolean | no | | | `createdAt` | integer | no | | | `updatedAt` | integer | no | | ### 400 Invalid request parameters Content type: `application/json` | Field | Type | Required | Description | |---|---|---|---| | `error` | string | yes | Human-readable error message | | `code` | string | no | Machine-readable error code (some endpoints) | ### Example response (201) ```json { "id": "gd_01jd8x2k7q", "context": [ "How do I contact support?" ], "document": "string", "enabled": true, "createdAt": 1, "updatedAt": 1 } ``` --- # Get custom answer `GET /sites/{site}/guidance/{id}` Base URL: https://api.butterix.com/v1 Authentication: bearer token in Authorization header or API key in cookie `biti_session` ## Path parameters | Name | Type | Required | Description | |---|---|---|---| | `site` | string | yes | Site slug or id | | `id` | string | yes | Custom answer id | ## Example request ```bash curl https://api.butterix.com/v1/sites/acme-payments/guidance/gd_01jd8x2k7q \ -H "Authorization: Bearer <token>" ``` ## Responses ### 200 Custom answer Content type: `application/json` | Field | Type | Required | Description | |---|---|---|---| | `id` | string | no | | | `context` | list of strings | no | Example questions | | `document` | string | no | Answer (Markdown) | | `enabled` | boolean | no | | | `createdAt` | integer | no | | | `updatedAt` | integer | no | | ### 404 The resource doesn't exist, or you don't have access to it Content type: `application/json` | Field | Type | Required | Description | |---|---|---|---| | `error` | string | yes | Human-readable error message | | `code` | string | no | Machine-readable error code (some endpoints) | ### Example response (200) ```json { "id": "gd_01jd8x2k7q", "context": [ "How do I contact support?" ], "document": "string", "enabled": true, "createdAt": 1, "updatedAt": 1 } ``` --- # Update custom answer `PATCH /sites/{site}/guidance/{id}` Requires the `editor` role. Only the fields you pass are updated. Base URL: https://api.butterix.com/v1 Authentication: bearer token in Authorization header or API key in cookie `biti_session` ## Path parameters | Name | Type | Required | Description | |---|---|---|---| | `site` | string | yes | Site slug or id | | `id` | string | yes | Custom answer id | ## Request body Content type: `application/json` | Field | Type | Required | Description | |---|---|---|---| | `context` | list of strings | no | | | `document` | string | no | | | `enabled` | boolean | no | | ## Example request ```bash curl -X PATCH https://api.butterix.com/v1/sites/acme-payments/guidance/gd_01jd8x2k7q \ -H "Authorization: Bearer <token>" \ -H "Content-Type: application/json" \ -d '{}' ``` ## Responses ### 200 Updated entry Content type: `application/json` | Field | Type | Required | Description | |---|---|---|---| | `id` | string | no | | | `context` | list of strings | no | Example questions | | `document` | string | no | Answer (Markdown) | | `enabled` | boolean | no | | | `createdAt` | integer | no | | | `updatedAt` | integer | no | | ### 400 Invalid request parameters Content type: `application/json` | Field | Type | Required | Description | |---|---|---|---| | `error` | string | yes | Human-readable error message | | `code` | string | no | Machine-readable error code (some endpoints) | ### Example response (200) ```json { "id": "gd_01jd8x2k7q", "context": [ "How do I contact support?" ], "document": "string", "enabled": true, "createdAt": 1, "updatedAt": 1 } ``` --- # Delete custom answer `DELETE /sites/{site}/guidance/{id}` Requires the `editor` role. Base URL: https://api.butterix.com/v1 Authentication: bearer token in Authorization header or API key in cookie `biti_session` ## Path parameters | Name | Type | Required | Description | |---|---|---|---| | `site` | string | yes | Site slug or id | | `id` | string | yes | Custom answer id | ## Example request ```bash curl -X DELETE https://api.butterix.com/v1/sites/acme-payments/guidance/gd_01jd8x2k7q \ -H "Authorization: Bearer <token>" ``` ## Responses ### 200 Success Content type: `application/json` | Field | Type | Required | Description | |---|---|---|---| | `ok` | true | no | Allowed: `true`. | ### Example response (200) ```json { "ok": true } ``` --- # List content sources `GET /sites/{site}/sources` Base URL: https://api.butterix.com/v1 Authentication: bearer token in Authorization header or API key in cookie `biti_session` ## Path parameters | Name | Type | Required | Description | |---|---|---|---| | `site` | string | yes | Site slug or id | ## Example request ```bash curl https://api.butterix.com/v1/sites/acme-payments/sources \ -H "Authorization: Bearer <token>" ``` ## Responses ### 200 Content sources, newest first Content type: `application/json` | Field | Type | Required | Description | |---|---|---|---| | `[].id` | string | no | | | `[].kind` | enum | no | Allowed: `document`, `website`. | | `[].title` | string | no | | | `[].url` | string | no | | | `[].config` | object | no | Fetch settings, `website` only | | `[].config.paths` | list of strings | no | | | `[].config.exclude` | list of strings | no | | | `[].config.maxPages` | integer | no | | | `[].config.refresh` | enum | no | Allowed: `never`, `daily`, `weekly`, `monthly`. | | `[].status` | enum | no | Allowed: `ready`, `queued`, `running`, `failed`. | | `[].error` | string | no | Why the last fetch failed | | `[].pageCount` | integer | no | | | `[].createdAt` | integer | no | | | `[].refreshedAt` | integer | no | When the content was last updated May be null. | | `[].nextAt` | integer | no | When it's fetched next May be null. | | `[].pages` | list of objects | no | Pages, 500 at most; not in lists | | `[].pages[].url` | string | no | | | `[].pages[].title` | string | no | | | `[].pages[].size` | integer | no | Number of characters of text | | `[].document` | string | no | Markdown content, `document` only; not in lists | ### Example response (200) ```json [ { "id": "src_01jd8x2k7q", "kind": "document", "title": "help.acme.com", "url": "https://help.acme.com/", "config": { "paths": [ "string" ], "exclude": [ "string" ], "maxPages": 1, "refresh": "never" }, "status": "ready", "error": "string", "pageCount": 86, "createdAt": 1, "refreshedAt": 1, "nextAt": 1, "pages": [ { "url": "string", "title": "string", "size": 1 } ], "document": "string" } ] ``` --- # Add content source `POST /sites/{site}/sources` Requires the `editor` role. A `document` is Markdown; a `website` is a public website fetched from `url` (respecting robots.txt). A site can have up to 20 sources. Base URL: https://api.butterix.com/v1 Authentication: bearer token in Authorization header or API key in cookie `biti_session` ## Path parameters | Name | Type | Required | Description | |---|---|---|---| | `site` | string | yes | Site slug or id | ## Request body Content type: `application/json` | Field | Type | Required | Description | |---|---|---|---| | `kind` | enum | yes | Allowed: `document`, `website`. | | `title` | string | no | Title; required for `document`, the host name by default for `website` | | `url` | string | yes | Address to cite for a document, or where fetching starts | | `document` | string | no | Markdown content, `document` only | | `paths` | list of strings | no | Fetch only pages under these paths; the start URL's directory by default, `website` only | | `exclude` | list of strings | no | Don't fetch pages under these paths, `website` only | | `maxPages` | integer | no | Page limit, `website` only | | `refresh` | enum | no | How often to fetch again, `website` only Allowed: `never`, `daily`, `weekly`, `monthly`. | ## Example request ```bash curl -X POST https://api.butterix.com/v1/sites/acme-payments/sources \ -H "Authorization: Bearer <token>" \ -H "Content-Type: application/json" \ -d '{ "kind": "website", "url": "https://help.acme.com/", "maxPages": 200, "refresh": "weekly" }' ``` ## Responses ### 201 New content source; websites are fetched in the background Content type: `application/json` | Field | Type | Required | Description | |---|---|---|---| | `id` | string | no | | | `kind` | enum | no | Allowed: `document`, `website`. | | `title` | string | no | | | `url` | string | no | | | `config` | object | no | Fetch settings, `website` only | | `config.paths` | list of strings | no | | | `config.exclude` | list of strings | no | | | `config.maxPages` | integer | no | | | `config.refresh` | enum | no | Allowed: `never`, `daily`, `weekly`, `monthly`. | | `status` | enum | no | Allowed: `ready`, `queued`, `running`, `failed`. | | `error` | string | no | Why the last fetch failed | | `pageCount` | integer | no | | | `createdAt` | integer | no | | | `refreshedAt` | integer | no | When the content was last updated May be null. | | `nextAt` | integer | no | When it's fetched next May be null. | | `pages` | list of objects | no | Pages, 500 at most; not in lists | | `pages[].url` | string | no | | | `pages[].title` | string | no | | | `pages[].size` | integer | no | Number of characters of text | | `document` | string | no | Markdown content, `document` only; not in lists | ### 400 Invalid request parameters Content type: `application/json` | Field | Type | Required | Description | |---|---|---|---| | `error` | string | yes | Human-readable error message | | `code` | string | no | Machine-readable error code (some endpoints) | ### Example response (201) ```json { "id": "src_01jd8x2k7q", "kind": "document", "title": "help.acme.com", "url": "https://help.acme.com/", "config": { "paths": [ "string" ], "exclude": [ "string" ], "maxPages": 1, "refresh": "never" }, "status": "ready", "error": "string", "pageCount": 86, "createdAt": 1, "refreshedAt": 1, "nextAt": 1, "pages": [ { "url": "string", "title": "string", "size": 1 } ], "document": "string" } ``` --- # Get content source `GET /sites/{site}/sources/{id}` Base URL: https://api.butterix.com/v1 Authentication: bearer token in Authorization header or API key in cookie `biti_session` ## Path parameters | Name | Type | Required | Description | |---|---|---|---| | `site` | string | yes | Site slug or id | | `id` | string | yes | Content source id | ## Example request ```bash curl https://api.butterix.com/v1/sites/acme-payments/sources/src_01jd8x2k7q \ -H "Authorization: Bearer <token>" ``` ## Responses ### 200 Content source with its pages Content type: `application/json` | Field | Type | Required | Description | |---|---|---|---| | `id` | string | no | | | `kind` | enum | no | Allowed: `document`, `website`. | | `title` | string | no | | | `url` | string | no | | | `config` | object | no | Fetch settings, `website` only | | `config.paths` | list of strings | no | | | `config.exclude` | list of strings | no | | | `config.maxPages` | integer | no | | | `config.refresh` | enum | no | Allowed: `never`, `daily`, `weekly`, `monthly`. | | `status` | enum | no | Allowed: `ready`, `queued`, `running`, `failed`. | | `error` | string | no | Why the last fetch failed | | `pageCount` | integer | no | | | `createdAt` | integer | no | | | `refreshedAt` | integer | no | When the content was last updated May be null. | | `nextAt` | integer | no | When it's fetched next May be null. | | `pages` | list of objects | no | Pages, 500 at most; not in lists | | `pages[].url` | string | no | | | `pages[].title` | string | no | | | `pages[].size` | integer | no | Number of characters of text | | `document` | string | no | Markdown content, `document` only; not in lists | ### 404 The resource doesn't exist, or you don't have access to it Content type: `application/json` | Field | Type | Required | Description | |---|---|---|---| | `error` | string | yes | Human-readable error message | | `code` | string | no | Machine-readable error code (some endpoints) | ### Example response (200) ```json { "id": "src_01jd8x2k7q", "kind": "document", "title": "help.acme.com", "url": "https://help.acme.com/", "config": { "paths": [ "string" ], "exclude": [ "string" ], "maxPages": 1, "refresh": "never" }, "status": "ready", "error": "string", "pageCount": 86, "createdAt": 1, "refreshedAt": 1, "nextAt": 1, "pages": [ { "url": "string", "title": "string", "size": 1 } ], "document": "string" } ``` --- # Update content source `PATCH /sites/{site}/sources/{id}` Requires the `editor` role. Only the fields you pass are updated; websites are then fetched again. Base URL: https://api.butterix.com/v1 Authentication: bearer token in Authorization header or API key in cookie `biti_session` ## Path parameters | Name | Type | Required | Description | |---|---|---|---| | `site` | string | yes | Site slug or id | | `id` | string | yes | Content source id | ## Request body Content type: `application/json` | Field | Type | Required | Description | |---|---|---|---| | `title` | string | no | | | `url` | string | no | | | `document` | string | no | | | `paths` | list of strings | no | | | `exclude` | list of strings | no | | | `maxPages` | integer | no | | | `refresh` | enum | no | Allowed: `never`, `daily`, `weekly`, `monthly`. | ## Example request ```bash curl -X PATCH https://api.butterix.com/v1/sites/acme-payments/sources/src_01jd8x2k7q \ -H "Authorization: Bearer <token>" \ -H "Content-Type: application/json" \ -d '{}' ``` ## Responses ### 200 Updated content source Content type: `application/json` | Field | Type | Required | Description | |---|---|---|---| | `id` | string | no | | | `kind` | enum | no | Allowed: `document`, `website`. | | `title` | string | no | | | `url` | string | no | | | `config` | object | no | Fetch settings, `website` only | | `config.paths` | list of strings | no | | | `config.exclude` | list of strings | no | | | `config.maxPages` | integer | no | | | `config.refresh` | enum | no | Allowed: `never`, `daily`, `weekly`, `monthly`. | | `status` | enum | no | Allowed: `ready`, `queued`, `running`, `failed`. | | `error` | string | no | Why the last fetch failed | | `pageCount` | integer | no | | | `createdAt` | integer | no | | | `refreshedAt` | integer | no | When the content was last updated May be null. | | `nextAt` | integer | no | When it's fetched next May be null. | | `pages` | list of objects | no | Pages, 500 at most; not in lists | | `pages[].url` | string | no | | | `pages[].title` | string | no | | | `pages[].size` | integer | no | Number of characters of text | | `document` | string | no | Markdown content, `document` only; not in lists | ### 400 Invalid request parameters Content type: `application/json` | Field | Type | Required | Description | |---|---|---|---| | `error` | string | yes | Human-readable error message | | `code` | string | no | Machine-readable error code (some endpoints) | ### Example response (200) ```json { "id": "src_01jd8x2k7q", "kind": "document", "title": "help.acme.com", "url": "https://help.acme.com/", "config": { "paths": [ "string" ], "exclude": [ "string" ], "maxPages": 1, "refresh": "never" }, "status": "ready", "error": "string", "pageCount": 86, "createdAt": 1, "refreshedAt": 1, "nextAt": 1, "pages": [ { "url": "string", "title": "string", "size": 1 } ], "document": "string" } ``` --- # Delete content source `DELETE /sites/{site}/sources/{id}` Requires the `editor` role. Base URL: https://api.butterix.com/v1 Authentication: bearer token in Authorization header or API key in cookie `biti_session` ## Path parameters | Name | Type | Required | Description | |---|---|---|---| | `site` | string | yes | Site slug or id | | `id` | string | yes | Content source id | ## Example request ```bash curl -X DELETE https://api.butterix.com/v1/sites/acme-payments/sources/src_01jd8x2k7q \ -H "Authorization: Bearer <token>" ``` ## Responses ### 200 Success Content type: `application/json` | Field | Type | Required | Description | |---|---|---|---| | `ok` | true | no | Allowed: `true`. | ### Example response (200) ```json { "ok": true } ``` --- # Fetch website again `POST /sites/{site}/sources/{id}/refresh` Requires the `editor` role. `website` only; runs in the background. Base URL: https://api.butterix.com/v1 Authentication: bearer token in Authorization header or API key in cookie `biti_session` ## Path parameters | Name | Type | Required | Description | |---|---|---|---| | `site` | string | yes | Site slug or id | | `id` | string | yes | Content source id | ## Example request ```bash curl -X POST https://api.butterix.com/v1/sites/acme-payments/sources/src_01jd8x2k7q/refresh \ -H "Authorization: Bearer <token>" ``` ## Responses ### 202 Queued Content type: `application/json` | Field | Type | Required | Description | |---|---|---|---| | `id` | string | no | | | `kind` | enum | no | Allowed: `document`, `website`. | | `title` | string | no | | | `url` | string | no | | | `config` | object | no | Fetch settings, `website` only | | `config.paths` | list of strings | no | | | `config.exclude` | list of strings | no | | | `config.maxPages` | integer | no | | | `config.refresh` | enum | no | Allowed: `never`, `daily`, `weekly`, `monthly`. | | `status` | enum | no | Allowed: `ready`, `queued`, `running`, `failed`. | | `error` | string | no | Why the last fetch failed | | `pageCount` | integer | no | | | `createdAt` | integer | no | | | `refreshedAt` | integer | no | When the content was last updated May be null. | | `nextAt` | integer | no | When it's fetched next May be null. | | `pages` | list of objects | no | Pages, 500 at most; not in lists | | `pages[].url` | string | no | | | `pages[].title` | string | no | | | `pages[].size` | integer | no | Number of characters of text | | `document` | string | no | Markdown content, `document` only; not in lists | ### 400 Invalid request parameters Content type: `application/json` | Field | Type | Required | Description | |---|---|---|---| | `error` | string | yes | Human-readable error message | | `code` | string | no | Machine-readable error code (some endpoints) | ### Example response (202) ```json { "id": "src_01jd8x2k7q", "kind": "document", "title": "help.acme.com", "url": "https://help.acme.com/", "config": { "paths": [ "string" ], "exclude": [ "string" ], "maxPages": 1, "refresh": "never" }, "status": "ready", "error": "string", "pageCount": 86, "createdAt": 1, "refreshedAt": 1, "nextAt": 1, "pages": [ { "url": "string", "title": "string", "size": 1 } ], "document": "string" } ``` --- # Get embed settings `GET /sites/{site}/embed` Base URL: https://api.butterix.com/v1 Authentication: bearer token in Authorization header or API key in cookie `biti_session` ## Path parameters | Name | Type | Required | Description | |---|---|---|---| | `site` | string | yes | Site slug or id | ## Example request ```bash curl https://api.butterix.com/v1/sites/acme-payments/embed \ -H "Authorization: Bearer <token>" ``` ## Responses ### 200 Websites that may embed the assistant, the skin, and the docs site's own two accent colors Content type: `application/json` | Field | Type | Required | Description | |---|---|---|---| | `skin` | enum | no | Skin: `classic`, or `aurora` (frosted glass with flowing light along the edges). A `data-skin` attribute on the page takes priority Allowed: `classic`, `aurora`. | | `trigger` | enum | no | Entry style: `button` (a floating button) or `bar` (an input bar at the bottom). A `data-trigger` attribute on the page takes priority Allowed: `button`, `bar`. | | `theme` | enum | no | Color mode; `auto` follows the visitor's system setting. A `data-theme` attribute on the page takes priority Allowed: `dark`, `light`, `auto`. | | `color` | string | no | Accent color for light mode; null uses the docs site's own. A `data-color` attribute on the page takes priority May be null. | | `colorDark` | string | no | Accent color for dark mode; when null, it's derived from `color` or the docs site's own is used. A `data-color-dark` attribute on the page takes priority May be null. | | `origins` | list of strings | no | Allowed origins; `*.` covers any subdomain, and http is for localhost only | | `accent` | object | no | 文档站亮色与暗色模式的强调色,嵌入时不指定颜色就用它们;还没发布过时为 null May be null. | | `accent.light` | string | no | | | `accent.dark` | string | no | | ### Example response (200) ```json { "skin": "classic", "trigger": "button", "theme": "dark", "color": "#7c5cff", "colorDark": "#9e8aff", "origins": [ "https://app.acme.com", "https://*.acme.com" ], "accent": { "light": "#a86200", "dark": "#ffc823" } } ``` --- # Update embed settings `PUT /sites/{site}/embed` Requires the `admin` role. Changes only the fields in the request — `origins` replaces all allowed origins (an empty list turns embedding off); the appearance fields (`skin`, `trigger`, `theme`, `color`, `colorDark`) apply right away, and `null` restores a default. Base URL: https://api.butterix.com/v1 Authentication: bearer token in Authorization header or API key in cookie `biti_session` ## Path parameters | Name | Type | Required | Description | |---|---|---|---| | `site` | string | yes | Site slug or id | ## Request body Content type: `application/json` | Field | Type | Required | Description | |---|---|---|---| | `skin` | enum | no | Skin: `classic`, or `aurora` (frosted glass with flowing light along the edges). A `data-skin` attribute on the page takes priority Allowed: `classic`, `aurora`. | | `trigger` | enum | no | Entry style: `button` (a floating button) or `bar` (an input bar at the bottom). A `data-trigger` attribute on the page takes priority Allowed: `button`, `bar`. | | `theme` | enum | no | Color mode; `auto` follows the visitor's system setting. A `data-theme` attribute on the page takes priority Allowed: `dark`, `light`, `auto`. | | `color` | string | no | Accent color for light mode; null uses the docs site's own. A `data-color` attribute on the page takes priority May be null. | | `colorDark` | string | no | Accent color for dark mode; when null, it's derived from `color` or the docs site's own is used. A `data-color-dark` attribute on the page takes priority May be null. | | `origins` | list of strings | no | Allowed origins; `*.` covers any subdomain, and http is for localhost only | ## Example request ```bash curl -X PUT https://api.butterix.com/v1/sites/acme-payments/embed \ -H "Authorization: Bearer <token>" \ -H "Content-Type: application/json" \ -d '{}' ``` ## Responses ### 200 Updated settings Content type: `application/json` | Field | Type | Required | Description | |---|---|---|---| | `skin` | enum | no | Skin: `classic`, or `aurora` (frosted glass with flowing light along the edges). A `data-skin` attribute on the page takes priority Allowed: `classic`, `aurora`. | | `trigger` | enum | no | Entry style: `button` (a floating button) or `bar` (an input bar at the bottom). A `data-trigger` attribute on the page takes priority Allowed: `button`, `bar`. | | `theme` | enum | no | Color mode; `auto` follows the visitor's system setting. A `data-theme` attribute on the page takes priority Allowed: `dark`, `light`, `auto`. | | `color` | string | no | Accent color for light mode; null uses the docs site's own. A `data-color` attribute on the page takes priority May be null. | | `colorDark` | string | no | Accent color for dark mode; when null, it's derived from `color` or the docs site's own is used. A `data-color-dark` attribute on the page takes priority May be null. | | `origins` | list of strings | no | Allowed origins; `*.` covers any subdomain, and http is for localhost only | ### 400 Invalid request parameters Content type: `application/json` | Field | Type | Required | Description | |---|---|---|---| | `error` | string | yes | Human-readable error message | | `code` | string | no | Machine-readable error code (some endpoints) | ### Example response (200) ```json { "skin": "classic", "trigger": "button", "theme": "dark", "color": "#7c5cff", "colorDark": "#9e8aff", "origins": [ "https://app.acme.com", "https://*.acme.com" ] } ``` --- # Docs eval results `GET /sites/{site}/evals` The last 100 results of the [docs eval](https://docs.butterix.com/en/guides/features/evals.md), newest first. Base URL: https://api.butterix.com/v1 Authentication: bearer token in Authorization header or API key in cookie `biti_session` ## Path parameters | Name | Type | Required | Description | |---|---|---|---| | `site` | string | yes | Site slug or id | ## Example request ```bash curl https://api.butterix.com/v1/sites/acme-payments/evals \ -H "Authorization: Bearer <token>" ``` ## Responses ### 200 Results Content type: `application/json` | Field | Type | Required | Description | |---|---|---|---| | `[].id` | string | no | | | `[].createdAt` | integer | no | | | `[].score` | integer | no | Percent answered correctly | | `[].passed` | integer | no | | | `[].total` | integer | no | | | `[].min` | integer | no | Pass mark | | `[].ok` | boolean | no | | | `[].model` | string | no | | | `[].judge` | string | no | | | `[].commit` | string | no | | ### Example response (200) ```json [ { "id": "eval_k2m9", "createdAt": 1764115200000, "score": 85, "passed": 17, "total": 20, "min": 80, "ok": true, "model": "deepseek-flash", "judge": "deepseek-flash", "commit": "0123abcd" } ] ``` --- # Upload a docs eval result `POST /sites/{site}/evals` Requires the `editor` role; usually called by `biti eval --site`. The score is computed from `results`. Base URL: https://api.butterix.com/v1 Authentication: bearer token in Authorization header or API key in cookie `biti_session` ## Path parameters | Name | Type | Required | Description | |---|---|---|---| | `site` | string | yes | Site slug or id | ## Request body Content type: `application/json` | Field | Type | Required | Description | |---|---|---|---| | `min` | integer | no | Pass mark (percent) | | `model` | string | no | Model that answered | | `judge` | string | no | Model that graded | | `commit` | string | no | Commit of the docs | | `results` | list of objects | yes | | | `results[].id` | string | no | | | `results[].question` | string | yes | | | `results[].pass` | boolean | no | | | `results[].met` | list of booleans | no | Whether each point is made | | `results[].missing` | list of strings | no | Missing points | | `results[].said` | list of strings | no | What the answer says but must not | | `results[].unseen` | list of strings | no | Pages search didn't find | | `results[].sources` | list of strings | no | | | `results[].answer` | string | no | | | `results[].note` | string | no | A remark from grading | | `results[].error` | string | no | Why it couldn't be answered or graded | ## Example request ```bash curl -X POST https://api.butterix.com/v1/sites/acme-payments/evals \ -H "Authorization: Bearer <token>" \ -H "Content-Type: application/json" \ -d '{ "results": [ { "question": "How long does a refund take?" } ] }' ``` ## Responses ### 201 Saved Content type: `application/json` | Field | Type | Required | Description | |---|---|---|---| | `id` | string | no | | | `createdAt` | integer | no | | | `score` | integer | no | Percent answered correctly | | `passed` | integer | no | | | `total` | integer | no | | | `min` | integer | no | Pass mark | | `ok` | boolean | no | | | `model` | string | no | | | `judge` | string | no | | | `commit` | string | no | | ### Example response (201) ```json { "id": "eval_k2m9", "createdAt": 1764115200000, "score": 85, "passed": 17, "total": 20, "min": 80, "ok": true, "model": "deepseek-flash", "judge": "deepseek-flash", "commit": "0123abcd" } ``` --- # Get a docs eval result `GET /sites/{site}/evals/{id}` A result with each question. Base URL: https://api.butterix.com/v1 Authentication: bearer token in Authorization header or API key in cookie `biti_session` ## Path parameters | Name | Type | Required | Description | |---|---|---|---| | `site` | string | yes | Site slug or id | | `id` | string | yes | | ## Example request ```bash curl https://api.butterix.com/v1/sites/acme-payments/evals/eval_k2m9 \ -H "Authorization: Bearer <token>" ``` ## Responses ### 200 The result with each question Content type: `application/json` | Field | Type | Required | Description | |---|---|---|---| | `id` | string | no | | | `createdAt` | integer | no | | | `score` | integer | no | Percent answered correctly | | `passed` | integer | no | | | `total` | integer | no | | | `min` | integer | no | Pass mark | | `ok` | boolean | no | | | `model` | string | no | | | `judge` | string | no | | | `commit` | string | no | | | `results` | list of objects | no | | | `results[].id` | string | no | | | `results[].question` | string | yes | | | `results[].pass` | boolean | no | | | `results[].met` | list of booleans | no | Whether each point is made | | `results[].missing` | list of strings | no | Missing points | | `results[].said` | list of strings | no | What the answer says but must not | | `results[].unseen` | list of strings | no | Pages search didn't find | | `results[].sources` | list of strings | no | | | `results[].answer` | string | no | | | `results[].note` | string | no | A remark from grading | | `results[].error` | string | no | Why it couldn't be answered or graded | ### Example response (200) ```json { "id": "eval_k2m9", "createdAt": 1764115200000, "score": 85, "passed": 17, "total": 20, "min": 80, "ok": true, "model": "deepseek-flash", "judge": "deepseek-flash", "commit": "0123abcd", "results": [ { "id": "refund-time", "question": "How long does a refund take?", "pass": true, "met": [ true ], "missing": [ "string" ], "said": [ "string" ], "unseen": [ "string" ], "sources": [ "/guides/refund" ], "answer": "Within three business days, to the original payment method.", "note": "string", "error": "string" } ] } ``` --- # Delete a docs eval result `DELETE /sites/{site}/evals/{id}` Requires the `editor` role. Base URL: https://api.butterix.com/v1 Authentication: bearer token in Authorization header or API key in cookie `biti_session` ## Path parameters | Name | Type | Required | Description | |---|---|---|---| | `site` | string | yes | Site slug or id | | `id` | string | yes | | ## Example request ```bash curl -X DELETE https://api.butterix.com/v1/sites/acme-payments/evals/eval_k2m9 \ -H "Authorization: Bearer <token>" ``` ## Responses ### 200 Deleted Content type: `application/json` | Field | Type | Required | Description | |---|---|---|---| | `ok` | boolean | no | | ### Example response (200) ```json { "ok": true } ``` --- # Traffic `GET /sites/{site}/analytics` Splits traffic by User-Agent into humans, AI (training crawlers and AI assistants), and other crawlers. `.md` requests, requests for index and spec files, and MCP calls are counted separately. Base URL: https://api.butterix.com/v1 Authentication: bearer token in Authorization header or API key in cookie `biti_session` ## Path parameters | Name | Type | Required | Description | |---|---|---|---| | `site` | string | yes | Site slug or id | ## Query parameters | Name | Type | Required | Description | |---|---|---|---| | `days` | integer | no | | ## Example request ```bash curl https://api.butterix.com/v1/sites/acme-payments/analytics \ -H "Authorization: Bearer <token>" ``` ## Responses ### 200 Statistics Content type: `application/json` | Field | Type | Required | Description | |---|---|---|---| | `totals` | object | no | | | `totals.views` | integer | no | Total page and .md visits | | `totals.humanViews` | integer | no | | | `totals.visitors` | integer | no | 访客数,按天去重后累计,真人、AI 与爬虫都算 | | `totals.aiViews` | integer | no | AI crawlers and AI assistants | | `totals.botViews` | integer | no | Search engines and other crawlers | | `totals.markdownRequests` | integer | no | | | `totals.agentFileRequests` | integer | no | Requests for indexes (llms.txt, llms-full.txt) and API spec files, not included in the numbers above | | `totals.mcpCalls` | integer | no | | | `totals.searches` | integer | no | | | `totals.questions` | integer | no | | | `totals.feedbackUp` | integer | no | | | `totals.feedbackDown` | integer | no | | | `daily` | list of objects | no | | | `daily[].date` | date | no | | | `daily[].human` | integer | no | | | `daily[].ai` | integer | no | | | `daily[].bot` | integer | no | | | `daily[].visitors` | object | no | 当天按类型去重的访客 | | `daily[].visitors.human` | integer | no | | | `daily[].visitors.ai` | integer | no | | | `daily[].visitors.bot` | integer | no | | | `topPages` | list of objects | no | | | `topPages[].path` | string | no | | | `topPages[].views` | integer | no | | | `aiAgents` | list of objects | no | | | `aiAgents[].name` | string | no | | | `aiAgents[].count` | integer | no | | | `referrers` | list of objects | no | | | `referrers[].host` | string | no | | | `referrers[].count` | integer | no | | | `countries` | list of objects | no | | | `countries[].code` | string | no | | | `countries[].count` | integer | no | | | `notFound` | list of objects | no | | | `notFound[].path` | string | no | | | `notFound[].count` | integer | no | | | `agentFiles` | list of objects | no | Most requested index and spec files | | `agentFiles[].path` | string | no | | | `agentFiles[].type` | enum | no | Allowed: `index`, `spec`. | | `agentFiles[].agents` | integer | no | | | `agentFiles[].humans` | integer | no | | | `agentFiles[].count` | integer | no | | | `topSearches` | list of objects | no | | | `topSearches[].q` | string | no | | | `topSearches[].count` | integer | no | | ### Example response (200) ```json { "totals": { "views": 1, "humanViews": 1, "visitors": 1, "aiViews": 1, "botViews": 1, "markdownRequests": 1, "agentFileRequests": 1, "mcpCalls": 1, "searches": 1, "questions": 1, "feedbackUp": 1, "feedbackDown": 1 }, "daily": [ { "date": "2026-11-20", "human": 1, "ai": 1, "bot": 1, "visitors": { "human": 1, "ai": 1, "bot": 1 } } ], "topPages": [ { "path": "string", "views": 1 } ], "aiAgents": [ { "name": "ClaudeBot", "count": 1 } ], "referrers": [ { "host": "github.com", "count": 1 } ], "countries": [ { "code": "CN", "count": 1 } ], "notFound": [ { "path": "string", "count": 1 } ], "agentFiles": [ { "path": "/llms.txt", "type": "index", "agents": 1, "humans": 1, "count": 1 } ], "topSearches": [ { "q": "Custom domains", "count": 1 } ] } ``` --- # Ask AI questions `GET /sites/{site}/questions` Newest first. Filters can be combined; for the next page, pass the `ts` of the last item as `before`. Base URL: https://api.butterix.com/v1 Authentication: bearer token in Authorization header or API key in cookie `biti_session` ## Path parameters | Name | Type | Required | Description | |---|---|---|---| | `site` | string | yes | Site slug or id | ## Query parameters | Name | Type | Required | Description | |---|---|---|---| | `days` | integer | no | How many days back; no limit by default | | `before` | integer | no | Only items before this time (Unix milliseconds) | | `outcome` | string | no | Outcomes, separated by commas | | `rating` | enum | no | The reader's rating; `none` for unrated ones Allowed: `up`, `down`, `none`. | | `sources` | enum | no | `none` returns only answers without any source Allowed: `none`. | | `page` | string | no | Page the reader asked from | | `limit` | integer | no | Number of items, 500 at most | ## Example request ```bash curl https://api.butterix.com/v1/sites/acme-payments/questions \ -H "Authorization: Bearer <token>" ``` ## Responses ### 200 Questions readers asked in Ask AI, with the answers Content type: `application/json` | Field | Type | Required | Description | |---|---|---|---| | `[].id` | integer | no | | | `[].ts` | integer | no | | | `[].question` | string | no | | | `[].answer` | string | no | | | `[].model` | string | no | | | `[].provider` | enum | no | Allowed: `anthropic`, `deepseek`, `openrouter`. | | `[].sources` | list of strings | no | | | `[].outcome` | enum | no | Whether it was answered: `answered`, `partial`, `missing` (not in the docs), `declined` (unrelated to the site), `stray` (the answer left the site's subject), or `failed` (incomplete) Allowed: `answered`, `partial`, `missing`, `declined`, `stray`, `failed`. | | `[].rating` | enum | no | The reader's rating May be null. Allowed: `up`, `down`. | | `[].page` | string | no | Page the reader asked from May be null. | | `[].country` | string | no | Country code (looked up from the IP) May be null. | | `[].net` | string | no | Masked network (first three parts of the IP) May be null. | | `[].agent` | string | no | Browser and system May be null. | | `[].visitor` | string | no | Anonymous visitor id (changes daily) May be null. | ### Example response (200) ```json [ { "id": 1, "ts": 1, "question": "How do I set up a custom domain?", "answer": "string", "model": "deepseek-flash", "provider": "anthropic", "sources": [ "/guides/deploy/custom-domains" ], "outcome": "answered", "rating": "up", "page": "/guides/deploy/platform", "country": "CN", "net": "203.0.113.*", "agent": "Chrome 158 · macOS", "visitor": "string" } ] ``` --- # Export Ask AI questions `GET /sites/{site}/questions.csv` Same filters as the question list, up to 10,000 rows. Base URL: https://api.butterix.com/v1 Authentication: bearer token in Authorization header or API key in cookie `biti_session` ## Path parameters | Name | Type | Required | Description | |---|---|---|---| | `site` | string | yes | Site slug or id | ## Query parameters | Name | Type | Required | Description | |---|---|---|---| | `days` | integer | no | How many days back; no limit by default | | `before` | integer | no | Only items before this time (Unix milliseconds) | | `outcome` | string | no | Outcomes, separated by commas | | `rating` | enum | no | The reader's rating; `none` for unrated ones Allowed: `up`, `down`, `none`. | | `sources` | enum | no | `none` returns only answers without any source Allowed: `none`. | | `page` | string | no | Page the reader asked from | ## Example request ```bash curl https://api.butterix.com/v1/sites/acme-payments/questions.csv \ -H "Authorization: Bearer <token>" ``` ## Responses ### 200 CSV file Content type: `text/csv` Type: string ### Example response (200) ```json "string" ``` --- # Page review `GET /sites/{site}/page-reviews` Who is responsible for each page on the default branch, when it was verified and when it is due, with outdated and overdue pages first. See [Page review](https://docs.butterix.com/en/guides/features/page-review.md). Base URL: https://api.butterix.com/v1 Authentication: bearer token in Authorization header or API key in cookie `biti_session` ## Path parameters | Name | Type | Required | Description | |---|---|---|---| | `site` | string | yes | Site slug or id | ## Query parameters | Name | Type | Required | Description | |---|---|---|---| | `today` | date | no | The day to judge by (YYYY-MM-DD); today in UTC by default | ## Example request ```bash curl https://api.butterix.com/v1/sites/acme-payments/page-reviews \ -H "Authorization: Bearer <token>" ``` ## Responses ### 200 Pages Content type: `application/json` | Field | Type | Required | Description | |---|---|---|---| | `pages` | list of objects | no | `null` when the site has no content on the platform yet May be null. | | `pages[].path` | string | no | | | `pages[].title` | string | no | | | `pages[].slug` | string | no | | | `pages[].owners` | list of strings | no | | | `pages[].verified` | date | no | | | `pages[].due` | date | no | Next review | | `pages[].outdated` | boolean | no | Marked as possibly outdated | | `pages[].status` | enum | no | Allowed: `verified`, `due`, `outdated`, `none`. | ### Example response (200) ```json { "pages": [ { "path": "pages/quickstart.mdx", "title": "Quickstart", "slug": "/guides/quickstart", "owners": [ "alice" ], "verified": "2026-11-01", "due": "2027-01-30", "outdated": false, "status": "verified" } ] } ``` --- # Resolution rate `GET /sites/{site}/questions/summary` Counts by outcome, the resolution rate, and reader ratings. Questions that are off-topic or incomplete don't count toward the rate. Base URL: https://api.butterix.com/v1 Authentication: bearer token in Authorization header or API key in cookie `biti_session` ## Path parameters | Name | Type | Required | Description | |---|---|---|---| | `site` | string | yes | Site slug or id | ## Query parameters | Name | Type | Required | Description | |---|---|---|---| | `days` | integer | no | | ## Example request ```bash curl https://api.butterix.com/v1/sites/acme-payments/questions/summary \ -H "Authorization: Bearer <token>" ``` ## Responses ### 200 Summary Content type: `application/json` | Field | Type | Required | Description | |---|---|---|---| | `days` | integer | no | | | `counts` | object | no | | | `counts.answered` | integer | no | | | `counts.partial` | integer | no | | | `counts.missing` | integer | no | | | `counts.declined` | integer | no | | | `counts.stray` | integer | no | | | `counts.failed` | integer | no | | | `resolutionRate` | number | no | 0–1; `null` when no questions count May be null. | | `rating` | object | no | | | `rating.up` | integer | no | | | `rating.down` | integer | no | | ### Example response (200) ```json { "days": 30, "counts": { "answered": 180, "partial": 20, "missing": 25, "declined": 12, "stray": 1, "failed": 3 }, "resolutionRate": 0.8, "rating": { "up": 42, "down": 5 } } ``` --- # Page feedback `GET /sites/{site}/feedback` Base URL: https://api.butterix.com/v1 Authentication: bearer token in Authorization header or API key in cookie `biti_session` ## Path parameters | Name | Type | Required | Description | |---|---|---|---| | `site` | string | yes | Site slug or id | ## Query parameters | Name | Type | Required | Description | |---|---|---|---| | `limit` | integer | no | | ## Example request ```bash curl https://api.butterix.com/v1/sites/acme-payments/feedback \ -H "Authorization: Bearer <token>" ``` ## Responses ### 200 Readers' answers to "Was this page helpful?", code issues, and feedback from AI tools Content type: `application/json` | Field | Type | Required | Description | |---|---|---|---| | `[].id` | integer | no | | | `[].ts` | integer | no | | | `[].path` | string | no | | | `[].helpful` | boolean | no | | | `[].comment` | string | no | | | `[].source` | enum | no | `agent`: sent by an AI tool through MCP or the address in the Markdown; written by AI Allowed: `reader`, `agent`. | | `[].code` | object | no | The code block it is about (code issues only) | | `[].code.index` | integer | no | Which code block on the page, from 0 | | `[].code.lang` | string | no | | | `[].code.line` | string | no | Its first line | ### Example response (200) ```json [ { "id": 1, "ts": 1, "path": "/guides/get-started/quickstart", "helpful": true, "comment": "Please add installation steps for Windows", "source": "reader", "code": { "index": 1, "lang": "bash", "line": "npm install -g bitidocs" } } ] ``` --- # List scheduled tasks `GET /sites/{site}/automations` Base URL: https://api.butterix.com/v1 Authentication: bearer token in Authorization header or API key in cookie `biti_session` ## Path parameters | Name | Type | Required | Description | |---|---|---|---| | `site` | string | yes | Site slug or id | ## Example request ```bash curl https://api.butterix.com/v1/sites/acme-payments/automations \ -H "Authorization: Bearer <token>" ``` ## Responses ### 200 Scheduled tasks, newest first Content type: `application/json` | Field | Type | Required | Description | |---|---|---|---| | `[].id` | string | no | | | `[].name` | string | no | | | `[].prompt` | string | no | | | `[].schedule` | object | no | | | `[].schedule.every` | enum | yes | Allowed: `day`, `week`. | | `[].schedule.weekday` | integer | no | 1 (Monday) to 7 (Sunday), required when `every` is `week` | | `[].schedule.hour` | integer | yes | | | `[].schedule.minute` | integer | no | | | `[].schedule.timezone` | string | no | IANA time zone | | `[].canEdit` | boolean | no | Allow changes to the docs | | `[].enabled` | boolean | no | | | `[].createdBy` | object | no | | | `[].createdBy.id` | string | no | | | `[].createdBy.name` | string | no | | | `[].createdAt` | integer | no | | | `[].nextAt` | integer | no | When it runs next May be null. | | `[].lastRun` | union | no | The last run (without its report); `null` before the first one | | _Variant 1_ | variant | | | | `[].lastRun.id` | string | no | | | `[].lastRun.automationId` | string | no | | | `[].lastRun.cause` | enum | no | Allowed: `schedule`, `manual`. | | `[].lastRun.status` | enum | no | Allowed: `running`, `done`, `failed`. | | `[].lastRun.report` | string | no | Report (Markdown) | | `[].lastRun.branch` | string | no | Draft branch, when there are changes | | `[].lastRun.files` | list of strings | no | Changed files | | `[].lastRun.error` | string | no | Why it failed | | `[].lastRun.usage` | object | no | Token usage | | `[].lastRun.usage.input` | integer | no | | | `[].lastRun.usage.output` | integer | no | | | `[].lastRun.startedAt` | integer | no | | | `[].lastRun.finishedAt` | integer | no | May be null. | ### Example response (200) ```json [ { "id": "auto_01jd8x2k7q", "name": "Weekly documentation gaps", "prompt": "string", "schedule": { "every": "day", "weekday": 1, "hour": 0, "minute": 0, "timezone": "Asia/Shanghai" }, "canEdit": true, "enabled": true, "createdBy": { "id": "string", "name": "string" }, "createdAt": 1, "nextAt": 1, "lastRun": { "id": "run_01jd8x2k7q", "automationId": "string", "cause": "schedule", "status": "running", "report": "string", "branch": "automation/2k7q9x1a", "files": [ "string" ], "error": "string", "usage": { "input": 1, "output": 1 }, "startedAt": 1, "finishedAt": 1 } } ] ``` --- # Create scheduled task `POST /sites/{site}/automations` Requires the `editor` role. A site can have up to 20. Base URL: https://api.butterix.com/v1 Authentication: bearer token in Authorization header or API key in cookie `biti_session` ## Path parameters | Name | Type | Required | Description | |---|---|---|---| | `site` | string | yes | Site slug or id | ## Request body Content type: `application/json` | Field | Type | Required | Description | |---|---|---|---| | `name` | string | yes | | | `prompt` | string | yes | What to do | | `schedule` | object | yes | | | `schedule.every` | enum | yes | Allowed: `day`, `week`. | | `schedule.weekday` | integer | no | 1 (Monday) to 7 (Sunday), required when `every` is `week` | | `schedule.hour` | integer | yes | | | `schedule.minute` | integer | no | | | `schedule.timezone` | string | no | IANA time zone | | `canEdit` | boolean | no | Allow changes to the docs; they are committed to a new draft branch | | `enabled` | boolean | no | | ## Example request ```bash curl -X POST https://api.butterix.com/v1/sites/acme-payments/automations \ -H "Authorization: Bearer <token>" \ -H "Content-Type: application/json" \ -d '{ "name": "Weekly documentation gaps", "prompt": "Look at unanswered questions from the last 7 days and list the 5 gaps most worth filling.", "schedule": { "every": "week", "weekday": 1, "hour": 9, "minute": 0, "timezone": "Asia/Shanghai" } }' ``` ## Responses ### 201 New scheduled task Content type: `application/json` | Field | Type | Required | Description | |---|---|---|---| | `id` | string | no | | | `name` | string | no | | | `prompt` | string | no | | | `schedule` | object | no | | | `schedule.every` | enum | yes | Allowed: `day`, `week`. | | `schedule.weekday` | integer | no | 1 (Monday) to 7 (Sunday), required when `every` is `week` | | `schedule.hour` | integer | yes | | | `schedule.minute` | integer | no | | | `schedule.timezone` | string | no | IANA time zone | | `canEdit` | boolean | no | Allow changes to the docs | | `enabled` | boolean | no | | | `createdBy` | object | no | | | `createdBy.id` | string | no | | | `createdBy.name` | string | no | | | `createdAt` | integer | no | | | `nextAt` | integer | no | When it runs next May be null. | | `lastRun` | union | no | The last run (without its report); `null` before the first one | | _Variant 1_ | variant | | | | `lastRun.id` | string | no | | | `lastRun.automationId` | string | no | | | `lastRun.cause` | enum | no | Allowed: `schedule`, `manual`. | | `lastRun.status` | enum | no | Allowed: `running`, `done`, `failed`. | | `lastRun.report` | string | no | Report (Markdown) | | `lastRun.branch` | string | no | Draft branch, when there are changes | | `lastRun.files` | list of strings | no | Changed files | | `lastRun.error` | string | no | Why it failed | | `lastRun.usage` | object | no | Token usage | | `lastRun.usage.input` | integer | no | | | `lastRun.usage.output` | integer | no | | | `lastRun.startedAt` | integer | no | | | `lastRun.finishedAt` | integer | no | May be null. | ### 400 Invalid request parameters Content type: `application/json` | Field | Type | Required | Description | |---|---|---|---| | `error` | string | yes | Human-readable error message | | `code` | string | no | Machine-readable error code (some endpoints) | ### Example response (201) ```json { "id": "auto_01jd8x2k7q", "name": "Weekly documentation gaps", "prompt": "string", "schedule": { "every": "day", "weekday": 1, "hour": 0, "minute": 0, "timezone": "Asia/Shanghai" }, "canEdit": true, "enabled": true, "createdBy": { "id": "string", "name": "string" }, "createdAt": 1, "nextAt": 1, "lastRun": { "id": "run_01jd8x2k7q", "automationId": "string", "cause": "schedule", "status": "running", "report": "string", "branch": "automation/2k7q9x1a", "files": [ "string" ], "error": "string", "usage": { "input": 1, "output": 1 }, "startedAt": 1, "finishedAt": 1 } } ``` --- # Get scheduled task `GET /sites/{site}/automations/{id}` Base URL: https://api.butterix.com/v1 Authentication: bearer token in Authorization header or API key in cookie `biti_session` ## Path parameters | Name | Type | Required | Description | |---|---|---|---| | `site` | string | yes | Site slug or id | | `id` | string | yes | Scheduled task id | ## Example request ```bash curl https://api.butterix.com/v1/sites/acme-payments/automations/auto_01jd8x2k7q \ -H "Authorization: Bearer <token>" ``` ## Responses ### 200 Scheduled task Content type: `application/json` | Field | Type | Required | Description | |---|---|---|---| | `id` | string | no | | | `name` | string | no | | | `prompt` | string | no | | | `schedule` | object | no | | | `schedule.every` | enum | yes | Allowed: `day`, `week`. | | `schedule.weekday` | integer | no | 1 (Monday) to 7 (Sunday), required when `every` is `week` | | `schedule.hour` | integer | yes | | | `schedule.minute` | integer | no | | | `schedule.timezone` | string | no | IANA time zone | | `canEdit` | boolean | no | Allow changes to the docs | | `enabled` | boolean | no | | | `createdBy` | object | no | | | `createdBy.id` | string | no | | | `createdBy.name` | string | no | | | `createdAt` | integer | no | | | `nextAt` | integer | no | When it runs next May be null. | | `lastRun` | union | no | The last run (without its report); `null` before the first one | | _Variant 1_ | variant | | | | `lastRun.id` | string | no | | | `lastRun.automationId` | string | no | | | `lastRun.cause` | enum | no | Allowed: `schedule`, `manual`. | | `lastRun.status` | enum | no | Allowed: `running`, `done`, `failed`. | | `lastRun.report` | string | no | Report (Markdown) | | `lastRun.branch` | string | no | Draft branch, when there are changes | | `lastRun.files` | list of strings | no | Changed files | | `lastRun.error` | string | no | Why it failed | | `lastRun.usage` | object | no | Token usage | | `lastRun.usage.input` | integer | no | | | `lastRun.usage.output` | integer | no | | | `lastRun.startedAt` | integer | no | | | `lastRun.finishedAt` | integer | no | May be null. | ### 404 The resource doesn't exist, or you don't have access to it Content type: `application/json` | Field | Type | Required | Description | |---|---|---|---| | `error` | string | yes | Human-readable error message | | `code` | string | no | Machine-readable error code (some endpoints) | ### Example response (200) ```json { "id": "auto_01jd8x2k7q", "name": "Weekly documentation gaps", "prompt": "string", "schedule": { "every": "day", "weekday": 1, "hour": 0, "minute": 0, "timezone": "Asia/Shanghai" }, "canEdit": true, "enabled": true, "createdBy": { "id": "string", "name": "string" }, "createdAt": 1, "nextAt": 1, "lastRun": { "id": "run_01jd8x2k7q", "automationId": "string", "cause": "schedule", "status": "running", "report": "string", "branch": "automation/2k7q9x1a", "files": [ "string" ], "error": "string", "usage": { "input": 1, "output": 1 }, "startedAt": 1, "finishedAt": 1 } } ``` --- # Update scheduled task `PATCH /sites/{site}/automations/{id}` Requires the `editor` role. Only the fields you pass are updated. Base URL: https://api.butterix.com/v1 Authentication: bearer token in Authorization header or API key in cookie `biti_session` ## Path parameters | Name | Type | Required | Description | |---|---|---|---| | `site` | string | yes | Site slug or id | | `id` | string | yes | Scheduled task id | ## Request body Content type: `application/json` | Field | Type | Required | Description | |---|---|---|---| | `name` | string | no | | | `prompt` | string | no | | | `schedule` | object | no | | | `schedule.every` | enum | yes | Allowed: `day`, `week`. | | `schedule.weekday` | integer | no | 1 (Monday) to 7 (Sunday), required when `every` is `week` | | `schedule.hour` | integer | yes | | | `schedule.minute` | integer | no | | | `schedule.timezone` | string | no | IANA time zone | | `canEdit` | boolean | no | | | `enabled` | boolean | no | | ## Example request ```bash curl -X PATCH https://api.butterix.com/v1/sites/acme-payments/automations/auto_01jd8x2k7q \ -H "Authorization: Bearer <token>" \ -H "Content-Type: application/json" \ -d '{}' ``` ## Responses ### 200 Updated scheduled task Content type: `application/json` | Field | Type | Required | Description | |---|---|---|---| | `id` | string | no | | | `name` | string | no | | | `prompt` | string | no | | | `schedule` | object | no | | | `schedule.every` | enum | yes | Allowed: `day`, `week`. | | `schedule.weekday` | integer | no | 1 (Monday) to 7 (Sunday), required when `every` is `week` | | `schedule.hour` | integer | yes | | | `schedule.minute` | integer | no | | | `schedule.timezone` | string | no | IANA time zone | | `canEdit` | boolean | no | Allow changes to the docs | | `enabled` | boolean | no | | | `createdBy` | object | no | | | `createdBy.id` | string | no | | | `createdBy.name` | string | no | | | `createdAt` | integer | no | | | `nextAt` | integer | no | When it runs next May be null. | | `lastRun` | union | no | The last run (without its report); `null` before the first one | | _Variant 1_ | variant | | | | `lastRun.id` | string | no | | | `lastRun.automationId` | string | no | | | `lastRun.cause` | enum | no | Allowed: `schedule`, `manual`. | | `lastRun.status` | enum | no | Allowed: `running`, `done`, `failed`. | | `lastRun.report` | string | no | Report (Markdown) | | `lastRun.branch` | string | no | Draft branch, when there are changes | | `lastRun.files` | list of strings | no | Changed files | | `lastRun.error` | string | no | Why it failed | | `lastRun.usage` | object | no | Token usage | | `lastRun.usage.input` | integer | no | | | `lastRun.usage.output` | integer | no | | | `lastRun.startedAt` | integer | no | | | `lastRun.finishedAt` | integer | no | May be null. | ### 400 Invalid request parameters Content type: `application/json` | Field | Type | Required | Description | |---|---|---|---| | `error` | string | yes | Human-readable error message | | `code` | string | no | Machine-readable error code (some endpoints) | ### Example response (200) ```json { "id": "auto_01jd8x2k7q", "name": "Weekly documentation gaps", "prompt": "string", "schedule": { "every": "day", "weekday": 1, "hour": 0, "minute": 0, "timezone": "Asia/Shanghai" }, "canEdit": true, "enabled": true, "createdBy": { "id": "string", "name": "string" }, "createdAt": 1, "nextAt": 1, "lastRun": { "id": "run_01jd8x2k7q", "automationId": "string", "cause": "schedule", "status": "running", "report": "string", "branch": "automation/2k7q9x1a", "files": [ "string" ], "error": "string", "usage": { "input": 1, "output": 1 }, "startedAt": 1, "finishedAt": 1 } } ``` --- # Delete scheduled task `DELETE /sites/{site}/automations/{id}` Requires the `editor` role. Base URL: https://api.butterix.com/v1 Authentication: bearer token in Authorization header or API key in cookie `biti_session` ## Path parameters | Name | Type | Required | Description | |---|---|---|---| | `site` | string | yes | Site slug or id | | `id` | string | yes | Scheduled task id | ## Example request ```bash curl -X DELETE https://api.butterix.com/v1/sites/acme-payments/automations/auto_01jd8x2k7q \ -H "Authorization: Bearer <token>" ``` ## Responses ### 200 Success Content type: `application/json` | Field | Type | Required | Description | |---|---|---|---| | `ok` | true | no | Allowed: `true`. | ### Example response (200) ```json { "ok": true } ``` --- # Run now `POST /sites/{site}/automations/{id}/run` Requires the `editor` role. Runs in the background without affecting the next scheduled run. Base URL: https://api.butterix.com/v1 Authentication: bearer token in Authorization header or API key in cookie `biti_session` ## Path parameters | Name | Type | Required | Description | |---|---|---|---| | `site` | string | yes | Site slug or id | | `id` | string | yes | Scheduled task id | ## Example request ```bash curl -X POST https://api.butterix.com/v1/sites/acme-payments/automations/auto_01jd8x2k7q/run \ -H "Authorization: Bearer <token>" ``` ## Responses ### 202 Started Content type: `application/json` | Field | Type | Required | Description | |---|---|---|---| | `id` | string | no | Run id | ### 409 Already running Content type: `application/json` | Field | Type | Required | Description | |---|---|---|---| | `error` | string | yes | Human-readable error message | | `code` | string | no | Machine-readable error code (some endpoints) | ### 429 Started too often, or other tasks are running Content type: `application/json` | Field | Type | Required | Description | |---|---|---|---| | `error` | string | yes | Human-readable error message | | `code` | string | no | Machine-readable error code (some endpoints) | ### Example response (202) ```json { "id": "run_01jd8x2k7q" } ``` --- # Run history `GET /sites/{site}/automations/{id}/runs` Base URL: https://api.butterix.com/v1 Authentication: bearer token in Authorization header or API key in cookie `biti_session` ## Path parameters | Name | Type | Required | Description | |---|---|---|---| | `site` | string | yes | Site slug or id | | `id` | string | yes | Scheduled task id | ## Example request ```bash curl https://api.butterix.com/v1/sites/acme-payments/automations/auto_01jd8x2k7q/runs \ -H "Authorization: Bearer <token>" ``` ## Responses ### 200 Runs from the last 30 days, 100 at most, newest first Content type: `application/json` | Field | Type | Required | Description | |---|---|---|---| | `[].id` | string | no | | | `[].automationId` | string | no | | | `[].cause` | enum | no | Allowed: `schedule`, `manual`. | | `[].status` | enum | no | Allowed: `running`, `done`, `failed`. | | `[].report` | string | no | Report (Markdown) | | `[].branch` | string | no | Draft branch, when there are changes | | `[].files` | list of strings | no | Changed files | | `[].error` | string | no | Why it failed | | `[].usage` | object | no | Token usage | | `[].usage.input` | integer | no | | | `[].usage.output` | integer | no | | | `[].startedAt` | integer | no | | | `[].finishedAt` | integer | no | May be null. | ### Example response (200) ```json [ { "id": "run_01jd8x2k7q", "automationId": "string", "cause": "schedule", "status": "running", "report": "string", "branch": "automation/2k7q9x1a", "files": [ "string" ], "error": "string", "usage": { "input": 1, "output": 1 }, "startedAt": 1, "finishedAt": 1 } ] ``` --- # List draft branches `GET /sites/{site}/editor/branches` Base URL: https://api.butterix.com/v1 Authentication: bearer token in Authorization header or API key in cookie `biti_session` ## Path parameters | Name | Type | Required | Description | |---|---|---|---| | `site` | string | yes | Site slug or id | ## Example request ```bash curl https://api.butterix.com/v1/sites/acme-payments/editor/branches \ -H "Authorization: Bearer <token>" ``` ## Responses ### 200 Branches Content type: `application/json` | Field | Type | Required | Description | |---|---|---|---| | `[].name` | string | no | | | `[].isDefault` | boolean | no | | | `[].updatedAt` | integer | no | | | `[].author` | string | no | | | `[].ahead` | integer | no | Commits ahead of the production branch | ### Example response (200) ```json [ { "name": "draft/3k9d2a1b-mf2x8k", "isDefault": true, "updatedAt": 1, "author": "Lin Xiao", "ahead": 1 } ] ``` --- # Create draft `POST /sites/{site}/editor/branches` Creates a draft branch `draft/<last 8 characters of the user id>-<time>` from `from` (the production branch by default). Base URL: https://api.butterix.com/v1 Authentication: bearer token in Authorization header or API key in cookie `biti_session` ## Path parameters | Name | Type | Required | Description | |---|---|---|---| | `site` | string | yes | Site slug or id | ## Request body Content type: `application/json` | Field | Type | Required | Description | |---|---|---|---| | `from` | string | no | | ## Example request ```bash curl -X POST https://api.butterix.com/v1/sites/acme-payments/editor/branches \ -H "Authorization: Bearer <token>" \ -H "Content-Type: application/json" \ -d '{}' ``` ## Responses ### 201 New branch name Content type: `application/json` | Field | Type | Required | Description | |---|---|---|---| | `name` | string | no | | ### Example response (201) ```json { "name": "draft/3k9d2a1b-mf2x8k" } ``` --- # Discard draft `DELETE /sites/{site}/editor/branches/{name}` The production branch can't be deleted. Base URL: https://api.butterix.com/v1 Authentication: bearer token in Authorization header or API key in cookie `biti_session` ## Path parameters | Name | Type | Required | Description | |---|---|---|---| | `site` | string | yes | Site slug or id | | `name` | string | yes | | ## Example request ```bash curl -X DELETE https://api.butterix.com/v1/sites/acme-payments/editor/branches/draft%2F3k9d2a1b-mf2x8k \ -H "Authorization: Bearer <token>" ``` ## Responses ### 200 Success Content type: `application/json` | Field | Type | Required | Description | |---|---|---|---| | `ok` | true | no | Allowed: `true`. | ### Example response (200) ```json { "ok": true } ``` --- # File tree and navigation `GET /sites/{site}/editor/tree` Base URL: https://api.butterix.com/v1 Authentication: bearer token in Authorization header or API key in cookie `biti_session` ## Path parameters | Name | Type | Required | Description | |---|---|---|---| | `site` | string | yes | Site slug or id | ## Query parameters | Name | Type | Required | Description | |---|---|---|---| | `branch` | string | no | Branch name; the production branch by default | ## Example request ```bash curl https://api.butterix.com/v1/sites/acme-payments/editor/tree \ -H "Authorization: Bearer <token>" ``` ## Responses ### 200 Files on the branch, the resolved navigation (source language and default version), and the text of docs.yml Content type: `application/json` | Field | Type | Required | Description | |---|---|---|---| | `branch` | string | no | | | `files` | list of objects | no | | | `files[].path` | string | no | | | `files[].size` | integer | no | | | `nav` | list of objects | no | | | `nav[].type` | enum | no | Allowed: `tab`, `section`, `page`, `link`, `api`. | | `nav[].title` | string | no | | | `nav[].slug` | string | no | | | `nav[].path` | string | no | Source file | | `nav[].children` | list of objects | no | | | `nav[].children[].type` | enum | no | Allowed: `tab`, `section`, `page`, `link`, `api`. | | `nav[].children[].title` | string | no | | | `nav[].children[].slug` | string | no | | | `nav[].children[].path` | string | no | Source file | | `nav[].children[].children` | object | no | | | `config` | string | no | Text of the config file | Some nested fields are left out. ### Example response (200) ```json { "branch": "string", "files": [ { "path": "pages/introduction.mdx", "size": 1834 } ], "nav": [ { "type": "tab", "title": "string", "slug": "string", "path": "string", "children": [ { "type": "tab", "title": "string", "slug": "string", "path": "string", "children": null } ] } ], "config": "string" } ``` --- # Read file `GET /sites/{site}/editor/file` Base URL: https://api.butterix.com/v1 Authentication: bearer token in Authorization header or API key in cookie `biti_session` ## Path parameters | Name | Type | Required | Description | |---|---|---|---| | `site` | string | yes | Site slug or id | ## Query parameters | Name | Type | Required | Description | |---|---|---|---| | `branch` | string | no | Branch name; the production branch by default | | `path` | string | yes | Path within the project | ## Example request ```bash curl https://api.butterix.com/v1/sites/acme-payments/editor/file?path=pages%2Fintroduction.mdx \ -H "Authorization: Bearer <token>" ``` ## Responses ### 200 File content Content type: `application/json` | Field | Type | Required | Description | |---|---|---|---| | `path` | string | no | | | `content` | string | no | | | `sha` | string | no | For optimistic concurrency control | ### 404 The resource doesn't exist, or you don't have access to it Content type: `application/json` | Field | Type | Required | Description | |---|---|---|---| | `error` | string | yes | Human-readable error message | | `code` | string | no | Machine-readable error code (some endpoints) | ### Example response (200) ```json { "path": "string", "content": "string", "sha": "string" } ``` --- # Save file `PUT /sites/{site}/editor/file` Commits a file to the draft branch (one save is one commit). Pass the `baseSha` from when the file was opened; if someone else has changed it, you get 409 with the latest content to merge. Sites connected to Git can't write to the production branch directly. Base URL: https://api.butterix.com/v1 Authentication: bearer token in Authorization header or API key in cookie `biti_session` ## Path parameters | Name | Type | Required | Description | |---|---|---|---| | `site` | string | yes | Site slug or id | ## Request body Content type: `application/json` | Field | Type | Required | Description | |---|---|---|---| | `branch` | string | yes | | | `path` | string | yes | | | `content` | string | yes | | | `message` | string | no | | | `baseSha` | string | no | | ## Example request ```bash curl -X PUT https://api.butterix.com/v1/sites/acme-payments/editor/file \ -H "Authorization: Bearer <token>" \ -H "Content-Type: application/json" \ -d '{ "branch": "draft/3k9d2a1b-mf2x8k", "path": "pages/quickstart.mdx", "content": "string" }' ``` ## Responses ### 200 New sha Content type: `application/json` | Field | Type | Required | Description | |---|---|---|---| | `sha` | string | no | | ### 409 The file has changed Content type: `application/json` | Field | Type | Required | Description | |---|---|---|---| | `error` | string | no | | | `current` | object | no | | | `current.content` | string | no | | | `current.sha` | string | no | | ### Example response (200) ```json { "sha": "string" } ``` --- # Delete file `DELETE /sites/{site}/editor/file` Base URL: https://api.butterix.com/v1 Authentication: bearer token in Authorization header or API key in cookie `biti_session` ## Path parameters | Name | Type | Required | Description | |---|---|---|---| | `site` | string | yes | Site slug or id | ## Query parameters | Name | Type | Required | Description | |---|---|---|---| | `branch` | string | no | Branch name; the production branch by default | | `path` | string | yes | Path within the project | ## Example request ```bash curl -X DELETE https://api.butterix.com/v1/sites/acme-payments/editor/file?path=pages%2Fintroduction.mdx \ -H "Authorization: Bearer <token>" ``` ## Responses ### 200 Success Content type: `application/json` | Field | Type | Required | Description | |---|---|---|---| | `ok` | true | no | Allowed: `true`. | ### Example response (200) ```json { "ok": true } ``` --- # Move or rename file `POST /sites/{site}/editor/move` Base URL: https://api.butterix.com/v1 Authentication: bearer token in Authorization header or API key in cookie `biti_session` ## Path parameters | Name | Type | Required | Description | |---|---|---|---| | `site` | string | yes | Site slug or id | ## Request body Content type: `application/json` | Field | Type | Required | Description | |---|---|---|---| | `branch` | string | yes | | | `from` | string | yes | | | `to` | string | yes | | ## Example request ```bash curl -X POST https://api.butterix.com/v1/sites/acme-payments/editor/move \ -H "Authorization: Bearer <token>" \ -H "Content-Type: application/json" \ -d '{ "branch": "string", "from": "pages/old.mdx", "to": "pages/guides/new.mdx" }' ``` ## Responses ### 200 Success Content type: `application/json` | Field | Type | Required | Description | |---|---|---|---| | `ok` | true | no | Allowed: `true`. | ### Example response (200) ```json { "ok": true } ``` --- # Upload an image, media file or font `POST /sites/{site}/editor/upload` Uploads an image, video, PDF, or font (WOFF2, WOFF, TTF, OTF; up to 20 MB), saves it under `assets/` on the draft branch (fonts in `assets/fonts/`), and commits it. Returns a URL you can use in Markdown. Base URL: https://api.butterix.com/v1 Authentication: bearer token in Authorization header or API key in cookie `biti_session` ## Path parameters | Name | Type | Required | Description | |---|---|---|---| | `site` | string | yes | Site slug or id | ## Query parameters | Name | Type | Required | Description | |---|---|---|---| | `branch` | string | yes | | ## Request body Content type: `multipart/form-data` | Field | Type | Required | Description | |---|---|---|---| | `file` | file | yes | | ## Example request ```bash curl -X POST https://api.butterix.com/v1/sites/acme-payments/editor/upload?branch=string \ -H "Authorization: Bearer <token>" \ -H "Content-Type: multipart/form-data" \ -d '{ "file": "<file>" }' ``` ## Responses ### 201 Saved Content type: `application/json` | Field | Type | Required | Description | |---|---|---|---| | `path` | string | no | | | `url` | string | no | | ### 413 Larger than 20 MB Content type: `application/json` | Field | Type | Required | Description | |---|---|---|---| | `error` | string | yes | Human-readable error message | | `code` | string | no | Machine-readable error code (some endpoints) | ### Example response (201) ```json { "path": "assets/mf2x8k-diagram.png", "url": "/assets/mf2x8k-diagram.png" } ``` --- # Live render `POST /sites/{site}/editor/render` Renders full page HTML from unsaved content (with styles, ready for an iframe's `srcdoc`) and returns diagnostics. Previews render in safe mode and don't load the site's custom scripts. Base URL: https://api.butterix.com/v1 Authentication: bearer token in Authorization header or API key in cookie `biti_session` ## Path parameters | Name | Type | Required | Description | |---|---|---|---| | `site` | string | yes | Site slug or id | ## Request body Content type: `application/json` | Field | Type | Required | Description | |---|---|---|---| | `branch` | string | yes | | | `path` | string | yes | | | `content` | string | yes | The current (possibly unsaved) content in the editor | ## Example request ```bash curl -X POST https://api.butterix.com/v1/sites/acme-payments/editor/render \ -H "Authorization: Bearer <token>" \ -H "Content-Type: application/json" \ -d '{ "branch": "string", "path": "pages/quickstart.mdx", "content": "string" }' ``` ## Responses ### 200 Render result Content type: `application/json` | Field | Type | Required | Description | |---|---|---|---| | `html` | string | no | | | `diagnostics` | list of objects | no | | | `diagnostics[].severity` | enum | no | Allowed: `error`, `warning`, `info`. | | `diagnostics[].code` | string | no | | | `diagnostics[].message` | string | no | | | `diagnostics[].file` | string | no | | | `diagnostics[].line` | integer | no | | | `diagnostics[].column` | integer | no | | | `diagnostics[].hint` | string | no | | ### Example response (200) ```json { "html": "string", "diagnostics": [ { "severity": "error", "code": "mdx/unknown-component", "message": "string", "file": "string", "line": 1, "column": 1, "hint": "string" } ] } ``` --- # Check content `POST /sites/{site}/editor/check` Same as live rendering, but returns diagnostics only (like running `biti check` on a single file). Base URL: https://api.butterix.com/v1 Authentication: bearer token in Authorization header or API key in cookie `biti_session` ## Path parameters | Name | Type | Required | Description | |---|---|---|---| | `site` | string | yes | Site slug or id | ## Request body Content type: `application/json` | Field | Type | Required | Description | |---|---|---|---| | `branch` | string | yes | | | `path` | string | yes | | | `content` | string | yes | The current (possibly unsaved) content in the editor | ## Example request ```bash curl -X POST https://api.butterix.com/v1/sites/acme-payments/editor/check \ -H "Authorization: Bearer <token>" \ -H "Content-Type: application/json" \ -d '{ "branch": "string", "path": "pages/quickstart.mdx", "content": "string" }' ``` ## Responses ### 200 Diagnostics Content type: `application/json` | Field | Type | Required | Description | |---|---|---|---| | `diagnostics` | list of objects | no | | | `diagnostics[].severity` | enum | no | Allowed: `error`, `warning`, `info`. | | `diagnostics[].code` | string | no | | | `diagnostics[].message` | string | no | | | `diagnostics[].file` | string | no | | | `diagnostics[].line` | integer | no | | | `diagnostics[].column` | integer | no | | | `diagnostics[].hint` | string | no | | ### Example response (200) ```json { "diagnostics": [ { "severity": "error", "code": "mdx/unknown-component", "message": "string", "file": "string", "line": 1, "column": 1, "hint": "string" } ] } ``` --- # Preview draft `POST /sites/{site}/editor/preview` Creates a preview deployment of the draft branch with its own URL, `<site>--<short id>`. Base URL: https://api.butterix.com/v1 Authentication: bearer token in Authorization header or API key in cookie `biti_session` ## Path parameters | Name | Type | Required | Description | |---|---|---|---| | `site` | string | yes | Site slug or id | ## Request body Content type: `application/json` | Field | Type | Required | Description | |---|---|---|---| | `branch` | string | no | | ## Example request ```bash curl -X POST https://api.butterix.com/v1/sites/acme-payments/editor/preview \ -H "Authorization: Bearer <token>" \ -H "Content-Type: application/json" \ -d '{}' ``` ## Responses ### 202 Queued preview deployment Content type: `application/json` | Field | Type | Required | Description | |---|---|---|---| | `id` | string | no | | | `siteId` | string | no | | | `kind` | enum | no | Allowed: `production`, `preview`. | | `status` | enum | no | Allowed: `queued`, `building`, `ready`, `failed`, `canceled`. | | `source` | string | no | `cli` (upload), `hosted` (hosted repository), or `git` | | `branch` | string | no | | | `commitSha` | string | no | | | `message` | string | no | | | `createdBy` | object | no | Who triggered it; with an API key, the person who created the key | | `createdBy.id` | string | no | | | `createdBy.name` | string | no | | | `apiKey` | object | no | The name, start and end of the key, when triggered with an API key (CLI / CI) | | `apiKey.name` | string | no | | | `apiKey.prefix` | string | no | First 10 characters of the key | | `apiKey.suffix` | string | no | Last 10 characters of the key | | `error` | string | no | Reason for failure | | `pageCount` | integer | no | | | `sizeBytes` | integer | no | | | `durationMs` | integer | no | | | `url` | URL | no | Present after success. Production deployments have the site's URL; previews use a `<site>--<last 8 characters of the id>` subdomain | | `isCurrent` | boolean | no | Whether this is the current production deployment | | `createdAt` | integer | no | | | `finishedAt` | integer | no | | ### Example response (202) ```json { "id": "dpl_01jd8x2k7q", "siteId": "site_2m4k8p", "kind": "production", "status": "queued", "source": "git", "branch": "main", "commitSha": "9fceb02d0ae598e95dc970b74767f19372d61af8", "message": "docs: update quickstart", "createdBy": { "id": "string", "name": "string" }, "apiKey": { "name": "GitHub Actions", "prefix": "biti_a1B2c", "suffix": "Kd82mQx0Zt" }, "error": "string", "pageCount": 94, "sizeBytes": 5832110, "durationMs": 6120, "url": "https://acme-payments--8x2k7q-sites.butterix.com", "isCurrent": true, "createdAt": 1, "finishedAt": 1 } ``` --- # Publish draft `POST /sites/{site}/editor/publish` Merges the draft branch into the production branch (and pushes to the remote when Git is connected), then triggers a production deployment. Returns 409 on merge conflicts. Base URL: https://api.butterix.com/v1 Authentication: bearer token in Authorization header or API key in cookie `biti_session` ## Path parameters | Name | Type | Required | Description | |---|---|---|---| | `site` | string | yes | Site slug or id | ## Request body Content type: `application/json` | Field | Type | Required | Description | |---|---|---|---| | `branch` | string | yes | | | `message` | string | no | | ## Example request ```bash curl -X POST https://api.butterix.com/v1/sites/acme-payments/editor/publish \ -H "Authorization: Bearer <token>" \ -H "Content-Type: application/json" \ -d '{ "branch": "draft/3k9d2a1b-mf2x8k" }' ``` ## Responses ### 202 Production deployment triggered Content type: `application/json` | Field | Type | Required | Description | |---|---|---|---| | `deploymentId` | string | no | | ### 409 Conflict (name taken, already added, or merge conflict) Content type: `application/json` | Field | Type | Required | Description | |---|---|---|---| | `error` | string | yes | Human-readable error message | | `code` | string | no | Machine-readable error code (some endpoints) | ### Example response (202) ```json { "deploymentId": "string" } ``` --- # Translate the site with AI `POST /sites/{site}/editor/translate` Availability: beta Uses the site's Ask AI settings to translate every page incrementally into a new branch `translate/…` (including navigation labels, API specs, and translation memory). Review it in the editor, then publish. Runs as a background job and returns the job id. Base URL: https://api.butterix.com/v1 Authentication: bearer token in Authorization header or API key in cookie `biti_session` ## Path parameters | Name | Type | Required | Description | |---|---|---|---| | `site` | string | yes | Site slug or id | ## Request body Content type: `application/json` | Field | Type | Required | Description | |---|---|---|---| | `to` | list of strings | no | Target languages; every language in docs.yml other than the source by default | | `from` | string | no | Branch to start from; the production branch by default | ## Example request ```bash curl -X POST https://api.butterix.com/v1/sites/acme-payments/editor/translate \ -H "Authorization: Bearer <token>" \ -H "Content-Type: application/json" \ -d '{}' ``` ## Responses ### 202 Job started Content type: `application/json` | Field | Type | Required | Description | |---|---|---|---| | `id` | string | no | | ### 400 Invalid request parameters Content type: `application/json` | Field | Type | Required | Description | |---|---|---|---| | `error` | string | yes | Human-readable error message | | `code` | string | no | Machine-readable error code (some endpoints) | ### Example response (202) ```json { "id": "job_4n7q2w" } ``` --- # Component list `GET /components` All MDX components and their props, the same as `biti components --json`. The visual editor builds its props panel from it. Base URL: https://api.butterix.com/v1 Authentication: bearer token in Authorization header or API key in cookie `biti_session` ## Example request ```bash curl https://api.butterix.com/v1/components \ -H "Authorization: Bearer <token>" ``` ## Responses ### 200 Component list Content type: `application/json` | Field | Type | Required | Description | |---|---|---|---| | `[].name` | string | no | | | `[].aliases` | list of strings | no | | | `[].category` | string | no | | | `[].description` | string | no | | | `[].children` | enum | no | Allowed: `none`, `inline`, `block`. | | `[].parent` | string | no | | | `[].props` | list of objects | no | | | `[].props[].name` | string | no | | | `[].props[].type` | string | no | | | `[].props[].required` | boolean | no | | | `[].props[].options` | list of strings | no | | | `[].props[].default` | any | no | | | `[].props[].description` | string | no | | ### Example response (200) ```json [ { "name": "Callout", "aliases": [ "Note", "Info", "Warning" ], "category": "callout", "description": "string", "children": "none", "parent": "string", "props": [ { "name": "string", "type": "string", "required": true, "options": [ "string" ], "default": "string", "description": "string" } ] } ] ``` --- # Get job `GET /jobs/{id}` Base URL: https://api.butterix.com/v1 Authentication: bearer token in Authorization header or API key in cookie `biti_session` ## Path parameters | Name | Type | Required | Description | |---|---|---|---| | `id` | string | yes | | ## Example request ```bash curl https://api.butterix.com/v1/jobs/job_4n7q2w \ -H "Authorization: Bearer <token>" ``` ## Responses ### 200 Job status and the latest 200 log lines Content type: `application/json` | Field | Type | Required | Description | |---|---|---|---| | `id` | string | no | | | `kind` | string | no | | | `status` | enum | no | Allowed: `running`, `done`, `failed`. | | `log` | list of strings | no | | | `result` | object | no | | | `result.branch` | string | no | | | `result.stats` | map from strings to objects | no | | | `result.stats.<key>.pages` | integer | no | | | `result.stats.<key>.translated` | integer | no | | | `result.stats.<key>.reused` | integer | no | | | `error` | string | no | | ### 404 The resource doesn't exist, or you don't have access to it Content type: `application/json` | Field | Type | Required | Description | |---|---|---|---| | `error` | string | yes | Human-readable error message | | `code` | string | no | Machine-readable error code (some endpoints) | ### Example response (200) ```json { "id": "string", "kind": "translate", "status": "running", "log": [ "string" ], "result": { "branch": "translate/3k9d2a-mf2x8k", "stats": { "key": { "pages": 1, "translated": 1, "reused": 1 } } }, "error": "string" } ``` --- # Ask AI chat (SSE) `POST /_biti/ai/chat` Searches the site's docs and streams an answer with numbered citations. The response is `text/event-stream`, with these events in order: | Event | Data | |---|---| | `sources` | `[{ n, title, heading?, url }]` cited sources | | `text` | `{ t }` a piece of text (many times) | | `done` | `{ model, sig?, notice? }` | | `error` | `{ message, code? }` | `done.sig` is the server's signature for this turn; send it back with the matching `assistant` message in follow-ups. Turns without a valid signature aren't passed to the model as context. Questions clearly unrelated to the docs get no generated answer: `text` is a fixed note and `done` is `{ model: null, notice: "offtopic" }`. When the site reaches its daily limit, only related docs are returned and `done` is `{ model: null, notice: "budget" }`. Requirements on the hosted platform: - Requests must come from the site's own pages (`Origin` matches the site and `Sec-Fetch-Site` is `same-origin`); otherwise 403. - Sites built with a recent version must also send a [session token](https://docs.butterix.com/en/api-reference/runtime/ask-ai-token.md) in the `X-Biti-AI-Token` header. If it's missing or expired you get 401 (`code: "ai_token"`); fetch a new one and retry. Rate limits: 12 per minute and 200 per day per IP (per /64 for IPv6); 60 per minute and 1000 per day per network (/24 for IPv4, /48 for IPv6); at most 2 answers at a time per IP. Returns 404 when the site has Ask AI turned off, and 503 when no key is configured or the monthly quota is used up. Because requests must be same-origin, **Try it** on API reference pages can't call this endpoint. Base URL: https://butterix-sites.butterix.com ## Header parameters | Name | Type | Required | Description | |---|---|---|---| | `X-Biti-AI-Token` | string | no | Session token (required for sites built with a recent version on the hosted platform) | ## Request body Content type: `application/json` | Field | Type | Required | Description | |---|---|---|---| | `messages` | list of objects | yes | Conversation history; the last message must be from `user` | | `messages[].role` | enum | yes | Allowed: `user`, `assistant`. | | `messages[].content` | string | yes | `user` messages can have up to 512 characters | | `messages[].sig` | string | no | For `assistant` messages: the signature returned by that turn's `done` event | | `locale` | string | no | Answer language; the site's first language by default | ## Example request ```bash curl -X POST https://butterix-sites.butterix.com/_biti/ai/chat \ -H "Content-Type: application/json" \ -d '{ "messages": [ { "role": "user", "content": "How do I add an English version of my site?" } ], "locale": "zh" }' ``` ## Responses ### 200 Event stream Content type: `text/event-stream` (stream; each event has these fields) Type: string ### 400 The last message isn't a question, or the question is longer than 512 characters (`code: "too_long"`) Content type: `application/json` | Field | Type | Required | Description | |---|---|---|---| | `error` | string | yes | Human-readable error message | | `code` | string | no | Machine-readable error code (some endpoints) | ### 401 Session token missing or expired (`code: "ai_token"`) Content type: `application/json` | Field | Type | Required | Description | |---|---|---|---| | `error` | string | yes | Human-readable error message | | `code` | string | no | Machine-readable error code (some endpoints) | ### 403 The request doesn't come from the site's own pages (`code: "origin"`) Content type: `application/json` | Field | Type | Required | Description | |---|---|---|---| | `error` | string | yes | Human-readable error message | | `code` | string | no | Machine-readable error code (some endpoints) | ### 413 Request body larger than 256 KB (`code: "too_large"`) Content type: `application/json` | Field | Type | Required | Description | |---|---|---|---| | `error` | string | yes | Human-readable error message | | `code` | string | no | Machine-readable error code (some endpoints) | ### 429 Too many questions (`code: "rate_limited"`) or too many answers at once (`code: "busy"`) Content type: `application/json` | Field | Type | Required | Description | |---|---|---|---| | `error` | string | yes | Human-readable error message | | `code` | string | no | Machine-readable error code (some endpoints) | ### 503 No AI provider configured Content type: `application/json` | Field | Type | Required | Description | |---|---|---|---| | `error` | string | yes | Human-readable error message | | `code` | string | no | Machine-readable error code (some endpoints) | ### Example response (200) ```json "event: sources\ndata: [{\"n\":1,\"title\":\"Internationalization\",\"url\":\"/guides/features/i18n\"}]\n\nevent: text\ndata: {\"t\":\"Add en to languages in docs.yml [1], \"}\n\nevent: text\ndata: {\"t\":\"then put the translations under translations/en/.\"}\n\nevent: done\ndata: {\"model\":\"claude-opus-5-5\",\"unanswered\":true}\n" ``` --- # Ask AI session token `GET /_biti/ai/token` Gets the session token needed for [Ask AI chat](https://docs.butterix.com/en/api-reference/runtime/ask-ai.md). It's valid for 30 minutes and tied to the site, the client's network, and the browser (get a new one after switching network or browser). Cross-site requests get 403; at most 30 per minute per IP. Base URL: https://butterix-sites.butterix.com ## Example request ```bash curl https://butterix-sites.butterix.com/_biti/ai/token ``` ## Responses ### 200 Session token Content type: `application/json` | Field | Type | Required | Description | |---|---|---|---| | `token` | string | yes | | | `expiresAt` | integer | yes | Expiry time (millisecond timestamp) | ### 403 Cross-site request Content type: `application/json` | Field | Type | Required | Description | |---|---|---|---| | `error` | string | yes | Human-readable error message | | `code` | string | no | Machine-readable error code (some endpoints) | ### 429 Too many requests Content type: `application/json` | Field | Type | Required | Description | |---|---|---|---| | `error` | string | yes | Human-readable error message | | `code` | string | no | Machine-readable error code (some endpoints) | ### Example response (200) ```json { "token": "1795435200000.Zm9vYmFyYmF6cXV4cXV1eGNvcmdl", "expiresAt": 1 } ``` --- # MCP server `POST /_mcp/server` The site's MCP server (Streamable HTTP transport, JSON responses). Supports `initialize`, `ping`, `tools/list`, and `tools/call`, and accepts batches. Tools: `search_docs` (search), `get_page` (a page's Markdown), and `list_pages` (list pages). On sites with several languages, `search_docs` and `list_pages` accept `locale`. `GET` requests get 405; sites with MCP turned off return 404. Password-protected sites need an access token or an OAuth sign-in, and return 401 without one. Base URL: https://butterix-sites.butterix.com ## Request body Content type: `application/json` | Field | Type | Required | Description | |---|---|---|---| | `jsonrpc` | "2.0" | yes | Allowed: `2.0`. | | `id` | string | no | | | `method` | enum | yes | Allowed: `initialize`, `ping`, `tools/list`, `tools/call`. | | `params` | object | no | | ## Example request ```bash curl -X POST https://butterix-sites.butterix.com/_mcp/server \ -H "Content-Type: application/json" \ -d '{ "jsonrpc": "2.0", "id": 1, "method": "tools/call", "params": { "name": "search_docs", "arguments": { "query": "Custom domains", "limit": 3 } } }' ``` ## Responses ### 200 JSON-RPC response Content type: `application/json` | Field | Type | Required | Description | |---|---|---|---| | `jsonrpc` | string | no | | | `id` | string | no | | | `result` | object | no | | | `error` | object | no | | | `error.code` | integer | no | | | `error.message` | string | no | | ### 202 Notifications have no response body ### Example response (200) ```json { "jsonrpc": "2.0", "id": 1, "result": { "content": [ { "type": "text", "text": "## 1. Custom domains › Configure DNS\nURL: https://docs.butterix.com/guides/deploy/custom-domains\n\nAdd a TXT record…" } ] } } ``` --- # API explorer proxy `POST /_biti/proxy` **Try it** on API reference pages sends requests through it to get around browser cross-origin limits. So that it can't be used as an open proxy: - Only `servers` origins declared in the site's OpenAPI specs are allowed; anything else gets 403. - On the hosted platform, hosts that resolve to private or loopback addresses are refused. - Headers such as `Cookie` and `Host` are removed, redirects aren't followed, response bodies are limited to 2 MB, and requests time out after 30 seconds. - At most 60 per minute per IP. Base URL: https://butterix-sites.butterix.com ## Request body Content type: `application/json` | Field | Type | Required | Description | |---|---|---|---| | `url` | string | yes | | | `method` | string | yes | | | `headers` | map from strings to strings | no | | | `body` | string | no | | ## Example request ```bash curl -X POST https://butterix-sites.butterix.com/_biti/proxy \ -H "Content-Type: application/json" \ -d '{ "url": "https://api.butterix.com/v1/whoami", "method": "GET" }' ``` ## Responses ### 200 The target service's response (whatever its status code) Content type: `application/json` | Field | Type | Required | Description | |---|---|---|---| | `status` | integer | no | | | `statusText` | string | no | | | `headers` | map from strings to strings | no | | | `body` | string | no | | | `truncated` | boolean | no | | | `size` | integer | no | | | `timeMs` | integer | no | | ### 403 The target host isn't declared in the specs, or resolves to a private address Content type: `application/json` | Field | Type | Required | Description | |---|---|---|---| | `error` | string | yes | Human-readable error message | | `code` | string | no | Machine-readable error code (some endpoints) | ### Example response (200) ```json { "status": 200, "statusText": "OK", "headers": { "key": "string" }, "body": "string", "truncated": true, "size": 1, "timeMs": 84 } ``` --- # Submit page feedback `POST /_biti/feedback` The endpoint behind "Was this page helpful?" at the bottom of pages. Comments can have up to 2000 characters. Base URL: https://butterix-sites.butterix.com ## Request body Content type: `application/json` | Field | Type | Required | Description | |---|---|---|---| | `path` | string | yes | | | `helpful` | boolean | yes | | | `comment` | string | no | | ## Example request ```bash curl -X POST https://butterix-sites.butterix.com/_biti/feedback \ -H "Content-Type: application/json" \ -d '{ "path": "/guides/get-started/quickstart", "helpful": true }' ``` ## Responses ### 204 Recorded --- # Changelog New features, improvements and fixes in ButterIX, newest first. Filter by tag, search, or subscribe via [RSS](https://docs.butterix.com/en/changelog.rss), [Atom](https://docs.butterix.com/en/changelog.atom) or [JSON Feed](https://docs.butterix.com/en/changelog.json). > Showing the latest 20 of 29 entries. > Index of every entry: https://docs.butterix.com/en/changelog/llms.txt > Feeds: https://docs.butterix.com/en/changelog.rss (RSS), https://docs.butterix.com/en/changelog.atom (Atom), https://docs.butterix.com/en/changelog.json (JSON Feed) ## [Navigation icons can sit in a tile](https://docs.butterix.com/en/changelog/2026/12/02.md#2026-12-02-navigation-icons-can-sit-in-a-tile) _December 2, 2026 · Tags: Navigation_ Write `icon-style: tile` on a navigation item and its icon sits in a small outlined square that fills with the accent color, with a white icon, on hover and on the current page: a way to set a few key entries apart from ordinary pages: ```yaml - page: Quickstart path: pages/quickstart.mdx icon: lucide:rocket icon-style: tile ``` Sections, pages, links, folders, changelogs, API sections and tabs shown in the sidebar all take it, and pages can set it in their frontmatter. [Sidebar links](https://docs.butterix.com/en/guides/configuration/docs-yml.md#sidebar-links) use this style by default, with their size, outline and dark mode adjusted to match; write `icon-style: plain` to make one an ordinary link. See [Icon style](https://docs.butterix.com/en/guides/configuration/navigation.md#icon-style). ## [Add .mdx to a page URL to get its source](https://docs.butterix.com/en/changelog/2026/11/30.md#2026-11-30-add-mdx-to-a-page-url-to-get-its-source) _November 30, 2026 · Tags: AI_ Append `.mdx` to any page URL to get the page's source as its author wrote it, with components left as MDX, so AI tools can learn how it is written: ```bash curl https://docs.butterix.com/components/live-photo.mdx ``` The `.md` suffix redirects to `.mdx`. Generated pages such as endpoint pages and the changelog have no source, so both addresses return their clean Markdown; for the clean Markdown of a written page, send `Accept: text/markdown`. See [Markdown for every page](https://docs.butterix.com/en/guides/features/agents.md#markdown-for-every-page). ## [New components: Live Photo and image compare](https://docs.butterix.com/en/changelog/2026/11/30.md#2026-11-30-new-components-live-photo-and-image-compare) _November 30, 2026 · Tags: Content_ - **Live Photo**: `<LivePhoto>` pairs a photo with a short video and shows a Live badge in the top-left corner. Press and hold to play, let go to stop, or click the badge to play it once, just like Live Photos on iPhone. - **Image compare**: `<ImageCompare>` stacks two images with a divider you drag left and right, great for showing before-and-after changes. ```mdx <LivePhoto src="/assets/live.jpg" video="/assets/live.mp4" /> <ImageCompare before="/assets/before.jpg" after="/assets/after.jpg" beforeLabel="Before" afterLabel="After" /> ``` See [Live Photo](https://docs.butterix.com/en/components/live-photo.md) and [Image compare](https://docs.butterix.com/en/components/image-compare.md). ## [Ask AI: images right in the answer](https://docs.butterix.com/en/changelog/2026/11/29.md#2026-11-29-ask-ai-images-right-in-the-answer) _November 29, 2026 · Tags: AI_ Add `askAi` to an image and Ask AI can show it right in an answer, such as a support group QR code or an architecture diagram: ```mdx <img src="/assets/support-qr.png" alt="User group QR code" width="240" askAi /> ``` For an image written in Markdown, put it where the title goes: `![User group QR code](/assets/support-qr.png 'askAi')`. Images without the marker are never shown, and the embedded assistant works the same way. In the visual editor, click the image to turn it on. See [Showing images in answers](https://docs.butterix.com/en/guides/features/ask-ai.md#showing-images-in-answers). ## [Page review, migration tool, and contact when AI has no answer](https://docs.butterix.com/en/changelog/2026/11/26.md#2026-11-26-page-review-migration-tool-and-contact-when-ai-has-no-answer) _November 26, 2026 · Tags: Content, CLI, AI_ - **Page review**: give pages an owner, a verification date and a review period. The dashboard lists pages to review, the editor has **Verified today**, and readers can see the date at the bottom of pages. - **Migration tool**: `biti migrate` prints migration steps for a coding agent, and compares pages, text, code, images, addresses, redirects and API operations with the new project to list what is missing. - **Contact when AI has no answer**: turn it on in the site's settings and enter your contact details. Readers can reach you when Ask AI has no answer, fails, or is rated down; they check and send emails themselves. - **Edit inside frames**: select, replace or delete images, videos and components inside a Frame directly in the editor, and change its caption in place; the same goes for callouts and updates that only hold an image. Several images in a frame now sit side by side instead of being cut off. - `biti check --review` lists pages to review; the console agent and scheduled tasks can read page reviews. See [Page review](https://docs.butterix.com/en/guides/features/page-review.md), [Migration tool](https://docs.butterix.com/en/guides/reference/migrate.md) and [Ask AI](https://docs.butterix.com/en/guides/features/ask-ai.md#contact-when-ai-has-no-answer). ## [Feedback on code blocks and from AI tools, suggested redirects for 404s, page events](https://docs.butterix.com/en/changelog/2026/11/26.md#2026-11-26-feedback-on-code-blocks-and-from-ai-tools-suggested-redirects-fo) _November 26, 2026 · Tags: AI, Content_ - **Code block feedback**: code blocks in the text now have a flag; readers can report that an example doesn't run, has a mistake or is out of date, and the dashboard records which block it was. - **Feedback from AI tools**: AI tools that find a mistake can report it through the site MCP's `send_feedback` or the address at the top of each page's Markdown; it is kept apart from readers' feedback in the dashboard. - **Suggested redirects for 404s**: **Content checks → 404 redirects** lists missing addresses readers visited and the page most like each. Add one and it works right away; moved sections become one wildcard rule, and a rule stops applying once its address has a page again. - **Page events**: custom scripts can listen to `bd:page`, `bd:search`, `bd:ask` and `bd:theme` to act on every page change or when search opens. - **llms.txt**: lists where to download the API specs; `noindex` pages are left out; supports `?excludeSpec=true` and `?excludeChangelog=true`. Request examples in the Markdown of endpoint pages include headers and authentication, and webhooks show an example payload. - The CLI connects to the ButterIX hosted platform by default; `--api` in the docs is only needed when self-hosting. See [Analytics › Feedback](https://docs.butterix.com/en/guides/features/analytics.md#feedback), [Page events](https://docs.butterix.com/en/guides/configuration/docs-yml.md#page-events) and [llms.txt](https://docs.butterix.com/en/guides/features/agents.md#take-only-what-you-need). ## [Export to PDF and Markdown](https://docs.butterix.com/en/changelog/2026/11/26.md#2026-11-26-export-to-pdf-and-markdown) _November 26, 2026 · Tags: Content, CLI_ - **Print a page**: **More actions** now has **Print / Save as PDF**. Everything folded or switched is opened up, code isn't cut off, and dark pages print in light colors. - **Export a section or the whole site**: pick what you need in the site's overview in the console, and get a PDF with a cover and contents, or a ZIP of Markdown with images that works offline. - **`biti export`**: export Markdown or PDF from the command line. - **Search in the tab bar**: `layout.searchbar-placement: header-tabs` now puts the search bar at the right end of the tab bar. - In the editor's settings, sidebar links moved to **Navigation**; a long navigation shows its beginning first and can be expanded. - **Addresses use the primary domain**: the embed code, the MCP address and the print page in the console now use the primary domain; embed code you already use keeps working. The domains page lists the primary domain first and folds the DNS records of verified domains. - On password-protected sites, readers get back to the page they wanted after entering the password. See [Export and print](https://docs.butterix.com/en/guides/features/export.md). ## [Docs eval, and a warning for AsyncAPI](https://docs.butterix.com/en/changelog/2026/11/26.md#2026-11-26-docs-eval-and-a-warning-for-asyncapi) _November 26, 2026 · Tags: AI, CLI_ - **Docs eval**: write what readers ask and what a correct answer says into `evals.yml`; `biti eval` lets AI answer from the docs alone with your own model key and grades each point. Set a pass mark in CI, and upload with `--site` to see the history in the dashboard. - **Questions from readers**: `biti eval --import` adds what is asked most as drafts; in the dashboard's conversations, select **Copy as an eval question**. - **Spec check**: a section that points at AsyncAPI, OpenRPC or another spec that isn't supported yet gets an `api/unsupported` warning in `biti check`, deployment logs and the editor, instead of staying silently empty. - The API explorer opens and closes along the same path, and slides more smoothly. See [Docs eval](https://docs.butterix.com/en/guides/features/evals.md). ## [Scheduled tasks, organization MCP, and access tokens for protected sites](https://docs.butterix.com/en/changelog/2026/11/25.md#2026-11-25-scheduled-tasks-organization-mcp-and-access-tokens-for-protected) _November 25, 2026 · Tags: AI, Platform_ - **Scheduled tasks**: have AI check your docs and reader feedback daily or weekly and write a report; when you allow edits, changes go to a draft branch for you to review. - **Organization MCP server**: connect `https://api.butterix.com/v1/mcp` to a coding assistant to look up sites, deployments, analytics, questions, and feedback, all read-only. - **Access tokens**: AI tools and scripts read password-protected sites with a token; MCP clients that support OAuth can sign in directly. - All of these, plus custom answers, content sources, embedding, and filtering and exporting questions, have matching APIs. See [Scheduled tasks](https://docs.butterix.com/en/guides/features/automations.md), [Hosted platform](https://docs.butterix.com/en/guides/deploy/platform.md#organization-mcp-server), and [Access control](https://docs.butterix.com/en/guides/deploy/access-control.md#ai-tools-and-programs). ## [Zoom and pan diagrams, persistent sidebar links](https://docs.butterix.com/en/changelog/2026/11/25.md#2026-11-25-zoom-and-pan-diagrams-persistent-sidebar-links) _November 25, 2026 · Tags: Content, Appearance_ - **Diagram controls**: Mermaid diagrams zoom, pan and reset right on the page, or open in a floating window; `controls` and `placement` adjust a single diagram. - **Sidebar links**: `sidebar-links` puts your community, blog or roadmap at the top of the sidebar on every tab, with icons and colors. You can edit them in the console too. - Global anchors become sidebar links when you import from Mintlify. See [Zoom and pan](https://docs.butterix.com/en/guides/writing/math-and-diagrams.md#zoom-and-pan) and [Sidebar links](https://docs.butterix.com/en/guides/configuration/docs-yml.md#sidebar-links). ## [Console agent and documentation gaps](https://docs.butterix.com/en/changelog/2026/11/25.md#2026-11-25-console-agent-and-documentation-gaps) _November 25, 2026 · Tags: AI, Console_ - **Console agent**: check traffic, questions, and feedback, write docs, and change the navigation from the console; changes go to a draft branch that you review and publish. - **Changes that need approval**: external addresses, scripts, site settings, and deleted pages are listed for your approval first. - **Suggestions**: custom answers and scheduled tasks are carried out only when you confirm. - **Documentation gaps**: unanswered questions, searches without results, negative feedback, and 404s, grouped by topic, with drafts one click away. - **Chats**: kept per site, available in both the editor and the console. - **Separate switches**: console AI and your readers' Ask AI are switched separately; the readers' Ask AI has no management abilities. See [Console agent](https://docs.butterix.com/en/guides/features/console-agent.md). ## [Ask AI: custom answers, content sources, and embedding](https://docs.butterix.com/en/changelog/2026/11/25.md#2026-11-25-ask-ai-custom-answers-content-sources-and-embedding) _November 25, 2026 · Tags: AI_ - **Custom answers**: write the answer to a kind of question, and the AI answers from it first. - **Content sources**: upload Markdown or fetch public websites, so the AI can draw on content outside your docs. - **Embed**: one script puts the assistant on your website or in your product. - **Hide personal data**: `ai.mask-pii` hides emails, phone numbers, ID numbers, bank cards, and secrets before sending, and asks the reader to check. - **Question log**: readers can rate answers; filter by outcome, rating, and whether there are sources, see the resolution rate, and export CSV. - **Direct links**: `?ask-ai=question` writes the question in, and `?search=words` opens search. - The notice in the panel can be customized (`ai.disclaimer`). See [Ask AI](https://docs.butterix.com/en/guides/features/ask-ai.md) and [Embed](https://docs.butterix.com/en/guides/features/ask-ai-embed.md). ## [API specs at fixed URLs, fuller Markdown for endpoints](https://docs.butterix.com/en/changelog/2026/11/25.md#2026-11-25-api-specs-at-fixed-urls-fuller-markdown-for-endpoints) _November 25, 2026 · Tags: API, Agent_ - **Spec URLs**: `/openapi.json`, `/openapi.yaml`, and `/openapi/<api-name>.json`; with several APIs the root URLs are a list, and hidden endpoints are left out. - **API catalog**: `/.well-known/api-catalog` lists each API's specs and reference page. - **Endpoint Markdown** lists the response fields of every status code, and endpoint snippet components output the actual code and field tables. See [Download the spec](https://docs.butterix.com/en/guides/api/openapi.md#download-the-spec). ## [Docs that agents read better, with your own skills](https://docs.butterix.com/en/changelog/2026/11/25.md#2026-11-25-docs-that-agents-read-better-with-your-own-skills) _November 25, 2026 · Tags: AI, Agent_ - **One-click setup**: the More menu of a page connects Claude Code, Cursor, or VS Code, or copies the MCP URL; opening in ChatGPT or Claude includes the full URL. - **Hosted skills**: skills in `.well-known/agent-skills/` are published with the site, and readers install them with `npx skills add` and your domain. - **Writing skill**: `biti init --skill` teaches coding agents to write ButterIX docs. - **Page directive**: every `.md` starts by telling agents where the index and MCP are, and which version the page belongs to on sites with several. Customize it or turn it off. - **Markdown URLs**: `.mdx` works like `.md`, redirects keep the suffix and query string, and missing pages return a Markdown 404 with similar pages. - **Site MCP**: on sites with several languages, pick a language or let the query decide; `agents.mcp: false` turns it off. - **robots.txt**: declare content use with `Content-Signal`, or use your own file. - Analytics counts requests for index and spec files separately. See [Agent-friendly](https://docs.butterix.com/en/guides/features/agents.md) and [SEO](https://docs.butterix.com/en/guides/features/seo.md#robotstxt-and-ai-crawlers). ## [Translate API references and changelogs too](https://docs.butterix.com/en/changelog/2026/11/24.md#2026-11-24-translate-api-references-and-changelogs-too) _November 24, 2026 · Tags: i18n_ - **API reference**: put a translated spec at the same path under `translations/<lang>/`. It can be partial; structure and URLs stay the same. - **Changelogs and blogs**: entries and tags can be translated, and feeds are generated per language. - **The default language can differ from the source language**: the default decides URLs and the home page, while files stay organized by the source. - **Missing translations fall back** to the default language, then the source. Links that start with `/` stay in the reader's language and version. - External links, the logo, the announcement bar, and the footer can differ by language, and AI translation covers all site text. - Manage languages and versions in the editor: add, reorder, rename, and set the default. See [Internationalization](https://docs.butterix.com/en/guides/features/i18n.md) and [Versions](https://docs.butterix.com/en/guides/features/versions.md). ## [Editor: icon picker, inserting between blocks, and image captions](https://docs.butterix.com/en/changelog/2026/11/24.md#2026-11-24-editor-icon-picker-inserting-between-blocks-and-image-captions) _November 24, 2026 · Tags: Editor, Content_ - **Icon picker**: more than 4,200 Lucide and Font Awesome icons, searchable and filterable by source; paste an image URL or SVG if you prefer. - **Insert between blocks**: hold `⌘` (`Ctrl` on Windows) and move the mouse for a line that shows where a click inserts — between blocks, list items, and table rows, and inside table cells — or just click the space between two blocks and type. - **Image captions**: `<img caption="…" />` adds a line of small gray text centered below the image, in tables too. - **Merged cells** are written `|>>|` and `|^^|`; a backslash shows the characters themselves. - **Drag table rows and columns**: hold a column's “…” or a row's “⋮” and drag; a line shows where it lands. - **Upload fonts**: body text, headings, and code can each use their own font files. - **Safer images**: Backspace next to an image selects it first and deletes it on the second press. - Steps have a new look; wide tables have cleaner edge shadows, sticky headers and first columns no longer show what's behind them, and neighboring components inside containers are spaced apart. See [Visual editor](https://docs.butterix.com/en/guides/deploy/editor.md#inserting-between-blocks), [Icon](https://docs.butterix.com/en/components/icon.md#available-icons), [Images and media](https://docs.butterix.com/en/guides/writing/media.md#captions), and [Merged cells](https://docs.butterix.com/en/guides/writing/markdown.md#merged-cells). ## [Faster builds and an easier CLI](https://docs.butterix.com/en/changelog/2026/11/24.md#2026-11-24-faster-builds-and-an-easier-cli) _November 24, 2026 · Tags: CLI, Platform_ - **Incremental builds**: only changed pages are rendered again, and the result is byte for byte what a build from scratch writes. - **CDN friendly**: assets are named by their content, unchanged assets aren't uploaded again, and sites with a CDN cache their pages. - **Merging online changes**: `biti deploy` merges changes published in the editor into your local files line by line before deploying; conflicts show the file, who published it, and when. - **API host**: scripts and CI can use `https://api.butterix.com`. - API keys show their beginning and end, and the deployment list shows which key triggered each deployment. See [CLI deployment and API keys](https://docs.butterix.com/en/guides/deploy/cli-deploy.md) and the [CLI reference](https://docs.butterix.com/en/guides/reference/cli.md). ## [Ask AI: reasoning effort, direct links, and abuse protection](https://docs.butterix.com/en/changelog/2026/11/24.md#2026-11-24-ask-ai-reasoning-effort-direct-links-and-abuse-protection) _November 24, 2026 · Tags: AI_ - **Reasoning effort** shows the levels the chosen model supports, for Anthropic, DeepSeek, and OpenRouter. - **Direct links**: add `?ask-ai` to any page URL and the panel opens with the page. - **Abuse protection**: topic gating, layered rate limits, origin checks, session tokens, signed history, and a daily limit per site keep it from being used as a free general-purpose AI. - Keys are verified with the provider when you save, and the entry points disappear from the site when no AI is available. See [Ask AI](https://docs.butterix.com/en/guides/features/ask-ai.md). ## [Endpoint pages: click to edit, more examples](https://docs.butterix.com/en/changelog/2026/11/24.md#2026-11-24-endpoint-pages-click-to-edit-more-examples) _November 24, 2026 · Tags: API_ - Click text on an endpoint page in the editor to change it; the content is written back to the spec, or to the translation when previewing another language. - Adjust how endpoints look site-wide or one by one: layout, the width of the example column and content, Try it, examples, and error descriptions. - The playground and endpoint pages share request examples in nine languages. The language preference follows the reader across the site, and values are escaped correctly for each language. - Parameter descriptions moved into hover cards, and response statuses into a dropdown. See [Import OpenAPI](https://docs.butterix.com/en/guides/api/openapi.md) and [Try it and proxy](https://docs.butterix.com/en/guides/api/try-it.md). ## [Live visitors and more accurate views](https://docs.butterix.com/en/changelog/2026/11/23.md#2026-11-23-live-visitors-and-more-accurate-views) _November 23, 2026 · Tags: Analytics_ - **Live visitors**: each request from the last 30 minutes, refreshed every 10 seconds, with the flag and country, masked network, browser and system, referrer, and whether it counts as a view. - **Views**: human views count once the page's script reports back; headless browsers and scanners are treated as crawlers, and dashboard visits and 404 pages aren't counted. - **Countries / regions**: looked up from the visitor's IP, with a database that updates itself. See [Analytics](https://docs.butterix.com/en/guides/features/analytics.md#live-visitors). --- # ButterIX Docs (v0) > Introduction to the ButterIX v0 (legacy) docs. v0 is no longer maintained; please read the v1 docs. > **You're reading legacy docs** > > v0 is no longer maintained. Switch to **v1** with the version selector in the header, or go straight to the [v1 introduction](https://docs.butterix.com/en/guides/get-started/introduction.md). v0 was an early preview of ButterIX that provided the core capabilities: describe navigation with `docs.yml`, write pages in MDX, and preview them with `biti dev`. ## What v0 includes - `docs.yml` configuration and navigation (sections, pages, links) - MDX pages and common components (callouts, cards, code blocks) - `biti dev` previews and `biti deploy` publishing Versions, locales, Ask AI, and the MCP server are all provided in v1. ## What this page demonstrates ### Version prefix This page's URL starts with `/v0`: non-default versions use a `/<slug>` prefix, and the default version (v1) has no prefix. ### Same-page switching Switching to v1 in the version selector opens the **matching** "Introduction" page in v1 directly, because both have the same tab, section titles, and page title. ### canonical View the page source: `<link rel="canonical" />` points to the same page in v1, so search engines only index the current version. See [v1 › Versions](https://docs.butterix.com/en/guides/features/versions.md) for details. --- # Quickstart (v0) > ButterIX v0 (legacy) quickstart. Please read the v1 quickstart first. > **Warning** > > Legacy docs. For the current steps, see [v1 › Quickstart](https://docs.butterix.com/en/guides/get-started/quickstart.md). ### Install ```bash npm install -g bitidocs ``` ### Initialize ```bash biti init my-docs ``` ### Preview and publish ```bash cd my-docs biti login biti dev biti deploy ``` `biti dev` previews the docs on your computer, and `biti deploy` publishes them to the hosted platform. --- # docs.yml reference (v0) > docs.yml fields in ButterIX v0 (legacy). See v1 for the full field reference. > **Warning** > > Legacy docs. For the complete, up-to-date field reference, see [v1 › docs.yml reference](https://docs.butterix.com/en/guides/configuration/docs-yml.md). Commonly used fields in v0: ```yaml title="docs.yml" title: Acme Docs logo: light: assets/logo.svg colors: accent-primary: "#7C5CFF" navigation: - section: Get started slug: start contents: - page: Introduction path: pages/introduction.mdx slug: introduction - link: Website href: https://example.com ``` - `title` (string): Site name. - `logo` (object): Header logo (`light`, `dark`, `height`). - `colors.accent-primary` (color): Accent color. - `navigation` (NavItem[]): Sidebar navigation: `section`, `page`, `link`. These fields remain compatible in v1, which adds tabs, versions, products, locales, redirects, SEO, AI, and more on top of them.