@openrouter/sdk 0.3.2 → 0.3.7

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 (294) hide show
  1. package/esm/core.js +1 -0
  2. package/esm/funcs/analyticsGetUserActivity.js +1 -0
  3. package/esm/funcs/apiKeysCreate.js +1 -0
  4. package/esm/funcs/apiKeysDelete.js +1 -0
  5. package/esm/funcs/apiKeysGet.js +1 -0
  6. package/esm/funcs/apiKeysGetCurrentKeyMetadata.js +1 -0
  7. package/esm/funcs/apiKeysList.js +1 -0
  8. package/esm/funcs/apiKeysUpdate.js +1 -0
  9. package/esm/funcs/betaResponsesSend.js +1 -0
  10. package/esm/funcs/call-model.d.ts +33 -0
  11. package/esm/funcs/call-model.js +155 -0
  12. package/esm/funcs/chatSend.js +1 -0
  13. package/esm/funcs/completionsGenerate.js +1 -0
  14. package/esm/funcs/creditsCreateCoinbaseCharge.js +1 -0
  15. package/esm/funcs/creditsGetCredits.js +1 -0
  16. package/esm/funcs/embeddingsGenerate.js +1 -0
  17. package/esm/funcs/embeddingsListModels.js +1 -0
  18. package/esm/funcs/endpointsList.js +1 -0
  19. package/esm/funcs/endpointsListZdrEndpoints.js +1 -0
  20. package/esm/funcs/generationsGetGeneration.js +1 -0
  21. package/esm/funcs/modelsCount.js +1 -0
  22. package/esm/funcs/modelsList.js +1 -0
  23. package/esm/funcs/modelsListForUser.js +1 -0
  24. package/esm/funcs/oAuthCreateAuthCode.js +1 -0
  25. package/esm/funcs/oAuthExchangeAuthCodeForAPIKey.js +1 -0
  26. package/esm/funcs/parametersGetParameters.js +1 -0
  27. package/esm/funcs/providersList.js +1 -0
  28. package/esm/hooks/hooks.js +1 -0
  29. package/esm/hooks/index.js +1 -0
  30. package/esm/hooks/types.js +1 -0
  31. package/esm/index.d.ts +3 -0
  32. package/esm/index.js +4 -0
  33. package/esm/lib/anthropic-compat.d.ts +46 -0
  34. package/esm/lib/anthropic-compat.js +204 -0
  35. package/esm/lib/anthropic-compat.test.d.ts +2 -0
  36. package/esm/lib/anthropic-compat.test.js +479 -0
  37. package/esm/lib/base64.js +1 -0
  38. package/esm/lib/chat-compat.d.ts +46 -0
  39. package/esm/lib/chat-compat.js +108 -0
  40. package/esm/lib/chat-compat.test.d.ts +2 -0
  41. package/esm/lib/chat-compat.test.js +282 -0
  42. package/esm/lib/config.d.ts +2 -2
  43. package/esm/lib/config.js +3 -2
  44. package/esm/lib/dlv.js +1 -0
  45. package/esm/lib/encodings.js +1 -0
  46. package/esm/lib/env.js +1 -0
  47. package/esm/lib/event-streams.js +1 -0
  48. package/esm/lib/files.js +1 -0
  49. package/esm/lib/http.js +1 -0
  50. package/esm/lib/is-plain-object.js +1 -0
  51. package/esm/lib/logger.js +1 -0
  52. package/esm/lib/matchers.js +1 -0
  53. package/esm/lib/{response-wrapper.d.ts → model-result.d.ts} +19 -26
  54. package/esm/lib/{response-wrapper.js → model-result.js} +93 -83
  55. package/esm/lib/primitives.js +1 -0
  56. package/esm/lib/retries.js +1 -0
  57. package/esm/lib/schemas.js +1 -0
  58. package/esm/lib/sdks.js +1 -0
  59. package/esm/lib/security.js +1 -0
  60. package/esm/lib/stream-transformers.d.ts +27 -1
  61. package/esm/lib/stream-transformers.js +319 -1
  62. package/esm/lib/tool-types.d.ts +3 -3
  63. package/esm/lib/url.js +1 -0
  64. package/esm/models/activityitem.js +1 -0
  65. package/esm/models/assistantmessage.js +1 -0
  66. package/esm/models/badgatewayresponseerrordata.js +1 -0
  67. package/esm/models/badrequestresponseerrordata.js +1 -0
  68. package/esm/models/chatcompletionfinishreason.js +1 -0
  69. package/esm/models/chaterror.js +1 -0
  70. package/esm/models/chatgenerationparams.js +1 -0
  71. package/esm/models/chatgenerationtokenusage.js +1 -0
  72. package/esm/models/chatmessagecontentitem.js +1 -0
  73. package/esm/models/chatmessagecontentitemaudio.js +1 -0
  74. package/esm/models/chatmessagecontentitemcachecontrol.js +1 -0
  75. package/esm/models/chatmessagecontentitemimage.js +1 -0
  76. package/esm/models/chatmessagecontentitemtext.js +1 -0
  77. package/esm/models/chatmessagecontentitemvideo.js +1 -0
  78. package/esm/models/chatmessagetokenlogprob.js +1 -0
  79. package/esm/models/chatmessagetokenlogprobs.js +1 -0
  80. package/esm/models/chatmessagetoolcall.js +1 -0
  81. package/esm/models/chatresponse.js +1 -0
  82. package/esm/models/chatresponsechoice.js +1 -0
  83. package/esm/models/chatstreamingchoice.js +1 -0
  84. package/esm/models/chatstreamingmessagechunk.js +1 -0
  85. package/esm/models/chatstreamingmessagetoolcall.js +1 -0
  86. package/esm/models/chatstreamingresponsechunk.js +1 -0
  87. package/esm/models/chatstreamoptions.js +1 -0
  88. package/esm/models/claude-message.d.ts +218 -0
  89. package/esm/models/claude-message.js +6 -0
  90. package/esm/models/completionchoice.js +1 -0
  91. package/esm/models/completioncreateparams.js +1 -0
  92. package/esm/models/completionlogprobs.js +1 -0
  93. package/esm/models/completionresponse.js +1 -0
  94. package/esm/models/completionusage.js +1 -0
  95. package/esm/models/createchargerequest.js +1 -0
  96. package/esm/models/datacollection.js +1 -0
  97. package/esm/models/defaultparameters.js +1 -0
  98. package/esm/models/edgenetworktimeoutresponseerrordata.js +1 -0
  99. package/esm/models/endpointstatus.js +1 -0
  100. package/esm/models/errors/badgatewayresponseerror.js +1 -0
  101. package/esm/models/errors/badrequestresponseerror.js +1 -0
  102. package/esm/models/errors/chaterror.js +1 -0
  103. package/esm/models/errors/edgenetworktimeoutresponseerror.js +1 -0
  104. package/esm/models/errors/forbiddenresponseerror.js +1 -0
  105. package/esm/models/errors/httpclienterrors.js +1 -0
  106. package/esm/models/errors/index.js +1 -0
  107. package/esm/models/errors/internalserverresponseerror.js +1 -0
  108. package/esm/models/errors/notfoundresponseerror.js +1 -0
  109. package/esm/models/errors/openrouterdefaulterror.js +1 -0
  110. package/esm/models/errors/openroutererror.js +1 -0
  111. package/esm/models/errors/payloadtoolargeresponseerror.js +1 -0
  112. package/esm/models/errors/paymentrequiredresponseerror.js +1 -0
  113. package/esm/models/errors/provideroverloadedresponseerror.js +1 -0
  114. package/esm/models/errors/requesttimeoutresponseerror.js +1 -0
  115. package/esm/models/errors/responsevalidationerror.js +1 -0
  116. package/esm/models/errors/sdkvalidationerror.js +1 -0
  117. package/esm/models/errors/serviceunavailableresponseerror.js +1 -0
  118. package/esm/models/errors/toomanyrequestsresponseerror.js +1 -0
  119. package/esm/models/errors/unauthorizedresponseerror.js +1 -0
  120. package/esm/models/errors/unprocessableentityresponseerror.js +1 -0
  121. package/esm/models/filecitation.js +1 -0
  122. package/esm/models/filepath.js +1 -0
  123. package/esm/models/forbiddenresponseerrordata.js +1 -0
  124. package/esm/models/imagegenerationstatus.js +1 -0
  125. package/esm/models/index.d.ts +1 -0
  126. package/esm/models/index.js +2 -0
  127. package/esm/models/inputmodality.js +1 -0
  128. package/esm/models/instructtype.js +1 -0
  129. package/esm/models/internalserverresponseerrordata.js +1 -0
  130. package/esm/models/jsonschemaconfig.js +1 -0
  131. package/esm/models/listendpointsresponse.js +1 -0
  132. package/esm/models/message.js +1 -0
  133. package/esm/models/model.js +1 -0
  134. package/esm/models/modelarchitecture.js +1 -0
  135. package/esm/models/modelgroup.js +1 -0
  136. package/esm/models/modelscountresponse.js +1 -0
  137. package/esm/models/modelslistresponse.js +1 -0
  138. package/esm/models/namedtoolchoice.js +1 -0
  139. package/esm/models/notfoundresponseerrordata.js +1 -0
  140. package/esm/models/openairesponsesannotation.js +1 -0
  141. package/esm/models/openairesponsesincludable.js +1 -0
  142. package/esm/models/openairesponsesincompletedetails.js +1 -0
  143. package/esm/models/openairesponsesinputunion.js +1 -0
  144. package/esm/models/openairesponsesprompt.js +1 -0
  145. package/esm/models/openairesponsesreasoningconfig.js +1 -0
  146. package/esm/models/openairesponsesreasoningeffort.js +1 -0
  147. package/esm/models/openairesponsesrefusalcontent.js +1 -0
  148. package/esm/models/openairesponsesresponsestatus.js +1 -0
  149. package/esm/models/openairesponsesservicetier.js +1 -0
  150. package/esm/models/openairesponsestoolchoiceunion.js +1 -0
  151. package/esm/models/openairesponsestruncation.js +1 -0
  152. package/esm/models/openresponseseasyinputmessage.js +1 -0
  153. package/esm/models/openresponseserrorevent.js +1 -0
  154. package/esm/models/openresponsesfunctioncalloutput.js +1 -0
  155. package/esm/models/openresponsesfunctiontoolcall.js +1 -0
  156. package/esm/models/openresponsesimagegencallcompleted.js +1 -0
  157. package/esm/models/openresponsesimagegencallgenerating.js +1 -0
  158. package/esm/models/openresponsesimagegencallinprogress.js +1 -0
  159. package/esm/models/openresponsesimagegencallpartialimage.js +1 -0
  160. package/esm/models/openresponsesinput.js +1 -0
  161. package/esm/models/openresponsesinputmessageitem.js +1 -0
  162. package/esm/models/openresponseslogprobs.js +1 -0
  163. package/esm/models/openresponsesnonstreamingresponse.js +1 -0
  164. package/esm/models/openresponsesreasoning.js +1 -0
  165. package/esm/models/openresponsesreasoningconfig.js +1 -0
  166. package/esm/models/openresponsesreasoningdeltaevent.js +1 -0
  167. package/esm/models/openresponsesreasoningdoneevent.js +1 -0
  168. package/esm/models/openresponsesreasoningsummarypartaddedevent.js +1 -0
  169. package/esm/models/openresponsesreasoningsummarytextdeltaevent.js +1 -0
  170. package/esm/models/openresponsesreasoningsummarytextdoneevent.js +1 -0
  171. package/esm/models/openresponsesrequest.js +1 -0
  172. package/esm/models/openresponsesresponsetext.js +1 -0
  173. package/esm/models/openresponsesstreamevent.js +1 -0
  174. package/esm/models/openresponsestoplogprobs.js +1 -0
  175. package/esm/models/openresponsesusage.js +1 -0
  176. package/esm/models/openresponseswebsearch20250826tool.js +1 -0
  177. package/esm/models/openresponseswebsearchpreview20250311tool.js +1 -0
  178. package/esm/models/openresponseswebsearchpreviewtool.js +1 -0
  179. package/esm/models/openresponseswebsearchtool.js +1 -0
  180. package/esm/models/operations/createauthkeyscode.js +1 -0
  181. package/esm/models/operations/createcoinbasecharge.js +1 -0
  182. package/esm/models/operations/createembeddings.js +1 -0
  183. package/esm/models/operations/createkeys.js +1 -0
  184. package/esm/models/operations/createresponses.js +1 -0
  185. package/esm/models/operations/deletekeys.js +1 -0
  186. package/esm/models/operations/exchangeauthcodeforapikey.js +1 -0
  187. package/esm/models/operations/getcredits.js +1 -0
  188. package/esm/models/operations/getcurrentkey.js +1 -0
  189. package/esm/models/operations/getgeneration.js +1 -0
  190. package/esm/models/operations/getkey.js +1 -0
  191. package/esm/models/operations/getmodels.js +1 -0
  192. package/esm/models/operations/getparameters.js +1 -0
  193. package/esm/models/operations/getuseractivity.js +1 -0
  194. package/esm/models/operations/index.js +1 -0
  195. package/esm/models/operations/list.js +1 -0
  196. package/esm/models/operations/listendpoints.js +1 -0
  197. package/esm/models/operations/listendpointszdr.js +1 -0
  198. package/esm/models/operations/listmodelsuser.js +1 -0
  199. package/esm/models/operations/listproviders.js +1 -0
  200. package/esm/models/operations/sendchatcompletionrequest.js +1 -0
  201. package/esm/models/operations/updatekeys.js +1 -0
  202. package/esm/models/outputitemimagegenerationcall.js +1 -0
  203. package/esm/models/outputmessage.js +1 -0
  204. package/esm/models/outputmodality.js +1 -0
  205. package/esm/models/parameter.js +1 -0
  206. package/esm/models/payloadtoolargeresponseerrordata.js +1 -0
  207. package/esm/models/paymentrequiredresponseerrordata.js +1 -0
  208. package/esm/models/pdfparserengine.js +1 -0
  209. package/esm/models/pdfparseroptions.js +1 -0
  210. package/esm/models/perrequestlimits.js +1 -0
  211. package/esm/models/providername.js +1 -0
  212. package/esm/models/provideroverloadedresponseerrordata.js +1 -0
  213. package/esm/models/providerpreferences.js +1 -0
  214. package/esm/models/providersort.js +1 -0
  215. package/esm/models/providersortconfig.js +1 -0
  216. package/esm/models/providersortunion.js +1 -0
  217. package/esm/models/publicendpoint.js +1 -0
  218. package/esm/models/publicpricing.js +1 -0
  219. package/esm/models/quantization.js +1 -0
  220. package/esm/models/reasoningsummarytext.js +1 -0
  221. package/esm/models/reasoningsummaryverbosity.js +1 -0
  222. package/esm/models/reasoningtextcontent.js +1 -0
  223. package/esm/models/requesttimeoutresponseerrordata.js +1 -0
  224. package/esm/models/responseformatjsonschema.js +1 -0
  225. package/esm/models/responseformattextconfig.js +1 -0
  226. package/esm/models/responseformattextgrammar.js +1 -0
  227. package/esm/models/responseinputaudio.js +1 -0
  228. package/esm/models/responseinputfile.js +1 -0
  229. package/esm/models/responseinputimage.js +1 -0
  230. package/esm/models/responseinputtext.js +1 -0
  231. package/esm/models/responseoutputtext.js +1 -0
  232. package/esm/models/responseserrorfield.js +1 -0
  233. package/esm/models/responsesformatjsonobject.js +1 -0
  234. package/esm/models/responsesformattext.js +1 -0
  235. package/esm/models/responsesformattextjsonschemaconfig.js +1 -0
  236. package/esm/models/responsesimagegenerationcall.js +1 -0
  237. package/esm/models/responsesoutputitem.js +1 -0
  238. package/esm/models/responsesoutputitemfilesearchcall.js +1 -0
  239. package/esm/models/responsesoutputitemfunctioncall.js +1 -0
  240. package/esm/models/responsesoutputitemreasoning.js +1 -0
  241. package/esm/models/responsesoutputmessage.js +1 -0
  242. package/esm/models/responsessearchcontextsize.js +1 -0
  243. package/esm/models/responseswebsearchcalloutput.js +1 -0
  244. package/esm/models/responseswebsearchuserlocation.js +1 -0
  245. package/esm/models/responsetextconfig.js +1 -0
  246. package/esm/models/schema0.js +1 -0
  247. package/esm/models/schema3.js +1 -0
  248. package/esm/models/security.js +1 -0
  249. package/esm/models/serviceunavailableresponseerrordata.js +1 -0
  250. package/esm/models/systemmessage.js +1 -0
  251. package/esm/models/toolcallstatus.js +1 -0
  252. package/esm/models/tooldefinitionjson.js +1 -0
  253. package/esm/models/toolresponsemessage.js +1 -0
  254. package/esm/models/toomanyrequestsresponseerrordata.js +1 -0
  255. package/esm/models/topproviderinfo.js +1 -0
  256. package/esm/models/unauthorizedresponseerrordata.js +1 -0
  257. package/esm/models/unprocessableentityresponseerrordata.js +1 -0
  258. package/esm/models/urlcitation.js +1 -0
  259. package/esm/models/usermessage.js +1 -0
  260. package/esm/models/websearchengine.js +1 -0
  261. package/esm/models/websearchpreviewtooluserlocation.js +1 -0
  262. package/esm/models/websearchstatus.js +1 -0
  263. package/esm/sdk/analytics.js +1 -0
  264. package/esm/sdk/apikeys.js +1 -0
  265. package/esm/sdk/beta.js +1 -0
  266. package/esm/sdk/chat.js +1 -0
  267. package/esm/sdk/completions.js +1 -0
  268. package/esm/sdk/credits.js +1 -0
  269. package/esm/sdk/embeddings.js +1 -0
  270. package/esm/sdk/endpoints.js +1 -0
  271. package/esm/sdk/generations.js +1 -0
  272. package/esm/sdk/index.js +1 -0
  273. package/esm/sdk/models.js +1 -0
  274. package/esm/sdk/oauth.js +1 -0
  275. package/esm/sdk/parameters.js +1 -0
  276. package/esm/sdk/providers.js +1 -0
  277. package/esm/sdk/responses.js +1 -0
  278. package/esm/sdk/sdk.d.ts +3 -3
  279. package/esm/sdk/sdk.js +2 -1
  280. package/esm/types/async.js +1 -0
  281. package/esm/types/blobs.js +1 -0
  282. package/esm/types/constdatetime.js +1 -0
  283. package/esm/types/discriminatedUnion.js +1 -0
  284. package/esm/types/enums.js +1 -0
  285. package/esm/types/fp.js +1 -0
  286. package/esm/types/index.js +1 -0
  287. package/esm/types/operations.js +1 -0
  288. package/esm/types/rfcdate.js +1 -0
  289. package/esm/types/streams.js +1 -0
  290. package/esm/types/unrecognized.js +1 -0
  291. package/jsr.json +1 -1
  292. package/package.json +1 -1
  293. package/esm/funcs/callModel.d.ts +0 -87
  294. package/esm/funcs/callModel.js +0 -215
