OhMyGPT
Files

List files

GET
/v1/files

Your uploaded files that have not expired. Batch result files are not listed; read them by ID. Requires an admin API key or the console session. Other keys get 403 and can still read a file by its ID.

Authorization

ApiKeyAuth
headerAuthorization<token>

Query Parameters

purpose?string

Only batch returns files. Any other value returns an empty list.

order?string

Upload order.

Default"desc"
Value in"asc""desc"
limit?integer
Range1 <= value <= 10000
Default10000
after?string

The last_id of the previous page. Paging continues even if that file was deleted.

Response Body

Successful response

application/json
  1. response
data*array<>
first_id*string
has_more*boolean
last_id*string

Pass as after for the next page; null on an empty page.

object*"list"
Value in"list"
Example Request
curl -X GET 'https://api.ohmygpt.com/v1/files'
Example Response
{  "data": [    {      "bytes": 0,      "created_at": 0,      "expires_at": 0,      "filename": "string",      "id": "string",      "object": "file",      "purpose": "batch",      "status": "processed"    }  ],  "first_id": "string",  "has_more": true,  "last_id": "string",  "object": "list"}

Was this page helpful?

Still stuck? Live chat · [email protected] · Telegram group