Skip to content

Commit d8378dd

Browse files
committed
fix env name and ci/cd
1 parent 360da34 commit d8378dd

File tree

30 files changed

+123
-101
lines changed

30 files changed

+123
-101
lines changed

.github/workflows/sdk_generation.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ permissions:
2121
types:
2222
- labeled
2323
- unlabeled
24+
2425
jobs:
2526
generate:
2627
uses: speakeasy-api/sdk-generation-action/.github/workflows/workflow-executor.yaml@v15
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: Generate (spec change merged)
2+
permissions:
3+
checks: write
4+
contents: write
5+
pull-requests: write
6+
statuses: write
7+
id-token: write
8+
"on":
9+
workflow_dispatch:
10+
inputs:
11+
force:
12+
description: Force generation of SDKs
13+
type: boolean
14+
default: false
15+
set_version:
16+
description: optionally set a specific SDK version
17+
type: string
18+
push:
19+
branches:
20+
- main
21+
paths:
22+
- .speakeasy/in.openapi.yaml
23+
24+
jobs:
25+
generate:
26+
uses: speakeasy-api/sdk-generation-action/.github/workflows/workflow-executor.yaml@v15
27+
with:
28+
force: ${{ github.event.inputs.force }}
29+
mode: direct
30+
set_version: ${{ github.event.inputs.set_version }}
31+
secrets:
32+
github_access_token: ${{ secrets.GITHUB_TOKEN }}
33+
npm_token: ${{ secrets.NPM_TOKEN }}
34+
speakeasy_api_key: ${{ secrets.SPEAKEASY_API_KEY }}

.speakeasy/gen.lock

Lines changed: 3 additions & 3 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: 0565265506e77d2f8173f58638aa099f
4+
docChecksum: 84232fbdd2d267684e96d466dd089ae6
55
docVersion: 1.0.0
66
speakeasyVersion: 1.622.2
77
generationVersion: 2.711.4
8-
releaseVersion: 0.0.0-beta.0
9-
configChecksum: ad5304d3b5e52b274ee22f4454e04f08
8+
releaseVersion: 0.0.0-beta.1
9+
configChecksum: a66c04c45616fc4e0222b710b314b7a7
1010
published: true
1111
features:
1212
typescript:

.speakeasy/gen.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ generation:
2727
generateNewTests: true
2828
skipResponseBodyAssertions: false
2929
typescript:
30-
version: 0.0.0-beta.0
30+
version: 0.0.0-beta.1
3131
additionalDependencies:
3232
dependencies: {}
3333
devDependencies: {}

.speakeasy/in.openapi.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -893,7 +893,7 @@ components:
893893
type: http
894894
scheme: bearer
895895
description: API key as bearer token in Authorization header
896-
apiKeyAuth:
896+
apiKey:
897897
type: apiKey
898898
in: header
899899
name: Authorization
@@ -3828,7 +3828,7 @@ servers:
38283828
description: Production server
38293829
x-speakeasy-server-id: production
38303830
security:
3831-
- apiKeyAuth: []
3831+
- apiKey: []
38323832
- bearer: []
38333833
externalDocs:
38343834
description: OpenRouter Documentation

.speakeasy/out.openapi.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -893,7 +893,7 @@ components:
893893
type: http
894894
scheme: bearer
895895
description: API key as bearer token in Authorization header
896-
apiKeyAuth:
896+
apiKey:
897897
type: apiKey
898898
in: header
899899
name: Authorization
@@ -3828,7 +3828,7 @@ servers:
38283828
description: Production server
38293829
x-speakeasy-server-id: production
38303830
security:
3831-
- apiKeyAuth: []
3831+
- apiKey: []
38323832
- bearer: []
38333833
externalDocs:
38343834
description: OpenRouter Documentation

