@1claw/openapi-spec 0.61.39 → 0.61.41

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 (3) hide show
  1. package/openapi.json +1311 -10
  2. package/openapi.yaml +729 -10
  3. package/package.json +1 -1
package/openapi.yaml CHANGED
@@ -2,7 +2,7 @@ openapi: 3.1.0
2
2
 
3
3
  info:
4
4
  title: 1Claw API
5
- version: "0.61.39"
5
+ version: "0.61.41"
6
6
  description: |
7
7
  Secure secret management for AI agents. Provides vaults, secrets,
8
8
  policy-based access control, agent identity, Intents API,
@@ -70,6 +70,8 @@ tags:
70
70
  description: Secret sharing links
71
71
  - name: Organization
72
72
  description: Org membership and roles
73
+ - name: Spend
74
+ description: AI spend — inference cost per agent, provider and model, against budgets and caps
73
75
  - name: Billing
74
76
  description: Subscriptions, credits, and usage
75
77
  - name: Audit
@@ -140,6 +142,8 @@ tags:
140
142
  description: MFA/passkey/password recovery escape hatch with admin approval
141
143
  - name: Shamir KEK
142
144
  description: Shamir secret-sharing for org-level Key Encryption Keys
145
+ - name: Agent Tools
146
+ description: Utility tools an agent calls directly on its own token (web search, etc.)
143
147
 
144
148
  # =============================================================================
145
149
  # PATHS
@@ -1977,7 +1981,7 @@ paths:
1977
1981
  x-payment-info:
1978
1982
  protocols: [x402]
1979
1983
  pricingMode: fixed
1980
- price: "0.0075"
1984
+ price: "0.0225"
1981
1985
  parameters:
1982
1986
  - $ref: "#/components/parameters/VaultId"
1983
1987
  - $ref: "#/components/parameters/SecretPath"
@@ -2007,7 +2011,7 @@ paths:
2007
2011
  x-payment-info:
2008
2012
  protocols: [x402]
2009
2013
  pricingMode: fixed
2010
- price: "0.0015"
2014
+ price: "0.0045"
2011
2015
  parameters:
2012
2016
  - $ref: "#/components/parameters/VaultId"
2013
2017
  - $ref: "#/components/parameters/SecretPath"
@@ -2732,7 +2736,8 @@ paths:
2732
2736
  mode: paid
2733
2737
  x-payment-info:
2734
2738
  protocols: [x402]
2735
- pricingMode: quote
2739
+ pricingMode: fixed
2740
+ price: "0.225"
2736
2741
  description: |
2737
2742
  Replay protection: send an optional **Idempotency-Key** header (e.g. UUID or opaque string).
2738
2743
  Duplicate requests with the same key within 24 hours return the cached transaction response
@@ -2843,7 +2848,8 @@ paths:
2843
2848
  mode: paid
2844
2849
  x-payment-info:
2845
2850
  protocols: [x402]
2846
- pricingMode: quote
2851
+ pricingMode: fixed
2852
+ price: "0.225"
2847
2853
  parameters:
2848
2854
  - $ref: "#/components/parameters/AgentId"
2849
2855
  requestBody:
@@ -2876,7 +2882,7 @@ paths:
2876
2882
  x-payment-info:
2877
2883
  protocols: [x402]
2878
2884
  pricingMode: fixed
2879
- price: "0.075"
2885
+ price: "0.225"
2880
2886
  parameters:
2881
2887
  - $ref: "#/components/parameters/AgentId"
2882
2888
  requestBody:
@@ -2909,7 +2915,7 @@ paths:
2909
2915
  x-payment-info:
2910
2916
  protocols: [x402]
2911
2917
  pricingMode: fixed
2912
- price: "0.075"
2918
+ price: "0.225"
2913
2919
  parameters:
2914
2920
  - $ref: "#/components/parameters/AgentId"
2915
2921
  requestBody:
@@ -4149,7 +4155,7 @@ paths:
4149
4155
  x-payment-info:
4150
4156
  protocols: [x402]
4151
4157
  pricingMode: fixed
4152
- price: "0.003"
4158
+ price: "0.009"
4153
4159
  parameters:
4154
4160
  - name: secret_id
4155
4161
  in: path
@@ -4186,7 +4192,7 @@ paths:
4186
4192
  x-payment-info:
4187
4193
  protocols: [x402]
