Upload one file into the session (BMA extension)
curl --request POST \
--url https://api.staging.bma.beeos.ai/v1/sessions/{session_id}/files \
--header 'Content-Type: multipart/form-data' \
--header 'x-api-key: <api-key>' \
--form file=@example-fileimport requests
url = "https://api.staging.bma.beeos.ai/v1/sessions/{session_id}/files"
files = { "file": ("example-file", open("example-file", "rb")) }
headers = {"x-api-key": "<api-key>"}
response = requests.post(url, files=files, headers=headers)
print(response.text)const form = new FormData();
form.append('file', '<string>');
const options = {method: 'POST', headers: {'x-api-key': '<api-key>'}};
options.body = form;
fetch('https://api.staging.bma.beeos.ai/v1/sessions/{session_id}/files', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.staging.bma.beeos.ai/v1/sessions/{session_id}/files"
payload := strings.NewReader("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001--")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"id": "<string>",
"type": "file",
"filename": "<string>",
"mime_type": "<string>",
"size_bytes": 123,
"created_at": "2023-11-07T05:31:56Z"
}{
"type": "error",
"error": {
"type": "<string>",
"message": "<string>",
"code": "<string>"
}
}API Reference
Upload one file into the session (BMA extension)
Stores one multipart file (at most 8 MiB, non-empty, bare filename) in
the session’s read_write memory store under the session’s own
directory. Create-only: an existing filename is a 409
file_already_exists. A session without a read_write memory store is a
409 session_files_unavailable.
POST
/
v1
/
sessions
/
{session_id}
/
files
Upload one file into the session (BMA extension)
curl --request POST \
--url https://api.staging.bma.beeos.ai/v1/sessions/{session_id}/files \
--header 'Content-Type: multipart/form-data' \
--header 'x-api-key: <api-key>' \
--form file=@example-fileimport requests
url = "https://api.staging.bma.beeos.ai/v1/sessions/{session_id}/files"
files = { "file": ("example-file", open("example-file", "rb")) }
headers = {"x-api-key": "<api-key>"}
response = requests.post(url, files=files, headers=headers)
print(response.text)const form = new FormData();
form.append('file', '<string>');
const options = {method: 'POST', headers: {'x-api-key': '<api-key>'}};
options.body = form;
fetch('https://api.staging.bma.beeos.ai/v1/sessions/{session_id}/files', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.staging.bma.beeos.ai/v1/sessions/{session_id}/files"
payload := strings.NewReader("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001--")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"id": "<string>",
"type": "file",
"filename": "<string>",
"mime_type": "<string>",
"size_bytes": 123,
"created_at": "2023-11-07T05:31:56Z"
}{
"type": "error",
"error": {
"type": "<string>",
"message": "<string>",
"code": "<string>"
}
}Authorizations
apiKeybearer
BMA organization API key.
Headers
Project to operate in. Required when the key can read more than one
project and the deployment has no default project.
anthropic-workspace-id is accepted as an alias.
Path Parameters
Minimum string length:
1Body
multipart/form-data