.speakeasy/workflow.lock

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,19 @@ speakeasyVersion: 1.622.2
22
sources:
33
OpenRouter API:
44
sourceNamespace: open-router-chat-completions-api
5-
sourceRevisionDigest: sha256:33ae487def452ee14ec8255ee26d55b3ad26e168d2294efe2992bb32259feb2e
6-
sourceBlobDigest: sha256:1f36153e04b279d7f1d297bbb9ce7cf750dd8790aa012d7c3291a16ee59c39a6
5+
sourceRevisionDigest: sha256:c814cf91deea7e80928b7a15adf0416a6b8fa080bead78c93b59e3c8a26ad521
6+
sourceBlobDigest: sha256:4a5d604c480dd211d7836e31d00fd21c619b9a73eee802622cf6b479f8cbf0b6
77
tags:
88
- latest
99
- 1.0.0
1010
targets:
1111
openrouter:
1212
source: OpenRouter API
1313
sourceNamespace: open-router-chat-completions-api
14-
sourceRevisionDigest: sha256:33ae487def452ee14ec8255ee26d55b3ad26e168d2294efe2992bb32259feb2e
15-
sourceBlobDigest: sha256:1f36153e04b279d7f1d297bbb9ce7cf750dd8790aa012d7c3291a16ee59c39a6
14+
sourceRevisionDigest: sha256:c814cf91deea7e80928b7a15adf0416a6b8fa080bead78c93b59e3c8a26ad521
15+
sourceBlobDigest: sha256:4a5d604c480dd211d7836e31d00fd21c619b9a73eee802622cf6b479f8cbf0b6
1616
codeSamplesNamespace: open-router-chat-completions-api-typescript-code-samples
17-
codeSamplesRevisionDigest: sha256:b321b255d705f018afadbd16e374a90e6e653be398e55f3221ac0f6cd811d4a6
17+
codeSamplesRevisionDigest: sha256:d2ce4fba9943239de29708bf6a72f6a9e0413a9b4c73e5671c0899e72fb1adec
1818
workflow:
1919
workflowVersion: 1.0.0
2020
speakeasyVersion: latest

FUNCTIONS.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ import { getCredits } from "@openrouter/sdk/funcs/getCredits.js";
2626
// You can create one instance of it to use across an application.
2727
const openRouter = new OpenRouterCore({
2828
security: {
29-
apiKeyAuth: process.env["OPENROUTER_API_KEY_AUTH"] ?? "",
29+
apiKey: process.env["OPENROUTER_API_KEY"] ?? "",
3030
},
3131
});
3232

REACT_QUERY.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ import { OpenRouterProvider } from "@openrouter/sdk/react-query";
2424
const queryClient = new QueryClient();
2525
const openRouter = new OpenRouterCore({
2626
security: {
27-
apiKeyAuth: process.env["OPENROUTER_API_KEY_AUTH"] ?? "",
27+
apiKey: process.env["OPENROUTER_API_KEY"] ?? "",
2828
},
2929
});
3030

@@ -225,7 +225,7 @@ import { useGetCreditsSuspense } from "@openrouter/sdk/react-query/getCredits.js
225225
const queryClient = new QueryClient();
226226
const openRouter = new OpenRouterCore({
227227
security: {
228-
apiKeyAuth: process.env["OPENROUTER_API_KEY_AUTH"] ?? "",
228+
apiKey: process.env["OPENROUTER_API_KEY"] ?? "",
229229
},
230230
});
231231

