Get Profile
curl --request GET \
--url https://{host}/api/profile \
--header 'Authorization: Bearer <token>'import requests
url = "https://{host}/api/profile"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://{host}/api/profile', 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://{host}/api/profile",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://{host}/api/profile"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://{host}/api/profile")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://{host}/api/profile")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"user": {
"id": 123,
"username": "<string>",
"role": "<string>",
"auth_source": "<string>",
"disabled": true,
"display_name": "<string>",
"email": "<string>",
"avatar": "<string>",
"created_at": "<string>",
"has_password": false
},
"quota": {
"max_concurrent_gpus": 123,
"max_concurrent_jobs": 123,
"daily_gpu_hours": 0,
"max_storage_gb": 0,
"allowed_profiles": [],
"priority": 0,
"per_series": {},
"default": false
},
"usage": {
"username": "<string>",
"user_display_name": "<string>",
"active_gpus": 0,
"active_jobs": 0,
"gpu_hours_total": 0,
"gpu_hours_today": 0,
"running": [],
"active_gpus_by_series": {},
"gpu_hours_today_by_series": {},
"storage_bytes": 0,
"storage_measured_at": 0
}
}GET
/
api
/
profile
Get Profile
curl --request GET \
--url https://{host}/api/profile \
--header 'Authorization: Bearer <token>'import requests
url = "https://{host}/api/profile"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://{host}/api/profile', 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://{host}/api/profile",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://{host}/api/profile"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://{host}/api/profile")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://{host}/api/profile")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"user": {
"id": 123,
"username": "<string>",
"role": "<string>",
"auth_source": "<string>",
"disabled": true,
"display_name": "<string>",
"email": "<string>",
"avatar": "<string>",
"created_at": "<string>",
"has_password": false
},
"quota": {
"max_concurrent_gpus": 123,
"max_concurrent_jobs": 123,
"daily_gpu_hours": 0,
"max_storage_gb": 0,
"allowed_profiles": [],
"priority": 0,
"per_series": {},
"default": false
},
"usage": {
"username": "<string>",
"user_display_name": "<string>",
"active_gpus": 0,
"active_jobs": 0,
"gpu_hours_total": 0,
"gpu_hours_today": 0,
"running": [],
"active_gpus_by_series": {},
"gpu_hours_today_by_series": {},
"storage_bytes": 0,
"storage_measured_at": 0
}
}授权
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.