Upload file
POST
/files
const url = 'https://api.mixen.ai/v1/files';const form = new FormData();form.append('file', 'example');form.append('policy', 'temp');
const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
options.body = form;
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api.mixen.ai/v1/files \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: multipart/form-data' \ --form file=example \ --form policy=tempUpload a file to your storage. policy=temp keeps it for 7 days (then it is deleted automatically), policy=permanent — indefinitely, counted against the 1 GB permanent quota. Max size 25 MB. Use stored files as file_data/image_url inputs (fetch /v1/files/{id}/content) or just to keep results.
Authorizations
Заголовок раздела «Authorizations»Request Bodyrequired
Заголовок раздела «Request Bodyrequired»Media typemultipart/form-data
Body_upload_file
object
file
required
File
string
policy
Policy
string
Responses
Заголовок раздела «Responses»Successful Response
Media typeapplication/json
Examplegenerated
exampleValidation Error
Media typeapplication/json
HTTPValidationError
object
detail
Detail
Array<object>
ValidationErrorobject
loc
required
Location
Array
msg
required
Message
string
type
required
Error Type
string
input
Input
ctx
Context
object
Examplegenerated
{ "detail": [ { "loc": [ "example" ], "msg": "example", "type": "example", "input": "example", "ctx": {} } ]}