BetaServer tools are currently in beta. The API and behavior may change.
openrouter:files server tool lets a model read, write, edit, and list text files in your workspace via the OpenRouter Files API. When the model needs file access — reading an uploaded document, saving output, or applying a targeted edit — it calls the tool and OpenRouter executes the operation server-side.
Quick Start
Configuration
The files tool has no configuration options — which workspace and files it can access is determined by your API key and thex-openrouter-file-ids header, so enabling the tool takes only its type:
Operations
The model generates the call arguments. Each call performs one operation:Call Arguments
Edits are copy-on-writeEditing a file creates a new copy with a new
file_id; the original file is left unchanged.Response
The tool returns{ "result": ... } on success with the operation’s output (file listing, file content, or the new file’s metadata), or { "error": "..." } when the operation fails — for example, when a required field is missing or the target file isn’t found. The model reads the error and can retry with corrected arguments.
Pricing
There is currently no separate charge for the files tool; you pay only for standard token usage.Next Steps
- Server Tools Overview — Learn about server tools
- Apply Patch — Let models propose file edits as V4A diffs
- Tool Calling — Learn about user-defined tool calling