Skip to main content

Files

Files belong to the environment: a caller uploads a document and passes its id in a run’s input, and every agent of the environment can download it by id. Agents can upload files too, and pass those ids on — in their output, in an ask, or in a child run’s input.
Pass file ids around, never the bytes. A file id in an input is a plain string to the input schema.

Download

Any file of the run’s environment, whether a caller or an agent uploaded it.

Upload

It answers:

With the SDKs

Callers upload and download files with an API key through the Files API. Files are kept; there is no deletion or retention policy yet.

Events

Add your own steps to a run’s timeline — what was extracted, which tool ran, how many items were found — so the run page tells the story of the run:
It answers 201 {"seq": 7} and the event appears on the run’s timeline as agent.extracted, and is streamed to anyone following the run.
  • type is a short lowercase name: a letter, then letters, digits, _, . or -, at most 40 characters.
  • data is a JSON object; the whole request is at most 64 KiB.
  • An event can only be added while the invocation is running, and only to the token’s own run.
  • A secret of the agent (8 or more characters) in data is stored as ***.
Model calls and tool calls appear on the timeline on their own (llm.call, tool.call); you don’t need to post them.