---
title: "Login Key"
method: POST
path: "/auth/login-key"
tags: ["Auth"]
---

# Login Key

`POST /auth/login-key`

## Request

- Base URL: `https://apigcp.trynia.ai/v2`
- URL: `https://apigcp.trynia.ai/v2/auth/login-key`
- Auth: none required
- TypeScript: <https://skmtc.dev/nozomio-labs/apis/nia-ai-api/docs/auth/login-key/post.ts> (a function with typed inputs; its response is checked against the schema)

Authenticate with email + password and receive a new nk_ API key.

For returning users who already have an account but need a new key
(e.g. an AI agent setting up in a new environment).

## Request body

- LoginKeyRequest
  - `email` string, required
  - `password` string, required
  - `organization_id` string, nullable: Org to scope the new key to (must be a member)
  - `idempotency_key` string, nullable

## Response `200`

Successful Response

- LoginKeyResponse
  - `api_key` string, required
  - `api_key_id` string, required
  - `user_id` string, required
  - `organization_id` string, nullable

## Other responses

- `422`: Validation Error

## Changes

- **2026-02-28** `7e426dce5dda`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/nozomio-labs/apis/nia-ai-api/changes/auth/login-key/post.md)

---

[API](https://skmtc.dev/nozomio-labs/apis/nia-ai-api.md) - [All operations](https://skmtc.dev/nozomio-labs/apis/nia-ai-api/llms.txt) - [OpenAPI document](https://skmtc.dev/nozomio-labs/apis/nia-ai-api/revisions/dbb602a3ef17?raw)
