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

# Create Knowledge Source

> Upload a plain-text or Markdown file (UTF-8, up to 1 MB) as a knowledge
source.



## OpenAPI

````yaml post /v1/agent/knowledge-sources
openapi: 3.1.0
info:
  title: FishAudio OpenAPI
  version: '1'
servers:
  - description: Fish Audio API
    url: https://api.fish.audio
security: []
tags: []
paths:
  /v1/agent/knowledge-sources:
    post:
      tags:
        - Knowledge Sources
      summary: Create Knowledge Source
      description: |-
        Upload a plain-text or Markdown file (UTF-8, up to 1 MB) as a knowledge
        source. Send `multipart/form-data` with the file in `source`; `name`
        defaults to the file name. Attach it to agents via the agent config's
        `knowledge_base.knowledge_source_ids`.
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              properties:
                source:
                  format: binary
                  title: Source
                  type: string
                name:
                  anyOf:
                    - type: string
                    - type: 'null'
                  default: null
                  title: Name
                description:
                  default: ''
                  title: Description
                  type: string
              required:
                - source
              type: object
      responses:
        '201':
          description: Document created, URL follows
          headers: {}
          content:
            application/json:
              schema:
                properties:
                  knowledge_source_id:
                    title: Knowledge Source Id
                    type: string
                  workspace_id:
                    title: Workspace Id
                    type: string
                  name:
                    title: Name
                    type: string
                  description:
                    default: ''
                    title: Description
                    type: string
                  file_name:
                    title: File Name
                    type: string
                  size_bytes:
                    title: Size Bytes
                    type: integer
                  chunk_count:
                    title: Chunk Count
                    type: integer
                  revision_number:
                    description: >-
                      Increments every time the content is replaced. Drafts
                      always use the newest revision; published versions pin the
                      revision current at publish time.
                    title: Revision Number
                    type: integer
                  created_at:
                    format: date-time
                    title: Created At
                    type: string
                  updated_at:
                    format: date-time
                    title: Updated At
                    type: string
                  content:
                    description: The full current text content.
                    title: Content
                    type: string
                required:
                  - knowledge_source_id
                  - workspace_id
                  - name
                  - file_name
                  - size_bytes
                  - chunk_count
                  - revision_number
                  - created_at
                  - updated_at
                  - content
                type: object
        '400':
          description: Bad request syntax or unsupported method
          headers: {}
          content:
            application/json:
              schema:
                properties:
                  status:
                    title: Status
                    type: integer
                  message:
                    title: Message
                    type: string
                required:
                  - status
                  - message
                type: object
        '401':
          description: No permission -- see authorization schemes
          headers: {}
          content:
            application/json:
              schema:
                properties:
                  status:
                    title: Status
                    type: integer
                  message:
                    title: Message
                    type: string
                required:
                  - status
                  - message
                type: object
        '403':
          description: Request forbidden -- authorization will not help
          headers: {}
          content:
            application/json:
              schema:
                properties:
                  status:
                    title: Status
                    type: integer
                  message:
                    title: Message
                    type: string
                required:
                  - status
                  - message
                type: object
        '422':
          description: ''
          headers: {}
          content:
            application/json:
              schema:
                properties:
                  status:
                    title: Status
                    type: integer
                  message:
                    title: Message
                    type: string
                required:
                  - status
                  - message
                type: object
        '503':
          description: The server cannot process the request due to a high load
          headers: {}
          content:
            application/json:
              schema:
                properties:
                  status:
                    title: Status
                    type: integer
                  message:
                    title: Message
                    type: string
                required:
                  - status
                  - message
                type: object
      security:
        - BearerAuth: []
components:
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer

````