Upload file
upload_fileUploads files for batch processing, image editing, or the Anthropic Files API. Specify a purpose or enable Anthropic mode with the appropriate flag.
Instructions
Upload file Uploads a TokenLab/OpenAI-compatible batch or image file. With anthropic-beta: files-api-2025-04-14, uploads an Anthropic Files resource without a purpose field and returns Anthropic file metadata.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| file | Yes | Pass local file path. | |
| model | No | Optional TokenLab extension for image file uploads. Defaults to gpt-image-2 and binds the returned file_id to the selected image-edit configuration. | |
| purpose | No | Required in TokenLab/OpenAI-compatible mode: use batch for Batch API JSONL files, or user_data/vision for image edits. Omit in Anthropic Files mode. | |
| anthropic-beta | No | Include files-api-2025-04-14 to use Anthropic Files API mode. |