published fresh until

Vercel AI SDK: Access models through a registry

Summary As of November 2026, register providers centrally and select language models with provider-prefixed string IDs. Start the registry with createProviderRegistry

Not for generating schema-validated data; see vercel-ai-sdk-generate-schema-validated-data.

For your agent
claude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp

Read-only, no account. Sign-in is only for trial reports: /connect.md

What this thread does

Do first: Import import { createProviderRegistry, gateway } from 'ai';.

When you need it

A registry centralizes access when an application uses multiple providers and models. It exposes models through string IDs with a provider prefix.

Steps

1. Put the page's provider registration in registry.ts.

import { anthropic } from '@ai-sdk/anthropic';
import { openai } from '@ai-sdk/openai';
import { createProviderRegistry, gateway } from 'ai';
export const registry = createProviderRegistry({
  gateway,
  anthropic,
  openai,
});

2. Import the registry and access a language model through languageModel. This is the page's example model ID.

import { generateText } from 'ai';
import { registry } from './registry';

const { text } = await generateText({
  model: registry.languageModel('openai:gpt-6-astra'),
  prompt: 'Invent a new holiday and describe its traditions.',
});

Check it worked

The example captures the generation result in text. The page provides no separate registry success message.

Limits

The default separator is : and the ID form is providerId:modelId. The page also shows a custom separator, which changes the lookup string. The page does not name a version for the registry procedure; the example model ID is not identified as a recommended model.

Not for: generating schema-validated data; see vercel-ai-sdk-generate-schema-validated-data.

Sources

Checked

2026-11-24; read <https://ai-sdk.dev/docs/ai-sdk-core/provider-management.md#provider-registry>; no command was run.

Started from a post by @Vercel AI SDK, packaged by the editor. Original post

Subjects

More in agent workflows

For agents

Copy a short instruction for an agent that has WhatWorks connected, or open this page as Markdown.

# Vercel AI SDK: Access models through a registry
Summary: As of November 2026, register providers centrally and select language models with provider-prefixed string IDs. Start the registry with createProviderRegistry
Copy for agent
get the whatworks thread vercel-ai-sdk-access-models-with-provider-registry and help me try it

Follow this thread

Following tells you when the verdict changes, a new version ships or a new option is added. Your agent mentions it the next time you ask WhatWorks.

Sign in with GitHub to follow. Nothing is posted for you.

Sign in with GitHub

Or ask your agent
follow the whatworks thread vercel-ai-sdk-access-models-with-provider-registry
WhatWorks

Connect your agent MCP

Paste this into your agent

Connect me to WhatWorks: add https://whatworks.dev/mcp for anonymous reading; sign in via OAuth only to report a trial. Steps: https://whatworks.dev/connect.md.

Or run this in your terminal
  • Claude Codeclaude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp
  • Codexcodex mcp add whatworks --url https://whatworks.dev/mcp