@crestal/nation-sdk 0.1.19

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.
Files changed (61) hide show
  1. package/.openapi-generator/FILES +51 -0
  2. package/.openapi-generator/VERSION +1 -0
  3. package/.openapi-generator-ignore +23 -0
  4. package/README.md +126 -0
  5. package/api.ts +4195 -0
  6. package/base.ts +86 -0
  7. package/common.ts +150 -0
  8. package/configuration.ts +115 -0
  9. package/dist/api.d.ts +3103 -0
  10. package/dist/api.js +2629 -0
  11. package/dist/base.d.ts +66 -0
  12. package/dist/base.js +86 -0
  13. package/dist/common.d.ts +65 -0
  14. package/dist/common.js +253 -0
  15. package/dist/configuration.d.ts +91 -0
  16. package/dist/configuration.js +57 -0
  17. package/dist/index.d.ts +13 -0
  18. package/dist/index.js +31 -0
  19. package/docs/AgentApi.md +167 -0
  20. package/docs/AgentAutonomous.md +33 -0
  21. package/docs/AgentExample.md +25 -0
  22. package/docs/AgentResponse.md +91 -0
  23. package/docs/AgentStatisticsResponse.md +49 -0
  24. package/docs/AgentUpdate.md +91 -0
  25. package/docs/AuthorType.md +23 -0
  26. package/docs/Chat.md +33 -0
  27. package/docs/ChatApi.md +516 -0
  28. package/docs/ChatMessage.md +63 -0
  29. package/docs/ChatMessageAttachment.md +23 -0
  30. package/docs/ChatMessageAttachmentType.md +13 -0
  31. package/docs/ChatMessageRequest.md +31 -0
  32. package/docs/ChatMessageSkillCall.md +35 -0
  33. package/docs/ChatMessagesResponse.md +25 -0
  34. package/docs/ChatUpdateRequest.md +21 -0
  35. package/docs/CreditAccount.md +45 -0
  36. package/docs/CreditApi.md +290 -0
  37. package/docs/CreditDebit.md +11 -0
  38. package/docs/CreditEvent.md +101 -0
  39. package/docs/CreditEventWithAgent.md +103 -0
  40. package/docs/CreditEventsResponse.md +25 -0
  41. package/docs/CreditTransactionResp.md +37 -0
  42. package/docs/CreditTransactionsResponse.md +25 -0
  43. package/docs/CreditType.md +13 -0
  44. package/docs/Direction.md +11 -0
  45. package/docs/EventType.md +31 -0
  46. package/docs/FeePercentage.md +19 -0
  47. package/docs/HTTPValidationError.md +20 -0
  48. package/docs/HealthApi.md +52 -0
  49. package/docs/LLMModelInfoWithProviderName.md +67 -0
  50. package/docs/LLMProvider.md +18 -0
  51. package/docs/MetadataApi.md +258 -0
  52. package/docs/OwnerType.md +13 -0
  53. package/docs/Skill.md +43 -0
  54. package/docs/TransactionType.md +39 -0
  55. package/docs/UpstreamType.md +15 -0
  56. package/docs/ValidationError.md +24 -0
  57. package/docs/ValidationErrorLocInner.md +18 -0
  58. package/git_push.sh +57 -0
  59. package/index.ts +18 -0
  60. package/package.json +31 -0
  61. package/tsconfig.json +21 -0
