Skip to content

Commit 602525e

Browse files
authored
feat: rename bearer auth to apikey (#3)
1 parent 3aaf434 commit 602525e

20 files changed

+46
-54
lines changed

.speakeasy/OAS_files/chat-completions-openapi.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ servers:
1717
default: openrouter.ai
1818
description: Production server
1919
security:
20-
- BearerAuth: []
20+
- ApiKey: []
2121
tags:
2222
- name: Chat
2323
description: Chat completion operations
@@ -26,7 +26,7 @@ externalDocs:
2626
url: https://openrouter.ai/docs
2727
components:
2828
securitySchemes:
29-
BearerAuth:
29+
ApiKey:
3030
type: http
3131
scheme: bearer
3232
description: API key as bearer token in Authorization header

.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: 53e6e641-e7b6-4f11-8e15-1d930a684b2b
33
management:
4-
docChecksum: b163f9f41b3d71f314b6facfd6e73920
4+
docChecksum: 94a9004b4eb9d74143f6acdb06982dd9
55
docVersion: 1.0.0
66
speakeasyVersion: 1.611.0
77
generationVersion: 2.694.1
8-
releaseVersion: 0.5.2
9-
configChecksum: 26a6d90117542e88807eeb93978d6ae1
8+
releaseVersion: 0.5.3
9+
configChecksum: 86f9fc17e898d37ca28f113762f1344a
1010
repoURL: https://github.com/speakeasy-sdks/openrouter-typescript-sdk.git
1111
installationURL: https://github.com/speakeasy-sdks/openrouter-typescript-sdk
1212
features:

.speakeasy/gen.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ generation:
2525
generateNewTests: true
2626
skipResponseBodyAssertions: false
2727
typescript:
28-
version: 0.5.2
28+
version: 0.5.3
2929
additionalDependencies:
3030
dependencies: {}
3131
devDependencies: {}

.speakeasy/out.openapi.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ servers:
1717
default: openrouter.ai
1818
description: Production server
1919
security:
20-
- BearerAuth: []
20+
- ApiKey: []
2121
tags:
2222
- name: Chat
2323
description: Chat completion operations
@@ -26,7 +26,7 @@ externalDocs:
2626
url: https://openrouter.ai/docs
2727
components:
2828
securitySchemes:
29-
BearerAuth:
29+
ApiKey:
3030
type: http
3131
scheme: bearer
3232
description: API key as bearer token in Authorization header

FUNCTIONS.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ import { chatComplete } from "open-router/funcs/chatComplete.js";
2525
// Use `OpenRouterCore` for best tree-shaking performance.
2626
// You can create one instance of it to use across an application.
2727
const openRouter = new OpenRouterCore({
28-
bearerAuth: process.env["OPENROUTER_BEARER_AUTH"] ?? "",
28+
apiKey: process.env["OPENROUTER_API_KEY"] ?? "",
2929
});
3030

3131
async function run() {

README.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ For supported JavaScript runtimes, please consult [RUNTIMES.md](RUNTIMES.md).
9494
import { OpenRouter } from "open-router";
9595

9696
const openRouter = new OpenRouter({
97-
bearerAuth: process.env["OPENROUTER_BEARER_AUTH"] ?? "",
97+
apiKey: process.env["OPENROUTER_API_KEY"] ?? "",
9898
});
9999

100100
async function run() {
@@ -125,16 +125,16 @@ run();
125125

126126
This SDK supports the following security scheme globally:
127127

128-
| Name | Type | Scheme | Environment Variable |
129-
| ------------ | ---- | ----------- | ------------------------ |
130-
| `bearerAuth` | http | HTTP Bearer | `OPENROUTER_BEARER_AUTH` |
128+
| Name | Type | Scheme | Environment Variable |
129+
| -------- | ---- | ----------- | -------------------- |
130+
| `apiKey` | http | HTTP Bearer | `OPENROUTER_API_KEY` |
131131

132-
To authenticate with the API the `bearerAuth` parameter must be set when initializing the SDK client instance. For example:
132+
To authenticate with the API the `apiKey` parameter must be set when initializing the SDK client instance. For example:
133133
```typescript
134134
import { OpenRouter } from "open-router";
135135

136136
const openRouter = new OpenRouter({
137-
bearerAuth: process.env["OPENROUTER_BEARER_AUTH"] ?? "",
137+
apiKey: process.env["OPENROUTER_API_KEY"] ?? "",
138138
});
139139

140140
async function run() {
@@ -283,7 +283,7 @@ To change the default retry strategy for a single API call, simply provide a ret
283283
import { OpenRouter } from "open-router";
284284

285285
const openRouter = new OpenRouter({
286-
bearerAuth: process.env["OPENROUTER_BEARER_AUTH"] ?? "",
286+
apiKey: process.env["OPENROUTER_API_KEY"] ?? "",
287287
});
288288

289289
async function run() {
@@ -332,7 +332,7 @@ const openRouter = new OpenRouter({
332332
},
333333
retryConnectionErrors: false,
334334
},
335-
bearerAuth: process.env["OPENROUTER_BEARER_AUTH"] ?? "",
335+
apiKey: process.env["OPENROUTER_API_KEY"] ?? "",
336336
});
337337

338338
async function run() {
@@ -376,7 +376,7 @@ import { OpenRouter } from "open-router";
376376
import * as errors from "open-router/models/errors";
377377

378378
const openRouter = new OpenRouter({
379-
bearerAuth: process.env["OPENROUTER_BEARER_AUTH"] ?? "",
379+
apiKey: process.env["OPENROUTER_API_KEY"] ?? "",
380380
});
381381

382382
async function run() {
@@ -455,7 +455,7 @@ import { OpenRouter } from "open-router";
455455

456456
const openRouter = new OpenRouter({
457457
providerUrl: "https://ruddy-guacamole.info/",
458-
bearerAuth: process.env["OPENROUTER_BEARER_AUTH"] ?? "",
458+
apiKey: process.env["OPENROUTER_API_KEY"] ?? "",
459459
});
460460

461461
async function run() {
@@ -486,7 +486,7 @@ import { OpenRouter } from "open-router";
486486

487487
const openRouter = new OpenRouter({
488488
serverURL: "https://openrouter.ai/api/v1",
489-
bearerAuth: process.env["OPENROUTER_BEARER_AUTH"] ?? "",
489+
apiKey: process.env["OPENROUTER_API_KEY"] ?? "",
490490
});
491491

492492
async function run() {

USAGE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import { OpenRouter } from "open-router";
44

55
const openRouter = new OpenRouter({
6-
bearerAuth: process.env["OPENROUTER_BEARER_AUTH"] ?? "",
6+
apiKey: process.env["OPENROUTER_API_KEY"] ?? "",
77
});
88

99
async function run() {

docs/models/security.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@ let value: Security = {};
1212

1313
| Field | Type | Required | Description |
1414
| ------------------ | ------------------ | ------------------ | ------------------ |
15-
| `bearerAuth` | *string* | :heavy_minus_sign: | N/A |
15+
| `apiKey` | *string* | :heavy_minus_sign: | N/A |

docs/sdks/chat/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ Creates a model response for the given chat conversation. Supports both streamin
1818
import { OpenRouter } from "open-router";
1919

2020
const openRouter = new OpenRouter({
21-
bearerAuth: process.env["OPENROUTER_BEARER_AUTH"] ?? "",
21+
apiKey: process.env["OPENROUTER_API_KEY"] ?? "",
2222
});
2323

2424
async function run() {
@@ -51,7 +51,7 @@ import { chatComplete } from "open-router/funcs/chatComplete.js";
5151
// Use `OpenRouterCore` for best tree-shaking performance.
5252
// You can create one instance of it to use across an application.
5353
const openRouter = new OpenRouterCore({
54-
bearerAuth: process.env["OPENROUTER_BEARER_AUTH"] ?? "",
54+
apiKey: process.env["OPENROUTER_API_KEY"] ?? "",
5555
});
5656

5757
async function run() {

examples/.env.template

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
# with the prefix: OPENROUTER_
88
#
99
# Security environment variables:
10-
OPENROUTER_BEARER_AUTH=your_bearer_auth_here
10+
OPENROUTER_API_KEY=your_api_key_here
1111

1212
# Debug Configuration
1313
# Enable HTTP request/response logging for debugging

0 commit comments

Comments
 (0)