Docs

Get Model

GET/v1beta/models/{model}

Get model metadata using Google Gemini API format

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

Returns metadata for a specific model in Google Gemini API format.

Path Parameters

Parameter model

Type: string

Location: path

Required: yes

Model name (e.g., gemini-2.5-pro, gemini-2.5-flash). Aliases are also accepted.

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 name

Type: string

Model resource name in models/{model} format.

Response Field displayName

Type: string

Human-readable model name.

Response Field inputTokenLimit

Type: integer

Maximum input tokens (context window).

Response Field outputTokenLimit

Type: integer

Maximum output tokens.

Response Field supportedGenerationMethods

Type: array

List of supported generation methods (e.g., generateContent, countTokens, streamGenerateContent).

Request Example

curl "https://api.anypath.dev/v1beta/models/gemini-2.5-pro"
import google.generativeai as genai

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

model = genai.get_model("models/gemini-2.5-pro")
print(f"Name: {model.name}")
print(f"Input limit: {model.input_token_limit}")
print(f"Output limit: {model.output_token_limit}")

Response Example

{
  "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"]
}