- Stage local files for
ask_stefanbrainand receive temporaryupload_...identifiers. - List and download the current workspace files produced inside a chat.
stefan_sk_... key or one scoped to include runs, or any stefan_oat_... OAuth token (OAuth tokens are not scoped). A key that stages files and then calls ask_stefanbrain needs both runs and tools.
Stage files for an ask
Sendmultipart/form-data to POST /api/developers/v1/files. Add each file as a repeated files field.
ask_stefanbrain message instead.
The endpoint returns 201:
file_ids:
An MCP client that cannot send multipart HTTP can call
stage_file with a public URL or base64-encoded file. Its upload_id works in the same file_ids field.List a chat’s current workspace files
UseGET /api/developers/v1/files?chat_id=... to retrieve the current workspace file heads from an accessible chat.
path. id is the SHA-256 of the current head, so id, sha256, and download_url change when the file is edited; list again for the current URL.
Do not send a cursor. The endpoint returns every current workspace file head in one response.
Download the current file
Request the returneddownload_url with the same credential:
private, no-store caching.
Listing and downloading are reads of existing work. They do not consume request limits or a billing budget.
Handle file errors
400 invalid_multipart_body,no_files,too_many_files,unsupported_attachment, orattachment_too_large: change the upload.400 chat_id_required,invalid_chat, orcursor_not_supported: correct the listing request.400 invalid_file_id,invalid_chat, orpath_required: request thedownload_urlexactly as the listing returned it.404 chat_not_found: the credential cannot access the requested chat.404 file_not_found: the file is unavailable or is not a current workspace file head.
ask_stefanbrain addressing.
