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

# Create Library

> Create a library. Content may be plain text or base64 (auto-detected)

Create a team Python library file. `content` can be plain text or base64 (auto-detected). `name` must be unique per team and end with `.py`.


## OpenAPI

````yaml POST /library
openapi: 3.1.0
info:
  title: LoadForge API
  description: >-
    The LoadForge API provides programmatic access to create, manage, and run
    load tests on your web applications
  license:
    name: MIT
  version: 2.0.0
servers:
  - url: https://app.loadforge.com/api/v2
security:
  - bearerAuth: []
paths:
  /library:
    post:
      description: Create a library. Content may be plain text or base64 (auto-detected)
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - name
                - content
              properties:
                name:
                  type: string
                  description: Filename ending with .py. Must be unique per team.
                content:
                  type: string
                  description: >-
                    Plain text or base64-encoded file content. Base64 is
                    auto-detected.
            example:
              name: helpers.py
              content: |-
                def foo():
                    return 1
      responses:
        '200':
          description: Created
          content:
            application/json:
              schema:
                type: object
                properties:
                  library_id:
                    type: integer
              example:
                library_id: 456
        '400':
          description: Validation or duplicate name error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: Insufficient scope
components:
  schemas:
    Error:
      required:
        - error
        - message
      type: object
      properties:
        error:
          type: integer
          format: int32
        message:
          type: string
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````