Skip to content

Commit ea1af8e

Browse files
committed
Merge remote-tracking branch 'origin/main' into mattapperson/feat/getResponse
2 parents 8c60b77 + 0694ef8 commit ea1af8e

File tree

334 files changed

+3387
-23775
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

334 files changed

+3387
-23775
lines changed

.github/actions/validate-sdk/action.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ runs:
3535
- name: Typecheck examples root
3636
shell: bash
3737
working-directory: examples
38-
run: npx tsc --noEmit
38+
run: npx tsc --noEmit --skipLibCheck --esModuleInterop --moduleResolution node --module esnext --target es2020 *.ts
3939

4040
- name: Install nextjs-example dependencies
4141
shell: bash
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: Notify Monorepo of Changes
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
jobs:
9+
notify-monorepo:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Send repository dispatch to monorepo
13+
run: |
14+
# Determine which event type to send based on repository name
15+
REPO_NAME="${GITHUB_REPOSITORY#*/}" # Gets 'typescript-sdk' from 'OpenRouterTeam/typescript-sdk'
16+
17+
case "$REPO_NAME" in
18+
"typescript-sdk")
19+
EVENT_TYPE="sync-typescript-sdk"
20+
;;
21+
"python-sdk")
22+
EVENT_TYPE="sync-python-sdk"
23+
;;
24+
"ai-sdk-provider")
25+
EVENT_TYPE="sync-ai-sdk-provider"
26+
;;
27+
"cli")
28+
EVENT_TYPE="sync-cli"
29+
;;
30+
*)
31+
echo "Unknown repository: $REPO_NAME"
32+
exit 1
33+
;;
34+
esac
35+
36+
echo "Sending repository_dispatch event: $EVENT_TYPE"
37+
38+
curl -L \
39+
-X POST \
40+
-H "Accept: application/vnd.github+json" \
41+
-H "Authorization: Bearer ${{ secrets.MONOREPO_SYNC_TOKEN }}" \
42+
-H "X-GitHub-Api-Version: 2022-11-28" \
43+
https://api.github.com/repos/OpenRouterTeam/openrouter-web/dispatches \
44+
-d "{\"event_type\":\"$EVENT_TYPE\",\"client_payload\":{\"repository\":\"$GITHUB_REPOSITORY\",\"ref\":\"$GITHUB_REF\",\"sha\":\"$GITHUB_SHA\"}}"
45+
46+
echo "✅ Notification sent to monorepo"
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: Recreate Staging Branch
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
permissions:
9+
contents: write
10+
11+
jobs:
12+
recreate-staging:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: Checkout repository
16+
uses: actions/checkout@v4
17+
with:
18+
fetch-depth: 0
19+
token: ${{ secrets.GITHUB_TOKEN }}
20+
21+
- name: Check if staging branch exists
22+
id: check-staging
23+
run: |
24+
if git ls-remote --heads origin staging | grep -q staging; then
25+
echo "exists=true" >> $GITHUB_OUTPUT
26+
else
27+
echo "exists=false" >> $GITHUB_OUTPUT
28+
fi
29+
30+
- name: Recreate staging branch
31+
if: steps.check-staging.outputs.exists == 'false'
32+
run: |
33+
git config user.name "github-actions[bot]"
34+
git config user.email "github-actions[bot]@users.noreply.github.com"
35+
git checkout -b staging
36+
git push origin staging

.speakeasy/gen.lock

