Retrieve file
Get information about a specific file by its ID. Returns metadata including filename, size, creation time, and purpose.
<Note>
**Customer credentials required**: This endpoint requires your own OpenAI API key configured in Respan dashboard (Settings → Providers).
</Note>
## Path parameters
- `file_id` *string* **required**: The unique identifier of the file to retrieve. Format: `file-xxxxx`
**Example**
```
file-abc123
```
## Response
Returns the file object with metadata.
```json 200 OK
{
"id": "file-abc123",
"object": "file",
"bytes": 1024,
"created_at": 1677610602,
"filename": "batch_input.jsonl",
"purpose": "batch"
}
```
```json 404 Not Found
{
"error": {
"message": "No such file: file-abc123",
"type": "invalid_request_error"
}
}
```
```json 401 Unauthorized
{
"error": "Authentication credentials were not provided."
}
```
```python Python
file_id = "file-abc123"
url = f"https://api.respan.ai/api/files/{file_id}/"
headers = {
"Authorization": "Bearer YOUR_API_KEY"
}
response = requests.get(url, headers=headers)
print(response.json())
```
```typescript TypeScript
const fileId = 'file-abc123';
const url = `https://api.respan.ai/api/files/${fileId}/`;
const headers = {
'Authorization': 'Bearer YOUR_API_KEY'
};
const response = await fetch(url, {
method: 'GET',
headers: headers
});
const data = await response.json();
console.log(data);
```
```bash cURL
curl https://api.respan.ai/api/files/file-abc123/ \
-H "Authorization: Bearer YOUR_API_KEY"
```
Authentication
AuthorizationBearer
API key authentication. Get your API key from https://platform.respan.ai/platform/api-keys
Path parameters
file_id
The unique identifier of the file to retrieve. Format: file-xxxxx
Response
Successful response for Retrieve file
Errors
401
Unauthorized Error