> ## Documentation Index
> Fetch the complete documentation index at: https://docs.llmgenerator.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Register Account

> This endpoint allows new users to register an account.

## POST /auth/register

This endpoint is used to create a new user account. It is a public endpoint and does not require authentication. Upon successful registration, a verification email is sent to the user.

### Request Body

<ParamField body="email" type="string" required>
  The user's email address. Must be a valid and unique email.
</ParamField>

<ParamField body="password" type="string" required>
  The user's password. Must be at least 8 characters long and meet password strength requirements.
</ParamField>

<ParamField body="firstName" type="string" required>
  The user's first name. Maximum 50 characters.
</ParamField>

<ParamField body="lastName" type="string">
  The user's last name. Maximum 50 characters.
</ParamField>

<ParamField body="company" type="string">
  The user's company name. Maximum 100 characters.
</ParamField>

### Response

<ResponseField name="success" type="boolean">
  Indicates if the registration was successful.
</ResponseField>

<ResponseField name="message" type="string">
  Human-readable status message.
</ResponseField>

<ResponseField name="user" type="object">
  An object containing the newly created user's information.

  <Expandable title="user properties">
    <ResponseField name="id" type="string">
      The unique identifier for the user.
    </ResponseField>

    <ResponseField name="email" type="string">
      The user's email address.
    </ResponseField>

    <ResponseField name="name" type="string">
      The user's full name.
    </ResponseField>

    <ResponseField name="emailVerified" type="boolean">
      Whether the email has been verified (initially false).
    </ResponseField>

    <ResponseField name="createdAt" type="string">
      ISO 8601 timestamp of account creation.
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="tokens" type="object">
  An object containing the authentication tokens.

  <Expandable title="tokens properties">
    <ResponseField name="accessToken" type="string">
      The access token for authenticating subsequent requests. Expires in 15 minutes.
    </ResponseField>

    <ResponseField name="refreshToken" type="string">
      The refresh token for obtaining new access tokens. Expires in 7 days.
    </ResponseField>

    <ResponseField name="expiresIn" type="number">
      Token expiry time in seconds (900 = 15 minutes).
    </ResponseField>

    <ResponseField name="tokenType" type="string">
      The token type (always "Bearer").
    </ResponseField>
  </Expandable>
</ResponseField>

<RequestExample>
  ```bash cURL theme={null}
  curl -X POST https://api.llmgenerator.com/api/v1/auth/register \
    -H "Content-Type: application/json" \
    -d '{
          "email": "user@example.com",
          "password": "securePassword123!",
          "firstName": "John",
          "lastName": "Doe",
          "company": "Acme Inc"
        }'
  ```

  ```javascript Node.js theme={null}
  const response = await fetch('https://api.llmgenerator.com/api/v1/auth/register', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json'
    },
    body: JSON.stringify({
      email: 'user@example.com',
      password: 'securePassword123!',
      firstName: 'John',
      lastName: 'Doe'
    })
  });

  const data = await response.json();
  ```

  ```python Python theme={null}
  import requests

  response = requests.post(
      'https://api.llmgenerator.com/api/v1/auth/register',
      json={
          'email': 'user@example.com',
          'password': 'securePassword123!',
          'firstName': 'John',
          'lastName': 'Doe'
      }
  )

  data = response.json()
  ```
</RequestExample>

<ResponseExample>
  ```json Success (201) theme={null}
  {
    "success": true,
    "message": "Account created successfully",
    "user": {
      "id": "550e8400-e29b-41d4-a716-446655440000",
      "email": "user@example.com",
      "name": "John Doe",
      "emailVerified": false,
      "createdAt": "2026-01-29T12:00:00.000Z"
    },
    "tokens": {
      "accessToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
      "refreshToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
      "expiresIn": 900,
      "tokenType": "Bearer"
    }
  }
  ```

  ```json Email Already Exists (409) theme={null}
  {
    "message": "Email already registered"
  }
  ```

  ```json Weak Password (400) theme={null}
  {
    "message": "Weak password: Password must contain at least one uppercase letter, one number"
  }
  ```
</ResponseExample>
