@soat/sdk 0.14.2 → 0.14.4
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/dist/index.cjs +113 -0
- package/dist/index.d.cts +597 -2
- package/dist/index.d.mts +597 -2
- package/dist/index.mjs +113 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -905,6 +905,34 @@ var AiProviders = class {
|
|
|
905
905
|
}
|
|
906
906
|
});
|
|
907
907
|
}
|
|
908
|
+
/**
|
|
909
|
+
* List per-provider price overrides
|
|
910
|
+
*
|
|
911
|
+
* Returns the per-provider price overrides for this AI provider instance. An override prices this specific provider (e.g. an enterprise-negotiated rate or a gateway with markup) and wins over the global default at cost time. Authorized by the caller's access to the provider's project — so, unlike the global price book, a project's own overrides are visible here.
|
|
912
|
+
*
|
|
913
|
+
*/
|
|
914
|
+
static getAiProviderPrices(options) {
|
|
915
|
+
return (options.client ?? client).get({
|
|
916
|
+
url: "/api/v1/ai-providers/{ai_provider_id}/prices",
|
|
917
|
+
...options
|
|
918
|
+
});
|
|
919
|
+
}
|
|
920
|
+
/**
|
|
921
|
+
* Upsert per-provider price overrides
|
|
922
|
+
*
|
|
923
|
+
* Upserts price overrides for this AI provider instance, keyed on (model, effective_from). The provider slug is taken from the AI provider itself, so only the model, rates, and effective_from are supplied. Authorized by the caller's access to the provider's project. `effective_from` must be in the future — past prices are immutable, so ship corrections as new future-dated rows.
|
|
924
|
+
*
|
|
925
|
+
*/
|
|
926
|
+
static updateAiProviderPrices(options) {
|
|
927
|
+
return (options.client ?? client).put({
|
|
928
|
+
url: "/api/v1/ai-providers/{ai_provider_id}/prices",
|
|
929
|
+
...options,
|
|
930
|
+
headers: {
|
|
931
|
+
"Content-Type": "application/json",
|
|
932
|
+
...options.headers
|
|
933
|
+
}
|
|
934
|
+
});
|
|
935
|
+
}
|
|
908
936
|
};
|
|
909
937
|
var ApiKeys = class {
|
|
910
938
|
/**
|
|
@@ -2362,6 +2390,34 @@ var Projects = class {
|
|
|
2362
2390
|
}
|
|
2363
2391
|
});
|
|
2364
2392
|
}
|
|
2393
|
+
/**
|
|
2394
|
+
* List a project's price rows
|
|
2395
|
+
*
|
|
2396
|
+
* Returns the project's per-provider-slug price rows — the middle pricing tier that covers every one of the project's instances of a given provider slug. At cost time a per-provider-instance override wins over these, and these win over the global default. Authorized by the caller's access to the project.
|
|
2397
|
+
*
|
|
2398
|
+
*/
|
|
2399
|
+
static getProjectPrices(options) {
|
|
2400
|
+
return (options.client ?? client).get({
|
|
2401
|
+
url: "/api/v1/projects/{project_id}/prices",
|
|
2402
|
+
...options
|
|
2403
|
+
});
|
|
2404
|
+
}
|
|
2405
|
+
/**
|
|
2406
|
+
* Upsert a project's price rows
|
|
2407
|
+
*
|
|
2408
|
+
* Upserts project + provider-slug price rows, keyed on (provider, model, effective_from). A row covers all of the project's instances of that provider slug. Authorized by the caller's access to the project. `effective_from` must be in the future — past prices are immutable, so ship corrections as new future-dated rows.
|
|
2409
|
+
*
|
|
2410
|
+
*/
|
|
2411
|
+
static updateProjectPrices(options) {
|
|
2412
|
+
return (options.client ?? client).put({
|
|
2413
|
+
url: "/api/v1/projects/{project_id}/prices",
|
|
2414
|
+
...options,
|
|
2415
|
+
headers: {
|
|
2416
|
+
"Content-Type": "application/json",
|
|
2417
|
+
...options.headers
|
|
2418
|
+
}
|
|
2419
|
+
});
|
|
2420
|
+
}
|
|
2365
2421
|
};
|
|
2366
2422
|
var Secrets = class {
|
|
2367
2423
|
/**
|
|
@@ -2827,6 +2883,60 @@ var Triggers = class {
|
|
|
2827
2883
|
});
|
|
2828
2884
|
}
|
|
2829
2885
|
};
|
|
2886
|
+
var Usage = class {
|
|
2887
|
+
/**
|
|
2888
|
+
* List usage meters
|
|
2889
|
+
*
|
|
2890
|
+
* Returns the raw usage-meter rows the caller can access, most recent first, optionally filtered by agent and generation. Each row is the per-generation token usage as reported by the provider, for audit and reconciliation.
|
|
2891
|
+
*
|
|
2892
|
+
*/
|
|
2893
|
+
static listUsageMeters(options) {
|
|
2894
|
+
return (options?.client ?? client).get({
|
|
2895
|
+
url: "/api/v1/usage/meters",
|
|
2896
|
+
...options
|
|
2897
|
+
});
|
|
2898
|
+
}
|
|
2899
|
+
/**
|
|
2900
|
+
* Get a generation's billing receipt
|
|
2901
|
+
*
|
|
2902
|
+
* Returns a billing receipt for a completed generation: per-model line items (tokens, the price-book version that priced them, and cost) plus totals.
|
|
2903
|
+
*
|
|
2904
|
+
*/
|
|
2905
|
+
static getUsageReceipt(options) {
|
|
2906
|
+
return (options.client ?? client).get({
|
|
2907
|
+
url: "/api/v1/usage/receipt",
|
|
2908
|
+
...options
|
|
2909
|
+
});
|
|
2910
|
+
}
|
|
2911
|
+
/**
|
|
2912
|
+
* Get the price book
|
|
2913
|
+
*
|
|
2914
|
+
* Returns the global price book — the versioned per-provider/model unit prices used to compute usage cost at write time. Readable by any authenticated user.
|
|
2915
|
+
*
|
|
2916
|
+
*/
|
|
2917
|
+
static getPriceBook(options) {
|
|
2918
|
+
return (options?.client ?? client).get({
|
|
2919
|
+
url: "/api/v1/usage/prices",
|
|
2920
|
+
...options
|
|
2921
|
+
});
|
|
2922
|
+
}
|
|
2923
|
+
/**
|
|
2924
|
+
* Upsert price-book rows
|
|
2925
|
+
*
|
|
2926
|
+
* Upserts price rows keyed on (provider, model, effective_from). Admin only. `effective_from` must be in the future — past prices are immutable so recorded costs stay explainable; ship corrections as new future-dated rows.
|
|
2927
|
+
*
|
|
2928
|
+
*/
|
|
2929
|
+
static upsertPriceBook(options) {
|
|
2930
|
+
return (options.client ?? client).put({
|
|
2931
|
+
url: "/api/v1/usage/prices",
|
|
2932
|
+
...options,
|
|
2933
|
+
headers: {
|
|
2934
|
+
"Content-Type": "application/json",
|
|
2935
|
+
...options.headers
|
|
2936
|
+
}
|
|
2937
|
+
});
|
|
2938
|
+
}
|
|
2939
|
+
};
|
|
2830
2940
|
var Users = class {
|
|
2831
2941
|
/**
|
|
2832
2942
|
* Get the current authenticated user
|
|
@@ -3106,6 +3216,7 @@ var SoatClient = class {
|
|
|
3106
3216
|
tools;
|
|
3107
3217
|
traces;
|
|
3108
3218
|
triggers;
|
|
3219
|
+
usage;
|
|
3109
3220
|
users;
|
|
3110
3221
|
webhooks;
|
|
3111
3222
|
constructor({ baseUrl, token, headers } = {}) {
|
|
@@ -3137,9 +3248,10 @@ var SoatClient = class {
|
|
|
3137
3248
|
this.tools = bindResource(Tools, httpClient);
|
|
3138
3249
|
this.traces = bindResource(Traces, httpClient);
|
|
3139
3250
|
this.triggers = bindResource(Triggers, httpClient);
|
|
3251
|
+
this.usage = bindResource(Usage, httpClient);
|
|
3140
3252
|
this.users = bindResource(Users, httpClient);
|
|
3141
3253
|
this.webhooks = bindResource(Webhooks, httpClient);
|
|
3142
3254
|
}
|
|
3143
3255
|
};
|
|
3144
3256
|
//#endregion
|
|
3145
|
-
export { Actors, Agents, AiProviders, ApiKeys, Chats, Conversations, Discussions, Documents, Embeddings, Files, Formations, Generations, IngestionRules, Knowledge, Memories, MemoryEntries, Orchestrations, Policies, Projects, Secrets, Sessions, SoatClient, Tools, Traces, Triggers, Users, Webhooks, createClient, createConfig };
|
|
3257
|
+
export { Actors, Agents, AiProviders, ApiKeys, Chats, Conversations, Discussions, Documents, Embeddings, Files, Formations, Generations, IngestionRules, Knowledge, Memories, MemoryEntries, Orchestrations, Policies, Projects, Secrets, Sessions, SoatClient, Tools, Traces, Triggers, Usage, Users, Webhooks, createClient, createConfig };
|