@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.
Files changed (56) hide show
  1. package/esm/lib/config.d.ts +2 -2
  2. package/esm/lib/config.js +2 -2
  3. package/esm/models/chatrequest.d.ts +16 -16
  4. package/esm/models/chatrequest.js +8 -8
  5. package/esm/models/chatusage.d.ts +4 -4
  6. package/esm/models/chatusage.js +4 -4
  7. package/esm/models/createguardrailrequest.d.ts +2 -2
  8. package/esm/models/createguardrailrequest.js +1 -1
  9. package/esm/models/guardrail.d.ts +1 -1
  10. package/esm/models/guardrail.js +1 -1
  11. package/esm/models/model.d.ts +1 -1
  12. package/esm/models/model.js +1 -1
  13. package/esm/models/openresponsesresult.d.ts +5 -5
  14. package/esm/models/openresponsesresult.js +5 -5
  15. package/esm/models/operations/createkeys.d.ts +4 -4
  16. package/esm/models/operations/createkeys.js +3 -3
  17. package/esm/models/operations/getcurrentkey.d.ts +2 -2
  18. package/esm/models/operations/getcurrentkey.js +2 -2
  19. package/esm/models/operations/getgeneration.d.ts +17 -17
  20. package/esm/models/operations/getgeneration.js +17 -17
  21. package/esm/models/operations/getkey.d.ts +2 -2
  22. package/esm/models/operations/getkey.js +2 -2
  23. package/esm/models/operations/list.d.ts +4 -4
  24. package/esm/models/operations/list.js +3 -3
  25. package/esm/models/operations/listguardrailkeyassignments.d.ts +2 -2
  26. package/esm/models/operations/listguardrailkeyassignments.js +1 -1
  27. package/esm/models/operations/listguardrailmemberassignments.d.ts +2 -2
  28. package/esm/models/operations/listguardrailmemberassignments.js +1 -1
  29. package/esm/models/operations/listguardrails.d.ts +2 -2
  30. package/esm/models/operations/listguardrails.js +1 -1
  31. package/esm/models/operations/listkeyassignments.d.ts +2 -2
  32. package/esm/models/operations/listkeyassignments.js +1 -1
  33. package/esm/models/operations/listmemberassignments.d.ts +2 -2
  34. package/esm/models/operations/listmemberassignments.js +1 -1
  35. package/esm/models/operations/listorganizationmembers.d.ts +2 -2
  36. package/esm/models/operations/listorganizationmembers.js +1 -1
  37. package/esm/models/operations/updatekeys.d.ts +4 -4
  38. package/esm/models/operations/updatekeys.js +3 -3
  39. package/esm/models/percentilelatencycutoffs.d.ts +8 -8
  40. package/esm/models/percentilelatencycutoffs.js +4 -4
  41. package/esm/models/percentilethroughputcutoffs.d.ts +8 -8
  42. package/esm/models/percentilethroughputcutoffs.js +4 -4
  43. package/esm/models/publicendpoint.d.ts +5 -5
  44. package/esm/models/publicendpoint.js +5 -5
  45. package/esm/models/reasoningconfig.d.ts +2 -2
  46. package/esm/models/reasoningconfig.js +1 -1
  47. package/esm/models/responsesrequest.d.ts +14 -14
  48. package/esm/models/responsesrequest.js +7 -7
  49. package/esm/models/updateguardrailrequest.d.ts +2 -2
  50. package/esm/models/updateguardrailrequest.js +1 -1
  51. package/esm/models/usage.d.ts +2 -2
  52. package/esm/models/usage.js +2 -2
  53. package/esm/models/videogenerationusage.d.ts +1 -1
  54. package/esm/models/videogenerationusage.js +1 -1
  55. package/jsr.json +1 -1
  56. package/package.json +5 -5
@@ -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) => {
@@ -8,7 +8,7 @@ export type VideoGenerationUsage = {
8
8
  /**
9
9
  * The cost of the video generation in USD.
10
10
  */
11
- cost?: number | undefined;
11
+ cost?: number | null | undefined;
12
12
  /**
13
13
  * Whether the request was made using a Bring Your Own Key configuration.
14
14
  */
@@ -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
@@ -2,7 +2,7 @@
2
2
 
3
3
  {
4
4
  "name": "@openrouter/sdk",
5
- "version": "0.12.3",
5
+ "version": "0.12.4",
6
6
  "exports": {
7
7
  ".": "./src/index.ts",
8
8
  "./models/errors": "./src/models/errors/index.ts",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openrouter/sdk",
3
- "version": "0.12.3",
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": "tsc --noEmit",
79
- "compile": "tsc",
80
- "postinstall": "node scripts/check-types.js || true"
80
+ "typecheck:transit": "exit 0"
81
81
  },
82
82
  "peerDependencies": {},
83
83
  "devDependencies": {