Use everything in the platform from your own code.
The REST API at https://api.brewmycode.com/v1 exposes knowledge bases, documents, queries, conversations, agents, runs and webhooks. Official SDKs are available for Python and TypeScript.
pip install brewmycode
from brewmycode import Client
bmc = Client(api_key="bmc_live_…")
res = bmc.queries.create(
knowledge_base="ops-eu",
query="Which suppliers have open August invoices?",
as_user="marja@example.com",
)
print(res.answer)
for c in res.citations:
print(c.n, c.document, c.url)
npm install @brewmycode/sdk
import { BrewMyCode } from "@brewmycode/sdk";
const bmc = new BrewMyCode({ apiKey: process.env.BMC_API_KEY! });
const res = await bmc.queries.create({
knowledgeBase: "ops-eu",
query: "Which suppliers have open August invoices?",
asUser: "marja@example.com",
});
console.log(res.answer, res.citations);
Continue with the API introduction and Authentication.