Skip to content

Commit c9c5f27

Browse files
committed
mor
1 parent 0ebb894 commit c9c5f27

File tree

9 files changed

+51
-62
lines changed

9 files changed

+51
-62
lines changed

.speakeasy/gen.lock

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ management:
55
docVersion: 1.0.0
66
speakeasyVersion: 1.622.2
77
generationVersion: 2.711.4
8-
releaseVersion: 0.4.5
9-
configChecksum: fd5fc81ac5b41d0d279d025ae0cace2c
8+
releaseVersion: 0.4.6
9+
configChecksum: 9a1cf412caf42aecd5cb1cf485559950
1010
features:
1111
typescript:
1212
acceptHeaders: 2.81.2

.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.4.5
30+
version: 0.4.6
3131
additionalDependencies:
3232
dependencies: {}
3333
devDependencies: {}

README.md

Lines changed: 42 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ For more information about the API: [OpenRouter Documentation](https://openroute
3535
* [Server-sent event streaming](#server-sent-event-streaming)
3636
* [Retries](#retries)
3737
* [Error Handling](#error-handling)
38-
* [Custom HTTP Client](#custom-http-client)
3938
* [Debugging](#debugging)
4039
* [Development](#development)
4140
* [Maturity](#maturity)
@@ -49,6 +48,7 @@ For more information about the API: [OpenRouter Documentation](https://openroute
4948
> [!TIP]
5049
> 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).
5150
51+
5252
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.
5353

5454
### NPM
@@ -131,7 +131,6 @@ This SDK supports the following security schemes globally:
131131
| `bearer` | http | HTTP Bearer | `OPENROUTER_BEARER` |
132132

133133
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-
135134
```typescript
136135
import { OpenRouter } from "openrouter";
137136

@@ -223,26 +222,26 @@ To read more about standalone functions, check [FUNCTIONS.md](./FUNCTIONS.md).
223222

224223
<summary>Available standalone functions</summary>
225224

226-
* [`analyticsGetActivity`](docs/sdks/analytics/README.md#getactivity) - Get user activity grouped by endpoint
227-
* [`apiKeysDeleteKeysHash`](docs/sdks/apikeys/README.md#deletekeyshash) - Delete an API key
228-
* [`apiKeysGetAuthKey`](docs/sdks/apikeys/README.md#getauthkey) - Get current API key
229-
* [`apiKeysGetKey`](docs/sdks/apikeys/README.md#getkey) - Get current API key
230-
* [`apiKeysGetKeys`](docs/sdks/apikeys/README.md#getkeys) - List API keys
231-
* [`apiKeysGetKeysHash`](docs/sdks/apikeys/README.md#getkeyshash) - Get a single API key
232-
* [`apiKeysPatchKeysHash`](docs/sdks/apikeys/README.md#patchkeyshash) - Update an API key
233-
* [`apiKeysPostKeys`](docs/sdks/apikeys/README.md#postkeys) - Create a new API key
234-
* [`chatSend`](docs/sdks/chat/README.md#send) - Create a chat completion
235-
* [`embeddingsPostEmbeddings`](docs/sdks/embeddings/README.md#postembeddings) - Submit an embedding request
236-
* [`endpointsGetEndpointsZdr`](docs/sdks/endpoints/README.md#getendpointszdr) - Preview the impact of ZDR on the available endpoints
237-
* [`endpointsGetModelsAuthorSlugEndpoints`](docs/sdks/endpoints/README.md#getmodelsauthorslugendpoints) - List all endpoints for a model
238-
* [`generationsGetGeneration`](docs/sdks/generations/README.md#getgeneration) - Get request & usage metadata for a generation
239-
* [`getCredits`](docs/sdks/openrouter/README.md#getcredits) - Get total credits purchased and used for the authenticated user
240-
* [`getProviders`](docs/sdks/openrouter/README.md#getproviders)
241-
* [`modelsGetModels`](docs/sdks/models/README.md#getmodels) - List all models and their properties
242-
* [`modelsGetModelsCount`](docs/sdks/models/README.md#getmodelscount) - Get total count of available models
243-
* [`modelsGetModelsUser`](docs/sdks/models/README.md#getmodelsuser) - List models filtered by user provider preferences
244-
* [`parametersGetParametersAuthorSlug`](docs/sdks/parameters/README.md#getparametersauthorslug) - Get a model's supported parameters and data about which are most popular
245-
* [`postCreditsCoinbase`](docs/sdks/openrouter/README.md#postcreditscoinbase) - Create a Coinbase charge for crypto payment
225+
- [`analyticsGetActivity`](docs/sdks/analytics/README.md#getactivity) - Get user activity grouped by endpoint
226+
- [`apiKeysDeleteKeysHash`](docs/sdks/apikeys/README.md#deletekeyshash) - Delete an API key
227+
- [`apiKeysGetAuthKey`](docs/sdks/apikeys/README.md#getauthkey) - Get current API key
228+
- [`apiKeysGetKey`](docs/sdks/apikeys/README.md#getkey) - Get current API key
229+
- [`apiKeysGetKeys`](docs/sdks/apikeys/README.md#getkeys) - List API keys
230+
- [`apiKeysGetKeysHash`](docs/sdks/apikeys/README.md#getkeyshash) - Get a single API key
231+
- [`apiKeysPatchKeysHash`](docs/sdks/apikeys/README.md#patchkeyshash) - Update an API key
232+
- [`apiKeysPostKeys`](docs/sdks/apikeys/README.md#postkeys) - Create a new API key
233+
- [`chatSend`](docs/sdks/chat/README.md#send) - Create a chat completion
234+
- [`embeddingsPostEmbeddings`](docs/sdks/embeddings/README.md#postembeddings) - Submit an embedding request
235+
- [`endpointsGetEndpointsZdr`](docs/sdks/endpoints/README.md#getendpointszdr) - Preview the impact of ZDR on the available endpoints
236+
- [`endpointsGetModelsAuthorSlugEndpoints`](docs/sdks/endpoints/README.md#getmodelsauthorslugendpoints) - List all endpoints for a model
237+
- [`generationsGetGeneration`](docs/sdks/generations/README.md#getgeneration) - Get request & usage metadata for a generation
238+
- [`getCredits`](docs/sdks/openrouter/README.md#getcredits) - Get total credits purchased and used for the authenticated user
239+
- [`getProviders`](docs/sdks/openrouter/README.md#getproviders)
240+
- [`modelsGetModels`](docs/sdks/models/README.md#getmodels) - List all models and their properties
241+
- [`modelsGetModelsCount`](docs/sdks/models/README.md#getmodelscount) - Get total count of available models
242+
- [`modelsGetModelsUser`](docs/sdks/models/README.md#getmodelsuser) - List models filtered by user provider preferences
243+
- [`parametersGetParametersAuthorSlug`](docs/sdks/parameters/README.md#getparametersauthorslug) - Get a model's supported parameters and data about which are most popular
244+
- [`postCreditsCoinbase`](docs/sdks/openrouter/README.md#postcreditscoinbase) - Create a Coinbase charge for crypto payment
246245

247246
</details>
248247
<!-- End Standalone functions [standalone-funcs] -->
@@ -269,26 +268,26 @@ To learn about this feature and how to get started, check
269268

270269
<summary>Available React hooks</summary>
271270

272-
* [`useAnalyticsGetActivity`](docs/sdks/analytics/README.md#getactivity) - Get user activity grouped by endpoint
273-
* [`useApiKeysDeleteKeysHashMutation`](docs/sdks/apikeys/README.md#deletekeyshash) - Delete an API key
274-
* [`useApiKeysGetAuthKey`](docs/sdks/apikeys/README.md#getauthkey) - Get current API key
275-
* [`useApiKeysGetKey`](docs/sdks/apikeys/README.md#getkey) - Get current API key
276-
* [`useApiKeysGetKeys`](docs/sdks/apikeys/README.md#getkeys) - List API keys
277-
* [`useApiKeysGetKeysHash`](docs/sdks/apikeys/README.md#getkeyshash) - Get a single API key
278-
* [`useApiKeysPatchKeysHashMutation`](docs/sdks/apikeys/README.md#patchkeyshash) - Update an API key
279-
* [`useApiKeysPostKeysMutation`](docs/sdks/apikeys/README.md#postkeys) - Create a new API key
280-
* [`useChatSendMutation`](docs/sdks/chat/README.md#send) - Create a chat completion
281-
* [`useEmbeddingsPostEmbeddingsMutation`](docs/sdks/embeddings/README.md#postembeddings) - Submit an embedding request
282-
* [`useEndpointsGetEndpointsZdr`](docs/sdks/endpoints/README.md#getendpointszdr) - Preview the impact of ZDR on the available endpoints
283-
* [`useEndpointsGetModelsAuthorSlugEndpoints`](docs/sdks/endpoints/README.md#getmodelsauthorslugendpoints) - List all endpoints for a model
284-
* [`useGenerationsGetGeneration`](docs/sdks/generations/README.md#getgeneration) - Get request & usage metadata for a generation
285-
* [`useGetCredits`](docs/sdks/openrouter/README.md#getcredits) - Get total credits purchased and used for the authenticated user
286-
* [`useGetProviders`](docs/sdks/openrouter/README.md#getproviders)
287-
* [`useModelsGetModels`](docs/sdks/models/README.md#getmodels) - List all models and their properties
288-
* [`useModelsGetModelsCount`](docs/sdks/models/README.md#getmodelscount) - Get total count of available models
289-
* [`useModelsGetModelsUser`](docs/sdks/models/README.md#getmodelsuser) - List models filtered by user provider preferences
290-
* [`useParametersGetParametersAuthorSlug`](docs/sdks/parameters/README.md#getparametersauthorslug) - Get a model's supported parameters and data about which are most popular
291-
* [`usePostCreditsCoinbaseMutation`](docs/sdks/openrouter/README.md#postcreditscoinbase) - Create a Coinbase charge for crypto payment
271+
- [`useAnalyticsGetActivity`](docs/sdks/analytics/README.md#getactivity) - Get user activity grouped by endpoint
272+
- [`useApiKeysDeleteKeysHashMutation`](docs/sdks/apikeys/README.md#deletekeyshash) - Delete an API key
273+
- [`useApiKeysGetAuthKey`](docs/sdks/apikeys/README.md#getauthkey) - Get current API key
274+
- [`useApiKeysGetKey`](docs/sdks/apikeys/README.md#getkey) - Get current API key
275+
- [`useApiKeysGetKeys`](docs/sdks/apikeys/README.md#getkeys) - List API keys
276+
- [`useApiKeysGetKeysHash`](docs/sdks/apikeys/README.md#getkeyshash) - Get a single API key
277+
- [`useApiKeysPatchKeysHashMutation`](docs/sdks/apikeys/README.md#patchkeyshash) - Update an API key
278+
- [`useApiKeysPostKeysMutation`](docs/sdks/apikeys/README.md#postkeys) - Create a new API key
279+
- [`useChatSendMutation`](docs/sdks/chat/README.md#send) - Create a chat completion
280+
- [`useEmbeddingsPostEmbeddingsMutation`](docs/sdks/embeddings/README.md#postembeddings) - Submit an embedding request
281+
- [`useEndpointsGetEndpointsZdr`](docs/sdks/endpoints/README.md#getendpointszdr) - Preview the impact of ZDR on the available endpoints
282+
- [`useEndpointsGetModelsAuthorSlugEndpoints`](docs/sdks/endpoints/README.md#getmodelsauthorslugendpoints) - List all endpoints for a model
283+
- [`useGenerationsGetGeneration`](docs/sdks/generations/README.md#getgeneration) - Get request & usage metadata for a generation
284+
- [`useGetCredits`](docs/sdks/openrouter/README.md#getcredits) - Get total credits purchased and used for the authenticated user
285+
- [`useGetProviders`](docs/sdks/openrouter/README.md#getproviders)
286+
- [`useModelsGetModels`](docs/sdks/models/README.md#getmodels) - List all models and their properties
287+
- [`useModelsGetModelsCount`](docs/sdks/models/README.md#getmodelscount) - Get total count of available models
288+
- [`useModelsGetModelsUser`](docs/sdks/models/README.md#getmodelsuser) - List models filtered by user provider preferences
289+
- [`useParametersGetParametersAuthorSlug`](docs/sdks/parameters/README.md#getparametersauthorslug) - Get a model's supported parameters and data about which are most popular
290+
- [`usePostCreditsCoinbaseMutation`](docs/sdks/openrouter/README.md#postcreditscoinbase) - Create a Coinbase charge for crypto payment
292291

293292
</details>
294293
<!-- End React hooks with TanStack Query [react-query] -->
@@ -331,7 +330,6 @@ run();
331330
Some of the endpoints in this SDK support retries. If you use the SDK without any configuration, it will fall back to the default retry strategy provided by the API. However, the default retry strategy can be overridden on a per-operation basis, or across the entire SDK.
332331

333332
To change the default retry strategy for a single API call, simply provide a retryConfig object to the call:
334-
335333
```typescript
336334
import { OpenRouter } from "openrouter";
337335

@@ -363,7 +361,6 @@ run();
363361
```
364362

365363
If you'd like to override the default retry strategy for all operations that support retries, you can provide a retryConfig at SDK initialization:
366-
367364
```typescript
368365
import { OpenRouter } from "openrouter";
369366

@@ -409,7 +406,6 @@ run();
409406
| `error.data$` | | Optional. Some errors may contain structured data. [See Error Classes](#error-classes). |
410407

411408
### Example
412-
413409
```typescript
414410
import { OpenRouter } from "openrouter";
415411
import * as errors from "openrouter/models/errors";
@@ -446,25 +442,22 @@ run();
446442
```
447443

448444
### Error Classes
449-
450445
**Primary error:**
451-
452446
* [`OpenRouterError`](./src/models/errors/openroutererror.ts): The base class for HTTP error responses.
453447

454448
<details><summary>Less common errors (8)</summary>
455449

456450
<br />
457451

458452
**Network errors:**
459-
460453
* [`ConnectionError`](./src/models/errors/httpclienterrors.ts): HTTP client was unable to make a request to a server.
461454
* [`RequestTimeoutError`](./src/models/errors/httpclienterrors.ts): HTTP request timed out due to an AbortSignal signal.
462455
* [`RequestAbortedError`](./src/models/errors/httpclienterrors.ts): HTTP request was aborted by the client.
463456
* [`InvalidRequestError`](./src/models/errors/httpclienterrors.ts): Any input used to create a request is invalid.
464457
* [`UnexpectedClientError`](./src/models/errors/httpclienterrors.ts): Unrecognised or unexpected error.
465458

466-
**Inherit from [`OpenRouterError`](./src/models/errors/openroutererror.ts)**:
467459

460+
**Inherit from [`OpenRouterError`](./src/models/errors/openroutererror.ts)**:
468461
* [`ChatError`](./src/models/errors/chaterror.ts): Bad request - invalid parameters. Applicable to 1 of 20 methods.*
469462
* [`InternalServerError`](./src/models/errors/internalservererror.ts): Internal Server Error. Status code `500`. Applicable to 1 of 20 methods.*
470463
* [`ResponseValidationError`](./src/models/errors/responsevalidationerror.ts): Type mismatch between the data returned from the server and the structure expected by the SDK. See `error.rawValue` for the raw value and `error.pretty()` for a nicely formatted multi-line string.

jsr.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
{
44
"name": "openrouter",
5-
"version": "0.4.5",
5+
"version": "0.4.6",
66
"exports": {
77
".": "./src/index.ts",
88
"./models/errors": "./src/models/errors/index.ts",

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "openrouter",
3-
"version": "0.4.5",
3+
"version": "0.4.6",
44
"author": "OpenRouter",
55
"type": "module",
66
"tshy": {

src/lib/config.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ export function serverURLFromOptions(options: SDKOptions): URL | null {
6363
export const SDK_METADATA = {
6464
language: "typescript",
6565
openapiDocVersion: "1.0.0",
66-
sdkVersion: "0.4.5",
66+
sdkVersion: "0.4.6",
6767
genVersion: "2.711.4",
68-
userAgent: "speakeasy-sdk/typescript 0.4.5 2.711.4 1.0.0 openrouter",
68+
userAgent: "speakeasy-sdk/typescript 0.4.6 2.711.4 1.0.0 openrouter",
6969
} as const;

src/node_modules/openrouter

Lines changed: 0 additions & 1 deletion
This file was deleted.

src/package.json

Lines changed: 0 additions & 3 deletions
This file was deleted.

0 commit comments

Comments
 (0)