Hadrian is experimental alpha software. Do not use in production.
Hadrian

Files

Upload and manage files for use with vector stores. Files are uploaded via multipart form data and can be added to vector stores for RAG.

List files

GET
/api/v1/files
AuthorizationBearer <token>

API key authentication using Bearer token format

In: header

Query Parameters

limit?integer|null

Maximum number of files to return (default: 20, max: 100)

Formatint64
Range1 <= value <= 100
order?null|SortOrder

Sort order by created_at timestamp (default: desc)

after?string|null

Cursor for forward pagination. Returns results after this file ID.

before?string|null

Hadrian Extension: Cursor for backward pagination. Returns results before this file ID.

purpose?string|null

Filter by purpose

owner_type*string

Hadrian Extension: Owner type for multi-tenancy (organization, project, or user)

owner_id*string

Hadrian Extension: Owner ID for multi-tenancy

Formatuuid

Response Body

application/json

application/json

curl -X GET "https://loading/api/v1/files?after=file-550e8400-e29b-41d4-a716-446655440000&before=file-550e8400-e29b-41d4-a716-446655440000&purpose=assistants&owner_type=string&owner_id=497f6eca-6276-4993-bfeb-53cbbbba6f08"
{
  "data": [
    {
      "bytes": 0,
      "content_type": "string",
      "created_at": "2019-08-24T14:15:22Z",
      "expires_at": "2019-08-24T14:15:22Z",
      "filename": "string",
      "id": "file-550e8400-e29b-41d4-a716-446655440000",
      "object": "string",
      "owner_id": "8826ee2e-7933-4665-aef2-2393f84a0d05",
      "owner_type": "organization",
      "purpose": "assistants",
      "status": "uploaded",
      "status_details": "string"
    }
  ],
  "first_id": "string",
  "has_more": true,
  "last_id": "string",
  "object": "string"
}
{
  "error": {
    "code": "budget_exceeded",
    "message": "Budget limit exceeded for monthly period",
    "param": null,
    "request_id": "550e8400-e29b-41d4-a716-446655440000",
    "type": "invalid_request_error"
  }
}

Upload a file

POST
/api/v1/files
AuthorizationBearer <token>

API key authentication using Bearer token format

In: header

Request Body

multipart/form-data

File upload with metadata

body?unknown

Response Body

application/json

application/json

application/json

application/json

curl -X POST "https://loading/api/v1/files"
{
  "bytes": 0,
  "content_type": "string",
  "created_at": "2019-08-24T14:15:22Z",
  "expires_at": "2019-08-24T14:15:22Z",
  "filename": "string",
  "id": "file-550e8400-e29b-41d4-a716-446655440000",
  "object": "string",
  "owner_id": "8826ee2e-7933-4665-aef2-2393f84a0d05",
  "owner_type": "organization",
  "purpose": "assistants",
  "status": "uploaded",
  "status_details": "string"
}
{
  "error": {
    "code": "budget_exceeded",
    "message": "Budget limit exceeded for monthly period",
    "param": null,
    "request_id": "550e8400-e29b-41d4-a716-446655440000",
    "type": "invalid_request_error"
  }
}
{
  "error": {
    "code": "budget_exceeded",
    "message": "Budget limit exceeded for monthly period",
    "param": null,
    "request_id": "550e8400-e29b-41d4-a716-446655440000",
    "type": "invalid_request_error"
  }
}
{
  "error": {
    "code": "budget_exceeded",
    "message": "Budget limit exceeded for monthly period",
    "param": null,
    "request_id": "550e8400-e29b-41d4-a716-446655440000",
    "type": "invalid_request_error"
  }
}

Get file metadata

GET
/api/v1/files/{file_id}
AuthorizationBearer <token>

API key authentication using Bearer token format

In: header

Path Parameters

file_id*string

File ID

Formatuuid

Response Body

application/json

application/json

curl -X GET "https://loading/api/v1/files/497f6eca-6276-4993-bfeb-53cbbbba6f08"
{
  "bytes": 0,
  "content_type": "string",
  "created_at": "2019-08-24T14:15:22Z",
  "expires_at": "2019-08-24T14:15:22Z",
  "filename": "string",
  "id": "file-550e8400-e29b-41d4-a716-446655440000",
  "object": "string",
  "owner_id": "8826ee2e-7933-4665-aef2-2393f84a0d05",
  "owner_type": "organization",
  "purpose": "assistants",
  "status": "uploaded",
  "status_details": "string"
}
{
  "error": {
    "code": "budget_exceeded",
    "message": "Budget limit exceeded for monthly period",
    "param": null,
    "request_id": "550e8400-e29b-41d4-a716-446655440000",
    "type": "invalid_request_error"
  }
}

Delete a file

DELETE
/api/v1/files/{file_id}
AuthorizationBearer <token>

API key authentication using Bearer token format

In: header

Path Parameters

file_id*string

File ID

Formatuuid

Response Body

application/json

application/json

application/json

curl -X DELETE "https://loading/api/v1/files/497f6eca-6276-4993-bfeb-53cbbbba6f08"
{
  "deleted": true,
  "id": "string",
  "object": "string"
}
{
  "error": {
    "code": "budget_exceeded",
    "message": "Budget limit exceeded for monthly period",
    "param": null,
    "request_id": "550e8400-e29b-41d4-a716-446655440000",
    "type": "invalid_request_error"
  }
}
{
  "error": {
    "code": "budget_exceeded",
    "message": "Budget limit exceeded for monthly period",
    "param": null,
    "request_id": "550e8400-e29b-41d4-a716-446655440000",
    "type": "invalid_request_error"
  }
}

Get file content

GET
/api/v1/files/{file_id}/content
AuthorizationBearer <token>

API key authentication using Bearer token format

In: header

Path Parameters

file_id*string

File ID

Formatuuid

Response Body

application/octet-stream

application/json

curl -X GET "https://loading/api/v1/files/497f6eca-6276-4993-bfeb-53cbbbba6f08/content"
Empty
{
  "error": {
    "code": "budget_exceeded",
    "message": "Budget limit exceeded for monthly period",
    "param": null,
    "request_id": "550e8400-e29b-41d4-a716-446655440000",
    "type": "invalid_request_error"
  }
}