Create or update a model pricing override
curl --request PUT \
--url https://{instance}.flintai.dev/api/v1/cost/model-pricing/tenants/{tenant_id}/workspaces/{workspace_id}/{model_fingerprint} \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"cache_read_cost_per_1m_tok": 123,
"cache_write_cost_per_1m_tok": 123,
"input_cost_per_1m_tok": 123,
"output_cost_per_1m_tok": 123,
"price_as_of": "<string>"
}
'import requests
url = "https://{instance}.flintai.dev/api/v1/cost/model-pricing/tenants/{tenant_id}/workspaces/{workspace_id}/{model_fingerprint}"
payload = {
"cache_read_cost_per_1m_tok": 123,
"cache_write_cost_per_1m_tok": 123,
"input_cost_per_1m_tok": 123,
"output_cost_per_1m_tok": 123,
"price_as_of": "<string>"
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
cache_read_cost_per_1m_tok: 123,
cache_write_cost_per_1m_tok: 123,
input_cost_per_1m_tok: 123,
output_cost_per_1m_tok: 123,
price_as_of: '<string>'
})
};
fetch('https://{instance}.flintai.dev/api/v1/cost/model-pricing/tenants/{tenant_id}/workspaces/{workspace_id}/{model_fingerprint}', 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://{instance}.flintai.dev/api/v1/cost/model-pricing/tenants/{tenant_id}/workspaces/{workspace_id}/{model_fingerprint}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'cache_read_cost_per_1m_tok' => 123,
'cache_write_cost_per_1m_tok' => 123,
'input_cost_per_1m_tok' => 123,
'output_cost_per_1m_tok' => 123,
'price_as_of' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"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://{instance}.flintai.dev/api/v1/cost/model-pricing/tenants/{tenant_id}/workspaces/{workspace_id}/{model_fingerprint}"
payload := strings.NewReader("{\n \"cache_read_cost_per_1m_tok\": 123,\n \"cache_write_cost_per_1m_tok\": 123,\n \"input_cost_per_1m_tok\": 123,\n \"output_cost_per_1m_tok\": 123,\n \"price_as_of\": \"<string>\"\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "<api-key>")
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.put("https://{instance}.flintai.dev/api/v1/cost/model-pricing/tenants/{tenant_id}/workspaces/{workspace_id}/{model_fingerprint}")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"cache_read_cost_per_1m_tok\": 123,\n \"cache_write_cost_per_1m_tok\": 123,\n \"input_cost_per_1m_tok\": 123,\n \"output_cost_per_1m_tok\": 123,\n \"price_as_of\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{instance}.flintai.dev/api/v1/cost/model-pricing/tenants/{tenant_id}/workspaces/{workspace_id}/{model_fingerprint}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"cache_read_cost_per_1m_tok\": 123,\n \"cache_write_cost_per_1m_tok\": 123,\n \"input_cost_per_1m_tok\": 123,\n \"output_cost_per_1m_tok\": 123,\n \"price_as_of\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"cache_read_cost_per_1m_tok": 123,
"cache_write_cost_per_1m_tok": 123,
"default_cache_read_cost_per_1m_tok": 123,
"default_cache_write_cost_per_1m_tok": 123,
"default_input_cost_per_1m_tok": 123,
"default_output_cost_per_1m_tok": 123,
"input_cost_per_1m_tok": 123,
"model_fingerprint": "<string>",
"model_name": "<string>",
"model_supplier": "<string>",
"output_cost_per_1m_tok": 123,
"price_as_of": "<string>",
"source": "<string>"
}{
"code": 400,
"message": "Invalid request"
}{
"code": 400,
"message": "Invalid request"
}{
"code": 400,
"message": "Invalid request"
}{
"code": 400,
"message": "Invalid request"
}cost
Create or update a model pricing override
Upsert a custom per-token price override for a model fingerprint. If all prices equal the model’s list prices, the override is removed and the model reverts to platform pricing.
PUT
/
cost
/
model-pricing
/
tenants
/
{tenant_id}
/
workspaces
/
{workspace_id}
/
{model_fingerprint}
Create or update a model pricing override
curl --request PUT \
--url https://{instance}.flintai.dev/api/v1/cost/model-pricing/tenants/{tenant_id}/workspaces/{workspace_id}/{model_fingerprint} \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"cache_read_cost_per_1m_tok": 123,
"cache_write_cost_per_1m_tok": 123,
"input_cost_per_1m_tok": 123,
"output_cost_per_1m_tok": 123,
"price_as_of": "<string>"
}
'import requests
url = "https://{instance}.flintai.dev/api/v1/cost/model-pricing/tenants/{tenant_id}/workspaces/{workspace_id}/{model_fingerprint}"
payload = {
"cache_read_cost_per_1m_tok": 123,
"cache_write_cost_per_1m_tok": 123,
"input_cost_per_1m_tok": 123,
"output_cost_per_1m_tok": 123,
"price_as_of": "<string>"
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
cache_read_cost_per_1m_tok: 123,
cache_write_cost_per_1m_tok: 123,
input_cost_per_1m_tok: 123,
output_cost_per_1m_tok: 123,
price_as_of: '<string>'
})
};
fetch('https://{instance}.flintai.dev/api/v1/cost/model-pricing/tenants/{tenant_id}/workspaces/{workspace_id}/{model_fingerprint}', 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://{instance}.flintai.dev/api/v1/cost/model-pricing/tenants/{tenant_id}/workspaces/{workspace_id}/{model_fingerprint}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'cache_read_cost_per_1m_tok' => 123,
'cache_write_cost_per_1m_tok' => 123,
'input_cost_per_1m_tok' => 123,
'output_cost_per_1m_tok' => 123,
'price_as_of' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"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://{instance}.flintai.dev/api/v1/cost/model-pricing/tenants/{tenant_id}/workspaces/{workspace_id}/{model_fingerprint}"
payload := strings.NewReader("{\n \"cache_read_cost_per_1m_tok\": 123,\n \"cache_write_cost_per_1m_tok\": 123,\n \"input_cost_per_1m_tok\": 123,\n \"output_cost_per_1m_tok\": 123,\n \"price_as_of\": \"<string>\"\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "<api-key>")
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.put("https://{instance}.flintai.dev/api/v1/cost/model-pricing/tenants/{tenant_id}/workspaces/{workspace_id}/{model_fingerprint}")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"cache_read_cost_per_1m_tok\": 123,\n \"cache_write_cost_per_1m_tok\": 123,\n \"input_cost_per_1m_tok\": 123,\n \"output_cost_per_1m_tok\": 123,\n \"price_as_of\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{instance}.flintai.dev/api/v1/cost/model-pricing/tenants/{tenant_id}/workspaces/{workspace_id}/{model_fingerprint}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"cache_read_cost_per_1m_tok\": 123,\n \"cache_write_cost_per_1m_tok\": 123,\n \"input_cost_per_1m_tok\": 123,\n \"output_cost_per_1m_tok\": 123,\n \"price_as_of\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"cache_read_cost_per_1m_tok": 123,
"cache_write_cost_per_1m_tok": 123,
"default_cache_read_cost_per_1m_tok": 123,
"default_cache_write_cost_per_1m_tok": 123,
"default_input_cost_per_1m_tok": 123,
"default_output_cost_per_1m_tok": 123,
"input_cost_per_1m_tok": 123,
"model_fingerprint": "<string>",
"model_name": "<string>",
"model_supplier": "<string>",
"output_cost_per_1m_tok": 123,
"price_as_of": "<string>",
"source": "<string>"
}{
"code": 400,
"message": "Invalid request"
}{
"code": 400,
"message": "Invalid request"
}{
"code": 400,
"message": "Invalid request"
}{
"code": 400,
"message": "Invalid request"
}Authorizations
Use this header with a Bearer token to authenticate requests.
Path Parameters
Tenant ID
Workspace ID
Model fingerprint
Body
application/json
Pricing override
Response
Saved model pricing
"platform" or "custom"
Was this page helpful?

