Conversation
Typesafe documents GET /v1/models, and both official SDKs expose it. This client had no way to reach it, so the only way to find out which names the `model` field takes was to read the docs and hardcode one -- and an alias moves when a release ships, which is the thing a list is for. Client#models returns ModelCards: name, description, release_date. A provider says whether it has a list at all by declaring models_path, and OpenRouter does not -- its /models is the whole gateway catalogue under a different base than the alpha decisions endpoint, so it raises rather than composing a URL that means something else. This is the first request that is not a POST, so the transport contract grows an optional `method:` keyword alongside the existing three. A transport that does not declare it keeps being called exactly as before, and asking it to list models raises ConfigurationError rather than quietly POSTing to the list endpoint. Listing goes through the same retry loop and the same error classes as asking does. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Typesafe documents
GET /v1/models, and both official SDKs expose it. This client had no way to reach it, so the only way to find out which names themodelfield takes was to read the docs and hardcode one — and an alias moves when a release ships, which is the thing a list is for.ModelCardisname,description,release_date. A provider says whether it has a list at all by declaringmodels_path, and OpenRouter does not — its/modelsis the whole gateway catalogue underapi/v1, a different base than theapi/alphadecisions endpoint, so it raisesConfigurationErrorrather than composing a URL that means something else.This is the first request that isn't a POST, so the transport contract grows an optional
method:keyword alongside the existing three. A transport that doesn't declare it keeps being called exactly as before, and asking it to list models raises rather than quietly POSTing to the list endpoint.Listing goes through the same retry loop and the same error classes as asking.
Tests
test/models_test.rb, 14 cases.Draft: part of a security and API-coverage audit, opened for reference rather than as a request for immediate review. Independent of the other branches, each off
main. Suite green on Ruby 3.2.11, 3.3.8 and 3.4.8.🤖 Generated with Claude Code