@openrouter/sdk 0.0.0-beta.4 → 0.0.0-beta.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/REACT_QUERY.md +4 -4
- package/README.md +32 -17
- package/dist/{esm/funcs/postCreditsCoinbase.d.ts → commonjs/funcs/creditsPostCreditsCoinbase.d.ts} +2 -2
- package/dist/commonjs/funcs/creditsPostCreditsCoinbase.d.ts.map +1 -0
- package/dist/commonjs/funcs/{postCreditsCoinbase.js → creditsPostCreditsCoinbase.js} +3 -3
- package/dist/commonjs/funcs/creditsPostCreditsCoinbase.js.map +1 -0
- package/dist/commonjs/funcs/{embeddingsPostEmbeddings.d.ts → embeddingsGenerate.d.ts} +2 -2
- package/dist/commonjs/funcs/embeddingsGenerate.d.ts.map +1 -0
- package/dist/commonjs/funcs/{embeddingsPostEmbeddings.js → embeddingsGenerate.js} +3 -3
- package/dist/commonjs/funcs/embeddingsGenerate.js.map +1 -0
- package/dist/{esm/funcs/parametersGetParametersAuthorSlug.d.ts → commonjs/funcs/modelGetParametersAuthorSlug.d.ts} +2 -2
- package/dist/commonjs/funcs/modelGetParametersAuthorSlug.d.ts.map +1 -0
- package/dist/commonjs/funcs/{parametersGetParametersAuthorSlug.js → modelGetParametersAuthorSlug.js} +3 -3
- package/dist/commonjs/funcs/modelGetParametersAuthorSlug.js.map +1 -0
- package/dist/commonjs/funcs/oAuthPostAuthKeys.d.ts +17 -0
- package/dist/commonjs/funcs/oAuthPostAuthKeys.d.ts.map +1 -0
- package/dist/commonjs/funcs/oAuthPostAuthKeys.js +116 -0
- package/dist/commonjs/funcs/oAuthPostAuthKeys.js.map +1 -0
- package/dist/commonjs/funcs/oAuthPostAuthKeysCode.d.ts +17 -0
- package/dist/commonjs/funcs/oAuthPostAuthKeysCode.d.ts.map +1 -0
- package/dist/commonjs/funcs/oAuthPostAuthKeysCode.js +116 -0
- package/dist/commonjs/funcs/oAuthPostAuthKeysCode.js.map +1 -0
- package/dist/{esm/funcs/getProviders.d.ts → commonjs/funcs/providersGetProviders.d.ts} +5 -2
- package/dist/commonjs/funcs/providersGetProviders.d.ts.map +1 -0
- package/dist/commonjs/funcs/{getProviders.js → providersGetProviders.js} +6 -3
- package/dist/commonjs/funcs/providersGetProviders.js.map +1 -0
- package/dist/commonjs/lib/config.d.ts +3 -3
- package/dist/commonjs/lib/config.js +3 -3
- package/dist/commonjs/models/operations/index.d.ts +2 -0
- package/dist/commonjs/models/operations/index.d.ts.map +1 -1
- package/dist/commonjs/models/operations/index.js +2 -0
- package/dist/commonjs/models/operations/index.js.map +1 -1
- package/dist/commonjs/models/operations/postauthkeys.d.ts +132 -0
- package/dist/commonjs/models/operations/postauthkeys.d.ts.map +1 -0
- package/dist/commonjs/models/operations/postauthkeys.js +175 -0
- package/dist/commonjs/models/operations/postauthkeys.js.map +1 -0
- package/dist/commonjs/models/operations/postauthkeyscode.d.ts +167 -0
- package/dist/commonjs/models/operations/postauthkeyscode.d.ts.map +1 -0
- package/dist/commonjs/models/operations/postauthkeyscode.js +210 -0
- package/dist/commonjs/models/operations/postauthkeyscode.js.map +1 -0
- package/dist/commonjs/react-query/creditsPostCreditsCoinbase.d.ts +21 -0
- package/dist/commonjs/react-query/creditsPostCreditsCoinbase.d.ts.map +1 -0
- package/dist/commonjs/react-query/creditsPostCreditsCoinbase.js +44 -0
- package/dist/commonjs/react-query/creditsPostCreditsCoinbase.js.map +1 -0
- package/dist/commonjs/react-query/embeddingsGenerate.d.ts +23 -0
- package/dist/commonjs/react-query/embeddingsGenerate.d.ts.map +1 -0
- package/dist/commonjs/react-query/{embeddingsPostEmbeddings.js → embeddingsGenerate.js} +13 -13
- package/dist/commonjs/react-query/embeddingsGenerate.js.map +1 -0
- package/dist/commonjs/react-query/index.d.ts +6 -4
- package/dist/commonjs/react-query/index.d.ts.map +1 -1
- package/dist/commonjs/react-query/index.js +6 -4
- package/dist/commonjs/react-query/index.js.map +1 -1
- package/dist/commonjs/react-query/modelGetParametersAuthorSlug.d.ts +38 -0
- package/dist/commonjs/react-query/modelGetParametersAuthorSlug.d.ts.map +1 -0
- package/dist/commonjs/react-query/modelGetParametersAuthorSlug.js +88 -0
- package/dist/commonjs/react-query/modelGetParametersAuthorSlug.js.map +1 -0
- package/dist/commonjs/react-query/oAuthPostAuthKeys.d.ts +23 -0
- package/dist/commonjs/react-query/oAuthPostAuthKeys.d.ts.map +1 -0
- package/dist/commonjs/react-query/oAuthPostAuthKeys.js +47 -0
- package/dist/commonjs/react-query/oAuthPostAuthKeys.js.map +1 -0
- package/dist/commonjs/react-query/oAuthPostAuthKeysCode.d.ts +23 -0
- package/dist/commonjs/react-query/oAuthPostAuthKeysCode.d.ts.map +1 -0
- package/dist/commonjs/react-query/oAuthPostAuthKeysCode.js +47 -0
- package/dist/commonjs/react-query/oAuthPostAuthKeysCode.js.map +1 -0
- package/dist/commonjs/react-query/providersGetProviders.d.ts +23 -0
- package/dist/commonjs/react-query/providersGetProviders.d.ts.map +1 -0
- package/dist/commonjs/react-query/providersGetProviders.js +69 -0
- package/dist/commonjs/react-query/providersGetProviders.js.map +1 -0
- package/dist/commonjs/sdk/credits.d.ts +9 -0
- package/dist/commonjs/sdk/credits.d.ts.map +1 -0
- package/dist/commonjs/sdk/credits.js +19 -0
- package/dist/commonjs/sdk/credits.js.map +1 -0
- package/dist/commonjs/sdk/embeddings.d.ts +1 -1
- package/dist/commonjs/sdk/embeddings.d.ts.map +1 -1
- package/dist/commonjs/sdk/embeddings.js +3 -3
- package/dist/commonjs/sdk/embeddings.js.map +1 -1
- package/dist/commonjs/sdk/{parameters.d.ts → model.d.ts} +2 -2
- package/dist/commonjs/sdk/model.d.ts.map +1 -0
- package/dist/commonjs/sdk/model.js +19 -0
- package/dist/commonjs/sdk/model.js.map +1 -0
- package/dist/commonjs/sdk/oauth.d.ts +19 -0
- package/dist/commonjs/sdk/oauth.d.ts.map +1 -0
- package/dist/commonjs/sdk/oauth.js +32 -0
- package/dist/commonjs/sdk/oauth.js.map +1 -0
- package/dist/commonjs/sdk/providers.d.ts +9 -0
- package/dist/commonjs/sdk/providers.d.ts.map +1 -0
- package/dist/commonjs/sdk/providers.js +19 -0
- package/dist/commonjs/sdk/providers.js.map +1 -0
- package/dist/commonjs/sdk/sdk.d.ts +12 -8
- package/dist/commonjs/sdk/sdk.d.ts.map +1 -1
- package/dist/commonjs/sdk/sdk.js +15 -14
- package/dist/commonjs/sdk/sdk.js.map +1 -1
- package/dist/{commonjs/funcs/postCreditsCoinbase.d.ts → esm/funcs/creditsPostCreditsCoinbase.d.ts} +2 -2
- package/dist/esm/funcs/creditsPostCreditsCoinbase.d.ts.map +1 -0
- package/dist/esm/funcs/{postCreditsCoinbase.js → creditsPostCreditsCoinbase.js} +2 -2
- package/dist/esm/funcs/creditsPostCreditsCoinbase.js.map +1 -0
- package/dist/esm/funcs/{embeddingsPostEmbeddings.d.ts → embeddingsGenerate.d.ts} +2 -2
- package/dist/esm/funcs/embeddingsGenerate.d.ts.map +1 -0
- package/dist/esm/funcs/{embeddingsPostEmbeddings.js → embeddingsGenerate.js} +2 -2
- package/dist/esm/funcs/embeddingsGenerate.js.map +1 -0
- package/dist/{commonjs/funcs/parametersGetParametersAuthorSlug.d.ts → esm/funcs/modelGetParametersAuthorSlug.d.ts} +2 -2
- package/dist/esm/funcs/modelGetParametersAuthorSlug.d.ts.map +1 -0
- package/dist/esm/funcs/{parametersGetParametersAuthorSlug.js → modelGetParametersAuthorSlug.js} +2 -2
- package/dist/esm/funcs/modelGetParametersAuthorSlug.js.map +1 -0
- package/dist/esm/funcs/oAuthPostAuthKeys.d.ts +17 -0
- package/dist/esm/funcs/oAuthPostAuthKeys.d.ts.map +1 -0
- package/dist/esm/funcs/oAuthPostAuthKeys.js +80 -0
- package/dist/esm/funcs/oAuthPostAuthKeys.js.map +1 -0
- package/dist/esm/funcs/oAuthPostAuthKeysCode.d.ts +17 -0
- package/dist/esm/funcs/oAuthPostAuthKeysCode.d.ts.map +1 -0
- package/dist/esm/funcs/oAuthPostAuthKeysCode.js +80 -0
- package/dist/esm/funcs/oAuthPostAuthKeysCode.js.map +1 -0
- package/dist/{commonjs/funcs/getProviders.d.ts → esm/funcs/providersGetProviders.d.ts} +5 -2
- package/dist/esm/funcs/providersGetProviders.d.ts.map +1 -0
- package/dist/esm/funcs/{getProviders.js → providersGetProviders.js} +5 -2
- package/dist/esm/funcs/providersGetProviders.js.map +1 -0
- package/dist/esm/lib/config.d.ts +3 -3
- package/dist/esm/lib/config.js +3 -3
- package/dist/esm/models/operations/index.d.ts +2 -0
- package/dist/esm/models/operations/index.d.ts.map +1 -1
- package/dist/esm/models/operations/index.js +2 -0
- package/dist/esm/models/operations/index.js.map +1 -1
- package/dist/esm/models/operations/postauthkeys.d.ts +132 -0
- package/dist/esm/models/operations/postauthkeys.d.ts.map +1 -0
- package/dist/esm/models/operations/postauthkeys.js +133 -0
- package/dist/esm/models/operations/postauthkeys.js.map +1 -0
- package/dist/esm/models/operations/postauthkeyscode.d.ts +167 -0
- package/dist/esm/models/operations/postauthkeyscode.d.ts.map +1 -0
- package/dist/esm/models/operations/postauthkeyscode.js +166 -0
- package/dist/esm/models/operations/postauthkeyscode.js.map +1 -0
- package/dist/esm/react-query/creditsPostCreditsCoinbase.d.ts +21 -0
- package/dist/esm/react-query/creditsPostCreditsCoinbase.d.ts.map +1 -0
- package/dist/esm/react-query/{postCreditsCoinbase.js → creditsPostCreditsCoinbase.js} +10 -10
- package/dist/esm/react-query/creditsPostCreditsCoinbase.js.map +1 -0
- package/dist/esm/react-query/embeddingsGenerate.d.ts +23 -0
- package/dist/esm/react-query/embeddingsGenerate.d.ts.map +1 -0
- package/dist/esm/react-query/{embeddingsPostEmbeddings.js → embeddingsGenerate.js} +10 -10
- package/dist/esm/react-query/embeddingsGenerate.js.map +1 -0
- package/dist/esm/react-query/index.d.ts +6 -4
- package/dist/esm/react-query/index.d.ts.map +1 -1
- package/dist/esm/react-query/index.js +6 -4
- package/dist/esm/react-query/index.js.map +1 -1
- package/dist/esm/react-query/modelGetParametersAuthorSlug.d.ts +38 -0
- package/dist/esm/react-query/modelGetParametersAuthorSlug.d.ts.map +1 -0
- package/dist/esm/react-query/modelGetParametersAuthorSlug.js +78 -0
- package/dist/esm/react-query/modelGetParametersAuthorSlug.js.map +1 -0
- package/dist/esm/react-query/oAuthPostAuthKeys.d.ts +23 -0
- package/dist/esm/react-query/oAuthPostAuthKeys.d.ts.map +1 -0
- package/dist/esm/react-query/oAuthPostAuthKeys.js +42 -0
- package/dist/esm/react-query/oAuthPostAuthKeys.js.map +1 -0
- package/dist/esm/react-query/oAuthPostAuthKeysCode.d.ts +23 -0
- package/dist/esm/react-query/oAuthPostAuthKeysCode.d.ts.map +1 -0
- package/dist/esm/react-query/oAuthPostAuthKeysCode.js +42 -0
- package/dist/esm/react-query/oAuthPostAuthKeysCode.js.map +1 -0
- package/dist/esm/react-query/providersGetProviders.d.ts +23 -0
- package/dist/esm/react-query/providersGetProviders.d.ts.map +1 -0
- package/dist/esm/react-query/providersGetProviders.js +60 -0
- package/dist/esm/react-query/providersGetProviders.js.map +1 -0
- package/dist/esm/sdk/credits.d.ts +9 -0
- package/dist/esm/sdk/credits.d.ts.map +1 -0
- package/dist/esm/sdk/credits.js +15 -0
- package/dist/esm/sdk/credits.js.map +1 -0
- package/dist/esm/sdk/embeddings.d.ts +1 -1
- package/dist/esm/sdk/embeddings.d.ts.map +1 -1
- package/dist/esm/sdk/embeddings.js +3 -3
- package/dist/esm/sdk/embeddings.js.map +1 -1
- package/dist/esm/sdk/{parameters.d.ts → model.d.ts} +2 -2
- package/dist/esm/sdk/model.d.ts.map +1 -0
- package/dist/esm/sdk/{parameters.js → model.js} +4 -4
- package/dist/esm/sdk/model.js.map +1 -0
- package/dist/esm/sdk/oauth.d.ts +19 -0
- package/dist/esm/sdk/oauth.d.ts.map +1 -0
- package/dist/esm/sdk/oauth.js +28 -0
- package/dist/esm/sdk/oauth.js.map +1 -0
- package/dist/esm/sdk/providers.d.ts +9 -0
- package/dist/esm/sdk/providers.d.ts.map +1 -0
- package/dist/esm/sdk/providers.js +15 -0
- package/dist/esm/sdk/providers.js.map +1 -0
- package/dist/esm/sdk/sdk.d.ts +12 -8
- package/dist/esm/sdk/sdk.d.ts.map +1 -1
- package/dist/esm/sdk/sdk.js +15 -14
- package/dist/esm/sdk/sdk.js.map +1 -1
- package/docs/sdks/credits/README.md +95 -0
- package/docs/sdks/embeddings/README.md +8 -8
- package/docs/sdks/{parameters → model}/README.md +12 -12
- package/docs/sdks/oauth/README.md +199 -0
- package/docs/sdks/openrouter/README.md +0 -183
- package/docs/sdks/providers/README.md +104 -0
- package/jsr.json +1 -1
- package/package.json +1 -1
- package/src/funcs/{postCreditsCoinbase.ts → creditsPostCreditsCoinbase.ts} +1 -1
- package/src/funcs/{embeddingsPostEmbeddings.ts → embeddingsGenerate.ts} +1 -1
- package/src/funcs/{parametersGetParametersAuthorSlug.ts → modelGetParametersAuthorSlug.ts} +1 -1
- package/src/funcs/oAuthPostAuthKeys.ts +164 -0
- package/src/funcs/oAuthPostAuthKeysCode.ts +164 -0
- package/src/funcs/{getProviders.ts → providersGetProviders.ts} +4 -1
- package/src/lib/config.ts +3 -3
- package/src/models/operations/index.ts +2 -0
- package/src/models/operations/postauthkeys.ts +272 -0
- package/src/models/operations/postauthkeyscode.ts +352 -0
- package/src/react-query/{postCreditsCoinbase.ts → creditsPostCreditsCoinbase.ts} +18 -18
- package/src/react-query/{embeddingsPostEmbeddings.ts → embeddingsGenerate.ts} +18 -19
- package/src/react-query/index.ts +6 -4
- package/src/react-query/{parametersGetParametersAuthorSlug.ts → modelGetParametersAuthorSlug.ts} +29 -34
- package/src/react-query/oAuthPostAuthKeys.ts +88 -0
- package/src/react-query/oAuthPostAuthKeysCode.ts +89 -0
- package/src/react-query/{getProviders.ts → providersGetProviders.ts} +35 -27
- package/src/sdk/credits.ts +26 -0
- package/src/sdk/embeddings.ts +3 -3
- package/src/sdk/{parameters.ts → model.ts} +3 -3
- package/src/sdk/oauth.ts +45 -0
- package/src/sdk/providers.ts +22 -0
- package/src/sdk/sdk.ts +22 -31
- package/dist/commonjs/funcs/embeddingsPostEmbeddings.d.ts.map +0 -1
- package/dist/commonjs/funcs/embeddingsPostEmbeddings.js.map +0 -1
- package/dist/commonjs/funcs/getProviders.d.ts.map +0 -1
- package/dist/commonjs/funcs/getProviders.js.map +0 -1
- package/dist/commonjs/funcs/parametersGetParametersAuthorSlug.d.ts.map +0 -1
- package/dist/commonjs/funcs/parametersGetParametersAuthorSlug.js.map +0 -1
- package/dist/commonjs/funcs/postCreditsCoinbase.d.ts.map +0 -1
- package/dist/commonjs/funcs/postCreditsCoinbase.js.map +0 -1
- package/dist/commonjs/react-query/embeddingsPostEmbeddings.d.ts +0 -23
- package/dist/commonjs/react-query/embeddingsPostEmbeddings.d.ts.map +0 -1
- package/dist/commonjs/react-query/embeddingsPostEmbeddings.js.map +0 -1
- package/dist/commonjs/react-query/getProviders.d.ts +0 -17
- package/dist/commonjs/react-query/getProviders.d.ts.map +0 -1
- package/dist/commonjs/react-query/getProviders.js +0 -63
- package/dist/commonjs/react-query/getProviders.js.map +0 -1
- package/dist/commonjs/react-query/parametersGetParametersAuthorSlug.d.ts +0 -38
- package/dist/commonjs/react-query/parametersGetParametersAuthorSlug.d.ts.map +0 -1
- package/dist/commonjs/react-query/parametersGetParametersAuthorSlug.js +0 -88
- package/dist/commonjs/react-query/parametersGetParametersAuthorSlug.js.map +0 -1
- package/dist/commonjs/react-query/postCreditsCoinbase.d.ts +0 -21
- package/dist/commonjs/react-query/postCreditsCoinbase.d.ts.map +0 -1
- package/dist/commonjs/react-query/postCreditsCoinbase.js +0 -44
- package/dist/commonjs/react-query/postCreditsCoinbase.js.map +0 -1
- package/dist/commonjs/sdk/parameters.d.ts.map +0 -1
- package/dist/commonjs/sdk/parameters.js +0 -19
- package/dist/commonjs/sdk/parameters.js.map +0 -1
- package/dist/esm/funcs/embeddingsPostEmbeddings.d.ts.map +0 -1
- package/dist/esm/funcs/embeddingsPostEmbeddings.js.map +0 -1
- package/dist/esm/funcs/getProviders.d.ts.map +0 -1
- package/dist/esm/funcs/getProviders.js.map +0 -1
- package/dist/esm/funcs/parametersGetParametersAuthorSlug.d.ts.map +0 -1
- package/dist/esm/funcs/parametersGetParametersAuthorSlug.js.map +0 -1
- package/dist/esm/funcs/postCreditsCoinbase.d.ts.map +0 -1
- package/dist/esm/funcs/postCreditsCoinbase.js.map +0 -1
- package/dist/esm/react-query/embeddingsPostEmbeddings.d.ts +0 -23
- package/dist/esm/react-query/embeddingsPostEmbeddings.d.ts.map +0 -1
- package/dist/esm/react-query/embeddingsPostEmbeddings.js.map +0 -1
- package/dist/esm/react-query/getProviders.d.ts +0 -17
- package/dist/esm/react-query/getProviders.d.ts.map +0 -1
- package/dist/esm/react-query/getProviders.js +0 -54
- package/dist/esm/react-query/getProviders.js.map +0 -1
- package/dist/esm/react-query/parametersGetParametersAuthorSlug.d.ts +0 -38
- package/dist/esm/react-query/parametersGetParametersAuthorSlug.d.ts.map +0 -1
- package/dist/esm/react-query/parametersGetParametersAuthorSlug.js +0 -78
- package/dist/esm/react-query/parametersGetParametersAuthorSlug.js.map +0 -1
- package/dist/esm/react-query/postCreditsCoinbase.d.ts +0 -21
- package/dist/esm/react-query/postCreditsCoinbase.d.ts.map +0 -1
- package/dist/esm/react-query/postCreditsCoinbase.js.map +0 -1
- package/dist/esm/sdk/parameters.d.ts.map +0 -1
- package/dist/esm/sdk/parameters.js.map +0 -1
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
# OAuth
|
|
2
|
+
(*oAuth*)
|
|
3
|
+
|
|
4
|
+
## Overview
|
|
5
|
+
|
|
6
|
+
### Available Operations
|
|
7
|
+
|
|
8
|
+
* [postAuthKeys](#postauthkeys) - Exchange authorization code for API key
|
|
9
|
+
* [postAuthKeysCode](#postauthkeyscode) - Create authorization code
|
|
10
|
+
|
|
11
|
+
## postAuthKeys
|
|
12
|
+
|
|
13
|
+
Exchange an authorization code from the PKCE flow for a user-controlled API key
|
|
14
|
+
|
|
15
|
+
### Example Usage
|
|
16
|
+
|
|
17
|
+
<!-- UsageSnippet language="typescript" operationID="post_/auth/keys" method="post" path="/auth/keys" -->
|
|
18
|
+
```typescript
|
|
19
|
+
import { OpenRouter } from "@openrouter/sdk";
|
|
20
|
+
|
|
21
|
+
const openRouter = new OpenRouter({
|
|
22
|
+
apiKey: process.env["OPENROUTER_API_KEY"] ?? "",
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
async function run() {
|
|
26
|
+
const result = await openRouter.oAuth.postAuthKeys({
|
|
27
|
+
code: "auth_code_abc123def456",
|
|
28
|
+
codeVerifier: "dBjftJeZ4CVP-mB92K27uhbUJU1p1r_wW1gFWFOEjXk",
|
|
29
|
+
codeChallengeMethod: "S256",
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
console.log(result);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
run();
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
### Standalone function
|
|
39
|
+
|
|
40
|
+
The standalone function version of this method:
|
|
41
|
+
|
|
42
|
+
```typescript
|
|
43
|
+
import { OpenRouterCore } from "@openrouter/sdk/core.js";
|
|
44
|
+
import { oAuthPostAuthKeys } from "@openrouter/sdk/funcs/oAuthPostAuthKeys.js";
|
|
45
|
+
|
|
46
|
+
// Use `OpenRouterCore` for best tree-shaking performance.
|
|
47
|
+
// You can create one instance of it to use across an application.
|
|
48
|
+
const openRouter = new OpenRouterCore({
|
|
49
|
+
apiKey: process.env["OPENROUTER_API_KEY"] ?? "",
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
async function run() {
|
|
53
|
+
const res = await oAuthPostAuthKeys(openRouter, {
|
|
54
|
+
code: "auth_code_abc123def456",
|
|
55
|
+
codeVerifier: "dBjftJeZ4CVP-mB92K27uhbUJU1p1r_wW1gFWFOEjXk",
|
|
56
|
+
codeChallengeMethod: "S256",
|
|
57
|
+
});
|
|
58
|
+
if (res.ok) {
|
|
59
|
+
const { value: result } = res;
|
|
60
|
+
console.log(result);
|
|
61
|
+
} else {
|
|
62
|
+
console.log("oAuthPostAuthKeys failed:", res.error);
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
run();
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
### React hooks and utilities
|
|
70
|
+
|
|
71
|
+
This method can be used in React components through the following hooks and
|
|
72
|
+
associated utilities.
|
|
73
|
+
|
|
74
|
+
> Check out [this guide][hook-guide] for information about each of the utilities
|
|
75
|
+
> below and how to get started using React hooks.
|
|
76
|
+
|
|
77
|
+
[hook-guide]: ../../../REACT_QUERY.md
|
|
78
|
+
|
|
79
|
+
```tsx
|
|
80
|
+
import {
|
|
81
|
+
// Mutation hook for triggering the API call.
|
|
82
|
+
useOAuthPostAuthKeysMutation
|
|
83
|
+
} from "@openrouter/sdk/react-query/oAuthPostAuthKeys.js";
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
### Parameters
|
|
87
|
+
|
|
88
|
+
| Parameter | Type | Required | Description |
|
|
89
|
+
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
90
|
+
| `request` | [operations.PostAuthKeysRequest](../../models/operations/postauthkeysrequest.md) | :heavy_check_mark: | The request object to use for the request. |
|
|
91
|
+
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
|
|
92
|
+
| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. |
|
|
93
|
+
| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
|
|
94
|
+
|
|
95
|
+
### Response
|
|
96
|
+
|
|
97
|
+
**Promise\<[operations.PostAuthKeysResponse](../../models/operations/postauthkeysresponse.md)\>**
|
|
98
|
+
|
|
99
|
+
### Errors
|
|
100
|
+
|
|
101
|
+
| Error Type | Status Code | Content Type |
|
|
102
|
+
| ----------------------------- | ----------------------------- | ----------------------------- |
|
|
103
|
+
| errors.OpenRouterDefaultError | 4XX, 5XX | \*/\* |
|
|
104
|
+
|
|
105
|
+
## postAuthKeysCode
|
|
106
|
+
|
|
107
|
+
Create an authorization code for the PKCE flow to generate a user-controlled API key
|
|
108
|
+
|
|
109
|
+
### Example Usage
|
|
110
|
+
|
|
111
|
+
<!-- UsageSnippet language="typescript" operationID="post_/auth/keys/code" method="post" path="/auth/keys/code" -->
|
|
112
|
+
```typescript
|
|
113
|
+
import { OpenRouter } from "@openrouter/sdk";
|
|
114
|
+
|
|
115
|
+
const openRouter = new OpenRouter({
|
|
116
|
+
apiKey: process.env["OPENROUTER_API_KEY"] ?? "",
|
|
117
|
+
});
|
|
118
|
+
|
|
119
|
+
async function run() {
|
|
120
|
+
const result = await openRouter.oAuth.postAuthKeysCode({
|
|
121
|
+
callbackUrl: "https://myapp.com/auth/callback",
|
|
122
|
+
codeChallenge: "E9Melhoa2OwvFrEMTJguCHaoeK1t8URWbuGJSstw-cM",
|
|
123
|
+
codeChallengeMethod: "S256",
|
|
124
|
+
limit: "100.0",
|
|
125
|
+
});
|
|
126
|
+
|
|
127
|
+
console.log(result);
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
run();
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
### Standalone function
|
|
134
|
+
|
|
135
|
+
The standalone function version of this method:
|
|
136
|
+
|
|
137
|
+
```typescript
|
|
138
|
+
import { OpenRouterCore } from "@openrouter/sdk/core.js";
|
|
139
|
+
import { oAuthPostAuthKeysCode } from "@openrouter/sdk/funcs/oAuthPostAuthKeysCode.js";
|
|
140
|
+
|
|
141
|
+
// Use `OpenRouterCore` for best tree-shaking performance.
|
|
142
|
+
// You can create one instance of it to use across an application.
|
|
143
|
+
const openRouter = new OpenRouterCore({
|
|
144
|
+
apiKey: process.env["OPENROUTER_API_KEY"] ?? "",
|
|
145
|
+
});
|
|
146
|
+
|
|
147
|
+
async function run() {
|
|
148
|
+
const res = await oAuthPostAuthKeysCode(openRouter, {
|
|
149
|
+
callbackUrl: "https://myapp.com/auth/callback",
|
|
150
|
+
codeChallenge: "E9Melhoa2OwvFrEMTJguCHaoeK1t8URWbuGJSstw-cM",
|
|
151
|
+
codeChallengeMethod: "S256",
|
|
152
|
+
limit: "100.0",
|
|
153
|
+
});
|
|
154
|
+
if (res.ok) {
|
|
155
|
+
const { value: result } = res;
|
|
156
|
+
console.log(result);
|
|
157
|
+
} else {
|
|
158
|
+
console.log("oAuthPostAuthKeysCode failed:", res.error);
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
run();
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
### React hooks and utilities
|
|
166
|
+
|
|
167
|
+
This method can be used in React components through the following hooks and
|
|
168
|
+
associated utilities.
|
|
169
|
+
|
|
170
|
+
> Check out [this guide][hook-guide] for information about each of the utilities
|
|
171
|
+
> below and how to get started using React hooks.
|
|
172
|
+
|
|
173
|
+
[hook-guide]: ../../../REACT_QUERY.md
|
|
174
|
+
|
|
175
|
+
```tsx
|
|
176
|
+
import {
|
|
177
|
+
// Mutation hook for triggering the API call.
|
|
178
|
+
useOAuthPostAuthKeysCodeMutation
|
|
179
|
+
} from "@openrouter/sdk/react-query/oAuthPostAuthKeysCode.js";
|
|
180
|
+
```
|
|
181
|
+
|
|
182
|
+
### Parameters
|
|
183
|
+
|
|
184
|
+
| Parameter | Type | Required | Description |
|
|
185
|
+
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
186
|
+
| `request` | [operations.PostAuthKeysCodeRequest](../../models/operations/postauthkeyscoderequest.md) | :heavy_check_mark: | The request object to use for the request. |
|
|
187
|
+
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
|
|
188
|
+
| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. |
|
|
189
|
+
| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
|
|
190
|
+
|
|
191
|
+
### Response
|
|
192
|
+
|
|
193
|
+
**Promise\<[operations.PostAuthKeysCodeResponse](../../models/operations/postauthkeyscoderesponse.md)\>**
|
|
194
|
+
|
|
195
|
+
### Errors
|
|
196
|
+
|
|
197
|
+
| Error Type | Status Code | Content Type |
|
|
198
|
+
| ----------------------------- | ----------------------------- | ----------------------------- |
|
|
199
|
+
| errors.OpenRouterDefaultError | 4XX, 5XX | \*/\* |
|
|
@@ -10,8 +10,6 @@ OpenRouter Documentation
|
|
|
10
10
|
### Available Operations
|
|
11
11
|
|
|
12
12
|
* [getCredits](#getcredits) - Get total credits purchased and used for the authenticated user
|
|
13
|
-
* [postCreditsCoinbase](#postcreditscoinbase) - Create a Coinbase charge for crypto payment
|
|
14
|
-
* [getProviders](#getproviders)
|
|
15
13
|
|
|
16
14
|
## getCredits
|
|
17
15
|
|
|
@@ -106,185 +104,4 @@ import {
|
|
|
106
104
|
|
|
107
105
|
| Error Type | Status Code | Content Type |
|
|
108
106
|
| ----------------------------- | ----------------------------- | ----------------------------- |
|
|
109
|
-
| errors.OpenRouterDefaultError | 4XX, 5XX | \*/\* |
|
|
110
|
-
|
|
111
|
-
## postCreditsCoinbase
|
|
112
|
-
|
|
113
|
-
Create a Coinbase charge for crypto payment
|
|
114
|
-
|
|
115
|
-
### Example Usage
|
|
116
|
-
|
|
117
|
-
<!-- UsageSnippet language="typescript" operationID="post_/credits/coinbase" method="post" path="/credits/coinbase" -->
|
|
118
|
-
```typescript
|
|
119
|
-
import { OpenRouter } from "@openrouter/sdk";
|
|
120
|
-
|
|
121
|
-
const openRouter = new OpenRouter();
|
|
122
|
-
|
|
123
|
-
async function run() {
|
|
124
|
-
const result = await openRouter.postCreditsCoinbase({
|
|
125
|
-
bearer: process.env["OPENROUTER_BEARER"] ?? "",
|
|
126
|
-
});
|
|
127
|
-
|
|
128
|
-
console.log(result);
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
run();
|
|
132
|
-
```
|
|
133
|
-
|
|
134
|
-
### Standalone function
|
|
135
|
-
|
|
136
|
-
The standalone function version of this method:
|
|
137
|
-
|
|
138
|
-
```typescript
|
|
139
|
-
import { OpenRouterCore } from "@openrouter/sdk/core.js";
|
|
140
|
-
import { postCreditsCoinbase } from "@openrouter/sdk/funcs/postCreditsCoinbase.js";
|
|
141
|
-
|
|
142
|
-
// Use `OpenRouterCore` for best tree-shaking performance.
|
|
143
|
-
// You can create one instance of it to use across an application.
|
|
144
|
-
const openRouter = new OpenRouterCore();
|
|
145
|
-
|
|
146
|
-
async function run() {
|
|
147
|
-
const res = await postCreditsCoinbase(openRouter, {
|
|
148
|
-
bearer: process.env["OPENROUTER_BEARER"] ?? "",
|
|
149
|
-
});
|
|
150
|
-
if (res.ok) {
|
|
151
|
-
const { value: result } = res;
|
|
152
|
-
console.log(result);
|
|
153
|
-
} else {
|
|
154
|
-
console.log("postCreditsCoinbase failed:", res.error);
|
|
155
|
-
}
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
run();
|
|
159
|
-
```
|
|
160
|
-
|
|
161
|
-
### React hooks and utilities
|
|
162
|
-
|
|
163
|
-
This method can be used in React components through the following hooks and
|
|
164
|
-
associated utilities.
|
|
165
|
-
|
|
166
|
-
> Check out [this guide][hook-guide] for information about each of the utilities
|
|
167
|
-
> below and how to get started using React hooks.
|
|
168
|
-
|
|
169
|
-
[hook-guide]: ../../../REACT_QUERY.md
|
|
170
|
-
|
|
171
|
-
```tsx
|
|
172
|
-
import {
|
|
173
|
-
// Mutation hook for triggering the API call.
|
|
174
|
-
usePostCreditsCoinbaseMutation
|
|
175
|
-
} from "@openrouter/sdk/react-query/postCreditsCoinbase.js";
|
|
176
|
-
```
|
|
177
|
-
|
|
178
|
-
### Parameters
|
|
179
|
-
|
|
180
|
-
| Parameter | Type | Required | Description |
|
|
181
|
-
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
182
|
-
| `request` | [operations.PostCreditsCoinbaseRequest](../../models/operations/postcreditscoinbaserequest.md) | :heavy_check_mark: | The request object to use for the request. |
|
|
183
|
-
| `security` | [operations.PostCreditsCoinbaseSecurity](../../models/operations/postcreditscoinbasesecurity.md) | :heavy_check_mark: | The security requirements to use for the request. |
|
|
184
|
-
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
|
|
185
|
-
| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. |
|
|
186
|
-
| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
|
|
187
|
-
|
|
188
|
-
### Response
|
|
189
|
-
|
|
190
|
-
**Promise\<[operations.PostCreditsCoinbaseResponse](../../models/operations/postcreditscoinbaseresponse.md)\>**
|
|
191
|
-
|
|
192
|
-
### Errors
|
|
193
|
-
|
|
194
|
-
| Error Type | Status Code | Content Type |
|
|
195
|
-
| ----------------------------- | ----------------------------- | ----------------------------- |
|
|
196
|
-
| errors.OpenRouterDefaultError | 4XX, 5XX | \*/\* |
|
|
197
|
-
|
|
198
|
-
## getProviders
|
|
199
|
-
|
|
200
|
-
### Example Usage
|
|
201
|
-
|
|
202
|
-
<!-- UsageSnippet language="typescript" operationID="get_/providers" method="get" path="/providers" -->
|
|
203
|
-
```typescript
|
|
204
|
-
import { OpenRouter } from "@openrouter/sdk";
|
|
205
|
-
|
|
206
|
-
const openRouter = new OpenRouter({
|
|
207
|
-
apiKey: process.env["OPENROUTER_API_KEY"] ?? "",
|
|
208
|
-
});
|
|
209
|
-
|
|
210
|
-
async function run() {
|
|
211
|
-
const result = await openRouter.getProviders();
|
|
212
|
-
|
|
213
|
-
console.log(result);
|
|
214
|
-
}
|
|
215
|
-
|
|
216
|
-
run();
|
|
217
|
-
```
|
|
218
|
-
|
|
219
|
-
### Standalone function
|
|
220
|
-
|
|
221
|
-
The standalone function version of this method:
|
|
222
|
-
|
|
223
|
-
```typescript
|
|
224
|
-
import { OpenRouterCore } from "@openrouter/sdk/core.js";
|
|
225
|
-
import { getProviders } from "@openrouter/sdk/funcs/getProviders.js";
|
|
226
|
-
|
|
227
|
-
// Use `OpenRouterCore` for best tree-shaking performance.
|
|
228
|
-
// You can create one instance of it to use across an application.
|
|
229
|
-
const openRouter = new OpenRouterCore({
|
|
230
|
-
apiKey: process.env["OPENROUTER_API_KEY"] ?? "",
|
|
231
|
-
});
|
|
232
|
-
|
|
233
|
-
async function run() {
|
|
234
|
-
const res = await getProviders(openRouter);
|
|
235
|
-
if (res.ok) {
|
|
236
|
-
const { value: result } = res;
|
|
237
|
-
console.log(result);
|
|
238
|
-
} else {
|
|
239
|
-
console.log("getProviders failed:", res.error);
|
|
240
|
-
}
|
|
241
|
-
}
|
|
242
|
-
|
|
243
|
-
run();
|
|
244
|
-
```
|
|
245
|
-
|
|
246
|
-
### React hooks and utilities
|
|
247
|
-
|
|
248
|
-
This method can be used in React components through the following hooks and
|
|
249
|
-
associated utilities.
|
|
250
|
-
|
|
251
|
-
> Check out [this guide][hook-guide] for information about each of the utilities
|
|
252
|
-
> below and how to get started using React hooks.
|
|
253
|
-
|
|
254
|
-
[hook-guide]: ../../../REACT_QUERY.md
|
|
255
|
-
|
|
256
|
-
```tsx
|
|
257
|
-
import {
|
|
258
|
-
// Query hooks for fetching data.
|
|
259
|
-
useGetProviders,
|
|
260
|
-
useGetProvidersSuspense,
|
|
261
|
-
|
|
262
|
-
// Utility for prefetching data during server-side rendering and in React
|
|
263
|
-
// Server Components that will be immediately available to client components
|
|
264
|
-
// using the hooks.
|
|
265
|
-
prefetchGetProviders,
|
|
266
|
-
|
|
267
|
-
// Utility to invalidate the query cache for this query in response to
|
|
268
|
-
// mutations and other user actions.
|
|
269
|
-
invalidateAllGetProviders,
|
|
270
|
-
} from "@openrouter/sdk/react-query/getProviders.js";
|
|
271
|
-
```
|
|
272
|
-
|
|
273
|
-
### Parameters
|
|
274
|
-
|
|
275
|
-
| Parameter | Type | Required | Description |
|
|
276
|
-
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
277
|
-
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
|
|
278
|
-
| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. |
|
|
279
|
-
| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
|
|
280
|
-
|
|
281
|
-
### Response
|
|
282
|
-
|
|
283
|
-
**Promise\<[operations.GetProvidersResponse](../../models/operations/getprovidersresponse.md)\>**
|
|
284
|
-
|
|
285
|
-
### Errors
|
|
286
|
-
|
|
287
|
-
| Error Type | Status Code | Content Type |
|
|
288
|
-
| ----------------------------- | ----------------------------- | ----------------------------- |
|
|
289
|
-
| errors.InternalServerError | 500 | application/json |
|
|
290
107
|
| errors.OpenRouterDefaultError | 4XX, 5XX | \*/\* |
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
# Providers
|
|
2
|
+
(*providers*)
|
|
3
|
+
|
|
4
|
+
## Overview
|
|
5
|
+
|
|
6
|
+
### Available Operations
|
|
7
|
+
|
|
8
|
+
* [getProviders](#getproviders) - List all available model providers
|
|
9
|
+
|
|
10
|
+
## getProviders
|
|
11
|
+
|
|
12
|
+
List all available model providers
|
|
13
|
+
|
|
14
|
+
### Example Usage
|
|
15
|
+
|
|
16
|
+
<!-- UsageSnippet language="typescript" operationID="get_/providers" method="get" path="/providers" -->
|
|
17
|
+
```typescript
|
|
18
|
+
import { OpenRouter } from "@openrouter/sdk";
|
|
19
|
+
|
|
20
|
+
const openRouter = new OpenRouter({
|
|
21
|
+
apiKey: process.env["OPENROUTER_API_KEY"] ?? "",
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
async function run() {
|
|
25
|
+
const result = await openRouter.providers.getProviders();
|
|
26
|
+
|
|
27
|
+
console.log(result);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
run();
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
### Standalone function
|
|
34
|
+
|
|
35
|
+
The standalone function version of this method:
|
|
36
|
+
|
|
37
|
+
```typescript
|
|
38
|
+
import { OpenRouterCore } from "@openrouter/sdk/core.js";
|
|
39
|
+
import { providersGetProviders } from "@openrouter/sdk/funcs/providersGetProviders.js";
|
|
40
|
+
|
|
41
|
+
// Use `OpenRouterCore` for best tree-shaking performance.
|
|
42
|
+
// You can create one instance of it to use across an application.
|
|
43
|
+
const openRouter = new OpenRouterCore({
|
|
44
|
+
apiKey: process.env["OPENROUTER_API_KEY"] ?? "",
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
async function run() {
|
|
48
|
+
const res = await providersGetProviders(openRouter);
|
|
49
|
+
if (res.ok) {
|
|
50
|
+
const { value: result } = res;
|
|
51
|
+
console.log(result);
|
|
52
|
+
} else {
|
|
53
|
+
console.log("providersGetProviders failed:", res.error);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
run();
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
### React hooks and utilities
|
|
61
|
+
|
|
62
|
+
This method can be used in React components through the following hooks and
|
|
63
|
+
associated utilities.
|
|
64
|
+
|
|
65
|
+
> Check out [this guide][hook-guide] for information about each of the utilities
|
|
66
|
+
> below and how to get started using React hooks.
|
|
67
|
+
|
|
68
|
+
[hook-guide]: ../../../REACT_QUERY.md
|
|
69
|
+
|
|
70
|
+
```tsx
|
|
71
|
+
import {
|
|
72
|
+
// Query hooks for fetching data.
|
|
73
|
+
useProvidersGetProviders,
|
|
74
|
+
useProvidersGetProvidersSuspense,
|
|
75
|
+
|
|
76
|
+
// Utility for prefetching data during server-side rendering and in React
|
|
77
|
+
// Server Components that will be immediately available to client components
|
|
78
|
+
// using the hooks.
|
|
79
|
+
prefetchProvidersGetProviders,
|
|
80
|
+
|
|
81
|
+
// Utility to invalidate the query cache for this query in response to
|
|
82
|
+
// mutations and other user actions.
|
|
83
|
+
invalidateAllProvidersGetProviders,
|
|
84
|
+
} from "@openrouter/sdk/react-query/providersGetProviders.js";
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
### Parameters
|
|
88
|
+
|
|
89
|
+
| Parameter | Type | Required | Description |
|
|
90
|
+
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
91
|
+
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
|
|
92
|
+
| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. |
|
|
93
|
+
| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
|
|
94
|
+
|
|
95
|
+
### Response
|
|
96
|
+
|
|
97
|
+
**Promise\<[operations.GetProvidersResponse](../../models/operations/getprovidersresponse.md)\>**
|
|
98
|
+
|
|
99
|
+
### Errors
|
|
100
|
+
|
|
101
|
+
| Error Type | Status Code | Content Type |
|
|
102
|
+
| ----------------------------- | ----------------------------- | ----------------------------- |
|
|
103
|
+
| errors.InternalServerError | 500 | application/json |
|
|
104
|
+
| errors.OpenRouterDefaultError | 4XX, 5XX | \*/\* |
|
package/jsr.json
CHANGED
package/package.json
CHANGED
|
@@ -27,7 +27,7 @@ import { Result } from "../types/fp.js";
|
|
|
27
27
|
/**
|
|
28
28
|
* Create a Coinbase charge for crypto payment
|
|
29
29
|
*/
|
|
30
|
-
export function
|
|
30
|
+
export function creditsPostCreditsCoinbase(
|
|
31
31
|
client: OpenRouterCore,
|
|
32
32
|
security: operations.PostCreditsCoinbaseSecurity,
|
|
33
33
|
request?: operations.PostCreditsCoinbaseRequest | undefined,
|
|
@@ -30,7 +30,7 @@ import { Result } from "../types/fp.js";
|
|
|
30
30
|
* @remarks
|
|
31
31
|
* Submits an embedding request to the embeddings router
|
|
32
32
|
*/
|
|
33
|
-
export function
|
|
33
|
+
export function embeddingsGenerate(
|
|
34
34
|
client: OpenRouterCore,
|
|
35
35
|
request?: operations.PostEmbeddingsRequest | undefined,
|
|
36
36
|
options?: RequestOptions,
|
|
@@ -27,7 +27,7 @@ import { Result } from "../types/fp.js";
|
|
|
27
27
|
/**
|
|
28
28
|
* Get a model's supported parameters and data about which are most popular
|
|
29
29
|
*/
|
|
30
|
-
export function
|
|
30
|
+
export function modelGetParametersAuthorSlug(
|
|
31
31
|
client: OpenRouterCore,
|
|
32
32
|
security: operations.GetParametersAuthorSlugSecurity,
|
|
33
33
|
request: operations.GetParametersAuthorSlugRequest,
|