files

Upload a file — universe-scoped; images are readable back, other uploads are write-once [write]

Changed on

multipart/form-data with a file part and an optional expires_in_seconds (3600–7776000). 32 MiB per file (413 file_too_large); upload larger files through POST /files/uploads. Reference the returned id from a message as {"type":"image","source":{"type":"file","file_id":"file_…"}} or a document block.

post/files

Request

  • Base URL
    https://api.agentsky.dev/v1
  • URL
    https://api.agentsky.dev/v1/files
  • Auth
    HTTP bearer

Request body multipart/form-data

filestring binary required
expires_in_secondsinteger

Response

OK

type'file' required
idstring required

file_…

created_atstring date-time required
filenamestring required
mime_typestring required
size_bytesinteger required
downloadableboolean required

true for image uploads (readable within the workspace) and for the per-session copies minted when a file rides a message; false for other uploads (write-once)

attach_by_defaultboolean required

Whether every new session in the workspace starts with a read-only copy under /workspace/shared/

expires_atstring date-time nullable required

Changes

    • info

      added the optional property to the response with the status

    • info

      added the optional property / to the response with the status