Upload File
Authentication
Enter your API key with the Bearer prefix, e.g. ‘Bearer sk_…’.
Headers
Request
The file to store (at most 25 MiB).
The person this file is for, in your own vocabulary - the same value a run, a conversation and a widget session take. Only a run acting for that person can read it. Omit for a workspace-wide file.
How long to keep it. ephemeral (the default) is working material
for a run and is deleted after 14 days. kept survives until you
delete it - use it for anything an agent produced that you intend to
keep or serve.
The project to create the file in, as a proj_... id; omit for the
caller’s default.
Response headers
Response
The file’s media type, normalised from the upload. An agent can read
application/pdf, text/plain, text/markdown, text/html and
image/* inside a run; any other type is stored and served but
reports itself unreadable to the agent.
The file’s lifetime, declared at upload. ephemeral is working
material for a run and is deleted 14 days after upload; kept
survives until you delete it and carries no expires_at at all.
Only a kept file can be published at a path.
The API path the bytes stream from (prepend the API host).
The project the file belongs to; absent for the Default project.
The person this file was uploaded for. Only a run acting for that same person can read it. Absent means workspace-wide: any run in the workspace can.
The name a serving layer addresses this file by, unique among the
workspace’s live files. Slash-separated segments of letters, digits
and . _ ~ -; no leading slash and no ... Absent on a file
nothing publishes.
When an ephemeral file is deleted automatically, 14 days after
upload; after it passes, every read answers 404 and the bytes are
collected. Absent on a kept file, which does not expire -
rather than a far-future date you would have to recognise as “never”.