You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+12-16Lines changed: 12 additions & 16 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -45,40 +45,36 @@ For more information about the API: [OpenRouter Documentation](https://openroute
45
45
<!-- Start SDK Installation [installation] -->
46
46
## SDK Installation
47
47
48
-
> [!TIP]
49
-
> To finish publishing your SDK to npm and others you must [run your first generation action](https://www.speakeasy.com/docs/github-setup#step-by-step-guide).
50
-
51
-
52
48
The SDK can be installed with either [npm](https://www.npmjs.com/), [pnpm](https://pnpm.io/), [bun](https://bun.sh/) or [yarn](https://classic.yarnpkg.com/en/) package managers.
53
49
54
50
### NPM
55
51
56
52
```bash
57
-
npm add <UNSET>
53
+
npm add @openrouter/sdk
58
54
# Install optional peer dependencies if you plan to use React hooks
59
55
npm add @tanstack/react-query react react-dom
60
56
```
61
57
62
58
### PNPM
63
59
64
60
```bash
65
-
pnpm add <UNSET>
61
+
pnpm add @openrouter/sdk
66
62
# Install optional peer dependencies if you plan to use React hooks
67
63
pnpm add @tanstack/react-query react react-dom
68
64
```
69
65
70
66
### Bun
71
67
72
68
```bash
73
-
bun add <UNSET>
69
+
bun add @openrouter/sdk
74
70
# Install optional peer dependencies if you plan to use React hooks
75
71
bun add @tanstack/react-query react react-dom
76
72
```
77
73
78
74
### Yarn
79
75
80
76
```bash
81
-
yarn add <UNSET>
77
+
yarn add @openrouter/sdk
82
78
# Install optional peer dependencies if you plan to use React hooks
@@ -132,7 +128,7 @@ This SDK supports the following security schemes globally:
132
128
133
129
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:
134
130
```typescript
135
-
import { OpenRouter } from"openrouter";
131
+
import { OpenRouter } from"@openrouter/sdk";
136
132
137
133
const openRouter =newOpenRouter({
138
134
security: {
@@ -302,7 +298,7 @@ terminate when the server no longer has any events to send and closes the
302
298
underlying connection.
303
299
304
300
```typescript
305
-
import { OpenRouter } from"openrouter";
301
+
import { OpenRouter } from"@openrouter/sdk";
306
302
307
303
const openRouter =newOpenRouter({
308
304
security: {
@@ -331,7 +327,7 @@ Some of the endpoints in this SDK support retries. If you use the SDK without a
331
327
332
328
To change the default retry strategy for a single API call, simply provide a retryConfig object to the call:
333
329
```typescript
334
-
import { OpenRouter } from"openrouter";
330
+
import { OpenRouter } from"@openrouter/sdk";
335
331
336
332
const openRouter =newOpenRouter({
337
333
security: {
@@ -362,7 +358,7 @@ run();
362
358
363
359
If you'd like to override the default retry strategy for all operations that support retries, you can provide a retryConfig at SDK initialization:
@@ -482,7 +478,7 @@ You can pass a logger that matches `console`'s interface as an SDK option.
482
478
> Beware that debug logging will reveal secrets, like API tokens in headers, in log messages printed to a console or files. It's recommended to use this feature only during local development and not in production.
0 commit comments