curl --request GET \
--url https://api-sandbox.beinfi.com/rail/config \
--header 'Authorization: Bearer <token>'import requests
url = "https://api-sandbox.beinfi.com/rail/config"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api-sandbox.beinfi.com/rail/config', 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-sandbox.beinfi.com/rail/config",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api-sandbox.beinfi.com/rail/config"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api-sandbox.beinfi.com/rail/config")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-sandbox.beinfi.com/rail/config")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"network": "eip155:8453",
"asset": "<string>",
"assetDecimals": 123,
"payTo": "<string>",
"grace": {
"window": "<string>",
"maxPerAgent": "5000",
"maxTotal": "5000",
"queueLimit": 123,
"clockSkewSeconds": 123
},
"facilitator": {
"provider": "<string>",
"indexesForDiscovery": true
},
"outputSchema": {}
}{
"message": "<string>",
"error_code": "internal_error",
"tracer_id": "<string>"
}{
"message": "<string>",
"error_code": "internal_error",
"tracer_id": "<string>",
"resource": "<string>"
}{
"message": "<string>",
"error_code": "internal_error",
"tracer_id": "<string>",
"errors": [
{
"field": "<string>",
"value": "<string>",
"constraint": "<string>",
"description": "<string>"
}
]
}Get Rail config
What your server needs to charge agents: network, asset, wallet and grace limits. Read it once, at startup, not per request.
Rail amounts are in the asset’s atomic units. Use assetDecimals to convert: "5000" at six decimals is 0.005 USDC. Do not hardcode the number of decimals.
The product parameter is validated here, so a missing product surfaces at startup rather than as a 402 on every agent request.
curl --request GET \
--url https://api-sandbox.beinfi.com/rail/config \
--header 'Authorization: Bearer <token>'import requests
url = "https://api-sandbox.beinfi.com/rail/config"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api-sandbox.beinfi.com/rail/config', 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-sandbox.beinfi.com/rail/config",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api-sandbox.beinfi.com/rail/config"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api-sandbox.beinfi.com/rail/config")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-sandbox.beinfi.com/rail/config")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"network": "eip155:8453",
"asset": "<string>",
"assetDecimals": 123,
"payTo": "<string>",
"grace": {
"window": "<string>",
"maxPerAgent": "5000",
"maxTotal": "5000",
"queueLimit": 123,
"clockSkewSeconds": 123
},
"facilitator": {
"provider": "<string>",
"indexesForDiscovery": true
},
"outputSchema": {}
}{
"message": "<string>",
"error_code": "internal_error",
"tracer_id": "<string>"
}{
"message": "<string>",
"error_code": "internal_error",
"tracer_id": "<string>",
"resource": "<string>"
}{
"message": "<string>",
"error_code": "internal_error",
"tracer_id": "<string>",
"errors": [
{
"field": "<string>",
"value": "<string>",
"constraint": "<string>",
"description": "<string>"
}
]
}Authorizations
Your account's secret key: Authorization: Bearer sk_test_… or sk_live_…. Server-side only.
Query Parameters
Key of the product whose meters carry the Rail prices.
Response
Your account's Rail configuration.
What your server uses to charge agents on the Rail.
Network in CAIP-2 format: eip155:<chain id> on EVM (e.g. Base), solana:<genesis ref> on Solana. Short names like base are not accepted.
"eip155:8453"
Token contract address (EVM) or mint (Solana). Never the ticker.
The token's number of decimals. Every atomic amount is read against it.
Your wallet, where the money lands.
How much your server may serve on its own, per process, while Infi is unreachable. It is the only case where delivery happens without settlement.
Show child attributes
Show child attributes
Whether your routes are indexed for discovery by agents (indexesForDiscovery). If not, no agent will find them by searching.
Show child attributes
Show child attributes
Route description your server echoes in its own 402 response.