@@ -0,0 +1,218 @@
1
+ /**
2
+ * Reason why the model stopped generating.
3
+ */
4
+ export type ClaudeStopReason = "end_turn" | "max_tokens" | "stop_sequence" | "tool_use" | "pause_turn" | "refusal";
5
+ /**
6
+ * Character-level citation location within a document.
7
+ */
8
+ export type ClaudeCitationCharLocation = {
9
+ type: "char_location";
10
+ cited_text: string;
11
+ document_index: number;
12
+ document_title: string;
13
+ file_id: string;
14
+ start_char_index: number;
15
+ end_char_index: number;
16
+ };
17
+ /**
18
+ * Page-level citation location within a document.
19
+ */
20
+ export type ClaudeCitationPageLocation = {
21
+ type: "page_location";
22
+ cited_text: string;
23
+ document_index: number;
24
+ document_title: string;
25
+ file_id: string;
26
+ start_page_number: number;
27
+ end_page_number: number;
28
+ };
29
+ /**
30
+ * Content block citation location within a document.
31
+ */
32
+ export type ClaudeCitationContentBlockLocation = {
33
+ type: "content_block_location";
34
+ cited_text: string;
35
+ document_index: number;
36
+ document_title: string;
37
+ file_id: string;
38
+ start_block_index: number;
39
+ end_block_index: number;
40
+ };
41
+ /**
42
+ * Web search result citation location.
43
+ */
44
+ export type ClaudeCitationWebSearchResultLocation = {
45
+ type: "web_search_result_location";
46
+ cited_text: string;
47
+ title: string;
48
+ url: string;
49
+ encrypted_index: string;
50
+ };
51
+ /**
52
+ * Search result citation location.
53
+ */
54
+ export type ClaudeCitationSearchResultLocation = {
55
+ type: "search_result_location";
56
+ cited_text: string;
57
+ title: string;
58
+ source: string;
59
+ start_block_index: number;
60
+ end_block_index: number;
61
+ search_result_index: number;
62
+ };
63
+ /**
64
+ * Union of all text citation types.
65
+ */
66
+ export type ClaudeTextCitation = ClaudeCitationCharLocation | ClaudeCitationPageLocation | ClaudeCitationContentBlockLocation | ClaudeCitationWebSearchResultLocation | ClaudeCitationSearchResultLocation;
67
+ /**
68
+ * Text content block.
69
+ */
70
+ export type ClaudeTextBlock = {
71
+ type: "text";
72
+ text: string;
73
+ citations?: ClaudeTextCitation[];
74
+ };
75
+ /**
76
+ * Extended thinking content block.
77
+ */
78
+ export type ClaudeThinkingBlock = {
79
+ type: "thinking";
80
+ thinking: string;
81
+ signature: string;
82
+ };
83
+ /**
84
+ * Redacted thinking content block.
85
+ */
86
+ export type ClaudeRedactedThinkingBlock = {
87
+ type: "redacted_thinking";
88
+ data: string;
89
+ };
90
+ /**
91
+ * Tool use content block.
92
+ */
93
+ export type ClaudeToolUseBlock = {
94
+ type: "tool_use";
95
+ id: string;
96
+ name: string;
97
+ input: Record<string, unknown>;
98
+ };
99
+ /**
100
+ * Server-side tool use content block (e.g., web_search).
101
+ */
102
+ export type ClaudeServerToolUseBlock = {
103
+ type: "server_tool_use";
104
+ id: string;
105
+ name: "web_search";
106
+ input: Record<string, unknown>;
107
+ };
108
+ /**
109
+ * Union of all content block types.
110
+ */
111
+ export type ClaudeContentBlock = ClaudeTextBlock | ClaudeThinkingBlock | ClaudeRedactedThinkingBlock | ClaudeToolUseBlock | ClaudeServerToolUseBlock;
112
+ /**
113
+ * Token usage information.
114
+ */
115
+ export type ClaudeUsage = {
116
+ input_tokens: number;
117
+ output_tokens: number;
118
+ cache_creation_input_tokens?: number;
119
+ cache_read_input_tokens?: number;
120
+ };
121
+ /**
122
+ * Claude Message response format compatible with the Anthropic SDK.
123
+ * This represents a complete assistant response from the Claude API.
124
+ */
125
+ export type ClaudeMessage = {
126
+ id: string;
127
+ type: "message";
128
+ role: "assistant";
129
+ model: string;
130
+ content: ClaudeContentBlock[];
131
+ stop_reason: ClaudeStopReason | null;
132
+ stop_sequence?: string | null;
133
+ usage: ClaudeUsage;
134
+ /** Unmappable content preserved for lossless round-trips */
135
+ unsupported_content?: UnsupportedContent[];
136
+ };
137
+ /**
138
+ * Cache control for prompt caching.
139
+ */
140
+ export type ClaudeCacheControl = {
141
+ type: "ephemeral";
142
+ };
143
+ /**
144
+ * Text content block parameter for input.
145
+ */
146
+ export type ClaudeTextBlockParam = {
147
+ type: "text";
148
+ text: string;
149
+ cache_control?: ClaudeCacheControl | null;
150
+ };
151
+ /**
152
+ * Base64-encoded image source.
153
+ */
154
+ export type ClaudeBase64ImageSource = {
155
+ type: "base64";
156
+ media_type: "image/jpeg" | "image/png" | "image/gif" | "image/webp";
157
+ data: string;
158
+ };
159
+ /**
160
+ * URL-based image source.
161
+ */
162
+ export type ClaudeURLImageSource = {
163
+ type: "url";
164
+ url: string;
165
+ };
166
+ /**
167
+ * Image content block parameter for input.
168
+ */
169
+ export type ClaudeImageBlockParam = {
170
+ type: "image";
171
+ source: ClaudeBase64ImageSource | ClaudeURLImageSource;
172
+ cache_control?: ClaudeCacheControl | null;
173
+ };
174
+ /**
175
+ * Tool use content block parameter for input (when passing assistant's tool use back).
176
+ */
177
+ export type ClaudeToolUseBlockParam = {
178
+ type: "tool_use";
179
+ id: string;
180
+ name: string;
181
+ input: Record<string, unknown>;
182
+ cache_control?: ClaudeCacheControl | null;
183
+ };
184
+ /**
185
+ * Tool result content block parameter for input.
186
+ */
187
+ export type ClaudeToolResultBlockParam = {
188
+ type: "tool_result";
189
+ tool_use_id: string;
190
+ content: string | Array<ClaudeTextBlockParam | ClaudeImageBlockParam>;
191
+ is_error?: boolean;
192
+ cache_control?: ClaudeCacheControl | null;
193
+ };
194
+ /**
195
+ * Union of all input content block types.
196
+ */
197
+ export type ClaudeContentBlockParam = ClaudeTextBlockParam | ClaudeImageBlockParam | ClaudeToolUseBlockParam | ClaudeToolResultBlockParam;
198
+ /**
199
+ * Claude MessageParam input format compatible with the Anthropic SDK.
200
+ * This represents a message in a conversation for the Claude API.
201
+ */
202
+ export type ClaudeMessageParam = {
203
+ role: "user" | "assistant";
204
+ content: string | Array<ClaudeContentBlockParam>;
205
+ };
206
+ /**
207
+ * Container for content that cannot be mapped to Claude's native format.
208
+ * Preserves information for round-trip conversions.
209
+ */
210
+ export type UnsupportedContent = {
211
+ /** Original type from source format (e.g., "image_generation_call", "refusal") */
212
+ original_type: string;
213
+ /** Complete original data structure */
214
+ data: Record<string, unknown>;
215
+ /** Optional explanation of why this couldn't be mapped */
216
+ reason?: string;
217
+ };
218
+ //# sourceMappingURL=claude-message.d.ts.map
@@ -0,0 +1,6 @@
1
+ /*
2
+ * Types copied from @anthropic-ai/sdk for ClaudeMessage format.
3
+ * These types represent the Anthropic Claude API message response structure.
4
+ */
5
+ export {};
6
+ //# sourceMappingURL=claude-message.js.map
@@ -1,5 +1,6 @@
1
1
  /*
2
2
  * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ * @generated-id: 86092a0ff4c4
3
4
  */
