Skip to content

Commit 6f5c2da

Browse files
committed
fix(scripts): migrate to catalog models endpoint
- Read tool support from nested endpoint object - Replace removed frontend models URL with catalog endpoint
1 parent 05b7071 commit 6f5c2da

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

scripts/openrouter.sh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import urllib.request
1313
1414
readmeFile = sys.argv[1]
1515
updateTime = sys.argv[2]
16-
apiUrl = 'https://openrouter.ai/api/frontend/models'
16+
apiUrl = 'https://openrouter.ai/api/frontend/v1/catalog/models'
1717
1818
with urllib.request.urlopen(apiUrl, timeout=30) as httpResponse:
1919
apiData = json.loads(httpResponse.read().decode())
@@ -42,7 +42,8 @@ for modelData in modelList:
4242
capList.append('video-gen')
4343
if modelData.get('supports_reasoning', False):
4444
capList.append('reasoning')
45-
if modelData.get('supports_tool_parameters', False):
45+
modelEndpoint = modelData.get('endpoint') or {}
46+
if modelEndpoint.get('supports_tool_parameters', False):
4647
capList.append('tools')
4748
if contextLength:
4849
sizeText = f'{contextLength:,} tokens'

0 commit comments

Comments
 (0)