Skip to content
  • Auto
  • Light
  • Dark
FeedbackDashboard
Getting started

Stainless Docs Overview

Getting started

Stainless Docs is a documentation framework that combines automated API reference generation with a flexible system for authoring guides and other long-form technical content. It produces comprehensive documentation for your Stainless SDKs and gives you deep control over content, layout, and deployment with a developer-centric docs-as-code workflow.

Stainless Docs produces API reference documentation using the same underlying technology that Stainless uses to generate SDKs. It ingests your OpenAPI specification and Stainless configuration, generates language-specific SDK metadata, and then renders that metadata as interactive content.

  • Language-specific output: Stainless Docs generates dedicated documentation for each programming language. Users can toggle between languages to see method signatures, parameters, and return objects, with language-specific type definitions. This goes beyond generic REST API documentation to provide a true SDK-native experience.
  • Comprehensive coverage: Everything is documented, from high-level resources to the specific types and properties in your SDKs. The documentation also includes a full HTTP reference with curl snippets for users who interact with your API directly.
  • Interactive snippet sandbox: Stainless Docs generates snippets for every method in each supported programming language. Users can edit and run code snippets in the browser with an integrated snippet sandbox. The snippet editor includes language-aware autocompletion and type checking, providing an ideal way for users to explore your API before they even install the SDK.
  • Accurate and consistent: Stainless Docs is powered by the same engine as our SDK generator, so you can be confident that types and method signatures are always correct and remain up-to-date as your API evolves.

For tutorials, conceptual guides, and architectural overviews, you can author content using familiar, Markdown-based formats like MDX and Markdoc. Create rich, interactive pages using a standard library of components (including tabs, cards, and asides) or create your own custom components as needed.

Every site built with Stainless Docs is a complete, standalone Astro project that you own and control.

  • High performance: By default, Astro generates static HTML and CSS with minimal client-side JavaScript. This ensures your documentation is fast and reliable for users everywhere. Opt-in “islands” of interactivity allow you to use frameworks like React, Vue, or Svelte where needed.
  • Great defaults: Stainless Docs provides a clean, responsive theme that is highly customizable out-of-the-box using CSS variables. You’ll get a great-looking site immediately without touching any Astro code.
  • Full control and extensibility: Want to go further? You’ll have direct access to the generated Git repository for your documentation site, so you can customize your theme, add new pages, modify layouts, and take advantage of Astro’s extensive third-party integration ecosystem.

We believe documentation should be treated with the same care as production code. Stainless Docs is built around a Git-based workflow that developers will find familiar and efficient.

  • Git as the source of truth: Publish changes by pushing commits to your documentation repository. By default, Stainless automatically builds and deploys your site on every push, but you can also choose your own deployment environment or run your own Astro builds as part of your continuous integration workflow and host the content yourself.
  • Local development: Clone the repository and run the site locally for a high-fidelity preview environment with hot-reloading. You can use your preferred code editor and toolchain.
  • Instant API doc previews: The local development server watches your OpenAPI specification and Stainless configuration. As you make changes, your API reference documentation regenerates on the fly, allowing you to see your edits in real-time.

Search and AI answers that understand SDKs

Section titled “Search and AI answers that understand SDKs”

Effective search is critical for API documentation. The search functionality in Stainless Docs is built from the ground up to understand the structure of your SDKs.

  • Metadata-driven indexing: Instead of scraping the HTML content of rendered pages, we build a search index directly from your SDK’s structural metadata. This provides more relevant and precise results.
  • Faceted search: Users can filter search results by programming language, and narrow down by resources, methods, types, or properties. Results are displayed in a rich format that highlights key SDK metadata, not just text snippets.
  • Conversational AI: An integrated AI-powered search allows users to ask questions in natural language. Using a Retrieval-Augmented Generation (RAG) pipeline, Stainless Docs automatically brings relevant SDK metadata into the LLM’s context to provide accurate, SDK-aware answers.
  • LLM-friendly Markdown: Stainless Docs generates an LLM-friendly Markdown representation for every single page on your documentation site. Add a .md extension to the end of any URL to get the corresponding Markdown content.