Promote a container file into workspace documents
Changed onCopies a file from the container's sandbox prefix into the workspace's durable document storage, so it outlives the container. Returns the new document in the Files API shape, with a durable file id in the documents namespace. The copy counts against the workspace's storage quota. Unlike a direct upload, promoted files are downloadable.
Request
- Base URL: https://openrouter.ai/api/v1
- URL: https://openrouter.ai/api/v1/containers/{container_id}/files/{file_id}/promote
- Auth: HTTP bearer
Path parameters
The canonical container id, exactly as returned in a bash/shell tool result — a restarted session has its own -r<nonce>-suffixed id. A session-derived id is always sess_ + the sanitized session key, which is not necessarily the raw session id that was sent.
Container file id (cfile_ + base64url of the file path).
Response
The promoted file, as a workspace document.
Example response
{
"_shape": "openrouter",
"created_at": "2025-01-01T00:00:00Z",
"downloadable": false,
"filename": "document.pdf",
"id": "or_file_011CNha8iCJcU1wXNR6q4V8w",
"mime_type": "application/pdf",
"size_bytes": 1024000,
"type": "file"
}Changes
- info
added the non-success response with the status
- info
- info
endpoint added
- info