Mixedbread

Files

API reference for managing files in Mixedbread. Covers uploading, retrieving, updating, listing, deleting, and downloading file content.

Upload File

POST/v1/files

Uploads a new file to your account. The file content is sent as multipart/form-data.

Response Body

  • id
    id
    Type
    string
    Required or Optional
    required
    Description
    Unique identifier for the uploaded file.
  • filename
    filename
    Type
    string
    Required or Optional
    required
    Description
    Name of the file, including its extension.
  • bytes
    bytes
    Type
    integer
    Required or Optional
    required
    Description
    Size of the file in bytes.
  • mime_type
    mime_type
    Type
    string
    Required or Optional
    required
    Description
    Detected MIME type of the file.
  • version
    version
    Type
    integer
    Required or Optional
    required
    Description
    Initial version of the file (typically 1).
  • created_at
    created_at
    Type
    string
    Required or Optional
    required
    Description
    Timestamp when the file was created.
  • updated_at
    updated_at
    Type
    string
    Required or Optional
    required
    Description
    Timestamp when the file was last updated (same as created_at initially).
  • object
    object
    Type
    string
    Required or Optional
    required
    Description
    Always "file".

Retrieve File

GET/v1/files/{file_id}

Retrieves the metadata for a specific file using its ID. This does not return the file content.

    Path Parameters

  • file_id
    file_id
    Type
    string
    Required or Optional
    required
    Description

    The unique identifier of the file to retrieve.

Response Body

  • id
    id
    Type
    string
    Required or Optional
    required
    Description
    Unique identifier for the file.
  • filename
    filename
    Type
    string
    Required or Optional
    required
    Description
    Name of the file.
  • bytes
    bytes
    Type
    integer
    Required or Optional
    required
    Description
    Size in bytes.
  • mime_type
    mime_type
    Type
    string
    Required or Optional
    required
    Description
    MIME type.
  • version
    version
    Type
    integer
    Required or Optional
    required
    Description
    Current version.
  • created_at
    created_at
    Type
    string
    Required or Optional
    required
    Description
    Timestamp when created.
  • updated_at
    updated_at
    Type
    string
    Required or Optional
    required
    Description
    Timestamp when last updated.
  • object
    object
    Type
    string
    Required or Optional
    required
    Description
    Always "file".

Update File

POST/v1/files/{file_id}

Updates the content of an existing file by uploading a new version. This replaces the previous content and increments the version number. Uses multipart/form-data.

Note: Using POST for updates is less conventional than PUT/PATCH, but reflects the current SDK implementation.

Response Body

  • id
    id
    Type
    string
    Required or Optional
    required
    Description
    Unique identifier for the file.
  • filename
    filename
    Type
    string
    Required or Optional
    required
    Description
    Name of the file (usually unchanged unless the new upload has a different name).
  • bytes
    bytes
    Type
    integer
    Required or Optional
    required
    Description
    Size of the new file content in bytes.
  • mime_type
    mime_type
    Type
    string
    Required or Optional
    required
    Description
    MIME type of the new file content.
  • version
    version
    Type
    integer
    Required or Optional
    required
    Description
    The incremented version number.
  • created_at
    created_at
    Type
    string
    Required or Optional
    required
    Description
    Original creation timestamp.
  • updated_at
    updated_at
    Type
    string
    Required or Optional
    required
    Description
    Timestamp when this update occurred.
  • object
    object
    Type
    string
    Required or Optional
    required
    Description
    Always "file".

List Files

GET/v1/files

Retrieves a list of files uploaded to your account, supporting pagination.

    Query Parameters

  • limit
    limit
    Type
    integer
    Required or Optional
    optional
    Description

    The maximum number of files to return in the list.

    • Default: 20, Max: 100
  • offset
    offset
    Type
    integer
    Required or Optional
    optional
    Description

    The number of files to skip before starting to collect the result set.

    • Default: 0

Response Body

  • object
    object
    Type
    string
    Required or Optional
    required
    Description
    Always "list".
  • data
    data
    Type
    FileObject[]
    Required or Optional
    required
    Description
    A list of file objects.
  • pagination
    pagination
    Type
    object
    Required or Optional
    required
    Description

    Pagination information.

  • total
    total
    Type
    integer
    Required or Optional
    optional
    Description
    Total number of files available.
  • offset
    offset
    Type
    integer
    Required or Optional
    optional
    Description
    The offset used for this page of results.

Delete File

DELETE/v1/files/{file_id}

Deletes a specific file and its content permanently. This action cannot be undone. If the file is associated with other resources (like Vector Stores), those associations might also be affected or cleaned up.

    Path Parameters

  • file_id
    file_id
    Type
    string
    Required or Optional
    required
    Description

    The unique identifier of the file to delete.

Response Body

  • id
    id
    Type
    string
    Required or Optional
    required
    Description
    The ID of the deleted file.
  • deleted
    deleted
    Type
    boolean
    Required or Optional
    required
    Description
    Indicates if the deletion was successful.
  • object
    object
    Type
    string
    Required or Optional
    required
    Description
    Always "file".

Download File Content

GET/v1/files/{file_id}/content

Downloads the raw content of a specific file. The response body will contain the binary data of the file.

    Path Parameters

  • file_id
    file_id
    Type
    string
    Required or Optional
    required
    Description

    The unique identifier of the file whose content is to be downloaded.

Response Body

  • Type
    binary
    Required or Optional
    required
    Description
    The raw binary content of the file. The Content-Type header will reflect the file's MIME type, and Content-Disposition may suggest the original filename.

Last updated on