@@ -0,0 +1,21 @@
1
+ # ChatUpdateRequest
2
+
3
+ Request model for updating a chat thread.
4
+
5
+ ## Properties
6
+
7
+ Name | Type | Description | Notes
8
+ ------------ | ------------- | ------------- | -------------
9
+ **summary** | **string** | Updated summary for the chat thread | [default to undefined]
10
+
11
+ ## Example
12
+
13
+ ```typescript
14
+ import { ChatUpdateRequest } from '@crestal/nation-sdk';
15
+
16
+ const instance: ChatUpdateRequest = {
17
+ summary,
18
+ };
19
+ ```
20
+
21
+ [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
@@ -0,0 +1,45 @@
1
+ # CreditAccount
2
+
3
+ Credit account model with all fields.
4
+
5
+ ## Properties
6
+
7
+ Name | Type | Description | Notes
8
+ ------------ | ------------- | ------------- | -------------
9
+ **id** | **string** | Unique identifier for the credit account | [optional] [default to undefined]
10
+ **owner_type** | [**OwnerType**](OwnerType.md) | Type of the account owner | [default to undefined]
11
+ **owner_id** | **string** | ID of the account owner | [default to undefined]
12
+ **free_quota** | **string** | Daily credit quota that resets each day | [optional] [default to '0']
13
+ **refill_amount** | **string** | Amount to refill hourly, not exceeding free_quota | [optional] [default to '0']
14
+ **free_credits** | **string** | Current available daily credits | [optional] [default to '0']
15
+ **reward_credits** | **string** | Reward credits earned through rewards | [optional] [default to '0']
16
+ **credits** | **string** | Credits added through top-ups | [optional] [default to '0']
17
+ **income_at** | **string** | | [optional] [default to undefined]
18
+ **expense_at** | **string** | | [optional] [default to undefined]
19
+ **last_event_id** | **string** | | [optional] [default to undefined]
20
+ **created_at** | **string** | Timestamp when this account was created | [default to undefined]
21
+ **updated_at** | **string** | Timestamp when this account was last updated | [default to undefined]
22
+
23
+ ## Example
24
+
25
+ ```typescript
26
+ import { CreditAccount } from '@crestal/nation-sdk';
27
+
28
+ const instance: CreditAccount = {
29
+ id,
30
+ owner_type,
31
+ owner_id,
32
+ free_quota,
33
+ refill_amount,
34
+ free_credits,
35
+ reward_credits,
36
+ credits,
37
+ income_at,
38
+ expense_at,
39
+ last_event_id,
40
+ created_at,
41
+ updated_at,
42
+ };
43
+ ```
44
+
45
+ [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
@@ -0,0 +1,290 @@
1
+ # CreditApi
2
+
3
+ All URIs are relative to *http://localhost*
4
+
5
+ |Method | HTTP request | Description|
6
+ |------------- | ------------- | -------------|
7
+ |[**fetchCreditEvent**](#fetchcreditevent) | **GET** /credit/events/{event_id} | Credit Event|
8
+ |[**getUserAccount**](#getuseraccount) | **GET** /credit/user/account | Get User Account|
9
+ |[**listAgentIncomeEvents**](#listagentincomeevents) | **GET** /credit/agents/{agent_id}/events | List Agent Income|
10
+ |[**listUserEvents**](#listuserevents) | **GET** /credit/user/events | List User Events|
11
+ |[**listUserTransactions**](#listusertransactions) | **GET** /credit/user/transactions | List User Transactions|
12
+
13
+ # **fetchCreditEvent**
14
+ > CreditEvent fetchCreditEvent()
15
+
16
+ Fetch a credit event by its ID, with authorization check. Returns the credit event if it exists and belongs to the user, otherwise raises an HTTP error.
17
+
18
+ ### Example
19
+
20
+ ```typescript
21
+ import {
22
+ CreditApi,
23
+ Configuration
24
+ } from '@crestal/nation-sdk';
25
+
26
+ const configuration = new Configuration();
27
+ const apiInstance = new CreditApi(configuration);
28
+
29
+ let eventId: string; //Credit event ID (default to undefined)
30
+
31
+ const { status, data } = await apiInstance.fetchCreditEvent(
32
+ eventId
33
+ );
34
+ ```
35
+
36
+ ### Parameters
37
+
38
+ |Name | Type | Description | Notes|
39
+ |------------- | ------------- | ------------- | -------------|
40
+ | **eventId** | [**string**] | Credit event ID | defaults to undefined|
41
+
42
+
43
+ ### Return type
44
+
45
+ **CreditEvent**
46
+
47
+ ### Authorization
48
+
49
+ [HTTPBearer](../README.md#HTTPBearer)
50
+
51
+ ### HTTP request headers
52
+
53
+ - **Content-Type**: Not defined
54
+ - **Accept**: application/json
55
+
56
+
57
+ ### HTTP response details
58
+ | Status code | Description | Response headers |
59
+ |-------------|-------------|------------------|
60
+ |**200** | Credit event found and returned successfully | - |
61
+ |**403** | Forbidden: Credit event does not belong to the specified user | - |
62
+ |**404** | Not Found: Credit event with the specified ID does not exist | - |
63
+ |**422** | Validation Error | - |
64
+
65
+ [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
66
+
67
+ # **getUserAccount**
68
+ > CreditAccount getUserAccount()
69
+
70
+ Get or create a user\'s credit account. This endpoint will create a new account if it does not exist. Not in the readonly router because it may create a new account.
71
+
72
+ ### Example
73
+
74
+ ```typescript
75
+ import {
76
+ CreditApi,
77
+ Configuration
78
+ } from '@crestal/nation-sdk';
79
+
80
+ const configuration = new Configuration();
81
+ const apiInstance = new CreditApi(configuration);
82
+
83
+ const { status, data } = await apiInstance.getUserAccount();
84
+ ```
85
+
86
+ ### Parameters
87
+ This endpoint does not have any parameters.
88
+
89
+
90
+ ### Return type
91
+
92
+ **CreditAccount**
93
+
94
+ ### Authorization
95
+
96
+ [HTTPBearer](../README.md#HTTPBearer)
97
+
98
+ ### HTTP request headers
99
+
100
+ - **Content-Type**: Not defined
101
+ - **Accept**: application/json
102
+
103
+
104
+ ### HTTP response details
105
+ | Status code | Description | Response headers |
106
+ |-------------|-------------|------------------|
107
+ |**200** | Successful Response | - |
108
+
109
+ [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
110
+
111
+ # **listAgentIncomeEvents**
112
+ > CreditEventsResponse listAgentIncomeEvents()
113
+
114
+ List all income events for an agent account, with authorization check. Returns a paginated list of income events for the specified agent, only if the agent belongs to the user.
115
+
116
+ ### Example
117
+
118
+ ```typescript
119
+ import {
120
+ CreditApi,
121
+ Configuration
122
+ } from '@crestal/nation-sdk';
123
+
124
+ const configuration = new Configuration();
125
+ const apiInstance = new CreditApi(configuration);
126
+
127
+ let agentId: string; // (default to undefined)
128
+ let cursor: string; //Cursor for pagination (optional) (default to undefined)
129
+ let limit: number; //Maximum number of events to return (optional) (default to 20)
130
+
131
+ const { status, data } = await apiInstance.listAgentIncomeEvents(
132
+ agentId,
133
+ cursor,
134
+ limit
135
+ );
136
+ ```
137
+
138
+ ### Parameters
139
+
140
+ |Name | Type | Description | Notes|
141
+ |------------- | ------------- | ------------- | -------------|
142
+ | **agentId** | [**string**] | | defaults to undefined|
143
+ | **cursor** | [**string**] | Cursor for pagination | (optional) defaults to undefined|
144
+ | **limit** | [**number**] | Maximum number of events to return | (optional) defaults to 20|
145
+
146
+
147
+ ### Return type
148
+
149
+ **CreditEventsResponse**
150
+
151
+ ### Authorization
152
+
153
+ [HTTPBearer](../README.md#HTTPBearer)
154
+
155
+ ### HTTP request headers
156
+
157
+ - **Content-Type**: Not defined
158
+ - **Accept**: application/json
159
+
160
+
161
+ ### HTTP response details
162
+ | Status code | Description | Response headers |
163
+ |-------------|-------------|------------------|
164
+ |**200** | Successful Response | - |
165
+ |**422** | Validation Error | - |
166
+
167
+ [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
168
+
169
+ # **listUserEvents**
170
+ > CreditEventsResponse listUserEvents()
171
+
172
+ List all credit events for a user account, with optional filtering by event types and direction. Returns a paginated list of events for the user.
173
+
174
+ ### Example
175
+
176
+ ```typescript
177
+ import {
178
+ CreditApi,
179
+ Configuration
180
+ } from '@crestal/nation-sdk';
181
+
182
+ const configuration = new Configuration();
183
+ const apiInstance = new CreditApi(configuration);
184
+
185
+ let eventType: Array<EventType>; //Event types (optional) (default to undefined)
186
+ let direction: Direction; //Direction of events (optional) (default to undefined)
187
+ let cursor: string; //Cursor for pagination (optional) (default to undefined)
188
+ let limit: number; //Maximum number of events to return (optional) (default to 20)
189
+
190
+ const { status, data } = await apiInstance.listUserEvents(
191
+ eventType,
192
+ direction,
193
+ cursor,
194
+ limit
195
+ );
196
+ ```
197
+
198
+ ### Parameters
199
+
200
+ |Name | Type | Description | Notes|
201
+ |------------- | ------------- | ------------- | -------------|
202
+ | **eventType** | **Array&lt;EventType&gt;** | Event types | (optional) defaults to undefined|
203
+ | **direction** | **Direction** | Direction of events | (optional) defaults to undefined|
204
+ | **cursor** | [**string**] | Cursor for pagination | (optional) defaults to undefined|
205
+ | **limit** | [**number**] | Maximum number of events to return | (optional) defaults to 20|
206
+
207
+
208
+ ### Return type
209
+
210
+ **CreditEventsResponse**
211
+
212
+ ### Authorization
213
+
214
+ [HTTPBearer](../README.md#HTTPBearer)
215
+
216
+ ### HTTP request headers
217
+
218
+ - **Content-Type**: Not defined
219
+ - **Accept**: application/json
220
+
221
+
222
+ ### HTTP response details
223
+ | Status code | Description | Response headers |
224
+ |-------------|-------------|------------------|
225
+ |**200** | Successful Response | - |
226
+ |**422** | Validation Error | - |
227
+
228
+ [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
229
+
230
+ # **listUserTransactions**
231
+ > CreditTransactionsResponse listUserTransactions()
232
+
233
+ List credit transactions for a user account, with optional filtering by transaction type and credit/debit. Returns a paginated list of transactions, each with optional associated event data.
234
+
235
+ ### Example
236
+
237
+ ```typescript
238
+ import {
239
+ CreditApi,
240
+ Configuration
241
+ } from '@crestal/nation-sdk';
242
+
243
+ const configuration = new Configuration();
244
+ const apiInstance = new CreditApi(configuration);
245
+
246
+ let txType: Array<TransactionType>; //Transaction types (optional) (default to undefined)
247
+ let creditDebit: CreditDebit; //Credit or debit (optional) (default to undefined)
248
+ let cursor: string; //Cursor for pagination (optional) (default to undefined)
249
+ let limit: number; //Maximum number of transactions to return (optional) (default to 20)
250
+
251
+ const { status, data } = await apiInstance.listUserTransactions(
252
+ txType,
253
+ creditDebit,
254
+ cursor,
255
+ limit
256
+ );
257
+ ```
258
+
259
+ ### Parameters
260
+
261
+ |Name | Type | Description | Notes|
262
+ |------------- | ------------- | ------------- | -------------|
263
+ | **txType** | **Array&lt;TransactionType&gt;** | Transaction types | (optional) defaults to undefined|
264
+ | **creditDebit** | **CreditDebit** | Credit or debit | (optional) defaults to undefined|
265
+ | **cursor** | [**string**] | Cursor for pagination | (optional) defaults to undefined|
266
+ | **limit** | [**number**] | Maximum number of transactions to return | (optional) defaults to 20|
267
+
268
+
269
+ ### Return type
270
+
271
+ **CreditTransactionsResponse**
272
+
273
+ ### Authorization
274
+
275
+ [HTTPBearer](../README.md#HTTPBearer)
276
+
277
+ ### HTTP request headers
278
+
279
+ - **Content-Type**: Not defined
280
+ - **Accept**: application/json
281
+
282
+
283
+ ### HTTP response details
284
+ | Status code | Description | Response headers |
285
+ |-------------|-------------|------------------|
286
+ |**200** | Successful Response | - |
287
+ |**422** | Validation Error | - |
288
+
289
+ [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
290
+
@@ -0,0 +1,11 @@
1
+ # CreditDebit
2
+
3
+ Credit or debit transaction.
4
+
5
+ ## Enum
6
+
7
+ * `Credit` (value: `'credit'`)
8
+
9
+ * `Debit` (value: `'debit'`)
10
+
11
+ [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
@@ -0,0 +1,101 @@
1
+ # CreditEvent
2
+
3
+ Credit event model with all fields.
4
+
5
+ ## Properties
6
+
7
+ Name | Type | Description | Notes
8
+ ------------ | ------------- | ------------- | -------------
9
+ **id** | **string** | Unique identifier for the credit event | [optional] [default to undefined]
10
+ **account_id** | **string** | Account ID from which credits flow | [optional] [default to undefined]
11
+ **event_type** | [**EventType**](EventType.md) | Type of the event | [default to undefined]
12
+ **user_id** | **string** | | [optional] [default to undefined]
13
+ **upstream_type** | [**UpstreamType**](UpstreamType.md) | Type of upstream transaction | [default to undefined]
14
+ **upstream_tx_id** | **string** | Upstream transaction ID if any | [default to undefined]
15
+ **agent_id** | **string** | | [optional] [default to undefined]
16
+ **start_message_id** | **string** | | [optional] [default to undefined]
17
+ **message_id** | **string** | | [optional] [default to undefined]
18
+ **model** | **string** | | [optional] [default to undefined]
19
+ **skill_call_id** | **string** | | [optional] [default to undefined]
20
+ **skill_name** | **string** | | [optional] [default to undefined]
21
+ **direction** | [**Direction**](Direction.md) | Direction of the credit flow | [default to undefined]
22
+ **total_amount** | **string** | Total amount (after discount) of credits involved | [optional] [default to '0']
23
+ **credit_type** | [**CreditType**](CreditType.md) | Type of credits involved | [default to undefined]
24
+ **credit_types** | [**Array&lt;CreditType&gt;**](CreditType.md) | | [optional] [default to undefined]
25
+ **balance_after** | **string** | | [optional] [default to undefined]
26
+ **base_amount** | **string** | Base amount of credits involved | [optional] [default to '0']
27
+ **base_discount_amount** | **string** | | [optional] [default to undefined]
28
+ **base_original_amount** | **string** | | [optional] [default to undefined]
29
+ **base_llm_amount** | **string** | | [optional] [default to undefined]
30
+ **base_skill_amount** | **string** | | [optional] [default to undefined]
31
+ **fee_platform_amount** | **string** | | [optional] [default to undefined]
32
+ **fee_platform_free_amount** | **string** | | [optional] [default to undefined]
33
+ **fee_platform_reward_amount** | **string** | | [optional] [default to undefined]
34
+ **fee_platform_permanent_amount** | **string** | | [optional] [default to undefined]
35
+ **fee_dev_account** | **string** | | [optional] [default to undefined]
36
+ **fee_dev_amount** | **string** | | [optional] [default to undefined]
37
+ **fee_dev_free_amount** | **string** | | [optional] [default to undefined]
38
+ **fee_dev_reward_amount** | **string** | | [optional] [default to undefined]
39
+ **fee_dev_permanent_amount** | **string** | | [optional] [default to undefined]
40
+ **fee_agent_account** | **string** | | [optional] [default to undefined]
41
+ **fee_agent_amount** | **string** | | [optional] [default to undefined]
42
+ **fee_agent_free_amount** | **string** | | [optional] [default to undefined]
43
+ **fee_agent_reward_amount** | **string** | | [optional] [default to undefined]
44
+ **fee_agent_permanent_amount** | **string** | | [optional] [default to undefined]
45
+ **free_amount** | **string** | | [optional] [default to undefined]
46
+ **reward_amount** | **string** | | [optional] [default to undefined]
47
+ **permanent_amount** | **string** | | [optional] [default to undefined]
48
+ **note** | **string** | | [optional] [default to undefined]
49
+ **created_at** | **string** | Timestamp when this event was created | [default to undefined]
50
+
51
+ ## Example
52
+
53
+ ```typescript
54
+ import { CreditEvent } from '@crestal/nation-sdk';
55
+
56
+ const instance: CreditEvent = {
57
+ id,
58
+ account_id,
59
+ event_type,
60
+ user_id,
61
+ upstream_type,
62
+ upstream_tx_id,
63
+ agent_id,
64
+ start_message_id,
65
+ message_id,
66
+ model,
67
+ skill_call_id,
68
+ skill_name,
69
+ direction,
70
+ total_amount,
71
+ credit_type,
72
+ credit_types,
73
+ balance_after,
74
+ base_amount,
75
+ base_discount_amount,
76
+ base_original_amount,
77
+ base_llm_amount,
78
+ base_skill_amount,
79
+ fee_platform_amount,
80
+ fee_platform_free_amount,
81
+ fee_platform_reward_amount,
82
+ fee_platform_permanent_amount,
83
+ fee_dev_account,
84
+ fee_dev_amount,
85
+ fee_dev_free_amount,
86
+ fee_dev_reward_amount,
87
+ fee_dev_permanent_amount,
88
+ fee_agent_account,
89
+ fee_agent_amount,
90
+ fee_agent_free_amount,
91
+ fee_agent_reward_amount,
92
+ fee_agent_permanent_amount,
93
+ free_amount,
94
+ reward_amount,
95
+ permanent_amount,
96
+ note,
97
+ created_at,
98
+ };
99
+ ```
100
+
101
+ [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
@@ -0,0 +1,103 @@
1
+ # CreditEventWithAgent
2
+
3
+ Credit event response model with agent name. Extends CreditEvent to include the agent name for better user experience.
4
+
5
+ ## Properties
6
+
7
+ Name | Type | Description | Notes
8
+ ------------ | ------------- | ------------- | -------------
9
+ **id** | **string** | Unique identifier for the credit event | [optional] [default to undefined]
10
+ **account_id** | **string** | Account ID from which credits flow | [optional] [default to undefined]
11
+ **event_type** | [**EventType**](EventType.md) | Type of the event | [default to undefined]
12
+ **user_id** | **string** | | [optional] [default to undefined]
13
+ **upstream_type** | [**UpstreamType**](UpstreamType.md) | Type of upstream transaction | [default to undefined]
14
+ **upstream_tx_id** | **string** | Upstream transaction ID if any | [default to undefined]
15
+ **agent_id** | **string** | | [optional] [default to undefined]
16
+ **start_message_id** | **string** | | [optional] [default to undefined]
17
+ **message_id** | **string** | | [optional] [default to undefined]
18
+ **model** | **string** | | [optional] [default to undefined]
19
+ **skill_call_id** | **string** | | [optional] [default to undefined]
20
+ **skill_name** | **string** | | [optional] [default to undefined]
21
+ **direction** | [**Direction**](Direction.md) | Direction of the credit flow | [default to undefined]
22
+ **total_amount** | **string** | Total amount (after discount) of credits involved | [optional] [default to '0']
23
+ **credit_type** | [**CreditType**](CreditType.md) | Type of credits involved | [default to undefined]
24
+ **credit_types** | [**Array&lt;CreditType&gt;**](CreditType.md) | | [optional] [default to undefined]
25
+ **balance_after** | **string** | | [optional] [default to undefined]
26
+ **base_amount** | **string** | Base amount of credits involved | [optional] [default to '0']
27
+ **base_discount_amount** | **string** | | [optional] [default to undefined]
28
+ **base_original_amount** | **string** | | [optional] [default to undefined]
29
+ **base_llm_amount** | **string** | | [optional] [default to undefined]
30
+ **base_skill_amount** | **string** | | [optional] [default to undefined]
31
+ **fee_platform_amount** | **string** | | [optional] [default to undefined]
32
+ **fee_platform_free_amount** | **string** | | [optional] [default to undefined]
33
+ **fee_platform_reward_amount** | **string** | | [optional] [default to undefined]
34
+ **fee_platform_permanent_amount** | **string** | | [optional] [default to undefined]
35
+ **fee_dev_account** | **string** | | [optional] [default to undefined]
36
+ **fee_dev_amount** | **string** | | [optional] [default to undefined]
37
+ **fee_dev_free_amount** | **string** | | [optional] [default to undefined]
38
+ **fee_dev_reward_amount** | **string** | | [optional] [default to undefined]
39
+ **fee_dev_permanent_amount** | **string** | | [optional] [default to undefined]
40
+ **fee_agent_account** | **string** | | [optional] [default to undefined]
41
+ **fee_agent_amount** | **string** | | [optional] [default to undefined]
42
+ **fee_agent_free_amount** | **string** | | [optional] [default to undefined]
43
+ **fee_agent_reward_amount** | **string** | | [optional] [default to undefined]
44
+ **fee_agent_permanent_amount** | **string** | | [optional] [default to undefined]
45
+ **free_amount** | **string** | | [optional] [default to undefined]
46
+ **reward_amount** | **string** | | [optional] [default to undefined]
47
+ **permanent_amount** | **string** | | [optional] [default to undefined]
48
+ **note** | **string** | | [optional] [default to undefined]
49
+ **created_at** | **string** | Timestamp when this event was created | [default to undefined]
50
+ **agent_name** | **string** | | [optional] [default to undefined]
51
+
52
+ ## Example
53
+
54
+ ```typescript
55
+ import { CreditEventWithAgent } from '@crestal/nation-sdk';
56
+
57
+ const instance: CreditEventWithAgent = {
58
+ id,
59
+ account_id,
60
+ event_type,
61
+ user_id,
62
+ upstream_type,
63
+ upstream_tx_id,
64
+ agent_id,
65
+ start_message_id,
66
+ message_id,
67
+ model,
68
+ skill_call_id,
69
+ skill_name,
70
+ direction,
71
+ total_amount,
72
+ credit_type,
73
+ credit_types,
74
+ balance_after,
75
+ base_amount,
76
+ base_discount_amount,
77
+ base_original_amount,
78
+ base_llm_amount,
79
+ base_skill_amount,
80
+ fee_platform_amount,
81
+ fee_platform_free_amount,
82
+ fee_platform_reward_amount,
83
+ fee_platform_permanent_amount,
84
+ fee_dev_account,
85
+ fee_dev_amount,
86
+ fee_dev_free_amount,
87
+ fee_dev_reward_amount,
88
+ fee_dev_permanent_amount,
89
+ fee_agent_account,
90
+ fee_agent_amount,
91
+ fee_agent_free_amount,
92
+ fee_agent_reward_amount,
93
+ fee_agent_permanent_amount,
94
+ free_amount,
95
+ reward_amount,
96
+ permanent_amount,
97
+ note,
98
+ created_at,
99
+ agent_name,
100
+ };
101
+ ```
102
+
103
+ [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
@@ -0,0 +1,25 @@
1
+ # CreditEventsResponse
2
+
3
+ Paginated response model for credit events. Contains a list of credit events, a flag indicating if more items are available, and a cursor for pagination.
4
+
5
+ ## Properties
6
+
7
+ Name | Type | Description | Notes
8
+ ------------ | ------------- | ------------- | -------------
9
+ **data** | [**Array&lt;CreditEventWithAgent&gt;**](CreditEventWithAgent.md) | List of credit events with agent names | [default to undefined]
10
+ **has_more** | **boolean** | Indicates if there are more items | [default to undefined]
11
+ **next_cursor** | **string** | | [optional] [default to undefined]
12
+
13
+ ## Example
14
+
15
+ ```typescript
16
+ import { CreditEventsResponse } from '@crestal/nation-sdk';
17
+
18
+ const instance: CreditEventsResponse = {
19
+ data,
20
+ has_more,
21
+ next_cursor,
22
+ };
23
+ ```
24
+
25
+ [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
@@ -0,0 +1,37 @@
1
+ # CreditTransactionResp
2
+
3
+ Credit transaction response model with associated event data. Extends CreditTransaction to include the related CreditEvent if available.
4
+
5
+ ## Properties
6
+
7
+ Name | Type | Description | Notes
8
+ ------------ | ------------- | ------------- | -------------
9
+ **id** | **string** | Unique identifier for the credit transaction | [optional] [default to undefined]
10
+ **account_id** | **string** | ID of the account this transaction belongs to | [default to undefined]
11
+ **event_id** | **string** | ID of the event that triggered this transaction | [default to undefined]
12
+ **tx_type** | [**TransactionType**](TransactionType.md) | Type of the transaction | [default to undefined]
13
+ **credit_debit** | [**CreditDebit**](CreditDebit.md) | Whether this is a credit or debit transaction | [default to undefined]
14
+ **change_amount** | **string** | Amount of credits changed | [optional] [default to '0']
15
+ **credit_type** | [**CreditType**](CreditType.md) | Type of credits involved | [default to undefined]
16
+ **created_at** | **string** | Timestamp when this transaction was created | [default to undefined]
17
+ **event** | [**CreditEvent**](CreditEvent.md) | | [optional] [default to undefined]
18
+
19
+ ## Example
20
+
21
+ ```typescript
22
+ import { CreditTransactionResp } from '@crestal/nation-sdk';
23
+
24
+ const instance: CreditTransactionResp = {
25
+ id,
26
+ account_id,
27
+ event_id,
28
+ tx_type,
29
+ credit_debit,
30
+ change_amount,
31
+ credit_type,
32
+ created_at,
33
+ event,
34
+ };
35
+ ```
36
+
37
+ [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
@@ -0,0 +1,25 @@
1
+ # CreditTransactionsResponse
2
+
3
+ Paginated response model for credit transactions. Contains a list of credit transactions (with event data), a flag for more items, and a pagination cursor.
4
+
5
+ ## Properties
6
+
7
+ Name | Type | Description | Notes
8
+ ------------ | ------------- | ------------- | -------------
9
+ **data** | [**Array&lt;CreditTransactionResp&gt;**](CreditTransactionResp.md) | List of credit transactions | [default to undefined]
10
+ **has_more** | **boolean** | Indicates if there are more items | [default to undefined]
11
+ **next_cursor** | **string** | | [optional] [default to undefined]
12
+
13
+ ## Example
14
+
15
+ ```typescript
16
+ import { CreditTransactionsResponse } from '@crestal/nation-sdk';
17
+
18
+ const instance: CreditTransactionsResponse = {
19
+ data,
20
+ has_more,
21
+ next_cursor,
22
+ };
23
+ ```
24
+
25
+ [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
@@ -0,0 +1,13 @@
1
+ # CreditType
2
+
3
+ Credit type is used in db column names, do not change it.
4
+
5
+ ## Enum
6
+
7
+ * `FreeCredits` (value: `'free_credits'`)
8
+
9
+ * `RewardCredits` (value: `'reward_credits'`)
10
+
11
+ * `Credits` (value: `'credits'`)
12
+
13
+ [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
@@ -0,0 +1,11 @@
1
+ # Direction
2
+
3
+ Direction of credit flow.
4
+
5
+ ## Enum
6
+
7
+ * `Income` (value: `'income'`)
8
+
9
+ * `Expense` (value: `'expense'`)
10
+
11
+ [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)