Packages

@ai-sdk/provider

4.0.39 · 17 Nov 2026Apache-2.0107.4M / weekRepositoryHomepagenpmAtom feed

Your version

2.0.0

major31 Jul 2025Where it was published

2.0.5 is the newest release of 2.x.

In short

33 breaking10 new22 fixed5 internal

  • Breaking

    Forward id, streaming start, streaming end of content blocks

  • Breaking

    Refactoring (provider): collapse provider defined tools into single definition

  • Breaking

    Feat (provider): support changing provider, model, supportedUrls in middleware

  • Breaking

    Feat (provider): add name for provider defined tools for future validation

  • Breaking

    Restructure language model supported urls

  • Breaking

    Chore (provider): cleanup request and rawRequest (language model v2)

  • Breaking

    Chore (provider): merge rawRequest into request (language model v2)

  • Breaking

    Chore (provider,ai): tools have input/output instead of args,result

Release note

Major Changes

  • Breaking

    Forward id, streaming start, streaming end of content blocks

  • Breaking

    Refactoring (provider): collapse provider defined tools into single definition

  • Breaking

    Feat (provider): support changing provider, model, supportedUrls in middleware

  • Breaking

    Feat (provider): add name for provider defined tools for future validation

  • Breaking

    Restructure language model supported urls

  • Breaking

    Chore (provider): cleanup request and rawRequest (language model v2)

  • Breaking

    Chore (provider): merge rawRequest into request (language model v2)

  • Breaking

    Chore (provider,ai): tools have input/output instead of args,result

  • Breaking

    AI SDK 5

  • Breaking

    Move warnings into stream-start part (spec)

  • Breaking

    Chore (provider): refactor usage (language model v2)

  • Breaking

    Rename mimeType to mediaType

  • Breaking

    Refactor file towards source pattern (spec)

  • Breaking

    Remove logprobs

  • Breaking

    Chore (ai): remove v1 providers

  • Breaking

    Refactor reasoning parts (spec)

  • Breaking

    Restructure reasoning support

  • Breaking

    Upgrade speech models to v2 specification

  • Breaking

    Refactor source parts (spec)

  • Breaking

    Refactor tool call and tool call delta parts (spec)

  • Breaking

    Refactor text parts (spec)

  • Breaking

    Chore (provider): remove image parts

  • Breaking

    Refactor file parts (spec)

  • Breaking

    Feat (provider): support reasoning tokens, cached input tokens, total token in usage information

  • Breaking

    Upgrade transcription models to v2 specification

  • Breaking

    Remove object generation mode

  • Breaking

    Feat (provider): support arbitrary media types in tool results

  • Breaking

    Chore (provider): remove prompt type from language model v2 spec

  • Breaking

    Refactoring (provider): restructure tool result output

  • Breaking

    Chore (provider): remove mode

  • Breaking

    Return content array from doGenerate (spec)

  • Breaking

    Rename maxTokens to maxOutputTokens

  • Breaking

    Chore (provider): rename providerMetadata inputs to providerOptions

Patch Changes

  • Release alpha.4

  • Update to LanguageModelV2ProviderDefinedClientTool to add server side tool later on

  • Release alpha.15

  • Chore (provider): tweak provider definition

  • Release alpha.8

  • Add raw chunk support

  • Chore (provider): change getSupportedUrls to supportedUrls (language model v2)

  • Add transcription with experimental_transcribe

  • embedding-model-v2: Add response body field

  • embed-many: Respect supportsParallelCalls & concurrency

  • anthropic: Add server-side web search support

  • Spec (ai): add provider options to tools

  • Refactor (image-model): rename ImageModelV1 to ImageModelV2

  • Core (ai): change transcription model mimeType to mediaType

  • Chore (provider): extract shared provider options and metadata (spec)

  • Chore (provider): extract LanguageModelV2File

  • Add speech with experimental_generateSpeech

  • Add transcription and speech model support to provider registry

  • Chore (provider): allow both binary and base64 file content (spec)

    Before

    import { convertUint8ArrayToBase64 } from '@ai-sdk/provider-utils';
    
    // Had to manually convert binary data to base64
    const fileData = new Uint8Array([0, 1, 2, 3]);
    const filePart = {
      type: 'file',
      mediaType: 'application/pdf',
      data: convertUint8ArrayToBase64(fileData), // Required conversion
    };

    After

    // Can use binary data directly
    const fileData = new Uint8Array([0, 1, 2, 3]);
    const filePart = {
      type: 'file',
      mediaType: 'application/pdf',
      data: fileData, // Direct Uint8Array support
    };
  • Release alpha.13

  • Release alpha.3

  • ImageModelV2#maxImagesPerCall can be set to a function that returns a number or undefined, optionally as a promise

    pull request: #6343

  • Feat (provider): add providerMetadata to ImageModelV2 interface

    The experimental_generateImage method from the ai package now returnes revised prompts for OpenAI's image models.

    const prompt = 'Santa Claus driving a Cadillac';
    
    const { providerMetadata } = await experimental_generateImage({
      model: openai.image('dall-e-3'),
      prompt,
    });
    
    const revisedPrompt = providerMetadata.openai.images[0]?.revisedPrompt;
    
    console.log({
      prompt,
      revisedPrompt,
    });
  • Release alpha.7

  • Release alpha.2

  • embedding-model-v2: Add providerOptions

  • Remove Experimental_LanguageModelV2Middleware type

  • Release alpha.11

  • Release alpha.9

  • tool-calling: Don't require the user to have to pass parameters

  • Feat (provider/gateway): Add providerMetadata to embeddings response

  • Release alpha.10

A whole project to check? Paste its package.json in the dependency check: every deprecated, outdated or vulnerable dependency, with what to upgrade to. Free, no account.