Packages

@tanstack/ai-openrouter

1.0.0 · 22 Oct 2026MIT69.2k / weekRepositoryHomepagenpmAtom feed

Latest releases

All 98 releases
  1. 1.x · latest line
  2. 1.0.0

    22 Oct 2026
    • breaking

      TanStack AI 1.0.0. This release removes every API that was deprecated in 0.x. Read the upgrade guide before you upgrade: tanstack.com/ai/latest/docs/migration/v1

    • The TypeSafe, Ollaya, OpenRouter and Vercel Gateway evaluate adapters now set status on the error they throw for an error response. status is the HTTP status code, so you can tell a rate limit (429) from a bad key (401) without parsing the message. The message does not change.

      if (error instanceof Error && 'status' in error && error.status === 429) {
        // wait, then call decide() again
      }
    • Update model metadata from OpenRouter API

  3. 0.23.x · maintenance
  4. 0.23.1

    21 Oct 2026

    Only updates a dependency:@tanstack/ai 0.71.0

  5. 0.23.0

    19 Oct 2026
    • Structured output sends response_format: { type: "json_object" } for OpenRouter and Groq models that declare a response format without strict structured outputs. These models reject strict json_schema. In JSON mode the adapter adds the schema as a system prompt. await chat({ outputSchema }) checks the reply when the schema is a Standard Schema, such as Zod. Other models keep strict json_schema.

      modelOptions can set json_object for any model. On the OpenAI-base adapters (OpenAI, Grok, Groq and others), a json_object in modelOptions was replaced by strict json_schema. It is now sent as given, with the schema in a system prompt. In JSON mode, supportsCombinedToolsAndSchema() returns false. Tools and the schema then go out in separate requests, so the tool-calling turns do not get the schema prompt.

      OpenRouter catalog ids with a :variant, such as google/gemma-4-26b-a4b-it:free, now match their own catalog entry. Before, only the id without the variant was checked.

    • Keep the provider's raw tool argument string for replay.

  6. 0.22.x · maintenance
  7. 0.22.0

    13 Oct 2026
    • Text adapters now set one stable code on RUN_ERROR when the input does not fit in the model's context window: code: 'context_overflow'. @tanstack/ai exports it as CONTEXT_OVERFLOW_CODE. The provider's own text stays in message.

      if (chunk.type === 'RUN_ERROR' && chunk.code === CONTEXT_OVERFLOW_CODE) {
        // shorten the messages, then call chat() again
      }

      These adapters set it: OpenAI and the other OpenAI-compatible adapters (from code: 'context_length_exceeded'), Anthropic, Gemini, Bedrock (Converse, Chat Completions, and Responses), OpenRouter, Grok, Cloudflare Workers AI, and BytePlus.

      Changes to code that reads the old values:

    • Add openrouterSignIn() at @tanstack/ai-openrouter/pkce: a local app, such as a CLI, signs the user in to OpenRouter in the browser and gets an API key, with no key to copy.

    • Prompt caching is now on by default. Each chat() call asks the provider to cache the stable start of the request (system prompt, tools, and earlier messages), so repeated requests cost less and answer sooner.

  8. 0.21.x · maintenance
  9. 0.21.5

    9 Oct 2026

    Only updates a dependency:@tanstack/ai 0.68.0

Dependency tracking · free for 3 projects

Know when your own dependencies move

@tanstack/ai-openrouter shipped a new major in the last 12 months, among 98 releases. Inlinr shows which of your projects are behind, and what the upgrade breaks.

  • Advisories reach you

    An email when a critical or high advisory affects a project, before the next install.

  • Upgrades checked first

    Peer ranges, Node, ESM-only and types changes read before you bump.

  • Only what matters

    Majors and breaking notes stay; patches and sibling bumps fold into one line.

How dependency tracking works

Registry facts last checked 22 Oct 2026. Releases and advisories last read 23 Oct 2026.