Skip to content

chore(deps): update dependency @openrouter/ai-sdk-provider to v2.2.5#375

Open
renovate[bot] wants to merge 1 commit intomainfrom
renovate/openrouter-ai-sdk-provider-2.x-lockfile
Open

chore(deps): update dependency @openrouter/ai-sdk-provider to v2.2.5#375
renovate[bot] wants to merge 1 commit intomainfrom
renovate/openrouter-ai-sdk-provider-2.x-lockfile

Conversation

@renovate
Copy link
Contributor

@renovate renovate bot commented Mar 3, 2026

This PR contains the following updates:

Package Change Age Confidence
@openrouter/ai-sdk-provider 2.0.22.2.5 age confidence

Release Notes

OpenRouterTeam/ai-sdk-provider (@​openrouter/ai-sdk-provider)

v2.2.5

Patch Changes
  • #​428 6e2ff61 Thanks @​robert-j-y! - Surface detailed error information from provider metadata in error messages

    When OpenRouter returns an error, the top-level error.message is often generic (e.g. "Provider returned error"). The actual error details from the upstream provider are in error.metadata.raw but were not being surfaced to users.

    Now extractErrorMessage recursively extracts meaningful error messages from metadata.raw (which can be a string, JSON string, or nested object) and includes the provider name when available. For example, instead of just "Provider returned error", users will now see "[Anthropic] Your credit balance is too low".

v2.2.4

Compare Source

Patch Changes
  • #​427 34b1c27 Thanks @​robert-j-y! - fix: preserve thinking block signature in streaming reasoning deltas

    Fixed two bugs causing Anthropic thinking block signatures to be lost during streaming:

    1. Signature-only deltas (containing a signature but no text) were silently dropped by the if (detail.text) guard in the reasoning delta handler. These deltas are now emitted with an empty string text, ensuring the signature propagates to downstream consumers.

    2. Per-delta providerMetadata.reasoning_details only contained the current chunk's details instead of an accumulated snapshot. This meant the signature (which arrives in a later delta) was never visible in earlier deltas' metadata. Now each reasoning delta carries a snapshot of all accumulated reasoning details.

    These fixes prevent "Invalid signature in thinking block" errors in multi-turn conversations with Anthropic models.

v2.2.3

Compare Source

Patch Changes
  • #​409 7b21d68 Thanks @​robert-j-y! - Compute missing token usage detail fields from available API data

    Previously, inputTokens.noCache, outputTokens.text, and inputTokens.cacheWrite were always undefined, even when the data to compute them was available in the API response. This caused downstream dashboards and analytics to receive misleading values.

    Now the provider computes these fields:

    • inputTokens.noCache = total - cacheRead (non-cached input tokens)
    • outputTokens.text = total - reasoning (text output tokens)
    • inputTokens.cacheWrite = passthrough from cache_write_tokens when available

    This applies to all code paths: chat doGenerate, chat doStream, completion doGenerate, and completion doStream.

v2.2.2

Compare Source

Patch Changes

v2.2.1

Compare Source

Patch Changes

v2.2.0

Minor Changes
  • #​399 ad0c2e1 Thanks @​robert-j-y! - Fix system message cache control to use block-level format

    When cache control is specified on a system message via providerOptions, the content is now converted to array format with cache_control on the text block, matching the existing behavior for user messages. This ensures consistent Anthropic prompt caching behavior across all message types.

    Before (message-level cache_control):

    {
      "role": "system",
      "content": "...",
      "cache_control": { "type": "ephemeral" }
    }

    After (block-level cache_control):

    {
      "role": "system",
      "content": [
        {
          "type": "text",
          "text": "...",
          "cache_control": { "type": "ephemeral" }
        }
      ]
    }

    Fixes #​389

v2.1.3

Patch Changes
  • #​398 50c932c Thanks @​robert-j-y! - Add support for reasoning effort values 'xhigh', 'minimal', and 'none' in the reasoning configuration type. Previously only 'high', 'medium', and 'low' were accepted.

v2.1.2

Patch Changes
  • #​395 23f02f1 Thanks @​robert-j-y! - fix: include accumulated reasoning_details with signature in reasoning-end stream event

    When streaming a text-only response (no tool calls) with reasoning enabled, the reasoning-end event now includes the accumulated reasoning_details (with signature) in providerMetadata. This fixes multi-turn conversation failures with Anthropic models where the signature was lost, causing "Invalid signature in thinking block" errors on subsequent turns.

v2.1.1

Compare Source

Patch Changes
  • #​365 363e232 Thanks @​robert-j-y! - fix: deduplicate reasoning_details across multi-turn conversations to prevent duplicate ID errors

v2.1.0

Compare Source

