Skip to content

Commit c103729

Browse files
authored
Update models endpoint (#4704)
1 parent a8594e0 commit c103729

File tree

4 files changed

+74
-8
lines changed

4 files changed

+74
-8
lines changed

docs/docs.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -343,7 +343,7 @@
343343
{
344344
"group": "Models",
345345
"pages": [
346-
"rest/models/get-v1models"
346+
"rest/models/get-v1public-model-registry-models"
347347
]
348348
}
349349
]

docs/rest/models/get-v1models.mdx

Lines changed: 0 additions & 6 deletions
This file was deleted.
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
title: "Get Model Registry"
3+
sidebarTitle: "Get All Available Models"
4+
description: "Returns all models and endpoints supported by the Helicone AI Gateway"
5+
openapi: get /v1/public/model-registry/models
6+
---
7+
8+
This endpoint returns the complete catalog of AI models and provider endpoints that the Helicone AI Gateway can route to. The gateway uses this registry to determine which providers support a requested model and how to intelligently route requests for maximum reliability and cost optimization.
9+
10+
When you request a model through the AI Gateway (like `gpt-4o-mini`), the gateway consults this registry to find all providers offering that model, then applies routing logic to select the best provider based on your configuration, availability, and pricing.

valhalla/jawn/src/controllers/public/modelRegistryController.ts

Lines changed: 63 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Controller, Get, Route, Tags } from "tsoa";
1+
import { Controller, Get, Route, Tags, Example } from "tsoa";
22
import { err, ok, Result } from "../../packages/common/result";
33
import { registry } from "../../../../../packages/cost/models/registry";
44
import { getProviderDisplayName } from "../../../../../packages/cost/models/provider-helpers";
@@ -82,7 +82,69 @@ export class ModelRegistryController extends Controller {
8282
return slugMap[provider.toLowerCase()] || provider.toLowerCase();
8383
}
8484

85+
/**
86+
* Get all available models from the registry
87+
* @summary Returns a comprehensive list of all AI models with their configurations, pricing, and capabilities
88+
* @description This endpoint provides detailed information about all available models including:
89+
* - Model metadata (name, author, context length, training date)
90+
* - Supported providers and endpoints
91+
* - Pricing information (per million tokens for prompt/completion/special features)
92+
* - Input/output modalities (text, image, audio, video)
93+
* - Supported parameters (temperature, max_tokens, etc.)
94+
* - Available capabilities (audio, video, image, thinking, web_search, caching)
95+
*
96+
* No authentication required - this is a public endpoint.
97+
*
98+
* @returns {ModelRegistryResponse} Complete model registry with models and filter options
99+
*/
85100
@Get("/models")
101+
@Example<ModelRegistryResponse>({
102+
models: [
103+
{
104+
id: "claude-opus-4-1",
105+
name: "Anthropic: Claude Opus 4.1",
106+
author: "anthropic",
107+
contextLength: 200000,
108+
endpoints: [
109+
{
110+
provider: "anthropic",
111+
providerSlug: "anthropic",
112+
supportsPtb: true,
113+
pricing: {
114+
prompt: 15,
115+
completion: 75,
116+
cacheRead: 1.5,
117+
cacheWrite: 18.75,
118+
},
119+
},
120+
],
121+
maxOutput: 32000,
122+
trainingDate: "2025-08-05",
123+
description: "Most capable Claude model with extended context",
124+
inputModalities: ["text" as InputModality],
125+
outputModalities: ["text" as OutputModality],
126+
supportedParameters: [
127+
"max_tokens" as StandardParameter,
128+
"temperature" as StandardParameter,
129+
"stop" as StandardParameter,
130+
"reasoning" as StandardParameter,
131+
"include_reasoning" as StandardParameter,
132+
"tools" as StandardParameter,
133+
"tool_choice" as StandardParameter,
134+
],
135+
},
136+
],
137+
total: 150,
138+
filters: {
139+
providers: [
140+
{ name: "anthropic", displayName: "Anthropic" },
141+
{ name: "openai", displayName: "OpenAI" },
142+
{ name: "google", displayName: "Google" },
143+
],
144+
authors: ["anthropic", "openai", "google", "meta"],
145+
capabilities: ["audio", "image", "thinking", "caching", "reasoning"],
146+
},
147+
})
86148
public async getModelRegistry(): Promise<
87149
Result<ModelRegistryResponse, string>
88150
> {

0 commit comments

Comments
 (0)