@cadenya/cadenya 0.124.0 → 0.125.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.
Files changed (285) hide show
  1. package/CHANGELOG.md +9 -0
  2. package/README.md +18 -7
  3. package/client.d.mts +17 -11
  4. package/client.d.mts.map +1 -1
  5. package/client.d.ts +17 -11
  6. package/client.d.ts.map +1 -1
  7. package/client.js +7 -3
  8. package/client.js.map +1 -1
  9. package/client.mjs +7 -3
  10. package/client.mjs.map +1 -1
  11. package/internal/request-options.d.mts +1 -1
  12. package/internal/request-options.d.ts +1 -1
  13. package/package.json +1 -1
  14. package/resources/account.d.mts +8 -0
  15. package/resources/account.d.mts.map +1 -1
  16. package/resources/account.d.ts +8 -0
  17. package/resources/account.d.ts.map +1 -1
  18. package/resources/account.js.map +1 -1
  19. package/resources/account.mjs.map +1 -1
  20. package/resources/agents/agents.d.mts +115 -28
  21. package/resources/agents/agents.d.mts.map +1 -1
  22. package/resources/agents/agents.d.ts +115 -28
  23. package/resources/agents/agents.d.ts.map +1 -1
  24. package/resources/agents/agents.js +93 -13
  25. package/resources/agents/agents.js.map +1 -1
  26. package/resources/agents/agents.mjs +93 -13
  27. package/resources/agents/agents.mjs.map +1 -1
  28. package/resources/agents/feedback.d.mts +13 -2
  29. package/resources/agents/feedback.d.mts.map +1 -1
  30. package/resources/agents/feedback.d.ts +13 -2
  31. package/resources/agents/feedback.d.ts.map +1 -1
  32. package/resources/agents/feedback.js +13 -2
  33. package/resources/agents/feedback.js.map +1 -1
  34. package/resources/agents/feedback.mjs +13 -2
  35. package/resources/agents/feedback.mjs.map +1 -1
  36. package/resources/agents/index.d.mts +1 -1
  37. package/resources/agents/index.d.mts.map +1 -1
  38. package/resources/agents/index.d.ts +1 -1
  39. package/resources/agents/index.d.ts.map +1 -1
  40. package/resources/agents/index.js.map +1 -1
  41. package/resources/agents/index.mjs.map +1 -1
  42. package/resources/agents/schedules.d.mts +100 -52
  43. package/resources/agents/schedules.d.mts.map +1 -1
  44. package/resources/agents/schedules.d.ts +100 -52
  45. package/resources/agents/schedules.d.ts.map +1 -1
  46. package/resources/agents/schedules.js +99 -21
  47. package/resources/agents/schedules.js.map +1 -1
  48. package/resources/agents/schedules.mjs +99 -21
  49. package/resources/agents/schedules.mjs.map +1 -1
  50. package/resources/agents/variations.d.mts +252 -105
  51. package/resources/agents/variations.d.mts.map +1 -1
  52. package/resources/agents/variations.d.ts +252 -105
  53. package/resources/agents/variations.d.ts.map +1 -1
  54. package/resources/agents/variations.js +138 -27
  55. package/resources/agents/variations.js.map +1 -1
  56. package/resources/agents/variations.mjs +138 -27
  57. package/resources/agents/variations.mjs.map +1 -1
  58. package/resources/agents/webhook-deliveries.d.mts +13 -2
  59. package/resources/agents/webhook-deliveries.d.mts.map +1 -1
  60. package/resources/agents/webhook-deliveries.d.ts +13 -2
  61. package/resources/agents/webhook-deliveries.d.ts.map +1 -1
  62. package/resources/agents/webhook-deliveries.js +13 -2
  63. package/resources/agents/webhook-deliveries.js.map +1 -1
  64. package/resources/agents/webhook-deliveries.mjs +13 -2
  65. package/resources/agents/webhook-deliveries.mjs.map +1 -1
  66. package/resources/ai-provider-keys.d.mts +125 -110
  67. package/resources/ai-provider-keys.d.mts.map +1 -1
  68. package/resources/ai-provider-keys.d.ts +125 -110
  69. package/resources/ai-provider-keys.d.ts.map +1 -1
  70. package/resources/ai-provider-keys.js +11 -9
  71. package/resources/ai-provider-keys.js.map +1 -1
  72. package/resources/ai-provider-keys.mjs +11 -9
  73. package/resources/ai-provider-keys.mjs.map +1 -1
  74. package/resources/api-keys.d.mts +28 -20
  75. package/resources/api-keys.d.mts.map +1 -1
  76. package/resources/api-keys.d.ts +28 -20
  77. package/resources/api-keys.d.ts.map +1 -1
  78. package/resources/api-keys.js +14 -12
  79. package/resources/api-keys.js.map +1 -1
  80. package/resources/api-keys.mjs +14 -12
  81. package/resources/api-keys.mjs.map +1 -1
  82. package/resources/index.d.mts +4 -4
  83. package/resources/index.d.mts.map +1 -1
  84. package/resources/index.d.ts +4 -4
  85. package/resources/index.d.ts.map +1 -1
  86. package/resources/index.js.map +1 -1
  87. package/resources/index.mjs.map +1 -1
  88. package/resources/memory-layers/entries.d.mts +27 -30
  89. package/resources/memory-layers/entries.d.mts.map +1 -1
  90. package/resources/memory-layers/entries.d.ts +27 -30
  91. package/resources/memory-layers/entries.d.ts.map +1 -1
  92. package/resources/memory-layers/entries.js +12 -12
  93. package/resources/memory-layers/entries.js.map +1 -1
  94. package/resources/memory-layers/entries.mjs +12 -12
  95. package/resources/memory-layers/entries.mjs.map +1 -1
  96. package/resources/memory-layers/index.d.mts +1 -1
  97. package/resources/memory-layers/index.d.mts.map +1 -1
  98. package/resources/memory-layers/index.d.ts +1 -1
  99. package/resources/memory-layers/index.d.ts.map +1 -1
  100. package/resources/memory-layers/index.js.map +1 -1
  101. package/resources/memory-layers/index.mjs.map +1 -1
  102. package/resources/memory-layers/memory-layers.d.mts +34 -22
  103. package/resources/memory-layers/memory-layers.d.mts.map +1 -1
  104. package/resources/memory-layers/memory-layers.d.ts +34 -22
  105. package/resources/memory-layers/memory-layers.d.ts.map +1 -1
  106. package/resources/memory-layers/memory-layers.js +11 -9
  107. package/resources/memory-layers/memory-layers.js.map +1 -1
  108. package/resources/memory-layers/memory-layers.mjs +11 -9
  109. package/resources/memory-layers/memory-layers.mjs.map +1 -1
  110. package/resources/models.d.mts +32 -24
  111. package/resources/models.d.mts.map +1 -1
  112. package/resources/models.d.ts +32 -24
  113. package/resources/models.d.ts.map +1 -1
  114. package/resources/models.js +10 -8
  115. package/resources/models.js.map +1 -1
  116. package/resources/models.mjs +10 -8
  117. package/resources/models.mjs.map +1 -1
  118. package/resources/objectives/feedback.d.mts +27 -3
  119. package/resources/objectives/feedback.d.mts.map +1 -1
  120. package/resources/objectives/feedback.d.ts +27 -3
  121. package/resources/objectives/feedback.d.ts.map +1 -1
  122. package/resources/objectives/feedback.js +27 -3
  123. package/resources/objectives/feedback.js.map +1 -1
  124. package/resources/objectives/feedback.mjs +27 -3
  125. package/resources/objectives/feedback.mjs.map +1 -1
  126. package/resources/objectives/index.d.mts +2 -2
  127. package/resources/objectives/index.d.mts.map +1 -1
  128. package/resources/objectives/index.d.ts +2 -2
  129. package/resources/objectives/index.d.ts.map +1 -1
  130. package/resources/objectives/index.js.map +1 -1
  131. package/resources/objectives/index.mjs.map +1 -1
  132. package/resources/objectives/objectives.d.mts +273 -102
  133. package/resources/objectives/objectives.d.mts.map +1 -1
  134. package/resources/objectives/objectives.d.ts +273 -102
  135. package/resources/objectives/objectives.d.ts.map +1 -1
  136. package/resources/objectives/objectives.js +112 -17
  137. package/resources/objectives/objectives.js.map +1 -1
  138. package/resources/objectives/objectives.mjs +112 -17
  139. package/resources/objectives/objectives.mjs.map +1 -1
  140. package/resources/objectives/tasks.d.mts +25 -8
  141. package/resources/objectives/tasks.d.mts.map +1 -1
  142. package/resources/objectives/tasks.d.ts +25 -8
  143. package/resources/objectives/tasks.d.ts.map +1 -1
  144. package/resources/objectives/tasks.js +26 -5
  145. package/resources/objectives/tasks.js.map +1 -1
  146. package/resources/objectives/tasks.mjs +26 -5
  147. package/resources/objectives/tasks.mjs.map +1 -1
  148. package/resources/objectives/tool-calls.d.mts +99 -42
  149. package/resources/objectives/tool-calls.d.mts.map +1 -1
  150. package/resources/objectives/tool-calls.d.ts +99 -42
  151. package/resources/objectives/tool-calls.d.ts.map +1 -1
  152. package/resources/objectives/tool-calls.js +73 -14
  153. package/resources/objectives/tool-calls.js.map +1 -1
  154. package/resources/objectives/tool-calls.mjs +73 -14
  155. package/resources/objectives/tool-calls.mjs.map +1 -1
  156. package/resources/objectives/tools.d.mts +13 -2
  157. package/resources/objectives/tools.d.mts.map +1 -1
  158. package/resources/objectives/tools.d.ts +13 -2
  159. package/resources/objectives/tools.d.ts.map +1 -1
  160. package/resources/objectives/tools.js +13 -2
  161. package/resources/objectives/tools.js.map +1 -1
  162. package/resources/objectives/tools.mjs +13 -2
  163. package/resources/objectives/tools.mjs.map +1 -1
  164. package/resources/search.d.mts +11 -2
  165. package/resources/search.d.mts.map +1 -1
  166. package/resources/search.d.ts +11 -2
  167. package/resources/search.d.ts.map +1 -1
  168. package/resources/search.js +3 -2
  169. package/resources/search.js.map +1 -1
  170. package/resources/search.mjs +3 -2
  171. package/resources/search.mjs.map +1 -1
  172. package/resources/tool-sets/index.d.mts +2 -2
  173. package/resources/tool-sets/index.d.mts.map +1 -1
  174. package/resources/tool-sets/index.d.ts +2 -2
  175. package/resources/tool-sets/index.d.ts.map +1 -1
  176. package/resources/tool-sets/index.js.map +1 -1
  177. package/resources/tool-sets/index.mjs.map +1 -1
  178. package/resources/tool-sets/secrets.d.mts +9 -24
  179. package/resources/tool-sets/secrets.d.mts.map +1 -1
  180. package/resources/tool-sets/secrets.d.ts +9 -24
  181. package/resources/tool-sets/secrets.d.ts.map +1 -1
  182. package/resources/tool-sets/secrets.js +12 -12
  183. package/resources/tool-sets/secrets.js.map +1 -1
  184. package/resources/tool-sets/secrets.mjs +12 -12
  185. package/resources/tool-sets/secrets.mjs.map +1 -1
  186. package/resources/tool-sets/tool-sets.d.mts +149 -64
  187. package/resources/tool-sets/tool-sets.d.mts.map +1 -1
  188. package/resources/tool-sets/tool-sets.d.ts +149 -64
  189. package/resources/tool-sets/tool-sets.d.ts.map +1 -1
  190. package/resources/tool-sets/tool-sets.js +17 -15
  191. package/resources/tool-sets/tool-sets.js.map +1 -1
  192. package/resources/tool-sets/tool-sets.mjs +17 -15
  193. package/resources/tool-sets/tool-sets.mjs.map +1 -1
  194. package/resources/tool-sets/tools.d.mts +33 -43
  195. package/resources/tool-sets/tools.d.mts.map +1 -1
  196. package/resources/tool-sets/tools.d.ts +33 -43
  197. package/resources/tool-sets/tools.d.ts.map +1 -1
  198. package/resources/tool-sets/tools.js +18 -18
  199. package/resources/tool-sets/tools.js.map +1 -1
  200. package/resources/tool-sets/tools.mjs +18 -18
  201. package/resources/tool-sets/tools.mjs.map +1 -1
  202. package/resources/uploads.d.mts +14 -6
  203. package/resources/uploads.d.mts.map +1 -1
  204. package/resources/uploads.d.ts +14 -6
  205. package/resources/uploads.d.ts.map +1 -1
  206. package/resources/uploads.js +5 -4
  207. package/resources/uploads.js.map +1 -1
  208. package/resources/uploads.mjs +5 -4
  209. package/resources/uploads.mjs.map +1 -1
  210. package/resources/workspace-admin/index.d.mts +1 -1
  211. package/resources/workspace-admin/index.d.mts.map +1 -1
  212. package/resources/workspace-admin/index.d.ts +1 -1
  213. package/resources/workspace-admin/index.d.ts.map +1 -1
  214. package/resources/workspace-admin/index.js.map +1 -1
  215. package/resources/workspace-admin/index.mjs.map +1 -1
  216. package/resources/workspace-admin/members.d.mts +41 -6
  217. package/resources/workspace-admin/members.d.mts.map +1 -1
  218. package/resources/workspace-admin/members.d.ts +41 -6
  219. package/resources/workspace-admin/members.d.ts.map +1 -1
  220. package/resources/workspace-admin/members.js +34 -6
  221. package/resources/workspace-admin/members.js.map +1 -1
  222. package/resources/workspace-admin/members.mjs +34 -6
  223. package/resources/workspace-admin/members.mjs.map +1 -1
  224. package/resources/workspace-admin/profiles.d.mts +8 -0
  225. package/resources/workspace-admin/profiles.d.mts.map +1 -1
  226. package/resources/workspace-admin/profiles.d.ts +8 -0
  227. package/resources/workspace-admin/profiles.d.ts.map +1 -1
  228. package/resources/workspace-admin/profiles.js +8 -0
  229. package/resources/workspace-admin/profiles.js.map +1 -1
  230. package/resources/workspace-admin/profiles.mjs +8 -0
  231. package/resources/workspace-admin/profiles.mjs.map +1 -1
  232. package/resources/workspace-admin/workspace-admin.d.mts +65 -9
  233. package/resources/workspace-admin/workspace-admin.d.mts.map +1 -1
  234. package/resources/workspace-admin/workspace-admin.d.ts +65 -9
  235. package/resources/workspace-admin/workspace-admin.d.ts.map +1 -1
  236. package/resources/workspace-admin/workspace-admin.js +46 -6
  237. package/resources/workspace-admin/workspace-admin.js.map +1 -1
  238. package/resources/workspace-admin/workspace-admin.mjs +46 -6
  239. package/resources/workspace-admin/workspace-admin.mjs.map +1 -1
  240. package/resources/workspace-secrets.d.mts +27 -15
  241. package/resources/workspace-secrets.d.mts.map +1 -1
  242. package/resources/workspace-secrets.d.ts +27 -15
  243. package/resources/workspace-secrets.d.ts.map +1 -1
  244. package/resources/workspace-secrets.js +11 -9
  245. package/resources/workspace-secrets.js.map +1 -1
  246. package/resources/workspace-secrets.mjs +11 -9
  247. package/resources/workspace-secrets.mjs.map +1 -1
  248. package/src/client.ts +102 -5
  249. package/src/internal/request-options.ts +1 -1
  250. package/src/resources/account.ts +9 -0
  251. package/src/resources/agents/agents.ts +147 -37
  252. package/src/resources/agents/feedback.ts +14 -3
  253. package/src/resources/agents/index.ts +6 -0
  254. package/src/resources/agents/schedules.ts +143 -71
  255. package/src/resources/agents/variations.ts +319 -125
  256. package/src/resources/agents/webhook-deliveries.ts +14 -3
  257. package/src/resources/ai-provider-keys.ts +155 -127
  258. package/src/resources/api-keys.ts +48 -29
  259. package/src/resources/index.ts +44 -1
  260. package/src/resources/memory-layers/entries.ts +56 -40
  261. package/src/resources/memory-layers/index.ts +2 -0
  262. package/src/resources/memory-layers/memory-layers.ts +53 -30
  263. package/src/resources/models.ts +46 -31
  264. package/src/resources/objectives/feedback.ts +29 -5
  265. package/src/resources/objectives/index.ts +26 -0
  266. package/src/resources/objectives/objectives.ts +373 -125
  267. package/src/resources/objectives/tasks.ts +33 -12
  268. package/src/resources/objectives/tool-calls.ts +123 -46
  269. package/src/resources/objectives/tools.ts +14 -3
  270. package/src/resources/search.ts +14 -4
  271. package/src/resources/tool-sets/index.ts +23 -3
  272. package/src/resources/tool-sets/secrets.ts +32 -35
  273. package/src/resources/tool-sets/tool-sets.ts +239 -79
  274. package/src/resources/tool-sets/tools.ts +79 -61
  275. package/src/resources/uploads.ts +22 -8
  276. package/src/resources/workspace-admin/index.ts +2 -0
  277. package/src/resources/workspace-admin/members.ts +53 -12
  278. package/src/resources/workspace-admin/profiles.ts +8 -0
  279. package/src/resources/workspace-admin/workspace-admin.ts +80 -11
  280. package/src/resources/workspace-secrets.ts +40 -25
  281. package/src/version.ts +1 -1
  282. package/version.d.mts +1 -1
  283. package/version.d.ts +1 -1
  284. package/version.js +1 -1
  285. package/version.mjs +1 -1
