Skip to content

Commit c618366

Browse files
committed
ci: regenerated with OpenAPI Doc , Speakeasy CLI 1.665.0
1 parent ba0fb90 commit c618366

24 files changed

+667
-306
lines changed

.speakeasy/gen.lock

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@ id: 8b6cd71c-ea04-44da-af45-e43968b5928d
33
management:
44
docChecksum: 0ecf8d42d5f305a124cbca4ffbda5eee
55
docVersion: 1.0.0
6-
speakeasyVersion: 1.660.0
7-
generationVersion: 2.760.2
8-
releaseVersion: 0.1.27
9-
configChecksum: 2c451c32d0e42b790ff08709ef1011b4
6+
speakeasyVersion: 1.665.0
7+
generationVersion: 2.767.2
8+
releaseVersion: 0.2.0
9+
configChecksum: 3bdb00da5598a173cf6cbf03954f1669
1010
repoURL: https://github.com/OpenRouterTeam/typescript-sdk.git
1111
installationURL: https://github.com/OpenRouterTeam/typescript-sdk
1212
published: true
@@ -15,7 +15,7 @@ features:
1515
acceptHeaders: 2.81.2
1616
additionalDependencies: 0.1.0
1717
constsAndDefaults: 0.1.12
18-
core: 3.26.9
18+
core: 3.26.13
1919
customCodeRegions: 0.1.0
2020
defaultEnabledRetries: 0.1.0
2121
deprecations: 2.81.1
@@ -35,11 +35,11 @@ features:
3535
openEnums: 0.1.1
3636
responseFormat: 0.2.3
3737
retries: 2.83.0
38-
sdkHooks: 0.3.0
38+
sdkHooks: 0.4.0
3939
serverEvents: 0.1.12
4040
serverEventsSentinels: 0.1.0
4141
serverIDs: 2.81.2
42-
unions: 2.86.0
42+
unions: 2.86.2
4343
generatedFiles:
4444
- .devcontainer/README.md
4545
- .devcontainer/devcontainer.json

.speakeasy/gen.yaml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ generation:
3030
generateNewTests: true
3131
skipResponseBodyAssertions: false
3232
typescript:
33-
version: 0.1.27
33+
version: 0.2.0
3434
acceptHeaderEnum: false
3535
additionalDependencies:
3636
dependencies: {}
@@ -71,7 +71,9 @@ typescript:
7171
exportZodModelNamespace: false
7272
flattenGlobalSecurity: true
7373
flatteningOrder: parameters-first
74+
formStringArrayEncodeMode: encoded-string
7475
forwardCompatibleEnumsByDefault: false
76+
forwardCompatibleUnionsByDefault: "false"
7577
generateExamples: true
7678
imports:
7779
option: openapi
@@ -82,13 +84,15 @@ typescript:
8284
shared: models
8385
webhooks: models/webhooks
8486
inferSSEOverload: true
87+
inferUnionDiscriminators: true
8588
inputModelSuffix: input
8689
jsonpath: rfc9535
8790
laxMode: strict
8891
maxMethodParams: 0
8992
methodArguments: infer-optional-args
9093
modelPropertyCasing: camel
9194
moduleFormat: esm
95+
multipartArrayFormat: legacy
9296
outputModelSuffix: output
9397
packageName: '@openrouter/sdk'
9498
responseFormat: flat

