Skip to main content
GET
https://api.keywordsai.co
/
api
/
files
/
{file_id}
import requests

file_id = "file-abc123"
url = f"https://api.keywordsai.co/api/files/{file_id}/"
headers = {
    "Authorization": "Bearer YOUR_API_KEY"
}

response = requests.get(url, headers=headers)
print(response.json())
{
  "id": "file-abc123",
  "object": "file",
  "bytes": 1024,
  "created_at": 1677610602,
  "filename": "batch_input.jsonl",
  "purpose": "batch"
}
Get information about a specific file by its ID. Returns metadata including filename, size, creation time, and purpose.
Customer credentials required: This endpoint requires your own OpenAI API key configured in Keywords AI dashboard (Settings → Providers).

Path parameters

file_id
string
required
The unique identifier of the file to retrieve. Format: file-xxxxx
file-abc123

Response

Returns the file object with metadata.
{
  "id": "file-abc123",
  "object": "file",
  "bytes": 1024,
  "created_at": 1677610602,
  "filename": "batch_input.jsonl",
  "purpose": "batch"
}
import requests

file_id = "file-abc123"
url = f"https://api.keywordsai.co/api/files/{file_id}/"
headers = {
    "Authorization": "Bearer YOUR_API_KEY"
}

response = requests.get(url, headers=headers)
print(response.json())