4188
4194
  pricingMode: fixed
4189
- price: "0.0015"
4195
+ price: "0.0045"
4190
4196
  parameters:
4191
4197
  - name: share_id
4192
4198
  in: path
@@ -4282,6 +4288,172 @@ paths:
4282
4288
  # Organization
4283
4289
  # ---------------------------------------------------------------------------
4284
4290
 
4291
+ /v1/spend/ai:
4292
+ get:
4293
+ tags: [Spend]
4294
+ summary: AI spend
4295
+ operationId: getAiSpend
4296
+ description: |
4297
+ Inference spend for the org over a window (default the last 30 days):
4298
+ totals with the previous equal-length window for comparison, a time series
4299
+ by provider, and breakdowns by provider, by model and by agent — each agent
4300
+ with its `shroud_config` daily budget, today's spend against it and the
4301
+ requests Shroud blocked for budget. `limits` carries router-key spend caps,
4302
+ the credit balance and 1Claw's inspection fees for the window (a separate
4303
+ number from provider cost). Every request is priced at ingest from the
4304
+ price card (`GET /v1/spend/ai/prices`); a request whose provider has no
4305
+ card is counted as unpriced, not free. Human and platform callers only.
4306
+ Backs the dashboard's Spend tab; the same numbers reach an org's own
4307
+ collector as OTEL metrics `ai.cost_usd`, `ai.tokens.input`, `ai.tokens.output`.
4308
+ parameters:
4309
+ - name: from
4310
+ in: query
4311
+ schema: { type: string, format: date-time }
4312
+ - name: to
4313
+ in: query
4314
+ schema: { type: string, format: date-time }
4315
+ - name: interval
4316
+ in: query
4317
+ schema: { type: string, enum: [day, week, month], default: day }
4318
+ - name: agent_id
4319
+ in: query
4320
+ schema: { type: string, format: uuid }
4321
+ - name: provider
4322
+ in: query
4323
+ schema: { type: string }
4324
+ responses:
4325
+ "200":
4326
+ description: Spend
4327
+ content:
4328
+ application/json:
4329
+ schema:
4330
+ $ref: "#/components/schemas/AiSpend"
4331
+ "400":
4332
+ $ref: "#/components/responses/BadRequest"
4333
+ "401":
4334
+ $ref: "#/components/responses/Unauthorized"
4335
+ "403":
4336
+ $ref: "#/components/responses/Forbidden"
4337
+
4338
+ /v1/spend/ai/export.csv:
4339
+ get:
4340
+ tags: [Spend]
4341
+ summary: AI spend as CSV
4342
+ operationId: exportAiSpendCsv
4343
+ description: One row per agent × provider × model in the window (same filters as `GET /v1/spend/ai`).
4344
+ parameters:
4345
+ - name: from
4346
+ in: query
4347
+ schema: { type: string, format: date-time }
4348
+ - name: to
4349
+ in: query
4350
+ schema: { type: string, format: date-time }
4351
+ - name: agent_id
4352
+ in: query
4353
+ schema: { type: string, format: uuid }
4354
+ - name: provider
4355
+ in: query
4356
+ schema: { type: string }
4357
+ responses:
4358
+ "200":
4359
+ description: CSV
4360
+ content:
4361
+ text/csv:
4362
+ schema: { type: string }
4363
+ "401":
4364
+ $ref: "#/components/responses/Unauthorized"
4365
+ "403":
4366
+ $ref: "#/components/responses/Forbidden"
4367
+
4368
+ /v1/spend/ai/prices:
4369
+ get:
4370
+ tags: [Spend]
4371
+ summary: LLM price card
4372
+ operationId: listLlmPrices
4373
+ description: |
4374
+ The global price card (public list prices per million tokens) plus this
4375
+ org's overrides. Matching: an org row beats a global row; among those the
4376
+ longest `model_pattern` wins; a pattern ending in `%` is a prefix match.
4377
+ responses:
4378
+ "200":
4379
+ description: Prices
4380
+ content:
4381
+ application/json:
4382
+ schema:
4383
+ type: object
4384
+ required: [prices]
4385
+ properties:
4386
+ prices:
4387
+ type: array
4388
+ items:
4389
+ $ref: "#/components/schemas/LlmModelPrice"
4390
+ "401":
4391
+ $ref: "#/components/responses/Unauthorized"
4392
+ put:
4393
+ tags: [Spend]
4394
+ summary: Set an org price override
4395
+ operationId: upsertLlmPrice
4396
+ description: Owner/admin. Upserts one override for this org; future requests are priced with it (history is not rewritten).
4397
+ requestBody:
4398
+ required: true
4399
+ content:
4400
+ application/json:
4401
+ schema:
4402
+ type: object
4403
+ required: [provider, model_pattern, input_usd_per_mtok, output_usd_per_mtok]
4404
+ properties:
4405
+ provider: { type: string, example: anthropic }
4406
+ model_pattern: { type: string, example: "claude-sonnet-5%" }
4407
+ input_usd_per_mtok: { type: number, example: 3 }
4408
+ output_usd_per_mtok: { type: number, example: 15 }
4409
+ responses:
4410
+ "200":
4411
+ description: The override
4412
+ content:
4413
+ application/json:
4414
+ schema:
4415
+ $ref: "#/components/schemas/LlmModelPrice"
4416
+ "400":
4417
+ $ref: "#/components/responses/BadRequest"
4418
+ "403":
4419
+ $ref: "#/components/responses/Forbidden"
4420
+
4421
+ /v1/spend/ai/prices/{id}:
4422
+ delete:
4423
+ tags: [Spend]
4424
+ summary: Remove an org price override
4425
+ operationId: deleteLlmPrice
4426
+ parameters:
4427
+ - name: id
4428
+ in: path
4429
+ required: true
4430
+ schema: { type: string, format: uuid }
4431
+ responses:
4432
+ "204":
4433
+ description: Removed
4434
+ "403":
4435
+ $ref: "#/components/responses/Forbidden"
4436
+ "404":
4437
+ $ref: "#/components/responses/NotFound"
4438
+
4439
+ /v1/spend/ai/reprice:
4440
+ post:
4441
+ tags: [Spend]
4442
+ summary: Price the org's unpriced requests
4443
+ operationId: repriceAiSpend
4444
+ description: Owner/admin. Re-runs the price card over rows that had no price when they arrived (after adding a card for that provider). Already-priced rows are untouched.
4445
+ responses:
4446
+ "200":
4447
+ description: Count
4448
+ content:
4449
+ application/json:
4450
+ schema:
4451
+ type: object
4452
+ properties:
4453
+ repriced: { type: integer }
4454
+ "403":
4455
+ $ref: "#/components/responses/Forbidden"
4456
+
4285
4457
  /v1/org/overview:
