> For the complete documentation index, see [llms.txt](https://docs.nexus.xyz/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.nexus.xyz/api-reference/authentication/login.md).

# POST /auth/login

Sign in with EVM wallet

Sign in with EVM wallet.

`operationId`: `login`

> **Not reachable through CCXT.** Session/credential lifecycle. CCXT takes credentials as constructor config; it never mints them.

**Authentication:** a wallet signature carried in the request body — no `X-API-Key` and no session token. API-key headers are ignored here and do not substitute for the signature. The description below says what to sign; an unsigned call is refused with `401`.

Submit an EIP-191 personal\_sign signature to receive a session token. The session token is used to create and manage API keys via /keys endpoints. For trading, use HMAC API keys instead. Session tokens expire after 24 hours.

## Request body

**Required.** [`LoginRequest`](/api-reference/guides/schemas.md#loginrequest) — `application/json`.

```json
{
  "message": "Sign in to Nexus Exchange",
  "signature": "0x1234...abcd"
}
```

## Responses

| Status | Body                                                              | Meaning                                                                                                                                                                                               |
| ------ | ----------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `200`  | [`LoginResponse`](/api-reference/guides/schemas.md#loginresponse) | Session created                                                                                                                                                                                       |
| `401`  | — *(no schema declared)*                                          | Signature verification failed                                                                                                                                                                         |
| `429`  | — *(no schema declared)*                                          | —                                                                                                                                                                                                     |
| `500`  | — *(no schema declared)*                                          | code=INTERNAL\_ERROR — the session store write failed (M3.15, ENG-10681: the Postgres-backed session store has no in-memory fallback, so a write failure surfaces here instead of degrading silently) |

## Example

{% tabs %}
{% tab title="cURL" %}

```bash
curl -X POST 'https://exchange.nexus.xyz/api/exchange/auth/login' \
  -H 'Content-Type: application/json' \
  -d '{
  "message": "Sign in to Nexus Exchange",
  "signature": "0x1234...abcd"
}'
```

{% endtab %}

{% tab title="Python" %}

```python
import requests

headers = {
    "Content-Type": "application/json"
}
payload = {
    "message": "Sign in to Nexus Exchange",
    "signature": "0x1234...abcd"
}

response = requests.post("https://exchange.nexus.xyz/api/exchange/auth/login", headers=headers, json=payload)
response.raise_for_status()
print(response.json())
```

{% endtab %}

{% tab title="TypeScript" %}

```typescript
const response = await fetch("https://exchange.nexus.xyz/api/exchange/auth/login", {
  method: "POST",
  headers: {
    "Content-Type": "application/json"
  },
  body: JSON.stringify({
    "message": "Sign in to Nexus Exchange",
    "signature": "0x1234...abcd"
  }),
});
if (!response.ok) throw new Error(`${response.status} ${await response.text()}`);
console.log(await response.json());
```

{% endtab %}
{% endtabs %}

***

<sub>Generated from</sub> <sub></sub><sub>`eng/apps/exchange/api/openapi.json`</sub> <sub></sub><sub>(spec</sub> <sub></sub><sub>`0.9.77`</sub><sub>). Do not edit by hand — regenerate with</sub> <sub></sub><sub>`python3 product/docs/tools/api-reference/generate.py`</sub><sub>. Hand-authored context lives in the Guides pages.</sub>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.nexus.xyz/api-reference/authentication/login.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
