@outputai/llm 0.11.1-next.da26845.0 → 0.12.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 (47) hide show
  1. package/package.json +7 -3
  2. package/src/agent.js +7 -2
  3. package/src/generate.js +1 -0
  4. package/src/index.d.ts +14 -6
  5. package/src/utils/wrap.js +35 -2
  6. package/src/agent.spec.js +0 -595
  7. package/src/ai_provider.spec.js +0 -217
  8. package/src/ai_sdk_options.spec.js +0 -390
  9. package/src/fixtures/image_response_v7_google_vertex.js +0 -72
  10. package/src/fixtures/image_response_v7_openai.js +0 -77
  11. package/src/fixtures/models_api_light.json +0 -675
  12. package/src/fixtures/models_api_v7_subset.json +0 -259
  13. package/src/fixtures/stream_response_v7_anthropic.js +0 -389
  14. package/src/fixtures/stream_response_v7_google_vertex.js +0 -462
  15. package/src/fixtures/stream_response_v7_openai.js +0 -353
  16. package/src/fixtures/stream_response_v7_perplexity.js +0 -671
  17. package/src/fixtures/text_response_v7_anthropic.js +0 -359
  18. package/src/fixtures/text_response_v7_anthropic_cache.js +0 -719
  19. package/src/fixtures/text_response_v7_google_vertex.js +0 -435
  20. package/src/fixtures/text_response_v7_openai.js +0 -347
  21. package/src/fixtures/text_response_v7_perplexity.js +0 -764
  22. package/src/generate.spec.js +0 -525
  23. package/src/prompt/content.spec.js +0 -208
  24. package/src/prompt/interpolations.spec.js +0 -109
  25. package/src/prompt/loader.full.spec.js +0 -309
  26. package/src/prompt/loader.spec.js +0 -258
  27. package/src/prompt/markup/attributes.spec.js +0 -132
  28. package/src/prompt/markup/nodes.spec.js +0 -333
  29. package/src/prompt/markup/tokenizer.spec.js +0 -149
  30. package/src/prompt/markup/tokens.spec.js +0 -250
  31. package/src/prompt/validations.spec.js +0 -812
  32. package/src/utils/cost.full.spec.js +0 -272
  33. package/src/utils/cost.spec.js +0 -290
  34. package/src/utils/error_handler.spec.js +0 -230
  35. package/src/utils/file.spec.js +0 -89
  36. package/src/utils/image.spec.js +0 -20
  37. package/src/utils/legacy_cost_attribute.spec.js +0 -278
  38. package/src/utils/models.spec.js +0 -119
  39. package/src/utils/models_pricing.spec.js +0 -162
  40. package/src/utils/skills.spec.js +0 -168
  41. package/src/utils/sources.spec.js +0 -122
  42. package/src/utils/stream.spec.js +0 -55
  43. package/src/utils/tools.spec.js +0 -167
  44. package/src/utils/usage.full.spec.js +0 -215
  45. package/src/utils/usage.spec.js +0 -246
  46. package/src/utils/wrap.spec.js +0 -467
  47. package/src/validations.spec.js +0 -631
