---
title: "Exchange a magic-link code (received via email) for an API key."
method: POST
path: "/auth/magic-link/consume"
---

# Exchange a magic-link code (received via email) for an API key.

`POST /auth/magic-link/consume`

## Request

- Base URL: `https://stremai.com/api/v1`
- URL: `https://stremai.com/api/v1/auth/magic-link/consume`
- Auth: none required

Single-use; 15-minute TTL. New-account path requires the original request to have included `acceptTerms: true`.

## Request body

- object
  - `code` string, required: The code from the email body, e.g. `MAGK-AB12-CD34-EF56-GH78`. Whitespace and casing are tolerated.

## Response `200`

Existing user signed in. Body contains apiKey + userId.

## Other responses

- `201`: New account created. Body contains apiKey + userId.
- `400`: Invalid, expired, or already-consumed code.
- `429`: Rate limit exceeded.

---

[API](https://skmtc.dev/aiagentsbay/apis/stremai-api.md) · [All operations](https://skmtc.dev/aiagentsbay/apis/stremai-api/llms.txt) · [OpenAPI document](https://skmtc.dev/aiagentsbay/apis/stremai-api/revisions/8b60381f8354?raw)
