Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions .speakeasy/gen.lock
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
lockVersion: 2.0.0
id: 8b6cd71c-ea04-44da-af45-e43968b5928d
management:
docChecksum: 591fccdc6b495b1230644174853f9113
docChecksum: 8e530fc8f007ea5179129b89d89ba958
docVersion: 1.0.0
speakeasyVersion: 1.666.0
generationVersion: 2.768.0
releaseVersion: 0.2.6
configChecksum: faa7e08defaa15a2a216f64d15953590
releaseVersion: 0.2.9
configChecksum: 12a255b210945a121402c22f63d8d8e5
repoURL: https://github.com/OpenRouterTeam/typescript-sdk.git
installationURL: https://github.com/OpenRouterTeam/typescript-sdk
published: true
Expand Down Expand Up @@ -67,7 +67,6 @@ generatedFiles:
- docs/models/chatgenerationtokenusage.md
- docs/models/chatmessagecontentitem.md
- docs/models/chatmessagecontentitemaudio.md
- docs/models/chatmessagecontentitemaudioformat.md
- docs/models/chatmessagecontentitemaudioinputaudio.md
- docs/models/chatmessagecontentitemcachecontrol.md
- docs/models/chatmessagecontentitemimage.md
Expand Down Expand Up @@ -108,6 +107,7 @@ generatedFiles:
- docs/models/costdetails.md
- docs/models/createchargerequest.md
- docs/models/datacollection.md
- docs/models/debug.md
- docs/models/defaultparameters.md
- docs/models/edgenetworktimeoutresponseerrordata.md
- docs/models/effort.md
Expand Down Expand Up @@ -288,7 +288,6 @@ generatedFiles:
- docs/models/operations/createembeddingsprovider.md
- docs/models/operations/createembeddingsrequest.md
- docs/models/operations/createembeddingsresponse.md
- docs/models/operations/createembeddingsresponsebody.md
- docs/models/operations/createkeysdata.md
- docs/models/operations/createkeyslimitreset.md
- docs/models/operations/createkeysrequest.md
Expand Down
2 changes: 1 addition & 1 deletion .speakeasy/gen.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ generation:
skipResponseBodyAssertions: false
preApplyUnionDiscriminators: true
typescript:
version: 0.2.6
version: 0.2.9
acceptHeaderEnum: false
additionalDependencies:
dependencies: {}
Expand Down
18 changes: 5 additions & 13 deletions .speakeasy/in.openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4639,14 +4639,6 @@ components:
type: string
format:
type: string
enum:
- wav
- mp3
- flac
- m4a
- ogg
- pcm16
- pcm24
required:
- data
- format
Expand Down Expand Up @@ -5195,6 +5187,11 @@ components:
- type: 'null'
user:
type: string
debug:
type: object
properties:
echo_upstream_body:
type: boolean
required:
- messages
ChatResponseChoice:
Expand Down Expand Up @@ -6230,11 +6227,6 @@ paths:
- object
- data
- model
text/event-stream:
schema:
type: string
description: Not used for embeddings - embeddings do not support streaming
x-speakeasy-sse-sentinel: '[DONE]'
'400':
description: Bad Request - Invalid request parameters or malformed input
content:
Expand Down
19 changes: 5 additions & 14 deletions .speakeasy/out.openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4659,15 +4659,6 @@ components:
type: string
format:
type: string
enum:
- wav
- mp3
- flac
- m4a
- ogg
- pcm16
- pcm24
x-speakeasy-unknown-values: allow
required:
- data
- format
Expand Down Expand Up @@ -5219,6 +5210,11 @@ components:
- type: 'null'
user:
type: string
debug:
type: object
properties:
echo_upstream_body:
type: boolean
required:
- messages
ChatResponseChoice:
Expand Down Expand Up @@ -6246,11 +6242,6 @@ paths:
- object
- data
- model
text/event-stream:
schema:
type: string
description: Not used for embeddings - embeddings do not support streaming
x-speakeasy-sse-sentinel: '[DONE]'
'400':
description: Bad Request - Invalid request parameters or malformed input
content:
Expand Down
12 changes: 6 additions & 6 deletions .speakeasy/workflow.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,20 @@ speakeasyVersion: 1.666.0
sources:
OpenRouter API:
sourceNamespace: open-router-chat-completions-api
sourceRevisionDigest: sha256:430fa9a22e960fd04a393c99eb3c967b11b5fbda6b19a104bfcd745efe887df3
sourceBlobDigest: sha256:c65ea29dcae3bb0b31cba1f207741a8a835620bc6e8921e614a7c371055d850c
sourceRevisionDigest: sha256:697f956356ab0195b9a9b9a5106e4ac979caa551709b3614c723df972c661829
sourceBlobDigest: sha256:a286a09ceced7f78a685731aef81d1498b89a6a46f3794219dc93fa2d822853b
tags:
- latest
- updates
- matt-fix-more-types
- 1.0.0
targets:
openrouter:
source: OpenRouter API
sourceNamespace: open-router-chat-completions-api
sourceRevisionDigest: sha256:430fa9a22e960fd04a393c99eb3c967b11b5fbda6b19a104bfcd745efe887df3
sourceBlobDigest: sha256:c65ea29dcae3bb0b31cba1f207741a8a835620bc6e8921e614a7c371055d850c
sourceRevisionDigest: sha256:697f956356ab0195b9a9b9a5106e4ac979caa551709b3614c723df972c661829
sourceBlobDigest: sha256:a286a09ceced7f78a685731aef81d1498b89a6a46f3794219dc93fa2d822853b
codeSamplesNamespace: open-router-chat-completions-api-typescript-code-samples
codeSamplesRevisionDigest: sha256:6f8f3b329dff31738a363e4df0f0c73002798aa996735b46a56968936e65b5f4
codeSamplesRevisionDigest: sha256:753b0f6f2de1c2d4fec4823c0f552e084d3b4083591c998375074e2d11fc7d6d
workflow:
workflowVersion: 1.0.0
speakeasyVersion: 1.666.0
Expand Down
3 changes: 2 additions & 1 deletion docs/models/chatgenerationparams.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,5 @@ let value: ChatGenerationParams = {
| `toolChoice` | *any* | :heavy_minus_sign: | N/A |
| `tools` | [models.ToolDefinitionJson](../models/tooldefinitionjson.md)[] | :heavy_minus_sign: | N/A |
| `topP` | *number* | :heavy_minus_sign: | N/A |
| `user` | *string* | :heavy_minus_sign: | N/A |
| `user` | *string* | :heavy_minus_sign: | N/A |
| `debug` | [models.Debug](../models/debug.md) | :heavy_minus_sign: | N/A |
2 changes: 1 addition & 1 deletion docs/models/chatmessagecontentitem.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ const value: models.ChatMessageContentItemAudio = {
type: "input_audio",
inputAudio: {
data: "<value>",
format: "pcm24",
format: "<value>",
},
};
```
Expand Down
2 changes: 1 addition & 1 deletion docs/models/chatmessagecontentitemaudio.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ let value: ChatMessageContentItemAudio = {
type: "input_audio",
inputAudio: {
data: "<value>",
format: "pcm24",
format: "<value>",
},
};
```
Expand Down
17 changes: 0 additions & 17 deletions docs/models/chatmessagecontentitemaudioformat.md

This file was deleted.

10 changes: 5 additions & 5 deletions docs/models/chatmessagecontentitemaudioinputaudio.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@ import { ChatMessageContentItemAudioInputAudio } from "@openrouter/sdk/models";

let value: ChatMessageContentItemAudioInputAudio = {
data: "<value>",
format: "wav",
format: "<value>",
};
```

## Fields

| Field | Type | Required | Description |
| ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ |
| `data` | *string* | :heavy_check_mark: | N/A |
| `format` | [models.ChatMessageContentItemAudioFormat](../models/chatmessagecontentitemaudioformat.md) | :heavy_check_mark: | N/A |
| Field | Type | Required | Description |
| ------------------ | ------------------ | ------------------ | ------------------ |
| `data` | *string* | :heavy_check_mark: | N/A |
| `format` | *string* | :heavy_check_mark: | N/A |
15 changes: 15 additions & 0 deletions docs/models/debug.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Debug

## Example Usage

```typescript
import { Debug } from "@openrouter/sdk/models";

let value: Debug = {};
```

## Fields

| Field | Type | Required | Description |
| ------------------ | ------------------ | ------------------ | ------------------ |
| `echoUpstreamBody` | *boolean* | :heavy_minus_sign: | N/A |
31 changes: 20 additions & 11 deletions docs/models/operations/createembeddingsresponse.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,30 @@
# CreateEmbeddingsResponse

Embedding response

## Supported Types

### `operations.CreateEmbeddingsResponseBody`
## Example Usage

```typescript
const value: operations.CreateEmbeddingsResponseBody = {
import { CreateEmbeddingsResponse } from "@openrouter/sdk/models/operations";

let value: CreateEmbeddingsResponse = {
object: "list",
data: [],
model: "Focus",
data: [
{
object: "embedding",
embedding: "<value>",
},
],
model: "Mustang",
};
```

### `string`

```typescript
const value: string = "<value>";
```
## Fields

| Field | Type | Required | Description |
| ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ |
| `id` | *string* | :heavy_minus_sign: | N/A |
| `object` | [operations.ObjectT](../../models/operations/objectt.md) | :heavy_check_mark: | N/A |
| `data` | [operations.CreateEmbeddingsData](../../models/operations/createembeddingsdata.md)[] | :heavy_check_mark: | N/A |
| `model` | *string* | :heavy_check_mark: | N/A |
| `usage` | [operations.Usage](../../models/operations/usage.md) | :heavy_minus_sign: | N/A |
25 changes: 0 additions & 25 deletions docs/models/operations/createembeddingsresponsebody.md

This file was deleted.

2 changes: 1 addition & 1 deletion jsr.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

{
"name": "@openrouter/sdk",
"version": "0.2.6",
"version": "0.2.9",
"exports": {
".": "./src/index.ts",
"./models/errors": "./src/models/errors/index.ts",
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@openrouter/sdk",
"version": "0.2.6",
"version": "0.2.9",
"author": "OpenRouter",
"description": "The OpenRouter TypeScript SDK is a type-safe toolkit for building AI applications with access to 300+ language models through a unified API.",
"keywords": [
Expand Down
5 changes: 1 addition & 4 deletions src/funcs/embeddingsGenerate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ async function $do(

const headers = new Headers(compactMap({
"Content-Type": "application/json",
Accept: "application/json;q=1, text/event-stream;q=0",
Accept: "application/json",
}));

const secConfig = await extractSecurity(client._options.apiKey);
Expand Down Expand Up @@ -197,9 +197,6 @@ async function $do(
| SDKValidationError
>(
M.json(200, operations.CreateEmbeddingsResponse$inboundSchema),
M.text(200, operations.CreateEmbeddingsResponse$inboundSchema, {
ctype: "text/event-stream",
}),
M.jsonErr(400, errors.BadRequestResponseError$inboundSchema),
M.jsonErr(401, errors.UnauthorizedResponseError$inboundSchema),
M.jsonErr(402, errors.PaymentRequiredResponseError$inboundSchema),
Expand Down
4 changes: 2 additions & 2 deletions src/lib/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ export function serverURLFromOptions(options: SDKOptions): URL | null {
export const SDK_METADATA = {
language: "typescript",
openapiDocVersion: "1.0.0",
sdkVersion: "0.2.6",
sdkVersion: "0.2.9",
genVersion: "2.768.0",
userAgent: "speakeasy-sdk/typescript 0.2.6 2.768.0 1.0.0 @openrouter/sdk",
userAgent: "speakeasy-sdk/typescript 0.2.9 2.768.0 1.0.0 @openrouter/sdk",
} as const;
Loading
Loading