Fern Ask API

Query indexed documentation for AI-generated, grounded answers.

OpenAPI Specification

fern-api-ask-api-openapi.yml Raw ↑
openapi: 3.0.3
info:
  title: Fern Fern Ask API
  description: The Ask Fern API is Fern's hosted, public REST surface for the "Ask Fern" AI documentation-search feature. It lets you index a documentation website and then query it programmatically, so you can build your own support integrations on top of Fern's AI-powered, docs-grounded answers. This is the primary documented hosted REST API that Fern exposes to customers; the rest of the Fern platform (SDK generation, docs generation, API-reference builds) is driven through the open-source `fern` CLI and the Fern dashboard rather than a public REST API. Requests are authenticated with a Bearer token generated by the `fern token` CLI command; the Ask Fern API is available on the Team and Enterprise plans. The website index/status endpoints are grounded in Fern's published API reference; the /ask query endpoint shape is modeled from the documented feature and should be reconciled against the live reference. Not all fields are exhaustively documented here.
  version: '1.0'
  contact:
    name: Fern
    url: https://buildwithfern.com
  license:
    name: Apache-2.0
    url: https://github.com/fern-api/fern/blob/main/LICENSE
servers:
- url: https://fai.buildwithfern.com
  description: Ask Fern API (production)
security:
- bearerAuth: []
tags:
- name: Ask
  description: Query indexed documentation for AI-generated, grounded answers.
paths:
  /ask:
    get:
      operationId: askFern
      tags:
      - Ask
      summary: Ask a question against indexed documentation
      description: Submit a natural-language question and receive an AI-generated answer grounded in the indexed documentation. (Query-parameter shape modeled from the documented Ask Fern feature; reconcile against the live reference. Some deployments expose the ask endpoint under https://buildwithfern.com/learn/api/fern-docs/ask.)
      parameters:
      - name: q
        in: query
        required: true
        description: URI-encoded natural-language question.
        schema:
          type: string
      responses:
        '200':
          description: A grounded answer with source references.
          content:
            application/json:
              schema:
                type: object
                properties:
                  answer:
                    type: string
                  sources:
                    type: array
                    items:
                      type: string
        '401':
          $ref: '#/components/responses/Unauthorized'
components:
  responses:
    Unauthorized:
      description: Missing or invalid API token.
      content:
        application/json:
          schema:
            type: object
            properties:
              error:
                type: string
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: 'Bearer token generated with the `fern token` CLI command. Passed as `Authorization: Bearer YOUR_API_TOKEN`. Tokens are scoped to your organization and do not expire.'