@openrouter/sdk 0.12.3 → 0.12.4
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/esm/lib/config.d.ts +2 -2
- package/esm/lib/config.js +2 -2
- package/esm/models/chatrequest.d.ts +16 -16
- package/esm/models/chatrequest.js +8 -8
- package/esm/models/chatusage.d.ts +4 -4
- package/esm/models/chatusage.js +4 -4
- package/esm/models/createguardrailrequest.d.ts +2 -2
- package/esm/models/createguardrailrequest.js +1 -1
- package/esm/models/guardrail.d.ts +1 -1
- package/esm/models/guardrail.js +1 -1
- package/esm/models/model.d.ts +1 -1
- package/esm/models/model.js +1 -1
- package/esm/models/openresponsesresult.d.ts +5 -5
- package/esm/models/openresponsesresult.js +5 -5
- package/esm/models/operations/createkeys.d.ts +4 -4
- package/esm/models/operations/createkeys.js +3 -3
- package/esm/models/operations/getcurrentkey.d.ts +2 -2
- package/esm/models/operations/getcurrentkey.js +2 -2
- package/esm/models/operations/getgeneration.d.ts +17 -17
- package/esm/models/operations/getgeneration.js +17 -17
- package/esm/models/operations/getkey.d.ts +2 -2
- package/esm/models/operations/getkey.js +2 -2
- package/esm/models/operations/list.d.ts +4 -4
- package/esm/models/operations/list.js +3 -3
- package/esm/models/operations/listguardrailkeyassignments.d.ts +2 -2
- package/esm/models/operations/listguardrailkeyassignments.js +1 -1
- package/esm/models/operations/listguardrailmemberassignments.d.ts +2 -2
- package/esm/models/operations/listguardrailmemberassignments.js +1 -1
- package/esm/models/operations/listguardrails.d.ts +2 -2
- package/esm/models/operations/listguardrails.js +1 -1
- package/esm/models/operations/listkeyassignments.d.ts +2 -2
- package/esm/models/operations/listkeyassignments.js +1 -1
- package/esm/models/operations/listmemberassignments.d.ts +2 -2
- package/esm/models/operations/listmemberassignments.js +1 -1
- package/esm/models/operations/listorganizationmembers.d.ts +2 -2
- package/esm/models/operations/listorganizationmembers.js +1 -1
- package/esm/models/operations/updatekeys.d.ts +4 -4
- package/esm/models/operations/updatekeys.js +3 -3
- package/esm/models/percentilelatencycutoffs.d.ts +8 -8
- package/esm/models/percentilelatencycutoffs.js +4 -4
- package/esm/models/percentilethroughputcutoffs.d.ts +8 -8
- package/esm/models/percentilethroughputcutoffs.js +4 -4
- package/esm/models/publicendpoint.d.ts +5 -5
- package/esm/models/publicendpoint.js +5 -5
- package/esm/models/reasoningconfig.d.ts +2 -2
- package/esm/models/reasoningconfig.js +1 -1
- package/esm/models/responsesrequest.d.ts +14 -14
- package/esm/models/responsesrequest.js +7 -7
- package/esm/models/updateguardrailrequest.d.ts +2 -2
- package/esm/models/updateguardrailrequest.js +1 -1
- package/esm/models/usage.d.ts +2 -2
- package/esm/models/usage.js +2 -2
- package/esm/models/videogenerationusage.d.ts +1 -1
- package/esm/models/videogenerationusage.js +1 -1
- package/jsr.json +1 -1
- package/package.json +5 -5
package/esm/models/usage.js
CHANGED
|
@@ -30,7 +30,7 @@ export function outputTokensDetailsFromJSON(jsonString) {
|
|
|
30
30
|
/** @internal */
|
|
31
31
|
export const CostDetails$inboundSchema = z
|
|
32
32
|
.object({
|
|
33
|
-
upstream_inference_cost: z.number().optional(),
|
|
33
|
+
upstream_inference_cost: z.nullable(z.number()).optional(),
|
|
34
34
|
upstream_inference_input_cost: z.number(),
|
|
35
35
|
upstream_inference_output_cost: z.number(),
|
|
36
36
|
}).transform((v) => {
|
|
@@ -50,7 +50,7 @@ export const Usage$inboundSchema = z.object({
|
|
|
50
50
|
output_tokens: z.int(),
|
|
51
51
|
output_tokens_details: z.lazy(() => OutputTokensDetails$inboundSchema),
|
|
52
52
|
total_tokens: z.int(),
|
|
53
|
-
cost: z.number().optional(),
|
|
53
|
+
cost: z.nullable(z.number()).optional(),
|
|
54
54
|
cost_details: z.lazy(() => CostDetails$inboundSchema).optional(),
|
|
55
55
|
is_byok: z.boolean().optional(),
|
|
56
56
|
}).transform((v) => {
|
|
@@ -7,7 +7,7 @@ import { remap as remap$ } from "../lib/primitives.js";
|
|
|
7
7
|
import { safeParse } from "../lib/schemas.js";
|
|
8
8
|
/** @internal */
|
|
9
9
|
export const VideoGenerationUsage$inboundSchema = z.object({
|
|
10
|
-
cost: z.number().optional(),
|
|
10
|
+
cost: z.nullable(z.number()).optional(),
|
|
11
11
|
is_byok: z.boolean().optional(),
|
|
12
12
|
}).transform((v) => {
|
|
13
13
|
return remap$(v, {
|
package/jsr.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openrouter/sdk",
|
|
3
|
-
"version": "0.12.
|
|
3
|
+
"version": "0.12.4",
|
|
4
4
|
"author": "OpenRouter",
|
|
5
5
|
"description": "The OpenRouter TypeScript SDK is a type-safe toolkit for building AI applications with access to 300+ language models through a unified API.",
|
|
6
6
|
"keywords": [
|
|
@@ -70,14 +70,14 @@
|
|
|
70
70
|
"build": "tsc",
|
|
71
71
|
"prepublishOnly": "npm run build",
|
|
72
72
|
"prepare": "npm run build",
|
|
73
|
+
"typecheck": "tsc --noEmit",
|
|
74
|
+
"compile": "tsc",
|
|
75
|
+
"postinstall": "node scripts/check-types.js || true",
|
|
73
76
|
"test": "vitest --run --project unit",
|
|
74
77
|
"test:e2e": "vitest --run --project e2e",
|
|
75
78
|
"test:transit": "exit 0",
|
|
76
|
-
"typecheck:transit": "exit 0",
|
|
77
79
|
"test:watch": "vitest --watch --project unit",
|
|
78
|
-
"typecheck": "
|
|
79
|
-
"compile": "tsc",
|
|
80
|
-
"postinstall": "node scripts/check-types.js || true"
|
|
80
|
+
"typecheck:transit": "exit 0"
|
|
81
81
|
},
|
|
82
82
|
"peerDependencies": {},
|
|
83
83
|
"devDependencies": {
|