> ## Documentation Index
> Fetch the complete documentation index at: https://docs.usefeyn.com/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> Call https://api.feyn.ai only; the hosts behind it are not public.
> Authenticate with a workspace API key in the Authorization header: `Authorization: Bearer fn_...`. Keep keys server-side.
> For chat completions, use the official OpenAI SDK with base_url https://api.feyn.ai/v1 and a model ID from GET /v1/models.
> On 429, wait for the Retry-After header before retrying. Failed requests are not charged.

# Extract content with Pulpie

> Send page HTML or a base64 text PDF; get the main content back as HTML and Markdown. Also served at `/pulpie/v1/extract`.



## OpenAPI

````yaml /api-reference/openapi.json post /v1/extract
openapi: 3.1.0
info:
  title: Feyn API
  version: 1.0.0
  description: Fine-tuned models, chat completions, traces and scores on api.feyn.ai.
servers:
  - url: https://api.feyn.ai
security:
  - bearerAuth: []
paths:
  /v1/extract:
    post:
      summary: Extract content with Pulpie
      description: >-
        Send page HTML or a base64 text PDF; get the main content back as HTML
        and Markdown. Also served at `/pulpie/v1/extract`.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              oneOf:
                - title: HTML
                  type: object
                  required:
                    - html
                  properties:
                    model:
                      type: string
                      description: >-
                        `pulpie`. Optional while Pulpie is the only extraction
                        model.
                      example: pulpie
                    html:
                      type: string
                      description: The page HTML. Up to 7 MB.
                - title: PDF
                  type: object
                  required:
                    - pdf_base64
                  properties:
                    model:
                      type: string
                      description: >-
                        `pulpie`. Optional while Pulpie is the only extraction
                        model.
                      example: pulpie
                    pdf_base64:
                      type: string
                      description: >-
                        A text PDF, base64-encoded. The request body is capped
                        at 8 MB, so about 6 MB of PDF.
            example:
              model: pulpie
              html: >-
                <nav>Menu</nav><article><h1>Hello</h1><p>Only this
                stays.</p></article>
      responses:
        '200':
          description: The extracted content.
          content:
            application/json:
              schema:
                type: object
                properties:
                  html:
                    type: string
                    description: The extracted content as HTML.
                  markdown:
                    type: string
                    description: The same content as Markdown.
                  elapsed_ms:
                    type: number
                    description: Model time in milliseconds.
                  diagnostics:
                    type: object
                    description: >-
                      Input and output sizes, block counts and any recovery
                      warnings.
        '401':
          $ref: '#/components/responses/Error'
        '402':
          $ref: '#/components/responses/Error'
        '413':
          $ref: '#/components/responses/Error'
        '422':
          $ref: '#/components/responses/Error'
        '429':
          $ref: '#/components/responses/Error'
        '503':
          $ref: '#/components/responses/Error'
components:
  responses:
    Error:
      description: An error. See the errors guide for each status.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  schemas:
    Error:
      type: object
      properties:
        error:
          type: object
          properties:
            message:
              type: string
            type:
              type: string
              enum:
                - invalid_request_error
                - auth_error
                - billing_error
                - permission_error
                - rate_limit_error
                - api_error
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: A workspace API key (`fn_...`).

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.