@miradorlabs/web-grpc 2.48.0 → 2.49.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@miradorlabs/web-grpc",
3
- "version": "2.48.0",
3
+ "version": "2.49.0",
4
4
  "description": "Generated gRPC (grpc-js) client stubs for the Mirador web gateway.",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",
@@ -923,6 +923,39 @@ export interface FileStateGroup {
923
923
  tiers: FileStateTiers | undefined;
924
924
  }
925
925
 
926
+ export interface ListModelPricesRequest {
927
+ organizationId: string;
928
+ projectId: string;
929
+ /** Structured filter. Unset or empty = the full latest catalog (still paginated). */
930
+ filter: AIModelPriceFilter | undefined;
931
+ pageSize: number;
932
+ pageToken: string;
933
+ }
934
+
935
+ export interface AIModelPriceFilter {
936
+ source: string[];
937
+ provider: string[];
938
+ model: string[];
939
+ }
940
+
941
+ export interface ListModelPricesResponse {
942
+ status: ResponseStatus | undefined;
943
+ prices: AIModelPrice[];
944
+ nextPageToken: string;
945
+ totalCount?: number | undefined;
946
+ }
947
+
948
+ export interface AIModelPrice {
949
+ source: string;
950
+ provider: string;
951
+ model: string;
952
+ scrapedAt: Date | undefined;
953
+ inputUsdPerMtok: number;
954
+ outputUsdPerMtok: number;
955
+ cacheReadUsdPerMtok: number;
956
+ cacheWriteUsdPerMtok: number;
957
+ }
958
+
926
959
  export interface AITokenUsage {
927
960
  inputTokens: number;
928
961
  outputTokens: number;
@@ -7766,6 +7799,595 @@ export const FileStateGroup: MessageFns<FileStateGroup> = {
7766
7799
  },
7767
7800
  };
7768
7801
 
