Skip to content

Docs mismatch: chat.send examples omit required chatGenerationParams wrapper #195

@0xherve

Description

@0xherve

The documentation overview shows calling client.chat.send with it accepting an object: with types below:

model: string,
messages: [{
role: string,
content: string
}],
stream?: boolean
]

However, the SDK types require these to be nested under chatGenerationParams. This causes a TypeScript error when following the docs.

Steps to Reproduce

  1. Install @openrouter/sdk@0.9.11
  2. Use the docs-style call:
    • client.chat.send({ model, messages, stream })
  3. Observe TypeScript error:
    Object literal may only specify known properties, and 'model' does not exist in type 'SendChatCompletionRequestRequest'

Expected Behavior
The docs example should either wrap model/messages/stream under chatGenerationParams, or the SDK typings should be updated to accept top‑level model/messages/stream.

Actual Behavior
The SDK currently requires:

  • client.chat.send({ chatGenerationParams: { model, messages, stream } })

Environment

  • OS: WSL with Ubuntu
  • Runtime: Bun
  • Package: @openrouter/sdk@0.9.11
  • TypeScript: ^5

Metadata

Metadata

Assignees

No one assigned

    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