4286
4458
  get:
4287
4459
  tags: [Organization]
@@ -4388,6 +4560,91 @@ paths:
4388
4560
  schema:
4389
4561
  $ref: "#/components/schemas/OnboardingProvisionResponse"
4390
4562
 
4563
+ /v1/onboarding/guided/status:
4564
+ get:
4565
+ tags: [Organization]
4566
+ summary: Guided onboarding eligibility + status
4567
+ description: |
4568
+ Whether this org is in the guided-onboarding rollout cohort, plus the
4569
+ same welcome-bundle progress fields `GET /v1/org/onboarding/status`
4570
+ reports. `eligible` decides whether the dashboard's redirect sends a
4571
+ new, still-unprovisioned user to the guided flow or the existing
4572
+ MCP-connect flow.
4573
+ operationId: getGuidedOnboardingStatus
4574
+ responses:
4575
+ "200":
4576
+ description: Guided onboarding status
4577
+ content:
4578
+ application/json:
4579
+ schema:
4580
+ $ref: "#/components/schemas/GuidedOnboardingStatus"
4581
+
4582
+ /v1/onboarding/guided/ask:
4583
+ post:
4584
+ tags: [Organization]
4585
+ summary: Ask the guided onboarding assistant a question
4586
+ description: |
4587
+ Scoped, one-shot Q&A for the guided wizard's "have a question?" panel.
4588
+ Not tied to an agent (many questions arrive before one exists yet) and
4589
+ not persisted as a conversation. The system prompt is fixed server-side
4590
+ and refuses anything outside vaults/policies/runtimes/billing/channels —
4591
+ never client-suppliable. Billed like any other Shroud LLM call: the
4592
+ caller's own bearer token is forwarded so usage attributes to their org.
4593
+ operationId: guidedOnboardingAsk
4594
+ requestBody:
4595
+ required: true
4596
+ content:
4597
+ application/json:
4598
+ schema:
4599
+ $ref: "#/components/schemas/GuidedAskRequest"
4600
+ responses:
4601
+ "200":
4602
+ description: Assistant's answer
4603
+ content:
4604
+ application/json:
4605
+ schema:
4606
+ $ref: "#/components/schemas/GuidedAskResponse"
4607
+
4608
+ /v1/onboarding/guided/trial/setup-intent:
4609
+ post:
4610
+ tags: [Organization]
4611
+ summary: Start a card-on-file trial runtime setup
4612
+ description: |
4613
+ Creates a Stripe SetupIntent for the org's customer so the guided
4614
+ onboarding wizard can collect a card with Stripe.js — no charge unless
4615
+ the trial runtime is kept past its trial window.
4616
+ operationId: createTrialSetupIntent
4617
+ responses:
4618
+ "200":
4619
+ description: SetupIntent client secret
4620
+ content:
4621
+ application/json:
4622
+ schema:
4623
+ $ref: "#/components/schemas/TrialSetupIntentResponse"
4624
+
4625
+ /v1/onboarding/guided/trial/runtime:
4626
+ post:
4627
+ tags: [Organization]
4628
+ summary: Create a card-gated trial runtime
4629
+ description: |
4630
+ Verifies the given SetupIntent succeeded, then delegates to the same
4631
+ runtime-creation logic `POST /v1/runtimes` uses. Only reachable once
4632
+ the guided onboarding wizard has a confirmed SetupIntent for the org.
4633
+ operationId: createTrialRuntime
4634
+ requestBody:
4635
+ required: true
4636
+ content:
4637
+ application/json:
4638
+ schema:
4639
+ $ref: "#/components/schemas/CreateTrialRuntimeRequest"
4640
+ responses:
4641
+ "201":
4642
+ description: Created runtime
4643
+ content:
4644
+ application/json:
4645
+ schema:
4646
+ $ref: "#/components/schemas/RuntimeResponse"
4647
+
4391
4648
  /v1/org/status:
