Skip to content

V2 runner has no native route for @ai-sdk/xai models, dropping prompt cache key #35034

Closed as not planned

Description

@BrianHung

The V2 session runner sets a prompt cache key on every request (packages/core/src/session/runner/llm.ts) and the OpenAI Responses protocol lowers it to prompt_cache_key. But SessionRunnerModel.fromCatalogModel has no branch for @ai-sdk/xai, so xai catalog models fail with UnsupportedApiError and never run through the native route that carries the key.

Related context: xAI's prompt caching relies on prompt_cache_key for the Responses API (https://docs.x.ai/developers/advanced-api-usage/prompt-caching/maximizing-cache-hits), and xAI's Responses API follows the OpenAI shape, so the existing OpenAIResponses route can serve these models.

One wrinkle: the OpenAIResponses route's default baseURL points at api.openai.com, so xai models without an explicit catalog URL need an explicit default of https://api.x.ai/v1.

Activity

  1. github-actions commented on Jul 2, 2026

    @github-actions
    Contributor

    This issue doesn't fully meet our contributing guidelines.

    What needs to be fixed:

    • No issue template was used. Please use one of the three templates: Bug Report, Feature Request, or Question. Bug reports require a Description field with reproduction steps and context.

    Please edit this issue to address the above within 2 hours, or it will be automatically closed.


    This issue may overlap with a recently filed issue. Please check:

    If you believe this was flagged incorrectly, please let a maintainer know.

  2. github-actions commented on Jul 3, 2026

    @github-actions
    Contributor

    This issue has been automatically closed because it was not updated to meet our contributing guidelines within the 2-hour window.

    Feel free to open a new issue that follows our issue templates.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions