> For the complete documentation index, see [llms.txt](https://developers.samochat.net/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developers.samochat.net/authentication.md).

# Authentication

The SamoChat API uses a bearer token to authenticate requests but first, you have to get it by using your `client_id` and `client_secret`. In order to get them you'll need to contact us at <info@samochat.net>, and write the following:

* Why you need access to the API?
* The link to your SamoChat profile

You'll only get access if you're already a SamoChat user.

{% hint style="info" %}
The access token will expire after 24 hours
{% endhint %}

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

```
curl --location --request POST 'https://samochat.eu.auth0.com/oauth/token' \
--header 'Content-Type: application/json' \
--data-raw '{
    "client_id": "{client_id}",
    "client_secret": "{client_secret}",
    "audience": "https://api.samochat.net",
    "grant_type": "client_credentials"
}
```

{% endtab %}

{% tab title=".NET library" %}

```csharp
using SamoChatNet;
 
 SamoChatConfig.ClientID = "ClientID";
 SamoChatConfig.ClientSecret = "ClientSecret";
```

{% endtab %}

{% tab title="Python library" %}

```python
import samochat

samochat.client_id = "client_id"
samochat.client_secret = "client_secret"
```

{% endtab %}
{% endtabs %}