4392
4649
  get:
4393
4650
  tags: [Organization]
@@ -4947,7 +5204,7 @@ paths:
4947
5204
  x-payment-info:
4948
5205
  protocols: [x402]
4949
5206
  pricingMode: fixed
4950
- price: "0.0008"
5207
+ price: "0.0024"
4951
5208
  parameters:
4952
5209
  - name: resource_id
4953
5210
  in: query
@@ -7629,6 +7886,41 @@ paths:
7629
7886
  "401":
7630
7887
  description: Unauthorized
7631
7888
 
7889
+ /v1/shroud/activity/today:
7890
+ get:
7891
+ tags: [Shroud]
7892
+ summary: An agent's inference spend since 00:00 UTC
7893
+ operationId: getAgentSpendToday
7894
+ description: |
7895
+ What the agent has spent today per the vault's priced activity rows, plus
7896
+ requests and tokens and how many requests Shroud blocked for budget. Shroud
7897
+ syncs its daily-budget counter from this so `daily_budget_usd` holds across
7898
+ Shroud instances and restarts. Callable by the agent itself (its own id) or the
7899
+ platform service key — the same gate as activity ingest.
7900
+ security:
7901
+ - BearerAuth: []
7902
+ parameters:
7903
+ - in: query
7904
+ name: agent_id
7905
+ required: true
7906
+ schema: { type: string, format: uuid }
7907
+ responses:
7908
+ "200":
7909
+ description: Today's spend
7910
+ content:
7911
+ application/json:
7912
+ schema:
7913
+ type: object
7914
+ properties:
7915
+ agent_id: { type: string, format: uuid }
7916
+ day: { type: string, example: "2026-09-21" }
7917
+ cost_usd: { type: number }
7918
+ requests: { type: integer, format: int64 }
7919
+ tokens: { type: integer, format: int64 }
7920
+ blocked_by_budget: { type: integer, format: int64 }
7921
+ "403":
7922
+ $ref: "#/components/responses/Forbidden"
7923
+
7632
7924
  /v1/shroud/threat-summary:
7633
7925
  get:
7634
7926
  tags: [Shroud]
@@ -11427,6 +11719,106 @@ paths:
11427
11719
  "403":
11428
11720
  $ref: "#/components/responses/Forbidden"
11429
11721
 
