---
title: "List files"
method: GET
path: "/api/files/"
tags: ["OpenAI Batch"]
---

# List files

`GET /api/files/`

## Request

- Base URL: `https://api.respan.ai`
- URL: `https://api.respan.ai/api/files/`
- Auth: HTTP bearer

List files from the upstream OpenAI Files API using the authenticated organization key's OpenAI credentials.

## Query parameters

- `provider_id` string, required

## Response `200`

List of files.

- object
  - `object` string
  - `data` object[], required
    - `id` string, required: File ID.
    - `object` string, required
    - `bytes` integer: File size in bytes.
    - `created_at` integer: Unix timestamp.
    - `filename` string
    - `purpose` string
    - `status` string: File status.
    - `status_details` unknown

## Other responses

- `400`: `provider_id` is missing.
- `401`: You haven't added your own key for the provider in Settings › Providers, or the provider rejected it. Files and batches always run on your own key; Respan credits can't cover them.
- `403`: The API key is missing, invalid or expired.

## Changes

- **2026-10-21** `c30bcb383ee8`: 5 breaking, 8 info
  - the response property `data/items/status_details` became nullable for the status `200`
  - the response property `error/code` became nullable for the status `400`
  - the response property `error/code` became nullable for the status `401`
  - the response property `error/param` became nullable for the status `400`
  - …9 more
- **2026-10-02** `b830b79cfd52`: 1 breaking, 3 warning, 7 info
  - the `error` response's property type changed from `string` to `object` for status `401`
  - removed the optional property `detail` from the response with the `401` status
  - removed the optional property `error_class` from the response with the `401` status
  - removed the optional property `id` from the response with the `401` status
  - …7 more
- **2026-09-17** `6fa8242da8c2`: 1 warning, 1 info
  - deleted the `header` request parameter `Authorization`
  - the endpoint scheme security `RespanApiKey` was added to the API
- **2026-09-12** `22b868ef3f22`: 1 info
  - api operation id `list-files` removed and replaced with `openAiBatch_listFiles`

[Operation history](https://skmtc.dev/respan/apis/respan-api/changes/api/files/get.md)

---

[API](https://skmtc.dev/respan/apis/respan-api.md) - [All operations](https://skmtc.dev/respan/apis/respan-api/llms.txt) - [OpenAPI document](https://skmtc.dev/respan/apis/respan-api/revisions/900841387635?raw)