@@ -1,719 +0,0 @@
1
- export const req1 = {
2
- initialResponseMessages: [],
3
- steps: [
4
- {
5
- callId: 'call-id',
6
- stepNumber: 0,
7
- model: {
8
- provider: 'anthropic.messages',
9
- modelId: 'claude-haiku-4-5'
10
- },
11
- runtimeContext: {},
12
- toolsContext: {},
13
- content: [
14
- {
15
- type: 'text',
16
- text: 'seeded'
17
- }
18
- ],
19
- finishReason: 'stop',
20
- rawFinishReason: 'end_turn',
21
- usage: {
22
- inputTokens: 15016,
23
- inputTokenDetails: {
24
- noCacheTokens: 15,
25
- cacheReadTokens: 0,
26
- cacheWriteTokens: 15001
27
- },
28
- outputTokens: 5,
29
- outputTokenDetails: {},
30
- totalTokens: 15021,
31
- raw: {
32
- input_tokens: 15,
33
- output_tokens: 5,
34
- cache_creation_input_tokens: 15001,
35
- cache_read_input_tokens: 0,
36
- cache_creation: {
37
- ephemeral_5m_input_tokens: 15001,
38
- ephemeral_1h_input_tokens: 0
39
- },
40
- service_tier: 'standard',
41
- inference_geo: 'not_available'
42
- }
43
- },
44
- performance: {
45
- effectiveOutputTokensPerSecond: 5.60052700959165,
46
- effectiveTotalTokensPerSecond: 16825.103242215235,
47
- stepTimeMs: 892.9739589999954,
48
- responseTimeMs: 892.7731249999924,
49
- toolExecutionMs: {}
50
- },
51
- warnings: [],
52
- request: {},
53
- response: {
54
- id: 'res-id',
55
- timestamp: '2026-08-25T00:00:00.000Z',
56
- modelId: 'claude-haiku-4-5-20251001',
57
- headers: {
58
- 'anthropic-organization-id': 'org-id',
59
- 'anthropic-ratelimit-input-tokens-limit': '999',
60
- 'anthropic-ratelimit-input-tokens-remaining': '998',
61
- 'anthropic-ratelimit-input-tokens-reset': '2026-08-25T00:00:00Z',
62
- 'anthropic-ratelimit-output-tokens-limit': '999',
63
- 'anthropic-ratelimit-output-tokens-remaining': '998',
64
- 'anthropic-ratelimit-output-tokens-reset': '2026-08-25T00:00:00Z',
65
- 'anthropic-ratelimit-requests-limit': '99',
66
- 'anthropic-ratelimit-requests-remaining': '98',
67
- 'anthropic-ratelimit-requests-reset': '2026-08-25T00:00:00Z',
68
- 'anthropic-ratelimit-tokens-limit': '999',
69
- 'anthropic-ratelimit-tokens-remaining': '998',
70
- 'anthropic-ratelimit-tokens-reset': '2026-08-25T00:00:00Z',
71
- 'anthropic-workspace-id': 'workspace-id',
72
- 'cf-cache-status': 'DYNAMIC',
73
- 'cf-ray': 'cf-id',
74
- connection: 'keep-alive',
75
- 'content-encoding': 'br',
76
- 'content-security-policy': 'default-src \'none\'; frame-ancestors \'none\'',
77
- 'content-type': 'application/json',
78
- date: 'Tue, 25 Aug 2026 00:00:00 GMT',
79
- 'request-id': 'req-id',
80
- server: 'cloudflare',
81
- 'strict-transport-security': 'max-age=31536000; includeSubDomains; preload',
82
- traceresponse: 'trace-id',
83
- 'transfer-encoding': 'chunked',
84
- vary: 'Accept-Encoding',
85
- 'x-robots-tag': 'none'
86
- },
87
- messages: [
88
- {
89
- role: 'assistant',
90
- content: [
91
- {
92
- type: 'text',
93
- text: 'seeded'
94
- }
95
- ]
96
- }
97
- ]
98
- },
99
- providerMetadata: {
100
- anthropic: {
101
- usage: {
102
- input_tokens: 15,
103
- output_tokens: 5,
104
- cache_creation_input_tokens: 15001,
105
- cache_read_input_tokens: 0,
106
- cache_creation: {
107
- ephemeral_5m_input_tokens: 15001,
108
- ephemeral_1h_input_tokens: 0
109
- },
110
- service_tier: 'standard',
111
- inference_geo: 'not_available'
112
- },
113
- stopSequence: null,
114
- iterations: null,
115
- container: null,
116
- contextManagement: null
117
- }
118
- }
119
- }
120
- ],
121
- _output: 'seeded',
122
- totalUsage: {
123
- inputTokens: 15016,
124
- inputTokenDetails: {
125
- noCacheTokens: 15,
126
- cacheReadTokens: 0,
127
- cacheWriteTokens: 15001
128
- },
129
- outputTokens: 5,
130
- outputTokenDetails: {},
131
- totalTokens: 15021
132
- },
133
- // getters
134
- finalStep: {
135
- callId: 'call-id',
136
- stepNumber: 0,
137
- model: {
138
- provider: 'anthropic.messages',
139
- modelId: 'claude-haiku-4-5'
140
- },
141
- runtimeContext: {},
142
- toolsContext: {},
143
- content: [
144
- {
145
- type: 'text',
146
- text: 'seeded'
147
- }
148
- ],
149
- finishReason: 'stop',
150
- rawFinishReason: 'end_turn',
151
- usage: {
152
- inputTokens: 15016,
153
- inputTokenDetails: {
154
- noCacheTokens: 15,
155
- cacheReadTokens: 0,
156
- cacheWriteTokens: 15001
157
- },
158
- outputTokens: 5,
159
- outputTokenDetails: {},
160
- totalTokens: 15021,
161
- raw: {
162
- input_tokens: 15,
163
- output_tokens: 5,
164
- cache_creation_input_tokens: 15001,
165
- cache_read_input_tokens: 0,
166
- cache_creation: {
167
- ephemeral_5m_input_tokens: 15001,
168
- ephemeral_1h_input_tokens: 0
169
- },
170
- service_tier: 'standard',
171
- inference_geo: 'not_available'
172
- }
173
- },
174
- performance: {
175
- effectiveOutputTokensPerSecond: 5.60052700959165,
176
- effectiveTotalTokensPerSecond: 16825.103242215235,
177
- stepTimeMs: 892.9739589999954,
178
- responseTimeMs: 892.7731249999924,
179
- toolExecutionMs: {}
180
- },
181
- warnings: [],
182
- request: {},
183
- response: {
184
- id: 'res-id',
185
- timestamp: '2026-08-25T00:00:00.000Z',
186
- modelId: 'claude-haiku-4-5-20251001',
187
- headers: {
188
- 'anthropic-organization-id': 'org-id',
189
- 'anthropic-ratelimit-input-tokens-limit': '999',
190
- 'anthropic-ratelimit-input-tokens-remaining': '998',
191
- 'anthropic-ratelimit-input-tokens-reset': '2026-08-25T00:00:00Z',
192
- 'anthropic-ratelimit-output-tokens-limit': '999',
193
- 'anthropic-ratelimit-output-tokens-remaining': '998',
194
- 'anthropic-ratelimit-output-tokens-reset': '2026-08-25T00:00:00Z',
195
- 'anthropic-ratelimit-requests-limit': '99',
196
- 'anthropic-ratelimit-requests-remaining': '98',
197
- 'anthropic-ratelimit-requests-reset': '2026-08-25T00:00:00Z',
198
- 'anthropic-ratelimit-tokens-limit': '999',
199
- 'anthropic-ratelimit-tokens-remaining': '998',
200
- 'anthropic-ratelimit-tokens-reset': '2026-08-25T00:00:00Z',
201
- 'anthropic-workspace-id': 'workspace-id',
202
- 'cf-cache-status': 'DYNAMIC',
203
- 'cf-ray': 'cf-id',
204
- connection: 'keep-alive',
205
- 'content-encoding': 'br',
206
- 'content-security-policy': 'default-src \'none\'; frame-ancestors \'none\'',
207
- 'content-type': 'application/json',
208
- date: 'Tue, 25 Aug 2026 00:00:00 GMT',
209
- 'request-id': 'req-id',
210
- server: 'cloudflare',
211
- 'strict-transport-security': 'max-age=31536000; includeSubDomains; preload',
212
- traceresponse: 'trace-id',
213
- 'transfer-encoding': 'chunked',
214
- vary: 'Accept-Encoding',
215
- 'x-robots-tag': 'none'
216
- },
217
- messages: [
218
- {
219
- role: 'assistant',
220
- content: [
221
- {
222
- type: 'text',
223
- text: 'seeded'
224
- }
225
- ]
226
- }
227
- ]
228
- },
229
- providerMetadata: {
230
- anthropic: {
231
- usage: {
232
- input_tokens: 15,
233
- output_tokens: 5,
234
- cache_creation_input_tokens: 15001,
235
- cache_read_input_tokens: 0,
236
- cache_creation: {
237
- ephemeral_5m_input_tokens: 15001,
238
- ephemeral_1h_input_tokens: 0
239
- },
240
- service_tier: 'standard',
241
- inference_geo: 'not_available'
242
- },
243
- stopSequence: null,
244
- iterations: null,
245
- container: null,
246
- contextManagement: null
247
- }
248
- }
249
- },
250
- content: [
251
- {
252
- type: 'text',
253
- text: 'seeded'
254
- }
255
- ],
256
- text: 'seeded',
257
- files: [],
258
- reasoning: [],
259
- toolCalls: [],
260
- staticToolCalls: [],
261
- dynamicToolCalls: [],
262
- toolResults: [],
263
- staticToolResults: [],
264
- dynamicToolResults: [],
265
- sources: [],
266
- finishReason: 'stop',
267
- rawFinishReason: 'end_turn',
268
- warnings: [],
269
- providerMetadata: {
270
- anthropic: {
271
- usage: {
272
- input_tokens: 15,
273
- output_tokens: 5,
274
- cache_creation_input_tokens: 15001,
275
- cache_read_input_tokens: 0,
276
- cache_creation: {
277
- ephemeral_5m_input_tokens: 15001,
278
- ephemeral_1h_input_tokens: 0
279
- },
280
- service_tier: 'standard',
281
- inference_geo: 'not_available'
282
- },
283
- stopSequence: null,
284
- iterations: null,
285
- container: null,
286
- contextManagement: null
287
- }
288
- },
289
- response: {
290
- id: 'res-id',
291
- timestamp: '2026-08-25T00:00:00.000Z',
292
- modelId: 'claude-haiku-4-5-20251001',
293
- headers: {
294
- 'anthropic-organization-id': 'org-id',
295
- 'anthropic-ratelimit-input-tokens-limit': '999',
296
- 'anthropic-ratelimit-input-tokens-remaining': '998',
297
- 'anthropic-ratelimit-input-tokens-reset': '2026-08-25T00:00:00Z',
298
- 'anthropic-ratelimit-output-tokens-limit': '999',
299
- 'anthropic-ratelimit-output-tokens-remaining': '998',
300
- 'anthropic-ratelimit-output-tokens-reset': '2026-08-25T00:00:00Z',
301
- 'anthropic-ratelimit-requests-limit': '99',
302
- 'anthropic-ratelimit-requests-remaining': '98',
303
- 'anthropic-ratelimit-requests-reset': '2026-08-25T00:00:00Z',
304
- 'anthropic-ratelimit-tokens-limit': '999',
305
- 'anthropic-ratelimit-tokens-remaining': '998',
306
- 'anthropic-ratelimit-tokens-reset': '2026-08-25T00:00:00Z',
307
- 'anthropic-workspace-id': 'workspace-id',
308
- 'cf-cache-status': 'DYNAMIC',
309
- 'cf-ray': 'cf-id',
310
- connection: 'keep-alive',
311
- 'content-encoding': 'br',
312
- 'content-security-policy': 'default-src \'none\'; frame-ancestors \'none\'',
313
- 'content-type': 'application/json',
314
- date: 'Tue, 25 Aug 2026 00:00:00 GMT',
315
- 'request-id': 'req-id',
316
- server: 'cloudflare',
317
- 'strict-transport-security': 'max-age=31536000; includeSubDomains; preload',
318
- traceresponse: 'trace-id',
319
- 'transfer-encoding': 'chunked',
320
- vary: 'Accept-Encoding',
321
- 'x-robots-tag': 'none'
322
- },
323
- messages: [
324
- {
325
- role: 'assistant',
326
- content: [
327
- {
328
- type: 'text',
329
- text: 'seeded'
330
- }
331
- ]
332
- }
333
- ]
334
- },
335
- responseMessages: [
336
- {
337
- role: 'assistant',
338
- content: [
339
- {
340
- type: 'text',
341
- text: 'seeded'
342
- }
343
- ]
344
- }
345
- ],
346
- request: {},
347
- usage: {
348
- inputTokens: 15016,
349
- inputTokenDetails: {
350
- noCacheTokens: 15,
351
- cacheReadTokens: 0,
352
- cacheWriteTokens: 15001
353
- },
354
- outputTokens: 5,
355
- outputTokenDetails: {},
356
- totalTokens: 15021
357
- },
358
- output: 'seeded'
359
- };
360
-
361
- export const req2 = {
362
- initialResponseMessages: [],
363
- steps: [
364
- {
365
- callId: 'call-id',
366
- stepNumber: 0,
367
- model: {
368
- provider: 'anthropic.messages',
369
- modelId: 'claude-haiku-4-5'
370
- },
371
- runtimeContext: {},
372
- toolsContext: {},
373
- content: [
374
- {
375
- type: 'text',
376
- text: 'captured'
377
- }
378
- ],
379
- finishReason: 'stop',
380
- rawFinishReason: 'end_turn',
381
- usage: {
382
- inputTokens: 19017,
383
- inputTokenDetails: {
384
- noCacheTokens: 14,
385
- cacheReadTokens: 15001,
386
- cacheWriteTokens: 4002
387
- },
388
- outputTokens: 4,
389
- outputTokenDetails: {},
390
- totalTokens: 19021,
391
- raw: {
392
- input_tokens: 14,
393
- output_tokens: 4,
394
- cache_creation_input_tokens: 4002,
395
- cache_read_input_tokens: 15001,
396
- cache_creation: {
397
- ephemeral_5m_input_tokens: 4002,
398
- ephemeral_1h_input_tokens: 0
399
- },
400
- service_tier: 'standard',
401
- inference_geo: 'not_available'
402
- }
403
- },
404
- performance: {
405
- effectiveOutputTokensPerSecond: 5.724641517187713,
406
- effectiveTotalTokensPerSecond: 27222.10157460687,
407
- stepTimeMs: 698.8922089999978,
408
- responseTimeMs: 698.7337090000074,
409
- toolExecutionMs: {}
410
- },
411
- warnings: [],
412
- request: {},
413
- response: {
414
- id: 'res-id',
415
- timestamp: '2026-08-25T00:00:00.000Z',
416
- modelId: 'claude-haiku-4-5-20251001',
417
- headers: {
418
- 'anthropic-organization-id': 'org-id',
419
- 'anthropic-ratelimit-input-tokens-limit': '999',
420
- 'anthropic-ratelimit-input-tokens-remaining': '999',
421
- 'anthropic-ratelimit-input-tokens-reset': '2026-08-25T00:00:00Z',
422
- 'anthropic-ratelimit-output-tokens-limit': '999',
423
- 'anthropic-ratelimit-output-tokens-remaining': '999',
424
- 'anthropic-ratelimit-output-tokens-reset': '2026-08-25T00:00:00Z',
425
- 'anthropic-ratelimit-requests-limit': '99',
426
- 'anthropic-ratelimit-requests-remaining': '98',
427
- 'anthropic-ratelimit-requests-reset': '2026-08-25T00:00:00Z',
428
- 'anthropic-ratelimit-tokens-limit': '999',
429
- 'anthropic-ratelimit-tokens-remaining': '999',
430
- 'anthropic-ratelimit-tokens-reset': '2026-08-25T00:00:00Z',
431
- 'anthropic-workspace-id': 'workspace-id',
432
- 'cf-cache-status': 'DYNAMIC',
433
- 'cf-ray': 'cf-id',
434
- connection: 'keep-alive',
435
- 'content-encoding': 'br',
436
- 'content-security-policy': 'default-src \'none\'; frame-ancestors \'none\'',
437
- 'content-type': 'application/json',
438
- date: 'Tue, 25 Aug 2026 00:00:00 GMT',
439
- 'request-id': 'req-id',
440
- server: 'cloudflare',
441
- 'strict-transport-security': 'max-age=31536000; includeSubDomains; preload',
442
- traceresponse: 'trace-id',
443
- 'transfer-encoding': 'chunked',
444
- vary: 'Accept-Encoding',
445
- 'x-robots-tag': 'none'
446
- },
447
- messages: [
448
- {
449
- role: 'assistant',
450
- content: [
451
- {
452
- type: 'text',
453
- text: 'captured'
454
- }
455
- ]
456
- }
457
- ]
458
- },
459
- providerMetadata: {
460
- anthropic: {
461
- usage: {
462
- input_tokens: 14,
463
- output_tokens: 4,
464
- cache_creation_input_tokens: 4002,
465
- cache_read_input_tokens: 15001,
466
- cache_creation: {
467
- ephemeral_5m_input_tokens: 4002,
468
- ephemeral_1h_input_tokens: 0
469
- },
470
- service_tier: 'standard',
471
- inference_geo: 'not_available'
472
- },
473
- stopSequence: null,
474
- iterations: null,
475
- container: null,
476
- contextManagement: null
477
- }
478
- }
479
- }
480
- ],
481
- _output: 'captured',
482
- totalUsage: {
483
- inputTokens: 19017,
484
- inputTokenDetails: {
485
- noCacheTokens: 14,
486
- cacheReadTokens: 15001,
487
- cacheWriteTokens: 4002
488
- },
489
- outputTokens: 4,
490
- outputTokenDetails: {},
491
- totalTokens: 19021
492
- },
493
- // getters
494
- finalStep: {
495
- callId: 'call-id',
496
- stepNumber: 0,
497
- model: {
498
- provider: 'anthropic.messages',
499
- modelId: 'claude-haiku-4-5'
500
- },
501
- runtimeContext: {},
502
- toolsContext: {},
503
- content: [
504
- {
505
- type: 'text',
506
- text: 'captured'
507
- }
508
- ],
509
- finishReason: 'stop',
510
- rawFinishReason: 'end_turn',
511
- usage: {
512
- inputTokens: 19017,
513
- inputTokenDetails: {
514
- noCacheTokens: 14,
515
- cacheReadTokens: 15001,
516
- cacheWriteTokens: 4002
517
- },
518
- outputTokens: 4,
519
- outputTokenDetails: {},
520
- totalTokens: 19021,
521
- raw: {
522
- input_tokens: 14,
523
- output_tokens: 4,
524
- cache_creation_input_tokens: 4002,
525
- cache_read_input_tokens: 15001,
526
- cache_creation: {
527
- ephemeral_5m_input_tokens: 4002,
528
- ephemeral_1h_input_tokens: 0
529
- },
530
- service_tier: 'standard',
531
- inference_geo: 'not_available'
532
- }
533
- },
534
- performance: {
535
- effectiveOutputTokensPerSecond: 5.724641517187713,
536
- effectiveTotalTokensPerSecond: 27222.10157460687,
537
- stepTimeMs: 698.8922089999978,
538
- responseTimeMs: 698.7337090000074,
539
- toolExecutionMs: {}
540
- },
541
- warnings: [],
542
- request: {},
543
- response: {
544
- id: 'res-id',
545
- timestamp: '2026-08-25T00:00:00.000Z',
546
- modelId: 'claude-haiku-4-5-20251001',
547
- headers: {
548
- 'anthropic-organization-id': 'org-id',
549
- 'anthropic-ratelimit-input-tokens-limit': '999',
550
- 'anthropic-ratelimit-input-tokens-remaining': '999',
551
- 'anthropic-ratelimit-input-tokens-reset': '2026-08-25T00:00:00Z',
552
- 'anthropic-ratelimit-output-tokens-limit': '999',
553
- 'anthropic-ratelimit-output-tokens-remaining': '999',
554
- 'anthropic-ratelimit-output-tokens-reset': '2026-08-25T00:00:00Z',
555
- 'anthropic-ratelimit-requests-limit': '99',
556
- 'anthropic-ratelimit-requests-remaining': '98',
557
- 'anthropic-ratelimit-requests-reset': '2026-08-25T00:00:00Z',
558
- 'anthropic-ratelimit-tokens-limit': '999',
559
- 'anthropic-ratelimit-tokens-remaining': '999',
560
- 'anthropic-ratelimit-tokens-reset': '2026-08-25T00:00:00Z',
561
- 'anthropic-workspace-id': 'workspace-id',
562
- 'cf-cache-status': 'DYNAMIC',
563
- 'cf-ray': 'cf-id',
564
- connection: 'keep-alive',
565
- 'content-encoding': 'br',
566
- 'content-security-policy': 'default-src \'none\'; frame-ancestors \'none\'',
567
- 'content-type': 'application/json',
568
- date: 'Tue, 25 Aug 2026 00:00:00 GMT',
569
- 'request-id': 'req-id',
570
- server: 'cloudflare',
571
- 'strict-transport-security': 'max-age=31536000; includeSubDomains; preload',
572
- traceresponse: 'trace-id',
573
- 'transfer-encoding': 'chunked',
574
- vary: 'Accept-Encoding',
575
- 'x-robots-tag': 'none'
576
- },
577
- messages: [
578
- {
579
- role: 'assistant',
580
- content: [
581
- {
582
- type: 'text',
583
- text: 'captured'
584
- }
585
- ]
586
- }
587
- ]
588
- },
589
- providerMetadata: {
590
- anthropic: {
591
- usage: {
592
- input_tokens: 14,
593
- output_tokens: 4,
594
- cache_creation_input_tokens: 4002,
595
- cache_read_input_tokens: 15001,
596
- cache_creation: {
597
- ephemeral_5m_input_tokens: 4002,
598
- ephemeral_1h_input_tokens: 0
599
- },
600
- service_tier: 'standard',
601
- inference_geo: 'not_available'
602
- },
603
- stopSequence: null,
604
- iterations: null,
605
- container: null,
606
- contextManagement: null
607
- }
608
- }
609
- },
610
- content: [
611
- {
612
- type: 'text',
613
- text: 'captured'
614
- }
615
- ],
616
- text: 'captured',
617
- files: [],
618
- reasoning: [],
619
- toolCalls: [],
620
- staticToolCalls: [],
621
- dynamicToolCalls: [],
622
- toolResults: [],
623
- staticToolResults: [],
624
- dynamicToolResults: [],
625
- sources: [],
626
- finishReason: 'stop',
627
- rawFinishReason: 'end_turn',
628
- warnings: [],
629
- providerMetadata: {
630
- anthropic: {
631
- usage: {
632
- input_tokens: 14,
633
- output_tokens: 4,
634
- cache_creation_input_tokens: 4002,
635
- cache_read_input_tokens: 15001,
636
- cache_creation: {
637
- ephemeral_5m_input_tokens: 4002,
638
- ephemeral_1h_input_tokens: 0
639
- },
640
- service_tier: 'standard',
641
- inference_geo: 'not_available'
642
- },
643
- stopSequence: null,
644
- iterations: null,
645
- container: null,
646
- contextManagement: null
647
- }
648
- },
649
- response: {
650
- id: 'res-id',
651
- timestamp: '2026-08-25T00:00:00.000Z',
652
- modelId: 'claude-haiku-4-5-20251001',
653
- headers: {
654
- 'anthropic-organization-id': 'org-id',
655
- 'anthropic-ratelimit-input-tokens-limit': '999',
656
- 'anthropic-ratelimit-input-tokens-remaining': '999',
657
- 'anthropic-ratelimit-input-tokens-reset': '2026-08-25T00:00:00Z',
658
- 'anthropic-ratelimit-output-tokens-limit': '999',
659
- 'anthropic-ratelimit-output-tokens-remaining': '999',
660
- 'anthropic-ratelimit-output-tokens-reset': '2026-08-25T00:00:00Z',
661
- 'anthropic-ratelimit-requests-limit': '99',
662
- 'anthropic-ratelimit-requests-remaining': '98',
663
- 'anthropic-ratelimit-requests-reset': '2026-08-25T00:00:00Z',
664
- 'anthropic-ratelimit-tokens-limit': '999',
665
- 'anthropic-ratelimit-tokens-remaining': '999',
666
- 'anthropic-ratelimit-tokens-reset': '2026-08-25T00:00:00Z',
667
- 'anthropic-workspace-id': 'workspace-id',
668
- 'cf-cache-status': 'DYNAMIC',
669
- 'cf-ray': 'cf-id',
670
- connection: 'keep-alive',
671
- 'content-encoding': 'br',
672
- 'content-security-policy': 'default-src \'none\'; frame-ancestors \'none\'',
673
- 'content-type': 'application/json',
674
- date: 'Tue, 25 Aug 2026 00:00:00 GMT',
675
- 'request-id': 'req-id',
676
- server: 'cloudflare',
677
- 'strict-transport-security': 'max-age=31536000; includeSubDomains; preload',
678
- traceresponse: 'trace-id',
679
- 'transfer-encoding': 'chunked',
680
- vary: 'Accept-Encoding',
681
- 'x-robots-tag': 'none'
682
- },
683
- messages: [
684
- {
685
- role: 'assistant',
686
- content: [
687
- {
688
- type: 'text',
689
- text: 'captured'
690
- }
691
- ]
692
- }
693
- ]
694
- },
695
- responseMessages: [
696
- {
697
- role: 'assistant',
698
- content: [
699
- {
700
- type: 'text',
701
- text: 'captured'
702
- }
703
- ]
704
- }
705
- ],
706
- request: {},
707
- usage: {
708
- inputTokens: 19017,
709
- inputTokenDetails: {
710
- noCacheTokens: 14,
711
- cacheReadTokens: 15001,
712
- cacheWriteTokens: 4002
713
- },
714
- outputTokens: 4,
715
- outputTokenDetails: {},
716
- totalTokens: 19021
717
- },
718
- output: 'captured'
719
- };