@@ -7,11 +7,11 @@ export declare class AIProviderKeys extends APIResource {
7
7
  /**
8
8
  * Creates a new customer-provided AI provider key in the workspace
9
9
  */
10
- create(workspaceID: string, body: AIProviderKeyCreateParams, options?: RequestOptions): APIPromise<AIProviderKey>;
10
+ create(params: AIProviderKeyCreateParams, options?: RequestOptions): APIPromise<AIProviderKey>;
11
11
  /**
12
12
  * Retrieves an AI provider key by ID from the workspace
13
13
  */
14
- retrieve(id: string, params: AIProviderKeyRetrieveParams, options?: RequestOptions): APIPromise<AIProviderKey>;
14
+ retrieve(id: string, params?: AIProviderKeyRetrieveParams | null | undefined, options?: RequestOptions): APIPromise<AIProviderKey>;
15
15
  /**
16
16
  * Updates an AI provider key's name or key value in the workspace
17
17
  */
@@ -19,13 +19,106 @@ export declare class AIProviderKeys extends APIResource {
19
19
  /**
20
20
  * Lists all customer-provided AI provider keys in the workspace
21
21
  */
22
- list(workspaceID: string, query?: AIProviderKeyListParams | null | undefined, options?: RequestOptions): PagePromise<AIProviderKeysCursorPagination, AIProviderKey>;
22
+ list(params?: AIProviderKeyListParams | null | undefined, options?: RequestOptions): PagePromise<AIProviderKeysCursorPagination, AIProviderKey>;
23
23
  /**
24
24
  * Deletes an AI provider key from the workspace
25
25
  */
26
- delete(id: string, params: AIProviderKeyDeleteParams, options?: RequestOptions): APIPromise<void>;
26
+ delete(id: string, params?: AIProviderKeyDeleteParams | null | undefined, options?: RequestOptions): APIPromise<void>;
27
27
  }
28
28
  export type AIProviderKeysCursorPagination = CursorPagination<AIProviderKey>;
29
+ export interface AIProviderConfigOpenAI {
30
+ /**
31
+ * OpenAIConfig holds OpenAI-specific settings.
32
+ */
33
+ openai: AIProviderConfigOpenAI.OpenAI;
34
+ type: 'openai';
35
+ }
36
+ export declare namespace AIProviderConfigOpenAI {
37
+ /**
38
+ * OpenAIConfig holds OpenAI-specific settings.
39
+ */
40
+ interface OpenAI {
41
+ /**
42
+ * Sent as the OpenAI-Organization header when set.
43
+ */
44
+ organizationId?: string;
45
+ /**
46
+ * Sent as the OpenAI-Project header when set.
47
+ */
48
+ projectId?: string;
49
+ }
50
+ }
51
+ export interface AIProviderConfigOpenAICompatible {
52
+ /**
53
+ * OpenAICompatibleConfig configures a generic endpoint that speaks the OpenAI Chat
54
+ * Completions API. The base URL is required and its model catalog is discovered
55
+ * live via GET {base_url}/models.
56
+ */
57
+ openaiCompatible: AIProviderConfigOpenAICompatible.OpenAICompatible;
58
+ type: 'openaiCompatible';
59
+ }
60
+ export declare namespace AIProviderConfigOpenAICompatible {
61
+ /**
62
+ * OpenAICompatibleConfig configures a generic endpoint that speaks the OpenAI Chat
63
+ * Completions API. The base URL is required and its model catalog is discovered
64
+ * live via GET {base_url}/models.
65
+ */
66
+ interface OpenAICompatible {
67
+ baseUrl: string;
68
+ }
69
+ }
70
+ export interface AIProviderConfigOpenrouter {
71
+ /**
72
+ * OpenRouterConfig holds OpenRouter-specific settings.
73
+ */
74
+ openrouter: AIProviderConfigOpenrouter.Openrouter;
75
+ type: 'openrouter';
76
+ }
77
+ export declare namespace AIProviderConfigOpenrouter {
78
+ /**
79
+ * OpenRouterConfig holds OpenRouter-specific settings.
80
+ */
81
+ interface Openrouter {
82
+ /**
83
+ * Data-residency region (e.g. "us", "eu"). Empty uses the provider default.
84
+ */
85
+ region?: string;
86
+ }
87
+ }
88
+ export interface AIProviderCredentialAPIKey {
89
+ /**
90
+ * CredentialAPIKey carries a single bearer/header API key.
91
+ */
92
+ apiKey: AIProviderCredentialAPIKey.APIKey;
93
+ type: 'apiKey';
94
+ }
95
+ export declare namespace AIProviderCredentialAPIKey {
96
+ /**
97
+ * CredentialAPIKey carries a single bearer/header API key.
98
+ */
99
+ interface APIKey {
100
+ apiKey?: string;
101
+ }
102
+ }
103
+ export interface AIProviderCredentialHeaders {
104
+ /**
105
+ * CredentialHeaders carries arbitrary HTTP headers sent with every request to the
106
+ * provider (e.g. {"Authorization": "Bearer ...", "X-Api-Key": "..."}).
107
+ */
108
+ headers: AIProviderCredentialHeaders.Headers;
109
+ type: 'headers';
110
+ }
111
+ export declare namespace AIProviderCredentialHeaders {
112
+ /**
113
+ * CredentialHeaders carries arbitrary HTTP headers sent with every request to the
114
+ * provider (e.g. {"Authorization": "Bearer ...", "X-Api-Key": "..."}).
115
+ */
116
+ interface Headers {
117
+ headers?: {
118
+ [key: string]: string;
119
+ };
120
+ }
121
+ }
29
122
  /**
30
123
  * AIProviderKey is a credential for an AI provider, scoped to a workspace. Most
31
124
  * keys are customer-provided (BYOK); Cadenya also provisions promotional keys (see
@@ -73,128 +166,46 @@ export interface AIProviderKeySpec {
73
166
  * intentionally not overridable here; use the OpenAI-compatible provider to target
74
167
  * a custom endpoint.
75
168
  */
76
- config?: AIProviderKeySpec.Config;
169
+ config?: AIProviderConfigOpenrouter | AIProviderConfigOpenAI | AIProviderConfigOpenAICompatible;
77
170
  /**
78
171
  * AIProviderCredential is the secret material used to authenticate with a
79
172
  * provider. The set case must correspond to AIProviderKeySpec.provider. The server
80
173
  * encrypts the serialized message at rest and never returns it on reads.
81
174
  */
82
- credentials?: AIProviderKeySpec.Credentials;
175
+ credentials?: AIProviderCredentialAPIKey | AIProviderCredentialHeaders;
83
176
  /**
84
177
  * The AI provider this key authenticates against.
85
178
  */
86
179
  provider?: 'AI_PROVIDER_UNSPECIFIED' | 'AI_PROVIDER_OPENROUTER' | 'AI_PROVIDER_OPENAI' | 'AI_PROVIDER_ANTHROPIC' | 'AI_PROVIDER_GEMINI' | 'AI_PROVIDER_OPENAI_COMPATIBLE';
87
180
  }
