ephemeris-cli 0.0.0-stage → 0.4.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.
@@ -0,0 +1,659 @@
1
+ {
2
+ "openapi": "3.1.0",
3
+ "info": {
4
+ "title": "Ephemeris API",
5
+ "version": "1.0.0",
6
+ "description": "Authenticated model discovery, balances, forecast execution, safe retries, costs, and usage history."
7
+ },
8
+ "servers": [
9
+ {
10
+ "url": "{baseUrl}",
11
+ "variables": {
12
+ "baseUrl": {
13
+ "default": "http://localhost:3000"
14
+ }
15
+ }
16
+ }
17
+ ],
18
+ "security": [
19
+ {
20
+ "apiKey": []
21
+ }
22
+ ],
23
+ "paths": {
24
+ "/api/v1/models": {
25
+ "get": {
26
+ "operationId": "listModels",
27
+ "summary": "List available models with prices and context limits",
28
+ "responses": {
29
+ "200": {
30
+ "description": "Model catalog",
31
+ "content": {
32
+ "application/json": {
33
+ "schema": {
34
+ "type": "array",
35
+ "items": {
36
+ "$ref": "#/components/schemas/Model"
37
+ }
38
+ }
39
+ }
40
+ }
41
+ },
42
+ "401": {
43
+ "$ref": "#/components/responses/Unauthorized"
44
+ },
45
+ "503": {
46
+ "$ref": "#/components/responses/ProviderUnavailable"
47
+ }
48
+ }
49
+ }
50
+ },
51
+ "/api/v1/balance": {
52
+ "get": {
53
+ "operationId": "getBalance",
54
+ "summary": "Get the credits available to spend now",
55
+ "responses": {
56
+ "200": {
57
+ "description": "Current balance",
58
+ "content": {
59
+ "application/json": {
60
+ "schema": {
61
+ "$ref": "#/components/schemas/Balance"
62
+ }
63
+ }
64
+ }
65
+ },
66
+ "401": {
67
+ "$ref": "#/components/responses/Unauthorized"
68
+ }
69
+ }
70
+ }
71
+ },
72
+ "/api/v1/forecast": {
73
+ "post": {
74
+ "operationId": "runForecast",
75
+ "summary": "Run and bill a forecast",
76
+ "description": "Use the same Idempotency-Key when retrying an identical request. A completed retry returns the stored response without running or charging for the forecast again.",
77
+ "parameters": [
78
+ {
79
+ "name": "Idempotency-Key",
80
+ "in": "header",
81
+ "required": false,
82
+ "description": "A unique 8-128 character retry key. Keys are scoped to the authenticated user.",
83
+ "schema": {
84
+ "type": "string",
85
+ "minLength": 8,
86
+ "maxLength": 128,
87
+ "pattern": "^[A-Za-z0-9._:-]+$"
88
+ }
89
+ }
90
+ ],
91
+ "requestBody": {
92
+ "required": true,
93
+ "content": {
94
+ "application/json": {
95
+ "schema": {
96
+ "$ref": "#/components/schemas/ForecastRequest"
97
+ }
98
+ }
99
+ }
100
+ },
101
+ "responses": {
102
+ "200": {
103
+ "description": "Forecast completed",
104
+ "headers": {
105
+ "X-Request-ID": {
106
+ "$ref": "#/components/headers/RequestId"
107
+ },
108
+ "Idempotency-Replayed": {
109
+ "$ref": "#/components/headers/IdempotencyReplayed"
110
+ }
111
+ },
112
+ "content": {
113
+ "application/json": {
114
+ "schema": {
115
+ "$ref": "#/components/schemas/ForecastResponse"
116
+ }
117
+ }
118
+ }
119
+ },
120
+ "400": {
121
+ "$ref": "#/components/responses/BadRequest"
122
+ },
123
+ "401": {
124
+ "$ref": "#/components/responses/Unauthorized"
125
+ },
126
+ "402": {
127
+ "description": "Insufficient credits",
128
+ "content": {
129
+ "application/json": {
130
+ "schema": {
131
+ "$ref": "#/components/schemas/InsufficientCredits"
132
+ }
133
+ }
134
+ }
135
+ },
136
+ "409": {
137
+ "description": "Idempotency key conflict or request still processing",
138
+ "headers": {
139
+ "X-Request-ID": {
140
+ "$ref": "#/components/headers/RequestId"
141
+ },
142
+ "Retry-After": {
143
+ "description": "Seconds before retrying an in-progress request",
144
+ "schema": {
145
+ "type": "integer"
146
+ }
147
+ }
148
+ },
149
+ "content": {
150
+ "application/json": {
151
+ "schema": {
152
+ "$ref": "#/components/schemas/Error"
153
+ }
154
+ }
155
+ }
156
+ },
157
+ "429": {
158
+ "$ref": "#/components/responses/RateLimited"
159
+ },
160
+ "503": {
161
+ "$ref": "#/components/responses/ProviderUnavailable"
162
+ }
163
+ }
164
+ }
165
+ },
166
+ "/api/v1/usage": {
167
+ "get": {
168
+ "operationId": "listUsage",
169
+ "summary": "List billed forecast request history",
170
+ "parameters": [
171
+ {
172
+ "name": "limit",
173
+ "in": "query",
174
+ "required": false,
175
+ "schema": {
176
+ "type": "integer",
177
+ "minimum": 1,
178
+ "maximum": 200,
179
+ "default": 50
180
+ }
181
+ },
182
+ {
183
+ "name": "offset",
184
+ "in": "query",
185
+ "required": false,
186
+ "schema": {
187
+ "type": "integer",
188
+ "minimum": 0,
189
+ "default": 0
190
+ }
191
+ }
192
+ ],
193
+ "responses": {
194
+ "200": {
195
+ "description": "Usage page",
196
+ "content": {
197
+ "application/json": {
198
+ "schema": {
199
+ "$ref": "#/components/schemas/UsagePage"
200
+ }
201
+ }
202
+ }
203
+ },
204
+ "400": {
205
+ "$ref": "#/components/responses/BadRequest"
206
+ },
207
+ "401": {
208
+ "$ref": "#/components/responses/Unauthorized"
209
+ }
210
+ }
211
+ }
212
+ }
213
+ },
214
+ "components": {
215
+ "securitySchemes": {
216
+ "apiKey": {
217
+ "type": "http",
218
+ "scheme": "bearer",
219
+ "bearerFormat": "pc_live_...",
220
+ "description": "Ephemeris application API key"
221
+ }
222
+ },
223
+ "headers": {
224
+ "RequestId": {
225
+ "description": "Stable forecast request identifier used by usage logs and safe retries",
226
+ "schema": {
227
+ "type": "string",
228
+ "pattern": "^req_[a-f0-9]{32}$"
229
+ }
230
+ },
231
+ "IdempotencyReplayed": {
232
+ "description": "True when a completed response was returned from the idempotency store",
233
+ "schema": {
234
+ "type": "string",
235
+ "enum": [
236
+ "true",
237
+ "false"
238
+ ]
239
+ }
240
+ }
241
+ },
242
+ "responses": {
243
+ "BadRequest": {
244
+ "description": "Invalid request",
245
+ "content": {
246
+ "application/json": {
247
+ "schema": {
248
+ "$ref": "#/components/schemas/Error"
249
+ }
250
+ }
251
+ }
252
+ },
253
+ "Unauthorized": {
254
+ "description": "Missing, invalid, or revoked API key",
255
+ "content": {
256
+ "application/json": {
257
+ "schema": {
258
+ "$ref": "#/components/schemas/Error"
259
+ }
260
+ }
261
+ }
262
+ },
263
+ "RateLimited": {
264
+ "description": "Rate or capacity limit exceeded",
265
+ "headers": {
266
+ "Retry-After": {
267
+ "description": "Seconds before retrying",
268
+ "schema": {
269
+ "type": "integer"
270
+ }
271
+ }
272
+ },
273
+ "content": {
274
+ "application/json": {
275
+ "schema": {
276
+ "$ref": "#/components/schemas/Error"
277
+ }
278
+ }
279
+ }
280
+ },
281
+ "ProviderUnavailable": {
282
+ "description": "Forecasting or pricing is temporarily unavailable",
283
+ "headers": {
284
+ "Retry-After": {
285
+ "description": "Seconds before retrying",
286
+ "schema": {
287
+ "type": "integer"
288
+ }
289
+ }
290
+ },
291
+ "content": {
292
+ "application/json": {
293
+ "schema": {
294
+ "$ref": "#/components/schemas/Error"
295
+ }
296
+ }
297
+ }
298
+ }
299
+ },
300
+ "schemas": {
301
+ "Error": {
302
+ "type": "object",
303
+ "required": [
304
+ "error"
305
+ ],
306
+ "properties": {
307
+ "error": {
308
+ "type": "string"
309
+ }
310
+ }
311
+ },
312
+ "Balance": {
313
+ "type": "object",
314
+ "required": [
315
+ "balance_mc",
316
+ "active_holds_mc"
317
+ ],
318
+ "properties": {
319
+ "balance_mc": {
320
+ "type": "string",
321
+ "pattern": "^-?[0-9]+$"
322
+ },
323
+ "active_holds_mc": {
324
+ "type": "string",
325
+ "pattern": "^[0-9]+$"
326
+ }
327
+ }
328
+ },
329
+ "Model": {
330
+ "type": "object",
331
+ "required": [
332
+ "name",
333
+ "price_per_kslot_mc",
334
+ "billing_context_cap"
335
+ ],
336
+ "properties": {
337
+ "name": {
338
+ "type": "string"
339
+ },
340
+ "price_per_kslot_mc": {
341
+ "type": [
342
+ "string",
343
+ "null"
344
+ ]
345
+ },
346
+ "billing_context_cap": {
347
+ "type": [
348
+ "integer",
349
+ "null"
350
+ ]
351
+ }
352
+ },
353
+ "additionalProperties": true
354
+ },
355
+ "ForecastSeries": {
356
+ "type": "object",
357
+ "required": [
358
+ "values"
359
+ ],
360
+ "properties": {
361
+ "values": {
362
+ "oneOf": [
363
+ {
364
+ "type": "array",
365
+ "minItems": 1,
366
+ "items": {
367
+ "type": "number"
368
+ }
369
+ },
370
+ {
371
+ "type": "array",
372
+ "minItems": 1,
373
+ "items": {
374
+ "type": "array",
375
+ "minItems": 1,
376
+ "items": {
377
+ "type": "number"
378
+ }
379
+ }
380
+ }
381
+ ]
382
+ },
383
+ "freq": {
384
+ "type": "string",
385
+ "minLength": 1,
386
+ "description": "Optional per-series frequency. Mixed-frequency batches are split into compatible upstream calls and reassembled in request order."
387
+ },
388
+ "covariates": {
389
+ "$ref": "#/components/schemas/SeriesCovariates"
390
+ }
391
+ },
392
+ "additionalProperties": true
393
+ },
394
+ "SeriesCovariates": {
395
+ "type": "object",
396
+ "required": [
397
+ "past"
398
+ ],
399
+ "properties": {
400
+ "past": {
401
+ "type": "object",
402
+ "additionalProperties": {
403
+ "type": "array",
404
+ "items": {
405
+ "type": "number"
406
+ }
407
+ },
408
+ "description": "Named historical channels aligned to the series context length."
409
+ },
410
+ "future": {
411
+ "type": "object",
412
+ "additionalProperties": {
413
+ "type": "array",
414
+ "items": {
415
+ "type": "number"
416
+ }
417
+ },
418
+ "description": "Optional known-future channels aligned to the requested horizon. Every future channel must also have past history."
419
+ }
420
+ },
421
+ "additionalProperties": false
422
+ },
423
+ "ForecastRequest": {
424
+ "type": "object",
425
+ "required": [
426
+ "mode",
427
+ "series"
428
+ ],
429
+ "properties": {
430
+ "mode": {
431
+ "type": "string",
432
+ "enum": [
433
+ "explicit",
434
+ "ensemble",
435
+ "route"
436
+ ]
437
+ },
438
+ "model": {
439
+ "type": "string"
440
+ },
441
+ "series": {
442
+ "type": "array",
443
+ "minItems": 1,
444
+ "maxItems": 64,
445
+ "items": {
446
+ "$ref": "#/components/schemas/ForecastSeries"
447
+ }
448
+ },
449
+ "context_len": {
450
+ "type": "integer",
451
+ "minimum": 1,
452
+ "maximum": 16384
453
+ },
454
+ "horizon": {
455
+ "type": "integer",
456
+ "minimum": 1,
457
+ "maximum": 4096,
458
+ "description": "Maximum 4096 steps. Slots x horizon x quantiles must not exceed 120000 output values; omitted or empty quantiles are budgeted as 21."
459
+ },
460
+ "quantiles": {
461
+ "type": "array",
462
+ "maxItems": 21,
463
+ "items": {
464
+ "type": "number",
465
+ "exclusiveMinimum": 0,
466
+ "exclusiveMaximum": 1
467
+ }
468
+ },
469
+ "top_k": {
470
+ "type": [
471
+ "integer",
472
+ "null"
473
+ ],
474
+ "minimum": 1,
475
+ "maximum": 16,
476
+ "description": "Optional ensemble-only limit on the number of models."
477
+ },
478
+ "combine": {
479
+ "type": "string",
480
+ "enum": [
481
+ "mixture",
482
+ "vincentize"
483
+ ],
484
+ "description": "Optional ensemble combination method."
485
+ }
486
+ },
487
+ "additionalProperties": true
488
+ },
489
+ "ForecastResponse": {
490
+ "type": "object",
491
+ "required": [
492
+ "meta"
493
+ ],
494
+ "properties": {
495
+ "meta": {
496
+ "type": "object",
497
+ "required": [
498
+ "gateway_request_id",
499
+ "billing"
500
+ ],
501
+ "properties": {
502
+ "gateway_request_id": {
503
+ "type": "string"
504
+ },
505
+ "request_id": {
506
+ "type": "string"
507
+ },
508
+ "models_used": {
509
+ "type": "array",
510
+ "items": {
511
+ "type": "string"
512
+ }
513
+ },
514
+ "upstream_request_ids": {
515
+ "type": "array",
516
+ "items": {
517
+ "type": "string"
518
+ },
519
+ "description": "Model request IDs when a mixed-frequency request is split into compatible groups."
520
+ },
521
+ "upstream_calls": {
522
+ "type": "integer",
523
+ "minimum": 1
524
+ },
525
+ "billing": {
526
+ "type": "object",
527
+ "required": [
528
+ "settled_mc",
529
+ "balance_mc"
530
+ ],
531
+ "properties": {
532
+ "settled_mc": {
533
+ "type": "string"
534
+ },
535
+ "balance_mc": {
536
+ "type": "string"
537
+ }
538
+ }
539
+ }
540
+ },
541
+ "additionalProperties": true
542
+ }
543
+ },
544
+ "additionalProperties": true
545
+ },
546
+ "InsufficientCredits": {
547
+ "type": "object",
548
+ "required": [
549
+ "error",
550
+ "balance_mc",
551
+ "required_mc",
552
+ "topup_url"
553
+ ],
554
+ "properties": {
555
+ "error": {
556
+ "type": "string"
557
+ },
558
+ "balance_mc": {
559
+ "type": "string"
560
+ },
561
+ "required_mc": {
562
+ "type": "string"
563
+ },
564
+ "topup_url": {
565
+ "type": "string",
566
+ "format": "uri"
567
+ }
568
+ }
569
+ },
570
+ "UsageRow": {
571
+ "type": "object",
572
+ "required": [
573
+ "requestId"
574
+ ],
575
+ "properties": {
576
+ "requestId": {
577
+ "type": "string"
578
+ },
579
+ "paracastRequestId": {
580
+ "type": [
581
+ "string",
582
+ "null"
583
+ ]
584
+ },
585
+ "estimatedMc": {
586
+ "type": [
587
+ "string",
588
+ "null"
589
+ ]
590
+ },
591
+ "settledMc": {
592
+ "type": [
593
+ "string",
594
+ "null"
595
+ ]
596
+ },
597
+ "status": {
598
+ "type": [
599
+ "integer",
600
+ "null"
601
+ ]
602
+ }
603
+ },
604
+ "additionalProperties": true
605
+ },
606
+ "UsagePage": {
607
+ "type": "object",
608
+ "required": [
609
+ "data",
610
+ "pagination"
611
+ ],
612
+ "properties": {
613
+ "data": {
614
+ "type": "array",
615
+ "items": {
616
+ "$ref": "#/components/schemas/UsageRow"
617
+ }
618
+ },
619
+ "limit": {
620
+ "type": "integer"
621
+ },
622
+ "offset": {
623
+ "type": "integer"
624
+ },
625
+ "pagination": {
626
+ "type": "object",
627
+ "required": [
628
+ "limit",
629
+ "offset",
630
+ "returned",
631
+ "has_more",
632
+ "next_offset"
633
+ ],
634
+ "properties": {
635
+ "limit": {
636
+ "type": "integer"
637
+ },
638
+ "offset": {
639
+ "type": "integer"
640
+ },
641
+ "returned": {
642
+ "type": "integer"
643
+ },
644
+ "has_more": {
645
+ "type": "boolean"
646
+ },
647
+ "next_offset": {
648
+ "type": [
649
+ "integer",
650
+ "null"
651
+ ]
652
+ }
653
+ }
654
+ }
655
+ }
656
+ }
657
+ }
658
+ }
659
+ }