Skip to main content
POST
/
files
Create files
curl --request POST \
  --url https://api.anyapi.ai/v1/files \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: multipart/form-data' \
  --form purpose=fine-tune \
  --form file=@example-file
{
  "id": "<string>",
  "object": "file",
  "bytes": 123,
  "created_at": 123,
  "filename": "<string>",
  "purpose": "<string>",
  "status": "uploaded",
  "status_details": "<string>"
}

Authorizations

Authorization
string
header
required

Bearer token authentication. Get your API key from the dashboard.

Body

multipart/form-data
file
file
required

The File object (not file name) to be uploaded

purpose
enum<string>
required

The intended purpose of the uploaded file

Available options:
fine-tune,
assistants,
batch,
vision

Response

Successful response

id
string
required

The file identifier

object
enum<string>
required

The object type, which is always 'file'

Available options:
file
bytes
integer
required

The size of the file, in bytes

created_at
integer
required

The Unix timestamp (in seconds) for when the file was created

filename
string
required

The name of the file

purpose
string
required

The intended purpose of the file

status
enum<string>

The current status of the file

Available options:
uploaded,
processed,
error
status_details
string

Additional details about the status of the file

I