@@ -283,7 +283,7 @@ export default async function Page() {
283283
const queryClient = new QueryClient();
284284
const openRouter = new OpenRouterCore({
285285
security: {
286-
apiKeyAuth: process.env["OPENROUTER_API_KEY_AUTH"] ?? "",
286+
apiKey: process.env["OPENROUTER_API_KEY"] ?? "",
287287
},
288288
});
289289

README.md

Lines changed: 14 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,17 @@
1-
# openrouter
1+
# OpenRouter SDK
22

3-
Developer-friendly & type-safe Typescript SDK specifically catered to leverage *openrouter* API.
4-
5-
<div align="left">
6-
<a href="https://www.speakeasy.com/?utm_source=openrouter&utm_campaign=typescript"><img src="https://www.speakeasy.com/assets/badges/built-by-speakeasy.svg" /></a>
7-
<a href="https://opensource.org/licenses/MIT">
8-
<img src="https://img.shields.io/badge/License-MIT-blue.svg" style="width: 100px; height: 28px;" />
9-
</a>
10-
</div>
3+
The [OpenRouter](https://openrouter.ai/) SDK gives access to over 300 large language models on the OpenRouter chat and completion APIs, as well as the rest of our full API. For more information about the API: [OpenRouter Documentation](https://openrouter.ai/docs)
114

125
<br /><br />
136
> [!IMPORTANT]
147
> This SDK is not yet ready for production use. To complete setup please follow the steps outlined in your [workspace](https://app.speakeasy.com/org/openrouter/sdk). Delete this section before > publishing to a package manager.
158
16-
<!-- Start Summary [summary] -->
17-
## Summary
18-
19-
OpenRouter API: OpenAI-compatible Chat Completions API with additional OpenRouter features
20-
21-
For more information about the API: [OpenRouter Documentation](https://openrouter.ai/docs)
22-
<!-- End Summary [summary] -->
9+
<!-- No Summary [summary] -->
2310

2411
<!-- Start Table of Contents [toc] -->
2512
## Table of Contents
2613
<!-- $toc-max-depth=2 -->
27-
* [openrouter](#openrouter)
14+
* [OpenRouter SDK](#openrouter-sdk)
2815
* [SDK Installation](#sdk-installation)
2916
* [Requirements](#requirements)
3017
* [SDK Example Usage](#sdk-example-usage)
@@ -99,7 +86,7 @@ import { OpenRouter } from "@openrouter/sdk";
9986

10087
const openRouter = new OpenRouter({
10188
security: {
102-
apiKeyAuth: process.env["OPENROUTER_API_KEY_AUTH"] ?? "",
89+
apiKey: process.env["OPENROUTER_API_KEY"] ?? "",
10390
},
10491
});
10592

@@ -121,18 +108,18 @@ run();
121108

122109
This SDK supports the following security schemes globally:
123110

124-
| Name | Type | Scheme | Environment Variable |
125-
| ------------ | ------ | ----------- | ------------------------- |
126-
| `apiKeyAuth` | apiKey | API key | `OPENROUTER_API_KEY_AUTH` |
127-
| `bearer` | http | HTTP Bearer | `OPENROUTER_BEARER` |
111+
| Name | Type | Scheme | Environment Variable |
112+
| -------- | ------ | ----------- | -------------------- |
113+
| `apiKey` | apiKey | API key | `OPENROUTER_API_KEY` |
114+
| `bearer` | http | HTTP Bearer | `OPENROUTER_BEARER` |
128115

129116
You can set the security parameters through the `security` optional parameter when initializing the SDK client instance. The selected scheme will be used by default to authenticate with the API for all operations that support it. For example:
130117
```typescript
131118
import { OpenRouter } from "@openrouter/sdk";
132119

133120
const openRouter = new OpenRouter({
134121
security: {
135-
apiKeyAuth: process.env["OPENROUTER_API_KEY_AUTH"] ?? "",
122+
apiKey: process.env["OPENROUTER_API_KEY"] ?? "",
136123
},
137124
});
138125

@@ -302,7 +289,7 @@ import { OpenRouter } from "@openrouter/sdk";
302289

303290
const openRouter = new OpenRouter({
304291
security: {
305-
apiKeyAuth: process.env["OPENROUTER_API_KEY_AUTH"] ?? "",
292+
apiKey: process.env["OPENROUTER_API_KEY"] ?? "",
306293
},
307294
});
308295

@@ -331,7 +318,7 @@ import { OpenRouter } from "@openrouter/sdk";
331318

332319
const openRouter = new OpenRouter({
333320
security: {
334-
apiKeyAuth: process.env["OPENROUTER_API_KEY_AUTH"] ?? "",
321+
apiKey: process.env["OPENROUTER_API_KEY"] ?? "",
335322
},
336323
});
337324

@@ -372,7 +359,7 @@ const openRouter = new OpenRouter({
372359
retryConnectionErrors: false,
373360
},
374361
security: {
375-
apiKeyAuth: process.env["OPENROUTER_API_KEY_AUTH"] ?? "",
362+
apiKey: process.env["OPENROUTER_API_KEY"] ?? "",
376363
},
377364
});
378365

@@ -408,7 +395,7 @@ import * as errors from "@openrouter/sdk/models/errors";
408395

409396
const openRouter = new OpenRouter({
410397
security: {
411-
apiKeyAuth: process.env["OPENROUTER_API_KEY_AUTH"] ?? "",
398+
apiKey: process.env["OPENROUTER_API_KEY"] ?? "",
412399
},
413400
});
414401

0 commit comments

Comments
 (0)