curl --request POST \
--url https://hub.oxen.ai/api/repos \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"description": "A repository for image classification",
"name": "Cat-Dog-Classifier",
"namespace": "ox",
"user": {
"email": "bessie@oxen.ai",
"name": "bessie"
}
}
'import requests
url = "https://hub.oxen.ai/api/repos"
payload = {
"description": "A repository for image classification",
"name": "Cat-Dog-Classifier",
"namespace": "ox",
"user": {
"email": "bessie@oxen.ai",
"name": "bessie"
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
description: 'A repository for image classification',
name: 'Cat-Dog-Classifier',
namespace: 'ox',
user: {email: 'bessie@oxen.ai', name: 'bessie'}
})
};
fetch('https://hub.oxen.ai/api/repos', 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",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'description' => 'A repository for image classification',
'name' => 'Cat-Dog-Classifier',
'namespace' => 'ox',
'user' => [
'email' => 'bessie@oxen.ai',
'name' => 'bessie'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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"
payload := strings.NewReader("{\n \"description\": \"A repository for image classification\",\n \"name\": \"Cat-Dog-Classifier\",\n \"namespace\": \"ox\",\n \"user\": {\n \"email\": \"bessie@oxen.ai\",\n \"name\": \"bessie\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://hub.oxen.ai/api/repos")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"description\": \"A repository for image classification\",\n \"name\": \"Cat-Dog-Classifier\",\n \"namespace\": \"ox\",\n \"user\": {\n \"email\": \"bessie@oxen.ai\",\n \"name\": \"bessie\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://hub.oxen.ai/api/repos")
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"] = 'application/json'
request.body = "{\n \"description\": \"A repository for image classification\",\n \"name\": \"Cat-Dog-Classifier\",\n \"namespace\": \"ox\",\n \"user\": {\n \"email\": \"bessie@oxen.ai\",\n \"name\": \"bessie\"\n }\n}"
response = http.request(request)
puts response.read_body{
"metadata_entries": [
{
"content_hash": "a1b2c3d4e5f678902e41",
"data_type": "image",
"file_size": 1024000,
"path": "data/images/cow.jpg"
}
],
"repository": {
"latest_commit": {
"author": "ox",
"email": "ox@example.com",
"id": "a1b2c3d4e5f678902e41",
"message": "Initial dataset import.",
"parent_ids": [
"f1e2d3c4b5a67890fedc"
],
"timestamp": "2025-01-01T10:00:00Z"
},
"name": "ImageNet-1k",
"namespace": "ox"
},
"status": "success",
"status_message": "resource_created"
}Create repository
Create a new repository, optionally with initial files via JSON or multipart form.
curl --request POST \
--url https://hub.oxen.ai/api/repos \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"description": "A repository for image classification",
"name": "Cat-Dog-Classifier",
"namespace": "ox",
"user": {
"email": "bessie@oxen.ai",
"name": "bessie"
}
}
'import requests
url = "https://hub.oxen.ai/api/repos"
payload = {
"description": "A repository for image classification",
"name": "Cat-Dog-Classifier",
"namespace": "ox",
"user": {
"email": "bessie@oxen.ai",
"name": "bessie"
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
description: 'A repository for image classification',
name: 'Cat-Dog-Classifier',
namespace: 'ox',
user: {email: 'bessie@oxen.ai', name: 'bessie'}
})
};
fetch('https://hub.oxen.ai/api/repos', 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",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'description' => 'A repository for image classification',
'name' => 'Cat-Dog-Classifier',
'namespace' => 'ox',
'user' => [
'email' => 'bessie@oxen.ai',
'name' => 'bessie'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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"
payload := strings.NewReader("{\n \"description\": \"A repository for image classification\",\n \"name\": \"Cat-Dog-Classifier\",\n \"namespace\": \"ox\",\n \"user\": {\n \"email\": \"bessie@oxen.ai\",\n \"name\": \"bessie\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://hub.oxen.ai/api/repos")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"description\": \"A repository for image classification\",\n \"name\": \"Cat-Dog-Classifier\",\n \"namespace\": \"ox\",\n \"user\": {\n \"email\": \"bessie@oxen.ai\",\n \"name\": \"bessie\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://hub.oxen.ai/api/repos")
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"] = 'application/json'
request.body = "{\n \"description\": \"A repository for image classification\",\n \"name\": \"Cat-Dog-Classifier\",\n \"namespace\": \"ox\",\n \"user\": {\n \"email\": \"bessie@oxen.ai\",\n \"name\": \"bessie\"\n }\n}"
response = http.request(request)
puts response.read_body{
"metadata_entries": [
{
"content_hash": "a1b2c3d4e5f678902e41",
"data_type": "image",
"file_size": 1024000,
"path": "data/images/cow.jpg"
}
],
"repository": {
"latest_commit": {
"author": "ox",
"email": "ox@example.com",
"id": "a1b2c3d4e5f678902e41",
"message": "Initial dataset import.",
"parent_ids": [
"f1e2d3c4b5a67890fedc"
],
"timestamp": "2025-01-01T10:00:00Z"
},
"name": "ImageNet-1k",
"namespace": "ox"
},
"status": "success",
"status_message": "resource_created"
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
Repository creation payload (JSON or Multipart)
Only used between client and server for creating a new remote repository.
The name of the repository. When cloned locally, this is the name of the directory. This name uniquely identifies it in the namespace.
The namespace that the repository lives in: dictates application-level repository ownership. A namespace can be e.g. a user, a team, or an entire organization. Namespaces must be unique.
Show child attributes
Show child attributes
Show child attributes
Show child attributes
{
"author": "ox",
"email": "ox@example.com",
"id": "a1b2c3d4e5f67890abcdef1234567890",
"message": "Refactor data loading pipeline.",
"parent_ids": ["f1e2d3c4b5a67890fedcba9876543210"],
"timestamp": "2025-01-01T10:00:00Z"
}
Which storage backend the server should use for this repo (e.g. "local", "s3").
local, s3 Response
Repository created
Show child attributes
Show child attributes
{
"latest_commit": {
"author": "ox",
"email": "ox@example.com",
"id": "a1b2c3d4e5f67890abcdef1234567890",
"message": "Initial dataset import.",
"parent_ids": ["f1e2d3c4b5a67890fedcba9876543210"],
"timestamp": "2025-01-01T10:00:00Z"
},
"name": "ImageNet-1k",
"namespace": "ox"
}
Show child attributes
Show child attributes