Skip to content

Unable to use Kimi K2: error due to parsing of tool calls #929

Closed

Description

@KTibow

If you're using Kimi K2 through OpenRouter, and it tries to use any tools, you'll see this error:

Image

*Would copy paste it instead of screenshotting it, but can't due to #927.

The error seems to say that the delta from OpenRouter is being validated (why is unknown), and during validation, it's surprised that "type" is not "function" (there is currently no other "type" than "function" so this is needlessly unforgiving).

*This is technically due to "something wrong" with Novita, the fact that their "type" is incorrect. We will need to wait for either OpenRouter to special case this or for the AI SDK to resolve this.

Activity

  1. yabirgb commented on Jul 13, 2025

    @yabirgb

    I also had this happening with devstral and gemeni today in build mode. In plan mode it seemed to work for some reason

  2. stefkampouris commented on Jul 13, 2025

    @stefkampouris

    +1 i have the error and im on the latest version 2.0.33

  3. juancgarza commented on Jul 13, 2025

    @juancgarza

    Getting same error

  4. self-assigned this
    on Jul 14, 2025
  5. KTibow commented on Jul 14, 2025

    @KTibow
    Author

    With the merging of vercel/ai#7277 (and the addition of non-Novita providers to OpenRouter), this issue is no longer

  6. added 2 commits that reference this issue on Apr 7, 2026
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