zorihq 0.19.1 → 0.21.0

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 (66) hide show
  1. package/CHANGELOG.md +28 -0
  2. package/package.json +1 -1
  3. package/resources/v1/analytics/analytics.d.mts +54 -3
  4. package/resources/v1/analytics/analytics.d.mts.map +1 -1
  5. package/resources/v1/analytics/analytics.d.ts +54 -3
  6. package/resources/v1/analytics/analytics.d.ts.map +1 -1
  7. package/resources/v1/analytics/analytics.js +4 -0
  8. package/resources/v1/analytics/analytics.js.map +1 -1
  9. package/resources/v1/analytics/analytics.mjs +4 -0
  10. package/resources/v1/analytics/analytics.mjs.map +1 -1
  11. package/resources/v1/analytics/index.d.mts +3 -2
  12. package/resources/v1/analytics/index.d.mts.map +1 -1
  13. package/resources/v1/analytics/index.d.ts +3 -2
  14. package/resources/v1/analytics/index.d.ts.map +1 -1
  15. package/resources/v1/analytics/index.js +3 -1
  16. package/resources/v1/analytics/index.js.map +1 -1
  17. package/resources/v1/analytics/index.mjs +1 -0
  18. package/resources/v1/analytics/index.mjs.map +1 -1
  19. package/resources/v1/analytics/llm.d.mts +63 -0
  20. package/resources/v1/analytics/llm.d.mts.map +1 -0
  21. package/resources/v1/analytics/llm.d.ts +63 -0
  22. package/resources/v1/analytics/llm.d.ts.map +1 -0
  23. package/resources/v1/analytics/llm.js +40 -0
  24. package/resources/v1/analytics/llm.js.map +1 -0
  25. package/resources/v1/analytics/llm.mjs +36 -0
  26. package/resources/v1/analytics/llm.mjs.map +1 -0
  27. package/resources/v1/analytics/tiles.d.mts +50 -1
  28. package/resources/v1/analytics/tiles.d.mts.map +1 -1
  29. package/resources/v1/analytics/tiles.d.ts +50 -1
  30. package/resources/v1/analytics/tiles.d.ts.map +1 -1
  31. package/resources/v1/analytics/tiles.js +31 -0
  32. package/resources/v1/analytics/tiles.js.map +1 -1
  33. package/resources/v1/analytics/tiles.mjs +31 -0
  34. package/resources/v1/analytics/tiles.mjs.map +1 -1
  35. package/resources/v1/index.d.mts +2 -2
  36. package/resources/v1/index.d.mts.map +1 -1
  37. package/resources/v1/index.d.ts +2 -2
  38. package/resources/v1/index.d.ts.map +1 -1
  39. package/resources/v1/index.js.map +1 -1
  40. package/resources/v1/index.mjs.map +1 -1
  41. package/resources/v1/projects.d.mts +34 -4
  42. package/resources/v1/projects.d.mts.map +1 -1
  43. package/resources/v1/projects.d.ts +34 -4
  44. package/resources/v1/projects.d.ts.map +1 -1
  45. package/resources/v1/projects.js +3 -2
  46. package/resources/v1/projects.js.map +1 -1
  47. package/resources/v1/projects.mjs +3 -2
  48. package/resources/v1/projects.mjs.map +1 -1
  49. package/resources/v1/v1.d.mts +4 -4
  50. package/resources/v1/v1.d.mts.map +1 -1
  51. package/resources/v1/v1.d.ts +4 -4
  52. package/resources/v1/v1.d.ts.map +1 -1
  53. package/resources/v1/v1.js.map +1 -1
  54. package/resources/v1/v1.mjs.map +1 -1
  55. package/src/resources/v1/analytics/analytics.ts +102 -0
  56. package/src/resources/v1/analytics/index.ts +9 -0
  57. package/src/resources/v1/analytics/llm.ts +99 -0
  58. package/src/resources/v1/analytics/tiles.ts +78 -0
  59. package/src/resources/v1/index.ts +7 -0
  60. package/src/resources/v1/projects.ts +49 -3
  61. package/src/resources/v1/v1.ts +14 -0
  62. package/src/version.ts +1 -1
  63. package/version.d.mts +1 -1
  64. package/version.d.ts +1 -1
  65. package/version.js +1 -1
  66. package/version.mjs +1 -1
@@ -0,0 +1,99 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ import { APIResource } from '../../../core/resource';
4
+ import * as AnalyticsAPI from './analytics';
5
+ import { APIPromise } from '../../../core/api-promise';
6
+ import { RequestOptions } from '../../../internal/request-options';
7
+
8
+ export class Llm extends APIResource {
9
+ /**
10
+ * Get a paginated list of LLM traces with optional filters (name, user_id,
11
+ * session_id, model)
12
+ *
13
+ * @example
14
+ * ```ts
15
+ * const llmTracesListResponse =
16
+ * await client.v1.analytics.llm.traces({
17
+ * project_id: 'project_id',
18
+ * time_range: 'last_hour',
19
+ * });
20
+ * ```
21
+ */
22
+ traces(query: LlmTracesParams, options?: RequestOptions): APIPromise<AnalyticsAPI.LlmTracesListResponse> {
23
+ return this._client.get('/api/v1/analytics/llm/traces', { query, ...options });
24
+ }
25
+
26
+ /**
27
+ * Get unique names, user_ids, session_ids, and models to populate filter dropdowns
28
+ *
29
+ * @example
30
+ * ```ts
31
+ * const llmTraceFilterOptionsResponse =
32
+ * await client.v1.analytics.llm.tracesFilterOptions({
33
+ * project_id: 'project_id',
34
+ * time_range: 'last_hour',
35
+ * });
36
+ * ```
37
+ */
38
+ tracesFilterOptions(
39
+ query: LlmTracesFilterOptionsParams,
40
+ options?: RequestOptions,
41
+ ): APIPromise<AnalyticsAPI.LlmTraceFilterOptionsResponse> {
42
+ return this._client.get('/api/v1/analytics/llm/traces/filter-options', { query, ...options });
43
+ }
44
+ }
45
+
46
+ export interface LlmTracesParams {
47
+ project_id: string;
48
+
49
+ time_range: 'last_hour' | 'today' | 'yesterday' | 'last_7_days' | 'last_30_days' | 'last_90_days';
50
+
51
+ customer_id?: string;
52
+
53
+ limit?: number;
54
+
55
+ model?: string;
56
+
57
+ name?: string;
58
+
59
+ offset?: number;
60
+
61
+ referrer?: string;
62
+
63
+ session_id?: string;
64
+
65
+ user_id?: string;
66
+
67
+ utmtag?: string;
68
+
69
+ utmtagValue?: string;
70
+
71
+ visitor_id?: string;
72
+ }
73
+
74
+ export interface LlmTracesFilterOptionsParams {
75
+ project_id: string;
76
+
77
+ time_range: 'last_hour' | 'today' | 'yesterday' | 'last_7_days' | 'last_30_days' | 'last_90_days';
78
+
79
+ customer_id?: string;
80
+
81
+ limit?: number;
82
+
83
+ offset?: number;
84
+
85
+ referrer?: string;
86
+
87
+ utmtag?: string;
88
+
89
+ utmtagValue?: string;
90
+
91
+ visitor_id?: string;
92
+ }
93
+
94
+ export declare namespace Llm {
95
+ export {
96
+ type LlmTracesParams as LlmTracesParams,
97
+ type LlmTracesFilterOptionsParams as LlmTracesFilterOptionsParams,
98
+ };
99
+ }
@@ -80,6 +80,42 @@ export class Tiles extends APIResource {
80
80
  return this._client.get('/api/v1/analytics/tiles/exit-pages', { query, ...options });
81
81
  }
82
82
 
