In short.
This OpenRouter reference helps Go developers integrate file management, with downloads restricted to files created on the server. It documents listing, uploading, deleting, retrieving metadata and downloading through the Go SDK. Uploads accept specified document, image, audio and text formats up to 100 MB, while deletion is irreversible. The page provides implementation examples but leaves pricing, licensing, retention and model-specific file compatibility unknown.
Researched and written by an AI model and checked by a second AI model. How it works
Covers the complete selected Files reference at [https://openrouter.ai/docs/client-sdks/go/sdks/files/README.md], including all five operations, examples, parameters, responses and error tables. The documentation index and all linked type definitions, SDK pages and external references are excluded. No separate license or terms text is included in the selected page. No code or API calls were executed; runtime behavior, provider parity, performance and end-to-end model use are unassessed.
The overview
Identity
The resource is the Files reference for OpenRouter's Go SDK at [https://openrouter.ai/docs/client-sdks/go/sdks/files/README.md]. Its examples import github.com/OpenRouterTeam/go-sdk and call methods through the client's Files group.
Its scope is file storage and lifecycle operations. It does not demonstrate a model request that consumes an uploaded file.
Assessment
The page is useful as an implementation reference: each operation has a Go example, parameter table, return type and documented errors. The distinction between retrieving metadata and downloading content is especially important when designing file handling.
It provides only part of a complete integration. Installation, provider-key configuration and subsequent use of file references in model requests are not explained here. Runtime correctness, reliability and performance are not assessed.
Users
The reference suits Go developers adding uploads, file listings, metadata lookup or deletion to an API integration. Experienced developers can use its typed requests, response variants and error tables directly.
Beginners will need familiarity with Go imports, environment variables, contexts, file readers and error handling. Anyone needing to download previously uploaded originals should account for the endpoint's explicit restriction.
Capabilities
List returns files belonging to the workspace associated with the authenticating API key, and its example advances through results with res.Next(). Upload stores a file for reference in future API calls. Retrieve returns metadata, Delete removes an owned file irreversibly, and Download returns raw bytes only for files created server-side.
Supported uploads are PDF; PNG, JPEG, GIF and WebP images; DOCX, XLSX and PPTX documents; MP3, WAV, FLAC and OGG audio; and UTF-8 text. Text is classified by structure as JSON, newline-delimited JSON, CSV, Markdown or plain text. Acceptance as an upload does not establish compatibility with any particular model.
Using it
Requirements
The examples require a Go project using the OpenRouter SDK and an API key supplied through OPENROUTER_API_KEY. Every operation takes a context, and operations on an existing file require its identifier.
Named-provider storage uses your own API key for that provider, but the configuration procedure is absent. The page specifies neither a minimum Go version nor an SDK release. Uploads must contain supported data, must not be empty and must not exceed 100 MB.
Mechanism
The client authenticates with openrouter.WithSecurity. Upload, Delete, Retrieve and Download accept an optional workspace identifier that defaults to the caller's default workspace. Their optional provider parameter selects named-provider storage using your own provider key; omitting it uses OpenRouter storage.
Upload and Retrieve return a FileResponse whose type identifies an Anthropic, OpenAI or OpenRouter response variant, with raw JSON available for unknown variants. Delete uses a similar response pattern. These variants do not establish identical behavior across providers. Download returns an io.ReadCloser for consuming file content.
Setup
The documented starting point imports the SDK, creates context.Background(), reads OPENROUTER_API_KEY with os.Getenv and constructs a client with openrouter.New. Upload additionally opens a local file with os.Open and passes its reader and filename in UploadFileFile.
The page supplies no installation command or version pin. Its snippets also leave application work unfinished: the listing loop contains placeholders for processing items and handling pagination errors. A complete integration needs resource cleanup and error handling appropriate to the application.
Example
The upload example opens example.file, supplies FileName and Content, leaves the workspace argument nil and selects FileProviderOpenai. It then examines the response type to handle provider-specific fields or an unknown response.
The filename is illustrative: the service determines format from the actual contents, rather than the extension or declared content type. For a PDF input, the file must therefore contain valid supported PDF data within the documented size limit. The page does not show the later model call that references it, and successful execution is not established.
Assessment & evidence
Limitations
Uploaded files cannot be downloaded through Download: the documentation says those requests return HTTP 400. Only server-created files are downloadable, and the page does not explain which workflows create them. Deletion is irreversible.
The error tables include authentication and authorization failures, HTTP 429 rate limiting and server errors. Upload additionally lists HTTP 413 for oversized payloads. Quantitative rate limits, retry behavior, storage quotas, retention periods and provider-specific differences are not specified.
Reasoning
The documented operations suggest a useful fit for applications that upload inputs and later inspect or delete their stored file records. This is an inference from the API design; the page contains no complete model-processing journey.
The upload and download rules have a practical consequence: applications that need to recover original inputs would need to retain another copy. The Files interface alone does not establish that uploaded originals can be recovered.
Alternatives
The documented choice is between OpenRouter storage, selected by omitting provider, and named-provider storage using your own provider key. The page does not compare their pricing, retention or operational behavior.
Direct provider APIs, other language SDKs and alternative file stores are not evaluated here. Their relative suitability cannot be established from this source.
Evidence
The source is the complete Files documentation page at [https://openrouter.ai/docs/client-sdks/go/sdks/files/README.md]. It supports the operation descriptions, upload restrictions, workspace and provider parameters, response types and error listings discussed here.
The examples are illustrative source material. They provide no execution receipts, benchmarks or production reliability measurements. Actual behavior and compatibility with a specific SDK release remain unassessed.
Access & freshness
Costs
The page states no prices, free allowances, billing units or provider charges. Storage, transfer and subsequent model-call costs are unknown. Neither the examples nor the option to use your own provider key supports a cost estimate.
Rights
The page does not state the SDK license, permission to redistribute its examples or terms governing uploaded content. Those rights are unknown from this source.
It also provides no retention, provider data-use or backup-removal terms. Workspace ownership describes which files the operations can access; it does not establish contractual rights over uploaded content.
Freshness
The supplied page was captured on 15 November 2026 at 06:44:43 UTC. The page itself gives no publication date, update date, SDK version or support timeline. The capture date establishes when this copy was obtained, while the age of the examples and their compatibility with a particular installed release remain unknown.
Actions
Before implementing, confirm how the intended model request references uploaded files, which formats that model accepts, and how the selected provider key is configured. Establish the SDK version, storage charges and retention terms from the relevant documentation.
In the application, validate input size and format, complete pagination and error handling, and retain originals separately when recovery is required. Make irreversible deletion clear to users. Download handling must account for uploaded files returning HTTP 400.
