Skip to content
FeedbackDashboard

Configuring the Stainless Docs Platform

apiReference: StainlessStarlightUserConfig

Configures the style and behavior of the API reference content in a Stainless Docs Platform site.

apiKey?: string

An API key for the Stainless API. If it is not provided, the Stainless Docs Platform looks for the STAINLESS_API_KEY environment variable. To generate an API key, navigate to the Settings tab of the organization view in Stainless Studio and click the Create new API key button.

stainlessProject: string

The name of the Stainless project to use for generating the API reference documentation.

versions?: Array<VersionUserConfig>

A list of versions to render in the API reference.

version: string
stainlessProject: string
branch: string
basePath?: string

The path where API reference content is mounted in your Stainless Docs Platform site. When this is not set, the default mount point is /api.

excludeLanguages?: Array<string>

A list of programming languages to exclude from the API reference. By default, all supported languages that have valid targets configured in your Stainless Config are rendered.

defaultLanguage?: string

The programming language that the API reference should treat as the default when the user has not yet selected a programming language. When no value is provided, the API reference defaults to showing HTTP documentation.

breadcrumbs?: BreadcrumbsUserConfig

Configures breadcrumbs that appear at the top of API reference pages.

includeCurrentPage?: boolean

Specifies whether the current page is included in the list of breadcrumbs that display at the top of API reference pages. When this is not set, the current page is excluded.

expandResources?: boolean

Controls the default state of top-level resources in the navigation sidebar. When this is set to true, the top-level resources are expanded by default. When no value is provided, top-level resources automatically expand if the total number of endpoints in the API is less than 20. You can explicitly set the value to false to prevent that behavior.

highlighting?: HighlightConfig

Options that control syntax highlighting for embedded code snippets in the API reference.

themes?: Array<string>

Set the syntax highlighting theme to use for code snippets in the API reference. This defaults to github-dark when no value is provided. It accepts any standard theme included in the Shiki syntax highlighter.

contentPanel?:

Configures the content panel for API reference pages.

layout?: "double-pane" | "single-pane"

Configures the layout for the content panel. The default value is double-pane.

Accepts one of the following:
"double-pane"
"single-pane"
propertySettings?: PropertySettingsType

Configures the design and behavior of properties in the API reference.

types?: "simple" | "rich"

Controls the presentation of types in API reference content. The options are simple and rich. The simple option shows more general, minimalistic type representations that are designed to be more consistent between programming languages whereas rich shows more sophisticated language-specific types. When no value is set, the default is rich.

Accepts one of the following:
"simple"
"rich"
includeModelProperties?: boolean

Controls whether properties that use a model as their type can expand to show the nested properties of the model. This setting is true by default when no value is provided.

collapseDescription?: boolean

Controls whether property descriptions are shown for properties that are not expanded. This setting is true when no value is provided. When set to false, property descriptions remain visible when a property is collapsed.

expandDepth?: number

When this value is set, properties in the API reference automatically expand to the specified level of depth. APIs with few top-level properties may benefit from adjusting this setting to show more content at once.

tabs?: Array<Tab>

Configures the navigation tabs that are displayed at the top of the documentation site. Tabbed navigation is optional, but can be useful for creating a natural partition between API reference content and guides.

label: string

Sets the label to display on the tab.

link: string

Specifies the route that loads when the user selects the tab. For example, /api.

sidebar?: Array<SidebarEntry>

Configures the navigation sidebar entries that display when the tab is selected. Refer to the Starlight documentation for details about the sidebar configuration.

hidden?: boolean

Controls whether the tab is visible in the navigation bar. When no value is provided, it defaults to true.

header?:

Configures the header that appears at the top of the site.

layout?: "default" | "stacked"

Configures the layout of the navigation tabs in the header. The default layout places the tabs alongside the page title. The stacked layout places the tabs in a second row beneath the title.

Accepts one of the following:
"default"
"stacked"
links?: Array<HeaderLink>

Use this setting to add links to the site header.

label: string

Sets the label displayed on the link.

link: string

Set the destination of the link.

variant?: "outline" | "ghost" | "accent" | 2 more

Set the visual style of the link.

Accepts one of the following:
"outline"
"ghost"
"accent"
"brand"
"default"
attrs?: Record<string, any>

Apply HTML attributes to the link.