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

# アカウントの作成

> 新しいユーザーアカウントを作成するエンドポイントです。

## POST /accounts

新しいユーザーアカウントを作成します。公開エンドポイントであり、認証は不要です。

<Note>
  通常は [app.llmgenerator.com](https://app.llmgenerator.com) の Web アプリから登録してください。本エンドポイントは主にプログラムからアカウントを作成する用途向けです。
</Note>

### リクエストボディ

<ParamField body="email" type="string" required>
  ユーザーのメールアドレス。一意である必要があります。
</ParamField>

<ParamField body="firstName" type="string" required>
  ユーザーの名（1〜50 文字）。
</ParamField>

<ParamField body="lastName" type="string">
  ユーザーの姓（最大 50 文字）。
</ParamField>

<ParamField body="company" type="string">
  ユーザーの会社名（最大 100 文字）。
</ParamField>

### レスポンス

<ResponseField name="success" type="boolean">
  アカウントが正常に作成されたかどうか。
</ResponseField>

<ResponseField name="message" type="string">
  ステータスメッセージ。
</ResponseField>

<ResponseField name="account" type="object">
  作成されたアカウントの詳細。

  <Expandable title="account のプロパティ">
    <ResponseField name="id" type="string">
      アカウントの一意な識別子。
    </ResponseField>

    <ResponseField name="email" type="string">
      ユーザーのメールアドレス。
    </ResponseField>

    <ResponseField name="firstName" type="string">
      ユーザーの名。
    </ResponseField>

    <ResponseField name="lastName" type="string">
      ユーザーの姓。
    </ResponseField>

    <ResponseField name="plan" type="string">
      アカウントのプラン（初期は `free`）。
    </ResponseField>

    <ResponseField name="createdAt" type="string">
      アカウント作成日時の ISO 8601 タイムスタンプ。
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="apiKey" type="string">
  アカウント用の初期 API キー。安全に保管してください。
</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 成功 (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 バリデーションエラー (400) theme={null}
  {
    "message": "Validation error: Invalid email format"
  }
  ```

  ```json メールアドレスは既に登録済み (409) theme={null}
  {
    "message": "An account with this email already exists"
  }
  ```
</ResponseExample>
