# Getting Started with the SDK

## Installation

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

<pre class="language-bash"><code class="lang-bash"><strong>npm install cortex-ts
</strong></code></pre>

{% endtab %}

{% tab title="Python" %}

```bash
pip install trycortex
```

{% endtab %}
{% endtabs %}

## Create a CortexAPI

Create environment variables for your cortex API key.

Use the API key to create a CortexAPI.

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

```typescript
import { CortexAPI } from 'cortex-ts';
const {CORTEX_API_KEY} = process.env;

const cortex = new CortexAPI(CORTEX_API_KEY);
```

{% endtab %}

{% tab title="Python" %}

```python
import cortex

CortexAPI = cortex.CortexAPI(API_KEY)
```

{% endtab %}
{% endtabs %}


---

# 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.trycortex.ai/guides/getting-started-with-the-sdk.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.
