Initialize a recoverable CLI account
Persist the random token before sending: its digest is the operation's id, and an identical retry returns the same account and protected credential during its exchange window. Cloud initialization is public and rate limited. Self-hosted initialization creates the deployment's single unclaimed account, and only for the token whose SHA-256 the deploying CLI stored as the Worker secret CLI_BOOTSTRAP_TOKEN_DIGEST; any other token, or a deployment without that secret, is refused with 403. It is not rate limited, because only the deploying CLI can pass it, and a limit would refuse that CLI retrying a deployment whose storage has not come up yet. All responses are no-store.
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/json
application/json
application/json
application/json
application/json
application/json
application/json
curl -X POST "https://example.com/v1/cli/bootstrap" \ -H "Content-Type: application/json" \ -d '{ "token": "string" }'{ "id": "string", "kind": "bootstrap", "state": "pending", "denied": true, "expiresAt": "string", "url": "http://example.com", "deployment": { "id": "string", "mode": "cloud", "apiUrl": "http://example.com", "consoleOrigin": "http://example.com" }, "result": { "credential": { "token": "string" }, "unclaimedAccess": { "endsAt": "string", "limit": 0 }, "accountId": "string", "app": { "revision": 1, "id": "string", "name": "string", "config": { "authentication": { "type": "apple_app_attest", "end_user": { "source": "issuer", "issuer": { "jwks_url": "http://example.com", "issuer": "string", "audience": "string", "user_id_claim": "string", "token_header": "string", "required_claims": [ { "path": "string", "contains": "string", "equals": "string" } ], "max_token_lifetime_seconds": 1, "provider": "firebase", "entitlement": "revenuecat" } }, "app_attest": { "team_id": "string", "bundle_id": "string", "environments": [ "production" ], "verify_on": "every_request" } }, "routing": { "providers": { "mode": "all" }, "model_rewrites": { "property1": "string", "property2": "string" } }, "limits": {}, "endpoints": {} }, "status": "active", "created_at": "string", "updated_at": "string", "warnings": [ { "code": "string", "message": "string", "until": "string", "docs_url": "string" } ] }, "api_key": { "id": "string", "name": "string", "key": "string", "key_prefix": "string", "created_at": "string" }, "provider": { "id": "string", "type": "openai", "slug": "string", "name": "string", "secretHint": "string", "providerGatewayId": "string", "gatewayRoute": { "modelPrefix": "string", "providerOnly": [ "string" ] }, "baseUrl": "string", "pricing": { "property1": { "input": 0, "output": 0, "cached_input": 0, "cache_write": 0, "cache_write_1h": 0, "image_input": 0, "audio_input": 0, "video_input": 0, "image_output": 0, "long_input": 0, "long_output": 0, "long_cached_input": 0, "long_cache_write": 0, "long_cache_write_1h": 0, "long_context_threshold": 1 }, "property2": { "input": 0, "output": 0, "cached_input": 0, "cache_write": 0, "cache_write_1h": 0, "image_input": 0, "audio_input": 0, "video_input": 0, "image_output": 0, "long_input": 0, "long_output": 0, "long_cached_input": 0, "long_cache_write": 0, "long_cache_write_1h": 0, "long_context_threshold": 1 } }, "route": "direct", "capability": { "apiStyles": [ "responses" ], "endpointStyles": [ "responses" ], "modelPrefix": "string", "paths": "provider" }, "revision": 1, "status": "active", "createdAt": "string", "createdBy": "string" }, "gateway": { "id": "string", "name": "string", "secretHint": "string", "providerCount": 0, "referencedCount": 0, "revision": 1, "status": "active", "createdAt": "string", "updatedAt": "string", "createdBy": "string", "type": "cf_aig", "config": { "accountId": "string", "gatewayId": "string" } } }, "account": { "id": "string", "name": "string", "createdAt": "string", "claimed": true, "expiresAt": "string" }}Discover deployment identity and provider capabilities
Discover deployment identity and provider capabilities (GET /v1/cli/capabilities) in the App AI Gateway API.
Send or recover a CLI operation
Send or recover a CLI operation (POST /v1/cli/operations) in the App AI Gateway API. Accepts a management key, MCP OAuth token or console session.