> ## 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.

# Create Account

> This endpoint allows for the creation of a new user account.

## POST /accounts

This endpoint creates a new user account. This is a public endpoint and does not require authentication.

<Note>
  For most use cases, users should sign up through the web application at [app.llmgenerator.com](https://app.llmgenerator.com). This endpoint is primarily for programmatic account creation.
</Note>

### Request Body

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

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

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

<ParamField body="company" type="string">
  The name of the user's company (max 100 characters).
</ParamField>

### Response

<ResponseField name="success" type="boolean">
  Whether the account was created successfully.
</ResponseField>

<ResponseField name="message" type="string">
  A status message.
</ResponseField>

<ResponseField name="account" type="object">
  The created account details.

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

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

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

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

    <ResponseField name="plan" type="string">
      The account plan (starts as `free`).
    </ResponseField>

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

<ResponseField name="apiKey" type="string">
  The initial API key for the account. Save this securely.
</ResponseField>

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

  ```javascript Node.js theme={null}
  const response = await fetch(
    'https://api.llmgenerator.com/api/v1/accounts',
    {
      method: 'POST',
      headers: { 'Content-Type': 'application/json' },
      body: JSON.stringify({
        email: 'user@example.com',
        firstName: 'Jane',
        lastName: 'Doe',
        company: 'Acme Inc'
      })
    }
  );
  ```
</RequestExample>

<ResponseExample>
  ```json Success (201) theme={null}
  {
    "success": true,
    "message": "Account created successfully",
    "account": {
      "id": "user_abc123def456",
      "email": "user@example.com",
      "firstName": "Jane",
      "lastName": "Doe",
      "company": "Acme Inc",
      "plan": "free",
      "createdAt": "2026-01-27T10:00:00.000Z"
    },
    "apiKey": "llm_1706345678_initialkeyabc123"
  }
  ```

  ```json Validation Error (400) theme={null}
  {
    "message": "Validation error: Invalid email format"
  }
  ```

  ```json Email Already Exists (409) theme={null}
  {
    "message": "An account with this email already exists"
  }
  ```
</ResponseExample>