7802
+ function createBaseListModelPricesRequest(): ListModelPricesRequest {
7803
+ return { organizationId: "", projectId: "", filter: undefined, pageSize: 0, pageToken: "" };
7804
+ }
7805
+
7806
+ export const ListModelPricesRequest: MessageFns<ListModelPricesRequest> = {
7807
+ encode(message: ListModelPricesRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
7808
+ if (message.organizationId !== "") {
7809
+ writer.uint32(10).string(message.organizationId);
7810
+ }
7811
+ if (message.projectId !== "") {
7812
+ writer.uint32(18).string(message.projectId);
7813
+ }
7814
+ if (message.filter !== undefined) {
7815
+ AIModelPriceFilter.encode(message.filter, writer.uint32(26).fork()).join();
7816
+ }
7817
+ if (message.pageSize !== 0) {
7818
+ writer.uint32(32).int32(message.pageSize);
7819
+ }
7820
+ if (message.pageToken !== "") {
7821
+ writer.uint32(42).string(message.pageToken);
7822
+ }
7823
+ return writer;
7824
+ },
7825
+
7826
+ decode(input: BinaryReader | Uint8Array, length?: number): ListModelPricesRequest {
7827
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
7828
+ const previousRecursionDepth = (reader as any).__tsProtoDecodeDepth ?? 0;
7829
+ if (previousRecursionDepth >= 100) {
7830
+ throw new globalThis.Error("protobuf decode recursion limit exceeded");
7831
+ }
7832
+ (reader as any).__tsProtoDecodeDepth = previousRecursionDepth + 1;
7833
+ try {
7834
+ const end = length === undefined ? reader.len : reader.pos + length;
7835
+ const message = createBaseListModelPricesRequest();
7836
+ while (reader.pos < end) {
7837
+ const tag = reader.uint32();
7838
+ switch (tag >>> 3) {
7839
+ case 1: {
7840
+ if (tag !== 10) {
7841
+ break;
7842
+ }
7843
+
7844
+ message.organizationId = reader.string();
7845
+ continue;
7846
+ }
7847
+ case 2: {
7848
+ if (tag !== 18) {
7849
+ break;
7850
+ }
7851
+
7852
+ message.projectId = reader.string();
7853
+ continue;
7854
+ }
7855
+ case 3: {
7856
+ if (tag !== 26) {
7857
+ break;
7858
+ }
7859
+
7860
+ message.filter = AIModelPriceFilter.decode(reader, reader.uint32());
7861
+ continue;
7862
+ }
7863
+ case 4: {
7864
+ if (tag !== 32) {
7865
+ break;
7866
+ }
7867
+
7868
+ message.pageSize = reader.int32();
7869
+ continue;
7870
+ }
7871
+ case 5: {
7872
+ if (tag !== 42) {
7873
+ break;
7874
+ }
7875
+
7876
+ message.pageToken = reader.string();
7877
+ continue;
7878
+ }
7879
+ }
7880
+ if ((tag & 7) === 4 || tag === 0) {
7881
+ break;
7882
+ }
7883
+ reader.skip(tag & 7);
7884
+ }
7885
+ return message;
7886
+ } finally {
7887
+ (reader as any).__tsProtoDecodeDepth = previousRecursionDepth;
7888
+ }
7889
+ },
7890
+
7891
+ fromJSON(object: any): ListModelPricesRequest {
7892
+ return {
7893
+ organizationId: isSet(object.organizationId)
7894
+ ? globalThis.String(object.organizationId)
7895
+ : isSet(object.organization_id)
7896
+ ? globalThis.String(object.organization_id)
7897
+ : "",
7898
+ projectId: isSet(object.projectId)
7899
+ ? globalThis.String(object.projectId)
7900
+ : isSet(object.project_id)
7901
+ ? globalThis.String(object.project_id)
7902
+ : "",
7903
+ filter: isSet(object.filter) ? AIModelPriceFilter.fromJSON(object.filter) : undefined,
7904
+ pageSize: isSet(object.pageSize)
7905
+ ? globalThis.Number(object.pageSize)
7906
+ : isSet(object.page_size)
7907
+ ? globalThis.Number(object.page_size)
7908
+ : 0,
7909
+ pageToken: isSet(object.pageToken)
7910
+ ? globalThis.String(object.pageToken)
7911
+ : isSet(object.page_token)
7912
+ ? globalThis.String(object.page_token)
7913
+ : "",
7914
+ };
7915
+ },
7916
+
7917
+ toJSON(message: ListModelPricesRequest): unknown {
7918
+ const obj: any = {};
7919
+ if (message.organizationId !== "") {
7920
+ obj.organizationId = message.organizationId;
7921
+ }
7922
+ if (message.projectId !== "") {
7923
+ obj.projectId = message.projectId;
7924
+ }
7925
+ if (message.filter !== undefined) {
7926
+ obj.filter = AIModelPriceFilter.toJSON(message.filter);
7927
+ }
7928
+ if (message.pageSize !== 0) {
7929
+ obj.pageSize = Math.round(message.pageSize);
7930
+ }
7931
+ if (message.pageToken !== "") {
7932
+ obj.pageToken = message.pageToken;
7933
+ }
7934
+ return obj;
7935
+ },
7936
+
7937
+ create<I extends Exact<DeepPartial<ListModelPricesRequest>, I>>(base?: I): ListModelPricesRequest {
7938
+ return ListModelPricesRequest.fromPartial(base ?? ({} as any));
7939
+ },
7940
+ fromPartial<I extends Exact<DeepPartial<ListModelPricesRequest>, I>>(object: I): ListModelPricesRequest {
7941
+ const message = createBaseListModelPricesRequest();
7942
+ message.organizationId = object.organizationId ?? "";
7943
+ message.projectId = object.projectId ?? "";
7944
+ message.filter = (object.filter !== undefined && object.filter !== null)
7945
+ ? AIModelPriceFilter.fromPartial(object.filter)
7946
+ : undefined;
7947
+ message.pageSize = object.pageSize ?? 0;
7948
+ message.pageToken = object.pageToken ?? "";
7949
+ return message;
7950
+ },
7951
+ };
7952
+
7953
+ function createBaseAIModelPriceFilter(): AIModelPriceFilter {
7954
+ return { source: [], provider: [], model: [] };
7955
+ }
7956
+
7957
+ export const AIModelPriceFilter: MessageFns<AIModelPriceFilter> = {
7958
+ encode(message: AIModelPriceFilter, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
7959
+ for (const v of message.source) {
7960
+ writer.uint32(10).string(v!);
7961
+ }
7962
+ for (const v of message.provider) {
7963
+ writer.uint32(18).string(v!);
7964
+ }
7965
+ for (const v of message.model) {
7966
+ writer.uint32(26).string(v!);
7967
+ }
7968
+ return writer;
7969
+ },
7970
+
7971
+ decode(input: BinaryReader | Uint8Array, length?: number): AIModelPriceFilter {
7972
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
7973
+ const previousRecursionDepth = (reader as any).__tsProtoDecodeDepth ?? 0;
7974
+ if (previousRecursionDepth >= 100) {
7975
+ throw new globalThis.Error("protobuf decode recursion limit exceeded");
7976
+ }
7977
+ (reader as any).__tsProtoDecodeDepth = previousRecursionDepth + 1;
7978
+ try {
7979
+ const end = length === undefined ? reader.len : reader.pos + length;
7980
+ const message = createBaseAIModelPriceFilter();
7981
+ while (reader.pos < end) {
7982
+ const tag = reader.uint32();
7983
+ switch (tag >>> 3) {
7984
+ case 1: {
7985
+ if (tag !== 10) {
7986
+ break;
7987
+ }
7988
+
7989
+ message.source.push(reader.string());
7990
+ continue;
7991
+ }
7992
+ case 2: {
7993
+ if (tag !== 18) {
7994
+ break;
7995
+ }
7996
+
7997
+ message.provider.push(reader.string());
7998
+ continue;
7999
+ }
8000
+ case 3: {
8001
+ if (tag !== 26) {
8002
+ break;
8003
+ }
8004
+
8005
+ message.model.push(reader.string());
8006
+ continue;
8007
+ }
8008
+ }
8009
+ if ((tag & 7) === 4 || tag === 0) {
8010
+ break;
8011
+ }
8012
+ reader.skip(tag & 7);
8013
+ }
8014
+ return message;
8015
+ } finally {
8016
+ (reader as any).__tsProtoDecodeDepth = previousRecursionDepth;
8017
+ }
8018
+ },
8019
+
8020
+ fromJSON(object: any): AIModelPriceFilter {
8021
+ return {
8022
+ source: globalThis.Array.isArray(object?.source) ? object.source.map((e: any) => globalThis.String(e)) : [],
8023
+ provider: globalThis.Array.isArray(object?.provider) ? object.provider.map((e: any) => globalThis.String(e)) : [],
8024
+ model: globalThis.Array.isArray(object?.model) ? object.model.map((e: any) => globalThis.String(e)) : [],
8025
+ };
8026
+ },
8027
+
8028
+ toJSON(message: AIModelPriceFilter): unknown {
8029
+ const obj: any = {};
8030
+ if (message.source?.length) {
8031
+ obj.source = message.source;
8032
+ }
8033
+ if (message.provider?.length) {
8034
+ obj.provider = message.provider;
8035
+ }
8036
+ if (message.model?.length) {
8037
+ obj.model = message.model;
8038
+ }
8039
+ return obj;
8040
+ },
8041
+
8042
+ create<I extends Exact<DeepPartial<AIModelPriceFilter>, I>>(base?: I): AIModelPriceFilter {
8043
+ return AIModelPriceFilter.fromPartial(base ?? ({} as any));
8044
+ },
8045
+ fromPartial<I extends Exact<DeepPartial<AIModelPriceFilter>, I>>(object: I): AIModelPriceFilter {
8046
+ const message = createBaseAIModelPriceFilter();
8047
+ message.source = object.source?.map((e) => e) || [];
8048
+ message.provider = object.provider?.map((e) => e) || [];
8049
+ message.model = object.model?.map((e) => e) || [];
8050
+ return message;
8051
+ },
8052
+ };
8053
+
8054
+ function createBaseListModelPricesResponse(): ListModelPricesResponse {
8055
+ return { status: undefined, prices: [], nextPageToken: "", totalCount: undefined };
8056
+ }
8057
+
8058
+ export const ListModelPricesResponse: MessageFns<ListModelPricesResponse> = {
8059
+ encode(message: ListModelPricesResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
8060
+ if (message.status !== undefined) {
8061
+ ResponseStatus.encode(message.status, writer.uint32(10).fork()).join();
8062
+ }
8063
+ for (const v of message.prices) {
8064
+ AIModelPrice.encode(v!, writer.uint32(18).fork()).join();
8065
+ }
8066
+ if (message.nextPageToken !== "") {
8067
+ writer.uint32(26).string(message.nextPageToken);
8068
+ }
8069
+ if (message.totalCount !== undefined) {
8070
+ writer.uint32(32).int64(message.totalCount);
8071
+ }
8072
+ return writer;
8073
+ },
8074
+
8075
+ decode(input: BinaryReader | Uint8Array, length?: number): ListModelPricesResponse {
8076
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
8077
+ const previousRecursionDepth = (reader as any).__tsProtoDecodeDepth ?? 0;
8078
+ if (previousRecursionDepth >= 100) {
8079
+ throw new globalThis.Error("protobuf decode recursion limit exceeded");
8080
+ }
8081
+ (reader as any).__tsProtoDecodeDepth = previousRecursionDepth + 1;
8082
+ try {
8083
+ const end = length === undefined ? reader.len : reader.pos + length;
8084
+ const message = createBaseListModelPricesResponse();
8085
+ while (reader.pos < end) {
8086
+ const tag = reader.uint32();
8087
+ switch (tag >>> 3) {
8088
+ case 1: {
8089
+ if (tag !== 10) {
8090
+ break;
8091
+ }
8092
+
8093
+ message.status = ResponseStatus.decode(reader, reader.uint32());
8094
+ continue;
8095
+ }
8096
+ case 2: {
8097
+ if (tag !== 18) {
8098
+ break;
8099
+ }
8100
+
8101
+ message.prices.push(AIModelPrice.decode(reader, reader.uint32()));
8102
+ continue;
8103
+ }
8104
+ case 3: {
8105
+ if (tag !== 26) {
8106
+ break;
8107
+ }
8108
+
8109
+ message.nextPageToken = reader.string();
8110
+ continue;
8111
+ }
8112
+ case 4: {
8113
+ if (tag !== 32) {
8114
+ break;
8115
+ }
8116
+
8117
+ message.totalCount = longToNumber(reader.int64());
8118
+ continue;
8119
+ }
8120
+ }
8121
+ if ((tag & 7) === 4 || tag === 0) {
8122
+ break;
8123
+ }
8124
+ reader.skip(tag & 7);
8125
+ }
8126
+ return message;
8127
+ } finally {
8128
+ (reader as any).__tsProtoDecodeDepth = previousRecursionDepth;
8129
+ }
8130
+ },
8131
+
8132
+ fromJSON(object: any): ListModelPricesResponse {
8133
+ return {
8134
+ status: isSet(object.status) ? ResponseStatus.fromJSON(object.status) : undefined,
8135
+ prices: globalThis.Array.isArray(object?.prices) ? object.prices.map((e: any) => AIModelPrice.fromJSON(e)) : [],
8136
+ nextPageToken: isSet(object.nextPageToken)
8137
+ ? globalThis.String(object.nextPageToken)
8138
+ : isSet(object.next_page_token)
8139
+ ? globalThis.String(object.next_page_token)
8140
+ : "",
8141
+ totalCount: isSet(object.totalCount)
8142
+ ? globalThis.Number(object.totalCount)
8143
+ : isSet(object.total_count)
8144
+ ? globalThis.Number(object.total_count)
8145
+ : undefined,
8146
+ };
8147
+ },
8148
+
8149
+ toJSON(message: ListModelPricesResponse): unknown {
8150
+ const obj: any = {};
8151
+ if (message.status !== undefined) {
8152
+ obj.status = ResponseStatus.toJSON(message.status);
8153
+ }
8154
+ if (message.prices?.length) {
8155
+ obj.prices = message.prices.map((e) => AIModelPrice.toJSON(e));
8156
+ }
8157
+ if (message.nextPageToken !== "") {
8158
+ obj.nextPageToken = message.nextPageToken;
8159
+ }
8160
+ if (message.totalCount !== undefined) {
8161
+ obj.totalCount = Math.round(message.totalCount);
8162
+ }
8163
+ return obj;
8164
+ },
8165
+
8166
+ create<I extends Exact<DeepPartial<ListModelPricesResponse>, I>>(base?: I): ListModelPricesResponse {
8167
+ return ListModelPricesResponse.fromPartial(base ?? ({} as any));
8168
+ },
8169
+ fromPartial<I extends Exact<DeepPartial<ListModelPricesResponse>, I>>(object: I): ListModelPricesResponse {
8170
+ const message = createBaseListModelPricesResponse();
8171
+ message.status = (object.status !== undefined && object.status !== null)
8172
+ ? ResponseStatus.fromPartial(object.status)
8173
+ : undefined;
8174
+ message.prices = object.prices?.map((e) => AIModelPrice.fromPartial(e)) || [];
8175
+ message.nextPageToken = object.nextPageToken ?? "";
8176
+ message.totalCount = object.totalCount ?? undefined;
8177
+ return message;
8178
+ },
8179
+ };
8180
+
8181
+ function createBaseAIModelPrice(): AIModelPrice {
8182
+ return {
8183
+ source: "",
8184
+ provider: "",
8185
+ model: "",
8186
+ scrapedAt: undefined,
8187
+ inputUsdPerMtok: 0,
8188
+ outputUsdPerMtok: 0,
8189
+ cacheReadUsdPerMtok: 0,
8190
+ cacheWriteUsdPerMtok: 0,
8191
+ };
8192
+ }
8193
+
8194
+ export const AIModelPrice: MessageFns<AIModelPrice> = {
8195
+ encode(message: AIModelPrice, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
8196
+ if (message.source !== "") {
8197
+ writer.uint32(10).string(message.source);
8198
+ }
8199
+ if (message.provider !== "") {
8200
+ writer.uint32(18).string(message.provider);
8201
+ }
8202
+ if (message.model !== "") {
8203
+ writer.uint32(26).string(message.model);
8204
+ }
8205
+ if (message.scrapedAt !== undefined) {
8206
+ Timestamp.encode(toTimestamp(message.scrapedAt), writer.uint32(34).fork()).join();
8207
+ }
8208
+ if (message.inputUsdPerMtok !== 0) {
8209
+ writer.uint32(41).double(message.inputUsdPerMtok);
8210
+ }
8211
+ if (message.outputUsdPerMtok !== 0) {
8212
+ writer.uint32(49).double(message.outputUsdPerMtok);
8213
+ }
8214
+ if (message.cacheReadUsdPerMtok !== 0) {
8215
+ writer.uint32(57).double(message.cacheReadUsdPerMtok);
8216
+ }
8217
+ if (message.cacheWriteUsdPerMtok !== 0) {
8218
+ writer.uint32(65).double(message.cacheWriteUsdPerMtok);
8219
+ }
8220
+ return writer;
8221
+ },
8222
+
8223
+ decode(input: BinaryReader | Uint8Array, length?: number): AIModelPrice {
8224
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
8225
+ const previousRecursionDepth = (reader as any).__tsProtoDecodeDepth ?? 0;
8226
+ if (previousRecursionDepth >= 100) {
8227
+ throw new globalThis.Error("protobuf decode recursion limit exceeded");
8228
+ }
8229
+ (reader as any).__tsProtoDecodeDepth = previousRecursionDepth + 1;
8230
+ try {
8231
+ const end = length === undefined ? reader.len : reader.pos + length;
8232
+ const message = createBaseAIModelPrice();
8233
+ while (reader.pos < end) {
8234
+ const tag = reader.uint32();
8235
+ switch (tag >>> 3) {
8236
+ case 1: {
8237
+ if (tag !== 10) {
8238
+ break;
8239
+ }
8240
+
8241
+ message.source = reader.string();
8242
+ continue;
8243
+ }
8244
+ case 2: {
8245
+ if (tag !== 18) {
8246
+ break;
8247
+ }
8248
+
8249
+ message.provider = reader.string();
8250
+ continue;
8251
+ }
8252
+ case 3: {
8253
+ if (tag !== 26) {
8254
+ break;
8255
+ }
8256
+
8257
+ message.model = reader.string();
8258
+ continue;
8259
+ }
8260
+ case 4: {
8261
+ if (tag !== 34) {
8262
+ break;
8263
+ }
8264
+
8265
+ message.scrapedAt = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
8266
+ continue;
8267
+ }
8268
+ case 5: {
8269
+ if (tag !== 41) {
8270
+ break;
8271
+ }
8272
+
8273
+ message.inputUsdPerMtok = reader.double();
8274
+ continue;
8275
+ }
8276
+ case 6: {
8277
+ if (tag !== 49) {
8278
+ break;
8279
+ }
8280
+
8281
+ message.outputUsdPerMtok = reader.double();
8282
+ continue;
8283
+ }
8284
+ case 7: {
8285
+ if (tag !== 57) {
8286
+ break;
8287
+ }
8288
+
8289
+ message.cacheReadUsdPerMtok = reader.double();
8290
+ continue;
8291
+ }
8292
+ case 8: {
8293
+ if (tag !== 65) {
8294
+ break;
8295
+ }
8296
+
8297
+ message.cacheWriteUsdPerMtok = reader.double();
8298
+ continue;
8299
+ }
8300
+ }
8301
+ if ((tag & 7) === 4 || tag === 0) {
8302
+ break;
8303
+ }
8304
+ reader.skip(tag & 7);
8305
+ }
8306
+ return message;
8307
+ } finally {
8308
+ (reader as any).__tsProtoDecodeDepth = previousRecursionDepth;
8309
+ }
8310
+ },
8311
+
8312
+ fromJSON(object: any): AIModelPrice {
8313
+ return {
8314
+ source: isSet(object.source) ? globalThis.String(object.source) : "",
8315
+ provider: isSet(object.provider) ? globalThis.String(object.provider) : "",
8316
+ model: isSet(object.model) ? globalThis.String(object.model) : "",
8317
+ scrapedAt: isSet(object.scrapedAt)
8318
+ ? fromJsonTimestamp(object.scrapedAt)
8319
+ : isSet(object.scraped_at)
8320
+ ? fromJsonTimestamp(object.scraped_at)
8321
+ : undefined,
8322
+ inputUsdPerMtok: isSet(object.inputUsdPerMtok)
8323
+ ? globalThis.Number(object.inputUsdPerMtok)
8324
+ : isSet(object.input_usd_per_mtok)
8325
+ ? globalThis.Number(object.input_usd_per_mtok)
8326
+ : 0,
8327
+ outputUsdPerMtok: isSet(object.outputUsdPerMtok)
8328
+ ? globalThis.Number(object.outputUsdPerMtok)
8329
+ : isSet(object.output_usd_per_mtok)
8330
+ ? globalThis.Number(object.output_usd_per_mtok)
8331
+ : 0,
8332
+ cacheReadUsdPerMtok: isSet(object.cacheReadUsdPerMtok)
8333
+ ? globalThis.Number(object.cacheReadUsdPerMtok)
8334
+ : isSet(object.cache_read_usd_per_mtok)
8335
+ ? globalThis.Number(object.cache_read_usd_per_mtok)
8336
+ : 0,
8337
+ cacheWriteUsdPerMtok: isSet(object.cacheWriteUsdPerMtok)
8338
+ ? globalThis.Number(object.cacheWriteUsdPerMtok)
8339
+ : isSet(object.cache_write_usd_per_mtok)
8340
+ ? globalThis.Number(object.cache_write_usd_per_mtok)
8341
+ : 0,
8342
+ };
8343
+ },
8344
+
8345
+ toJSON(message: AIModelPrice): unknown {
8346
+ const obj: any = {};
8347
+ if (message.source !== "") {
8348
+ obj.source = message.source;
8349
+ }
8350
+ if (message.provider !== "") {
8351
+ obj.provider = message.provider;
8352
+ }
8353
+ if (message.model !== "") {
8354
+ obj.model = message.model;
8355
+ }
8356
+ if (message.scrapedAt !== undefined) {
8357
+ obj.scrapedAt = message.scrapedAt.toISOString();
8358
+ }
8359
+ if (message.inputUsdPerMtok !== 0) {
8360
+ obj.inputUsdPerMtok = message.inputUsdPerMtok;
8361
+ }
8362
+ if (message.outputUsdPerMtok !== 0) {
8363
+ obj.outputUsdPerMtok = message.outputUsdPerMtok;
8364
+ }
8365
+ if (message.cacheReadUsdPerMtok !== 0) {
8366
+ obj.cacheReadUsdPerMtok = message.cacheReadUsdPerMtok;
8367
+ }
8368
+ if (message.cacheWriteUsdPerMtok !== 0) {
8369
+ obj.cacheWriteUsdPerMtok = message.cacheWriteUsdPerMtok;
8370
+ }
8371
+ return obj;
8372
+ },
8373
+
8374
+ create<I extends Exact<DeepPartial<AIModelPrice>, I>>(base?: I): AIModelPrice {
8375
+ return AIModelPrice.fromPartial(base ?? ({} as any));
8376
+ },
8377
+ fromPartial<I extends Exact<DeepPartial<AIModelPrice>, I>>(object: I): AIModelPrice {
8378
+ const message = createBaseAIModelPrice();
8379
+ message.source = object.source ?? "";
8380
+ message.provider = object.provider ?? "";
8381
+ message.model = object.model ?? "";
8382
+ message.scrapedAt = object.scrapedAt ?? undefined;
8383
+ message.inputUsdPerMtok = object.inputUsdPerMtok ?? 0;
8384
+ message.outputUsdPerMtok = object.outputUsdPerMtok ?? 0;
8385
+ message.cacheReadUsdPerMtok = object.cacheReadUsdPerMtok ?? 0;
8386
+ message.cacheWriteUsdPerMtok = object.cacheWriteUsdPerMtok ?? 0;
8387
+ return message;
8388
+ },
8389
+ };
8390
+
7769
8391
  function createBaseAITokenUsage(): AITokenUsage {
7770
8392
  return { inputTokens: 0, outputTokens: 0, cacheReadTokens: 0, cacheWriteTokens: 0, providerCostUsd: 0 };
7771
8393
  }
