Files

List Files

Returns information about a specific file. that can be used across - Assistants API, Batch API This is the equivalent of GET https://api.openai.com/v1/files/

Supports Identical Params as: https://platform.openai.com/docs/api-reference/files/list

Example Curl

curl http://localhost:4000/v1/files        -H "Authorization: Bearer sk-1234"

GET/files
Authorization
Query parameters
Response

Successful Response

Body
any
Request
const response = await fetch('/files', {
    method: 'GET',
    headers: {},
});
const data = await response.json();
Response
{
  "detail": [
    {
      "loc": [
        "text"
      ],
      "msg": "text",
      "type": "text"
    }
  ]
}

Create File

Upload a file that can be used across - Assistants API, Batch API This is the equivalent of POST https://api.openai.com/v1/files

Supports Identical Params as: https://platform.openai.com/docs/api-reference/files/create

Example Curl

curl http://localhost:4000/v1/files         -H "Authorization: Bearer sk-1234"         -F purpose="batch"         -F file="@mydata.jsonl"

POST/files
Authorization
Query parameters
Body
purpose*Purpose
custom_llm_providerCustom Llm Provider
file*File
Response

Successful Response

Body
any
Request
const response = await fetch('/files', {
    method: 'POST',
    headers: {
      "Content-Type": "multipart/form-data"
    },
    body: JSON.stringify({
      "purpose": "text",
      "file": "binary"
    }),
});
const data = await response.json();
Response
{
  "detail": [
    {
      "loc": [
        "text"
      ],
      "msg": "text",
      "type": "text"
    }
  ]
}

List Files

Returns information about a specific file. that can be used across - Assistants API, Batch API This is the equivalent of GET https://api.openai.com/v1/files/

Supports Identical Params as: https://platform.openai.com/docs/api-reference/files/list

Example Curl

curl http://localhost:4000/v1/files        -H "Authorization: Bearer sk-1234"

GET/v1/files
Authorization
Query parameters
Response

Successful Response

Body
any
Request
const response = await fetch('/v1/files', {
    method: 'GET',
    headers: {},
});
const data = await response.json();
Response
{
  "detail": [
    {
      "loc": [
        "text"
      ],
      "msg": "text",
      "type": "text"
    }
  ]
}

Create File

Upload a file that can be used across - Assistants API, Batch API This is the equivalent of POST https://api.openai.com/v1/files

Supports Identical Params as: https://platform.openai.com/docs/api-reference/files/create

Example Curl

curl http://localhost:4000/v1/files         -H "Authorization: Bearer sk-1234"         -F purpose="batch"         -F file="@mydata.jsonl"

POST/v1/files
Authorization
Query parameters
Body
purpose*Purpose
custom_llm_providerCustom Llm Provider
file*File
Response

Successful Response

Body
any
Request
const response = await fetch('/v1/files', {
    method: 'POST',
    headers: {
      "Content-Type": "multipart/form-data"
    },
    body: JSON.stringify({
      "purpose": "text",
      "file": "binary"
    }),
});
const data = await response.json();
Response
{
  "detail": [
    {
      "loc": [
        "text"
      ],
      "msg": "text",
      "type": "text"
    }
  ]
}

Get File

Returns information about a specific file. that can be used across - Assistants API, Batch API This is the equivalent of GET https://api.openai.com/v1/files/{file_id}

Supports Identical Params as: https://platform.openai.com/docs/api-reference/files/retrieve

Example Curl

curl http://localhost:4000/v1/files/file-abc123         -H "Authorization: Bearer sk-1234"

GET/files/{file_id}
Authorization
Path parameters
file_id*File Id
Query parameters
Response

Successful Response

Body
any
Request
const response = await fetch('/files/{file_id}', {
    method: 'GET',
    headers: {},
});
const data = await response.json();
Response
{
  "detail": [
    {
      "loc": [
        "text"
      ],
      "msg": "text",
      "type": "text"
    }
  ]
}

Delete File

Deletes a specified file. that can be used across - Assistants API, Batch API This is the equivalent of DELETE https://api.openai.com/v1/files/{file_id}

Supports Identical Params as: https://platform.openai.com/docs/api-reference/files/delete

Example Curl

curl http://localhost:4000/v1/files/file-abc123     -X DELETE     -H "Authorization: Bearer $OPENAI_API_KEY"

DELETE/files/{file_id}
Authorization
Path parameters
file_id*File Id
Query parameters
Response

Successful Response

Body
any
Request
const response = await fetch('/files/{file_id}', {
    method: 'DELETE',
    headers: {},
});
const data = await response.json();
Response
{
  "detail": [
    {
      "loc": [
        "text"
      ],
      "msg": "text",
      "type": "text"
    }
  ]
}

Get File

Returns information about a specific file. that can be used across - Assistants API, Batch API This is the equivalent of GET https://api.openai.com/v1/files/{file_id}

Supports Identical Params as: https://platform.openai.com/docs/api-reference/files/retrieve

Example Curl

curl http://localhost:4000/v1/files/file-abc123         -H "Authorization: Bearer sk-1234"

GET/v1/files/{file_id}
Authorization
Path parameters
file_id*File Id
Query parameters
Response

Successful Response

Body
any
Request
const response = await fetch('/v1/files/{file_id}', {
    method: 'GET',
    headers: {},
});
const data = await response.json();
Response
{
  "detail": [
    {
      "loc": [
        "text"
      ],
      "msg": "text",
      "type": "text"
    }
  ]
}

Delete File

Deletes a specified file. that can be used across - Assistants API, Batch API This is the equivalent of DELETE https://api.openai.com/v1/files/{file_id}

Supports Identical Params as: https://platform.openai.com/docs/api-reference/files/delete

Example Curl

curl http://localhost:4000/v1/files/file-abc123     -X DELETE     -H "Authorization: Bearer $OPENAI_API_KEY"

DELETE/v1/files/{file_id}
Authorization
Path parameters
file_id*File Id
Query parameters
Response

Successful Response

Body
any
Request
const response = await fetch('/v1/files/{file_id}', {
    method: 'DELETE',
    headers: {},
});
const data = await response.json();
Response
{
  "detail": [
    {
      "loc": [
        "text"
      ],
      "msg": "text",
      "type": "text"
    }
  ]
}