Lines changed: 50 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
lockVersion: 2.0.0
22
id: 8b6cd71c-ea04-44da-af45-e43968b5928d
33
management:
4-
docChecksum: 21d34ad219f16d5944497a609bd0c936
4+
docChecksum: bcccd1abd05f6654a822386f2eefbd8a
55
docVersion: 1.0.0
6-
speakeasyVersion: 1.649.0
7-
generationVersion: 2.739.1
8-
releaseVersion: 0.1.1
9-
configChecksum: c28c46b34a103eebef5cf4e55b42c8b7
6+
speakeasyVersion: 1.659.0
7+
generationVersion: 2.755.9
8+
releaseVersion: 0.1.18
9+
configChecksum: ad5a220c1110e01ccea49eed2d7bb48c
1010
repoURL: https://github.com/OpenRouterTeam/typescript-sdk.git
1111
installationURL: https://github.com/OpenRouterTeam/typescript-sdk
1212
published: true
@@ -15,7 +15,7 @@ features:
1515
acceptHeaders: 2.81.2
1616
additionalDependencies: 0.1.0
1717
constsAndDefaults: 0.1.12
18-
core: 3.26.0
18+
core: 3.26.7
1919
customCodeRegions: 0.1.0
2020
defaultEnabledRetries: 0.1.0
2121
deprecations: 2.81.1
@@ -26,13 +26,13 @@ features:
2626
globalSecurityCallbacks: 0.1.0
2727
globalSecurityFlattening: 0.1.0
2828
globalServerURLs: 2.83.0
29+
globals: 2.82.2
2930
groups: 2.81.3
3031
methodArguments: 0.1.2
3132
methodSecurity: 2.82.6
3233
nameOverrides: 2.81.2
3334
nullables: 0.1.1
3435
openEnums: 0.1.1
35-
reactQueryHooks: 0.2.3
3636
responseFormat: 0.2.3
3737
retries: 2.83.0
3838
sdkHooks: 0.3.0
@@ -46,7 +46,6 @@ generatedFiles:
4646
- .devcontainer/setup.sh
4747
- .gitattributes
4848
- FUNCTIONS.md
49-
- REACT_QUERY.md
5049
- RUNTIMES.md
5150
- USAGE.md
5251
- docs/lib/utils/retryconfig.md
@@ -70,9 +69,14 @@ generatedFiles:
7069
- docs/models/chatmessagecontentitemaudio.md
7170
- docs/models/chatmessagecontentitemaudioformat.md
7271
- docs/models/chatmessagecontentitemaudioinputaudio.md
72+
- docs/models/chatmessagecontentitemfile.md
7373
- docs/models/chatmessagecontentitemimage.md
7474
- docs/models/chatmessagecontentitemimagedetail.md
7575
- docs/models/chatmessagecontentitemtext.md
76+
- docs/models/chatmessagecontentitemvideo.md
77+
- docs/models/chatmessagecontentitemvideoinputvideo.md
78+
- docs/models/chatmessagecontentitemvideovideourl.md
79+
- docs/models/chatmessagecontentitemvideovideourlvideourl.md
7680
- docs/models/chatmessagetokenlogprob.md
7781
- docs/models/chatmessagetokenlogprobs.md
7882
- docs/models/chatmessagetoolcall.md
@@ -125,11 +129,11 @@ generatedFiles:
125129
- docs/models/errors/toomanyrequestsresponseerror.md
126130
- docs/models/errors/unauthorizedresponseerror.md
127131
- docs/models/errors/unprocessableentityresponseerror.md
128-
- docs/models/experimental.md
129132
- docs/models/filecitation.md
130133
- docs/models/filecitationtype.md
131134
- docs/models/filepath.md
132135
- docs/models/filepathtype.md
136+
- docs/models/filet.md
133137
- docs/models/forbiddenresponseerrordata.md
134138
- docs/models/idfileparser.md
135139
- docs/models/idmoderation.md
@@ -294,6 +298,9 @@ generatedFiles:
294298
- docs/models/openresponseswebsearchtooltype.md
295299
- docs/models/operations/apitype.md
296300
- docs/models/operations/calldata.md
301+
- docs/models/operations/content.md
302+
- docs/models/operations/contentimageurl.md
303+
- docs/models/operations/contenttext.md
297304
- docs/models/operations/createauthkeyscodecodechallengemethod.md
298305
- docs/models/operations/createauthkeyscodedata.md
299306
- docs/models/operations/createauthkeyscoderequest.md
@@ -312,17 +319,13 @@ generatedFiles:
312319
- docs/models/operations/createkeysresponse.md
313320
- docs/models/operations/createresponsesresponse.md
314321
- docs/models/operations/createresponsesresponsebody.md
315-
- docs/models/operations/datacollection.md
316322
- docs/models/operations/deletekeysrequest.md
317323
- docs/models/operations/deletekeysresponse.md
318324
- docs/models/operations/embedding.md
319325
- docs/models/operations/encodingformat.md
320-
- docs/models/operations/encodingformatbase64.md
321-
- docs/models/operations/encodingformatfloat.md
322326
- docs/models/operations/exchangeauthcodeforapikeycodechallengemethod.md
323327
- docs/models/operations/exchangeauthcodeforapikeyrequest.md
324328
- docs/models/operations/exchangeauthcodeforapikeyresponse.md
325-
- docs/models/operations/experimental.md
326329
- docs/models/operations/getcreditsresponse.md
327330
- docs/models/operations/getcurrentkeydata.md
328331
- docs/models/operations/getcurrentkeyresponse.md
@@ -341,7 +344,9 @@ generatedFiles:
341344
- docs/models/operations/getuseractivityrequest.md
342345
- docs/models/operations/getuseractivityresponse.md
343346
- docs/models/operations/ignore.md
347+
- docs/models/operations/imageurl.md
344348
- docs/models/operations/input.md
349+
- docs/models/operations/inputunion.md
345350
- docs/models/operations/listdata.md
346351
- docs/models/operations/listendpointsrequest.md
347352
- docs/models/operations/listendpointsresponse.md
@@ -359,9 +364,10 @@ generatedFiles:
359364
- docs/models/operations/order.md
360365
- docs/models/operations/ratelimit.md
361366
- docs/models/operations/sendchatcompletionrequestresponse.md
362-
- docs/models/operations/sort.md
363367
- docs/models/operations/supportedparameter.md
364368
- docs/models/operations/transferintent.md
369+
- docs/models/operations/typeimageurl.md
370+
- docs/models/operations/typetext.md
365371
- docs/models/operations/updatekeysdata.md
366372
- docs/models/operations/updatekeyslimitreset.md
367373
- docs/models/operations/updatekeysrequest.md
@@ -400,6 +406,7 @@ generatedFiles:
400406
- docs/models/provider.md
401407
- docs/models/providername.md
402408
- docs/models/provideroverloadedresponseerrordata.md
409+
- docs/models/providersort.md
403410
- docs/models/publicendpoint.md
404411
- docs/models/publicendpointquantization.md
405412
- docs/models/publicpricing.md
@@ -470,14 +477,13 @@ generatedFiles:
470477
- docs/models/security.md
471478
- docs/models/servicetier.md
472479
- docs/models/serviceunavailableresponseerrordata.md
473-
- docs/models/sort.md
474480
- docs/models/streamoptions.md
475481
- docs/models/systemmessage.md
476482
- docs/models/systemmessagecontent.md
477483
- docs/models/tokenizer.md
478-
- docs/models/tool.md
479484
- docs/models/toolcallstatus.md
480-
- docs/models/toolfunction.md
485+
- docs/models/tooldefinitionjson.md
486+
- docs/models/tooldefinitionjsonfunction.md
481487
- docs/models/toolresponsemessage.md
482488
- docs/models/toolresponsemessagecontent.md
483489
- docs/models/toomanyrequestsresponseerrordata.md
@@ -509,6 +515,7 @@ generatedFiles:
509515
- docs/models/usermessage.md
510516
- docs/models/usermessagecontent.md
511517
- docs/models/variables.md
518+
- docs/models/videourl.md
512519
- docs/models/websearchpreviewtooluserlocation.md
513520
- docs/models/websearchpreviewtooluserlocationtype.md
514521
- docs/models/websearchstatus.md
@@ -546,6 +553,7 @@ generatedFiles:
546553
- src/funcs/creditsCreateCoinbaseCharge.ts
547554
- src/funcs/creditsGetCredits.ts
548555
- src/funcs/embeddingsGenerate.ts
556+
- src/funcs/embeddingsListModels.ts
549557
- src/funcs/endpointsList.ts
550558
- src/funcs/endpointsListZdrEndpoints.ts
551559
- src/funcs/generationsGetGeneration.ts
@@ -581,20 +589,20 @@ generatedFiles:
581589
- src/models/assistantmessage.ts
582590
- src/models/badgatewayresponseerrordata.ts
583591
- src/models/badrequestresponseerrordata.ts
584-
- src/models/chatcompletionfinishreason.ts
585592
- src/models/chaterror.ts
586593
- src/models/chatgenerationparams.ts
587594
- src/models/chatgenerationtokenusage.ts
588595
- src/models/chatmessagecontentitem.ts
589596
- src/models/chatmessagecontentitemaudio.ts
597+
- src/models/chatmessagecontentitemfile.ts
590598
- src/models/chatmessagecontentitemimage.ts
591599
- src/models/chatmessagecontentitemtext.ts
600+
- src/models/chatmessagecontentitemvideo.ts
592601
- src/models/chatmessagetokenlogprob.ts
593602
- src/models/chatmessagetokenlogprobs.ts
594603
- src/models/chatmessagetoolcall.ts
595604
- src/models/chatresponse.ts
596605
- src/models/chatresponsechoice.ts
597-
- src/models/chatstreamingchoice.ts
598606
- src/models/chatstreamingmessagechunk.ts
599607
- src/models/chatstreamingmessagetoolcall.ts
600608
- src/models/chatstreamingresponsechunk.ts
@@ -605,6 +613,7 @@ generatedFiles:
605613
- src/models/completionresponse.ts
606614
- src/models/completionusage.ts
607615
- src/models/createchargerequest.ts
616+
- src/models/datacollection.ts
608617
- src/models/defaultparameters.ts
609618
- src/models/edgenetworktimeoutresponseerrordata.ts
610619
- src/models/endpointstatus.ts
@@ -718,6 +727,7 @@ generatedFiles:
718727
- src/models/perrequestlimits.ts
719728
- src/models/providername.ts
720729
- src/models/provideroverloadedresponseerrordata.ts
730+
- src/models/providersort.ts
721731
- src/models/publicendpoint.ts
722732
- src/models/publicpricing.ts
723733
- src/models/quantization.ts
@@ -750,43 +760,18 @@ generatedFiles:
750760
- src/models/security.ts
751761
- src/models/serviceunavailableresponseerrordata.ts
752762
- src/models/systemmessage.ts
753-
- src/models/tool.ts
754763
- src/models/toolcallstatus.ts
764+
- src/models/tooldefinitionjson.ts
755765
- src/models/toolresponsemessage.ts
756766
- src/models/toomanyrequestsresponseerrordata.ts
757767
- src/models/topproviderinfo.ts
758768
- src/models/unauthorizedresponseerrordata.ts
759769
- src/models/unprocessableentityresponseerrordata.ts
760770
- src/models/urlcitation.ts
761771
- src/models/usermessage.ts
772+
- src/models/videourl.ts
762773
- src/models/websearchpreviewtooluserlocation.ts
763774
- src/models/websearchstatus.ts
764-
- src/react-query/_context.tsx
765-
- src/react-query/_types.ts
766-
- src/react-query/analyticsGetUserActivity.ts
767-
- src/react-query/apiKeysCreate.ts
768-
- src/react-query/apiKeysDelete.ts
769-
- src/react-query/apiKeysGet.ts
770-
- src/react-query/apiKeysGetCurrentKeyMetadata.ts
771-
- src/react-query/apiKeysList.ts
772-
- src/react-query/apiKeysUpdate.ts
773-
- src/react-query/betaResponsesSend.ts
774-
- src/react-query/chatSend.ts
775-
- src/react-query/completionsGenerate.ts
776-
- src/react-query/creditsCreateCoinbaseCharge.ts
777-
- src/react-query/creditsGetCredits.ts
778-
- src/react-query/embeddingsGenerate.ts
779-
- src/react-query/endpointsList.ts
780-
- src/react-query/endpointsListZdrEndpoints.ts
781-
- src/react-query/generationsGetGeneration.ts
782-
- src/react-query/index.ts
783-
- src/react-query/modelsCount.ts
784-
- src/react-query/modelsList.ts
785-
- src/react-query/modelsListForUser.ts
786-
- src/react-query/oAuthCreateAuthCode.ts
787-
- src/react-query/oAuthExchangeAuthCodeForAPIKey.ts
788-
- src/react-query/parametersGetParameters.ts
789-
- src/react-query/providersList.ts
790775
- src/sdk/analytics.ts
791776
- src/sdk/apikeys.ts
792777
- src/sdk/beta.ts
@@ -1523,7 +1508,7 @@ examples:
15231508
id: "<id>"
15241509
responses:
15251510
"200":
1526-
application/json: {"data": {"id": "gen-3bhGkxlo4XFrqiabUM7NDtwDzWwG", "upstream_id": "chatcmpl-791bcf62-080e-4568-87d0-94c72e3b4946", "total_cost": 0.0015, "cache_discount": 0.0002, "upstream_inference_cost": 0.0012, "created_at": "2024-07-15T23:33:19.433273+00:00", "model": "sao10k/l3-stheno-8b", "app_id": 12345, "streamed": true, "cancelled": false, "provider_name": "Infermatic", "latency": 1250, "moderation_latency": 50, "generation_time": 1200, "finish_reason": "stop", "tokens_prompt": 10, "tokens_completion": 25, "native_tokens_prompt": 10, "native_tokens_completion": 25, "native_tokens_completion_images": 0, "native_tokens_reasoning": 5, "native_tokens_cached": 3, "num_media_prompt": 1, "num_input_audio_prompt": 0, "num_video_prompt": 0, "num_media_completion": 0, "num_search_results": 5, "origin": "https://openrouter.ai/", "usage": 0.0015, "is_byok": false, "native_finish_reason": "stop", "external_user": "user-123", "api_type": "completions"}}
1511+
application/json: {"data": {"id": "gen-3bhGkxlo4XFrqiabUM7NDtwDzWwG", "upstream_id": "chatcmpl-791bcf62-080e-4568-87d0-94c72e3b4946", "total_cost": 0.0015, "cache_discount": 0.0002, "upstream_inference_cost": 0.0012, "created_at": "2024-07-15T23:33:19.433273+00:00", "model": "sao10k/l3-stheno-8b", "app_id": 12345, "streamed": true, "cancelled": false, "provider_name": "Infermatic", "latency": 1250, "moderation_latency": 50, "generation_time": 1200, "finish_reason": "stop", "tokens_prompt": 10, "tokens_completion": 25, "native_tokens_prompt": 10, "native_tokens_completion": 25, "native_tokens_completion_images": 0, "native_tokens_reasoning": 5, "native_tokens_cached": 3, "num_media_prompt": 1, "num_input_audio_prompt": 0, "num_media_completion": 0, "num_search_results": 5, "origin": "https://openrouter.ai/", "usage": 0.0015, "is_byok": false, "native_finish_reason": "stop", "external_user": "user-123", "api_type": "completions"}}
15271512
default:
15281513
application/json: {"error": {"code": 400, "message": "Invalid request parameters", "metadata": {"field": "temperature", "reason": "Must be between 0 and 2"}}, "user_id": "user-abc123"}
15291514
4XX:
@@ -1790,4 +1775,22 @@ examples:
17901775
application/json: {"error": {"code": 524, "message": "Request timed out. Please try again later."}}
17911776
"529":
17921777
application/json: {"error": {"code": 529, "message": "Provider returned error"}}
1778+
listModelsEmbeddings:
1779+
speakeasy-default-list-models-embeddings:
1780+
responses:
1781+
"200":
1782+
application/json: {"data": [{"id": "openai/gpt-4", "canonical_slug": "openai/gpt-4", "name": "GPT-4", "created": 1692901234, "pricing": {"prompt": "0.00003", "completion": "0.00006"}, "context_length": 8192, "architecture": {"modality": "text->text", "input_modalities": ["text"], "output_modalities": ["text"]}, "top_provider": {"is_moderated": true}, "per_request_limits": null, "supported_parameters": ["temperature", "top_p", "max_tokens", "frequency_penalty", "presence_penalty"], "default_parameters": null}]}
1783+
"400":
1784+
application/json: {"error": {"code": 400, "message": "Invalid request parameters"}}
1785+
"500":
1786+
application/json: {"error": {"code": 500, "message": "Internal Server Error"}}
1787+
listEmbeddingsModels:
1788+
speakeasy-default-list-embeddings-models:
1789+
responses:
1790+
"200":
1791+
application/json: {"data": [{"id": "openai/gpt-4", "canonical_slug": "openai/gpt-4", "name": "GPT-4", "created": 1692901234, "pricing": {"prompt": "0.00003", "completion": "0.00006"}, "context_length": 8192, "architecture": {"modality": "text->text", "input_modalities": ["text"], "output_modalities": ["text"]}, "top_provider": {"is_moderated": true}, "per_request_limits": null, "supported_parameters": ["temperature", "top_p", "max_tokens", "frequency_penalty", "presence_penalty"], "default_parameters": null}]}
1792+
"400":
1793+
application/json: {"error": {"code": 400, "message": "Invalid request parameters"}}
1794+
"500":
1795+
application/json: {"error": {"code": 500, "message": "Internal Server Error"}}
17931796
examplesVersion: 1.0.2

0 commit comments

Comments
 (0)