LM-Kit OneDocs2026.8.10lm-kit.com
Infrastructure

Files Management

Uploads a file and returns its generated file ID.#

POST/lmkit/v1/files/upload

Accepts a multipart/form-data upload, saves the file to the configured upload directory using a GUID-based filename, writes a manifest containing the original filename, and returns the new fileId.

Request body

application/x-www-form-urlencoded · object

PropertyTypeDescription
ContentTypestring
ContentDispositionstring
Headersobject
Lengthobject (int64)
Namestring
FileNamestring

Responses

StatusTypeDescription
200

OK

400

Bad Request

curl -X POST "$LMKIT_ONE_URL/lmkit/v1/files/upload" \
  -H "Authorization: Bearer $LMKIT_API_KEY" \
  -H "Content-Type: application/x-www-form-urlencoded"

Lists every file extension the upload endpoints accept.#

GET/lmkit/v1/files/supported-extensions

Returns the complete set of file extensions accepted by POST /upload and POST /from-url, lowercase, dot-prefixed, sorted, and without duplicates. 'extensions' is the full union; 'document' carries the formats the document engine ingests (text, office documents, images, emails - content that can be parsed and indexed), 'audio' the containers accepted for transcription, and 'media' the video/mixed containers accepted for metadata/stream inspection. Clients should call this once at startup (cache the result) and validate file names before uploading, instead of hardcoding an extension list that drifts from server capabilities: a name whose extension is absent from 'extensions' is guaranteed to be refused by name. Membership is the guarantee of acceptance by name, not the only path in - an upload whose name carries NO recognizable extension is still accepted when magic-byte content detection recognizes the format.

Responses

StatusTypeDescription
200

OK

curl -X GET "$LMKIT_ONE_URL/lmkit/v1/files/supported-extensions" \
  -H "Authorization: Bearer $LMKIT_API_KEY"

Registers a file by downloading it from a URL and returns its generated file ID.#

POST/lmkit/v1/files/from-url

Downloads the content of the supplied http(s) URL server-side and stores it exactly like a direct upload (GUID-based filename + original-name manifest), returning the new fileId. Designed for content that already lives in object storage: pass a short-lived pre-signed URL (Amazon S3, Azure Blob SAS, Google Cloud Storage, MinIO, or any S3-compatible endpoint) and the transfer happens storage-to-server, so the caller never relays the bytes (no double transfer). The same size limit and format allowlist as /upload apply; the file name (explicit file_name, or derived from the URL path) drives the format check, and when the name carries no recognizable extension the downloaded CONTENT decides (magic-byte detection) before the request is rejected. The download follows no redirects, and URLs resolving to link-local addresses (cloud metadata services) are refused; private-network and loopback sources are allowed, so self-hosted object stores work. A source that cannot be fetched (unreachable, non-success status, expired signature) returns 502 Bad Gateway.

Request body

application/json ·

PropertyTypeDescription
urlrequiredstring

Absolute http(s) URL of the content to download. Must be reachable from the server and remain valid for the duration of the transfer (mind short pre-signed URL expirations).

file_namestring

Optional logical file name (e.g. 'report.pdf'). Its extension drives the same format validation as a direct upload, and it is recorded as the file's original name. When omitted, the name is derived from the last segment of the URL path - pass it explicitly when the URL path is opaque (a storage key without an extension).

Responses

StatusTypeDescription
200application/json

OK

400

Bad Request

415

Unsupported Media Type

502application/json

Bad Gateway

curl -X POST "$LMKIT_ONE_URL/lmkit/v1/files/from-url" \
  -H "Authorization: Bearer $LMKIT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "url": "",
  "file_name": ""
}'

Downloads a file by its ID.#

GET/lmkit/v1/files/{fileId}

Returns the file content as a binary download. The response includes the original filename in the Content-Disposition header. This endpoint can be used to retrieve any server-managed file, including files produced by the AI document splitting endpoint.

Parameters

NameInTypeDescription
fileIdrequiredpathstring

Responses

StatusTypeDescription
200

OK

404

Not Found

curl -X GET "$LMKIT_ONE_URL/lmkit/v1/files/$FILEID" \
  -H "Authorization: Bearer $LMKIT_API_KEY"

Deletes an uploaded file by its ID.#

DELETE/lmkit/v1/files/{fileId}

Removes the file (and its associated manifest) whose filename begins with the provided fileId from the upload directory. Returns 204 on success or 404 if not found.

Parameters

NameInTypeDescription
fileIdrequiredpathstring

Responses

StatusTypeDescription
204

No Content

404

Not Found

curl -X DELETE "$LMKIT_ONE_URL/lmkit/v1/files/$FILEID" \
  -H "Authorization: Bearer $LMKIT_API_KEY"

Checks whether a file exists by its ID.#

HEAD/lmkit/v1/files/{fileId}

Returns 200 OK if the file exists, or 404 Not Found if it does not. No file content is returned. Use this for lightweight existence checks.

Parameters

NameInTypeDescription
fileIdrequiredpathstring

Responses

StatusTypeDescription
200

OK

404

Not Found

curl -X HEAD "$LMKIT_ONE_URL/lmkit/v1/files/$FILEID" \
  -H "Authorization: Bearer $LMKIT_API_KEY"

Returns file metadata (size, filename) without downloading the content.#

GET/lmkit/v1/files/{fileId}/info

Returns the file size in bytes and the original filename for the given file ID. Use this for lightweight metadata queries without transferring file content.

Parameters

NameInTypeDescription
fileIdrequiredpathstring

Responses

StatusTypeDescription
200

OK

404

Not Found

curl -X GET "$LMKIT_ONE_URL/lmkit/v1/files/$FILEID/info" \
  -H "Authorization: Bearer $LMKIT_API_KEY"