Minor Changes
  • #​366 f2b78f5 Thanks @​robert-j-y! - Add imageModel() method to OpenRouter provider for image generation support

    This adds the imageModel() method to the OpenRouter provider, enabling image generation through the AI SDK's generateImage() function. The implementation uses OpenRouter's chat completions endpoint with modalities: ['image', 'text'] to generate images.

    Features:

    • Implements ImageModelV3 interface from AI SDK
    • Supports aspectRatio parameter via image_config
    • Supports seed parameter for reproducible generation
    • Supports provider routing settings (order, allow_fallbacks, etc.)
    • Returns appropriate warnings for unsupported features (n > 1, size)
    • Throws UnsupportedFunctionalityError for image editing (files/mask parameters)

    Usage:

    import { createOpenRouter } from "@​openrouter/ai-sdk-provider";
    import { generateImage } from "ai";
    
    const openrouter = createOpenRouter();
    const { image } = await generateImage({
      model: openrouter.imageModel("google/gemini-2.5-flash-image"),
      prompt: "A cat wearing a hat",
      aspectRatio: "16:9",
    });
  • #​361 da10f19 Thanks @​robert-j-y! - Add support for the Response Healing plugin

    The Response Healing plugin automatically validates and repairs malformed JSON responses from AI models. Enable it by adding { id: 'response-healing' } to the plugins array when using structured outputs with generateObject.

    const model = openrouter("openai/gpt-4o", {
      plugins: [{ id: "response-healing" }],
    });
    
    const { object } = await generateObject({
      model,
      schema: z.object({ name: z.string(), age: z.number() }),
      prompt: "Generate a person.",
    });

    Note: Response Healing only works with non-streaming requests.

  • #​360 b129d36 Thanks @​robert-j-y! - Add includeRawChunks support for streaming

    When includeRawChunks: true is passed to streaming calls, the provider now emits { type: 'raw', rawValue: <parsed chunk> } stream parts for each SSE event, giving consumers access to the raw provider chunks alongside the processed AI SDK stream parts.

    This feature is available for both chat and completion models.

  • #​357 f24fac7 Thanks @​robert-j-y! - Remove dependency on @​openrouter/sdk

    This change removes the external dependency on @openrouter/sdk by inlining the necessary type definitions locally. The types are now defined in src/types/openrouter-api-types.ts.

    This reduces the package's dependency footprint and eliminates potential version conflicts with the SDK.

Patch Changes
  • #​359 85d6633 Thanks @​robert-j-y! - Fix undefined cost field in providerMetadata causing AI SDK validation failures

  • #​362 bd8794a Thanks @​robert-j-y! - fix: respect user-specified User-Agent headers without modification

    Previously, when users provided a custom User-Agent header via createOpenRouter({ headers: { 'User-Agent': 'my-app/1.0' } }), the SDK would append its identifier to the header, resulting in my-app/1.0, ai-sdk/openrouter/x.x.x. This was unexpected behavior.

    Now, user-specified User-Agent headers are used verbatim without modification. The SDK identifier is only added as the default when no User-Agent header is provided.

    This also fixes a case-sensitivity bug where User-Agent (capitalized) was not recognized as the same header as user-agent (lowercase), causing duplicate headers to be sent.

    Fixes #​300

  • #​363 f2d5034 Thanks @​robert-j-y! - Populate usage.raw with OpenRouter raw usage accounting object in finish step

  • #​364 c6ae94d Thanks @​robert-j-y! - Fix missing web search citations by making url_citation schema fields optional

v2.0.4

Patch Changes
  • #​352 d76d566 Thanks @​robert-j-y! - fix: handle tool calls with missing arguments field (#​287)

    Made the arguments field optional in the tool_calls schema and default to '{}' (empty JSON object) when missing. This handles cases where upstream providers may omit the arguments field for tools with no parameters.


Configuration

📅 Schedule: Branch creation - "after 01:00 and before 07:00 every weekday" in timezone Europe/London, Automerge - At any time (no schedule defined).

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • If you want to rebase/retry this PR, check this box

This PR was generated by Mend Renovate. View the repository job log.

@renovate renovate bot added the dependencies label Mar 3, 2026
@github-actions github-actions bot added the size/XS Extra small PR: < 100 lines changed label Mar 3, 2026
@renovate renovate bot force-pushed the renovate/openrouter-ai-sdk-provider-2.x-lockfile branch from f534647 to a68c331 Compare March 5, 2026 14:59
@github-actions github-actions bot added size/XS Extra small PR: < 100 lines changed and removed size/XS Extra small PR: < 100 lines changed labels Mar 5, 2026
@renovate renovate bot force-pushed the renovate/openrouter-ai-sdk-provider-2.x-lockfile branch from a68c331 to 8f2836c Compare March 6, 2026 17:55
@github-actions github-actions bot added size/XS Extra small PR: < 100 lines changed and removed size/XS Extra small PR: < 100 lines changed labels Mar 6, 2026
@renovate renovate bot force-pushed the renovate/openrouter-ai-sdk-provider-2.x-lockfile branch from 8f2836c to 8a1aba4 Compare March 6, 2026 17:59
@github-actions github-actions bot added size/XS Extra small PR: < 100 lines changed and removed size/XS Extra small PR: < 100 lines changed labels Mar 6, 2026
@renovate renovate bot changed the title chore(deps): update dependency @openrouter/ai-sdk-provider to v2.2.3 chore(deps): update dependency @openrouter/ai-sdk-provider to v2.2.5 Mar 7, 2026
@renovate renovate bot force-pushed the renovate/openrouter-ai-sdk-provider-2.x-lockfile branch from 8a1aba4 to a8d9561 Compare March 7, 2026 08:51
@github-actions github-actions bot added size/XS Extra small PR: < 100 lines changed and removed size/XS Extra small PR: < 100 lines changed labels Mar 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies size/XS Extra small PR: < 100 lines changed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants