Overview
Model information endpointsAvailable Operations
- Get - Get a model by its slug
- List - List all models and their properties
- Count - Get total count of available models
- 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
Parameters
| Parameter | Type | Required | Description | Example |
|---|---|---|---|---|
ctx | context.Context | :heavy_check_mark: | The context to use for the request. | |
author | string | :heavy_check_mark: | The author/organization of the model | openai |
slug | string | :heavy_check_mark: | The model slug, optionally including a variant suffix (e.g. gpt-4 or gpt-4:free) | gpt-4 |
opts | []operations.Option | :heavy_minus_sign: | The options for this request. |
Response
*components.ModelResponse, errorErrors
| Error Type | Status Code | Content Type |
|---|---|---|
| sdkerrors.NotFoundResponseError | 404 | application/json |
| sdkerrors.InternalServerResponseError | 500 | application/json |
| sdkerrors.APIError | 4XX, 5XX | */* |
List
List all models and their propertiesExample Usage
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
ctx | context.Context | :heavy_check_mark: | The context to use for the request. |
request | operations.GetModelsRequest | :heavy_check_mark: | The request object to use for the request. |
opts | []operations.Option | :heavy_minus_sign: | The options for this request. |
Response
*components.ModelsListResponse, errorErrors
| Error Type | Status Code | Content Type |
|---|---|---|
| sdkerrors.BadRequestResponseError | 400 | application/json |
| sdkerrors.InternalServerResponseError | 500 | application/json |
| sdkerrors.APIError | 4XX, 5XX | */* |
Count
Get total count of available modelsExample Usage
Parameters
| Parameter | Type | Required | Description | Example |
|---|---|---|---|---|
ctx | context.Context | :heavy_check_mark: | The context to use for the request. | |
outputModalities | *string | :heavy_minus_sign: | Filter models by output modality. Accepts a comma-separated list of modalities (text, image, audio, embeddings) or “all” to include all models. Defaults to “text”. | text |
opts | []operations.Option | :heavy_minus_sign: | The options for this request. |
Response
*components.ModelsCountResponse, errorErrors
| Error Type | Status Code | Content Type |
|---|---|---|
| sdkerrors.BadRequestResponseError | 400 | application/json |
| sdkerrors.InternalServerResponseError | 500 | application/json |
| sdkerrors.APIError | 4XX, 5XX | */* |
ListForUser
List models filtered by user provider preferences, privacy settings, and guardrails. If requesting througheu.openrouter.ai/api/v1/... the results will be filtered to models that satisfy EU in-region routing.
Example Usage
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
ctx | context.Context | :heavy_check_mark: | The context to use for the request. |
security | operations.ListModelsUserSecurity | :heavy_check_mark: | The security requirements to use for the request. |
opts | []operations.Option | :heavy_minus_sign: | The options for this request. |
Response
*components.ModelsListResponse, errorErrors
| Error Type | Status Code | Content Type |
|---|---|---|
| sdkerrors.UnauthorizedResponseError | 401 | application/json |
| sdkerrors.NotFoundResponseError | 404 | application/json |
| sdkerrors.InternalServerResponseError | 500 | application/json |
| sdkerrors.APIError | 4XX, 5XX | */* |