.speakeasy/workflow.lock

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
speakeasyVersion: 1.660.0
1+
speakeasyVersion: 1.665.0
22
sources:
33
OpenRouter API:
44
sourceNamespace: open-router-chat-completions-api
55
sourceRevisionDigest: sha256:01256c8494de6bfc13c36d82ae316a6a13d402194f844618bcd4d59e34f325f3
66
sourceBlobDigest: sha256:4c80e48fd5e1cd030e68d664eb93984b4d5946867252ff1755a2bd2a05eccd4e
77
tags:
88
- latest
9-
- matt-cache-control
9+
- speakeasy-sdk-regen-1762734783
1010
- 1.0.0
1111
targets:
1212
openrouter:
@@ -15,7 +15,7 @@ targets:
1515
sourceRevisionDigest: sha256:01256c8494de6bfc13c36d82ae316a6a13d402194f844618bcd4d59e34f325f3
1616
sourceBlobDigest: sha256:4c80e48fd5e1cd030e68d664eb93984b4d5946867252ff1755a2bd2a05eccd4e
1717
codeSamplesNamespace: open-router-chat-completions-api-typescript-code-samples
18-
codeSamplesRevisionDigest: sha256:b9f865c93ad3b73a288706cfe0cdbb54a0a2fe160c405b59bc45f567118e554a
18+
codeSamplesRevisionDigest: sha256:4fb983d31ef998eb30f12c38e07fb278a3054a1def2a61c418d71d553c648a66
1919
workflow:
2020
workflowVersion: 1.0.0
2121
speakeasyVersion: latest

RELEASES.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,4 +146,14 @@ Based on:
146146
### Generated
147147
- [typescript v0.1.2] .
148148
### Releases
149-
- [NPM v0.1.2] https://www.npmjs.com/package/@openrouter/sdk/v/0.1.2 - .
149+
- [NPM v0.1.2] https://www.npmjs.com/package/@openrouter/sdk/v/0.1.2 - .
150+
151+
## 2025-11-30 00:35:43
152+
### Changes
153+
Based on:
154+
- OpenAPI Doc
155+
- Speakeasy CLI 1.665.0 (2.767.2) https://github.com/speakeasy-api/speakeasy
156+
### Generated
157+
- [typescript v0.2.0] .
158+
### Releases
159+
- [NPM v0.2.0] https://www.npmjs.com/package/@openrouter/sdk/v/0.2.0 - .

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/sdk",
5-
"version": "0.1.27",
5+
"version": "0.2.0",
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/sdk",
3-
"version": "0.1.27",
3+
"version": "0.2.0",
44
"author": "OpenRouter",
55
"description": "The OpenRouter TypeScript SDK is a type-safe toolkit for building AI applications with access to 300+ language models through a unified API.",
66
"keywords": [

src/lib/config.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ export function serverURLFromOptions(options: SDKOptions): URL | null {
6969
export const SDK_METADATA = {
7070
language: "typescript",
7171
openapiDocVersion: "1.0.0",
72-
sdkVersion: "0.1.27",
73-
genVersion: "2.760.2",
74-
userAgent: "speakeasy-sdk/typescript 0.1.27 2.760.2 1.0.0 @openrouter/sdk",
72+
sdkVersion: "0.2.0",
73+
genVersion: "2.767.2",
74+
userAgent: "speakeasy-sdk/typescript 0.2.0 2.767.2 1.0.0 @openrouter/sdk",
7575
} as const;

src/lib/encodings.ts

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -102,8 +102,9 @@ export function encodeLabel(
102102
});
103103
encValue = mapped?.join("").slice(1);
104104
} else {
105-
const k =
106-
options?.explode && isPlainObject(value) ? `${encodeString(pk)}=` : "";
105+
const k = options?.explode && isPlainObject(value)
106+
? `${encodeString(pk)}=`
107+
: "";
107108
encValue = `${k}${encodeValue(pv)}`;
108109
}
109110

