@1claw/openapi-spec 0.61.29 → 0.61.34

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 +600 -5
  2. package/openapi.yaml +365 -1
  3. package/package.json +1 -1
package/openapi.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "openapi": "3.1.0",
3
3
  "info": {
4
4
  "title": "1Claw API",
5
- "version": "0.61.29",
5
+ "version": "0.61.34",
6
6
  "description": "Secure secret management for AI agents. Provides vaults, secrets,\npolicy-based access control, agent identity, Intents API,\nsharing, billing, and audit logging. Automations (workflow_spec,\nwebhook tokens, event triggers, Assist), cloud runtimes with\ninteractive shell sessions, agent memory, and discovery.\n\n## Domains\n\n`api.1claw.co` is canonical: it is the OIDC issuer, the `aud` the API\nmints, and the first entry in `servers` — a generated client takes its\nbase URL from there, and the previous ordering pointed every SDK at the\ndomain the issuer had already left. `api.1claw.xyz` still answers and is\nstill accepted on token validation, because tokens minted before the\nmove carry it; it is never minted now.\n\nOne deliberate exception: the Shroud attestation identity token is\nrequested from GCP with `audience: https://api.1claw.xyz`, so\n`/v1/shroud/attestation` reports that as its `expected_audience`. That\nis accurate rather than stale — the audience is a verification contract\nwith anyone already checking the token, and moving it is a breaking\nchange for them, not a rename.\n\nAll endpoints require JWT Bearer authentication unless marked with\n`security: []`.\n",
7
7
  "contact": {
8
8
  "email": "ops@1claw.co"
@@ -277,7 +277,7 @@
277
277
  "Authentication"
278
278
  ],
279
279
  "summary": "Exchange agent credentials for JWT",
280
- "description": "Returns a short-lived EdDSA-signed JWT (`access_token`). Standard claims include `sub`\n(`agent:<uuid>`), `org`, `scopes`, `vault_ids`, optional `intents_api_enabled`, optional\n`shroud_enabled`, optional `llm_token_billing` / `stripe_customer_id` when org LLM billing is on.\n\nWhen **`shroud_enabled`** is true, the JWT payload may include **`shroud_config`**: a JSON object\nmirroring the agent row in Vault (same shape as `ShroudConfig` on `GET /v1/agents/{id}`).\n**Shroud** (TEE proxy) decodes this on each LLM request and runs **PolicyEngine** after the\nglobal inspection pipeline so per-agent limits and threat **block** actions apply without a\nseparate policy fetch. Re-exchange the agent token after changing `shroud_config` so the JWT\nis fresh.\n\nUser JWTs from password, API key, or device flow do **not** include `shroud_config`.\n",
280
+ "description": "Returns a short-lived EdDSA-signed JWT (`access_token`). Standard claims include `sub`\n(`agent:<uuid>`), `org`, `scopes`, `vault_ids`, optional `intents_api_enabled`, optional\n`shroud_enabled`, optional `llm_token_billing` / `stripe_customer_id` when org LLM billing is on.\n\nWhen **`shroud_enabled`** is true, the JWT payload may include **`shroud_config`**: a JSON object\nmirroring the agent row in Vault (same shape as `ShroudConfig` on `GET /v1/agents/{id}`).\n**Shroud** (TEE proxy) decodes this on each LLM request and runs **PolicyEngine** after the\nglobal inspection pipeline so per-agent limits and threat **block** actions apply without a\nseparate policy fetch. Re-exchange the agent token after changing `shroud_config` so the JWT\nis fresh.\n\nUser JWTs from password, API key, or device flow do **not** include `shroud_config`.\n\n**Router keys.** An `sk-shroud-v1-…` key (minted at\n`POST /v1/agents/{agent_id}/router-keys`) is exchanged key-only — send `api_key`\nalone, no `agent_id`. The token carries a `router_key` claim\n(`{id, max_concurrent_streams?, spend_cap_micro_usd?}`), lives at most **60 s**\n(revocation SLA), and is only issued for Shroud-enabled agents. Revoked keys get 401.\n",
281
281
  "operationId": "agentToken",
282
282
  "security": [],
283
283
  "requestBody": {
@@ -17221,6 +17221,75 @@
17221
17221
  }
17222
17222
  }
17223
17223
  },
17224
+ "/v1/x402/topup": {
17225
+ "post": {
17226
+ "tags": [
17227
+ "Billing"
17228
+ ],
17229
+ "summary": "x402 ledger top-up (agent door)",
17230
+ "description": "The wallet rail for Shroud (Shroud AI plan). Without `X-PAYMENT` the response is a\n**402** quote (`x402Version`, `accepts[]` with `payTo`, `maxAmountRequired`, `resource`)\nfor `amount_usd` (default $1) of USDC on Base. With a signed EIP-3009 `X-PAYMENT`\nthe facilitator verifies it, the proof is claimed once, the payer wallet's org\nledger is credited in micro-USD, and the facilitator settles.\n\n**Payment is the account.** An unknown wallet's first settled top-up provisions a\nshadow org, one Shroud-enabled agent and one `sk-shroud-v1` router key keyed on the\nwallet (returned once as `router_key`), after screening the wallet against the OFAC\nSDN list (fails closed when the list is missing or stale) and the caller's region\nagainst the custody geofence. Same wallet = same org on every later top-up. The\nresponse always carries a ≤60 s `access_token` for the wallet's agent so the\ngateway can serve the paid request immediately. The Shroud gateway drives this for\n`Authorization: Bearer x402` requests and relays the quote or the result.\n",
17231
+ "operationId": "x402Topup",
17232
+ "security": [],
17233
+ "parameters": [
17234
+ {
17235
+ "name": "X-PAYMENT",
17236
+ "in": "header",
17237
+ "required": false,
17238
+ "schema": {
17239
+ "type": "string"
17240
+ },
17241
+ "description": "Base64 x402 payment payload (EIP-3009 USDC authorization on Base)"
17242
+ }
17243
+ ],
17244
+ "requestBody": {
17245
+ "required": false,
17246
+ "content": {
17247
+ "application/json": {
17248
+ "schema": {
17249
+ "type": "object",
17250
+ "additionalProperties": false,
17251
+ "properties": {
17252
+ "amount_usd": {
17253
+ "type": "integer",
17254
+ "minimum": 1,
17255
+ "maximum": 100,
17256
+ "description": "Whole dollars to add to the ledger (default 1)"
17257
+ }
17258
+ }
17259
+ }
17260
+ }
17261
+ }
17262
+ },
17263
+ "responses": {
17264
+ "200": {
17265
+ "description": "Credited",
17266
+ "content": {
17267
+ "application/json": {
17268
+ "schema": {
17269
+ "$ref": "#/components/schemas/X402TopupResponse"
17270
+ }
17271
+ }
17272
+ }
17273
+ },
17274
+ "402": {
17275
+ "description": "Payment required — the quote to sign, or why the payment was refused",
17276
+ "content": {
17277
+ "application/json": {
17278
+ "schema": {
17279
+ "$ref": "#/components/schemas/PaymentRequirement"
17280
+ }
17281
+ }
17282
+ }
17283
+ },
17284
+ "403": {
17285
+ "description": "The wallet is sanctioned or the region is fenced; no account is opened"
17286
+ },
17287
+ "503": {
17288
+ "description": "The sanctions list is unavailable (fails closed)"
17289
+ }
17290
+ }
17291
+ }
17292
+ },
17224
17293
  "/v1/oauth/token": {
17225
17294
  "post": {
17226
17295
  "tags": [
@@ -23741,6 +23810,260 @@
23741
23810
  }
23742
23811
  }
23743
23812
  },
23813
+ "/v1/agents/{agent_id}/router-keys": {
23814
+ "post": {
23815
+ "tags": [
23816
+ "Agents"
23817
+ ],
23818
+ "summary": "Mint a router key (sk-shroud-v1)",
23819
+ "description": "Creates an `sk-shroud-v1-<32>` static Bearer for the Shroud gateway, mapped to this\nagent. A stock OpenAI or Anthropic SDK sends it as `Authorization: Bearer …` with\n`base_url` set to the gateway; the gateway exchanges it key-only for the agent's\ntoken. The plaintext key is returned **once**. Up to 20 live keys per agent.\nHuman users only; the agent must have `shroud_enabled: true`.\n",
23820
+ "operationId": "createRouterKey",
23821
+ "parameters": [
23822
+ {
23823
+ "$ref": "#/components/parameters/AgentId"
23824
+ }
23825
+ ],
23826
+ "requestBody": {
23827
+ "required": false,
23828
+ "content": {
23829
+ "application/json": {
23830
+ "schema": {
23831
+ "$ref": "#/components/schemas/CreateRouterKeyRequest"
23832
+ }
23833
+ }
23834
+ }
23835
+ },
23836
+ "responses": {
23837
+ "201": {
23838
+ "description": "Router key created (plaintext returned once)",
23839
+ "content": {
23840
+ "application/json": {
23841
+ "schema": {
23842
+ "$ref": "#/components/schemas/RouterKeyCreated"
23843
+ }
23844
+ }
23845
+ }
23846
+ },
23847
+ "400": {
23848
+ "$ref": "#/components/responses/BadRequest"
23849
+ },
23850
+ "403": {
23851
+ "$ref": "#/components/responses/Forbidden"
23852
+ },
23853
+ "404": {
23854
+ "$ref": "#/components/responses/NotFound"
23855
+ }
23856
+ }
23857
+ },
23858
+ "get": {
23859
+ "tags": [
23860
+ "Agents"
23861
+ ],
23862
+ "summary": "List router keys",
23863
+ "description": "Every router key of the agent, live and revoked, without secrets.",
23864
+ "operationId": "listRouterKeys",
23865
+ "parameters": [
23866
+ {
23867
+ "$ref": "#/components/parameters/AgentId"
23868
+ }
23869
+ ],
23870
+ "responses": {
23871
+ "200": {
23872
+ "description": "Router keys",
23873
+ "content": {
23874
+ "application/json": {
23875
+ "schema": {
23876
+ "type": "object",
23877
+ "required": [
23878
+ "keys"
23879
+ ],
23880
+ "properties": {
23881
+ "keys": {
23882
+ "type": "array",
23883
+ "items": {
23884
+ "$ref": "#/components/schemas/RouterKey"
23885
+ }
23886
+ }
23887
+ }
23888
+ }
23889
+ }
23890
+ }
23891
+ },
23892
+ "403": {
23893
+ "$ref": "#/components/responses/Forbidden"
23894
+ },
23895
+ "404": {
23896
+ "$ref": "#/components/responses/NotFound"
23897
+ }
23898
+ }
23899
+ }
23900
+ },
23901
+ "/v1/agents/{agent_id}/router-keys/{key_id}": {
23902
+ "delete": {
23903
+ "tags": [
23904
+ "Agents"
23905
+ ],
23906
+ "summary": "Revoke a router key",
23907
+ "description": "Revokes the key. The gateway stops accepting it within 60 s (router-key tokens\nlive at most that long and the gateway re-exchanges on expiry). Idempotent.\nHuman users only.\n",
23908
+ "operationId": "revokeRouterKey",
23909
+ "parameters": [
23910
+ {
23911
+ "$ref": "#/components/parameters/AgentId"
23912
+ },
23913
+ {
23914
+ "name": "key_id",
23915
+ "in": "path",
23916
+ "required": true,
23917
+ "schema": {
23918
+ "type": "string",
23919
+ "format": "uuid"
23920
+ }
23921
+ }
23922
+ ],
23923
+ "responses": {
23924
+ "200": {
23925
+ "description": "Revoked",
23926
+ "content": {
23927
+ "application/json": {
23928
+ "schema": {
23929
+ "$ref": "#/components/schemas/RouterKey"
23930
+ }
23931
+ }
23932
+ }
23933
+ },
23934
+ "403": {
23935
+ "$ref": "#/components/responses/Forbidden"
23936
+ },
23937
+ "404": {
23938
+ "$ref": "#/components/responses/NotFound"
23939
+ }
23940
+ }
23941
+ }
23942
+ },
23943
+ "/v1/agents/{agent_id}/tool-bindings": {
23944
+ "post": {
23945
+ "tags": [
23946
+ "Agents"
23947
+ ],
23948
+ "summary": "Create a secret → tool binding (rehydration policy)",
23949
+ "description": "Authorises the enclave to rehydrate the `⟦sk:…⟧` placeholder for `secret_path`\ninto `tool_name` at `arg_path` — and only when the call's destination host is one\nof `destination_hosts`. Redaction replaces vault secrets in prompts with\ndeterministic placeholders the model can place but never read; a placeholder is\nsubstituted back only inside an authorised tool-call argument, at the moment the\nenclave performs the call (`execution_mode: \"tee\"`). No binding, wrong argument,\nwrong host, bad checksum or an unknown tag is a 403 at execution time. Human users\nonly; up to 200 per agent.\n",
23950
+ "operationId": "createToolBinding",
23951
+ "parameters": [
23952
+ {
23953
+ "$ref": "#/components/parameters/AgentId"
23954
+ }
23955
+ ],
23956
+ "requestBody": {
23957
+ "required": true,
23958
+ "content": {
23959
+ "application/json": {
23960
+ "schema": {
23961
+ "$ref": "#/components/schemas/CreateToolBindingRequest"
23962
+ }
23963
+ }
23964
+ }
23965
+ },
23966
+ "responses": {
23967
+ "201": {
23968
+ "description": "Created",
23969
+ "content": {
23970
+ "application/json": {
23971
+ "schema": {
23972
+ "$ref": "#/components/schemas/SecretToolBinding"
23973
+ }
23974
+ }
23975
+ }
23976
+ },
23977
+ "400": {
23978
+ "$ref": "#/components/responses/BadRequest"
23979
+ },
23980
+ "403": {
23981
+ "$ref": "#/components/responses/Forbidden"
23982
+ },
23983
+ "404": {
23984
+ "$ref": "#/components/responses/NotFound"
23985
+ },
23986
+ "409": {
23987
+ "description": "A binding for this secret, tool and argument already exists"
23988
+ }
23989
+ }
23990
+ },
23991
+ "get": {
23992
+ "tags": [
23993
+ "Agents"
23994
+ ],
23995
+ "summary": "List secret → tool bindings",
23996
+ "operationId": "listToolBindings",
23997
+ "parameters": [
23998
+ {
23999
+ "$ref": "#/components/parameters/AgentId"
24000
+ }
24001
+ ],
24002
+ "responses": {
24003
+ "200": {
24004
+ "description": "Bindings",
24005
+ "content": {
24006
+ "application/json": {
24007
+ "schema": {
24008
+ "type": "object",
24009
+ "required": [
24010
+ "bindings"
24011
+ ],
24012
+ "properties": {
24013
+ "bindings": {
24014
+ "type": "array",
24015
+ "items": {
24016
+ "$ref": "#/components/schemas/SecretToolBinding"
24017
+ }
24018
+ }
24019
+ }
24020
+ }
24021
+ }
24022
+ }
24023
+ },
24024
+ "403": {
24025
+ "$ref": "#/components/responses/Forbidden"
24026
+ },
24027
+ "404": {
24028
+ "$ref": "#/components/responses/NotFound"
24029
+ }
24030
+ }
24031
+ }
24032
+ },
24033
+ "/v1/agents/{agent_id}/tool-bindings/{binding_id}": {
24034
+ "delete": {
24035
+ "tags": [
24036
+ "Agents"
24037
+ ],
24038
+ "summary": "Delete a secret → tool binding",
24039
+ "operationId": "deleteToolBinding",
24040
+ "parameters": [
24041
+ {
24042
+ "$ref": "#/components/parameters/AgentId"
24043
+ },
24044
+ {
24045
+ "name": "binding_id",
24046
+ "in": "path",
24047
+ "required": true,
24048
+ "schema": {
24049
+ "type": "string",
24050
+ "format": "uuid"
24051
+ }
24052
+ }
24053
+ ],
24054
+ "responses": {
24055
+ "204": {
24056
+ "description": "Deleted"
24057
+ },
24058
+ "403": {
24059
+ "$ref": "#/components/responses/Forbidden"
24060
+ },
24061
+ "404": {
24062
+ "$ref": "#/components/responses/NotFound"
24063
+ }
24064
+ }
24065
+ }
24066
+ },
23744
24067
  "/v1/agents/{agent_id}/oauth/connections": {
23745
24068
  "get": {
23746
24069
  "tags": [
@@ -33768,6 +34091,26 @@
33768
34091
  "minimum": 0,
33769
34092
  "maximum": 365,
33770
34093
  "description": "Number of days to retain flagged request bodies for replay/investigation"
34094
+ },
34095
+ "streaming_inspection_mode": {
34096
+ "type": "string",
34097
+ "enum": [
34098
+ "rolling",
34099
+ "holdback"
34100
+ ],
34101
+ "description": "How streamed LLM responses are inspected before release. `rolling` (default) releases text behind a tail buffer at least as long as the org's longest vault secret (capped at 256 bytes; longer secrets are matched by prefix); `holdback` buffers `streaming_holdback_chars` for full parity with buffered inspection. Tool-call deltas are always held until the call is complete."
34102
+ },
34103
+ "streaming_holdback_chars": {
34104
+ "type": "integer",
34105
+ "minimum": 64,
34106
+ "maximum": 65536,
34107
+ "description": "Characters held back per stream in holdback mode (default 512)"
34108
+ },
34109
+ "max_concurrent_streams": {
34110
+ "type": "integer",
34111
+ "minimum": 1,
34112
+ "maximum": 1000,
34113
+ "description": "Open streaming responses allowed per agent key (default 20; 429 with Retry-After beyond it)"
33771
34114
  }
33772
34115
  }
33773
34116
  },
@@ -35940,7 +36283,13 @@
35940
36283
  "type": "string"
35941
36284
  },
35942
36285
  "credit_balance_cents": {
35943
- "type": "integer"
36286
+ "type": "integer",
36287
+ "description": "Derived (rounded down); the ledger unit is micro-USD"
36288
+ },
36289
+ "credit_balance_micro_usd": {
36290
+ "type": "integer",
36291
+ "format": "int64",
36292
+ "description": "The ledger value. One inspected Shroud request costs 5,000 micro-USD ($0.005)."
35944
36293
  },
35945
36294
  "credit_balance_usd": {
35946
36295
  "type": "string"
@@ -36163,10 +36512,17 @@
36163
36512
  "type": "object",
36164
36513
  "properties": {
36165
36514
  "balance_cents": {
36166
- "type": "integer"
36515
+ "type": "integer",
36516
+ "description": "Derived (rounded down); the ledger unit is micro-USD"
36517
+ },
36518
+ "balance_micro_usd": {
36519
+ "type": "integer",
36520
+ "format": "int64",
36521
+ "description": "The ledger value (1 = $0.000001)"
36167
36522
  },
36168
36523
  "balance_usd": {
36169
- "type": "string"
36524
+ "type": "string",
36525
+ "description": "Dollars at the ledger's precision (e.g. \"4.995\"), never fewer than two decimals"
36170
36526
  },
36171
36527
  "expiring_within_90_days": {
36172
36528
  "type": "object",
@@ -39788,6 +40144,245 @@
39788
40144
  }
39789
40145
  }
39790
40146
  },
40147
+ "CreateRouterKeyRequest": {
40148
+ "type": "object",
40149
+ "additionalProperties": false,
40150
+ "properties": {
40151
+ "name": {
40152
+ "type": "string",
40153
+ "maxLength": 64,
40154
+ "description": "Shown in lists; defaults to `default`"
40155
+ },
40156
+ "max_concurrent_streams": {
40157
+ "type": "integer",
40158
+ "minimum": 1,
40159
+ "maximum": 1000,
40160
+ "description": "Open streaming responses this key may hold at once (gateway default 20)"
40161
+ },
40162
+ "spend_cap_usd": {
40163
+ "type": "number",
40164
+ "minimum": 0,
40165
+ "description": "Optional spend cap in USD, metered by the gateway"
40166
+ }
40167
+ }
40168
+ },
40169
+ "RouterKey": {
40170
+ "type": "object",
40171
+ "required": [
40172
+ "id",
40173
+ "agent_id",
40174
+ "name",
40175
+ "key_prefix",
40176
+ "created_at"
40177
+ ],
40178
+ "properties": {
40179
+ "id": {
40180
+ "type": "string",
40181
+ "format": "uuid"
40182
+ },
40183
+ "agent_id": {
40184
+ "type": "string",
40185
+ "format": "uuid"
40186
+ },
40187
+ "name": {
40188
+ "type": "string"
40189
+ },
40190
+ "key_prefix": {
40191
+ "type": "string",
40192
+ "description": "First 20 characters (`sk-shroud-v1-` + 7) — enough to recognise, not to use"
40193
+ },
40194
+ "max_concurrent_streams": {
40195
+ "type": "integer",
40196
+ "nullable": true
40197
+ },
40198
+ "spend_cap_usd": {
40199
+ "type": "number",
40200
+ "nullable": true
40201
+ },
40202
+ "created_at": {
40203
+ "type": "string",
40204
+ "format": "date-time"
40205
+ },
40206
+ "last_used_at": {
40207
+ "type": "string",
40208
+ "format": "date-time",
40209
+ "nullable": true
40210
+ },
40211
+ "revoked_at": {
40212
+ "type": "string",
40213
+ "format": "date-time",
40214
+ "nullable": true
40215
+ }
40216
+ }
40217
+ },
40218
+ "RouterKeyCreated": {
40219
+ "allOf": [
40220
+ {
40221
+ "$ref": "#/components/schemas/RouterKey"
40222
+ },
40223
+ {
40224
+ "type": "object",
40225
+ "required": [
40226
+ "router_key",
40227
+ "base_url"
40228
+ ],
40229
+ "properties": {
40230
+ "router_key": {
40231
+ "type": "string",
40232
+ "description": "The plaintext `sk-shroud-v1-…` key. Returned once.",
40233
+ "example": "sk-shroud-v1-Q2c5o0yQ3bHkT9m1vXz8Lw7nRp4aEf6u"
40234
+ },
40235
+ "base_url": {
40236
+ "type": "string",
40237
+ "description": "The Shroud gateway to point the SDK at",
40238
+ "example": "https://shroud.1claw.co"
40239
+ }
40240
+ }
40241
+ }
40242
+ ]
40243
+ },
40244
+ "CreateToolBindingRequest": {
40245
+ "type": "object",
40246
+ "additionalProperties": false,
40247
+ "required": [
40248
+ "secret_path",
40249
+ "tool_name",
40250
+ "destination_hosts"
40251
+ ],
40252
+ "properties": {
40253
+ "secret_path": {
40254
+ "type": "string",
40255
+ "description": "Vault path of the secret the placeholder stands for"
40256
+ },
40257
+ "tool_name": {
40258
+ "type": "string",
40259
+ "description": "Tool the binding applies to (`http_request`, `run_sql`, …) or `*`"
40260
+ },
40261
+ "arg_path": {
40262
+ "type": "string",
40263
+ "description": "JSON pointer into the tool's arguments (`/headers/Authorization`, `/body/*`) or `*` (default)"
40264
+ },
40265
+ "destination_hosts": {
40266
+ "type": "array",
40267
+ "minItems": 1,
40268
+ "maxItems": 32,
40269
+ "items": {
40270
+ "type": "string"
40271
+ },
40272
+ "description": "Hosts the rehydrated call may reach (`api.stripe.com`, `*.googleapis.com`); required"
40273
+ }
40274
+ }
40275
+ },
40276
+ "SecretToolBinding": {
40277
+ "type": "object",
40278
+ "required": [
40279
+ "id",
40280
+ "org_id",
40281
+ "agent_id",
40282
+ "secret_path",
40283
+ "tool_name",
40284
+ "arg_path",
40285
+ "destination_hosts",
40286
+ "created_at"
40287
+ ],
40288
+ "properties": {
40289
+ "id": {
40290
+ "type": "string",
40291
+ "format": "uuid"
40292
+ },
40293
+ "org_id": {
40294
+ "type": "string",
40295
+ "format": "uuid"
40296
+ },
40297
+ "agent_id": {
40298
+ "type": "string",
40299
+ "format": "uuid"
40300
+ },
40301
+ "secret_path": {
40302
+ "type": "string"
40303
+ },
40304
+ "tool_name": {
40305
+ "type": "string"
40306
+ },
40307
+ "arg_path": {
40308
+ "type": "string"
40309
+ },
40310
+ "destination_hosts": {
40311
+ "type": "array",
40312
+ "items": {
40313
+ "type": "string"
40314
+ }
40315
+ },
40316
+ "created_by": {
40317
+ "type": "string",
40318
+ "format": "uuid",
40319
+ "nullable": true
40320
+ },
40321
+ "created_at": {
40322
+ "type": "string",
40323
+ "format": "date-time"
40324
+ }
40325
+ }
40326
+ },
40327
+ "X402TopupResponse": {
40328
+ "type": "object",
40329
+ "required": [
40330
+ "wallet",
40331
+ "org_id",
40332
+ "agent_id",
40333
+ "credited_micro_usd",
40334
+ "balance_micro_usd",
40335
+ "balance_usd",
40336
+ "access_token",
40337
+ "expires_in",
40338
+ "base_url",
40339
+ "provisioned"
40340
+ ],
40341
+ "properties": {
40342
+ "wallet": {
40343
+ "type": "string",
40344
+ "description": "Payer address (lower-case)"
40345
+ },
40346
+ "org_id": {
40347
+ "type": "string",
40348
+ "format": "uuid"
40349
+ },
40350
+ "agent_id": {
40351
+ "type": "string",
40352
+ "format": "uuid"
40353
+ },
40354
+ "credited_micro_usd": {
40355
+ "type": "integer",
40356
+ "format": "int64"
40357
+ },
40358
+ "balance_micro_usd": {
40359
+ "type": "integer",
40360
+ "format": "int64"
40361
+ },
40362
+ "balance_usd": {
40363
+ "type": "string"
40364
+ },
40365
+ "router_key": {
40366
+ "type": "string",
40367
+ "description": "Present only on the top-up that provisioned the account (or re-minted a lost key). Shown once."
40368
+ },
40369
+ "access_token": {
40370
+ "type": "string",
40371
+ "description": "A ≤60 s agent token for the wallet's agent (carries the `router_key` claim)"
40372
+ },
40373
+ "expires_in": {
40374
+ "type": "integer"
40375
+ },
40376
+ "base_url": {
40377
+ "type": "string",
40378
+ "description": "The Shroud gateway"
40379
+ },
40380
+ "provisioned": {
40381
+ "type": "boolean",
40382
+ "description": "True when this top-up created the account"
40383
+ }
40384
+ }
40385
+ },
39791
40386
  "EventSubscription": {
39792
40387
  "type": "object",
39793
40388
  "required": [
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.29"
5
+ version: "0.61.34"
6
6
  description: |
7
7
  Secure secret management for AI agents. Provides vaults, secrets,
8
8
  policy-based access control, agent identity, Intents API,
@@ -198,6 +198,12 @@ paths:
198
198
  is fresh.
199
199
 
200
200
  User JWTs from password, API key, or device flow do **not** include `shroud_config`.
201
+
202
+ **Router keys.** An `sk-shroud-v1-…` key (minted at
203
+ `POST /v1/agents/{agent_id}/router-keys`) is exchanged key-only — send `api_key`
204
+ alone, no `agent_id`. The token carries a `router_key` claim
205
+ (`{id, max_concurrent_streams?, spend_cap_micro_usd?}`), lives at most **60 s**
206
+ (revocation SLA), and is only issued for Shroud-enabled agents. Revoked keys get 401.
201
207
  operationId: agentToken
202
208
  security: []
203
209
  requestBody:
@@ -10950,6 +10956,64 @@ paths:
10950
10956
  "400":
10951
10957
  description: Invalid request
10952
10958
 
10959
+ /v1/x402/topup:
10960
+ post:
10961
+ tags: [Billing]
10962
+ summary: x402 ledger top-up (agent door)
10963
+ description: |
10964
+ The wallet rail for Shroud (Shroud AI plan). Without `X-PAYMENT` the response is a
10965
+ **402** quote (`x402Version`, `accepts[]` with `payTo`, `maxAmountRequired`, `resource`)
10966
+ for `amount_usd` (default $1) of USDC on Base. With a signed EIP-3009 `X-PAYMENT`
10967
+ the facilitator verifies it, the proof is claimed once, the payer wallet's org
10968
+ ledger is credited in micro-USD, and the facilitator settles.
10969
+
10970
+ **Payment is the account.** An unknown wallet's first settled top-up provisions a
10971
+ shadow org, one Shroud-enabled agent and one `sk-shroud-v1` router key keyed on the
10972
+ wallet (returned once as `router_key`), after screening the wallet against the OFAC
10973
+ SDN list (fails closed when the list is missing or stale) and the caller's region
10974
+ against the custody geofence. Same wallet = same org on every later top-up. The
10975
+ response always carries a ≤60 s `access_token` for the wallet's agent so the
10976
+ gateway can serve the paid request immediately. The Shroud gateway drives this for
10977
+ `Authorization: Bearer x402` requests and relays the quote or the result.
10978
+ operationId: x402Topup
10979
+ security: []
10980
+ parameters:
10981
+ - name: X-PAYMENT
10982
+ in: header
10983
+ required: false
10984
+ schema: { type: string }
10985
+ description: Base64 x402 payment payload (EIP-3009 USDC authorization on Base)
10986
+ requestBody:
10987
+ required: false
10988
+ content:
10989
+ application/json:
10990
+ schema:
10991
+ type: object
10992
+ additionalProperties: false
10993
+ properties:
10994
+ amount_usd:
10995
+ type: integer
10996
+ minimum: 1
10997
+ maximum: 100
10998
+ description: Whole dollars to add to the ledger (default 1)
10999
+ responses:
11000
+ "200":
11001
+ description: Credited
11002
+ content:
11003
+ application/json:
11004
+ schema:
11005
+ $ref: "#/components/schemas/X402TopupResponse"
11006
+ "402":
11007
+ description: Payment required — the quote to sign, or why the payment was refused
11008
+ content:
11009
+ application/json:
11010
+ schema:
11011
+ $ref: "#/components/schemas/PaymentRequirement"
11012
+ "403":
11013
+ description: The wallet is sanctioned or the region is fenced; no account is opened
11014
+ "503":
11015
+ description: The sanctions list is unavailable (fails closed)
11016
+
10953
11017
  /v1/oauth/token:
10954
11018
  post:
10955
11019
  tags: [OAuth]
@@ -15180,6 +15244,170 @@ paths:
15180
15244
  "404":
15181
15245
  $ref: "#/components/responses/NotFound"
15182
15246
 
15247
+ /v1/agents/{agent_id}/router-keys:
15248
+ post:
15249
+ tags: [Agents]
15250
+ summary: Mint a router key (sk-shroud-v1)
15251
+ description: |
15252
+ Creates an `sk-shroud-v1-<32>` static Bearer for the Shroud gateway, mapped to this
15253
+ agent. A stock OpenAI or Anthropic SDK sends it as `Authorization: Bearer …` with
15254
+ `base_url` set to the gateway; the gateway exchanges it key-only for the agent's
15255
+ token. The plaintext key is returned **once**. Up to 20 live keys per agent.
15256
+ Human users only; the agent must have `shroud_enabled: true`.
15257
+ operationId: createRouterKey
15258
+ parameters:
15259
+ - $ref: "#/components/parameters/AgentId"
15260
+ requestBody:
15261
+ required: false
15262
+ content:
15263
+ application/json:
15264
+ schema:
15265
+ $ref: "#/components/schemas/CreateRouterKeyRequest"
15266
+ responses:
15267
+ "201":
15268
+ description: Router key created (plaintext returned once)
15269
+ content:
15270
+ application/json:
15271
+ schema:
15272
+ $ref: "#/components/schemas/RouterKeyCreated"
15273
+ "400":
15274
+ $ref: "#/components/responses/BadRequest"
15275
+ "403":
15276
+ $ref: "#/components/responses/Forbidden"
15277
+ "404":
15278
+ $ref: "#/components/responses/NotFound"
15279
+ get:
15280
+ tags: [Agents]
15281
+ summary: List router keys
15282
+ description: Every router key of the agent, live and revoked, without secrets.
15283
+ operationId: listRouterKeys
15284
+ parameters:
15285
+ - $ref: "#/components/parameters/AgentId"
15286
+ responses:
15287
+ "200":
15288
+ description: Router keys
15289
+ content:
15290
+ application/json:
15291
+ schema:
15292
+ type: object
15293
+ required: [keys]
15294
+ properties:
15295
+ keys:
15296
+ type: array
15297
+ items:
15298
+ $ref: "#/components/schemas/RouterKey"
15299
+ "403":
15300
+ $ref: "#/components/responses/Forbidden"
15301
+ "404":
15302
+ $ref: "#/components/responses/NotFound"
15303
+
15304
+ /v1/agents/{agent_id}/router-keys/{key_id}:
15305
+ delete:
15306
+ tags: [Agents]
15307
+ summary: Revoke a router key
15308
+ description: |
15309
+ Revokes the key. The gateway stops accepting it within 60 s (router-key tokens
15310
+ live at most that long and the gateway re-exchanges on expiry). Idempotent.
15311
+ Human users only.
15312
+ operationId: revokeRouterKey
15313
+ parameters:
15314
+ - $ref: "#/components/parameters/AgentId"
15315
+ - name: key_id
15316
+ in: path
15317
+ required: true
15318
+ schema: { type: string, format: uuid }
15319
+ responses:
15320
+ "200":
15321
+ description: Revoked
15322
+ content:
15323
+ application/json:
15324
+ schema:
15325
+ $ref: "#/components/schemas/RouterKey"
15326
+ "403":
15327
+ $ref: "#/components/responses/Forbidden"
15328
+ "404":
15329
+ $ref: "#/components/responses/NotFound"
15330
+
15331
+ /v1/agents/{agent_id}/tool-bindings:
15332
+ post:
15333
+ tags: [Agents]
15334
+ summary: Create a secret → tool binding (rehydration policy)
15335
+ description: |
15336
+ Authorises the enclave to rehydrate the `⟦sk:…⟧` placeholder for `secret_path`
15337
+ into `tool_name` at `arg_path` — and only when the call's destination host is one
15338
+ of `destination_hosts`. Redaction replaces vault secrets in prompts with
15339
+ deterministic placeholders the model can place but never read; a placeholder is
15340
+ substituted back only inside an authorised tool-call argument, at the moment the
15341
+ enclave performs the call (`execution_mode: "tee"`). No binding, wrong argument,
15342
+ wrong host, bad checksum or an unknown tag is a 403 at execution time. Human users
15343
+ only; up to 200 per agent.
15344
+ operationId: createToolBinding
15345
+ parameters:
15346
+ - $ref: "#/components/parameters/AgentId"
15347
+ requestBody:
15348
+ required: true
15349
+ content:
15350
+ application/json:
15351
+ schema:
15352
+ $ref: "#/components/schemas/CreateToolBindingRequest"
15353
+ responses:
15354
+ "201":
15355
+ description: Created
15356
+ content:
15357
+ application/json:
15358
+ schema:
15359
+ $ref: "#/components/schemas/SecretToolBinding"
15360
+ "400":
15361
+ $ref: "#/components/responses/BadRequest"
15362
+ "403":
15363
+ $ref: "#/components/responses/Forbidden"
15364
+ "404":
15365
+ $ref: "#/components/responses/NotFound"
15366
+ "409":
15367
+ description: A binding for this secret, tool and argument already exists
15368
+ get:
15369
+ tags: [Agents]
15370
+ summary: List secret → tool bindings
15371
+ operationId: listToolBindings
15372
+ parameters:
15373
+ - $ref: "#/components/parameters/AgentId"
15374
+ responses:
15375
+ "200":
15376
+ description: Bindings
15377
+ content:
15378
+ application/json:
15379
+ schema:
15380
+ type: object
15381
+ required: [bindings]
15382
+ properties:
15383
+ bindings:
15384
+ type: array
15385
+ items:
15386
+ $ref: "#/components/schemas/SecretToolBinding"
15387
+ "403":
15388
+ $ref: "#/components/responses/Forbidden"
15389
+ "404":
15390
+ $ref: "#/components/responses/NotFound"
15391
+
15392
+ /v1/agents/{agent_id}/tool-bindings/{binding_id}:
15393
+ delete:
15394
+ tags: [Agents]
15395
+ summary: Delete a secret → tool binding
15396
+ operationId: deleteToolBinding
15397
+ parameters:
15398
+ - $ref: "#/components/parameters/AgentId"
15399
+ - name: binding_id
15400
+ in: path
15401
+ required: true
15402
+ schema: { type: string, format: uuid }
15403
+ responses:
15404
+ "204":
15405
+ description: Deleted
15406
+ "403":
15407
+ $ref: "#/components/responses/Forbidden"
15408
+ "404":
15409
+ $ref: "#/components/responses/NotFound"
15410
+
15183
15411
  /v1/agents/{agent_id}/oauth/connections:
15184
15412
  get:
15185
15413
  tags: [OAuth Connect]
@@ -21757,6 +21985,25 @@ components:
21757
21985
  minimum: 0
21758
21986
  maximum: 365
21759
21987
  description: Number of days to retain flagged request bodies for replay/investigation
21988
+ streaming_inspection_mode:
21989
+ type: string
21990
+ enum: [rolling, holdback]
21991
+ description: >-
21992
+ How streamed LLM responses are inspected before release. `rolling` (default)
21993
+ releases text behind a tail buffer at least as long as the org's longest vault
21994
+ secret (capped at 256 bytes; longer secrets are matched by prefix); `holdback`
21995
+ buffers `streaming_holdback_chars` for full parity with buffered inspection.
21996
+ Tool-call deltas are always held until the call is complete.
21997
+ streaming_holdback_chars:
21998
+ type: integer
21999
+ minimum: 64
22000
+ maximum: 65536
22001
+ description: Characters held back per stream in holdback mode (default 512)
22002
+ max_concurrent_streams:
22003
+ type: integer
22004
+ minimum: 1
22005
+ maximum: 1000
22006
+ description: Open streaming responses allowed per agent key (default 20; 429 with Retry-After beyond it)
21760
22007
 
21761
22008
  UnicodeNormalizationConfig:
21762
22009
  type: object
@@ -23321,6 +23568,11 @@ components:
23321
23568
  type: string
23322
23569
  credit_balance_cents:
23323
23570
  type: integer
23571
+ description: Derived (rounded down); the ledger unit is micro-USD
23572
+ credit_balance_micro_usd:
23573
+ type: integer
23574
+ format: int64
23575
+ description: The ledger value. One inspected Shroud request costs 5,000 micro-USD ($0.005).
23324
23576
  credit_balance_usd:
23325
23577
  type: string
23326
23578
  overage_method:
@@ -23477,8 +23729,14 @@ components:
23477
23729
  properties:
23478
23730
  balance_cents:
23479
23731
  type: integer
23732
+ description: Derived (rounded down); the ledger unit is micro-USD
23733
+ balance_micro_usd:
23734
+ type: integer
23735
+ format: int64
23736
+ description: The ledger value (1 = $0.000001)
23480
23737
  balance_usd:
23481
23738
  type: string
23739
+ description: Dollars at the ledger's precision (e.g. "4.995"), never fewer than two decimals
23482
23740
  expiring_within_90_days:
23483
23741
  type: object
23484
23742
  properties:
@@ -25824,6 +26082,112 @@ components:
25824
26082
  description: Pointers within one item whose values together identify it.
25825
26083
  min_interval_secs: { type: integer, example: 60 }
25826
26084
 
26085
+ CreateRouterKeyRequest:
26086
+ type: object
26087
+ additionalProperties: false
26088
+ properties:
26089
+ name:
26090
+ type: string
26091
+ maxLength: 64
26092
+ description: Shown in lists; defaults to `default`
26093
+ max_concurrent_streams:
26094
+ type: integer
26095
+ minimum: 1
26096
+ maximum: 1000
26097
+ description: Open streaming responses this key may hold at once (gateway default 20)
26098
+ spend_cap_usd:
26099
+ type: number
26100
+ minimum: 0
26101
+ description: Optional spend cap in USD, metered by the gateway
26102
+
26103
+ RouterKey:
26104
+ type: object
26105
+ required: [id, agent_id, name, key_prefix, created_at]
26106
+ properties:
26107
+ id: { type: string, format: uuid }
26108
+ agent_id: { type: string, format: uuid }
26109
+ name: { type: string }
26110
+ key_prefix:
26111
+ type: string
26112
+ description: First 20 characters (`sk-shroud-v1-` + 7) — enough to recognise, not to use
26113
+ max_concurrent_streams: { type: integer, nullable: true }
26114
+ spend_cap_usd: { type: number, nullable: true }
26115
+ created_at: { type: string, format: date-time }
26116
+ last_used_at: { type: string, format: date-time, nullable: true }
26117
+ revoked_at: { type: string, format: date-time, nullable: true }
26118
+
26119
+ RouterKeyCreated:
26120
+ allOf:
26121
+ - $ref: "#/components/schemas/RouterKey"
26122
+ - type: object
26123
+ required: [router_key, base_url]
26124
+ properties:
26125
+ router_key:
26126
+ type: string
26127
+ description: The plaintext `sk-shroud-v1-…` key. Returned once.
26128
+ example: sk-shroud-v1-Q2c5o0yQ3bHkT9m1vXz8Lw7nRp4aEf6u
26129
+ base_url:
26130
+ type: string
26131
+ description: The Shroud gateway to point the SDK at
26132
+ example: https://shroud.1claw.co
26133
+
26134
+ CreateToolBindingRequest:
26135
+ type: object
26136
+ additionalProperties: false
26137
+ required: [secret_path, tool_name, destination_hosts]
26138
+ properties:
26139
+ secret_path:
26140
+ type: string
26141
+ description: Vault path of the secret the placeholder stands for
26142
+ tool_name:
26143
+ type: string
26144
+ description: Tool the binding applies to (`http_request`, `run_sql`, …) or `*`
26145
+ arg_path:
26146
+ type: string
26147
+ description: JSON pointer into the tool's arguments (`/headers/Authorization`, `/body/*`) or `*` (default)
26148
+ destination_hosts:
26149
+ type: array
26150
+ minItems: 1
26151
+ maxItems: 32
26152
+ items: { type: string }
26153
+ description: Hosts the rehydrated call may reach (`api.stripe.com`, `*.googleapis.com`); required
26154
+
26155
+ SecretToolBinding:
26156
+ type: object
26157
+ required: [id, org_id, agent_id, secret_path, tool_name, arg_path, destination_hosts, created_at]
26158
+ properties:
26159
+ id: { type: string, format: uuid }
26160
+ org_id: { type: string, format: uuid }
26161
+ agent_id: { type: string, format: uuid }
26162
+ secret_path: { type: string }
26163
+ tool_name: { type: string }
26164
+ arg_path: { type: string }
26165
+ destination_hosts:
26166
+ type: array
26167
+ items: { type: string }
26168
+ created_by: { type: string, format: uuid, nullable: true }
26169
+ created_at: { type: string, format: date-time }
26170
+
26171
+ X402TopupResponse:
26172
+ type: object
26173
+ required: [wallet, org_id, agent_id, credited_micro_usd, balance_micro_usd, balance_usd, access_token, expires_in, base_url, provisioned]
26174
+ properties:
26175
+ wallet: { type: string, description: Payer address (lower-case) }
26176
+ org_id: { type: string, format: uuid }
26177
+ agent_id: { type: string, format: uuid }
26178
+ credited_micro_usd: { type: integer, format: int64 }
26179
+ balance_micro_usd: { type: integer, format: int64 }
26180
+ balance_usd: { type: string }
26181
+ router_key:
26182
+ type: string
26183
+ description: Present only on the top-up that provisioned the account (or re-minted a lost key). Shown once.
26184
+ access_token:
26185
+ type: string
26186
+ description: A ≤60 s agent token for the wallet's agent (carries the `router_key` claim)
26187
+ expires_in: { type: integer }
26188
+ base_url: { type: string, description: The Shroud gateway }
26189
+ provisioned: { type: boolean, description: True when this top-up created the account }
26190
+
25827
26191
  EventSubscription:
25828
26192
  type: object
25829
26193
  required: [id, agent_id, binding_id, event_type, interval_secs, is_active, primed, next_poll_at, consecutive_errors, events_emitted, created_at]
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@1claw/openapi-spec",
3
- "version": "0.61.29",
3
+ "version": "0.61.34",
4
4
  "description": "OpenAPI 3.1.0 specification for the 1Claw Vault API \u2014 generate clients in any language",
5
5
  "license": "MIT",
6
6
  "repository": {