@roarkanalytics/sdk 5.8.0 → 5.10.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.
- package/CHANGELOG.md +26 -0
- package/client.d.mts +13 -4
- package/client.d.mts.map +1 -1
- package/client.d.ts +13 -4
- package/client.d.ts.map +1 -1
- package/client.js +9 -0
- package/client.js.map +1 -1
- package/client.mjs +9 -0
- package/client.mjs.map +1 -1
- package/package.json +1 -1
- package/resources/analytics.d.mts +354 -0
- package/resources/analytics.d.mts.map +1 -0
- package/resources/analytics.d.ts +354 -0
- package/resources/analytics.d.ts.map +1 -0
- package/resources/analytics.js +55 -0
- package/resources/analytics.js.map +1 -0
- package/resources/analytics.mjs +51 -0
- package/resources/analytics.mjs.map +1 -0
- package/resources/call.d.mts +90 -1
- package/resources/call.d.mts.map +1 -1
- package/resources/call.d.ts +90 -1
- package/resources/call.d.ts.map +1 -1
- package/resources/call.js +17 -0
- package/resources/call.js.map +1 -1
- package/resources/call.mjs +17 -0
- package/resources/call.mjs.map +1 -1
- package/resources/config.d.mts +578 -8
- package/resources/config.d.mts.map +1 -1
- package/resources/config.d.ts +578 -8
- package/resources/config.d.ts.map +1 -1
- package/resources/dashboard.d.mts +2280 -0
- package/resources/dashboard.d.mts.map +1 -0
- package/resources/dashboard.d.ts +2280 -0
- package/resources/dashboard.d.ts.map +1 -0
- package/resources/dashboard.js +170 -0
- package/resources/dashboard.js.map +1 -0
- package/resources/dashboard.mjs +166 -0
- package/resources/dashboard.mjs.map +1 -0
- package/resources/index.d.mts +5 -2
- package/resources/index.d.mts.map +1 -1
- package/resources/index.d.ts +5 -2
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js +7 -1
- package/resources/index.js.map +1 -1
- package/resources/index.mjs +3 -0
- package/resources/index.mjs.map +1 -1
- package/resources/simulation-run-plan-job.d.mts +98 -1
- package/resources/simulation-run-plan-job.d.mts.map +1 -1
- package/resources/simulation-run-plan-job.d.ts +98 -1
- package/resources/simulation-run-plan-job.d.ts.map +1 -1
- package/resources/simulation-run-plan-job.js +17 -0
- package/resources/simulation-run-plan-job.js.map +1 -1
- package/resources/simulation-run-plan-job.mjs +17 -0
- package/resources/simulation-run-plan-job.mjs.map +1 -1
- package/resources/usage.d.mts +116 -0
- package/resources/usage.d.mts.map +1 -0
- package/resources/usage.d.ts +116 -0
- package/resources/usage.d.ts.map +1 -0
- package/resources/usage.js +29 -0
- package/resources/usage.js.map +1 -0
- package/resources/usage.mjs +25 -0
- package/resources/usage.mjs.map +1 -0
- package/src/client.ts +67 -0
- package/src/resources/analytics.ts +573 -0
- package/src/resources/call.ts +136 -0
- package/src/resources/config.ts +1441 -41
- package/src/resources/dashboard.ts +3752 -0
- package/src/resources/index.ts +29 -0
- package/src/resources/simulation-run-plan-job.ts +141 -0
- package/src/resources/usage.ts +149 -0
- package/src/version.ts +1 -1
- package/version.d.mts +1 -1
- package/version.d.mts.map +1 -1
- package/version.d.ts +1 -1
- package/version.d.ts.map +1 -1
- package/version.js +1 -1
- package/version.js.map +1 -1
- package/version.mjs +1 -1
- package/version.mjs.map +1 -1
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
import { APIResource } from "../core/resource.mjs";
|
|
2
|
+
import { APIPromise } from "../core/api-promise.mjs";
|
|
3
|
+
import { RequestOptions } from "../internal/request-options.mjs";
|
|
4
|
+
export declare class Usage extends APIResource {
|
|
5
|
+
/**
|
|
6
|
+
* Report billable usage and cost for the organization over a time window, broken
|
|
7
|
+
* down by project (highest spend first). Pass `from`/`to` as ISO 8601 timestamps;
|
|
8
|
+
* optionally pass `projectId` to scope the report to one project. Amounts are
|
|
9
|
+
* billable spend only (what we absorb is never included). Authenticated by either
|
|
10
|
+
* an organization API key with the `usage:read` permission (any project in the
|
|
11
|
+
* organization), or a project API key with the `billing:read` permission (that
|
|
12
|
+
* key's own project only; any other `projectId` is a 403).
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* ```ts
|
|
16
|
+
* const usage = await client.usage.get({
|
|
17
|
+
* from: '2026-09-01T00:00:00Z',
|
|
18
|
+
* to: '2026-10-01T00:00:00Z',
|
|
19
|
+
* });
|
|
20
|
+
* ```
|
|
21
|
+
*/
|
|
22
|
+
get(query: UsageGetParams, options?: RequestOptions): APIPromise<UsageGetResponse>;
|
|
23
|
+
}
|
|
24
|
+
export interface UsageGetResponse {
|
|
25
|
+
data: UsageGetResponse.Data;
|
|
26
|
+
}
|
|
27
|
+
export declare namespace UsageGetResponse {
|
|
28
|
+
interface Data {
|
|
29
|
+
currency: 'usd';
|
|
30
|
+
/**
|
|
31
|
+
* The resolved window start, echoed back as ISO 8601.
|
|
32
|
+
*/
|
|
33
|
+
from: string;
|
|
34
|
+
/**
|
|
35
|
+
* Per-project billable spend, highest first. Only projects with spend in the
|
|
36
|
+
* window appear.
|
|
37
|
+
*/
|
|
38
|
+
projects: Array<Data.Project>;
|
|
39
|
+
/**
|
|
40
|
+
* The resolved window end, echoed back as ISO 8601.
|
|
41
|
+
*/
|
|
42
|
+
to: string;
|
|
43
|
+
/**
|
|
44
|
+
* The same total in US dollars.
|
|
45
|
+
*/
|
|
46
|
+
totalUsd: number;
|
|
47
|
+
/**
|
|
48
|
+
* Total billable spend across the organization (or the single project) in
|
|
49
|
+
* micro-dollars.
|
|
50
|
+
*/
|
|
51
|
+
totalUsdMicros: number;
|
|
52
|
+
}
|
|
53
|
+
namespace Data {
|
|
54
|
+
interface Project {
|
|
55
|
+
/**
|
|
56
|
+
* The same billable spend in US dollars. For display; use amountUsdMicros to
|
|
57
|
+
* reconcile.
|
|
58
|
+
*/
|
|
59
|
+
amountUsd: number;
|
|
60
|
+
/**
|
|
61
|
+
* Billable spend in integer micro-dollars (1,000,000 = $1). The exact value.
|
|
62
|
+
*/
|
|
63
|
+
amountUsdMicros: number;
|
|
64
|
+
/**
|
|
65
|
+
* This project's spend split by cost type, highest first. Sums to amountUsdMicros.
|
|
66
|
+
*/
|
|
67
|
+
breakdown: Array<Project.Breakdown>;
|
|
68
|
+
projectId: string;
|
|
69
|
+
/**
|
|
70
|
+
* Null only if the project no longer exists in this organization.
|
|
71
|
+
*/
|
|
72
|
+
projectName: string | null;
|
|
73
|
+
}
|
|
74
|
+
namespace Project {
|
|
75
|
+
interface Breakdown {
|
|
76
|
+
/**
|
|
77
|
+
* The same figure in US dollars.
|
|
78
|
+
*/
|
|
79
|
+
amountUsd: number;
|
|
80
|
+
/**
|
|
81
|
+
* Billable spend for this type, in micro-dollars.
|
|
82
|
+
*/
|
|
83
|
+
amountUsdMicros: number;
|
|
84
|
+
/**
|
|
85
|
+
* The cost source, e.g. SIM*PLATFORM_FEE, SIM_LLM, SIM_TTS, SIM_STT,
|
|
86
|
+
* SIM_TELEPHONY, METRIC, or TRANSCRIPTION. These are the granular sources behind
|
|
87
|
+
* the Billing screen categories (SIM*\* roll up into "Simulation").
|
|
88
|
+
*/
|
|
89
|
+
source: 'SIM_PLATFORM_FEE' | 'SIM_TTS' | 'SIM_STT' | 'SIM_LLM' | 'SIM_TELEPHONY' | 'METRIC' | 'TRANSCRIPTION' | 'INTERNAL_LLM' | 'INTERNAL_STT';
|
|
90
|
+
/**
|
|
91
|
+
* Whether this cost came from a SIMULATION or a production call (POST_CALL).
|
|
92
|
+
*/
|
|
93
|
+
surface: 'SIMULATION' | 'POST_CALL';
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
export interface UsageGetParams {
|
|
99
|
+
/**
|
|
100
|
+
* Start of the window (inclusive), ISO 8601.
|
|
101
|
+
*/
|
|
102
|
+
from: string;
|
|
103
|
+
/**
|
|
104
|
+
* End of the window (exclusive), ISO 8601. Must be after `from`, and the window
|
|
105
|
+
* may not exceed 366 days.
|
|
106
|
+
*/
|
|
107
|
+
to: string;
|
|
108
|
+
/**
|
|
109
|
+
* Limit the report to a single project. Omit for the whole organization.
|
|
110
|
+
*/
|
|
111
|
+
projectId?: string;
|
|
112
|
+
}
|
|
113
|
+
export declare namespace Usage {
|
|
114
|
+
export { type UsageGetResponse as UsageGetResponse, type UsageGetParams as UsageGetParams };
|
|
115
|
+
}
|
|
116
|
+
//# sourceMappingURL=usage.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"usage.d.mts","sourceRoot":"","sources":["../src/resources/usage.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,6BAAyB;AAC/C,OAAO,EAAE,UAAU,EAAE,gCAA4B;AACjD,OAAO,EAAE,cAAc,EAAE,wCAAoC;AAE7D,qBAAa,KAAM,SAAQ,WAAW;IACpC;;;;;;;;;;;;;;;;OAgBG;IACH,GAAG,CAAC,KAAK,EAAE,cAAc,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,gBAAgB,CAAC;CAGnF;AAED,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,gBAAgB,CAAC,IAAI,CAAC;CAC7B;AAED,yBAAiB,gBAAgB,CAAC;IAChC,UAAiB,IAAI;QACnB,QAAQ,EAAE,KAAK,CAAC;QAEhB;;WAEG;QACH,IAAI,EAAE,MAAM,CAAC;QAEb;;;WAGG;QACH,QAAQ,EAAE,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAE9B;;WAEG;QACH,EAAE,EAAE,MAAM,CAAC;QAEX;;WAEG;QACH,QAAQ,EAAE,MAAM,CAAC;QAEjB;;;WAGG;QACH,cAAc,EAAE,MAAM,CAAC;KACxB;IAED,UAAiB,IAAI,CAAC;QACpB,UAAiB,OAAO;YACtB;;;eAGG;YACH,SAAS,EAAE,MAAM,CAAC;YAElB;;eAEG;YACH,eAAe,EAAE,MAAM,CAAC;YAExB;;eAEG;YACH,SAAS,EAAE,KAAK,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;YAEpC,SAAS,EAAE,MAAM,CAAC;YAElB;;eAEG;YACH,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;SAC5B;QAED,UAAiB,OAAO,CAAC;YACvB,UAAiB,SAAS;gBACxB;;mBAEG;gBACH,SAAS,EAAE,MAAM,CAAC;gBAElB;;mBAEG;gBACH,eAAe,EAAE,MAAM,CAAC;gBAExB;;;;mBAIG;gBACH,MAAM,EACF,kBAAkB,GAClB,SAAS,GACT,SAAS,GACT,SAAS,GACT,eAAe,GACf,QAAQ,GACR,eAAe,GACf,cAAc,GACd,cAAc,CAAC;gBAEnB;;mBAEG;gBACH,OAAO,EAAE,YAAY,GAAG,WAAW,CAAC;aACrC;SACF;KACF;CACF;AAED,MAAM,WAAW,cAAc;IAC7B;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;;OAGG;IACH,EAAE,EAAE,MAAM,CAAC;IAEX;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,CAAC,OAAO,WAAW,KAAK,CAAC;IAC7B,OAAO,EAAE,KAAK,gBAAgB,IAAI,gBAAgB,EAAE,KAAK,cAAc,IAAI,cAAc,EAAE,CAAC;CAC7F"}
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
import { APIResource } from "../core/resource.js";
|
|
2
|
+
import { APIPromise } from "../core/api-promise.js";
|
|
3
|
+
import { RequestOptions } from "../internal/request-options.js";
|
|
4
|
+
export declare class Usage extends APIResource {
|
|
5
|
+
/**
|
|
6
|
+
* Report billable usage and cost for the organization over a time window, broken
|
|
7
|
+
* down by project (highest spend first). Pass `from`/`to` as ISO 8601 timestamps;
|
|
8
|
+
* optionally pass `projectId` to scope the report to one project. Amounts are
|
|
9
|
+
* billable spend only (what we absorb is never included). Authenticated by either
|
|
10
|
+
* an organization API key with the `usage:read` permission (any project in the
|
|
11
|
+
* organization), or a project API key with the `billing:read` permission (that
|
|
12
|
+
* key's own project only; any other `projectId` is a 403).
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* ```ts
|
|
16
|
+
* const usage = await client.usage.get({
|
|
17
|
+
* from: '2026-09-01T00:00:00Z',
|
|
18
|
+
* to: '2026-10-01T00:00:00Z',
|
|
19
|
+
* });
|
|
20
|
+
* ```
|
|
21
|
+
*/
|
|
22
|
+
get(query: UsageGetParams, options?: RequestOptions): APIPromise<UsageGetResponse>;
|
|
23
|
+
}
|
|
24
|
+
export interface UsageGetResponse {
|
|
25
|
+
data: UsageGetResponse.Data;
|
|
26
|
+
}
|
|
27
|
+
export declare namespace UsageGetResponse {
|
|
28
|
+
interface Data {
|
|
29
|
+
currency: 'usd';
|
|
30
|
+
/**
|
|
31
|
+
* The resolved window start, echoed back as ISO 8601.
|
|
32
|
+
*/
|
|
33
|
+
from: string;
|
|
34
|
+
/**
|
|
35
|
+
* Per-project billable spend, highest first. Only projects with spend in the
|
|
36
|
+
* window appear.
|
|
37
|
+
*/
|
|
38
|
+
projects: Array<Data.Project>;
|
|
39
|
+
/**
|
|
40
|
+
* The resolved window end, echoed back as ISO 8601.
|
|
41
|
+
*/
|
|
42
|
+
to: string;
|
|
43
|
+
/**
|
|
44
|
+
* The same total in US dollars.
|
|
45
|
+
*/
|
|
46
|
+
totalUsd: number;
|
|
47
|
+
/**
|
|
48
|
+
* Total billable spend across the organization (or the single project) in
|
|
49
|
+
* micro-dollars.
|
|
50
|
+
*/
|
|
51
|
+
totalUsdMicros: number;
|
|
52
|
+
}
|
|
53
|
+
namespace Data {
|
|
54
|
+
interface Project {
|
|
55
|
+
/**
|
|
56
|
+
* The same billable spend in US dollars. For display; use amountUsdMicros to
|
|
57
|
+
* reconcile.
|
|
58
|
+
*/
|
|
59
|
+
amountUsd: number;
|
|
60
|
+
/**
|
|
61
|
+
* Billable spend in integer micro-dollars (1,000,000 = $1). The exact value.
|
|
62
|
+
*/
|
|
63
|
+
amountUsdMicros: number;
|
|
64
|
+
/**
|
|
65
|
+
* This project's spend split by cost type, highest first. Sums to amountUsdMicros.
|
|
66
|
+
*/
|
|
67
|
+
breakdown: Array<Project.Breakdown>;
|
|
68
|
+
projectId: string;
|
|
69
|
+
/**
|
|
70
|
+
* Null only if the project no longer exists in this organization.
|
|
71
|
+
*/
|
|
72
|
+
projectName: string | null;
|
|
73
|
+
}
|
|
74
|
+
namespace Project {
|
|
75
|
+
interface Breakdown {
|
|
76
|
+
/**
|
|
77
|
+
* The same figure in US dollars.
|
|
78
|
+
*/
|
|
79
|
+
amountUsd: number;
|
|
80
|
+
/**
|
|
81
|
+
* Billable spend for this type, in micro-dollars.
|
|
82
|
+
*/
|
|
83
|
+
amountUsdMicros: number;
|
|
84
|
+
/**
|
|
85
|
+
* The cost source, e.g. SIM*PLATFORM_FEE, SIM_LLM, SIM_TTS, SIM_STT,
|
|
86
|
+
* SIM_TELEPHONY, METRIC, or TRANSCRIPTION. These are the granular sources behind
|
|
87
|
+
* the Billing screen categories (SIM*\* roll up into "Simulation").
|
|
88
|
+
*/
|
|
89
|
+
source: 'SIM_PLATFORM_FEE' | 'SIM_TTS' | 'SIM_STT' | 'SIM_LLM' | 'SIM_TELEPHONY' | 'METRIC' | 'TRANSCRIPTION' | 'INTERNAL_LLM' | 'INTERNAL_STT';
|
|
90
|
+
/**
|
|
91
|
+
* Whether this cost came from a SIMULATION or a production call (POST_CALL).
|
|
92
|
+
*/
|
|
93
|
+
surface: 'SIMULATION' | 'POST_CALL';
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
export interface UsageGetParams {
|
|
99
|
+
/**
|
|
100
|
+
* Start of the window (inclusive), ISO 8601.
|
|
101
|
+
*/
|
|
102
|
+
from: string;
|
|
103
|
+
/**
|
|
104
|
+
* End of the window (exclusive), ISO 8601. Must be after `from`, and the window
|
|
105
|
+
* may not exceed 366 days.
|
|
106
|
+
*/
|
|
107
|
+
to: string;
|
|
108
|
+
/**
|
|
109
|
+
* Limit the report to a single project. Omit for the whole organization.
|
|
110
|
+
*/
|
|
111
|
+
projectId?: string;
|
|
112
|
+
}
|
|
113
|
+
export declare namespace Usage {
|
|
114
|
+
export { type UsageGetResponse as UsageGetResponse, type UsageGetParams as UsageGetParams };
|
|
115
|
+
}
|
|
116
|
+
//# sourceMappingURL=usage.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"usage.d.ts","sourceRoot":"","sources":["../src/resources/usage.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,4BAAyB;AAC/C,OAAO,EAAE,UAAU,EAAE,+BAA4B;AACjD,OAAO,EAAE,cAAc,EAAE,uCAAoC;AAE7D,qBAAa,KAAM,SAAQ,WAAW;IACpC;;;;;;;;;;;;;;;;OAgBG;IACH,GAAG,CAAC,KAAK,EAAE,cAAc,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,gBAAgB,CAAC;CAGnF;AAED,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,gBAAgB,CAAC,IAAI,CAAC;CAC7B;AAED,yBAAiB,gBAAgB,CAAC;IAChC,UAAiB,IAAI;QACnB,QAAQ,EAAE,KAAK,CAAC;QAEhB;;WAEG;QACH,IAAI,EAAE,MAAM,CAAC;QAEb;;;WAGG;QACH,QAAQ,EAAE,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAE9B;;WAEG;QACH,EAAE,EAAE,MAAM,CAAC;QAEX;;WAEG;QACH,QAAQ,EAAE,MAAM,CAAC;QAEjB;;;WAGG;QACH,cAAc,EAAE,MAAM,CAAC;KACxB;IAED,UAAiB,IAAI,CAAC;QACpB,UAAiB,OAAO;YACtB;;;eAGG;YACH,SAAS,EAAE,MAAM,CAAC;YAElB;;eAEG;YACH,eAAe,EAAE,MAAM,CAAC;YAExB;;eAEG;YACH,SAAS,EAAE,KAAK,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;YAEpC,SAAS,EAAE,MAAM,CAAC;YAElB;;eAEG;YACH,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;SAC5B;QAED,UAAiB,OAAO,CAAC;YACvB,UAAiB,SAAS;gBACxB;;mBAEG;gBACH,SAAS,EAAE,MAAM,CAAC;gBAElB;;mBAEG;gBACH,eAAe,EAAE,MAAM,CAAC;gBAExB;;;;mBAIG;gBACH,MAAM,EACF,kBAAkB,GAClB,SAAS,GACT,SAAS,GACT,SAAS,GACT,eAAe,GACf,QAAQ,GACR,eAAe,GACf,cAAc,GACd,cAAc,CAAC;gBAEnB;;mBAEG;gBACH,OAAO,EAAE,YAAY,GAAG,WAAW,CAAC;aACrC;SACF;KACF;CACF;AAED,MAAM,WAAW,cAAc;IAC7B;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;;OAGG;IACH,EAAE,EAAE,MAAM,CAAC;IAEX;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,CAAC,OAAO,WAAW,KAAK,CAAC;IAC7B,OAAO,EAAE,KAAK,gBAAgB,IAAI,gBAAgB,EAAE,KAAK,cAAc,IAAI,cAAc,EAAE,CAAC;CAC7F"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.Usage = void 0;
|
|
5
|
+
const resource_1 = require("../core/resource.js");
|
|
6
|
+
class Usage extends resource_1.APIResource {
|
|
7
|
+
/**
|
|
8
|
+
* Report billable usage and cost for the organization over a time window, broken
|
|
9
|
+
* down by project (highest spend first). Pass `from`/`to` as ISO 8601 timestamps;
|
|
10
|
+
* optionally pass `projectId` to scope the report to one project. Amounts are
|
|
11
|
+
* billable spend only (what we absorb is never included). Authenticated by either
|
|
12
|
+
* an organization API key with the `usage:read` permission (any project in the
|
|
13
|
+
* organization), or a project API key with the `billing:read` permission (that
|
|
14
|
+
* key's own project only; any other `projectId` is a 403).
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* ```ts
|
|
18
|
+
* const usage = await client.usage.get({
|
|
19
|
+
* from: '2026-09-01T00:00:00Z',
|
|
20
|
+
* to: '2026-10-01T00:00:00Z',
|
|
21
|
+
* });
|
|
22
|
+
* ```
|
|
23
|
+
*/
|
|
24
|
+
get(query, options) {
|
|
25
|
+
return this._client.get('/v1/usage', { query, ...options });
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
exports.Usage = Usage;
|
|
29
|
+
//# sourceMappingURL=usage.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"usage.js","sourceRoot":"","sources":["../src/resources/usage.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,kDAA+C;AAI/C,MAAa,KAAM,SAAQ,sBAAW;IACpC;;;;;;;;;;;;;;;;OAgBG;IACH,GAAG,CAAC,KAAqB,EAAE,OAAwB;QACjD,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,WAAW,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC9D,CAAC;CACF;AArBD,sBAqBC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
import { APIResource } from "../core/resource.mjs";
|
|
3
|
+
export class Usage extends APIResource {
|
|
4
|
+
/**
|
|
5
|
+
* Report billable usage and cost for the organization over a time window, broken
|
|
6
|
+
* down by project (highest spend first). Pass `from`/`to` as ISO 8601 timestamps;
|
|
7
|
+
* optionally pass `projectId` to scope the report to one project. Amounts are
|
|
8
|
+
* billable spend only (what we absorb is never included). Authenticated by either
|
|
9
|
+
* an organization API key with the `usage:read` permission (any project in the
|
|
10
|
+
* organization), or a project API key with the `billing:read` permission (that
|
|
11
|
+
* key's own project only; any other `projectId` is a 403).
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* ```ts
|
|
15
|
+
* const usage = await client.usage.get({
|
|
16
|
+
* from: '2026-09-01T00:00:00Z',
|
|
17
|
+
* to: '2026-10-01T00:00:00Z',
|
|
18
|
+
* });
|
|
19
|
+
* ```
|
|
20
|
+
*/
|
|
21
|
+
get(query, options) {
|
|
22
|
+
return this._client.get('/v1/usage', { query, ...options });
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=usage.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"usage.mjs","sourceRoot":"","sources":["../src/resources/usage.ts"],"names":[],"mappings":"AAAA,sFAAsF;AAEtF,OAAO,EAAE,WAAW,EAAE,6BAAyB;AAI/C,MAAM,OAAO,KAAM,SAAQ,WAAW;IACpC;;;;;;;;;;;;;;;;OAgBG;IACH,GAAG,CAAC,KAAqB,EAAE,OAAwB;QACjD,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,WAAW,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC9D,CAAC;CACF"}
|
package/src/client.ts
CHANGED
|
@@ -59,6 +59,12 @@ import {
|
|
|
59
59
|
AgentPromptUpdateParams,
|
|
60
60
|
AgentPromptUpdateResponse,
|
|
61
61
|
} from './resources/agent-prompt';
|
|
62
|
+
import {
|
|
63
|
+
Analytics,
|
|
64
|
+
AnalyticsGetSchemaResponse,
|
|
65
|
+
AnalyticsQueryParams,
|
|
66
|
+
AnalyticsQueryResponse,
|
|
67
|
+
} from './resources/analytics';
|
|
62
68
|
import {
|
|
63
69
|
AutoimproveJob,
|
|
64
70
|
AutoimproveJobAnswerQuestionParams,
|
|
@@ -95,6 +101,7 @@ import {
|
|
|
95
101
|
CallCreateParams,
|
|
96
102
|
CallCreateResponse,
|
|
97
103
|
CallGetByIDResponse,
|
|
104
|
+
CallGetCostResponse,
|
|
98
105
|
CallGetTranscriptParams,
|
|
99
106
|
CallGetTranscriptResponse,
|
|
100
107
|
CallListMetricsParams,
|
|
@@ -143,6 +150,26 @@ import {
|
|
|
143
150
|
CustomerFlowEdgeCaseUpdateParams,
|
|
144
151
|
CustomerFlowEdgeCaseUpdateResponse,
|
|
145
152
|
} from './resources/customer-flow-edge-case';
|
|
153
|
+
import {
|
|
154
|
+
Dashboard,
|
|
155
|
+
DashboardCreateParams,
|
|
156
|
+
DashboardCreateResponse,
|
|
157
|
+
DashboardCreateWidgetParams,
|
|
158
|
+
DashboardCreateWidgetResponse,
|
|
159
|
+
DashboardDeleteResponse,
|
|
160
|
+
DashboardDeleteWidgetParams,
|
|
161
|
+
DashboardDeleteWidgetResponse,
|
|
162
|
+
DashboardGetByIDResponse,
|
|
163
|
+
DashboardGetDataParams,
|
|
164
|
+
DashboardGetDataResponse,
|
|
165
|
+
DashboardGetWidgetDataParams,
|
|
166
|
+
DashboardGetWidgetDataResponse,
|
|
167
|
+
DashboardListResponse,
|
|
168
|
+
DashboardUpdateParams,
|
|
169
|
+
DashboardUpdateResponse,
|
|
170
|
+
DashboardUpdateWidgetParams,
|
|
171
|
+
DashboardUpdateWidgetResponse,
|
|
172
|
+
} from './resources/dashboard';
|
|
146
173
|
import { Health, HealthGetResponse } from './resources/health';
|
|
147
174
|
import {
|
|
148
175
|
HTTPRequestDefinition,
|
|
@@ -281,6 +308,7 @@ import {
|
|
|
281
308
|
SimulationRunPlanJobCreateDebriefParams,
|
|
282
309
|
SimulationRunPlanJobCreateDebriefResponse,
|
|
283
310
|
SimulationRunPlanJobGetByIDResponse,
|
|
311
|
+
SimulationRunPlanJobGetCostResponse,
|
|
284
312
|
SimulationRunPlanJobGetResultsParams,
|
|
285
313
|
SimulationRunPlanJobGetResultsResponse,
|
|
286
314
|
SimulationRunPlanJobListParams,
|
|
@@ -299,6 +327,7 @@ import {
|
|
|
299
327
|
SimulationToolFixtureUpdateParams,
|
|
300
328
|
SimulationToolFixtureUpdateResponse,
|
|
301
329
|
} from './resources/simulation-tool-fixture';
|
|
330
|
+
import { Usage, UsageGetParams, UsageGetResponse } from './resources/usage';
|
|
302
331
|
import {
|
|
303
332
|
Webhook,
|
|
304
333
|
WebhookCreateParams,
|
|
@@ -1057,7 +1086,10 @@ export class Roark {
|
|
|
1057
1086
|
health: API.Health = new API.Health(this);
|
|
1058
1087
|
me: API.Me = new API.Me(this);
|
|
1059
1088
|
project: API.Project = new API.Project(this);
|
|
1089
|
+
usage: API.Usage = new API.Usage(this);
|
|
1060
1090
|
call: API.Call = new API.Call(this);
|
|
1091
|
+
analytics: API.Analytics = new API.Analytics(this);
|
|
1092
|
+
dashboard: API.Dashboard = new API.Dashboard(this);
|
|
1061
1093
|
metric: API.Metric = new API.Metric(this);
|
|
1062
1094
|
metricPolicy: API.MetricPolicy = new API.MetricPolicy(this);
|
|
1063
1095
|
metricCollectionJob: API.MetricCollectionJob = new API.MetricCollectionJob(this);
|
|
@@ -1089,7 +1121,10 @@ export class Roark {
|
|
|
1089
1121
|
Roark.Health = Health;
|
|
1090
1122
|
Roark.Me = Me;
|
|
1091
1123
|
Roark.Project = Project;
|
|
1124
|
+
Roark.Usage = Usage;
|
|
1092
1125
|
Roark.Call = Call;
|
|
1126
|
+
Roark.Analytics = Analytics;
|
|
1127
|
+
Roark.Dashboard = Dashboard;
|
|
1093
1128
|
Roark.Metric = Metric;
|
|
1094
1129
|
Roark.MetricPolicy = MetricPolicy;
|
|
1095
1130
|
Roark.MetricCollectionJob = MetricCollectionJob;
|
|
@@ -1134,12 +1169,15 @@ export declare namespace Roark {
|
|
|
1134
1169
|
|
|
1135
1170
|
export { Project as Project, type ProjectListResponse as ProjectListResponse };
|
|
1136
1171
|
|
|
1172
|
+
export { Usage as Usage, type UsageGetResponse as UsageGetResponse, type UsageGetParams as UsageGetParams };
|
|
1173
|
+
|
|
1137
1174
|
export {
|
|
1138
1175
|
Call as Call,
|
|
1139
1176
|
type CallCreateResponse as CallCreateResponse,
|
|
1140
1177
|
type CallListResponse as CallListResponse,
|
|
1141
1178
|
type CallAppendToolInvocationsResponse as CallAppendToolInvocationsResponse,
|
|
1142
1179
|
type CallGetByIDResponse as CallGetByIDResponse,
|
|
1180
|
+
type CallGetCostResponse as CallGetCostResponse,
|
|
1143
1181
|
type CallGetTranscriptResponse as CallGetTranscriptResponse,
|
|
1144
1182
|
type CallListMetricsResponse as CallListMetricsResponse,
|
|
1145
1183
|
type CallListSentimentRunsResponse as CallListSentimentRunsResponse,
|
|
@@ -1152,6 +1190,34 @@ export declare namespace Roark {
|
|
|
1152
1190
|
type CallUpdatePropertiesParams as CallUpdatePropertiesParams,
|
|
1153
1191
|
};
|
|
1154
1192
|
|
|
1193
|
+
export {
|
|
1194
|
+
Analytics as Analytics,
|
|
1195
|
+
type AnalyticsGetSchemaResponse as AnalyticsGetSchemaResponse,
|
|
1196
|
+
type AnalyticsQueryResponse as AnalyticsQueryResponse,
|
|
1197
|
+
type AnalyticsQueryParams as AnalyticsQueryParams,
|
|
1198
|
+
};
|
|
1199
|
+
|
|
1200
|
+
export {
|
|
1201
|
+
Dashboard as Dashboard,
|
|
1202
|
+
type DashboardCreateResponse as DashboardCreateResponse,
|
|
1203
|
+
type DashboardUpdateResponse as DashboardUpdateResponse,
|
|
1204
|
+
type DashboardListResponse as DashboardListResponse,
|
|
1205
|
+
type DashboardDeleteResponse as DashboardDeleteResponse,
|
|
1206
|
+
type DashboardCreateWidgetResponse as DashboardCreateWidgetResponse,
|
|
1207
|
+
type DashboardDeleteWidgetResponse as DashboardDeleteWidgetResponse,
|
|
1208
|
+
type DashboardGetByIDResponse as DashboardGetByIDResponse,
|
|
1209
|
+
type DashboardGetDataResponse as DashboardGetDataResponse,
|
|
1210
|
+
type DashboardGetWidgetDataResponse as DashboardGetWidgetDataResponse,
|
|
1211
|
+
type DashboardUpdateWidgetResponse as DashboardUpdateWidgetResponse,
|
|
1212
|
+
type DashboardCreateParams as DashboardCreateParams,
|
|
1213
|
+
type DashboardUpdateParams as DashboardUpdateParams,
|
|
1214
|
+
type DashboardCreateWidgetParams as DashboardCreateWidgetParams,
|
|
1215
|
+
type DashboardDeleteWidgetParams as DashboardDeleteWidgetParams,
|
|
1216
|
+
type DashboardGetDataParams as DashboardGetDataParams,
|
|
1217
|
+
type DashboardGetWidgetDataParams as DashboardGetWidgetDataParams,
|
|
1218
|
+
type DashboardUpdateWidgetParams as DashboardUpdateWidgetParams,
|
|
1219
|
+
};
|
|
1220
|
+
|
|
1155
1221
|
export {
|
|
1156
1222
|
Metric as Metric,
|
|
1157
1223
|
type MetricCreateDefinitionResponse as MetricCreateDefinitionResponse,
|
|
@@ -1269,6 +1335,7 @@ export declare namespace Roark {
|
|
|
1269
1335
|
type SimulationRunPlanJobCancelResponse as SimulationRunPlanJobCancelResponse,
|
|
1270
1336
|
type SimulationRunPlanJobCreateDebriefResponse as SimulationRunPlanJobCreateDebriefResponse,
|
|
1271
1337
|
type SimulationRunPlanJobGetByIDResponse as SimulationRunPlanJobGetByIDResponse,
|
|
1338
|
+
type SimulationRunPlanJobGetCostResponse as SimulationRunPlanJobGetCostResponse,
|
|
1272
1339
|
type SimulationRunPlanJobGetResultsResponse as SimulationRunPlanJobGetResultsResponse,
|
|
1273
1340
|
type SimulationRunPlanJobStartResponse as SimulationRunPlanJobStartResponse,
|
|
1274
1341
|
type SimulationRunPlanJobListParams as SimulationRunPlanJobListParams,
|