---
title: "Exchange Firebase auth for a session key"
method: POST
path: "/api/v1/auth/session-key"
tags: ["Auth"]
---

# Exchange Firebase auth for a session key

`POST /api/v1/auth/session-key`

## Request

- Base URL: `https://www.devspeak.dev`
- URL: `https://www.devspeak.dev/api/v1/auth/session-key`
- Auth: HTTP bearer

Creates an ephemeral dsk_sess_ API key from a Firebase Bearer token. The response is returned once and expires after 24 hours.

## Request body

- SessionKeyRequest
  - `scopes` ApiScope[]
  - `label` string

## Response `201`

Ephemeral session key created

- SessionKeyResponse
  - `success` true, required
  - `data` object, required
    - `key` string, required
    - `expiresAt` string, date-time, required
    - `scopes` ApiScope[], required

## Other responses

- `400`: Validation error
- `401`: Missing or invalid credentials
- `500`: Internal server error

---

[API](https://skmtc.dev/devspeak/apis/devspeak-api-v1.md) · [All operations](https://skmtc.dev/devspeak/apis/devspeak-api-v1/llms.txt) · [OpenAPI document](https://skmtc.dev/devspeak/apis/devspeak-api-v1/revisions/7000833a5bbf?raw)
