> ## Documentation Index > Fetch the complete documentation index at: https://openrouter.ai/docs/llms.txt > Use this file to discover all available pages before exploring further. # Models > Model information endpoints ## Overview Model information endpoints ### Available Operations * [get](#get) - Get a model by its slug * [list](#list) - List all models and their properties * [count](#count) - Get total count of available models * [listForUser](#listforuser) - List models filtered by user provider preferences, privacy settings, and guardrails ## get Returns full details for a single model identified by its author and slug (e.g. openai/gpt-4). Supports variant suffixes (e.g. openai/gpt-4:free) and resolves known slug aliases. ### Example Usage ```typescript theme={null} import { OpenRouter } from "@openrouter/sdk"; const openRouter = new OpenRouter({ httpReferer: "", appTitle: "", appCategories: "", apiKey: process.env["OPENROUTER_API_KEY"] ?? "", }); async function run() { const result = await openRouter.models.get({ author: "openai", slug: "gpt-4", }); console.log(result); } run(); ``` ### Standalone function The standalone function version of this method: ```typescript theme={null} import { OpenRouterCore } from "@openrouter/sdk/core.js"; import { modelsGet } from "@openrouter/sdk/funcs/modelsGet.js"; // Use `OpenRouterCore` for best tree-shaking performance. // You can create one instance of it to use across an application. const openRouter = new OpenRouterCore({ httpReferer: "", appTitle: "", appCategories: "", apiKey: process.env["OPENROUTER_API_KEY"] ?? "", }); async function run() { const res = await modelsGet(openRouter, { author: "openai", slug: "gpt-4", }); if (res.ok) { const { value: result } = res; console.log(result); } else { console.log("modelsGet failed:", res.error); } } run(); ``` ### Parameters | Parameter | Type | Required | Description | | ---------------------- | --------------------------------------------------------------------------------------- | -------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | `request` | [operations.GetModelRequest](../../models/operations/getmodelrequest.mdx) | :heavy\_check\_mark: | The request object to use for the request. | | `options` | RequestOptions | :heavy\_minus\_sign: | Used to set various options for making HTTP requests. | | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy\_minus\_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.mdx) | :heavy\_minus\_sign: | Enables retrying HTTP requests under certain failure conditions. | ### Response **Promise\<[models.ModelResponse](../../models/modelresponse.mdx)>** ### Errors | Error Type | Status Code | Content Type | | ---------------------------------- | ----------- | ---------------- | | errors.ForbiddenResponseError | 403 | application/json | | errors.NotFoundResponseError | 404 | application/json | | errors.InternalServerResponseError | 500 | application/json | | errors.OpenRouterDefaultError | 4XX, 5XX | \*/\* | ## list List all models and their properties ### Example Usage ```typescript theme={null} import { OpenRouter } from "@openrouter/sdk"; const openRouter = new OpenRouter({ httpReferer: "", appTitle: "", appCategories: "", apiKey: process.env["OPENROUTER_API_KEY"] ?? "", }); async function run() { const result = await openRouter.models.list(); for await (const page of result) { console.log(page); } } run(); ``` ### Standalone function The standalone function version of this method: ```typescript theme={null} import { OpenRouterCore } from "@openrouter/sdk/core.js"; import { modelsList } from "@openrouter/sdk/funcs/modelsList.js"; // Use `OpenRouterCore` for best tree-shaking performance. // You can create one instance of it to use across an application. const openRouter = new OpenRouterCore({ httpReferer: "", appTitle: "", appCategories: "", apiKey: process.env["OPENROUTER_API_KEY"] ?? "", }); async function run() { const res = await modelsList(openRouter); if (res.ok) { const { value: result } = res; for await (const page of result) { console.log(page); } } else { console.log("modelsList failed:", res.error); } } run(); ``` ### Parameters | Parameter | Type | Required | Description | | ---------------------- | --------------------------------------------------------------------------------------- | -------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | `request` | [operations.GetModelsRequest](../../models/operations/getmodelsrequest.mdx) | :heavy\_check\_mark: | The request object to use for the request. | | `options` | RequestOptions | :heavy\_minus\_sign: | Used to set various options for making HTTP requests. | | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy\_minus\_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.mdx) | :heavy\_minus\_sign: | Enables retrying HTTP requests under certain failure conditions. | ### Response **Promise\<[operations.GetModelsResponse](../../models/operations/getmodelsresponse.mdx)>** ### Errors | Error Type | Status Code | Content Type | | ---------------------------------- | ----------- | ---------------- | | errors.BadRequestResponseError | 400 | application/json | | errors.ForbiddenResponseError | 403 | application/json | | errors.InternalServerResponseError | 500 | application/json | | errors.OpenRouterDefaultError | 4XX, 5XX | \*/\* | ## count Get total count of available models ### Example Usage ```typescript theme={null} import { OpenRouter } from "@openrouter/sdk"; const openRouter = new OpenRouter({ httpReferer: "", appTitle: "", appCategories: "", apiKey: process.env["OPENROUTER_API_KEY"] ?? "", }); async function run() { const result = await openRouter.models.count(); console.log(result); } run(); ``` ### Standalone function The standalone function version of this method: ```typescript theme={null} import { OpenRouterCore } from "@openrouter/sdk/core.js"; import { modelsCount } from "@openrouter/sdk/funcs/modelsCount.js"; // Use `OpenRouterCore` for best tree-shaking performance. // You can create one instance of it to use across an application. const openRouter = new OpenRouterCore({ httpReferer: "", appTitle: "", appCategories: "", apiKey: process.env["OPENROUTER_API_KEY"] ?? "", }); async function run() { const res = await modelsCount(openRouter); if (res.ok) { const { value: result } = res; console.log(result); } else { console.log("modelsCount failed:", res.error); } } run(); ``` ### Parameters | Parameter | Type | Required | Description | | ---------------------- | --------------------------------------------------------------------------------------- | -------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | `request` | [operations.ListModelsCountRequest](../../models/operations/listmodelscountrequest.mdx) | :heavy\_check\_mark: | The request object to use for the request. | | `options` | RequestOptions | :heavy\_minus\_sign: | Used to set various options for making HTTP requests. | | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy\_minus\_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.mdx) | :heavy\_minus\_sign: | Enables retrying HTTP requests under certain failure conditions. | ### Response **Promise\<[models.ModelsCountResponse](../../models/modelscountresponse.mdx)>** ### Errors | Error Type | Status Code | Content Type | | ---------------------------------- | ----------- | ---------------- | | errors.BadRequestResponseError | 400 | application/json | | errors.ForbiddenResponseError | 403 | application/json | | errors.InternalServerResponseError | 500 | application/json | | errors.OpenRouterDefaultError | 4XX, 5XX | \*/\* | ## listForUser List models filtered by user provider preferences, [privacy settings](https://openrouter.ai/docs/guides/privacy/provider-logging), and [guardrails](https://openrouter.ai/docs/guides/features/guardrails). Returns text-output models by default; pass `output_modalities` (a comma-separated list of `text`, `image`, `embeddings`, `audio`, `video`, `rerank`, `speech`, `transcription`, or `all`) to include other modalities. If requesting through a regional hostname, the results will be filtered to models that satisfy in-region routing for that region. ### Example Usage ```typescript theme={null} import { OpenRouter } from "@openrouter/sdk"; const openRouter = new OpenRouter({ httpReferer: "", appTitle: "", appCategories: "", }); async function run() { const result = await openRouter.models.listForUser({ bearer: process.env["OPENROUTER_BEARER"] ?? "", }); for await (const page of result) { console.log(page); } } run(); ``` ### Standalone function The standalone function version of this method: ```typescript theme={null} import { OpenRouterCore } from "@openrouter/sdk/core.js"; import { modelsListForUser } from "@openrouter/sdk/funcs/modelsListForUser.js"; // Use `OpenRouterCore` for best tree-shaking performance. // You can create one instance of it to use across an application. const openRouter = new OpenRouterCore({ httpReferer: "", appTitle: "", appCategories: "", }); async function run() { const res = await modelsListForUser(openRouter, { bearer: process.env["OPENROUTER_BEARER"] ?? "", }); if (res.ok) { const { value: result } = res; for await (const page of result) { console.log(page); } } else { console.log("modelsListForUser failed:", res.error); } } run(); ``` ### Parameters | Parameter | Type | Required | Description | | ---------------------- | --------------------------------------------------------------------------------------- | -------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | `request` | [operations.ListModelsUserRequest](../../models/operations/listmodelsuserrequest.mdx) | :heavy\_check\_mark: | The request object to use for the request. | | `security` | [operations.ListModelsUserSecurity](../../models/operations/listmodelsusersecurity.mdx) | :heavy\_check\_mark: | The security requirements to use for the request. | | `options` | RequestOptions | :heavy\_minus\_sign: | Used to set various options for making HTTP requests. | | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy\_minus\_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.mdx) | :heavy\_minus\_sign: | Enables retrying HTTP requests under certain failure conditions. | ### Response **Promise\<[operations.ListModelsUserResponse](../../models/operations/listmodelsuserresponse.mdx)>** ### Errors | Error Type | Status Code | Content Type | | ---------------------------------- | ----------- | ---------------- | | errors.UnauthorizedResponseError | 401 | application/json | | errors.ForbiddenResponseError | 403 | application/json | | errors.NotFoundResponseError | 404 | application/json | | errors.InternalServerResponseError | 500 | application/json | | errors.OpenRouterDefaultError | 4XX, 5XX | \*/\* |