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
Netra.models to query model pricing information programmatically.
Getting Started
Themodels 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 ofModelPricing 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.
ModelPricing
ModelPricing
getModelPricing is async. Always await the call. Errors are logged and null is returned so your application keeps running.Caching
By default, everygetModelPricing call hits the backend. Pass useCache: true to serve repeated lookups from an in-memory TTL cache.
"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 callNetra.shutdown().
void
Configuration
Environment Variables
The models client respects the following environment variables:Complete Example
Next Steps
- TypeScript SDK Overview - Full TypeScript API reference
- Prompts - Fetch managed prompt templates
- Dashboard Query - Query dashboard metrics
- Usage & Traces - Query traces and spans
