UNPKG

notdiamond

Version:

The official TypeScript library for the Notdiamond API

49 lines 1.81 kB
"use strict"; // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. Object.defineProperty(exports, "__esModule", { value: true }); exports.Models = void 0; const resource_1 = require("../core/resource.js"); class Models extends resource_1.APIResource { /** * List all supported text generation models with optional filtering. * * including pricing, context length, latency, and OpenRouter availability. * * **Note:** Image generation models are excluded from this endpoint. * * **Examples:** * * - Get all models: `/v2/models` * - OpenRouter only: `/v2/models?openrouter_only=true` * - Specific provider: `/v2/models?provider=openai` * - Multiple providers: `/v2/models?provider=openai&provider=anthropic` * * **Query Parameters:** * * - **provider**: Filter by provider name(s). Can specify multiple times for * multiple providers (e.g., `?provider=openai&provider=anthropic`) * - **openrouter_only**: Return only models that have OpenRouter support (default: * false) * * **Returns:** * * - **models**: List of active text generation model objects with metadata * - **total**: Total number of active models returned * - **deprecated_models**: List of deprecated text generation model objects with * metadata (respects the same filters as active models) * * **Caching:** * * - Response is cacheable for 1 hour (model list rarely changes) * * @example * ```ts * const models = await client.models.list(); * ``` */ list(query = {}, options) { return this._client.get('/v2/models', { query, ...options }); } } exports.Models = Models; //# sourceMappingURL=models.js.map