@modelrelay/sdk 1.36.0 → 1.37.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.
@@ -268,14 +268,14 @@ interface FrontendToken {
268
268
  sessionId: string;
269
269
  /** The project ID this token is scoped to. */
270
270
  projectId: string;
271
- /** The internal customer ID (UUID). */
272
- customerId: string;
271
+ /** The internal customer ID (UUID). Only present for managed billing projects; BYOB projects have end-users but not customers. */
272
+ customerId?: string;
273
273
  /** The external customer ID provided by the application. */
274
274
  customerExternalId: string;
275
275
  /** The tier code for the customer (e.g., "free", "pro", "enterprise").
276
276
  * Optional for BYOB (external billing) projects where customers may not have subscriptions.
277
277
  */
278
- tierCode?: string;
278
+ tierCode?: TierCode;
279
279
  /**
280
280
  * Publishable key used for issuance. Added client-side for caching.
281
281
  */
@@ -304,10 +304,11 @@ interface CustomerToken {
304
304
  expiresIn: number;
305
305
  tokenType: TokenType;
306
306
  projectId: string;
307
- customerId: string;
307
+ /** Only present for managed billing projects; BYOB projects have end-users but not customers. */
308
+ customerId?: string;
308
309
  customerExternalId: string;
309
310
  /** Optional for BYOB (external billing) projects */
310
- tierCode?: string;
311
+ tierCode?: TierCode;
311
312
  }
312
313
  interface OIDCExchangeRequest {
313
314
  idToken: string;
@@ -355,12 +356,12 @@ interface DeviceTokenResponse {
355
356
  tokenType: TokenType;
356
357
  /** The project ID this token is scoped to */
357
358
  projectId: string;
358
- /** The internal customer ID (UUID) */
359
- customerId: string;
359
+ /** The internal customer ID (UUID). Only present for managed billing projects; BYOB projects have end-users but not customers. */
360
+ customerId?: string;
360
361
  /** The external customer ID */
361
362
  customerExternalId: string;
362
363
  /** The tier code for the customer (optional for BYOB projects) */
363
- tierCode?: string;
364
+ tierCode?: TierCode;
364
365
  }
365
366
  /**
366
367
  * Pending response from polling device token endpoint.
@@ -704,9 +705,10 @@ interface APIFrontendToken {
704
705
  key_id: string;
705
706
  session_id: string;
706
707
  project_id: string;
707
- customer_id: string;
708
+ /** Optional for BYOB projects where customers are not created in the billing sense. */
709
+ customer_id?: string;
708
710
  customer_external_id: string;
709
- tier_code?: string;
711
+ tier_code?: TierCode;
710
712
  }
711
713
  interface APICustomerRef {
712
714
  id: string;
@@ -1169,4 +1171,4 @@ interface RetryOptions {
1169
1171
  */
1170
1172
  declare function executeWithRetry(registry: ToolRegistry, toolCalls: ToolCall[], options?: RetryOptions): Promise<ToolExecutionResult[]>;
1171
1173
 
1172
- export { assistantMessageWithToolCalls as $, type ApiKey as A, type BillingProvider as B, type CustomerTokenRequest as C, type DeviceStartRequest as D, DEFAULT_BASE_URL as E, type FrontendCustomer as F, createFunctionTool as G, createFunctionToolFromSchema as H, type InputItem as I, createWebTool as J, toolChoiceAuto as K, toolChoiceRequired as L, type MetricsCallbacks as M, toolChoiceNone as N, type OIDCExchangeRequest as O, type ProviderId as P, hasToolCalls as Q, type RetryConfig as R, type StructuredJSONEvent as S, type TraceCallbacks as T, firstToolCall as U, createUserMessage as V, createAssistantMessage as W, createSystemMessage as X, toolResultMessage as Y, type ZodLikeSchema as Z, respondToToolCall as _, type RequestContext as a, type OutputFormatType as a$, createToolCall as a0, createFunctionCall as a1, ToolCallAccumulator as a2, zodToJsonSchema as a3, parseToolArgs as a4, tryParseToolArgs as a5, parseToolArgsRaw as a6, ToolArgsError as a7, formatToolErrorForModel as a8, hasRetryableErrors as a9, type Usage as aA, createUsage as aB, type UsageSummary as aC, type Project as aD, MessageRoles as aE, type MessageRole as aF, ContentPartTypes as aG, type ContentPartType as aH, type ContentPart as aI, InputItemTypes as aJ, type InputItemType as aK, OutputItemTypes as aL, type OutputItemType as aM, type OutputItem as aN, ToolTypes as aO, type ToolType as aP, WebToolIntents as aQ, type WebToolIntent as aR, type FunctionTool as aS, type WebSearchConfig as aT, type XSearchConfig as aU, type CodeExecConfig as aV, ToolChoiceTypes as aW, type ToolChoiceType as aX, type FunctionCall as aY, type ToolCall as aZ, OutputFormatTypes as a_, getRetryableErrors as aa, createRetryMessages as ab, executeWithRetry as ac, type JsonSchemaOptions as ad, type Schema as ae, type ToolHandler as af, type RetryOptions as ag, SDK_VERSION as ah, DEFAULT_CLIENT_HEADER as ai, DEFAULT_CONNECT_TIMEOUT_MS as aj, DEFAULT_REQUEST_TIMEOUT_MS as ak, type NonEmptyArray as al, StopReasons as am, type KnownStopReason as an, type StopReason as ao, asProviderId as ap, asModelId as aq, asTierCode as ar, SubscriptionStatuses as as, BillingProviders as at, type ModelRelayBaseOptions as au, type ModelRelayTokenOptions as av, type ModelRelayTokenProviderOptions as aw, type TokenType as ax, type DeviceTokenResponse as ay, type DeviceTokenPending as az, type TokenProvider as b, type JSONSchemaFormat as b0, type Citation as b1, type HttpRequestMetrics as b2, type StreamFirstTokenMetrics as b3, type TokenUsageMetrics as b4, mergeMetrics as b5, mergeTrace as b6, normalizeStopReason as b7, stopReasonToString as b8, normalizeModelId as b9, modelToString as ba, type ResponseEventType as bb, type MessageStartData as bc, type MessageDeltaData as bd, type MessageStopData as be, type ToolCallDelta as bf, type FunctionCallDelta as bg, type StructuredJSONRecordType as bh, type DeepPartial as bi, type APIFrontendToken as bj, type APICustomerRef as bk, type APICheckoutSession as bl, type APIUsage as bm, type APIResponsesResponse as bn, type APIKey as bo, type FrontendTokenRequest as c, type FrontendToken as d, type FrontendTokenAutoProvisionRequest as e, type CustomerToken as f, type DeviceStartResponse as g, type DeviceTokenResult as h, type ModelId as i, type OutputFormat as j, type Tool as k, type ToolChoice as l, type ResponseEvent as m, type Response as n, type FieldError as o, type RetryMetadata as p, type TransportErrorKind as q, type CustomerMetadata as r, type TierCode as s, type SubscriptionStatusKind as t, ToolRegistry as u, type ToolExecutionResult as v, type PublishableKey as w, type SecretKey as x, type ModelRelayKeyOptions as y, type ModelRelayOptions as z };
1174
+ export { ToolCallAccumulator as $, type ApiKey as A, createFunctionToolFromSchema as B, type CustomerTokenRequest as C, type DeviceStartRequest as D, createWebTool as E, type FrontendCustomer as F, toolChoiceAuto as G, toolChoiceRequired as H, type InputItem as I, toolChoiceNone as J, hasToolCalls as K, firstToolCall as L, type MetricsCallbacks as M, createUserMessage as N, type OIDCExchangeRequest as O, type ProviderId as P, createAssistantMessage as Q, type RetryConfig as R, type StructuredJSONEvent as S, type TraceCallbacks as T, createSystemMessage as U, toolResultMessage as V, respondToToolCall as W, assistantMessageWithToolCalls as X, createToolCall as Y, type ZodLikeSchema as Z, createFunctionCall as _, type RequestContext as a, type OutputFormatType as a$, zodToJsonSchema as a0, parseToolArgs as a1, tryParseToolArgs as a2, parseToolArgsRaw as a3, ToolArgsError as a4, formatToolErrorForModel as a5, hasRetryableErrors as a6, getRetryableErrors as a7, createRetryMessages as a8, executeWithRetry as a9, type Usage as aA, createUsage as aB, type UsageSummary as aC, type Project as aD, MessageRoles as aE, type MessageRole as aF, ContentPartTypes as aG, type ContentPartType as aH, type ContentPart as aI, InputItemTypes as aJ, type InputItemType as aK, OutputItemTypes as aL, type OutputItemType as aM, type OutputItem as aN, ToolTypes as aO, type ToolType as aP, WebToolIntents as aQ, type WebToolIntent as aR, type FunctionTool as aS, type WebSearchConfig as aT, type XSearchConfig as aU, type CodeExecConfig as aV, ToolChoiceTypes as aW, type ToolChoiceType as aX, type FunctionCall as aY, type ToolCall as aZ, OutputFormatTypes as a_, type JsonSchemaOptions as aa, type Schema as ab, type ToolHandler as ac, type RetryOptions as ad, SDK_VERSION as ae, DEFAULT_CLIENT_HEADER as af, DEFAULT_CONNECT_TIMEOUT_MS as ag, DEFAULT_REQUEST_TIMEOUT_MS as ah, type NonEmptyArray as ai, StopReasons as aj, type KnownStopReason as ak, type StopReason as al, asProviderId as am, asModelId as an, asTierCode as ao, SubscriptionStatuses as ap, type SubscriptionStatusKind as aq, BillingProviders as ar, type BillingProvider as as, type CustomerMetadata as at, type ModelRelayBaseOptions as au, type ModelRelayTokenOptions as av, type ModelRelayTokenProviderOptions as aw, type TokenType as ax, type DeviceTokenResponse as ay, type DeviceTokenPending as az, type TokenProvider as b, type JSONSchemaFormat as b0, type Citation as b1, type HttpRequestMetrics as b2, type StreamFirstTokenMetrics as b3, type TokenUsageMetrics as b4, mergeMetrics as b5, mergeTrace as b6, normalizeStopReason as b7, stopReasonToString as b8, normalizeModelId as b9, modelToString as ba, type ResponseEventType as bb, type MessageStartData as bc, type MessageDeltaData as bd, type MessageStopData as be, type ToolCallDelta as bf, type FunctionCallDelta as bg, type StructuredJSONRecordType as bh, type DeepPartial as bi, type APIFrontendToken as bj, type APICustomerRef as bk, type APICheckoutSession as bl, type APIUsage as bm, type APIResponsesResponse as bn, type APIKey as bo, type FrontendTokenRequest as c, type FrontendToken as d, type FrontendTokenAutoProvisionRequest as e, type CustomerToken as f, type DeviceStartResponse as g, type DeviceTokenResult as h, type ModelId as i, type OutputFormat as j, type Tool as k, type ToolChoice as l, type ResponseEvent as m, type Response as n, type FieldError as o, type RetryMetadata as p, type TransportErrorKind as q, ToolRegistry as r, type ToolExecutionResult as s, type TierCode as t, type PublishableKey as u, type SecretKey as v, type ModelRelayKeyOptions as w, type ModelRelayOptions as x, DEFAULT_BASE_URL as y, createFunctionTool as z };
@@ -268,14 +268,14 @@ interface FrontendToken {
268
268
  sessionId: string;
269
269
  /** The project ID this token is scoped to. */
270
270
  projectId: string;
271
- /** The internal customer ID (UUID). */
272
- customerId: string;
271
+ /** The internal customer ID (UUID). Only present for managed billing projects; BYOB projects have end-users but not customers. */
272
+ customerId?: string;
273
273
  /** The external customer ID provided by the application. */
274
274
  customerExternalId: string;
275
275
  /** The tier code for the customer (e.g., "free", "pro", "enterprise").
276
276
  * Optional for BYOB (external billing) projects where customers may not have subscriptions.
277
277
  */
278
- tierCode?: string;
278
+ tierCode?: TierCode;
279
279
  /**
280
280
  * Publishable key used for issuance. Added client-side for caching.
281
281
  */
@@ -304,10 +304,11 @@ interface CustomerToken {
304
304
  expiresIn: number;
305
305
  tokenType: TokenType;
306
306
  projectId: string;
307
- customerId: string;
307
+ /** Only present for managed billing projects; BYOB projects have end-users but not customers. */
308
+ customerId?: string;
308
309
  customerExternalId: string;
309
310
  /** Optional for BYOB (external billing) projects */
310
- tierCode?: string;
311
+ tierCode?: TierCode;
311
312
  }
312
313
  interface OIDCExchangeRequest {
313
314
  idToken: string;
@@ -355,12 +356,12 @@ interface DeviceTokenResponse {
355
356
  tokenType: TokenType;
356
357
  /** The project ID this token is scoped to */
357
358
  projectId: string;
358
- /** The internal customer ID (UUID) */
359
- customerId: string;
359
+ /** The internal customer ID (UUID). Only present for managed billing projects; BYOB projects have end-users but not customers. */
360
+ customerId?: string;
360
361
  /** The external customer ID */
361
362
  customerExternalId: string;
362
363
  /** The tier code for the customer (optional for BYOB projects) */
363
- tierCode?: string;
364
+ tierCode?: TierCode;
364
365
  }
365
366
  /**
366
367
  * Pending response from polling device token endpoint.
@@ -704,9 +705,10 @@ interface APIFrontendToken {
704
705
  key_id: string;
705
706
  session_id: string;
706
707
  project_id: string;
707
- customer_id: string;
708
+ /** Optional for BYOB projects where customers are not created in the billing sense. */
709
+ customer_id?: string;
708
710
  customer_external_id: string;
709
- tier_code?: string;
711
+ tier_code?: TierCode;
710
712
  }
711
713
  interface APICustomerRef {
712
714
  id: string;
@@ -1169,4 +1171,4 @@ interface RetryOptions {
1169
1171
  */
1170
1172
  declare function executeWithRetry(registry: ToolRegistry, toolCalls: ToolCall[], options?: RetryOptions): Promise<ToolExecutionResult[]>;
1171
1173
 
1172
- export { assistantMessageWithToolCalls as $, type ApiKey as A, type BillingProvider as B, type CustomerTokenRequest as C, type DeviceStartRequest as D, DEFAULT_BASE_URL as E, type FrontendCustomer as F, createFunctionTool as G, createFunctionToolFromSchema as H, type InputItem as I, createWebTool as J, toolChoiceAuto as K, toolChoiceRequired as L, type MetricsCallbacks as M, toolChoiceNone as N, type OIDCExchangeRequest as O, type ProviderId as P, hasToolCalls as Q, type RetryConfig as R, type StructuredJSONEvent as S, type TraceCallbacks as T, firstToolCall as U, createUserMessage as V, createAssistantMessage as W, createSystemMessage as X, toolResultMessage as Y, type ZodLikeSchema as Z, respondToToolCall as _, type RequestContext as a, type OutputFormatType as a$, createToolCall as a0, createFunctionCall as a1, ToolCallAccumulator as a2, zodToJsonSchema as a3, parseToolArgs as a4, tryParseToolArgs as a5, parseToolArgsRaw as a6, ToolArgsError as a7, formatToolErrorForModel as a8, hasRetryableErrors as a9, type Usage as aA, createUsage as aB, type UsageSummary as aC, type Project as aD, MessageRoles as aE, type MessageRole as aF, ContentPartTypes as aG, type ContentPartType as aH, type ContentPart as aI, InputItemTypes as aJ, type InputItemType as aK, OutputItemTypes as aL, type OutputItemType as aM, type OutputItem as aN, ToolTypes as aO, type ToolType as aP, WebToolIntents as aQ, type WebToolIntent as aR, type FunctionTool as aS, type WebSearchConfig as aT, type XSearchConfig as aU, type CodeExecConfig as aV, ToolChoiceTypes as aW, type ToolChoiceType as aX, type FunctionCall as aY, type ToolCall as aZ, OutputFormatTypes as a_, getRetryableErrors as aa, createRetryMessages as ab, executeWithRetry as ac, type JsonSchemaOptions as ad, type Schema as ae, type ToolHandler as af, type RetryOptions as ag, SDK_VERSION as ah, DEFAULT_CLIENT_HEADER as ai, DEFAULT_CONNECT_TIMEOUT_MS as aj, DEFAULT_REQUEST_TIMEOUT_MS as ak, type NonEmptyArray as al, StopReasons as am, type KnownStopReason as an, type StopReason as ao, asProviderId as ap, asModelId as aq, asTierCode as ar, SubscriptionStatuses as as, BillingProviders as at, type ModelRelayBaseOptions as au, type ModelRelayTokenOptions as av, type ModelRelayTokenProviderOptions as aw, type TokenType as ax, type DeviceTokenResponse as ay, type DeviceTokenPending as az, type TokenProvider as b, type JSONSchemaFormat as b0, type Citation as b1, type HttpRequestMetrics as b2, type StreamFirstTokenMetrics as b3, type TokenUsageMetrics as b4, mergeMetrics as b5, mergeTrace as b6, normalizeStopReason as b7, stopReasonToString as b8, normalizeModelId as b9, modelToString as ba, type ResponseEventType as bb, type MessageStartData as bc, type MessageDeltaData as bd, type MessageStopData as be, type ToolCallDelta as bf, type FunctionCallDelta as bg, type StructuredJSONRecordType as bh, type DeepPartial as bi, type APIFrontendToken as bj, type APICustomerRef as bk, type APICheckoutSession as bl, type APIUsage as bm, type APIResponsesResponse as bn, type APIKey as bo, type FrontendTokenRequest as c, type FrontendToken as d, type FrontendTokenAutoProvisionRequest as e, type CustomerToken as f, type DeviceStartResponse as g, type DeviceTokenResult as h, type ModelId as i, type OutputFormat as j, type Tool as k, type ToolChoice as l, type ResponseEvent as m, type Response as n, type FieldError as o, type RetryMetadata as p, type TransportErrorKind as q, type CustomerMetadata as r, type TierCode as s, type SubscriptionStatusKind as t, ToolRegistry as u, type ToolExecutionResult as v, type PublishableKey as w, type SecretKey as x, type ModelRelayKeyOptions as y, type ModelRelayOptions as z };
1174
+ export { ToolCallAccumulator as $, type ApiKey as A, createFunctionToolFromSchema as B, type CustomerTokenRequest as C, type DeviceStartRequest as D, createWebTool as E, type FrontendCustomer as F, toolChoiceAuto as G, toolChoiceRequired as H, type InputItem as I, toolChoiceNone as J, hasToolCalls as K, firstToolCall as L, type MetricsCallbacks as M, createUserMessage as N, type OIDCExchangeRequest as O, type ProviderId as P, createAssistantMessage as Q, type RetryConfig as R, type StructuredJSONEvent as S, type TraceCallbacks as T, createSystemMessage as U, toolResultMessage as V, respondToToolCall as W, assistantMessageWithToolCalls as X, createToolCall as Y, type ZodLikeSchema as Z, createFunctionCall as _, type RequestContext as a, type OutputFormatType as a$, zodToJsonSchema as a0, parseToolArgs as a1, tryParseToolArgs as a2, parseToolArgsRaw as a3, ToolArgsError as a4, formatToolErrorForModel as a5, hasRetryableErrors as a6, getRetryableErrors as a7, createRetryMessages as a8, executeWithRetry as a9, type Usage as aA, createUsage as aB, type UsageSummary as aC, type Project as aD, MessageRoles as aE, type MessageRole as aF, ContentPartTypes as aG, type ContentPartType as aH, type ContentPart as aI, InputItemTypes as aJ, type InputItemType as aK, OutputItemTypes as aL, type OutputItemType as aM, type OutputItem as aN, ToolTypes as aO, type ToolType as aP, WebToolIntents as aQ, type WebToolIntent as aR, type FunctionTool as aS, type WebSearchConfig as aT, type XSearchConfig as aU, type CodeExecConfig as aV, ToolChoiceTypes as aW, type ToolChoiceType as aX, type FunctionCall as aY, type ToolCall as aZ, OutputFormatTypes as a_, type JsonSchemaOptions as aa, type Schema as ab, type ToolHandler as ac, type RetryOptions as ad, SDK_VERSION as ae, DEFAULT_CLIENT_HEADER as af, DEFAULT_CONNECT_TIMEOUT_MS as ag, DEFAULT_REQUEST_TIMEOUT_MS as ah, type NonEmptyArray as ai, StopReasons as aj, type KnownStopReason as ak, type StopReason as al, asProviderId as am, asModelId as an, asTierCode as ao, SubscriptionStatuses as ap, type SubscriptionStatusKind as aq, BillingProviders as ar, type BillingProvider as as, type CustomerMetadata as at, type ModelRelayBaseOptions as au, type ModelRelayTokenOptions as av, type ModelRelayTokenProviderOptions as aw, type TokenType as ax, type DeviceTokenResponse as ay, type DeviceTokenPending as az, type TokenProvider as b, type JSONSchemaFormat as b0, type Citation as b1, type HttpRequestMetrics as b2, type StreamFirstTokenMetrics as b3, type TokenUsageMetrics as b4, mergeMetrics as b5, mergeTrace as b6, normalizeStopReason as b7, stopReasonToString as b8, normalizeModelId as b9, modelToString as ba, type ResponseEventType as bb, type MessageStartData as bc, type MessageDeltaData as bd, type MessageStopData as be, type ToolCallDelta as bf, type FunctionCallDelta as bg, type StructuredJSONRecordType as bh, type DeepPartial as bi, type APIFrontendToken as bj, type APICustomerRef as bk, type APICheckoutSession as bl, type APIUsage as bm, type APIResponsesResponse as bn, type APIKey as bo, type FrontendTokenRequest as c, type FrontendToken as d, type FrontendTokenAutoProvisionRequest as e, type CustomerToken as f, type DeviceStartResponse as g, type DeviceTokenResult as h, type ModelId as i, type OutputFormat as j, type Tool as k, type ToolChoice as l, type ResponseEvent as m, type Response as n, type FieldError as o, type RetryMetadata as p, type TransportErrorKind as q, ToolRegistry as r, type ToolExecutionResult as s, type TierCode as t, type PublishableKey as u, type SecretKey as v, type ModelRelayKeyOptions as w, type ModelRelayOptions as x, DEFAULT_BASE_URL as y, createFunctionTool as z };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@modelrelay/sdk",
3
- "version": "1.36.0",
3
+ "version": "1.37.0",
4
4
  "description": "TypeScript SDK for the ModelRelay API",
5
5
  "type": "module",
6
6
  "main": "dist/index.cjs",