@@ -426,6 +427,7 @@ export function queryJoin(...args: (string | undefined)[]): string {
426427
type QueryEncoderOptions = {
427428
explode?: boolean;
428429
charEncoding?: "percent" | "none";
430+
allowEmptyValue?: string[];
429431
};
430432

431433
type QueryEncoder = (
@@ -440,7 +442,7 @@ type BulkQueryEncoder = (
440442
) => string;
441443

442444
export function queryEncoder(f: QueryEncoder): BulkQueryEncoder {
443-
const bulkEncode = function (
445+
const bulkEncode = function(
444446
values: Record<string, unknown>,
445447
options?: QueryEncoderOptions,
446448
): string {
@@ -450,7 +452,19 @@ export function queryEncoder(f: QueryEncoder): BulkQueryEncoder {
450452
charEncoding: options?.charEncoding ?? "percent",
451453
};
452454

455+
const allowEmptySet = new Set(options?.allowEmptyValue ?? []);
456+
453457
const encoded = Object.entries(values).map(([key, value]) => {
458+
if (allowEmptySet.has(key)) {
459+
if (
460+
value === undefined
461+
|| value === null
462+
|| value === ""
463+
|| (Array.isArray(value) && value.length === 0)
464+
) {
465+
return `${encodeURIComponent(key)}=`;
466+
}
467+
}
454468
return f(key, value, opts);
455469
});
456470
return queryJoin(...encoded);

src/models/chatgenerationparams.ts

Lines changed: 53 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -63,11 +63,11 @@ export type ChatGenerationParamsResponseFormatText = {
6363
};
6464

6565
export type ChatGenerationParamsResponseFormatUnion =
66-
| ResponseFormatJSONSchema
67-
| ResponseFormatTextGrammar
68-
| ChatGenerationParamsResponseFormatText
69-
| ChatGenerationParamsResponseFormatJSONObject
70-
| ChatGenerationParamsResponseFormatPython;
66+
| (ResponseFormatJSONSchema & { type: "json_schema" })
67+
| (ResponseFormatTextGrammar & { type: "grammar" })
68+
| (ChatGenerationParamsResponseFormatText & { type: "text" })
69+
| (ChatGenerationParamsResponseFormatJSONObject & { type: "json_object" })
70+
| (ChatGenerationParamsResponseFormatPython & { type: "python" });
7171

7272
export type ChatGenerationParamsStop = string | Array<string>;
7373

@@ -85,11 +85,11 @@ export type ChatGenerationParams = {
8585
presencePenalty?: number | null | undefined;
8686
reasoning?: Reasoning | undefined;
8787
responseFormat?:
88-
| ResponseFormatJSONSchema
89-
| ResponseFormatTextGrammar
90-
| ChatGenerationParamsResponseFormatText
91-
| ChatGenerationParamsResponseFormatJSONObject
92-
| ChatGenerationParamsResponseFormatPython
88+
| (ResponseFormatJSONSchema & { type: "json_schema" })
89+
| (ResponseFormatTextGrammar & { type: "grammar" })
90+
| (ChatGenerationParamsResponseFormatText & { type: "text" })
91+
| (ChatGenerationParamsResponseFormatJSONObject & { type: "json_object" })
92+
| (ChatGenerationParamsResponseFormatPython & { type: "python" })
9393
| undefined;
9494
seed?: number | null | undefined;
9595
stop?: string | Array<string> | null | undefined;
@@ -200,22 +200,34 @@ export function chatGenerationParamsResponseFormatTextToJSON(
200200

201201
/** @internal */
202202
export type ChatGenerationParamsResponseFormatUnion$Outbound =
203-
| ResponseFormatJSONSchema$Outbound
204-
| ResponseFormatTextGrammar$Outbound
205-
| ChatGenerationParamsResponseFormatText$Outbound
206-
| ChatGenerationParamsResponseFormatJSONObject$Outbound
207-
| ChatGenerationParamsResponseFormatPython$Outbound;
203+
| (ResponseFormatJSONSchema$Outbound & { type: "json_schema" })
204+
| (ResponseFormatTextGrammar$Outbound & { type: "grammar" })
205+
| (ChatGenerationParamsResponseFormatText$Outbound & { type: "text" })
206+
| (ChatGenerationParamsResponseFormatJSONObject$Outbound & {
207+
type: "json_object";
208+
})
209+
| (ChatGenerationParamsResponseFormatPython$Outbound & { type: "python" });
208210

209211
/** @internal */
210212
export const ChatGenerationParamsResponseFormatUnion$outboundSchema: z.ZodType<
211213
ChatGenerationParamsResponseFormatUnion$Outbound,
212214
ChatGenerationParamsResponseFormatUnion
213215
> = z.union([
214-
ResponseFormatJSONSchema$outboundSchema,
215-
ResponseFormatTextGrammar$outboundSchema,
216-
z.lazy(() => ChatGenerationParamsResponseFormatText$outboundSchema),
217-
z.lazy(() => ChatGenerationParamsResponseFormatJSONObject$outboundSchema),
218-
z.lazy(() => ChatGenerationParamsResponseFormatPython$outboundSchema),
216+
ResponseFormatJSONSchema$outboundSchema.and(
217+
z.object({ type: z.literal("json_schema") }),
218+
),
219+
ResponseFormatTextGrammar$outboundSchema.and(
220+
z.object({ type: z.literal("grammar") }),
221+
),
222+
z.lazy(() => ChatGenerationParamsResponseFormatText$outboundSchema).and(
223+
z.object({ type: z.literal("text") }),
224+
),
225+
z.lazy(() => ChatGenerationParamsResponseFormatJSONObject$outboundSchema).and(
226+
z.object({ type: z.literal("json_object") }),
227+
),
228+
z.lazy(() => ChatGenerationParamsResponseFormatPython$outboundSchema).and(
229+
z.object({ type: z.literal("python") }),
230+
),
219231
]);
220232

221233
export function chatGenerationParamsResponseFormatUnionToJSON(
@@ -261,11 +273,13 @@ export type ChatGenerationParams$Outbound = {
261273
presence_penalty?: number | null | undefined;
262274
reasoning?: Reasoning$Outbound | undefined;
263275
response_format?:
264-
| ResponseFormatJSONSchema$Outbound
265-
| ResponseFormatTextGrammar$Outbound
266-
| ChatGenerationParamsResponseFormatText$Outbound
267-
| ChatGenerationParamsResponseFormatJSONObject$Outbound
268-
| ChatGenerationParamsResponseFormatPython$Outbound
276+
| (ResponseFormatJSONSchema$Outbound & { type: "json_schema" })
277+
| (ResponseFormatTextGrammar$Outbound & { type: "grammar" })
278+
| (ChatGenerationParamsResponseFormatText$Outbound & { type: "text" })
279+
| (ChatGenerationParamsResponseFormatJSONObject$Outbound & {
280+
type: "json_object";
281+
})
282+
| (ChatGenerationParamsResponseFormatPython$Outbound & { type: "python" })
269283
| undefined;
270284
seed?: number | null | undefined;
271285
stop?: string | Array<string> | null | undefined;
@@ -296,11 +310,20 @@ export const ChatGenerationParams$outboundSchema: z.ZodType<
296310
presencePenalty: z.nullable(z.number()).optional(),
297311
reasoning: z.lazy(() => Reasoning$outboundSchema).optional(),
298312
responseFormat: z.union([
299-
ResponseFormatJSONSchema$outboundSchema,
300-
ResponseFormatTextGrammar$outboundSchema,
301-
z.lazy(() => ChatGenerationParamsResponseFormatText$outboundSchema),
302-
z.lazy(() => ChatGenerationParamsResponseFormatJSONObject$outboundSchema),
303-
z.lazy(() => ChatGenerationParamsResponseFormatPython$outboundSchema),
313+
ResponseFormatJSONSchema$outboundSchema.and(
314+
z.object({ type: z.literal("json_schema") }),
315+
),
316+
ResponseFormatTextGrammar$outboundSchema.and(
317+
z.object({ type: z.literal("grammar") }),
318+
),
319+
z.lazy(() => ChatGenerationParamsResponseFormatText$outboundSchema).and(
320+
z.object({ type: z.literal("text") }),
321+
),
322+
z.lazy(() => ChatGenerationParamsResponseFormatJSONObject$outboundSchema)
323+
.and(z.object({ type: z.literal("json_object") })),
324+
z.lazy(() => ChatGenerationParamsResponseFormatPython$outboundSchema).and(
325+
z.object({ type: z.literal("python") }),
326+
),
304327
]).optional(),
305328
seed: z.nullable(z.int()).optional(),
306329
stop: z.nullable(z.union([z.string(), z.array(z.string())])).optional(),

0 commit comments

Comments
 (0)