4
5
  import * as z from "zod/v4";
5
6
  import { remap as remap$ } from "../lib/primitives.js";
@@ -1,5 +1,6 @@
1
1
  /*
2
2
  * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ * @generated-id: 44cc0c9c4c06
3
4
  */
4
5
  import * as z from "zod/v4";
5
6
  import { remap as remap$ } from "../lib/primitives.js";
@@ -1,5 +1,6 @@
1
1
  /*
2
2
  * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ * @generated-id: b6552175348e
3
4
  */
4
5
  import * as z from "zod/v4";
5
6
  import { remap as remap$ } from "../lib/primitives.js";
@@ -1,5 +1,6 @@
1
1
  /*
2
2
  * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ * @generated-id: 316ab9f7e558
3
4
  */
4
5
  import * as z from "zod/v4";
5
6
  import { remap as remap$ } from "../lib/primitives.js";
@@ -1,5 +1,6 @@
1
1
  /*
2
2
  * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ * @generated-id: 4a222248409d
3
4
  */
4
5
  import * as z from "zod/v4";
5
6
  import { remap as remap$ } from "../lib/primitives.js";
@@ -1,5 +1,6 @@
1
1
  /*
2
2
  * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ * @generated-id: c342dc72d1f4
3
4
  */
4
5
  import * as z from "zod/v4";