11722
+ /v1/admin/stats/growth-timeseries:
11723
+ get:
11724
+ tags: [Admin]
11725
+ summary: Time-bucketed usage series for one adoption/usage vertical (admin only)
11726
+ description: >
11727
+ Gap-filled counts (24h → hourly, 7d/30d/90d → daily, 365d → weekly)
11728
+ for one of 15 adoption/usage verticals, plus a period-over-period
11729
+ delta. Backs both the live admin analytics dashboard and the
11730
+ weekly investor report — same source, two surfaces.
11731
+ operationId: adminGrowthTimeseries
11732
+ parameters:
11733
+ - name: vertical
11734
+ in: query
11735
+ required: true
11736
+ schema:
11737
+ type: string
11738
+ enum:
11739
+ - signups_orgs
11740
+ - signups_users
11741
+ - subscriptions_new
11742
+ - subscriptions_churned
11743
+ - shroud_usage
11744
+ - shroud_security
11745
+ - intents_execution
11746
+ - intents_transactions
11747
+ - vault_usage
11748
+ - runtime_usage
11749
+ - memory_usage
11750
+ - automations
11751
+ - embedded_wallets_created
11752
+ - embedded_wallets_used
11753
+ - platform_api
11754
+ - name: period
11755
+ in: query
11756
+ schema:
11757
+ type: string
11758
+ enum: [24h, 7d, 30d, 90d, 365d]
11759
+ default: 30d
11760
+ responses:
11761
+ "200":
11762
+ description: Time-bucketed series for the requested vertical
11763
+ content:
11764
+ application/json:
11765
+ schema:
11766
+ $ref: "#/components/schemas/GrowthTimeseriesResponse"
11767
+ "400":
11768
+ $ref: "#/components/responses/BadRequest"
11769
+ "403":
11770
+ $ref: "#/components/responses/Forbidden"
11771
+
11772
+ /v1/admin/stats/retention:
11773
+ get:
11774
+ tags: [Admin]
11775
+ summary: Logo retention over a trailing window (admin only)
11776
+ description: >
11777
+ Percentage of organizations older than `window_days` that showed
11778
+ any platform activity (usage_events) in the trailing
11779
+ `window_days` — a simple, defensible retention proxy, not a full
11780
+ cohort matrix.
11781
+ operationId: adminRetention
11782
+ parameters:
11783
+ - name: window_days
11784
+ in: query
11785
+ schema:
11786
+ type: integer
11787
+ default: 30
11788
+ minimum: 1
11789
+ maximum: 365
11790
+ responses:
11791
+ "200":
11792
+ description: Retention over the requested window
11793
+ content:
11794
+ application/json:
11795
+ schema:
11796
+ $ref: "#/components/schemas/RetentionResponse"
11797
+ "403":
11798
+ $ref: "#/components/responses/Forbidden"
11799
+
11800
+ /v1/admin/llm-prices:
11801
+ get:
11802
+ tags: [Admin]
11803
+ summary: Global LLM price card (admin only)
11804
+ description: The platform-wide price card with no org-level overrides applied — see `/v1/spend/ai/prices` for the org-resolved view.
11805
+ operationId: adminListLlmPrices
11806
+ responses:
11807
+ "200":
11808
+ description: Prices
11809
+ content:
11810
+ application/json:
11811
+ schema:
11812
+ type: object
11813
+ required: [prices]
11814
+ properties:
11815
+ prices:
11816
+ type: array
11817
+ items:
11818
+ $ref: "#/components/schemas/LlmModelPrice"
11819
+ "403":
11820
+ $ref: "#/components/responses/Forbidden"
11821
+
11430
11822
  /v1/agents/{agent_id}/pay/settings:
11431
11823
  patch:
11432
11824
  tags: [Pay]
@@ -17696,6 +18088,47 @@ paths:
17696
18088
  description: Forbidden, or the plan does not include this
17697
18089
  '404':
17698
18090
  description: Not found
