Upload files once and reference them by id in chat requests from Go.
The files endpoint stores a file once so you can reference it by id in any number of chat requests instead of re-encoding the bytes into every message. The upload takes the same multipart form as the OpenAI files endpoint, so an OpenAI-compatible Go client pointed at https://opendunes.com/v1 can send it through its files service — check your installed SDK version's own documentation for the exact call shape. The file object that comes back carries OpenDunes' own fields, listed in the Files guide; id is the one to keep. Uploads, storage and downloads are free.
The endpoint itself is a standard multipart POST — this is the full wire surface any Go HTTP client can target directly:
curl https://opendunes.com/v1/files \
-H "Authorization: Bearer $OPENDUNES_API_KEY" \
-F "file=@report.pdf"A successful upload returns 201 with the file object — keep the id and reference it in chat requests.
Send a file content part carrying the file_id inside the message content array — the server inlines the bytes for you:
{ "type": "file", "file": { "file_id": "<the uploaded id>" } }