Checkpoints
Validate a checkpoint
Returns whether the caller can manage and use this checkpoint.
POST
/
v1
/
loops
/
checkpoints
/
validate
cURL
curl --request POST \
--url https://api.baseten.co/v1/loops/checkpoints/validate \
--header "Authorization: Bearer $BASETEN_API_KEY" \
--data '{
"checkpoint_path": "bt://loops:k4q95w5/sampler_weights/step-100"
}'import requests
import os
API_KEY = os.environ.get("BASETEN_API_KEY", "<YOUR_API_KEY>")
url = "https://api.baseten.co/v1/loops/checkpoints/validate"
headers = {"Authorization": f"Bearer {API_KEY}"}
response = requests.request(
"POST",
url,
headers=headers,
json={'checkpoint_path': 'bt://loops:k4q95w5/sampler_weights/step-100'}
)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({checkpoint_path: '<string>'})
};
fetch('https://api.baseten.co/v1/loops/checkpoints/validate', 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.baseten.co/v1/loops/checkpoints/validate",
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([
'checkpoint_path' => '<string>'
]),
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://api.baseten.co/v1/loops/checkpoints/validate"
payload := strings.NewReader("{\n \"checkpoint_path\": \"<string>\"\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://api.baseten.co/v1/loops/checkpoints/validate")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"checkpoint_path\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.baseten.co/v1/loops/checkpoints/validate")
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 \"checkpoint_path\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{}Authorizations
Send Authorization: Bearer <api_key>. The legacy Authorization: Api-Key <api_key> scheme is also accepted.
Body
application/json
Request body for POST /v1/loops/checkpoints/validate.
bt:// URI of a sampler checkpoint. Form: bt://loops:<run_id>/sampler_weights/<checkpoint_name>.
Example:
"bt://loops:k4q95w5/sampler_weights/step-100"
Response
200 - application/json
Response for POST /v1/loops/checkpoints/validate. Empty on success;
inaccessible or malformed paths raise 400.
Was this page helpful?
Previous
Get checkpoint filesGets presigned URLs for the files under a Loops checkpoint. Returns a paginated list.
Next
⌘I
cURL
curl --request POST \
--url https://api.baseten.co/v1/loops/checkpoints/validate \
--header "Authorization: Bearer $BASETEN_API_KEY" \
--data '{
"checkpoint_path": "bt://loops:k4q95w5/sampler_weights/step-100"
}'import requests
import os
API_KEY = os.environ.get("BASETEN_API_KEY", "<YOUR_API_KEY>")
url = "https://api.baseten.co/v1/loops/checkpoints/validate"
headers = {"Authorization": f"Bearer {API_KEY}"}
response = requests.request(
"POST",
url,
headers=headers,
json={'checkpoint_path': 'bt://loops:k4q95w5/sampler_weights/step-100'}
)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({checkpoint_path: '<string>'})
};
fetch('https://api.baseten.co/v1/loops/checkpoints/validate', 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.baseten.co/v1/loops/checkpoints/validate",
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([
'checkpoint_path' => '<string>'
]),
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://api.baseten.co/v1/loops/checkpoints/validate"
payload := strings.NewReader("{\n \"checkpoint_path\": \"<string>\"\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://api.baseten.co/v1/loops/checkpoints/validate")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"checkpoint_path\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.baseten.co/v1/loops/checkpoints/validate")
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 \"checkpoint_path\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{}