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

# Create Session

> Initialize a new chat session with Neyrs agent

### Authorization

<ParamField header="Authorization" type="string" required>
  Bearer token. Format: `Bearer neyrs_live_abc123def456`
</ParamField>

### Body Parameters

<ParamField body="walletAddress" type="string" required>
  Solana wallet address. Format: Base58 encoded public key
</ParamField>

<ParamField body="metadata" type="object">
  Optional session metadata

  Properties:

  * `userAgent` (string): Client user agent
  * `ipAddress` (string): Client IP address
  * `referrer` (string): Referrer URL
</ParamField>

### Response

<ResponseField name="sessionId" type="string">
  Unique session identifier. Format: `session_<16 chars>`
</ResponseField>

<ResponseField name="walletAddress" type="string">
  Connected wallet address
</ResponseField>

<ResponseField name="createdAt" type="string">
  ISO 8601 timestamp of session creation
</ResponseField>

<ResponseField name="expiresAt" type="string">
  ISO 8601 timestamp of session expiration (24 hours)
</ResponseField>

<RequestExample>
  ```bash cURL theme={null}
  curl --request POST \
    --url https://api.neyrs.cloud/v1/sessions \
    --header 'Authorization: Bearer neyrs_live_abc123def456' \
    --header 'Content-Type: application/json' \
    --data '{
      "walletAddress": "7xKXtg2CW87d97TXJSDpbD5jBkheTqA83TZRuJosgAsU"
    }'
  ```

  ```javascript Node.js theme={null}
  const response = await fetch('https://api.neyrs.cloud/v1/sessions', {
    method: 'POST',
    headers: {
      'Authorization': `Bearer ${process.env.NEYRS_API_KEY}`,
      'Content-Type': 'application/json'
    },
    body: JSON.stringify({
      walletAddress: '7xKXtg2CW87d97TXJSDpbD5jBkheTqA83TZRuJosgAsU'
    })
  });
  ```

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

  response = requests.post(
      'https://api.neyrs.cloud/v1/sessions',
      headers={
          'Authorization': f'Bearer {api_key}',
          'Content-Type': 'application/json'
      },
      json={
          'walletAddress': '7xKXtg2CW87d97TXJSDpbD5jBkheTqA83TZRuJosgAsU'
      }
  )
  ```
</RequestExample>

<ResponseExample>
  ```json 200 - Success theme={null}
  {
    "sessionId": "session_abc123def456",
    "walletAddress": "7xKXtg2CW87d97TXJSDpbD5jBkheTqA83TZRuJosgAsU",
    "createdAt": "2024-03-08T14:30:00Z",
    "expiresAt": "2024-03-09T14:30:00Z"
  }
  ```

  ```json 400 - Bad Request theme={null}
  {
    "error": {
      "code": "validation_error",
      "message": "Invalid wallet address format",
      "field": "walletAddress"
    }
  }
  ```
</ResponseExample>
