Last active
November 10, 2025 08:32
-
-
Save FranciscoMoretti/1acde9cef32c5addd9ae38cb93571d5a to your computer and use it in GitHub Desktop.
ai-registry: vercel-gateway demo-static-dynamic-models.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const models = [ | |
| { | |
| id: 'openai/gpt-5', | |
| provider: 'openai', | |
| }, | |
| { | |
| id: 'openai/gpt-4o', | |
| provider: 'openai', | |
| }, | |
| { | |
| id: 'openai/gpt-4o-mini', | |
| provider: 'openai', | |
| },{ | |
| id: "anthropic/claude-3-5-sonnet", | |
| provider: 'anthropic', | |
| } | |
| ] as const | |
| type ModelId = (typeof models)[number]['id'] | |
| type ProviderId = (typeof models)[number]['provider'] | |
| const fetchedPrices: Record<ModelId, number> = { | |
| 'openai/gpt-5': 0.00000125, | |
| 'openai/gpt-4o': 0.0000015, | |
| 'openai/gpt-4o-mini': 0.0000015, | |
| 'anthropic/claude-3-5-sonnet': 0.000003, | |
| } | |
| const newAll = models.map((model) => { | |
| const modelId = model.id | |
| return { | |
| ...model, | |
| price: fetchedPrices[modelId], | |
| } | |
| }) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment