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

# Quickstart

> Get started with Synthra in under 5 minutes

Install and configure Synthra to build your first conversational AI agent.

## Installation

<CodeGroup>
  ```bash npm theme={null}
  npm install @synthra/agent
  ```

  ```bash yarn theme={null}
  yarn add @synthra/agent
  ```

  ```bash pnpm theme={null}
  pnpm add @synthra/agent
  ```
</CodeGroup>

## Initialize the Agent

```typescript theme={null}
import { SynthraAgent } from '@synthra/agent';

const agent = new SynthraAgent({
  apiKey: process.env.SYNTHRA_API_KEY,
  endpoint: 'https://api.synthra.ai',
  timeout: 10000
});
```

## Create a Session

```typescript theme={null}
const session = agent.createSession('user_abc123def456');

console.log(`Session created: ${session.id}`);
// Output: Session created: session_9f8e7d6c5b4a
```

## Send Your First Message

```typescript theme={null}
const response = await agent.sendMessage(
  session.id,
  'Hello, Synthra! What can you help me with?'
);

console.log(response.content);
// Output: Hello! I'm Synthra, your AI assistant...
```

## Configuration Options

```typescript theme={null}
const agent = new SynthraAgent({
  apiKey: process.env.SYNTHRA_API_KEY,
  endpoint: 'https://api.synthra.ai',
  timeout: 10000,
  retryAttempts: 3,
  contextConfig: {
    maxTokens: 8192,
    compressionEnabled: true,
    retentionPolicy: 'semantic'
  },
  rateLimits: {
    requestsPerMinute: 100,
    tokensPerMinute: 50000
  }
});
```

## Complete Example

```typescript theme={null}
import { SynthraAgent } from '@synthra/agent';

async function main() {
  // Initialize agent
  const agent = new SynthraAgent({
    apiKey: process.env.SYNTHRA_API_KEY
  });

  // Create session
  const session = agent.createSession('user_abc123def456');

  // Send messages
  const response1 = await agent.sendMessage(
    session.id,
    'What is the current price of SOL?'
  );
  console.log(response1.content);

  const response2 = await agent.sendMessage(
    session.id,
    'How has it changed in the last 24 hours?'
  );
  console.log(response2.content);

  // Get session history
  const history = await agent.getHistory(session.id);
  console.log(`Total messages: ${history.length}`);

  // Clean up
  await agent.deleteSession(session.id);
}

main().catch(console.error);
```

## Next Steps

<CardGroup cols={2}>
  <Card title="Session Management" icon="comments" href="/core-features/session-management">
    Learn about session lifecycle and configuration
  </Card>

  <Card title="Context Compression" icon="compress" href="/core-features/context-compression">
    Understand context window management
  </Card>

  <Card title="Solana Integration" icon="link" href="/integrations/solana">
    Integrate blockchain capabilities
  </Card>

  <Card title="API Reference" icon="book" href="/api-reference/introduction">
    Explore the complete API
  </Card>
</CardGroup>

<Note>
  API keys can be generated from the [Developer Dashboard](https://synthraai.dev/dashboard). Store keys securely and never expose them in client-side code.
</Note>
