Skip to main content
The Netra SDK exposes a models client that lets you:
  • Fetch model pricing - Retrieve pricing details for all AI models in your project
  • Filter by model name - Look up pricing for a specific model by name
This page shows how to use Netra.models to query model pricing information programmatically.

Getting Started

The models client is available on the main Netra entry point after initialization.

getModelPricing

Fetch model details and pricing for all models associated with your project, or filter by a specific model name.

Parameters

Response

Returns an array of ModelPricing objects from the API. Returns null if the request fails or the client is not initialized. Returns an empty array if the project has no matching models.
The name parameter performs a filter on the server side. Use it to avoid fetching the full model catalog when you only need pricing for a specific model.
getModelPricing is async. Always await the call. Errors are logged and null is returned so your application keeps running.

Caching

By default, every getModelPricing call hits the backend. Pass useCache: true to serve repeated lookups from an in-memory TTL cache.
Cache keys include the model name (or "all" when name is omitted), so filtered and unfiltered results are stored separately. Failed lookups (null) are not cached.

clearCache

Clear all cached model pricing entries. The SDK also clears this cache when you call Netra.shutdown().
Returns: void

Configuration

Environment Variables

The models client respects the following environment variables:

Complete Example

Next Steps

Last modified on December 4, 2026