Quote one described tool
curl --request POST \
--url https://api.paywithlocus.com/api/credits/tools/estimate \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"slug": "<string>",
"body": {},
"max_charge_credits": "<string>",
"preflight_external_quote": true,
"idempotency_key": "<string>",
"expires_in_seconds": 315
}
'import requests
url = "https://api.paywithlocus.com/api/credits/tools/estimate"
payload = {
"slug": "<string>",
"body": {},
"max_charge_credits": "<string>",
"preflight_external_quote": True,
"idempotency_key": "<string>",
"expires_in_seconds": 315
}
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({
slug: '<string>',
body: JSON.stringify({}),
max_charge_credits: '<string>',
preflight_external_quote: true,
idempotency_key: '<string>',
expires_in_seconds: 315
})
};
fetch('https://api.paywithlocus.com/api/credits/tools/estimate', 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.paywithlocus.com/api/credits/tools/estimate",
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([
'slug' => '<string>',
'body' => [
],
'max_charge_credits' => '<string>',
'preflight_external_quote' => true,
'idempotency_key' => '<string>',
'expires_in_seconds' => 315
]),
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.paywithlocus.com/api/credits/tools/estimate"
payload := strings.NewReader("{\n \"slug\": \"<string>\",\n \"body\": {},\n \"max_charge_credits\": \"<string>\",\n \"preflight_external_quote\": true,\n \"idempotency_key\": \"<string>\",\n \"expires_in_seconds\": 315\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.paywithlocus.com/api/credits/tools/estimate")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"slug\": \"<string>\",\n \"body\": {},\n \"max_charge_credits\": \"<string>\",\n \"preflight_external_quote\": true,\n \"idempotency_key\": \"<string>\",\n \"expires_in_seconds\": 315\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.paywithlocus.com/api/credits/tools/estimate")
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 \"slug\": \"<string>\",\n \"body\": {},\n \"max_charge_credits\": \"<string>\",\n \"preflight_external_quote\": true,\n \"idempotency_key\": \"<string>\",\n \"expires_in_seconds\": 315\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"estimate": {}
}Catalog
Quote one described tool
Prices the intended request without dispatching it or burning credits. Variable-price and live external-rail tools may return an executable approval token or request a hard maximum before execution.
POST
/
credits
/
tools
/
estimate
Quote one described tool
curl --request POST \
--url https://api.paywithlocus.com/api/credits/tools/estimate \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"slug": "<string>",
"body": {},
"max_charge_credits": "<string>",
"preflight_external_quote": true,
"idempotency_key": "<string>",
"expires_in_seconds": 315
}
'import requests
url = "https://api.paywithlocus.com/api/credits/tools/estimate"
payload = {
"slug": "<string>",
"body": {},
"max_charge_credits": "<string>",
"preflight_external_quote": True,
"idempotency_key": "<string>",
"expires_in_seconds": 315
}
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({
slug: '<string>',
body: JSON.stringify({}),
max_charge_credits: '<string>',
preflight_external_quote: true,
idempotency_key: '<string>',
expires_in_seconds: 315
})
};
fetch('https://api.paywithlocus.com/api/credits/tools/estimate', 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.paywithlocus.com/api/credits/tools/estimate",
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([
'slug' => '<string>',
'body' => [
],
'max_charge_credits' => '<string>',
'preflight_external_quote' => true,
'idempotency_key' => '<string>',
'expires_in_seconds' => 315
]),
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.paywithlocus.com/api/credits/tools/estimate"
payload := strings.NewReader("{\n \"slug\": \"<string>\",\n \"body\": {},\n \"max_charge_credits\": \"<string>\",\n \"preflight_external_quote\": true,\n \"idempotency_key\": \"<string>\",\n \"expires_in_seconds\": 315\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.paywithlocus.com/api/credits/tools/estimate")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"slug\": \"<string>\",\n \"body\": {},\n \"max_charge_credits\": \"<string>\",\n \"preflight_external_quote\": true,\n \"idempotency_key\": \"<string>\",\n \"expires_in_seconds\": 315\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.paywithlocus.com/api/credits/tools/estimate")
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 \"slug\": \"<string>\",\n \"body\": {},\n \"max_charge_credits\": \"<string>\",\n \"preflight_external_quote\": true,\n \"idempotency_key\": \"<string>\",\n \"expires_in_seconds\": 315\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"estimate": {}
}Authorizations
secretKeysandboxKeyendUserTokenagentConnection
Tenant secret key (lcr_…). Server-side only.
Headers
Required only when the end-user JWT carries sid. Send the original high-entropy session value; sid is its SHA-256 fingerprint. Ignored for secret-key authentication.
Required string length:
16 - 128Pattern:
^[A-Za-z0-9][A-Za-z0-9._:-]{15,127}$Optional end-user identity for a tenant secret key. Case-sensitive immutable ID in the tenant namespace. Prefer an identity-provider subject, not an email address.
Required string length:
1 - 200Pattern:
^[A-Za-z0-9][A-Za-z0-9._:@/-]{0,199}$Body
application/json
Pattern:
^[A-Za-z0-9][A-Za-z0-9._-]*/[A-Za-z0-9][A-Za-z0-9._-]*$Non-negative exact decimal string with at most six fractional digits. Endpoint-specific positivity and amount limits still apply.
Pattern:
^\d+(?:\.\d{1,6})?$Required string length:
1 - 200Required range:
30 <= x <= 600