SDKs, sandbox e ferramentas
Clientes prontos, coleção Postman e ambiente de teste para integrar rápido e com segurança.
Sandbox (chaves de teste)
Use uma chave sm_test_... para integração: ela se comporta como produção, mas não gera
cobrança — a resposta vem com billing_status: "not_charged". Solicite à SauBit uma chave de
teste (is_test). Para homologação isolada, solicite um ambiente de staging.
Coleção Postman
Baixe e importe: saubit.postman_collection.json.
Defina as variáveis baseUrl (https://api.saubit.com.br) e apiKey (sua sm_test_...).
SDK Python
pip install requests
from saubit_client import SauBitClient # sdks/python/saubit_client.py
sb = SauBitClient(api_key="sm_test_...")
res = sb.check(
[{"name": "Varfarina", "dose": 5, "dose_unit": "mg"},
{"name": "Aspirina", "dose": 100, "dose_unit": "mg"}],
conditions=["insuficiência renal"],
)
print(res["prescription_risk_level"], res["clinical_context_assessment"])
SDK Node / TypeScript (Node ≥ 18)
import { SauBitClient } from "./saubit.mjs"; // sdks/node/saubit.mjs
const sb = new SauBitClient({ apiKey: "sm_test_..." });
const res = await sb.check({
medications: [{ name: "Varfarina", dose: 5, dose_unit: "mg" }, { name: "Aspirina", dose: 100, dose_unit: "mg" }],
conditions: ["insuficiência renal"],
});
console.log(res.prescription_risk_level);
SDK Go (stdlib)
sb := saubit.New("sm_test_...") // sdks/go/saubit.go
res, _ := sb.Check(saubit.CheckInput{
Medications: []map[string]any{
{"name": "Varfarina", "dose": 5, "dose_unit": "mg"},
{"name": "Aspirina", "dose": 100, "dose_unit": "mg"},
},
Conditions: []string{"insuficiência renal"},
})
fmt.Println(res["prescription_risk_level"])
SDK PHP (ext-curl)
require 'SauBitClient.php'; // sdks/php/SauBitClient.php
use SauBit\SauBitClient;
$sb = new SauBitClient('sm_test_...');
$res = $sb->check(
[['name' => 'Varfarina', 'dose' => 5, 'dose_unit' => 'mg'],
['name' => 'Aspirina', 'dose' => 100, 'dose_unit' => 'mg']],
['conditions' => ['insuficiência renal']]
);
echo $res['prescription_risk_level'];
SDK C# / .NET (6+)
using SauBit; // sdks/dotnet/SauBitClient.cs
var sb = new SauBitClient("sm_test_...");
var res = await sb.CheckAsync(new object[] {
new { name = "Varfarina", dose = 5, dose_unit = "mg" },
new { name = "Aspirina", dose = 100, dose_unit = "mg" }
}, conditions: new[] { "insuficiência renal" });
Console.WriteLine(res.GetProperty("prescription_risk_level").GetString());
SDK Java (JDK 11+, Jackson)
var sb = new SauBitClient("sm_test_..."); // sdks/java/SauBitClient.java
var res = sb.check(
List.of(
Map.of("name", "Varfarina", "dose", 5, "dose_unit", "mg"),
Map.of("name", "Aspirina", "dose", 100, "dose_unit", "mg")),
Map.of("conditions", List.of("insuficiência renal")));
System.out.println(res.get("prescription_risk_level"));
Todos os SDKs expõem a mesma superfície: check, recheck, batch, compare, chat,
analysis_status, record_decision, fhir_check, cds_services, usage_summary. Os arquivos
ficam em sdks/ no repositório.
Referência interativa
A referência completa com "Try it" (curl, Python, JavaScript, PHP, Go, Java) está em Referência da API (Scalar). Veja também os Fluxos do sistema.