Upload file (not implemented)
POST
/v1/files
package main
import ( "fmt" "strings" "net/http" "io")
func main() {
url := "https://api.mirapi.ai/v1/files"
payload := strings.NewReader("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"\r\nContent-Type: application/octet-stream\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"purpose\"\r\nContent-Type: text/plain\r\n\r\n\r\n-----011000010111000001101001--\r\n")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>") req.Header.Add("Content-Type", "multipart/form-data; boundary=---011000010111000001101001")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close() body, _ := io.ReadAll(res.Body)
fmt.Println(res) fmt.Println(string(body))
}const url = 'https://api.mirapi.ai/v1/files';const form = new FormData();form.append('file', '');form.append('purpose', '');
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.mirapi.ai/v1/files \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: multipart/form-data' \ --form file=undefined \ --form purpose=This endpoint is not implemented yet.
Authorizations
Section titled “Authorizations”Request Body
Section titled “Request Body”Media typemultipart/form-data
object
file
string format: binary
purpose
string
Example
{ "file": "", "purpose": ""}Responses
Section titled “Responses”Not implemented
Media typeapplication/json
object
error
object
message
Error message
string
type
Error type
string
param
Related parameter
string
code
Error code
string
Examplegenerated
{ "error": { "message": "example", "type": "example", "param": "example", "code": "example" }}