curl --request POST \
--url https://api.cool.computer/api/operator/attachments \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: */*' \
--data '<string>'import requests
url = "https://api.cool.computer/api/operator/attachments"
payload = "<string>"
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "*/*"
}
response = requests.post(url, data=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': '*/*'},
body: '<string>'
};
fetch('https://api.cool.computer/api/operator/attachments', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.cool.computer/api/operator/attachments",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "<string>",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: */*"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.cool.computer/api/operator/attachments"
payload := strings.NewReader("<string>")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "*/*")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.cool.computer/api/operator/attachments")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "*/*")
.body("<string>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.cool.computer/api/operator/attachments")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = '*/*'
request.body = "<string>"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"filename": "<string>",
"media_type": "<string>",
"size_bytes": 1,
"width": 2,
"height": 2
}{
"type": "<string>",
"title": "<string>",
"status": 499,
"code": "<string>",
"detail": "<string>",
"resolution": "<string>",
"context": {}
}{
"type": "<string>",
"title": "<string>",
"status": 499,
"code": "<string>",
"detail": "<string>",
"resolution": "<string>",
"context": {}
}{
"type": "<string>",
"title": "<string>",
"status": 499,
"code": "<string>",
"detail": "<string>",
"resolution": "<string>",
"context": {}
}{
"type": "<string>",
"title": "<string>",
"status": 499,
"code": "<string>",
"detail": "<string>",
"resolution": "<string>",
"context": {}
}{
"type": "<string>",
"title": "<string>",
"status": 499,
"code": "<string>",
"detail": "<string>",
"resolution": "<string>",
"context": {}
}{
"type": "<string>",
"title": "<string>",
"status": 499,
"code": "<string>",
"detail": "<string>",
"resolution": "<string>",
"context": {}
}{
"type": "<string>",
"title": "<string>",
"status": 499,
"code": "<string>",
"detail": "<string>",
"resolution": "<string>",
"context": {}
}Upload an operator attachment
Uploads one file as the raw request body for a later message’s attachment_ids (at most 8 per message). The bytes decide the kind, never Content-Type: a PNG, JPEG, GIF or WebP image of up to 20 MiB, 25 megapixels and 16384 pixels on a side, stored as the model receives it (within 2000x2000 and 4.5 MiB of base64; larger images are oriented, scaled and re-encoded, and width and height report the stored size). An image carrying metadata (EXIF such as orientation or GPS, XMP, IPTC, comments or PNG text) is oriented and re-encoded so no metadata is stored, a GIF is stored as a PNG of its first frame, animated PNG and WebP are refused, and an image whose decoding would take too much memory (such as a large progressive or 16-bit image) is refused with 413; an MP4, MOV or WebM video of up to 32 MiB, which is copied to the message’s selected computer for the agent to inspect; or a UTF-8 text file of up to 1 MiB with its media type in Content-Type. A refusal says what to change; 413 means the file is too large. A member keeps at most 32 unsent uploads and 256 MiB, and an account stores at most 512 attachments and 1 GiB until their chats are deleted (429). An account uploads at most 2 files at once; another is refused with 429 attachment_upload_busy and Retry-After. Callers: the account owner with a user API key, user access token, claimed agent access token, or MCP token; organization API keys are refused.
curl --request POST \
--url https://api.cool.computer/api/operator/attachments \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: */*' \
--data '<string>'import requests
url = "https://api.cool.computer/api/operator/attachments"
payload = "<string>"
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "*/*"
}
response = requests.post(url, data=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': '*/*'},
body: '<string>'
};
fetch('https://api.cool.computer/api/operator/attachments', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.cool.computer/api/operator/attachments",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "<string>",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: */*"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.cool.computer/api/operator/attachments"
payload := strings.NewReader("<string>")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "*/*")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.cool.computer/api/operator/attachments")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "*/*")
.body("<string>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.cool.computer/api/operator/attachments")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = '*/*'
request.body = "<string>"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"filename": "<string>",
"media_type": "<string>",
"size_bytes": 1,
"width": 2,
"height": 2
}{
"type": "<string>",
"title": "<string>",
"status": 499,
"code": "<string>",
"detail": "<string>",
"resolution": "<string>",
"context": {}
}{
"type": "<string>",
"title": "<string>",
"status": 499,
"code": "<string>",
"detail": "<string>",
"resolution": "<string>",
"context": {}
}{
"type": "<string>",
"title": "<string>",
"status": 499,
"code": "<string>",
"detail": "<string>",
"resolution": "<string>",
"context": {}
}{
"type": "<string>",
"title": "<string>",
"status": 499,
"code": "<string>",
"detail": "<string>",
"resolution": "<string>",
"context": {}
}{
"type": "<string>",
"title": "<string>",
"status": 499,
"code": "<string>",
"detail": "<string>",
"resolution": "<string>",
"context": {}
}{
"type": "<string>",
"title": "<string>",
"status": 499,
"code": "<string>",
"detail": "<string>",
"resolution": "<string>",
"context": {}
}{
"type": "<string>",
"title": "<string>",
"status": 499,
"code": "<string>",
"detail": "<string>",
"resolution": "<string>",
"context": {}
}Authorizations
A Cool Computers API key, user access token, or claimed agent access token in the Authorization header. Follow https://www.cool.computer/auth.md for agent registration and https://www.cool.computer/authentication.md for direct user credentials.
Query Parameters
The file's name.
1Body
The body is of type file.
33554432Response
The stored attachment.
image/png, image/jpeg, image/gif, image/webp, video/mp4, video/quicktime, video/webm, or a text type.
x >= 0An image's stored width, the width the model sees.
x >= 1An image's stored height, the height the model sees.
x >= 1
