/v1/api-keysSessionMint a key
Create an account API key. The plaintext is returned exactly once.
Only a hash is persisted. If you lose the plaintext, revoke the key and mint another — it cannot be recovered.
Body
| Field | Type | Required | Description |
|---|---|---|---|
| label | string | optional | Human-readable label, shown in the key list. |
| role | string | optional | Who the key acts as: "owner" (the default) runs every request as you, at your live access on the project it names; "user" acts for one of your own end users instead — bound to one project, read and project-write only, and never above your tier there. A "user" key names the end user it acts for with the X-Runlog-End-User header, so writes attribute to them. "user" is minted only from a storefront's own account settings: the key binds to the tenant the minting session is on, and a session on no storefront is answered 403. |
curl -X POST "https://runlog-7613480744.us-central1.run.app/v1/api-keys" \
-H "Authorization: Bearer $RUNLOG_SESSION_TOKEN" \
-H "X-Project-Id: p7Kd2mQx" \
-H "Content-Type: application/json" \
-d '{
"label": "LingCode production",
"role": "owner"
}'{
"createdAt": "2026-08-07T18:00:00Z",
"key": "rlka_key2Xm9Qd_…",
"keyId": "key_2Xm9Qd",
"label": "LingCode production"
}Errors
| Status | error | When |
|---|---|---|
| 400 | invalid request body | The body is not JSON, or exceeds the 1 MB request-body cap. |
| 401 | unauthorized | This route takes your signed-in session, not an API key — a key cannot mint another key. |