Skip to content

OpenRouter provider doesn't respect baseurl when fetching generation details & when getting models #1571

@mikoskinen

Description

@mikoskinen

Which version of the app are you using?

3.8.4

Which API Provider are you using?

OpenRouter

Which Model are you using?

Claude 3.7. Sonnet

What happened?

The OpenRouter provider supports custom base url. But when fetching generation details, it doesn't respect this but instead the address is hard coded: https://openrouter.ai/api/v1/generation?id=${genId}

https://github.com/RooVetGit/Roo-Code/blob/ff54c63ffa567408ab42620bd564d35cae90ad9d/src/api/providers/openrouter.ts#L165

Same issue with getting models:

	const response = await axios.get("https://openrouter.ai/api/v1/models")

Is it possible to change this so that base address is respected when fetching generation details and models? This is useful in situations where a Openrouter proxy is used.

Steps to reproduce

  1. Create a proxy that forwards requests to Openrouter
  2. Ask something from Roo code
  3. See it bypass the proxy and talk directly to Openrouter.

Relevant API REQUEST output

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions