Docs

List Models

GET/v1beta/models

List available models using Google Gemini API format

On this page
  1. Query Parameters
  2. Authentication
  3. Response
  4. Request Example
  5. Response Example

Returns a list of available models in Google Gemini API format.

Query Parameters

Parameter pageSize

Type: integer

Location: query

Maximum number of models to return. Default: 50, maximum: 1000.

Authentication

Required. Supports the same authentication methods as other Gemini endpoints:

  • ?key=YOUR_API_KEY query parameter
  • x-goog-api-key: YOUR_API_KEY header
  • Authorization: Bearer YOUR_API_KEY header

Response

Response Field models

Type: array

Array of model objects.

Request Example

curl "https://api.anypath.dev/v1beta/models?pageSize=5" \
  -H "x-goog-api-key: sk-your-api-key"
import google.generativeai as genai

genai.configure(
    api_key="sk-your-api-key",
    transport="rest",
    client_options={"api_endpoint": "api.anypath.dev"}
)

for model in genai.list_models():
    print(model.name)
const response = await fetch(
  "https://api.anypath.dev/v1beta/models?pageSize=5",
  { headers: { "x-goog-api-key": "sk-your-api-key" } }
);
const { models } = await response.json();
models.forEach(m => console.log(m.name));

Response Example

{
  "models": [
    {
      "name": "models/gemini-2.5-pro",
      "version": "1.0",
      "displayName": "gemini-2.5-pro",
      "description": "AnyPath routeable Gemini-compatible model.",
      "inputTokenLimit": 1048576,
      "outputTokenLimit": 65536,
      "supportedGenerationMethods": ["generateContent", "countTokens", "streamGenerateContent"]
    },
    {
      "name": "models/gemini-2.5-flash",
      "version": "1.0",
      "displayName": "gemini-2.5-flash",
      "description": "AnyPath routeable Gemini-compatible model.",
      "inputTokenLimit": 1048576,
      "outputTokenLimit": 65536,
      "supportedGenerationMethods": ["generateContent", "countTokens", "streamGenerateContent"]
    }
  ]
}