---
title: "Get a file"
method: GET
path: "/api/files/{file_id}/"
tags: ["OpenAI Batch"]
---

# Get a file

`GET /api/files/{file_id}/`

## Request

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

Retrieve metadata for a file from the upstream OpenAI Files API.

## Path parameters

- `file_id` string, required

## Query parameters

- `provider_id` string, required

## Response `200`

File details.

- object
  - `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

- `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.
- `404`: Not Found

## Changes

- **2026-10-21** `c30bcb383ee8`: 3 breaking, 6 info
  - the response property `error/code` became nullable for the status `401`
  - the response property `error/param` became nullable for the status `401`
  - the response property `status_details` became nullable for the status `200`
  - api operation id `openAiBatch_retrieveFile` removed and replaced with `retrieveFile`
  - …5 more
- **2026-10-02** `b830b79cfd52`: 1 breaking, 3 warning, 6 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
  - …6 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 `retrieve-file` removed and replaced with `openAiBatch_retrieveFile`
- **2026-08-13** `4e064cf81dae`: 1 breaking, 10 info
  - added the new required `query` request parameter `provider_id`
  - added the non-success response with the status `401`
  - added the non-success response with the status `404`
  - added the optional property `bytes` to the response with the `200` status
  - …7 more

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

---

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