88
- export declare namespace AIProviderKeySpec {
181
+ export interface AIProviderKeyCreateParams {
89
182
  /**
90
- * AIProviderConfig holds non-secret, provider-specific settings. The set case must
91
- * correspond to AIProviderKeySpec.provider. Providers with no settings (Anthropic,
92
- * Gemini) simply leave this unset. The endpoint of a named provider is fixed and
93
- * intentionally not overridable here; use the OpenAI-compatible provider to target
94
- * a custom endpoint.
183
+ * Path param: The workspace that will own this key.
95
184
  */
96
- interface Config {
97
- /**
98
- * OpenAIConfig holds OpenAI-specific settings.
99
- */
100
- openai?: Config.OpenAI;
101
- /**
102
- * OpenAICompatibleConfig configures a generic endpoint that speaks the OpenAI Chat
103
- * Completions API. The base URL is required and its model catalog is discovered
104
- * live via GET {base_url}/models.
105
- */
106
- openaiCompatible?: Config.OpenAICompatible;
107
- /**
108
- * OpenRouterConfig holds OpenRouter-specific settings.
109
- */
110
- openrouter?: Config.Openrouter;
111
- }
112
- namespace Config {
113
- /**
114
- * OpenAIConfig holds OpenAI-specific settings.
115
- */
116
- interface OpenAI {
117
- /**
118
- * Sent as the OpenAI-Organization header when set.
119
- */
120
- organizationId?: string;
121
- /**
122
- * Sent as the OpenAI-Project header when set.
123
- */
124
- projectId?: string;
125
- }
126
- /**
127
- * OpenAICompatibleConfig configures a generic endpoint that speaks the OpenAI Chat
128
- * Completions API. The base URL is required and its model catalog is discovered
129
- * live via GET {base_url}/models.
130
- */
131
- interface OpenAICompatible {
132
- baseUrl?: string;
133
- }
134
- /**
135
- * OpenRouterConfig holds OpenRouter-specific settings.
136
- */
137
- interface Openrouter {
138
- /**
139
- * Data-residency region (e.g. "us", "eu"). Empty uses the provider default.
140
- */
141
- region?: string;
142
- }
143
- }
185
+ workspaceId?: string;
144
186
  /**
145
- * AIProviderCredential is the secret material used to authenticate with a
146
- * provider. The set case must correspond to AIProviderKeySpec.provider. The server
147
- * encrypts the serialized message at rest and never returns it on reads.
187
+ * Body param: CreateResourceMetadata contains the user-provided fields for
188
+ * creating a workspace-scoped resource. Read-only fields (id, account_id,
189
+ * workspace_id, profile_id, created_at) are excluded since they are set by the
190
+ * server.
148
191
  */
149
- interface Credentials {
150
- /**
151
- * CredentialAPIKey carries a single bearer/header API key.
152
- */
153
- apiKey?: Credentials.APIKey;
154
- /**
155
- * CredentialHeaders carries arbitrary HTTP headers sent with every request to the
156
- * provider (e.g. {"Authorization": "Bearer ...", "X-Api-Key": "..."}).
157
- */
158
- headers?: Credentials.Headers;
159
- }
160
- namespace Credentials {
161
- /**
162
- * CredentialAPIKey carries a single bearer/header API key.
163
- */
164
- interface APIKey {
165
- apiKey?: string;
166
- }
167
- /**
168
- * CredentialHeaders carries arbitrary HTTP headers sent with every request to the
169
- * provider (e.g. {"Authorization": "Bearer ...", "X-Api-Key": "..."}).
170
- */
171
- interface Headers {
172
- headers?: {
173
- [key: string]: string;
174
- };
175
- }
176
- }
177
- }
178
- export interface AIProviderKeyCreateParams {
192
+ metadata: Shared.CreateResourceMetadata;
179
193
  /**
180
- * CreateResourceMetadata contains the user-provided fields for creating a
181
- * workspace-scoped resource. Read-only fields (id, account_id, workspace_id,
182
- * profile_id, created_at) are excluded since they are set by the server.
194
+ * Body param
183
195
  */
184
- metadata: Shared.CreateResourceMetadata;
185
196
  spec: AIProviderKeySpec;
186
197
  }
187
198
  export interface AIProviderKeyRetrieveParams {
188
199
  /**
189
200
  * The workspace the key belongs to.
190
201
  */
191
- workspaceId: string;
202
+ workspaceId?: string;
192
203
  }
193
204
  export interface AIProviderKeyUpdateParams {
194
205
  /**
195
206
  * Path param: The workspace the key belongs to.
196
207
  */
197
- workspaceId: string;
208
+ workspaceId?: string;
198
209
  /**
199
210
  * Body param: UpdateResourceMetadata contains the user-provided fields for
200
211
  * updating a workspace-scoped resource. Read-only fields (id, account_id,
@@ -213,32 +224,36 @@ export interface AIProviderKeyUpdateParams {
213
224
  }
214
225
  export interface AIProviderKeyListParams extends CursorPaginationParams {
215
226
  /**
216
- * When true, populate each item's info (model counts), at the cost of extra
217
- * lookups.
227
+ * Path param: The workspace whose keys will be listed.
228
+ */
229
+ workspaceId?: string;
230
+ /**
231
+ * Query param: When true, populate each item's info (model counts), at the cost of
232
+ * extra lookups.
218
233
  */
219
234
  includeInfo?: boolean;
220
235
  /**
221
- * Filters by metadata labels. Comma-separated key=value pairs, e.g.
236
+ * Query param: Filters by metadata labels. Comma-separated key=value pairs, e.g.
222
237
  * "env=prod,team=ai". A resource matches only if every pair matches exactly (AND
223
238
  * semantics).
224
239
  */
225
240
  labels?: string;
226
241
  /**
227
- * Filter expression (query param: prefix)
242
+ * Query param: Filter expression (query param: prefix)
228
243
  */
229
244
  prefix?: string;
230
245
  /**
231
- * When true, return only promotional keys (provided by Cadenya, e.g. for
232
- * onboarding). Defaults to returning all keys, customer-provided and promotional
233
- * alike.
246
+ * Query param: When true, return only promotional keys (provided by Cadenya, e.g.
247
+ * for onboarding). Defaults to returning all keys, customer-provided and
248
+ * promotional alike.
234
249
  */
235
250
  promotional?: boolean;
236
251
  /**
237
- * Free-form search query
252
+ * Query param: Free-form search query
238
253
  */
239
254
  query?: string;
240
255
  /**
241
- * Sort order for results (asc or desc by creation time)
256
+ * Query param: Sort order for results (asc or desc by creation time)
242
257
  */
243
258
  sortOrder?: string;
244
259
  }
@@ -246,9 +261,9 @@ export interface AIProviderKeyDeleteParams {
246
261
  /**
247
262
  * The workspace the key belongs to.
248
263
  */
249
- workspaceId: string;
264
+ workspaceId?: string;
250
265
  }
251
266
  export declare namespace AIProviderKeys {
252
- export { type AIProviderKey as AIProviderKey, type AIProviderKeySpec as AIProviderKeySpec, type AIProviderKeysCursorPagination as AIProviderKeysCursorPagination, type AIProviderKeyCreateParams as AIProviderKeyCreateParams, type AIProviderKeyRetrieveParams as AIProviderKeyRetrieveParams, type AIProviderKeyUpdateParams as AIProviderKeyUpdateParams, type AIProviderKeyListParams as AIProviderKeyListParams, type AIProviderKeyDeleteParams as AIProviderKeyDeleteParams, };
267
+ export { type AIProviderConfigOpenAI as AIProviderConfigOpenAI, type AIProviderConfigOpenAICompatible as AIProviderConfigOpenAICompatible, type AIProviderConfigOpenrouter as AIProviderConfigOpenrouter, type AIProviderCredentialAPIKey as AIProviderCredentialAPIKey, type AIProviderCredentialHeaders as AIProviderCredentialHeaders, type AIProviderKey as AIProviderKey, type AIProviderKeySpec as AIProviderKeySpec, type AIProviderKeysCursorPagination as AIProviderKeysCursorPagination, type AIProviderKeyCreateParams as AIProviderKeyCreateParams, type AIProviderKeyRetrieveParams as AIProviderKeyRetrieveParams, type AIProviderKeyUpdateParams as AIProviderKeyUpdateParams, type AIProviderKeyListParams as AIProviderKeyListParams, type AIProviderKeyDeleteParams as AIProviderKeyDeleteParams, };
253
268
  }
254
269
  //# sourceMappingURL=ai-provider-keys.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ai-provider-keys.d.mts","sourceRoot":"","sources":["../src/resources/ai-provider-keys.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,6BAAyB;AAC/C,OAAO,KAAK,MAAM,qBAAiB;AACnC,OAAO,EAAE,UAAU,EAAE,gCAA4B;AACjD,OAAO,EAAE,gBAAgB,EAAE,KAAK,sBAAsB,EAAE,WAAW,EAAE,+BAA2B;AAEhG,OAAO,EAAE,cAAc,EAAE,wCAAoC;AAG7D,qBAAa,cAAe,SAAQ,WAAW;IAC7C;;OAEG;IACH,MAAM,CACJ,WAAW,EAAE,MAAM,EACnB,IAAI,EAAE,yBAAyB,EAC/B,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CAAC,aAAa,CAAC;IAI5B;;OAEG;IACH,QAAQ,CACN,EAAE,EAAE,MAAM,EACV,MAAM,EAAE,2BAA2B,EACnC,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CAAC,aAAa,CAAC;IAK5B;;OAEG;IACH,MAAM,CAAC,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,yBAAyB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,aAAa,CAAC;IAQ1G;;OAEG;IACH,IAAI,CACF,WAAW,EAAE,MAAM,EACnB,KAAK,GAAE,uBAAuB,GAAG,IAAI,GAAG,SAAc,EACtD,OAAO,CAAC,EAAE,cAAc,GACvB,WAAW,CAAC,8BAA8B,EA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BAA0B,EAC7D,KAAK,0BAA0B,IAAI,0BAA0B,EAC7D,KAAK,2BAA2B,IAAI,2BAA2B,EAC/D,KAAK,aAAa,IAAI,aAAa,EACnC,KAAK,iBAAiB,IAAI,iBAAiB,EAC3C,KAAK,8BAA8B,IAAI,8BAA8B,EACrE,KAAK,yBAAyB,IAAI,yBAAyB,EAC3D,KAAK,2BAA2B,IAAI,2BAA2B,EAC/D,KAAK,yBAAyB,IAAI,yBAAyB,EAC3D,KAAK,uBAAuB,IAAI,uBAAuB,EACvD,KAAK,yBAAyB,IAAI,yBAAyB,GAC5D,CAAC;CACH"}
@@ -7,11 +7,11 @@ export declare class AIProviderKeys extends APIResource {
7
7
  /**
8
8
  * Creates a new customer-provided AI provider key in the workspace
9
9
  */
10
- create(workspaceID: string, body: AIProviderKeyCreateParams, options?: RequestOptions): APIPromise<AIProviderKey>;
10
+ create(params: AIProviderKeyCreateParams, options?: RequestOptions): APIPromise<AIProviderKey>;
11
11
  /**
12
12
  * Retrieves an AI provider key by ID from the workspace
13
13
  */
14
- retrieve(id: string, params: AIProviderKeyRetrieveParams, options?: RequestOptions): APIPromise<AIProviderKey>;
14
+ retrieve(id: string, params?: AIProviderKeyRetrieveParams | null | undefined, options?: RequestOptions): APIPromise<AIProviderKey>;
15
15
  /**
16
16
  * Updates an AI provider key's name or key value in the workspace
17
17
  */
@@ -19,13 +19,106 @@ export declare class AIProviderKeys extends APIResource {
19
19
  /**
20
20
  * Lists all customer-provided AI provider keys in the workspace
21
21
  */
22
- list(workspaceID: string, query?: AIProviderKeyListParams | null | undefined, options?: RequestOptions): PagePromise<AIProviderKeysCursorPagination, AIProviderKey>;
22
+ list(params?: AIProviderKeyListParams | null | undefined, options?: RequestOptions): PagePromise<AIProviderKeysCursorPagination, AIProviderKey>;
23
23
  /**
24
24
  * Deletes an AI provider key from the workspace
25
25
  */
26
- delete(id: string, params: AIProviderKeyDeleteParams, options?: RequestOptions): APIPromise<void>;
26
+ delete(id: string, params?: AIProviderKeyDeleteParams | null | undefined, options?: RequestOptions): APIPromise<void>;
27
27
  }
28
28
  export type AIProviderKeysCursorPagination = CursorPagination<AIProviderKey>;
29
+ export interface AIProviderConfigOpenAI {
30
+ /**
31
+ * OpenAIConfig holds OpenAI-specific settings.
32
+ */
33
+ openai: AIProviderConfigOpenAI.OpenAI;
34
+ type: 'openai';
35
+ }
36
+ export declare namespace AIProviderConfigOpenAI {
37
+ /**
38
+ * OpenAIConfig holds OpenAI-specific settings.
39
+ */
40
+ interface OpenAI {
41
+ /**
42
+ * Sent as the OpenAI-Organization header when set.
43
+ */
44
+ organizationId?: string;
45
+ /**
46
+ * Sent as the OpenAI-Project header when set.
47
+ */
48
+ projectId?: string;
49
+ }
50
+ }
51
+ export interface AIProviderConfigOpenAICompatible {
52
+ /**
53
+ * OpenAICompatibleConfig configures a generic endpoint that speaks the OpenAI Chat
54
+ * Completions API. The base URL is required and its model catalog is discovered
55
+ * live via GET {base_url}/models.
56
+ */
57
+ openaiCompatible: AIProviderConfigOpenAICompatible.OpenAICompatible;
58
+ type: 'openaiCompatible';
59
+ }
60
+ export declare namespace AIProviderConfigOpenAICompatible {
61
+ /**
62
+ * OpenAICompatibleConfig configures a generic endpoint that speaks the OpenAI Chat
63
+ * Completions API. The base URL is required and its model catalog is discovered
64
+ * live via GET {base_url}/models.
65
+ */
66
+ interface OpenAICompatible {
67
+ baseUrl: string;
68
+ }
69
+ }
70
+ export interface AIProviderConfigOpenrouter {
71
+ /**
72
+ * OpenRouterConfig holds OpenRouter-specific settings.
73
+ */
74
+ openrouter: AIProviderConfigOpenrouter.Openrouter;
75
+ type: 'openrouter';
76
+ }
77
+ export declare namespace AIProviderConfigOpenrouter {
78
+ /**
79
+ * OpenRouterConfig holds OpenRouter-specific settings.
80
+ */
81
+ interface Openrouter {
82
+ /**
83
+ * Data-residency region (e.g. "us", "eu"). Empty uses the provider default.
84
+ */
85
+ region?: string;
86
+ }
87
+ }
88
+ export interface AIProviderCredentialAPIKey {
89
+ /**
90
+ * CredentialAPIKey carries a single bearer/header API key.
91
+ */
92
+ apiKey: AIProviderCredentialAPIKey.APIKey;
93
+ type: 'apiKey';
94
+ }
95
+ export declare namespace AIProviderCredentialAPIKey {
96
+ /**
97
+ * CredentialAPIKey carries a single bearer/header API key.
98
+ */
99
+ interface APIKey {
100
+ apiKey?: string;
101
+ }
102
+ }
103
+ export interface AIProviderCredentialHeaders {
104
+ /**
105
+ * CredentialHeaders carries arbitrary HTTP headers sent with every request to the
106
+ * provider (e.g. {"Authorization": "Bearer ...", "X-Api-Key": "..."}).
107
+ */
108
+ headers: AIProviderCredentialHeaders.Headers;
109
+ type: 'headers';
110
+ }
111
+ export declare namespace AIProviderCredentialHeaders {
112
+ /**
113
+ * CredentialHeaders carries arbitrary HTTP headers sent with every request to the
114
+ * provider (e.g. {"Authorization": "Bearer ...", "X-Api-Key": "..."}).
115
+ */
116
+ interface Headers {
117
+ headers?: {
118
+ [key: string]: string;
119
+ };
120
+ }
121
+ }
29
122
  /**
30
123
  * AIProviderKey is a credential for an AI provider, scoped to a workspace. Most
31
124
  * keys are customer-provided (BYOK); Cadenya also provisions promotional keys (see
@@ -73,128 +166,46 @@ export interface AIProviderKeySpec {
73
166
  * intentionally not overridable here; use the OpenAI-compatible provider to target
74
167
  * a custom endpoint.
75
168
  */
76
- config?: AIProviderKeySpec.Config;
169
+ config?: AIProviderConfigOpenrouter | AIProviderConfigOpenAI | AIProviderConfigOpenAICompatible;
77
170
  /**
78
171
  * AIProviderCredential is the secret material used to authenticate with a
79
172
  * provider. The set case must correspond to AIProviderKeySpec.provider. The server
80
173
  * encrypts the serialized message at rest and never returns it on reads.
81
174
  */
82
- credentials?: AIProviderKeySpec.Credentials;
175
+ credentials?: AIProviderCredentialAPIKey | AIProviderCredentialHeaders;
83
176
  /**
84
177
  * The AI provider this key authenticates against.
85
178
  */
86
179
  provider?: 'AI_PROVIDER_UNSPECIFIED' | 'AI_PROVIDER_OPENROUTER' | 'AI_PROVIDER_OPENAI' | 'AI_PROVIDER_ANTHROPIC' | 'AI_PROVIDER_GEMINI' | 'AI_PROVIDER_OPENAI_COMPATIBLE';
87
180
  }
88
- export declare namespace AIProviderKeySpec {
181
+ export interface AIProviderKeyCreateParams {
89
182
  /**
90
- * AIProviderConfig holds non-secret, provider-specific settings. The set case must
91
- * correspond to AIProviderKeySpec.provider. Providers with no settings (Anthropic,
92
- * Gemini) simply leave this unset. The endpoint of a named provider is fixed and
93
- * intentionally not overridable here; use the OpenAI-compatible provider to target
94
- * a custom endpoint.
183
+ * Path param: The workspace that will own this key.
95
184
  */
96
- interface Config {
97
- /**
98
- * OpenAIConfig holds OpenAI-specific settings.
99
- */
100
- openai?: Config.OpenAI;
101
- /**
102
- * OpenAICompatibleConfig configures a generic endpoint that speaks the OpenAI Chat
103
- * Completions API. The base URL is required and its model catalog is discovered
104
- * live via GET {base_url}/models.
105
- */
106
- openaiCompatible?: Config.OpenAICompatible;
107
- /**
108
- * OpenRouterConfig holds OpenRouter-specific settings.
109
- */
110
- openrouter?: Config.Openrouter;
111
- }
112
- namespace Config {
113
- /**
114
- * OpenAIConfig holds OpenAI-specific settings.
115
- */
116
- interface OpenAI {
117
- /**
118
- * Sent as the OpenAI-Organization header when set.
119
- */
120
- organizationId?: string;
121
- /**
122
- * Sent as the OpenAI-Project header when set.
123
- */
124
- projectId?: string;
125
- }
126
- /**
127
- * OpenAICompatibleConfig configures a generic endpoint that speaks the OpenAI Chat
128
- * Completions API. The base URL is required and its model catalog is discovered
129
- * live via GET {base_url}/models.
130
- */
131
- interface OpenAICompatible {
132
- baseUrl?: string;
133
- }
134
- /**
135
- * OpenRouterConfig holds OpenRouter-specific settings.
136
- */
137
- interface Openrouter {
138
- /**
139
- * Data-residency region (e.g. "us", "eu"). Empty uses the provider default.
140
- */
141
- region?: string;
142
- }
143
- }
185
+ workspaceId?: string;
144
186
  /**
145
- * AIProviderCredential is the secret material used to authenticate with a
146
- * provider. The set case must correspond to AIProviderKeySpec.provider. The server
147
- * encrypts the serialized message at rest and never returns it on reads.
187
+ * Body param: CreateResourceMetadata contains the user-provided fields for
188
+ * creating a workspace-scoped resource. Read-only fields (id, account_id,
189
+ * workspace_id, profile_id, created_at) are excluded since they are set by the
190
+ * server.
148
191
  */
149
- interface Credentials {
150
- /**
151
- * CredentialAPIKey carries a single bearer/header API key.
152
- */
153
- apiKey?: Credentials.APIKey;
154
- /**
155
- * CredentialHeaders carries arbitrary HTTP headers sent with every request to the
156
- * provider (e.g. {"Authorization": "Bearer ...", "X-Api-Key": "..."}).
157
- */
158
- headers?: Credentials.Headers;
159
- }
160
- namespace Credentials {
161
- /**
162
- * CredentialAPIKey carries a single bearer/header API key.
163
- */
164
- interface APIKey {
165
- apiKey?: string;
166
- }
167
- /**
168
- * CredentialHeaders carries arbitrary HTTP headers sent with every request to the
169
- * provider (e.g. {"Authorization": "Bearer ...", "X-Api-Key": "..."}).
170
- */
171
- interface Headers {
172
- headers?: {
173
- [key: string]: string;
174
- };
175
- }
176
- }
177
- }
178
- export interface AIProviderKeyCreateParams {
192
+ metadata: Shared.CreateResourceMetadata;
179
193
  /**
180
- * CreateResourceMetadata contains the user-provided fields for creating a
181
- * workspace-scoped resource. Read-only fields (id, account_id, workspace_id,
182
- * profile_id, created_at) are excluded since they are set by the server.
194
+ * Body param
183
195
  */
184
- metadata: Shared.CreateResourceMetadata;
185
196
  spec: AIProviderKeySpec;
186
197
  }
187
198
  export interface AIProviderKeyRetrieveParams {
188
199
  /**
189
200
  * The workspace the key belongs to.
190
201
  */
191
- workspaceId: string;
202
+ workspaceId?: string;
192
203
  }
193
204
  export interface AIProviderKeyUpdateParams {
194
205
  /**
195
206
  * Path param: The workspace the key belongs to.
196
207
  */
197
- workspaceId: string;
208
+ workspaceId?: string;
198
209
  /**
199
210
  * Body param: UpdateResourceMetadata contains the user-provided fields for
200
211
  * updating a workspace-scoped resource. Read-only fields (id, account_id,
@@ -213,32 +224,36 @@ export interface AIProviderKeyUpdateParams {
213
224
  }
214
225
  export interface AIProviderKeyListParams extends CursorPaginationParams {
215
226
  /**
216
- * When true, populate each item's info (model counts), at the cost of extra
217
- * lookups.
227
+ * Path param: The workspace whose keys will be listed.
228
+ */
229
+ workspaceId?: string;
230
+ /**
231
+ * Query param: When true, populate each item's info (model counts), at the cost of
232
+ * extra lookups.
218
233
  */
219
234
  includeInfo?: boolean;
220
235
  /**
221
- * Filters by metadata labels. Comma-separated key=value pairs, e.g.
236
+ * Query param: Filters by metadata labels. Comma-separated key=value pairs, e.g.
222
237
  * "env=prod,team=ai". A resource matches only if every pair matches exactly (AND
223
238
  * semantics).
224
239
  */
225
240
  labels?: string;
226
241
  /**
227
- * Filter expression (query param: prefix)
242
+ * Query param: Filter expression (query param: prefix)
228
243
  */
229
244
  prefix?: string;
230
245
  /**
231
- * When true, return only promotional keys (provided by Cadenya, e.g. for
232
- * onboarding). Defaults to returning all keys, customer-provided and promotional
233
- * alike.
246
+ * Query param: When true, return only promotional keys (provided by Cadenya, e.g.
247
+ * for onboarding). Defaults to returning all keys, customer-provided and
248
+ * promotional alike.
234
249
  */
235
250
  promotional?: boolean;
236
251
  /**
237
- * Free-form search query
252
+ * Query param: Free-form search query
238
253
  */
239
254
  query?: string;
240
255
  /**
241
- * Sort order for results (asc or desc by creation time)
256
+ * Query param: Sort order for results (asc or desc by creation time)
242
257
  */
243
258
  sortOrder?: string;
244
259
  }
@@ -246,9 +261,9 @@ export interface AIProviderKeyDeleteParams {
246
261
  /**
247
262
  * The workspace the key belongs to.
248
263
  */
249
- workspaceId: string;
264
+ workspaceId?: string;
250
265
  }
251
266
  export declare namespace AIProviderKeys {
252
- export { type AIProviderKey as AIProviderKey, type AIProviderKeySpec as AIProviderKeySpec, type AIProviderKeysCursorPagination as AIProviderKeysCursorPagination, type AIProviderKeyCreateParams as AIProviderKeyCreateParams, type AIProviderKeyRetrieveParams as AIProviderKeyRetrieveParams, type AIProviderKeyUpdateParams as AIProviderKeyUpdateParams, type AIProviderKeyListParams as AIProviderKeyListParams, type AIProviderKeyDeleteParams as AIProviderKeyDeleteParams, };
267
+ export { type AIProviderConfigOpenAI as AIProviderConfigOpenAI, type AIProviderConfigOpenAICompatible as AIProviderConfigOpenAICompatible, type AIProviderConfigOpenrouter as AIProviderConfigOpenrouter, type AIProviderCredentialAPIKey as AIProviderCredentialAPIKey, type AIProviderCredentialHeaders as AIProviderCredentialHeaders, type AIProviderKey as AIProviderKey, type AIProviderKeySpec as AIProviderKeySpec, type AIProviderKeysCursorPagination as AIProviderKeysCursorPagination, type AIProviderKeyCreateParams as AIProviderKeyCreateParams, type AIProviderKeyRetrieveParams as AIProviderKeyRetrieveParams, type AIProviderKeyUpdateParams as AIProviderKeyUpdateParams, type AIProviderKeyListParams as AIProviderKeyListParams, type AIProviderKeyDeleteParams as AIProviderKeyDeleteParams, };
253
268
  }
254
269
  //# sourceMappingURL=ai-provider-keys.d.ts.map