Decisions
Estimate the cost of Jev decisions
Counts customer input using the pinned billing tokenizer and resolves the current model and fallback price. Reserves no credit and runs no model. Estimates consume their own account token budget; the execution policy and available balance are checked again when the request is submitted.
POST
/
v1
/
systemone
/
estimate
Estimate the cost of Jev decisions
curl --request POST \
--url https://api.sqwish.ai/v1/systemone/estimate \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "<string>",
"questions": {},
"state": ""
}
'import requests
url = "https://api.sqwish.ai/v1/systemone/estimate"
payload = {
"model": "<string>",
"questions": {},
"state": ""
}
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({model: '<string>', questions: {}, state: ''})
};
fetch('https://api.sqwish.ai/v1/systemone/estimate', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"currency": "USD",
"input_tokens": 123,
"tokenizer": {
"name": "<string>",
"revision": "<string>"
},
"maximum_charge_usd": "<string>",
"models": [
{
"id": "<string>",
"quote_usd": "<string>"
}
]
}{
"error": {
"code": "<string>",
"message": "<string>",
"retryable": true,
"request_id": "<string>",
"details": [
{
"path": [
"<string>"
],
"message": "<string>",
"type": "<string>"
}
]
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"retryable": true,
"request_id": "<string>",
"details": [
{
"path": [
"<string>"
],
"message": "<string>",
"type": "<string>"
}
]
}
}Authorizations
Create an API key in the console.
Body
application/json
Estimate the cost of Jev decisions
curl --request POST \
--url https://api.sqwish.ai/v1/systemone/estimate \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "<string>",
"questions": {},
"state": ""
}
'import requests
url = "https://api.sqwish.ai/v1/systemone/estimate"
payload = {
"model": "<string>",
"questions": {},
"state": ""
}
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({model: '<string>', questions: {}, state: ''})
};
fetch('https://api.sqwish.ai/v1/systemone/estimate', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"currency": "USD",
"input_tokens": 123,
"tokenizer": {
"name": "<string>",
"revision": "<string>"
},
"maximum_charge_usd": "<string>",
"models": [
{
"id": "<string>",
"quote_usd": "<string>"
}
]
}{
"error": {
"code": "<string>",
"message": "<string>",
"retryable": true,
"request_id": "<string>",
"details": [
{
"path": [
"<string>"
],
"message": "<string>",
"type": "<string>"
}
]
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"retryable": true,
"request_id": "<string>",
"details": [
{
"path": [
"<string>"
],
"message": "<string>",
"type": "<string>"
}
]
}
}