Skip to main content
Use @google/genai with either backend. Follow the TypeScript quickstart to create your wrapped gemini client. Pass the provider ID in wrap() so Brello can distinguish the two backends. Brello uses its own project ingestion key. The SDK collects usage from the methods below. Automatic imports of Google billing data are not yet available.

Send a request

Set GEMINI_MODEL to a model available to your Google backend.
Your application can read response.text as usual. Brello collects the model, available token counts, and a response ID when Google provides one. It leaves prompts, output text, tool arguments and results, and embedding vectors for your application to handle.

Supported methods

Google usage is recorded per wrapped SDK method call. The Google client may make additional requests internally, for example for automatic continuation. For generation, input totals include tool-use prompt tokens and output totals include thinking tokens when Google reports them. Cached input is included in total input and reported separately as a subset. Brello records usage: null when it cannot determine usable token counts.

Track streaming usage

Consume the stream to completion to capture its final usage. If you stop iterating early, Brello records a cancelled call with unknown usage. In a short-lived script, call await brello.flush() after consuming the stream. See configuration and delivery for user and feature attribution, and privacy and collection for data handling.