5
6
  import { remap as remap$ } from "../lib/primitives.js";
@@ -1,5 +1,6 @@
1
1
  /*
2
2
  * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ * @generated-id: fa417e9ad79a
3
4
  */
4
5
  import * as openEnums from "../types/enums.js";
5
6
  /**
@@ -1,5 +1,6 @@
1
1
  /*
2
2
  * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ * @generated-id: 8da6fac53cb5
3
4
  */
4
5
  import * as z from "zod/v4";
5
6
  import { remap as remap$ } from "../lib/primitives.js";
@@ -1,5 +1,6 @@
1
1
  /*
2
2
  * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ * @generated-id: d86e84250105
3
4
  */
4
5
  import * as z from "zod/v4";
5
6
  import { safeParse } from "../lib/schemas.js";
@@ -1,5 +1,6 @@
1
1
  /*
2
2
  * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ * @generated-id: 83efda25dcf0
3
4
  */
4
5
  import * as openEnums from "../types/enums.js";
5
6
  export const EndpointStatus = {
@@ -1,5 +1,6 @@
1
1
  /*
2
2
  * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ * @generated-id: 6264bb9f01d6
3
4
  */
4
5
  import * as z from "zod/v4";
5
6
  import { remap as remap$ } from "../../lib/primitives.js";
@@ -1,5 +1,6 @@
1
1
  /*
2
2
  * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ * @generated-id: beddfd22a313
3
4
  */
4
5
  import * as z from "zod/v4";
5
6
  import { remap as remap$ } from "../../lib/primitives.js";
@@ -1,5 +1,6 @@
1
1
  /*
2
2
  * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ * @generated-id: a3b18e48f494
3
4
  */
4
5
  import * as z from "zod/v4";
5
6
  import * as models from "../index.js";
@@ -1,5 +1,6 @@
1
1
  /*
2
2
  * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ * @generated-id: da53f308c771
3
4
  */
4
5
  import * as z from "zod/v4";
5
6
  import { remap as remap$ } from "../../lib/primitives.js";
@@ -1,5 +1,6 @@
1
1
  /*
2
2
  * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ * @generated-id: d08a9d9ee588
3
4
  */
4
5
  import * as z from "zod/v4";
5
6
  import { remap as remap$ } from "../../lib/primitives.js";
@@ -1,5 +1,6 @@
1
1
  /*
2
2
  * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ * @generated-id: 6948de76af99
3
4
  */
4
5
  /**
5
6
  * Base class for all HTTP errors.
@@ -1,5 +1,6 @@
1
1
  /*
2
2
  * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ * @generated-id: c4e22507cb83
3
4
  */
4
5
  export * from "./badgatewayresponseerror.js";
5
6
  export * from "./badrequestresponseerror.js";
@@ -1,5 +1,6 @@
1
1
  /*
2
2
  * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ * @generated-id: 02b76cec85f0
3
4
  */
4
5
  import * as z from "zod/v4";
5
6
  import { remap as remap$ } from "../../lib/primitives.js";
@@ -1,5 +1,6 @@
1
1
  /*
2
2
  * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ * @generated-id: 1914d6d7fbaf
3
4
  */
4
5
  import * as z from "zod/v4";
5
6
  import { remap as remap$ } from "../../lib/primitives.js";
@@ -1,5 +1,6 @@
1
1
  /*
2
2
  * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ * @generated-id: 8a3f2faf1848
3
4
  */
4
5
  import { OpenRouterError } from "./openroutererror.js";
5
6
  /** The fallback error class if no more specific error class is matched */
@@ -1,5 +1,6 @@
1
1
  /*
2
2
  * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ * @generated-id: b030240a8442
3
4
  */
4
5
  /** The base class for all HTTP error responses */
5
6
  export class OpenRouterError extends Error {
@@ -1,5 +1,6 @@
1
1
  /*
2
2
  * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ * @generated-id: f1e472cb7b51
3
4
  */
4
5
  import * as z from "zod/v4";
5
6
  import { remap as remap$ } from "../../lib/primitives.js";
@@ -1,5 +1,6 @@
1
1
  /*
2
2
  * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ * @generated-id: f70439757fb9
3
4
  */
4
5
  import * as z from "zod/v4";
5
6
  import { remap as remap$ } from "../../lib/primitives.js";
@@ -1,5 +1,6 @@
1
1
  /*
2
2
  * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ * @generated-id: ba8edf813fa0
3
4
  */
4
5
  import * as z from "zod/v4";
5
6
  import { remap as remap$ } from "../../lib/primitives.js";
@@ -1,5 +1,6 @@
1
1
  /*
2
2
  * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ * @generated-id: 3a4a755c8536
3
4
  */
4
5
  import * as z from "zod/v4";
5
6
  import { remap as remap$ } from "../../lib/primitives.js";
@@ -1,5 +1,6 @@
1
1
  /*
2
2
  * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ * @generated-id: 88ff98a41be9
3
4
  */
4
5
  import * as z from "zod/v4/core";
5
6
  import { OpenRouterError } from "./openroutererror.js";
@@ -1,5 +1,6 @@
1
1
  /*
2
2
  * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ * @generated-id: fb6b2b49c445
3
4
  */
4
5
  import * as z from "zod/v4/core";
5
6
  export class SDKValidationError extends Error {
@@ -1,5 +1,6 @@
1
1
  /*
2
2
  * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ * @generated-id: 1259f9d051c8
3
4
  */
4
5
  import * as z from "zod/v4";
5
6
  import { remap as remap$ } from "../../lib/primitives.js";
@@ -1,5 +1,6 @@
1
1
  /*
2
2
  * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ * @generated-id: ab15bfa145f3
3
4
  */
4
5
  import * as z from "zod/v4";
5
6
  import { remap as remap$ } from "../../lib/primitives.js";
@@ -1,5 +1,6 @@
1
1
  /*
2
2
  * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ * @generated-id: 79ab0861cf08
3
4
  */
4
5
  import * as z from "zod/v4";
5
6
  import { remap as remap$ } from "../../lib/primitives.js";
@@ -1,5 +1,6 @@
1
1
  /*
2
2
  * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ * @generated-id: d81e01bbb5e3
3
4
  */
4
5
  import * as z from "zod/v4";
5
6
  import { remap as remap$ } from "../../lib/primitives.js";
@@ -1,5 +1,6 @@
1
1
  /*
2
2
  * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ * @generated-id: 0e609723dbc8
3
4
  */
4
5
  import * as z from "zod/v4";
5
6
  import { remap as remap$ } from "../lib/primitives.js";
@@ -1,5 +1,6 @@
1
1
  /*
2
2
  * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ * @generated-id: 0f8d4008ed8e
3
4
  */
4
5
  import * as z from "zod/v4";
5
6
  import { remap as remap$ } from "../lib/primitives.js";
@@ -1,5 +1,6 @@
1
1
  /*
2
2
  * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ * @generated-id: cc3fdc45a2fd
3
4
  */
4
5
  import * as z from "zod/v4";
5
6
  import { safeParse } from "../lib/schemas.js";
@@ -1,5 +1,6 @@
1
1
  /*
2
2
  * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ * @generated-id: 2a72a5923e5a
3
4
  */
4
5
  import * as openEnums from "../types/enums.js";
5
6
  export const ImageGenerationStatus = {
@@ -150,4 +150,5 @@ export * from "./usermessage.js";
150
150
  export * from "./websearchengine.js";
151
151
  export * from "./websearchpreviewtooluserlocation.js";
152
152
  export * from "./websearchstatus.js";
153
+ export * from "./claude-message.js";
153
154
  //# sourceMappingURL=index.d.ts.map
@@ -1,5 +1,6 @@
1
1
  /*
2
2
  * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ * @generated-id: f93644b0f37e
3
4
  */
4
5
  export * from "./activityitem.js";
5
6
  export * from "./assistantmessage.js";
@@ -153,4 +154,5 @@ export * from "./usermessage.js";
153
154
  export * from "./websearchengine.js";
154
155
  export * from "./websearchpreviewtooluserlocation.js";
155
156
  export * from "./websearchstatus.js";
157
+ export * from "./claude-message.js";
156
158
  //# sourceMappingURL=index.js.map
@@ -1,5 +1,6 @@
1
1
  /*
2
2
  * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ * @generated-id: 771d5d4c91ec
3
4
  */
4
5
  import * as openEnums from "../types/enums.js";
5
6
  export const InputModality = {
@@ -1,5 +1,6 @@
1
1
  /*
2
2
  * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ * @generated-id: 970f140dadec
3
4
  */
4
5
  import * as openEnums from "../types/enums.js";
5
6
  /**
@@ -1,5 +1,6 @@
1
1
  /*
2
2
  * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ * @generated-id: 48c17eec376a
3
4
  */
4
5
  import * as z from "zod/v4";
5
6
  import { safeParse } from "../lib/schemas.js";
@@ -1,5 +1,6 @@
1
1
  /*
2
2
  * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ * @generated-id: a5dbdd0305ec
3
4
  */
4
5
  import * as z from "zod/v4";
5
6
  /** @internal */
@@ -1,5 +1,6 @@
1
1
  /*
2
2
  * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ * @generated-id: 5178e92a44ba
3
4
  */
4
5
  import * as z from "zod/v4";
5
6
  import { remap as remap$ } from "../lib/primitives.js";
@@ -1,5 +1,6 @@
1
1
  /*
2
2
  * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ * @generated-id: 34645e53d993
3
4
  */
4
5
  import * as z from "zod/v4";
5
6
  import { AssistantMessage$outboundSchema, } from "./assistantmessage.js";
@@ -1,5 +1,6 @@
1
1
  /*
2
2
  * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ * @generated-id: b99d4c14e794
3
4
  */
4
5
  import * as z from "zod/v4";
5
6
  import { remap as remap$ } from "../lib/primitives.js";
@@ -1,5 +1,6 @@
1
1
  /*
2
2
  * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ * @generated-id: 57607576095f
3
4
  */
4
5
  import * as z from "zod/v4";
5
6
  import { remap as remap$ } from "../lib/primitives.js";
@@ -1,5 +1,6 @@
1
1
  /*
2
2
  * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ * @generated-id: b65482ec4223
3
4
  */
4
5
  import * as openEnums from "../types/enums.js";
5
6
  /**
@@ -1,5 +1,6 @@
1
1
  /*
2
2
  * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ * @generated-id: cf41f6279453
3
4
  */
4
5
  import * as z from "zod/v4";
5
6
  import { safeParse } from "../lib/schemas.js";
@@ -1,5 +1,6 @@
1
1
  /*
2
2
  * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ * @generated-id: ea0e62a13d8d
3
4
  */
4
5
  import * as z from "zod/v4";
5
6
  import { safeParse } from "../lib/schemas.js";
@@ -1,5 +1,6 @@
1
1
  /*
2
2
  * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ * @generated-id: db68e36b6a77
3
4
  */
4
5
  import * as z from "zod/v4";
5
6
  /** @internal */
@@ -1,5 +1,6 @@
1
1
  /*
2
2
  * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ * @generated-id: 6c2943dd4f02
3
4
  */
4
5
  import * as z from "zod/v4";
5
6
  import { safeParse } from "../lib/schemas.js";
@@ -1,5 +1,6 @@
1
1
  /*
2
2
  * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ * @generated-id: 5828fa2314e3
3
4
  */
4
5
  import * as z from "zod/v4";
5
6
  import { safeParse } from "../lib/schemas.js";
@@ -1,5 +1,6 @@
1
1
  /*
2
2
  * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ * @generated-id: 3b5ed15267fc
3
4
  */
4
5
  import * as openEnums from "../types/enums.js";
5
6
  export const OpenAIResponsesIncludable = {