@@ -7921,8 +8543,8 @@ export const AITokenUsage: MessageFns<AITokenUsage> = {
7921
8543
 
7922
8544
  /**
7923
8545
  * AIGatewayService is the frontend-facing proxy over telemetry.api.v1.AIService:
7924
- * the AI session catalog, one session's conversational replay, and the principal
7925
- * id->name catalog (read + alias write). A thin proxy — it resolves the caller's
8546
+ * the AI session catalog, one session's conversational replay, the principal
8547
+ * id->name catalog (read + alias write), and the global model-price catalog. A thin proxy — it resolves the caller's
7926
8548
  * identity, stamps the authorized organization/project, and forwards. Messages
7927
8549
  * duplicate the telemetry-api shape (proto domain isolation); unary responses
7928
8550
  * carry ResponseStatus, streams do not.
@@ -7966,6 +8588,8 @@ export interface AIGatewayService {
7966
8588
  GetFileStateSummary(request: FileStateSummaryRequest, metadata?: Metadata): Promise<GetFileStateSummaryResponse>;
7967
8589
  /** Live stream of the funnel: a complete snapshot re-derived each tick. */
7968
8590
  StreamFileStateSummary(request: FileStateSummaryRequest, metadata?: Metadata): Observable<FileStateSummary>;
8591
+ /** Latest observed list price per (source, provider, model) from the global catalog. */
8592
+ ListModelPrices(request: ListModelPricesRequest, metadata?: Metadata): Promise<ListModelPricesResponse>;
7969
8593
  }
