Skip to main content
POST
/
api
/
repos
/
{namespace}
/
{repo_name}
/
fine_tunes
/
{id}
/
checkpoints
/
{step}
/
deploy
Deploy a checkpoint from a fine-tune job
curl --request POST \
  --url https://hub.oxen.ai/api/repos/{namespace}/{repo_name}/fine_tunes/{id}/checkpoints/{step}/deploy \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "deployment_type": "normal"
}
'
import requests

url = "https://hub.oxen.ai/api/repos/{namespace}/{repo_name}/fine_tunes/{id}/checkpoints/{step}/deploy"

payload = { "deployment_type": "normal" }
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({deployment_type: 'normal'})
};

fetch('https://hub.oxen.ai/api/repos/{namespace}/{repo_name}/fine_tunes/{id}/checkpoints/{step}/deploy', 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}/fine_tunes/{id}/checkpoints/{step}/deploy",
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([
'deployment_type' => 'normal'
]),
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/{namespace}/{repo_name}/fine_tunes/{id}/checkpoints/{step}/deploy"

payload := strings.NewReader("{\n \"deployment_type\": \"normal\"\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/{namespace}/{repo_name}/fine_tunes/{id}/checkpoints/{step}/deploy")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"deployment_type\": \"normal\"\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://hub.oxen.ai/api/repos/{namespace}/{repo_name}/fine_tunes/{id}/checkpoints/{step}/deploy")

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 \"deployment_type\": \"normal\"\n}"

response = http.request(request)
puts response.read_body
{
  "deployment_id": "<string>",
  "fine_tune": {
    "base_model": "<string>",
    "created_by": {
      "id": "<string>",
      "image": "<string>",
      "name": "<string>",
      "username": "<string>"
    },
    "credits_used": "<string>",
    "deployed_model": {},
    "description": "<string>",
    "display_name": "<string>",
    "error": "<string>",
    "fine_tune_script": {
      "description": "<string>",
      "display_name": "<string>",
      "docker_image_name": "<string>",
      "fine_tune_schema": {
        "description": "<string>",
        "id": "<string>",
        "name": "<string>",
        "schema": {
          "additionalProperties": true,
          "basic": [
            "<string>"
          ],
          "properties": {},
          "required": [
            "<string>"
          ],
          "type": "<string>"
        }
      },
      "id": "<string>",
      "name": "<string>",
      "script_type": "<string>"
    },
    "finished_at": "<string>",
    "gpu_count": 123,
    "gpu_model": "<string>",
    "id": "<string>",
    "inserted_at": "<string>",
    "last_credit_check": "<string>",
    "name": "<string>",
    "output_resource": {},
    "queue_position": 123,
    "rate_per_second": "<string>",
    "repository_id": "<string>",
    "resource": {
      "path": "<string>",
      "version": "<string>"
    },
    "source_model": {},
    "started_at": "<string>",
    "status": "<string>",
    "total_token_count": 0,
    "training_params": {
      "answer_column": "<string>",
      "batch_size": 123,
      "enable_thinking": true,
      "epochs": 123,
      "grad_accum": 123,
      "learning_rate": 123,
      "logging_steps": 123,
      "lora_alpha": 123,
      "lora_rank": 123,
      "neftune_noise_alpha": 123,
      "question_column": "<string>",
      "save_steps_ratio": 123,
      "save_strategy": "<string>",
      "seq_length": 123,
      "use_lora": true
    },
    "updated_at": "<string>",
    "use_lora": true
  },
  "model": {},
  "status": "<string>",
  "status_message": "<string>"
}
{}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

id
string
required

Fine-tune ID

step
integer
required

Checkpoint step number

Query Parameters

retry
boolean

If true, cleanup the existing deployment and model for this checkpoint before creating a new one.

Body

application/json

Deployment configuration

Request payload to deploy a specific checkpoint from a fine-tune job.

deployment_type
enum<string>
default:normal

Deployment type: 'fast' for faster inference instances, 'normal' for standard instances.

Available options:
fast,
normal

Response

Deployment created response

Standard wrapper for checkpoint deployment responses.

deployment_id
string

ID of the created Baseten deployment.

fine_tune
FineTuneRun · object

Fine-tune job the deployed checkpoint belongs to.

model
object

Model record created for this checkpoint deployment.

status
string

High-level status string (for example, 'success').

status_message
string

Human-readable status message (for example, 'resource_found').