> For the complete documentation index, see [llms.txt](https://docs.nexos.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.nexos.ai/gateway-api/storage.md).

# Storage

Upload and manage media files.

## List uploaded media files

> List uploaded files.

```json
{"openapi":"3.0.0","info":{"title":"Nexos AI Public API Production","version":"1.0.0"},"tags":[{"name":"Storage","description":"Upload and manage media files."}],"servers":[{"url":"https://api.nexos.ai"}],"security":[{"bearerAuth":[]},{"apiKeyHeader":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer"},"apiKeyHeader":{"type":"apiKey","in":"header","name":"X-Api-Key","description":"Authenticate by sending your nexos API key in the `X-Api-Key` header (e.g. `X-Api-Key: nexos-...` for a user key or `X-Api-Key: nexos-team-...` for a team key). This is an alternative to the `Authorization: Bearer` scheme. If both `X-Nexos-Key` and `X-Api-Key` are sent, `X-Nexos-Key` takes precedence."}},"schemas":{"FilePurposeType":{"type":"string","description":"The intended purpose of the file. Only \"batch\" is supported — uploaded files may only be used as input for the Batch API.","enum":["batch"]},"list_files_ListFilesResponse":{"type":"object","description":"A list of uploaded files.","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/file_FileResponse"}},"object":{"type":"string","enum":["list"]}},"required":["data"]},"file_FileResponse":{"type":"object","description":"The File object represents a document that has been uploaded to OpenAI.","properties":{"bytes":{"type":"integer","description":"The size of the file, in bytes."},"created_at":{"type":"integer","description":"The Unix timestamp (in seconds) for when the file was created."},"filename":{"type":"string","description":"The name of the file."},"id":{"type":"string","description":"The file identifier, which can be referenced in the API endpoints."},"purpose":{"type":"string","description":"The intended purpose of the file.","enum":["assistants","assistants_output","batch","batch_output","fine-tune","fine-tune-results","vision"]},"status":{"type":"string","description":"The status of the file.","enum":["error","processed","uploaded"]},"object":{"type":"string","enum":["file"]}}}},"responses":{"OutOfCredits":{"description":"The company has run out of AI credits. Returned when the company's budget limit has been reached.\n","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["message"],"properties":{"message":{"type":"string"}}}}}}}}}},"paths":{"/v1/storage":{"get":{"operationId":"get-storage-files-v1","summary":"List uploaded media files","tags":["Storage"],"description":"List uploaded files.","parameters":[{"name":"after","in":"query","description":"A cursor for use in pagination. after is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include after=obj_foo in order to fetch the next page of the list.","required":false,"schema":{"type":"string"}},{"name":"limit","in":"query","description":"A limit on the number of objects to be returned. Limit can range between 1 and 10,000, and the default is 10,000.","required":false,"schema":{"type":"integer","format":"uint32","default":10000}},{"name":"order","in":"query","description":"Sort order by the created_at timestamp of the objects. asc for ascending order and desc for descending order.","required":false,"schema":{"type":"string","enum":["asc","desc"],"default":"desc"}},{"name":"purpose","in":"query","description":"Only return files with the given purpose.","required":false,"schema":{"$ref":"#/components/schemas/FilePurposeType"}}],"responses":{"200":{"description":"Successful response with list of files","content":{"application/json":{"schema":{"$ref":"#/components/schemas/list_files_ListFilesResponse"}}}},"402":{"$ref":"#/components/responses/OutOfCredits"},"500":{"description":"Server error."}}}}}}
```

## Upload media file

> Upload a media file for later use.

```json
{"openapi":"3.0.0","info":{"title":"Nexos AI Public API Production","version":"1.0.0"},"tags":[{"name":"Storage","description":"Upload and manage media files."}],"servers":[{"url":"https://api.nexos.ai"}],"security":[{"bearerAuth":[]},{"apiKeyHeader":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer"},"apiKeyHeader":{"type":"apiKey","in":"header","name":"X-Api-Key","description":"Authenticate by sending your nexos API key in the `X-Api-Key` header (e.g. `X-Api-Key: nexos-...` for a user key or `X-Api-Key: nexos-team-...` for a team key). This is an alternative to the `Authorization: Bearer` scheme. If both `X-Nexos-Key` and `X-Api-Key` are sent, `X-Nexos-Key` takes precedence."}},"schemas":{"upload_file_UploadFileRequest":{"type":"object","properties":{"file":{"type":"string","format":"binary","description":"The File object (not file name) to be uploaded."},"purpose":{"$ref":"#/components/schemas/FilePurposeType"}},"required":["file","purpose"]},"FilePurposeType":{"type":"string","description":"The intended purpose of the file. Only \"batch\" is supported — uploaded files may only be used as input for the Batch API.","enum":["batch"]},"file_FileResponse":{"type":"object","description":"The File object represents a document that has been uploaded to OpenAI.","properties":{"bytes":{"type":"integer","description":"The size of the file, in bytes."},"created_at":{"type":"integer","description":"The Unix timestamp (in seconds) for when the file was created."},"filename":{"type":"string","description":"The name of the file."},"id":{"type":"string","description":"The file identifier, which can be referenced in the API endpoints."},"purpose":{"type":"string","description":"The intended purpose of the file.","enum":["assistants","assistants_output","batch","batch_output","fine-tune","fine-tune-results","vision"]},"status":{"type":"string","description":"The status of the file.","enum":["error","processed","uploaded"]},"object":{"type":"string","enum":["file"]}}}},"responses":{"OutOfCredits":{"description":"The company has run out of AI credits. Returned when the company's budget limit has been reached.\n","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["message"],"properties":{"message":{"type":"string"}}}}}}}}}},"paths":{"/v1/storage":{"post":{"operationId":"post-storage-files-v1","summary":"Upload media file","tags":["Storage"],"description":"Upload a media file for later use.","requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/upload_file_UploadFileRequest"}}}},"responses":{"200":{"description":"Successful response with file upload details","content":{"application/json":{"schema":{"$ref":"#/components/schemas/file_FileResponse"}}}},"400":{"description":"Invalid request data."},"402":{"$ref":"#/components/responses/OutOfCredits"},"500":{"description":"Server error."}}}}}}
```

## Get storage file

> Retrieve file details by ID.

```json
{"openapi":"3.0.0","info":{"title":"Nexos AI Public API Production","version":"1.0.0"},"tags":[{"name":"Storage","description":"Upload and manage media files."}],"servers":[{"url":"https://api.nexos.ai"}],"security":[{"bearerAuth":[]},{"apiKeyHeader":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer"},"apiKeyHeader":{"type":"apiKey","in":"header","name":"X-Api-Key","description":"Authenticate by sending your nexos API key in the `X-Api-Key` header (e.g. `X-Api-Key: nexos-...` for a user key or `X-Api-Key: nexos-team-...` for a team key). This is an alternative to the `Authorization: Bearer` scheme. If both `X-Nexos-Key` and `X-Api-Key` are sent, `X-Nexos-Key` takes precedence."}},"schemas":{"file_FileResponse":{"type":"object","description":"The File object represents a document that has been uploaded to OpenAI.","properties":{"bytes":{"type":"integer","description":"The size of the file, in bytes."},"created_at":{"type":"integer","description":"The Unix timestamp (in seconds) for when the file was created."},"filename":{"type":"string","description":"The name of the file."},"id":{"type":"string","description":"The file identifier, which can be referenced in the API endpoints."},"purpose":{"type":"string","description":"The intended purpose of the file.","enum":["assistants","assistants_output","batch","batch_output","fine-tune","fine-tune-results","vision"]},"status":{"type":"string","description":"The status of the file.","enum":["error","processed","uploaded"]},"object":{"type":"string","enum":["file"]}}}},"responses":{"OutOfCredits":{"description":"The company has run out of AI credits. Returned when the company's budget limit has been reached.\n","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["message"],"properties":{"message":{"type":"string"}}}}}}}}}},"paths":{"/v1/storage/{file_id}":{"get":{"operationId":"get-storage-file-v1","summary":"Get storage file","tags":["Storage"],"description":"Retrieve file details by ID.","parameters":[{"name":"file_id","description":"The ID of the file to use for this request.","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful response with file details","content":{"application/json":{"schema":{"$ref":"#/components/schemas/file_FileResponse"}}}},"402":{"$ref":"#/components/responses/OutOfCredits"},"404":{"description":"File not found."},"500":{"description":"Server error."}}}}}}
```

## Delete storage file

> Delete a file by ID.

```json
{"openapi":"3.0.0","info":{"title":"Nexos AI Public API Production","version":"1.0.0"},"tags":[{"name":"Storage","description":"Upload and manage media files."}],"servers":[{"url":"https://api.nexos.ai"}],"security":[{"bearerAuth":[]},{"apiKeyHeader":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer"},"apiKeyHeader":{"type":"apiKey","in":"header","name":"X-Api-Key","description":"Authenticate by sending your nexos API key in the `X-Api-Key` header (e.g. `X-Api-Key: nexos-...` for a user key or `X-Api-Key: nexos-team-...` for a team key). This is an alternative to the `Authorization: Bearer` scheme. If both `X-Nexos-Key` and `X-Api-Key` are sent, `X-Nexos-Key` takes precedence."}},"schemas":{"deletion_status_DeletionStatusResponse":{"type":"object","description":"The status of a file deletion.","properties":{"id":{"type":"string","description":"The file identifier."},"deleted":{"type":"boolean","description":"Indicates whether the file has been deleted."}},"required":["id","deleted"]}},"responses":{"OutOfCredits":{"description":"The company has run out of AI credits. Returned when the company's budget limit has been reached.\n","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["message"],"properties":{"message":{"type":"string"}}}}}}}}}},"paths":{"/v1/storage/{file_id}":{"delete":{"operationId":"delete-storage-file-v1","summary":"Delete storage file","tags":["Storage"],"description":"Delete a file by ID.","parameters":[{"name":"file_id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful response with deletion status.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/deletion_status_DeletionStatusResponse"}}}},"402":{"$ref":"#/components/responses/OutOfCredits"},"404":{"description":"File not found."},"500":{"description":"Server error."}}}}}}
```

## Get storage file contents

> Download file contents by ID.

```json
{"openapi":"3.0.0","info":{"title":"Nexos AI Public API Production","version":"1.0.0"},"tags":[{"name":"Storage","description":"Upload and manage media files."}],"servers":[{"url":"https://api.nexos.ai"}],"security":[{"bearerAuth":[]},{"apiKeyHeader":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer"},"apiKeyHeader":{"type":"apiKey","in":"header","name":"X-Api-Key","description":"Authenticate by sending your nexos API key in the `X-Api-Key` header (e.g. `X-Api-Key: nexos-...` for a user key or `X-Api-Key: nexos-team-...` for a team key). This is an alternative to the `Authorization: Bearer` scheme. If both `X-Nexos-Key` and `X-Api-Key` are sent, `X-Nexos-Key` takes precedence."}},"responses":{"OutOfCredits":{"description":"The company has run out of AI credits. Returned when the company's budget limit has been reached.\n","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["message"],"properties":{"message":{"type":"string"}}}}}}}}}},"paths":{"/v1/storage/{file_id}/content":{"get":{"operationId":"get-storage-file-contents-v1","summary":"Get storage file contents","tags":["Storage"],"description":"Download file contents by ID.","parameters":[{"name":"file_id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful response with file contents","content":{"application/octet-stream":{"schema":{"type":"string","format":"binary"}}}},"402":{"$ref":"#/components/responses/OutOfCredits"},"404":{"description":"File not found."},"500":{"description":"Server error."}}}}}}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.nexos.ai/gateway-api/storage.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
