# Installation

This guide covers installing the Amigo SDK in your Python or TypeScript/JavaScript project.

{% hint style="warning" %}
**Classic API only.** These SDKs are for the Classic API. Platform API developers should use the [Platform SDK](/developer-guide/platform-api/platform-sdk.md) for TypeScript or direct HTTP while additional first-party Platform SDKs are added.
{% endhint %}

{% tabs %}
{% tab title="Python" %}

#### Requirements

* Python 3.11 or higher
* pip (Python package manager)

#### Install from PyPI

Install the latest version of the Python SDK using pip:

```bash
pip install amigo_sdk
```

#### Add to requirements.txt

For reproducible builds, add the SDK to your `requirements.txt` file:

```txt
amigo_sdk
```

Then install dependencies:

```bash
pip install -r requirements.txt
```

#### Virtual Environment (Recommended)

We recommend using a virtual environment to avoid dependency conflicts:

```bash
# Create virtual environment
python -m venv amigo-env

# Activate virtual environment
# On macOS/Linux:
source amigo-env/bin/activate
# On Windows:
amigo-env\Scripts\activate

# Install SDK
pip install amigo_sdk
```

#### Verify Installation

Verify the installation by importing the SDK:

```python
from amigo_sdk import AmigoClient
print("Amigo Python SDK installed successfully!")
```

{% endtab %}

{% tab title="TypeScript" %}

#### Requirements

* Node.js 18 or higher
* npm or yarn package manager

#### Install from npm

Install the latest version of the TypeScript SDK:

```bash
npm install @amigo-ai/sdk
```

#### Add to package.json

The SDK will be automatically added to your `package.json` dependencies:

```json
{
  "dependencies": {
    "@amigo-ai/sdk": "^1.0.0"
  }
}
```

#### TypeScript Configuration

If you're using TypeScript, ensure your `tsconfig.json` includes:

```json
{
  "compilerOptions": {
    "target": "ES2022",
    "module": "ESNext",
    "moduleResolution": "bundler",
    "strict": true,
    "esModuleInterop": true,
    "skipLibCheck": true,
    "forceConsistentCasingInFileNames": true
  }
}
```

#### Verify Installation

Verify the installation by importing the SDK:

```typescript
import { AmigoClient } from '@amigo-ai/sdk'
console.log('Amigo TypeScript SDK installed successfully!')
```

{% endtab %}
{% endtabs %}

## Configuration Setup

Both SDKs support initialization with configuration parameters passed directly to the client constructor.

{% hint style="info" %}
**Regional endpoints.** Ensure you set the correct regional base URL for your organization. See [Regions & Endpoints](/developer-guide/getting-started/regions-and-endpoints.md).
{% endhint %}

{% tabs %}
{% tab title="Python" %}

```python
from amigo_sdk import AmigoClient

# Initialize with configuration parameters
with AmigoClient(
    api_key="your-api-key",
    api_key_id="your-api-key-id",
    user_id="user-id",
    organization_id="your-organization-id",
    base_url="https://api.amigo.ai"  # optional
) as client:
    # Use the client
    pass
```

{% endtab %}

{% tab title="TypeScript" %}

```typescript
import { AmigoClient } from '@amigo-ai/sdk'

// Initialize with configuration parameters
const client = new AmigoClient({
  apiKey: 'your-api-key',
  apiKeyId: 'your-api-key-id',
  userId: 'user-id',
  orgId: 'your-organization-id',
  baseUrl: 'https://api.amigo.ai' // optional
})
```

{% endtab %}
{% endtabs %}

## Environment Variables

For enhanced security, use environment variables for configuration. Create a `.env` file in your project root:

```env
AMIGO_API_KEY=your-api-key
AMIGO_API_KEY_ID=your-api-key-id
AMIGO_USER_ID=user-id
AMIGO_ORGANIZATION_ID=your-organization-id
AMIGO_BASE_URL=https://api.amigo.ai
```

{% tabs %}
{% tab title="Python" %}
Install `python-dotenv` to load environment variables:

```bash
pip install python-dotenv
```

Then load them in your application:

```python
from dotenv import load_dotenv
load_dotenv()

from amigo_sdk import AmigoClient

# Automatically loads from environment variables
with AmigoClient() as client:
    pass
```

{% endtab %}

{% tab title="TypeScript" %}
Install `dotenv`:

```bash
npm install dotenv
```

Then load them in your application:

```typescript
import 'dotenv/config'
import { AmigoClient } from '@amigo-ai/sdk'

// For TypeScript, you still need to pass config explicitly
const client = new AmigoClient({
  apiKey: process.env.AMIGO_API_KEY!,
  apiKeyId: process.env.AMIGO_API_KEY_ID!,
  userId: process.env.AMIGO_USER_ID!,
  orgId: process.env.AMIGO_ORGANIZATION_ID!,
})
```

{% endtab %}
{% endtabs %}

## Next Steps

Once you have the SDK installed, proceed to:

* [**SDK Configuration**](/developer-guide/classic-api/sdks/sdk-configuration.md)**.** Configure authentication and client options.
* [**Hello World Example**](/developer-guide/classic-api/sdks/sdk-hello-world.md)**.** Create your first conversation.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.amigo.ai/developer-guide/classic-api/sdks/sdk-installation.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