18091
+ /v1/tools/web-search:
18092
+ post:
18093
+ tags: [Agent Tools]
18094
+ summary: Platform-default web search fallback
18095
+ description: >
18096
+ Called on the agent's own token (not a Shroud-internal callback).
18097
+ Used by the runtime `web_search` tool when an agent has no
18098
+ BRAVE_API_KEY/TAVILY_API_KEY/SERP_API_KEY/ONECLAW_WEB_SEARCH_BINDING
18099
+ of its own — proxies to a shared, platform-provided Brave Search
18100
+ key under a hard monthly platform-wide cap.
18101
+ operationId: agentWebSearch
18102
+ requestBody:
18103
+ required: true
18104
+ content:
18105
+ application/json:
18106
+ schema:
18107
+ type: object
18108
+ required: [query]
18109
+ properties:
18110
+ query:
18111
+ type: string
18112
+ maxLength: 500
18113
+ num_results:
18114
+ type: integer
18115
+ default: 5
18116
+ responses:
18117
+ "200":
18118
+ description: Search results
18119
+ content:
18120
+ application/json:
18121
+ schema:
18122
+ $ref: "#/components/schemas/WebSearchResponse"
18123
+ "400":
18124
+ $ref: "#/components/responses/BadRequest"
18125
+ "403":
18126
+ description: Called on a non-agent token
18127
+ content:
18128
+ application/json:
18129
+ schema:
18130
+ $ref: "#/components/schemas/ProblemDetails"
18131
+
17699
18132
  /v1/memory/shared-namespaces:
17700
18133
  get:
17701
18134
  tags: [Memory]
@@ -23848,6 +24281,13 @@ components:
23848
24281
  if the org has one. Same field and meaning as on `POST /v1/agents`:
23849
24282
  the first call returns 202 with the approval to collect, and the
23850
24283
  retry passes its id here.
24284
+ guided:
24285
+ type: boolean
24286
+ default: false
24287
+ description: |
24288
+ Seeds `getting-started/**` instead of `examples/**` in the shared
24289
+ `default` vault — the guided onboarding wizard's own sample content,
24290
+ kept distinguishable from the MCP-connect developer flow's.
23851
24291
 
23852
24292
  OnboardingProvisionResponse:
23853
24293
  type: object
@@ -23866,6 +24306,75 @@ components:
23866
24306
  verify_prompt:
23867
24307
  type: string
23868
24308
 
24309
+ GuidedOnboardingStatus:
24310
+ allOf:
24311
+ - type: object
24312
+ required: [eligible]
24313
+ properties:
24314
+ eligible:
24315
+ type: boolean
24316
+ description: |
24317
+ Whether this org is in the guided-onboarding rollout cohort —
24318
+ decides whether the dashboard redirects a new user here or to
24319
+ the MCP-connect flow.
24320
+ - $ref: "#/components/schemas/OnboardingStatus"
24321
+
24322
+ GuidedAskRequest:
24323
+ type: object
24324
+ required: [question]
24325
+ properties:
24326
+ question:
24327
+ type: string
24328
+ maxLength: 500
24329
+ step:
24330
+ type: integer
24331
+ description: Accepted but not yet used to tailor the answer; reserved for later.
24332
+
24333
+ GuidedAskResponse:
24334
+ type: object
24335
+ required: [answer]
24336
+ properties:
24337
+ answer:
24338
+ type: string
24339
+
24340
+ TrialSetupIntentResponse:
24341
+ type: object
24342
+ required: [client_secret, publishable_key]
24343
+ properties:
24344
+ client_secret:
24345
+ type: string
24346
+ publishable_key:
24347
+ type: string
24348
+
24349
+ CreateTrialRuntimeRequest:
24350
+ type: object
24351
+ required: [setup_intent_id, agent_id, template, name]
24352
+ properties:
24353
+ setup_intent_id:
24354
+ type: string
24355
+ agent_id:
24356
+ type: string
24357
+ format: uuid
24358
+ template:
24359
+ type: string
24360
+ preset:
24361
+ type: string
24362
+ description: Defaults to CreateRuntimeRequest's own default ("small") when omitted.
24363
+ name:
24364
+ type: string
24365
+ always_on:
24366
+ type: boolean
24367
+ default: false
24368
+ description: |
24369
+ Keeps the runtime running indefinitely instead of auto-stopping after the
24370
+ default idle window (maps to `idle_timeout_secs: 0`).
24371
+ env_public:
24372
+ type: object
24373
+ description: |
24374
+ Non-secret runtime config — in practice just `LLM_PROVIDER`/`LLM_MODEL`
24375
+ from the guided flow's model-choice step. Rejected if any key looks
24376
+ secret-shaped (same `validate_env_public` the canonical runtime API uses).
24377
+
23869
24378
  AgentKeysVaultResponse:
