Create a file
curl --request POST \
--url https://api.agipower.ai/v1/files \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: multipart/form-data' \
--form file='@example-file' \
--form purpose=assistantsimport requests
url = "https://api.agipower.ai/v1/files"
files = { "file": ("example-file", open("example-file", "rb")) }
payload = { "purpose": "assistants" }
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, data=payload, files=files, headers=headers)
print(response.text)const form = new FormData();
form.append('file', '<string>');
form.append('purpose', 'assistants');
const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
options.body = form;
fetch('https://api.agipower.ai/v1/files', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{}Files API
Create a file
POST
/
v1
/
files
Create a file
curl --request POST \
--url https://api.agipower.ai/v1/files \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: multipart/form-data' \
--form file='@example-file' \
--form purpose=assistantsimport requests
url = "https://api.agipower.ai/v1/files"
files = { "file": ("example-file", open("example-file", "rb")) }
payload = { "purpose": "assistants" }
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, data=payload, files=files, headers=headers)
print(response.text)const form = new FormData();
form.append('file', '<string>');
form.append('purpose', 'assistants');
const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
options.body = form;
fetch('https://api.agipower.ai/v1/files', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{}