Skip to content
For the complete documentation index, see llms.txt. This page is also available as Markdown.

files_finalize_upload

After the direct PUT succeeds, finalize the file_id and obtain a run-ready signed_url.

Effect: This call saves data or changes configuration. Review the behavior below before using it.

Inputs

Name
Type
Requirement
Description

file_id

string

Required

File ID returned by files_create_upload_url.

Example

These are MCP tool arguments, not an HTTP request body. Replace bracketed IDs with values returned from your account.

{
  "file_id": "<file-id>"
}

Result

Abbreviated result example; unshown fields are omitted for clarity.

{
  "file_id": "<file-id>",
  "signed_url": "<temporary-file-url>",
  "bytes": 15
}

Behavior

The server checks storage presence and hash.

An absent object raises file_not_in_storage; a second finalization can return file_already_uploaded.

Inline uploads are already finalized and do not need this call.

Troubleshooting

For file_not_in_storage, finish the direct upload before finalizing. file_already_uploaded means the file was already finalized; inspect the prior result rather than creating a duplicate.

File uploads

Upload a larger document

Connection, permissions, pagination, and recovery

Was this helpful?