curl --request POST \
--url https://api.together.ai/v1/shaping/prepare-for-fp4-inference \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"inputs": {
"adapter_object_id": "ml_CeG3fF6pyEViU8dE8pk7R",
"adapter_revision_id": "rv_CeG3faPBj2ABwbAaHPTmx",
"calibration_file_id": "file-5f1b0c7a-2d19-4a3e-9c60-8ab41c2f7d35"
}
}
'import requests
url = "https://api.together.ai/v1/shaping/prepare-for-fp4-inference"
payload = { "inputs": {
"adapter_object_id": "ml_CeG3fF6pyEViU8dE8pk7R",
"adapter_revision_id": "rv_CeG3faPBj2ABwbAaHPTmx",
"calibration_file_id": "file-5f1b0c7a-2d19-4a3e-9c60-8ab41c2f7d35"
} }
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({
inputs: {
adapter_object_id: 'ml_CeG3fF6pyEViU8dE8pk7R',
adapter_revision_id: 'rv_CeG3faPBj2ABwbAaHPTmx',
calibration_file_id: 'file-5f1b0c7a-2d19-4a3e-9c60-8ab41c2f7d35'
}
})
};
fetch('https://api.together.ai/v1/shaping/prepare-for-fp4-inference', 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.together.ai/v1/shaping/prepare-for-fp4-inference",
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([
'inputs' => [
'adapter_object_id' => 'ml_CeG3fF6pyEViU8dE8pk7R',
'adapter_revision_id' => 'rv_CeG3faPBj2ABwbAaHPTmx',
'calibration_file_id' => 'file-5f1b0c7a-2d19-4a3e-9c60-8ab41c2f7d35'
]
]),
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.together.ai/v1/shaping/prepare-for-fp4-inference"
payload := strings.NewReader("{\n \"inputs\": {\n \"adapter_object_id\": \"ml_CeG3fF6pyEViU8dE8pk7R\",\n \"adapter_revision_id\": \"rv_CeG3faPBj2ABwbAaHPTmx\",\n \"calibration_file_id\": \"file-5f1b0c7a-2d19-4a3e-9c60-8ab41c2f7d35\"\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://api.together.ai/v1/shaping/prepare-for-fp4-inference")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"inputs\": {\n \"adapter_object_id\": \"ml_CeG3fF6pyEViU8dE8pk7R\",\n \"adapter_revision_id\": \"rv_CeG3faPBj2ABwbAaHPTmx\",\n \"calibration_file_id\": \"file-5f1b0c7a-2d19-4a3e-9c60-8ab41c2f7d35\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.together.ai/v1/shaping/prepare-for-fp4-inference")
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 \"inputs\": {\n \"adapter_object_id\": \"ml_CeG3fF6pyEViU8dE8pk7R\",\n \"adapter_revision_id\": \"rv_CeG3faPBj2ABwbAaHPTmx\",\n \"calibration_file_id\": \"file-5f1b0c7a-2d19-4a3e-9c60-8ab41c2f7d35\"\n }\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"job_type": "quantization",
"status": "pending",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"user_id": "<string>",
"params": {
"inputs": {
"adapter_object_id": "ml_CeG3fF6pyEViU8dE8pk7R",
"adapter_revision_id": "rv_CeG3faPBj2ABwbAaHPTmx",
"calibration_file_id": "file-5f1b0c7a-2d19-4a3e-9c60-8ab41c2f7d35"
},
"configuration": {
"user_id": "user_CKfewYkQBpaEmN7wuQS3W",
"adapter_project_id": "proj_CczF9KYFantA84sNYDTJd",
"adapter_revision_id": "rv_CeERyXMBQCJTRC1yqGTpk",
"adapter_model_name": "ft-qa-artifacts/glm-5.3-e2e-test-adapter",
"base_object_id": "ml_CbJ9yCnij7A47b1xkpioB",
"base_revision_id": "rv_CbJ9yNrws93VQrZum1fTE",
"base_model_name": "zai-org/GLM-5.3-NVFP4"
}
},
"events": [
{
"object": "shaping",
"created_at": "2023-11-07T05:31:56Z",
"level": "Info",
"message": "<string>",
"type": "SHAPING_ERROR",
"hash": "<string>",
"result": {
"model_object_id": "<string>",
"model_revision_id": "<string>"
}
}
],
"results": {
"model_object_id": "<string>",
"model_revision_id": "<string>"
}
}{
"error": {
"message": "<string>",
"type": "<string>",
"param": null,
"code": null
}
}{
"error": {
"message": "<string>",
"type": "<string>",
"param": null,
"code": null
}
}{
"error": {
"message": "<string>",
"type": "<string>",
"param": null,
"code": null
}
}{
"error": {
"message": "<string>",
"type": "<string>",
"param": null,
"code": null
}
}{
"error": {
"message": "<string>",
"type": "<string>",
"param": null,
"code": null
}
}{
"error": {
"message": "<string>",
"type": "<string>",
"param": null,
"code": null
}
}Prepare a fine-tuned model for FP4 inference
Merges a fine-tuned adapter into its base model and prepares the result for FP4 inference. The adapter is resolved when the request is made, so a request naming a model that does not exist in the project, is not an adapter, was not produced by fine-tuning, has no base model to merge into, or uses an unsupported base model is rejected with 400 rather than accepted and failed later. The run is priced before it is created, and a project that cannot cover it is answered 402.
curl --request POST \
--url https://api.together.ai/v1/shaping/prepare-for-fp4-inference \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"inputs": {
"adapter_object_id": "ml_CeG3fF6pyEViU8dE8pk7R",
"adapter_revision_id": "rv_CeG3faPBj2ABwbAaHPTmx",
"calibration_file_id": "file-5f1b0c7a-2d19-4a3e-9c60-8ab41c2f7d35"
}
}
'import requests
url = "https://api.together.ai/v1/shaping/prepare-for-fp4-inference"
payload = { "inputs": {
"adapter_object_id": "ml_CeG3fF6pyEViU8dE8pk7R",
"adapter_revision_id": "rv_CeG3faPBj2ABwbAaHPTmx",
"calibration_file_id": "file-5f1b0c7a-2d19-4a3e-9c60-8ab41c2f7d35"
} }
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({
inputs: {
adapter_object_id: 'ml_CeG3fF6pyEViU8dE8pk7R',
adapter_revision_id: 'rv_CeG3faPBj2ABwbAaHPTmx',
calibration_file_id: 'file-5f1b0c7a-2d19-4a3e-9c60-8ab41c2f7d35'
}
})
};
fetch('https://api.together.ai/v1/shaping/prepare-for-fp4-inference', 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.together.ai/v1/shaping/prepare-for-fp4-inference",
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([
'inputs' => [
'adapter_object_id' => 'ml_CeG3fF6pyEViU8dE8pk7R',
'adapter_revision_id' => 'rv_CeG3faPBj2ABwbAaHPTmx',
'calibration_file_id' => 'file-5f1b0c7a-2d19-4a3e-9c60-8ab41c2f7d35'
]
]),
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.together.ai/v1/shaping/prepare-for-fp4-inference"
payload := strings.NewReader("{\n \"inputs\": {\n \"adapter_object_id\": \"ml_CeG3fF6pyEViU8dE8pk7R\",\n \"adapter_revision_id\": \"rv_CeG3faPBj2ABwbAaHPTmx\",\n \"calibration_file_id\": \"file-5f1b0c7a-2d19-4a3e-9c60-8ab41c2f7d35\"\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://api.together.ai/v1/shaping/prepare-for-fp4-inference")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"inputs\": {\n \"adapter_object_id\": \"ml_CeG3fF6pyEViU8dE8pk7R\",\n \"adapter_revision_id\": \"rv_CeG3faPBj2ABwbAaHPTmx\",\n \"calibration_file_id\": \"file-5f1b0c7a-2d19-4a3e-9c60-8ab41c2f7d35\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.together.ai/v1/shaping/prepare-for-fp4-inference")
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 \"inputs\": {\n \"adapter_object_id\": \"ml_CeG3fF6pyEViU8dE8pk7R\",\n \"adapter_revision_id\": \"rv_CeG3faPBj2ABwbAaHPTmx\",\n \"calibration_file_id\": \"file-5f1b0c7a-2d19-4a3e-9c60-8ab41c2f7d35\"\n }\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"job_type": "quantization",
"status": "pending",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"user_id": "<string>",
"params": {
"inputs": {
"adapter_object_id": "ml_CeG3fF6pyEViU8dE8pk7R",
"adapter_revision_id": "rv_CeG3faPBj2ABwbAaHPTmx",
"calibration_file_id": "file-5f1b0c7a-2d19-4a3e-9c60-8ab41c2f7d35"
},
"configuration": {
"user_id": "user_CKfewYkQBpaEmN7wuQS3W",
"adapter_project_id": "proj_CczF9KYFantA84sNYDTJd",
"adapter_revision_id": "rv_CeERyXMBQCJTRC1yqGTpk",
"adapter_model_name": "ft-qa-artifacts/glm-5.3-e2e-test-adapter",
"base_object_id": "ml_CbJ9yCnij7A47b1xkpioB",
"base_revision_id": "rv_CbJ9yNrws93VQrZum1fTE",
"base_model_name": "zai-org/GLM-5.3-NVFP4"
}
},
"events": [
{
"object": "shaping",
"created_at": "2023-11-07T05:31:56Z",
"level": "Info",
"message": "<string>",
"type": "SHAPING_ERROR",
"hash": "<string>",
"result": {
"model_object_id": "<string>",
"model_revision_id": "<string>"
}
}
],
"results": {
"model_object_id": "<string>",
"model_revision_id": "<string>"
}
}{
"error": {
"message": "<string>",
"type": "<string>",
"param": null,
"code": null
}
}{
"error": {
"message": "<string>",
"type": "<string>",
"param": null,
"code": null
}
}{
"error": {
"message": "<string>",
"type": "<string>",
"param": null,
"code": null
}
}{
"error": {
"message": "<string>",
"type": "<string>",
"param": null,
"code": null
}
}{
"error": {
"message": "<string>",
"type": "<string>",
"param": null,
"code": null
}
}{
"error": {
"message": "<string>",
"type": "<string>",
"param": null,
"code": null
}
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
Request body for preparing an adapter for FP4 inference.
Adapter inputs to prepare.
Show child attributes
Show child attributes
{ "adapter_object_id": "ml_CeG3fF6pyEViU8dE8pk7R", "adapter_revision_id": "rv_CeG3faPBj2ABwbAaHPTmx", "calibration_file_id": "file-5f1b0c7a-2d19-4a3e-9c60-8ab41c2f7d35" }
Response
Quantization job created successfully.
Quantization job that prepares an adapter for FP4 inference.
Unique shaping job ID.
^shp-quant-[a-f0-9-]+$Type of shaping job.
quantization Current job status.
pending, queued, running, completed, cancelled, cancel_requested, error, user_error Time when the job was created.
Time when the job was last updated.
User that created the job.
Job specification.
Show child attributes
Show child attributes
Events emitted by the job.
Show child attributes
Show child attributes
Model artifacts produced by the job.
Show child attributes
Show child attributes
Was this page helpful?