7970
8594
 
7971
8595
  export const AIGatewayServiceServiceName = "gateway.web.v1.AIGatewayService";
@@ -7988,6 +8612,7 @@ export class AIGatewayServiceClientImpl implements AIGatewayService {
7988
8612
  this.ListFileStates = this.ListFileStates.bind(this);
7989
8613
  this.GetFileStateSummary = this.GetFileStateSummary.bind(this);
7990
8614
  this.StreamFileStateSummary = this.StreamFileStateSummary.bind(this);
8615
+ this.ListModelPrices = this.ListModelPrices.bind(this);
7991
8616
  }
7992
8617
  ListSessions(request: ListSessionsRequest, metadata?: Metadata): Promise<ListSessionsResponse> {
7993
8618
  const data = ListSessionsRequest.encode(request).finish();
@@ -8069,6 +8694,12 @@ export class AIGatewayServiceClientImpl implements AIGatewayService {
8069
8694
  const result = this.rpc.serverStreamingRequest(this.service, "StreamFileStateSummary", data, metadata);
8070
8695
  return result.pipe(map((data) => FileStateSummary.decode(new BinaryReader(data))));
8071
8696
  }
8697
+
8698
+ ListModelPrices(request: ListModelPricesRequest, metadata?: Metadata): Promise<ListModelPricesResponse> {
8699
+ const data = ListModelPricesRequest.encode(request).finish();
8700
+ const promise = this.rpc.request(this.service, "ListModelPrices", data, metadata);
8701
+ return promise.then((data) => ListModelPricesResponse.decode(new BinaryReader(data)));
8702
+ }
8072
8703
  }
8073
8704
 
8074
8705
  interface Rpc {