83
+ /**
84
+ * Get total LLM cost for current period compared to the previous period
85
+ *
86
+ * @example
87
+ * ```ts
88
+ * const llmCostResponse =
89
+ * await client.v1.analytics.tiles.llmCost({
90
+ * project_id: 'project_id',
91
+ * time_range: 'last_hour',
92
+ * });
93
+ * ```
94
+ */
95
+ llmCost(query: TileLlmCostParams, options?: RequestOptions): APIPromise<AnalyticsAPI.LlmCostResponse> {
96
+ return this._client.get('/api/v1/analytics/tiles/llm-cost', { query, ...options });
97
+ }
98
+
99
+ /**
100
+ * Get top 3 most expensive LLM models for current period compared to the previous
101
+ * period
102
+ *
103
+ * @example
104
+ * ```ts
105
+ * const llmTopModelsCostResponse =
106
+ * await client.v1.analytics.tiles.llmTopModelsCost({
107
+ * project_id: 'project_id',
108
+ * time_range: 'last_hour',
109
+ * });
110
+ * ```
111
+ */
112
+ llmTopModelsCost(
113
+ query: TileLlmTopModelsCostParams,
114
+ options?: RequestOptions,
115
+ ): APIPromise<AnalyticsAPI.LlmTopModelsCostResponse> {
116
+ return this._client.get('/api/v1/analytics/tiles/llm-top-models-cost', { query, ...options });
117
+ }
118
+
83
119
  /**
84
120
  * Get monthly active user count (last 30 days) compared to the previous month
85
121
  *
@@ -405,6 +441,46 @@ export interface TileExitPagesParams {
405
441
  visitor_id?: string;
406
442
  }
407
443
 
444
+ export interface TileLlmCostParams {
445
+ project_id: string;
446
+
447
+ time_range: 'last_hour' | 'today' | 'yesterday' | 'last_7_days' | 'last_30_days' | 'last_90_days';
448
+
449
+ customer_id?: string;
450
+
451
+ limit?: number;
452
+
453
+ offset?: number;
454
+
455
+ referrer?: string;
456
+
457
+ utmtag?: string;
458
+
459
+ utmtagValue?: string;
460
+
461
+ visitor_id?: string;
462
+ }
463
+
464
+ export interface TileLlmTopModelsCostParams {
465
+ project_id: string;
466
+
467
+ time_range: 'last_hour' | 'today' | 'yesterday' | 'last_7_days' | 'last_30_days' | 'last_90_days';
468
+
469
+ customer_id?: string;
470
+
471
+ limit?: number;
472
+
473
+ offset?: number;
474
+
475
+ referrer?: string;
476
+
477
+ utmtag?: string;
478
+
479
+ utmtagValue?: string;
480
+
481
+ visitor_id?: string;
482
+ }
483
+
408
484
  export interface TileMauParams {
409
485
  project_id: string;
410
486
 
@@ -671,6 +747,8 @@ export declare namespace Tiles {
671
747
  type TileDauParams as TileDauParams,
672
748
  type TileEntryPagesParams as TileEntryPagesParams,
673
749
  type TileExitPagesParams as TileExitPagesParams,
750
+ type TileLlmCostParams as TileLlmCostParams,
751
+ type TileLlmTopModelsCostParams as TileLlmTopModelsCostParams,
674
752
  type TileMauParams as TileMauParams,
675
753
  type TilePagesPerSessionParams as TilePagesPerSessionParams,
676
754
  type TileReturnRateParams as TileReturnRateParams,
@@ -16,6 +16,12 @@ export {
16
16
  type EventsOverTimeDataPoint,
17
17
  type ExitPagesData,
18
18
  type ExitPagesResponse,
19
+ type LlmCostResponse,
20
+ type LlmModelCostData,
21
+ type LlmTopModelsCostResponse,
22
+ type LlmTraceFilterOptionsResponse,
23
+ type LlmTraceItem,
24
+ type LlmTracesListResponse,
19
25
  type ManualIdentifyRequest,
20
26
  type ManualIdentifyResponse,
21
27
  type MauResponse,
@@ -65,6 +71,7 @@ export {
65
71
  type Project,
66
72
  type ProjectResponse,
67
73
  type UpdateProjectRequest,
74
+ type ProjectCreateResponse,
68
75
  type ProjectDeleteResponse,
69
76
  type ProjectCreateParams,
70
77
  type ProjectUpdateParams,
@@ -7,17 +7,18 @@ import { path } from '../../internal/utils/path';
7
7
 
8
8
  export class Projects extends APIResource {
9
9
  /**
10
- * Create a new project for the authenticated user's organization
10
+ * Create a new project for the authenticated user's organization. The response
11
+ * includes Langfuse API keys for LLM trace ingestion.
11
12
  *
12
13
  * @example
13
14
  * ```ts
14
- * const projectResponse = await client.v1.projects.create({
15
+ * const project = await client.v1.projects.create({
15
16
  * name: 'My Awesome Project',
16
17
  * website_url: 'https://example.com',
17
18
  * });
18
19
  * ```
19
20
  */