23870
24379
  type: object
23871
24380
  properties:
@@ -28262,6 +28771,138 @@ components:
28262
28771
  format: uuid
28263
28772
  description: Control-plane approval when rolling back to a wider spec.
28264
28773
 
28774
+ LlmModelPrice:
28775
+ type: object
28776
+ required: [id, provider, model_pattern, input_micro_usd_per_mtok, output_micro_usd_per_mtok, source, updated_at]
28777
+ properties:
28778
+ id: { type: string, format: uuid }
28779
+ org_id:
28780
+ type: string
28781
+ format: uuid
28782
+ nullable: true
28783
+ description: Null for a global row.
28784
+ provider: { type: string }
28785
+ model_pattern: { type: string }
28786
+ input_micro_usd_per_mtok: { type: integer, format: int64 }
28787
+ output_micro_usd_per_mtok: { type: integer, format: int64 }
28788
+ source: { type: string }
28789
+ updated_at: { type: string, format: date-time }
28790
+ AiSpendTotals:
28791
+ type: object
28792
+ properties:
28793
+ cost_usd: { type: number }
28794
+ tokens_input: { type: integer, format: int64 }
28795
+ tokens_output: { type: integer, format: int64 }
28796
+ tokens: { type: integer, format: int64 }
28797
+ requests: { type: integer, format: int64 }
28798
+ blocked: { type: integer, format: int64 }
28799
+ unpriced_requests: { type: integer, format: int64 }
28800
+ agents: { type: integer, format: int64 }
28801
+ models: { type: integer, format: int64 }
28802
+ avg_cost_per_day: { type: number }
28803
+ cost_per_request: { type: number }
28804
+ cost_per_mtok: { type: number }
28805
+ AiSpend:
28806
+ type: object
28807
+ required: [window, totals, previous, series, by_provider, by_model, by_agent, limits, generated_at]
28808
+ properties:
28809
+ generated_at: { type: string, format: date-time }
28810
+ window:
28811
+ type: object
28812
+ properties:
28813
+ from: { type: string, format: date-time }
28814
+ to: { type: string, format: date-time }
28815
+ interval: { type: string }
28816
+ previous_from: { type: string, format: date-time }
28817
+ previous_to: { type: string, format: date-time }
28818
+ days: { type: number }
28819
+ totals:
28820
+ $ref: "#/components/schemas/AiSpendTotals"
28821
+ previous:
28822
+ $ref: "#/components/schemas/AiSpendTotals"
28823
+ series:
28824
+ type: array
28825
+ items:
28826
+ type: object
28827
+ properties:
28828
+ bucket: { type: string, format: date-time }
28829
+ provider: { type: string }
28830
+ cost_usd: { type: number }
28831
+ tokens: { type: integer, format: int64 }
28832
+ requests: { type: integer, format: int64 }
28833
+ by_provider:
28834
+ type: array
28835
+ items:
28836
+ type: object
28837
+ properties:
28838
+ provider: { type: string }
28839
+ cost_usd: { type: number }
28840
+ tokens: { type: integer, format: int64 }
28841
+ requests: { type: integer, format: int64 }
28842
+ previous_cost_usd: { type: number }
28843
+ share_pct: { type: number }
28844
+ trend_pct: { type: number, nullable: true }
28845
+ by_model:
28846
+ type: array
28847
+ items:
28848
+ type: object
28849
+ properties:
28850
+ provider: { type: string }
28851
+ model: { type: string }
28852
+ cost_usd: { type: number }
28853
+ tokens_input: { type: integer, format: int64 }
28854
+ tokens_output: { type: integer, format: int64 }
28855
+ requests: { type: integer, format: int64 }
28856
+ previous_cost_usd: { type: number }
28857
+ priced: { type: boolean }
28858
+ share_pct: { type: number }
28859
+ trend_pct: { type: number, nullable: true }
28860
+ by_agent:
28861
+ type: array
28862
+ items:
28863
+ type: object
28864
+ properties:
28865
+ agent_id: { type: string, format: uuid }
28866
+ agent_name: { type: string }
28867
+ is_active: { type: boolean }
28868
+ cost_usd: { type: number }
28869
+ tokens: { type: integer, format: int64 }
28870
+ requests: { type: integer, format: int64 }
28871
+ blocked: { type: integer, format: int64 }
28872
+ top_model: { type: string, nullable: true }
28873
+ top_provider: { type: string, nullable: true }
28874
+ previous_cost_usd: { type: number }
28875
+ last_request_at: { type: string, format: date-time, nullable: true }
28876
+ daily_budget_usd: { type: number, nullable: true }
28877
+ today_cost_usd: { type: number }
28878
+ blocked_by_budget: { type: integer, format: int64 }
28879
+ max_tokens_per_request: { type: integer, format: int64, nullable: true }
28880
+ max_requests_per_day: { type: integer, format: int64, nullable: true }
28881
+ share_pct: { type: number }
28882
+ trend_pct: { type: number, nullable: true }
28883
+ budget_used_pct: { type: number, nullable: true }
28884
+ limits:
28885
+ type: object
28886
+ properties:
28887
+ agents_with_daily_budget: { type: integer, format: int64 }
28888
+ agents_over_80pct: { type: integer, format: int64 }
28889
+ agents_at_cap: { type: integer, format: int64 }
28890
+ blocked_by_budget: { type: integer, format: int64 }
28891
+ router_keys:
28892
+ type: array
28893
+ items:
28894
+ type: object
28895
+ properties:
28896
+ key_id: { type: string, format: uuid }
28897
+ agent_id: { type: string, format: uuid }
28898
+ agent_name: { type: string }
28899
+ name: { type: string }
28900
+ spent_usd: { type: number }
28901
+ cap_usd: { type: number, nullable: true }
28902
+ last_used_at: { type: string, format: date-time, nullable: true }
28903
+ credit_balance_usd: { type: number }
28904
+ inspection_fees_usd: { type: number }
28905
+ billing_tier: { type: string }
28265
28906
  OrgOverview:
28266
28907
  type: object
28267
28908
  required: [generated_at, window_hours, inventory, activity, spend, health, trend]
@@ -31569,3 +32210,81 @@ components:
31569
32210
  properties:
31570
32211
  valid:
31571
32212
  type: boolean
32213
+
32214
+ GrowthCountBucket:
32215
+ type: object
32216
+ required: [bucket, count]
32217
+ properties:
32218
+ bucket:
32219
+ type: string
32220
+ format: date-time
32221
+ count:
32222
+ type: integer
32223
+
32224
+ GrowthTimeseriesResponse:
32225
+ type: object
32226
+ required: [vertical, period, bucket_unit, points, total, prior_total]
32227
+ properties:
32228
+ vertical:
32229
+ type: string
32230
+ period:
32231
+ type: string
32232
+ bucket_unit:
32233
+ type: string
32234
+ enum: [hour, day, week]
32235
+ points:
32236
+ type: array
32237
+ items:
32238
+ $ref: "#/components/schemas/GrowthCountBucket"
32239
+ total:
32240
+ type: integer
32241
+ prior_total:
32242
+ type: integer
32243
+ delta_pct:
32244
+ type: number
32245
+ nullable: true
32246
+ description: Null when both the current and prior totals are 0.
32247
+ notes:
32248
+ type: string
32249
+ nullable: true
32250
+ description: >
32251
+ A known limitation worth surfacing for this vertical (e.g.
32252
+ a source table with no org_id to exclude test-fixture
32253
+ activity from). Null for the clean verticals.
32254
+
32255
+ RetentionResponse:
32256
+ type: object
32257
+ required: [window_days, cohort_orgs, retained_orgs]
32258
+ properties:
32259
+ window_days:
32260
+ type: integer
32261
+ cohort_orgs:
32262
+ type: integer
32263
+ retained_orgs:
32264
+ type: integer
32265
+ retention_pct:
32266
+ type: number
32267
+ nullable: true
32268
+ description: Null when there is no cohort yet (platform younger than the window).
32269
+
32270
+ WebSearchResult:
32271
+ type: object
32272
+ required: [title, url, snippet]
32273
+ properties:
32274
+ title:
32275
+ type: string
32276
+ url:
32277
+ type: string
32278
+ snippet:
32279
+ type: string
32280
+
32281
+ WebSearchResponse:
32282
+ type: object
32283
+ required: [results, provider]
32284
+ properties:
32285
+ results:
32286
+ type: array
32287
+ items:
32288
+ $ref: "#/components/schemas/WebSearchResult"
32289
+ provider:
32290
+ type: string