Skip to Content

Gemini Models API

Query available models on the HaoAI platform through the Gemini native protocol. The response format follows the Google GenAI API specification (name, displayName, inputTokenLimit, and other camelCase fields).

The Models API is a public endpoint that does not require an API Key. This endpoint returns all models accessible via the Gemini protocol, not limited to Google models.

List All Models

GET https://api.hao.ai/gemini/v1beta/models

Request Example

Terminal
curl https://api.hao.ai/gemini/v1beta/models

Response Format

{ "models": [ { "name": "models/google/gemini-3.1-flash-lite-preview", "version": "001", "displayName": "Google: Gemini 3 Flash Preview", "description": "High speed, high value thinking model designed for agentic workflows...", "inputTokenLimit": 1048576, "outputTokenLimit": 65536, "supportedGenerationMethods": [ "generateContent", "countTokens" ], "ownedBy": "google", "canonicalSlug": "gemini-3.1-flash-lite-preview", "contextLength": 1048576, "architecture": { "modality": "text+image+audio+file->text", "input_modalities": ["text", "image", "audio", "file"], "output_modalities": ["text"], "tokenizer": "gemini", "instruct_type": null }, "pricing": { "prompt": "0.0000005", "completion": "0.000003", "audio": "0.000001", "input_cache_read": "0.00000005", "input_cache_write": "0.000001", "web_search": "0.014" }, "topProvider": { "context_length": 1048576, "max_completion_tokens": 65536, "is_moderated": false }, "supportedParameters": [ "temperature", "top_p", "max_tokens", "stop", "tools", "tool_choice", "response_format", "reasoning" ], "expirationDate": null } ] }

Field Differences from OpenAI Protocol

FieldOpenAI ProtocolGemini Protocol
List keydatamodels
Model identifieridname (with models/ prefix)
NamenamedisplayName
Context lengthcontext_lengthinputTokenLimit + contextLength
Max outputtop_provider.max_completion_tokensoutputTokenLimit
Naming stylesnake_casecamelCase

Filter Models by Provider

GET https://api.hao.ai/gemini/v1beta/models/{provider}

Path Parameters

ParameterTypeDescription
providerstringProvider identifier, e.g. google, anthropic, openai

Request Example

Terminal
# List only Google models curl https://api.hao.ai/gemini/v1beta/models/google

Response Format

The response format is the same as listing all models, with the models array containing only models from the specified provider.

Get Model Details

GET https://api.hao.ai/gemini/v1beta/models/{provider}/{model_id}

Path Parameters

ParameterTypeDescription
providerstringProvider identifier, e.g. google
model_idstringModel name, e.g. gemini-3.1-flash-lite-preview

Request Example

Terminal
curl https://api.hao.ai/gemini/v1beta/models/google/gemini-3.1-flash-lite-preview

Response Format

Returns a single Model object with the same structure as objects in the list endpoint.