Skip to main content

Overview

The models endpoint returns a list of all available models that can be used with the Helicone AI Gateway. This endpoint is OpenAI-compatible and returns models in the same format as OpenAI’s /v1/models endpoint.

Authentication

This endpoint does not require authentication and can be called without an API key.

Endpoint

GET https://ai-gateway.helicone.ai/v1/models

Request

This endpoint accepts no query parameters and returns all available models.
curl https://ai-gateway.helicone.ai/v1/models

Response Format

object
string
Always returns list to indicate this is a list response.
data
array
Array of model objects available through the gateway.

Example Response

{
  "object": "list",
  "data": [
    {
      "id": "gpt-4",
      "object": "model",
      "created": 1704067200,
      "owned_by": "openai"
    },
    {
      "id": "gpt-4-turbo",
      "object": "model",
      "created": 1704067200,
      "owned_by": "openai"
    },
    {
      "id": "gpt-3.5-turbo",
      "object": "model",
      "created": 1704067200,
      "owned_by": "openai"
    },
    {
      "id": "claude-3-opus-20240229",
      "object": "model",
      "created": 1704067200,
      "owned_by": "anthropic"
    },
    {
      "id": "claude-3-sonnet-20240229",
      "object": "model",
      "created": 1704067200,
      "owned_by": "anthropic"
    },
    {
      "id": "claude-3-haiku-20240307",
      "object": "model",
      "created": 1704067200,
      "owned_by": "anthropic"
    },
    {
      "id": "gemini-pro",
      "object": "model",
      "created": 1704067200,
      "owned_by": "google"
    },
    {
      "id": "gemini-1.5-pro",
      "object": "model",
      "created": 1704067200,
      "owned_by": "google"
    },
    {
      "id": "llama-3-70b",
      "object": "model",
      "created": 1704067200,
      "owned_by": "meta"
    },
    {
      "id": "mistral-large",
      "object": "model",
      "created": 1704067200,
      "owned_by": "mistral"
    }
  ]
}

Model Filtering

The endpoint automatically filters out models that:
  • Require explicit routing configuration
  • Are not available through the standard gateway endpoints
  • Have no registered endpoints in the cost registry
This ensures you only see models that are immediately usable with the chat completions endpoint.

Using Model IDs

The id field from each model object can be used directly in your chat completion requests:
{
  "model": "gpt-4",
  "messages": [
    {"role": "user", "content": "Hello!"}
  ]
}

Model Support

The Helicone AI Gateway supports models from multiple providers:
  • OpenAI: GPT-4, GPT-3.5, and variants
  • Anthropic: Claude 3 family (Opus, Sonnet, Haiku)
  • Google: Gemini models
  • Meta: Llama models
  • Mistral: Mistral and Mixtral models
  • And many more: The registry is continuously updated with new models

Error Handling

error
object
Error information if the request fails.

Example Error Response

{
  "error": {
    "message": "Failed to fetch models from registry",
    "type": "internal_error"
  }
}

Implementation Details

The models list is generated from Helicone’s internal cost registry (@helicone-package/cost/models/registry), which:
  • Tracks pricing and capabilities for each model
  • Is automatically synced with provider model releases
  • Includes metadata like creation dates and ownership
  • Powers cost calculation and analytics in Helicone

Rate Limits

This endpoint has generous rate limits as it’s a read-only operation that doesn’t consume compute resources. It can be called frequently for model discovery without concerns about rate limiting.

Best Practices

  • Cache the response: The model list doesn’t change frequently, so cache it client-side to reduce API calls
  • Filter by provider: If you only use specific providers, filter the response by the owned_by field
  • Dynamic model selection: Use this endpoint to build dynamic model selection UIs
  • Validation: Validate user-provided model IDs against this list before making completion requests

Client-Side Filtering Example

// Get all OpenAI models
const openaiModels = models.data.filter(m => m.owned_by === 'openai');

// Get all Claude models
const claudeModels = models.data.filter(m => m.owned_by === 'anthropic');

// Check if a model exists
const hasGPT4 = models.data.some(m => m.id === 'gpt-4');

// Get the newest models (sort by created timestamp)
const newestModels = [...models.data]
  .sort((a, b) => b.created - a.created)
  .slice(0, 5);