---
title: "Issue an API key"
method: POST
path: "/createAgentApiKey"
tags: ["Agent Wallet"]
---

# Issue an API key

`POST /createAgentApiKey`

## Request

- Base URL: `https://laso.finance`
- URL: `https://laso.finance/createAgentApiKey`
- Auth: API key in header `Authorization`

Issues a durable `lasoak_` API key for the account. **The raw key is returned once** — only its hash is stored, so it cannot be retrieved again. Normally the human does this from the dashboard.

A Firebase callable. Callables wrap the request in `{"data": ...}` and the reply in `{"result": ...}`. Send the `id_token` from `/auth` as a Bearer token. Free.

## Request body

- object
  - `data` object, required
    - `userId` string, required: The Laso user id (the `usr_...` value from /auth).
    - `label` string: A label to recognize the key by.

## Response `200`

The raw `apiKey` (shown once) and its `keyId`.

- object
  - `result` object

## Other responses

- `400`: A required field is missing or invalid.
- `401`: Missing, invalid, or expired Bearer token.

---

[API](https://skmtc.dev/laso/apis/laso-finance-x402-api.md) · [All operations](https://skmtc.dev/laso/apis/laso-finance-x402-api/llms.txt) · [OpenAPI document](https://skmtc.dev/laso/apis/laso-finance-x402-api/revisions/ff8ce20b49ba?raw)
