# Authentication

The MAXIR AI Open API uses an API Key for authentication. Every API request must include your API Key. The API Key is used for request authentication and usage quota tracking.

<Tip>
When accessing resources within a specific project through the API, you must use the API Key from that project for authentication.
</Tip>

Please note that **your API Key is a very important confidential information**. Do not share it with anyone, nor expose it in browser, application, or other client code.

All API requests must include your API Key in the `x-pd-api-key` HTTP header, for example:

```shell
x-pd-api-key: API_KEY
```

---

## Making Requests

You can copy and paste the following command into your terminal to make your first API request. Before executing the request, replace `$PROJECT_API_KEY` with your API Key, `$USER_ID` with your actual user ID, and `<domain_name>` in the URL with an actual domain name.

<CodeGroup>

```curl cURL
curl --request POST \
  --url https://<domain_name>/v2/team/sessions \
  --header 'Content-Type: application/json' \
  --header 'x-pd-api-key: $PROJECT_API_KEY' \
  --data '{
  "name": "My session",
  "output_language": "FR",
  "job_mode": "AUTO",
  "max_contextual_job_history": 10,
  "agent_id": "DATA_ANALYSIS_AGENT",
  "user_id": "$USER_ID"
}'
```

```python Python
import requests

url = "https://<domain_name>/app/api/v2/team/sessions"

payload = {
    "name": "My session",
    "output_language": "FR",
    "job_mode": "AUTO",
    "max_contextual_job_history": 10,
    "agent_id": "DATA_ANALYSIS_AGENT",
    "user_id": "tmm-dafasdfasdfasdf"
}
headers = {
    "x-pd-api-key": "$PROJECT_API_KEY",
    "Content-Type": "application/json"
}

response = requests.request("POST", url, json=payload, headers=headers)

print(response.text)
```

</CodeGroup>