Skip to main content
POST
Add a Session resource

Headers

kimi-api-version
enum<string>

API version for this request, in YYYY-MM-DD form. Send 2026-09-01-beta for the version documented here. Required outside /v1/files*: a missing header there is rejected with 400 invalid_request_error; on /v1/files* its absence selects the compatibility behavior. An unknown value is rejected with 400 invalid_request_error on every endpoint. API versions served by the platform. New dated versions are added as they ship; a version is removed after its announced Sunset date.

Available options:
2026-09-01-beta
Idempotency-Key
string

Optional idempotency key. Reusing the same key with the same request target, API version, and body replays the first response for 24 hours. Reusing it with a different target, API version, or body, or while the first request is still being processed, returns 409.

Path Parameters

id
string
required

Session ID.

Body

application/json

File ID to attach to this Session.

Request body for adding a file resource to a Session. Vault and Memory Store bindings are fixed at creation.

type
enum<string>
required

Resource kind. Only files can be added after creation.

Available options:
file
Example:

"file"

file_id
string
required

Identifier of the uploaded file to mount.

Example:

"file_01h455vb4pex5vsknk084sn02q"

Response

The created resource binding, with its assigned id.

An uploaded file available to a Session.

type
enum<string>
required
Available options:
file
file_id
string
required

Identifier of the uploaded file.

id
string

Session resource ID assigned at binding.

mime_type
string

MIME type of the uploaded file.

title
string

Display title of the uploaded file.

path
string

Path where the file is linked inside the Session workspace, under upload/.