20
- create(body: ProjectCreateParams, options?: RequestOptions): APIPromise<ProjectResponse> {
21
+ create(body: ProjectCreateParams, options?: RequestOptions): APIPromise<ProjectCreateResponse> {
21
22
  return this._client.post('/api/v1/projects', { body, ...options });
22
23
  }
23
24
 
@@ -98,6 +99,14 @@ export interface Project {
98
99
 
99
100
  first_event_received_at?: string;
100
101
 
102
+ /**
103
+ * Langfuse-compatible API keys for LLM trace ingestion (used to accept OpenRouter
104
+ * traces)
105
+ */
106
+ langfuse_public_key?: string;
107
+
108
+ langfuse_secret_key?: string;
109
+
101
110
  name?: string;
102
111
 
103
112
  organization_id?: string;
@@ -118,6 +127,14 @@ export interface ProjectResponse {
118
127
 
119
128
  first_event_received_at?: string;
120
129
 
130
+ /**
131
+ * Langfuse-compatible API keys for LLM trace ingestion (used to accept OpenRouter
132
+ * traces)
133
+ */
134
+ langfuse_public_key?: string;
135
+
136
+ langfuse_secret_key?: string;
137
+
121
138
  name?: string;
122
139
 
123
140
  organization_id?: string;
@@ -135,6 +152,34 @@ export interface UpdateProjectRequest {
135
152
  website_url?: string;
136
153
  }
137
154
 
155
+ export interface ProjectCreateResponse {
156
+ id?: string;
157
+
158
+ allow_local_host?: boolean;
159
+
160
+ created_at?: string;
161
+
162
+ domain?: string;
163
+
164
+ first_event_received_at?: string;
165
+
166
+ /**
167
+ * Langfuse-compatible API keys for LLM trace ingestion (used to accept OpenRouter
168
+ * traces)
169
+ */
170
+ langfuse_public_key?: string;
171
+
172
+ langfuse_secret_key?: string;
173
+
174
+ name?: string;
175
+
176
+ organization_id?: string;
177
+
178
+ project_token?: string;
179
+
180
+ updated_at?: string;
181
+ }
182
+
138
183
  export type ProjectDeleteResponse = { [key: string]: string };
139
184
 
140
185
  export interface ProjectCreateParams {
@@ -160,6 +205,7 @@ export declare namespace Projects {
160
205
  type Project as Project,
161
206
  type ProjectResponse as ProjectResponse,
162
207
  type UpdateProjectRequest as UpdateProjectRequest,
208
+ type ProjectCreateResponse as ProjectCreateResponse,
163
209
  type ProjectDeleteResponse as ProjectDeleteResponse,
164
210
  type ProjectCreateParams as ProjectCreateParams,
165
211
  type ProjectUpdateParams as ProjectUpdateParams,
@@ -9,6 +9,7 @@ import {
9
9
  ListProjectsResponse,
10
10
  Project,
11
11
  ProjectCreateParams,
12
+ ProjectCreateResponse,
12
13
  ProjectDeleteResponse,
13
14
  ProjectResponse,
14
15
  ProjectUpdateParams,
@@ -33,6 +34,12 @@ import {
33
34
  EventsOverTimeDataPoint,
34
35
  ExitPagesData,
35
36
  ExitPagesResponse,
37
+ LlmCostResponse,
38
+ LlmModelCostData,
39
+ LlmTopModelsCostResponse,
40
+ LlmTraceFilterOptionsResponse,
41
+ LlmTraceItem,
42
+ LlmTracesListResponse,
36
43
  ManualIdentifyRequest,
37
44
  ManualIdentifyResponse,
38
45
  MauResponse,
@@ -134,6 +141,12 @@ export declare namespace V1 {
134
141
  type EventsOverTimeDataPoint as EventsOverTimeDataPoint,
135
142
  type ExitPagesData as ExitPagesData,
136
143
  type ExitPagesResponse as ExitPagesResponse,
144
+ type LlmCostResponse as LlmCostResponse,
145
+ type LlmModelCostData as LlmModelCostData,
146
+ type LlmTopModelsCostResponse as LlmTopModelsCostResponse,
147
+ type LlmTraceFilterOptionsResponse as LlmTraceFilterOptionsResponse,
148
+ type LlmTraceItem as LlmTraceItem,
149
+ type LlmTracesListResponse as LlmTracesListResponse,
137
150
  type ManualIdentifyRequest as ManualIdentifyRequest,
138
151
  type ManualIdentifyResponse as ManualIdentifyResponse,
139
152
  type MauResponse as MauResponse,
@@ -188,6 +201,7 @@ export declare namespace V1 {
188
201
  type Project as Project,
189
202
  type ProjectResponse as ProjectResponse,
190
203
  type UpdateProjectRequest as UpdateProjectRequest,
204
+ type ProjectCreateResponse as ProjectCreateResponse,
191
205
  type ProjectDeleteResponse as ProjectDeleteResponse,
192
206
  type ProjectCreateParams as ProjectCreateParams,
193
207
  type ProjectUpdateParams as ProjectUpdateParams,
package/src/version.ts CHANGED
@@ -1 +1 @@
1
- export const VERSION = '0.19.1'; // x-release-please-version
1
+ export const VERSION = '0.21.0'; // x-release-please-version
package/version.d.mts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "0.19.1";
1
+ export declare const VERSION = "0.21.0";
2
2
  //# sourceMappingURL=version.d.mts.map
package/version.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "0.19.1";
1
+ export declare const VERSION = "0.21.0";
2
2
  //# sourceMappingURL=version.d.ts.map
package/version.js CHANGED
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.VERSION = void 0;
4
- exports.VERSION = '0.19.1'; // x-release-please-version
4
+ exports.VERSION = '0.21.0'; // x-release-please-version
5
5
  //# sourceMappingURL=version.js.map
package/version.mjs CHANGED
@@ -1,2 +1,2 @@
1
- export const VERSION = '0.19.1'; // x-release-please-version
1
+ export const VERSION = '0.21.0'; // x-release-please-version
2
2
  //# sourceMappingURL=version.mjs.map