---
title: "Create zkLogin nonce"
method: POST
path: "/v1/zklogin/nonce"
---

# Create zkLogin nonce

`POST /v1/zklogin/nonce`

## Request

- Base URL: `http://api.enoki.mystenlabs.com`
- URL: `http://api.enoki.mystenlabs.com/v1/zklogin/nonce`
- Auth: HTTP bearer

Generates a nonce used in the zkLogin OAuth flow. Using this API is not required, you can also construct a nonce client-side if desired.

## Request body

- NonceRequest
  - `network` 'testnet' | 'mainnet' | 'devnet': The Sui network you wish to use. Defaults to `mainnet`.
  - `ephemeralPublicKey` string, required: The ephemeral public key created during the zkLogin process, encoded as a base64 string.
  - `additionalEpochs` number: The amount of epochs that you would like to have the nonce be valid for.

## Response `200`

Successful response

- NonceResponse
  - `data` object, required
    - `nonce` string, required
    - `randomness` string, required
    - `epoch` number, required
    - `maxEpoch` number, required
    - `estimatedExpiration` number, required

---

[API](https://skmtc.dev/mystenlabs/apis/enoki-api-specification.md) - [All operations](https://skmtc.dev/mystenlabs/apis/enoki-api-specification/llms.txt) - [OpenAPI document](https://skmtc.dev/mystenlabs/apis/enoki-api-specification/revisions/2ac8d418823a?raw)
