@to11ai/sdk 3.0.0-rc.10 → 3.0.0-rc.11

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/README.md CHANGED
@@ -117,7 +117,7 @@ const to11 = createClient({ apiKey, projectId: "proj_abc123" });
117
117
  await to11.prompts.list(); // uses the bound projectId
118
118
  await to11.prompts.get({ promptId: "prompt_1" });
119
119
  await to11.prompts.getVersion({ promptId: "prompt_1", versionNumber: 3 });
120
- await to11.prompts.listLabels({ promptId: "prompt_1" }); // [{ label: "latest", versionId: "ver_9", … }]
120
+ await to11.prompts.listLabels({ promptId: "prompt_1" }); // { items: [{ label: "latest", versionId: "ver_9", … }], pagination }
121
121
  ```
122
122
 
123
123
  `listVersions` pages a prompt's versions newest first and returns summaries — `id`, `version`, `format`, `changelog`, who created it and when — without the content. Pass `pagination.nextCursor` back as `cursor` for the next page (`null` on the last one); `limit` defaults to 50 and clamps to 100. Read one version's `templateJson`, `variablesSchema` and `modelConfig` with `getVersion`:
@@ -10723,7 +10723,7 @@ export type ProjectEnvironmentsListProjectEnvironmentsData = {
10723
10723
  };
10724
10724
  query?: {
10725
10725
  includeArchived?: 'true' | 'false' | null;
10726
- page?: number | null;
10726
+ cursor?: string | null;
10727
10727
  limit?: number | null;
10728
10728
  };
10729
10729
  url: '/v1/projects/{projectId}/environments';
@@ -10785,7 +10785,13 @@ export type ProjectEnvironmentsListProjectEnvironmentsResponses = {
10785
10785
  */
10786
10786
  200: {
10787
10787
  code: number;
10788
- data: Array<ProjectEnvironment> | null;
10788
+ data: {
10789
+ items: Array<ProjectEnvironment>;
10790
+ pagination: {
10791
+ limit: number;
10792
+ nextCursor: string | null;
10793
+ };
10794
+ } | null;
10789
10795
  error: {
10790
10796
  code: string;
10791
10797
  details?: unknown | null;
@@ -11413,7 +11419,7 @@ export type ApiKeysListApiKeysProjectData = {
11413
11419
  projectId: string;
11414
11420
  };
11415
11421
  query?: {
11416
- page?: number | null;
11422
+ cursor?: string | null;
11417
11423
  limit?: number | null;
11418
11424
  };
11419
11425
  url: '/v1/projects/{projectId}/keys';
@@ -11475,17 +11481,33 @@ export type ApiKeysListApiKeysProjectResponses = {
11475
11481
  */
11476
11482
  200: {
11477
11483
  code: number;
11478
- data: Array<{
11479
- createdAt: string;
11480
- environment: 'live' | 'test';
11481
- expiresAt: string;
11482
- id: string;
11483
- key: string;
11484
- orgId: string | null;
11485
- projectId: string | null;
11486
- revokedAt: string | null;
11487
- scopes: Array<string>;
11488
- }> | null;
11484
+ data: {
11485
+ items: Array<{
11486
+ createdAt: string;
11487
+ createdBy: string | null;
11488
+ environment: 'live' | 'test';
11489
+ expiresAt: string | null;
11490
+ graceExpiresAt: string | null;
11491
+ id: string;
11492
+ ipAllowlist: Array<string>;
11493
+ keyPreview: string;
11494
+ name: string;
11495
+ orgId: string | null;
11496
+ prefix: string;
11497
+ projectId: string | null;
11498
+ revokedAt: string | null;
11499
+ rotatedFromId: string | null;
11500
+ rotatedToId: string | null;
11501
+ scopeTier: 'platform' | 'org' | 'workspace' | 'project';
11502
+ scopes: Array<string>;
11503
+ status: 'active' | 'revoked' | 'rotating' | 'expired';
11504
+ workspaceId: string | null;
11505
+ }>;
11506
+ pagination: {
11507
+ limit: number;
11508
+ nextCursor: string | null;
11509
+ };
11510
+ } | null;
11489
11511
  error: {
11490
11512
  code: string;
11491
11513
  details?: unknown | null;
@@ -11975,7 +11997,7 @@ export type CostRatesGetEffectiveCostRatesData = {
11975
11997
  provider?: string | null;
11976
11998
  model?: string | null;
11977
11999
  asOf?: string | null;
11978
- page?: number | null;
12000
+ cursor?: string | null;
11979
12001
  limit?: number | null;
11980
12002
  };
11981
12003
  url: '/v1/projects/{projectId}/llm-cost-rates/effective';
@@ -12037,20 +12059,26 @@ export type CostRatesGetEffectiveCostRatesResponses = {
12037
12059
  */
12038
12060
  200: {
12039
12061
  code: number;
12040
- data: Array<{
12041
- inputIncludesCacheCreation: boolean | null;
12042
- inputIncludesCacheRead: boolean | null;
12043
- matchType: 'exact' | 'prefix';
12044
- modelMatch: string;
12045
- outputIncludesReasoning: boolean | null;
12046
- pricePerMillion: number;
12047
- provider: string;
12048
- source: 'builtin' | 'organization' | 'workspace' | 'project';
12049
- tierMaxTokens: number | null;
12050
- tierMinTokens: number | null;
12051
- tokenType: 'input' | 'output' | 'cache_read' | 'cache_creation' | 'cache_creation_5m' | 'cache_creation_1h' | 'reasoning';
12052
- validFrom: string;
12053
- }> | null;
12062
+ data: {
12063
+ items: Array<{
12064
+ inputIncludesCacheCreation: boolean | null;
12065
+ inputIncludesCacheRead: boolean | null;
12066
+ matchType: 'exact' | 'prefix';
12067
+ modelMatch: string;
12068
+ outputIncludesReasoning: boolean | null;
12069
+ pricePerMillion: number;
12070
+ provider: string;
12071
+ source: 'builtin' | 'organization' | 'workspace' | 'project';
12072
+ tierMaxTokens: number | null;
12073
+ tierMinTokens: number | null;
12074
+ tokenType: 'input' | 'output' | 'cache_read' | 'cache_creation' | 'cache_creation_5m' | 'cache_creation_1h' | 'reasoning';
12075
+ validFrom: string;
12076
+ }>;
12077
+ pagination: {
12078
+ limit: number;
12079
+ nextCursor: string | null;
12080
+ };
12081
+ } | null;
12054
12082
  error: {
12055
12083
  code: string;
12056
12084
  details?: unknown | null;
@@ -13982,7 +14010,7 @@ export type PromptsListPromptLabelsData = {
13982
14010
  promptId: string;
13983
14011
  };
13984
14012
  query?: {
13985
- page?: number | null;
14013
+ cursor?: string | null;
13986
14014
  limit?: number | null;
13987
14015
  };
13988
14016
  url: '/v1/projects/{projectId}/prompts/{promptId}/labels';
@@ -14044,7 +14072,13 @@ export type PromptsListPromptLabelsResponses = {
14044
14072
  */
14045
14073
  200: {
14046
14074
  code: number;
14047
- data: Array<PromptLabelPointer> | null;
14075
+ data: {
14076
+ items: Array<PromptLabelPointer>;
14077
+ pagination: {
14078
+ limit: number;
14079
+ nextCursor: string | null;
14080
+ };
14081
+ } | null;
14048
14082
  error: {
14049
14083
  code: string;
14050
14084
  details?: unknown | null;
@@ -15105,7 +15139,7 @@ export type CredentialAttachmentsListEligibleCredentialsData = {
15105
15139
  providerId: string;
15106
15140
  };
15107
15141
  query?: {
15108
- page?: number | null;
15142
+ cursor?: string | null;
15109
15143
  limit?: number | null;
15110
15144
  };
15111
15145
  url: '/v1/projects/{projectId}/providers/{providerId}/eligible-credentials';
@@ -15167,14 +15201,20 @@ export type CredentialAttachmentsListEligibleCredentialsResponses = {
15167
15201
  */
15168
15202
  200: {
15169
15203
  code: number;
15170
- data: Array<{
15171
- createdAt: string;
15172
- credentialType: string;
15173
- id: string;
15174
- keyLast4: string;
15175
- label: string | null;
15176
- providerCatalogId: string;
15177
- }> | null;
15204
+ data: {
15205
+ items: Array<{
15206
+ createdAt: string;
15207
+ credentialType: string;
15208
+ id: string;
15209
+ keyLast4: string;
15210
+ label: string | null;
15211
+ providerCatalogId: string;
15212
+ }>;
15213
+ pagination: {
15214
+ limit: number;
15215
+ nextCursor: string | null;
15216
+ };
15217
+ } | null;
15178
15218
  error: {
15179
15219
  code: string;
15180
15220
  details?: unknown | null;
@@ -17023,7 +17063,7 @@ export type RoutingMetricsGetRoutingProviderMetricsData = {
17023
17063
  };
17024
17064
  query?: {
17025
17065
  window?: string | null;
17026
- page?: number | null;
17066
+ cursor?: string | null;
17027
17067
  limit?: number | null;
17028
17068
  };
17029
17069
  url: '/v1/projects/{projectId}/routing/providers/metrics';
@@ -17085,17 +17125,23 @@ export type RoutingMetricsGetRoutingProviderMetricsResponses = {
17085
17125
  */
17086
17126
  200: {
17087
17127
  code: number;
17088
- data: Array<{
17089
- calls7dTotal: number;
17090
- daily: Array<number>;
17091
- errorCount: number;
17092
- errorRate: number;
17093
- latencyP50Ms: number | null;
17094
- latencyP95Ms: number | null;
17095
- providerId: string;
17096
- requests: number;
17097
- spend7dUsd: number | null;
17098
- }> | null;
17128
+ data: {
17129
+ items: Array<{
17130
+ calls7dTotal: number;
17131
+ daily: Array<number>;
17132
+ errorCount: number;
17133
+ errorRate: number;
17134
+ latencyP50Ms: number | null;
17135
+ latencyP95Ms: number | null;
17136
+ providerId: string;
17137
+ requests: number;
17138
+ spend7dUsd: number | null;
17139
+ }>;
17140
+ pagination: {
17141
+ limit: number;
17142
+ nextCursor: string | null;
17143
+ };
17144
+ } | null;
17099
17145
  error: {
17100
17146
  code: string;
17101
17147
  details?: unknown | null;
@@ -20038,7 +20084,7 @@ export type ProviderConfigVersionsListProviderConfigVersionsData = {
20038
20084
  providerId: string;
20039
20085
  };
20040
20086
  query?: {
20041
- page?: number | null;
20087
+ cursor?: string | null;
20042
20088
  limit?: number | null;
20043
20089
  };
20044
20090
  url: '/v1/projects/{projectId}/routing/providers/{providerId}/versions';
@@ -20100,17 +20146,23 @@ export type ProviderConfigVersionsListProviderConfigVersionsResponses = {
20100
20146
  */
20101
20147
  200: {
20102
20148
  code: number;
20103
- data: Array<{
20104
- configSnapshot: {
20105
- [key: string]: unknown;
20149
+ data: {
20150
+ items: Array<{
20151
+ configSnapshot: {
20152
+ [key: string]: unknown;
20153
+ };
20154
+ contentHash: string;
20155
+ createdAt: string;
20156
+ createdBy: string | null;
20157
+ id: string;
20158
+ liveInEnvSlugs: Array<string>;
20159
+ version: number;
20160
+ }>;
20161
+ pagination: {
20162
+ limit: number;
20163
+ nextCursor: string | null;
20106
20164
  };
20107
- contentHash: string;
20108
- createdAt: string;
20109
- createdBy: string | null;
20110
- id: string;
20111
- liveInEnvSlugs: Array<string>;
20112
- version: number;
20113
- }> | null;
20165
+ } | null;
20114
20166
  error: {
20115
20167
  code: string;
20116
20168
  details?: unknown | null;
@@ -21171,7 +21223,8 @@ export type RuleReleasesListRuleReleasesData = {
21171
21223
  };
21172
21224
  query?: {
21173
21225
  envSlug?: string | null;
21174
- limit?: string | null;
21226
+ cursor?: string | null;
21227
+ limit?: number | null;
21175
21228
  };
21176
21229
  url: '/v1/projects/{projectId}/routing/rules/{ruleId}/releases';
21177
21230
  };
@@ -21232,7 +21285,13 @@ export type RuleReleasesListRuleReleasesResponses = {
21232
21285
  */
21233
21286
  200: {
21234
21287
  code: number;
21235
- data: Array<RuleRelease> | null;
21288
+ data: {
21289
+ items: Array<RuleRelease>;
21290
+ pagination: {
21291
+ limit: number;
21292
+ nextCursor: string | null;
21293
+ };
21294
+ } | null;
21236
21295
  error: {
21237
21296
  code: string;
21238
21297
  details?: unknown | null;
@@ -21267,7 +21326,8 @@ export type RuleReleasesListRuleReleasesEnvData = {
21267
21326
  envSlug: string;
21268
21327
  };
21269
21328
  query?: {
21270
- limit?: string | null;
21329
+ cursor?: string | null;
21330
+ limit?: number | null;
21271
21331
  };
21272
21332
  url: '/v1/projects/{projectId}/routing/rules/{ruleId}/releases/{envSlug}';
21273
21333
  };
@@ -21328,7 +21388,13 @@ export type RuleReleasesListRuleReleasesEnvResponses = {
21328
21388
  */
21329
21389
  200: {
21330
21390
  code: number;
21331
- data: Array<RuleRelease> | null;
21391
+ data: {
21392
+ items: Array<RuleRelease>;
21393
+ pagination: {
21394
+ limit: number;
21395
+ nextCursor: string | null;
21396
+ };
21397
+ } | null;
21332
21398
  error: {
21333
21399
  code: string;
21334
21400
  details?: unknown | null;
@@ -22185,7 +22251,7 @@ export type RoutingTargetsListRoutingTargetsData = {
22185
22251
  projectId: string;
22186
22252
  };
22187
22253
  query?: {
22188
- page?: number | null;
22254
+ cursor?: string | null;
22189
22255
  limit?: number | null;
22190
22256
  };
22191
22257
  url: '/v1/projects/{projectId}/routing/targets';
@@ -22247,17 +22313,23 @@ export type RoutingTargetsListRoutingTargetsResponses = {
22247
22313
  */
22248
22314
  200: {
22249
22315
  code: number;
22250
- data: Array<{
22251
- createdAt: string;
22252
- credentialId: string | null;
22253
- id: string;
22254
- modelId: string;
22255
- name: string;
22256
- projectId: string;
22257
- timeoutMs: number | null;
22258
- updatedAt: string;
22259
- weight: number | null;
22260
- }> | null;
22316
+ data: {
22317
+ items: Array<{
22318
+ createdAt: string;
22319
+ credentialId: string | null;
22320
+ id: string;
22321
+ modelId: string;
22322
+ name: string;
22323
+ projectId: string;
22324
+ timeoutMs: number | null;
22325
+ updatedAt: string;
22326
+ weight: number | null;
22327
+ }>;
22328
+ pagination: {
22329
+ limit: number;
22330
+ nextCursor: string | null;
22331
+ };
22332
+ } | null;
22261
22333
  error: {
22262
22334
  code: string;
22263
22335
  details?: unknown | null;