Skip to content

Conversation

@SplittyDev
Copy link
Contributor

What

This PR makes the /models endpoint work with OpenRouter.

Why

Unlike OpenAI, OpenRouter doesn't use the object and owned_by fields.

I've chosen to use reasonable defaults for object (i.e. list in ModelsResult and model in ModelResult), and an empty string for owned_by, since I don't think there's a better default for that one.

The ModelsResult and ModelResult structs themselves aren't changed, and this PR makes use of the existing parsingOptions mechanism to supply the default values.

Affected Areas

  • Decoding of ModelsResult and ModelResult, if relaxed parsing options are specified
  • No breaking changes

@SplittyDev SplittyDev force-pushed the upstream/openrouter-list-models branch from e97d121 to 4ca0591 Compare June 25, 2025 06:56
Copy link
Contributor

@nezhyborets nezhyborets left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great, thanks!

@nezhyborets nezhyborets merged commit cedec2f into MacPaw:main Jun 26, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants