@1claw/openapi-spec 0.30.0 → 0.32.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.
package/README.md CHANGED
@@ -40,7 +40,20 @@ openapi-generator generate \
40
40
  import spec from "@1claw/openapi-spec/openapi.json";
41
41
  ```
42
42
 
43
- ## What's in the spec (v0.28.0 — API `info.version` 2.15.0)
43
+ ## What's in the spec (v0.32.0 — API `info.version` 2.18.0)
44
+
45
+ ### Bankr dynamic key vending (2.18)
46
+ - **Bankr keys** — `POST /v1/agents/{id}/bankr-keys/lease`, `GET /v1/agents/{id}/bankr-keys`, `DELETE /v1/agents/{id}/bankr-keys/{lease_id}`. Partner key vending for scoped, TTL-bound `bk_usr_` wallet API keys.
47
+
48
+
49
+ ### CDP parity & embedded wallet (2.16+)
50
+ - **Deposit destinations** — `POST/GET/PATCH /v1/deposit-destinations`, `GET /v1/deposit-destinations/{id}`
51
+ - **Internal accounts** — `POST/GET /v1/internal-accounts`, `POST /v1/internal-transfers` (supports `Idempotency-Key`), `GET /v1/internal-accounts/{id}/ledger`
52
+ - **Fiat ramps** — `POST /v1/fiat/onramp/session`, `POST /v1/fiat/offramp/initiate`, `POST /v1/fiat/webhooks` (MoonPay signature required in production)
53
+ - **Social login** — `POST /v1/auth/social-login` (Google/Apple ID tokens with audience validation; Discord authorization code + `oauth_redirect_uri`; no email auto-linking — 409 on conflict)
54
+ - **Passkey tx auth** — `POST /v1/auth/passkeys/tx-assert/begin|complete` → `X-Passkey-Token` (+ optional `X-Passkey-Tx-Digest`) on treasury send
55
+
56
+ ### Core API (summary)
44
57
 
45
58
  - **OIDC Federation (1claw as IdP)** — `GET /.well-known/openid-configuration` (public discovery: issuer, jwks_uri, supported algs `["EdDSA","RS256"]`, supported grant types incl. token-exchange), `GET /.well-known/jwks.json` (public JWKS — every active EdDSA + RS256 key version, keyed by deterministic `kid`), `POST /v1/auth/federated-token` (RFC 8693 token exchange — accepts JSON or `application/x-www-form-urlencoded`; subject token is an agent JWT or `ocv_` API key; returns RS256 JWT scoped to `audience`). Agent fields: `federation_enabled`, `federation_audiences[]`, `federated_token_ttl_seconds`. Designed for Anthropic Workload Identity Federation, GCP STS, AWS STS, etc.
46
59
  - **Auth — agent JWT** — `POST /v1/auth/agent-token` documents optional JWT claim **`shroud_config`** when the agent has Shroud enabled (mirrors DB; consumed by Shroud PolicyEngine on LLM requests). Re-exchange after changing agent Shroud settings. Federation tokens use a separate KMS RSA-2048 key and are signed RS256.
package/openapi.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "openapi": "3.1.0",
3
3
  "info": {
4
4
  "title": "1Claw API",
5
- "version": "2.16.0",
5
+ "version": "2.18.0",
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.\n\nAll endpoints require JWT Bearer authentication unless marked with\n`security: []`.\n",
7
7
  "contact": {
8
8
  "email": "ops@1claw.xyz"
@@ -3687,6 +3687,109 @@
3687
3687
  }
3688
3688
  }
3689
3689
  },
3690
+ "/v1/agents/{agent_id}/bankr-keys/lease": {
3691
+ "post": {
3692
+ "tags": [
3693
+ "Bankr Keys"
3694
+ ],
3695
+ "summary": "Lease a short-lived Bankr wallet API key",
3696
+ "description": "Provision a scoped, time-limited Bankr wallet API key for an agent.\nRequires `BANKR_PARTNER_KEY` configured on the Vault service.\nDefault TTL 1 hour, max 24 hours. Max 5 concurrent leases per agent.\n",
3697
+ "operationId": "leaseBankrKey",
3698
+ "parameters": [
3699
+ {
3700
+ "$ref": "#/components/parameters/AgentId"
3701
+ }
3702
+ ],
3703
+ "requestBody": {
3704
+ "required": false,
3705
+ "content": {
3706
+ "application/json": {
3707
+ "schema": {
3708
+ "$ref": "#/components/schemas/LeaseBankrKeyRequest"
3709
+ }
3710
+ }
3711
+ }
3712
+ },
3713
+ "responses": {
3714
+ "201": {
3715
+ "description": "Bankr key leased",
3716
+ "content": {
3717
+ "application/json": {
3718
+ "schema": {
3719
+ "$ref": "#/components/schemas/LeaseBankrKeyResponse"
3720
+ }
3721
+ }
3722
+ }
3723
+ },
3724
+ "400": {
3725
+ "$ref": "#/components/responses/BadRequest"
3726
+ },
3727
+ "403": {
3728
+ "$ref": "#/components/responses/Forbidden"
3729
+ }
3730
+ }
3731
+ }
3732
+ },
3733
+ "/v1/agents/{agent_id}/bankr-keys": {
3734
+ "get": {
3735
+ "tags": [
3736
+ "Bankr Keys"
3737
+ ],
3738
+ "summary": "List active Bankr key leases for an agent",
3739
+ "operationId": "listBankrKeys",
3740
+ "parameters": [
3741
+ {
3742
+ "$ref": "#/components/parameters/AgentId"
3743
+ }
3744
+ ],
3745
+ "responses": {
3746
+ "200": {
3747
+ "description": "Active leases (no secret values)",
3748
+ "content": {
3749
+ "application/json": {
3750
+ "schema": {
3751
+ "$ref": "#/components/schemas/BankrKeyLeaseListResponse"
3752
+ }
3753
+ }
3754
+ }
3755
+ },
3756
+ "404": {
3757
+ "$ref": "#/components/responses/NotFound"
3758
+ }
3759
+ }
3760
+ }
3761
+ },
3762
+ "/v1/agents/{agent_id}/bankr-keys/{lease_id}": {
3763
+ "delete": {
3764
+ "tags": [
3765
+ "Bankr Keys"
3766
+ ],
3767
+ "summary": "Revoke an active Bankr key lease",
3768
+ "operationId": "revokeBankrKey",
3769
+ "parameters": [
3770
+ {
3771
+ "$ref": "#/components/parameters/AgentId"
3772
+ },
3773
+ {
3774
+ "name": "lease_id",
3775
+ "in": "path",
3776
+ "required": true,
3777
+ "schema": {
3778
+ "type": "string",
3779
+ "format": "uuid"
3780
+ }
3781
+ }
3782
+ ],
3783
+ "responses": {
3784
+ "204": {
3785
+ "description": "Lease revoked"
3786
+ },
3787
+ "404": {
3788
+ "$ref": "#/components/responses/NotFound"
3789
+ }
3790
+ }
3791
+ }
3792
+ },
3690
3793
  "/v1/agents/{agent_id}/sign": {
3691
3794
  "post": {
3692
3795
  "tags": [
@@ -8054,7 +8157,18 @@
8054
8157
  ]
8055
8158
  },
8056
8159
  "id_token": {
8057
- "type": "string"
8160
+ "type": "string",
8161
+ "description": "Google/Apple ID token, or Discord OAuth authorization code"
8162
+ },
8163
+ "oauth_redirect_uri": {
8164
+ "type": "string",
8165
+ "description": "Required for Discord — must match the redirect URI used in the OAuth flow"
8166
+ },
8167
+ "auto_provision_chains": {
8168
+ "type": "array",
8169
+ "items": {
8170
+ "type": "string"
8171
+ }
8058
8172
  }
8059
8173
  }
8060
8174
  }
@@ -8067,6 +8181,12 @@
8067
8181
  },
8068
8182
  "201": {
8069
8183
  "description": "New user created"
8184
+ },
8185
+ "401": {
8186
+ "description": "Invalid or unverified token"
8187
+ },
8188
+ "409": {
8189
+ "description": "Email already registered (no auto-linking)"
8070
8190
  }
8071
8191
  }
8072
8192
  }
@@ -8077,15 +8197,38 @@
8077
8197
  "Authentication"
8078
8198
  ],
8079
8199
  "summary": "Begin passkey transaction authorization",
8200
+ "description": "Requires `tx_digest` — SHA-256 hex of canonical `chain|to|value_wei|data`\nfor the treasury send being authorized. The server recomputes this digest\non send and rejects passkey tokens that do not match.\n",
8080
8201
  "operationId": "passkeyTxAssertBegin",
8081
8202
  "security": [
8082
8203
  {
8083
8204
  "BearerAuth": []
8084
8205
  }
8085
8206
  ],
8207
+ "requestBody": {
8208
+ "required": true,
8209
+ "content": {
8210
+ "application/json": {
8211
+ "schema": {
8212
+ "type": "object",
8213
+ "required": [
8214
+ "tx_digest"
8215
+ ],
8216
+ "properties": {
8217
+ "tx_digest": {
8218
+ "type": "string",
8219
+ "description": "64-char hex SHA-256 of canonical send params"
8220
+ }
8221
+ }
8222
+ }
8223
+ }
8224
+ }
8225
+ },
8086
8226
  "responses": {
8087
8227
  "200": {
8088
8228
  "description": "WebAuthn challenge"
8229
+ },
8230
+ "400": {
8231
+ "description": "Missing or invalid tx_digest"
8089
8232
  }
8090
8233
  }
8091
8234
  }
@@ -10747,6 +10890,98 @@
10747
10890
  }
10748
10891
  }
10749
10892
  },
10893
+ "LeaseBankrKeyRequest": {
10894
+ "type": "object",
10895
+ "properties": {
10896
+ "wallet_id": {
10897
+ "type": "string",
10898
+ "description": "Bankr wallet ID (wlt_...). Uses org default if omitted."
10899
+ },
10900
+ "ttl_seconds": {
10901
+ "type": "integer",
10902
+ "description": "Lease TTL in seconds (default 3600, max 86400).",
10903
+ "minimum": 60,
10904
+ "maximum": 86400
10905
+ },
10906
+ "permissions": {
10907
+ "$ref": "#/components/schemas/LeaseBankrPermissions"
10908
+ }
10909
+ }
10910
+ },
10911
+ "LeaseBankrPermissions": {
10912
+ "type": "object",
10913
+ "properties": {
10914
+ "llm_gateway_enabled": {
10915
+ "type": "boolean",
10916
+ "default": true
10917
+ },
10918
+ "agent_api_enabled": {
10919
+ "type": "boolean",
10920
+ "default": false
10921
+ },
10922
+ "read_only": {
10923
+ "type": "boolean",
10924
+ "default": true
10925
+ }
10926
+ }
10927
+ },
10928
+ "LeaseBankrKeyResponse": {
10929
+ "type": "object",
10930
+ "properties": {
10931
+ "lease_id": {
10932
+ "type": "string",
10933
+ "format": "uuid"
10934
+ },
10935
+ "api_key": {
10936
+ "type": "string",
10937
+ "description": "Ephemeral bk_usr_ key (one-time display)."
10938
+ },
10939
+ "wallet_id": {
10940
+ "type": "string"
10941
+ },
10942
+ "expires_at": {
10943
+ "type": "string",
10944
+ "format": "date-time"
10945
+ }
10946
+ }
10947
+ },
10948
+ "BankrKeyLeaseResponse": {
10949
+ "type": "object",
10950
+ "properties": {
10951
+ "id": {
10952
+ "type": "string",
10953
+ "format": "uuid"
10954
+ },
10955
+ "wallet_id": {
10956
+ "type": "string"
10957
+ },
10958
+ "bankr_key_id": {
10959
+ "type": "string"
10960
+ },
10961
+ "permissions": {
10962
+ "type": "object"
10963
+ },
10964
+ "expires_at": {
10965
+ "type": "string",
10966
+ "format": "date-time"
10967
+ },
10968
+ "created_at": {
10969
+ "type": "string",
10970
+ "format": "date-time"
10971
+ }
10972
+ }
10973
+ },
10974
+ "BankrKeyLeaseListResponse": {
10975
+ "type": "object",
10976
+ "properties": {
10977
+ "leases": {
10978
+ "type": "array",
10979
+ "items": {
10980
+ "$ref": "#/components/schemas/BankrKeyLeaseResponse"
10981
+ }
10982
+ }
10983
+ }
10984
+ },
10750
10985
  "SignIntentRequest": {
10751
10986
  "type": "object",
10752
10987
  "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: 2.16.0
5
+ version: 2.18.0
6
6
  description: |
7
7
  Secure secret management for AI agents. Provides vaults, secrets,
8
8
  policy-based access control, agent identity, Intents API,
@@ -2413,6 +2413,75 @@ paths:
2413
2413
  "404":
2414
2414
  $ref: "#/components/responses/NotFound"
2415
2415
 
2416
+ # ---------------------------------------------------------------------------
2417
+ # Bankr Dynamic Key Vending
2418
+ # ---------------------------------------------------------------------------
2419
+
2420
+ /v1/agents/{agent_id}/bankr-keys/lease:
2421
+ post:
2422
+ tags: [Bankr Keys]
2423
+ summary: Lease a short-lived Bankr wallet API key
2424
+ description: |
2425
+ Provision a scoped, time-limited Bankr wallet API key for an agent.
2426
+ Requires `BANKR_PARTNER_KEY` configured on the Vault service.
2427
+ Default TTL 1 hour, max 24 hours. Max 5 concurrent leases per agent.
2428
+ operationId: leaseBankrKey
2429
+ parameters:
2430
+ - $ref: "#/components/parameters/AgentId"
2431
+ requestBody:
2432
+ required: false
2433
+ content:
2434
+ application/json:
2435
+ schema:
2436
+ $ref: "#/components/schemas/LeaseBankrKeyRequest"
2437
+ responses:
2438
+ "201":
2439
+ description: Bankr key leased
2440
+ content:
2441
+ application/json:
2442
+ schema:
2443
+ $ref: "#/components/schemas/LeaseBankrKeyResponse"
2444
+ "400":
2445
+ $ref: "#/components/responses/BadRequest"
2446
+ "403":
2447
+ $ref: "#/components/responses/Forbidden"
2448
+
2449
+ /v1/agents/{agent_id}/bankr-keys:
2450
+ get:
2451
+ tags: [Bankr Keys]
2452
+ summary: List active Bankr key leases for an agent
2453
+ operationId: listBankrKeys
2454
+ parameters:
2455
+ - $ref: "#/components/parameters/AgentId"
2456
+ responses:
2457
+ "200":
2458
+ description: Active leases (no secret values)
2459
+ content:
2460
+ application/json:
2461
+ schema:
2462
+ $ref: "#/components/schemas/BankrKeyLeaseListResponse"
2463
+ "404":
2464
+ $ref: "#/components/responses/NotFound"
2465
+
2466
+ /v1/agents/{agent_id}/bankr-keys/{lease_id}:
2467
+ delete:
2468
+ tags: [Bankr Keys]
2469
+ summary: Revoke an active Bankr key lease
2470
+ operationId: revokeBankrKey
2471
+ parameters:
2472
+ - $ref: "#/components/parameters/AgentId"
2473
+ - name: lease_id
2474
+ in: path
2475
+ required: true
2476
+ schema:
2477
+ type: string
2478
+ format: uuid
2479
+ responses:
2480
+ "204":
2481
+ description: Lease revoked
2482
+ "404":
2483
+ $ref: "#/components/responses/NotFound"
2484
+
2416
2485
  # ---------------------------------------------------------------------------
2417
2486
  # Unified Signing Intent
2418
2487
  # ---------------------------------------------------------------------------
@@ -5150,23 +5219,52 @@ paths:
5150
5219
  required: [provider, id_token]
5151
5220
  properties:
5152
5221
  provider: { type: string, enum: [google, apple, discord] }
5153
- id_token: { type: string }
5222
+ id_token:
5223
+ type: string
5224
+ description: Google/Apple ID token, or Discord OAuth authorization code
5225
+ oauth_redirect_uri:
5226
+ type: string
5227
+ description: Required for Discord — must match the redirect URI used in the OAuth flow
5228
+ auto_provision_chains:
5229
+ type: array
5230
+ items: { type: string }
5154
5231
  responses:
5155
5232
  "200":
5156
5233
  description: Login successful
5157
5234
  "201":
5158
5235
  description: New user created
5236
+ "409":
5237
+ description: Email already registered (no auto-linking)
5238
+ "401":
5239
+ description: Invalid or unverified token
5159
5240
 
5160
5241
  /v1/auth/passkeys/tx-assert/begin:
5161
5242
  post:
5162
5243
  tags: [Authentication]
5163
5244
  summary: Begin passkey transaction authorization
5245
+ description: |
5246
+ Requires `tx_digest` — SHA-256 hex of canonical `chain|to|value_wei|data`
5247
+ for the treasury send being authorized. The server recomputes this digest
5248
+ on send and rejects passkey tokens that do not match.
5164
5249
  operationId: passkeyTxAssertBegin
5165
5250
  security:
5166
5251
  - BearerAuth: []
5252
+ requestBody:
5253
+ required: true
5254
+ content:
5255
+ application/json:
5256
+ schema:
5257
+ type: object
5258
+ required: [tx_digest]
5259
+ properties:
5260
+ tx_digest:
5261
+ type: string
5262
+ description: 64-char hex SHA-256 of canonical send params
5167
5263
  responses:
5168
5264
  "200":
5169
5265
  description: WebAuthn challenge
5266
+ "400":
5267
+ description: Missing or invalid tx_digest
5170
5268
 
5171
5269
  /v1/auth/passkeys/tx-assert/complete:
5172
5270
  post:
@@ -7029,6 +7127,76 @@ components:
7029
7127
  items:
7030
7128
  $ref: "#/components/schemas/SigningKeyResponse"
7031
7129
 
7130
+ # Bankr Dynamic Key Vending
7131
+ LeaseBankrKeyRequest:
7132
+ type: object
7133
+ properties:
7134
+ wallet_id:
7135
+ type: string
7136
+ description: Bankr wallet ID (wlt_...). Uses org default if omitted.
7137
+ ttl_seconds:
7138
+ type: integer
7139
+ description: Lease TTL in seconds (default 3600, max 86400).
7140
+ minimum: 60
7141
+ maximum: 86400
7142
+ permissions:
7143
+ $ref: "#/components/schemas/LeaseBankrPermissions"
7144
+
7145
+ LeaseBankrPermissions:
7146
+ type: object
7147
+ properties:
7148
+ llm_gateway_enabled:
7149
+ type: boolean
7150
+ default: true
7151
+ agent_api_enabled:
7152
+ type: boolean
7153
+ default: false
7154
+ read_only:
7155
+ type: boolean
7156
+ default: true
7157
+
7158
+ LeaseBankrKeyResponse:
7159
+ type: object
7160
+ properties:
7161
+ lease_id:
7162
+ type: string
7163
+ format: uuid
7164
+ api_key:
7165
+ type: string
7166
+ description: Ephemeral bk_usr_ key (one-time display).
7167
+ wallet_id:
7168
+ type: string
7169
+ expires_at:
7170
+ type: string
7171
+ format: date-time
7172
+
7173
+ BankrKeyLeaseResponse:
7174
+ type: object
7175
+ properties:
7176
+ id:
7177
+ type: string
7178
+ format: uuid
7179
+ wallet_id:
7180
+ type: string
7181
+ bankr_key_id:
7182
+ type: string
7183
+ permissions:
7184
+ type: object
7185
+ expires_at:
7186
+ type: string
7187
+ format: date-time
7188
+ created_at:
7189
+ type: string
7190
+ format: date-time
7191
+
7192
+ BankrKeyLeaseListResponse:
7193
+ type: object
7194
+ properties:
7195
+ leases:
7196
+ type: array
7197
+ items:
7198
+ $ref: "#/components/schemas/BankrKeyLeaseResponse"
7199
+
7032
7200
  # Unified Signing Intent
7033
7201
  SignIntentRequest:
7034
7202
  type: object
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@1claw/openapi-spec",
3
- "version": "0.30.0",
3
+ "version": "0.32.0",
4
4
  "description": "OpenAPI 3.1.0 specification for the 1Claw Vault API — generate clients in any language",
5
5
  "license": "MIT",
6
6
  "repository": {