curl --request PUT \
--url https://hub.oxen.ai/api/repos/{namespace}/{repo_name}/versions/uploads/{upload_id}/parts/{part_number} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/octet-stream' \
--data '[
1
]'import requests
url = "https://hub.oxen.ai/api/repos/{namespace}/{repo_name}/versions/uploads/{upload_id}/parts/{part_number}"
payload = "[\n 1\n]"
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/octet-stream"
}
response = requests.put(url, data=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/octet-stream'},
body: '[\n 1\n]'
};
fetch('https://hub.oxen.ai/api/repos/{namespace}/{repo_name}/versions/uploads/{upload_id}/parts/{part_number}', 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://hub.oxen.ai/api/repos/{namespace}/{repo_name}/versions/uploads/{upload_id}/parts/{part_number}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => "[\n 1\n]",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/octet-stream"
],
]);
$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://hub.oxen.ai/api/repos/{namespace}/{repo_name}/versions/uploads/{upload_id}/parts/{part_number}"
payload := strings.NewReader("[\n 1\n]")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/octet-stream")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://hub.oxen.ai/api/repos/{namespace}/{repo_name}/versions/uploads/{upload_id}/parts/{part_number}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/octet-stream")
.body("[\n 1\n]")
.asString();require 'uri'
require 'net/http'
url = URI("https://hub.oxen.ai/api/repos/{namespace}/{repo_name}/versions/uploads/{upload_id}/parts/{part_number}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/octet-stream'
request.body = "[\n 1\n]"
response = http.request(request)
puts response.read_body{
"status": "<string>",
"status_message": "<string>",
"completed": true,
"oxen_version": "<string>"
}Upload one part of a version file
Upload one part of a file. A part may arrive up to part_window parts from the earliest part not yet hashed, counting that part, and one further ahead is refused with 429 and Retry-After, as is a part sent again while its first copy is still being stored. Until the upload completes, a part sent again after it was stored is accepted and ignored. Once it completes, any part gets 404, as for an upload that was aborted, so a client that lost the response for the last part begins the upload again, which answers with no parts to send once the file is stored. Each part but the last is exactly the upload’s part size. The response for the part that completes the file reports completed: true, once the file is verified against its hash and staged in the upload’s workspace, if it has one.
curl --request PUT \
--url https://hub.oxen.ai/api/repos/{namespace}/{repo_name}/versions/uploads/{upload_id}/parts/{part_number} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/octet-stream' \
--data '[
1
]'import requests
url = "https://hub.oxen.ai/api/repos/{namespace}/{repo_name}/versions/uploads/{upload_id}/parts/{part_number}"
payload = "[\n 1\n]"
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/octet-stream"
}
response = requests.put(url, data=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/octet-stream'},
body: '[\n 1\n]'
};
fetch('https://hub.oxen.ai/api/repos/{namespace}/{repo_name}/versions/uploads/{upload_id}/parts/{part_number}', 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://hub.oxen.ai/api/repos/{namespace}/{repo_name}/versions/uploads/{upload_id}/parts/{part_number}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => "[\n 1\n]",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/octet-stream"
],
]);
$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://hub.oxen.ai/api/repos/{namespace}/{repo_name}/versions/uploads/{upload_id}/parts/{part_number}"
payload := strings.NewReader("[\n 1\n]")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/octet-stream")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://hub.oxen.ai/api/repos/{namespace}/{repo_name}/versions/uploads/{upload_id}/parts/{part_number}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/octet-stream")
.body("[\n 1\n]")
.asString();require 'uri'
require 'net/http'
url = URI("https://hub.oxen.ai/api/repos/{namespace}/{repo_name}/versions/uploads/{upload_id}/parts/{part_number}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/octet-stream'
request.body = "[\n 1\n]"
response = http.request(request)
puts response.read_body{
"status": "<string>",
"status_message": "<string>",
"completed": true,
"oxen_version": "<string>"
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
The namespace of the repository
The name of the repository
The id the upload began with
The part's number, counting from 1
x >= 0Body
x >= 0