For the complete documentation index, see llms.txt. This page is also available as Markdown.

Files

List Files

get

List the authenticated user's uploaded files in the request's workspace.

workspace_id narrows a master-key listing to one workspace; a keyed request is already confined to its key's own and cannot widen or move it.

Each flavor pages with its own cursor. OpenAI's after names the last file of the previous page, and has_more says whether to ask again. Anthropic's next_page is passed back as page, and ids[] reads up to 100 named files in one page. A cursor whose file has since been deleted or has expired is still a position. An after the caller never owned is a 404, and a page token this gateway did not issue is a 400.

Authorizations
Otari-KeystringRequired

Enter your API key here (sent as Otari-Key header).

Query parameters
userstring · nullableOptional
purposestring · nullableOptional
workspace_idstring · uuid · nullableOptional
limitinteger · min: 1 · max: 1000OptionalDefault: 100
afterstring · nullableOptional
orderstring · enumOptionalDefault: descPossible values:
pagestring · nullableOptional
ids[]string[] · nullableOptional
Responses
200

Successful Response

application/json
or
get/api/v1/files
GET /api/v1/files HTTP/1.1
Otari-Key: YOUR_API_KEY
Accept: */*
{
  "data": [
    {
      "bytes": 1,
      "created_at": 1,
      "expires_at": 1,
      "filename": "text",
      "id": "text",
      "object": "file",
      "purpose": "text"
    }
  ],
  "first_id": "text",
  "has_more": true,
  "last_id": "text",
  "object": "list"
}

Create File

post

Upload a file. Answers in the OpenAI or Anthropic file shape, following the caller's headers.

Authorizations
Otari-KeystringRequired

Enter your API key here (sent as Otari-Key header).

Body
filestringRequired
purposestringOptionalDefault: user_data
userstring · nullableOptional
Responses
200

Successful Response

application/json
or
post/api/v1/files
POST /api/v1/files HTTP/1.1
Otari-Key: YOUR_API_KEY
Content-Type: multipart/form-data
Accept: */*
Content-Length: 51

{
  "file": "text",
  "purpose": "user_data",
  "user": "text"
}
{
  "bytes": 1,
  "created_at": 1,
  "expires_at": 1,
  "filename": "text",
  "id": "text",
  "object": "file",
  "purpose": "text"
}

Get File

get

Retrieve metadata for a single file.

Authorizations
Otari-KeystringRequired

Enter your API key here (sent as Otari-Key header).

Path parameters
file_idstringRequired
Query parameters
userstring · nullableOptional
Responses
200

Successful Response

application/json
or
get/api/v1/files/{file_id}
GET /api/v1/files/{file_id} HTTP/1.1
Otari-Key: YOUR_API_KEY
Accept: */*
{
  "bytes": 1,
  "created_at": 1,
  "expires_at": 1,
  "filename": "text",
  "id": "text",
  "object": "file",
  "purpose": "text"
}

Delete File

delete

Soft-delete a file's metadata and remove its bytes from the backend.

Authorizations
Otari-KeystringRequired

Enter your API key here (sent as Otari-Key header).

Path parameters
file_idstringRequired
Query parameters
userstring · nullableOptional
Responses
200

Successful Response

application/json
or
delete/api/v1/files/{file_id}
DELETE /api/v1/files/{file_id} HTTP/1.1
Otari-Key: YOUR_API_KEY
Accept: */*
{
  "deleted": true,
  "id": "text",
  "object": "file"
}

Get File Content

get

Download the raw bytes of a file, streamed rather than buffered whole.

Authorizations
Otari-KeystringRequired

Enter your API key here (sent as Otari-Key header).

Path parameters
file_idstringRequired
Query parameters
userstring · nullableOptional
Responses
200

File content. Content-Type reflects the stored media type; application/octet-stream is the fallback.

Responsestring · binary
get/api/v1/files/{file_id}/content
GET /api/v1/files/{file_id}/content HTTP/1.1
Otari-Key: YOUR_API_KEY
Accept: */*
binary

Last updated

Was this helpful?