> For the complete documentation index, see [llms.txt](https://incubiq.gitbook.io/opensourceais/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://incubiq.gitbook.io/opensourceais/apis/client-apps/authenticate-into-osais.md).

# Authenticate into OSAIS

## Authenticates a Client into OSAIS backend

<mark style="color:green;">`POST`</mark> `https://opensourceAIs.com/api/v1/public/client/login`

#### Request Body

| Name                                     | Type   | Description                                   |
| ---------------------------------------- | ------ | --------------------------------------------- |
| token<mark style="color:red;">\*</mark>  | String | Your token, as received at registration time  |
| secret<mark style="color:red;">\*</mark> | String | Your secret, as received at registration time |

{% tabs %}
{% tab title="201: Created Your authentication token is delivered" %}

```json
{
 "data": {
        "token": "a641d628f31b456af7ccc388d140bb0e1fc2",
        "authToken": "eyJhbGciOiJIUzI1CI6IkpXVCJ9.eyJ1c2VybmFtZSI6Imh0dHA6Ly8xOTIuMTY4LjEuMTA4OjMwMjIiLCJ0b2tlbiI6ImE2NDFkNjQxM2E5OWY4ZmU1MGEyOGYzMWI0NTZhZjdjY2MzOGNkMzRiYWFjODdlNWY5NzhkMTQwYmIwZTFmYzIiLCJpYXQiOjE2NzgyOTY4MzEsImV4cCIX0.dIlfgqV8z9GcEBhgr1ksPGiNgC4yRXVkxZNICdnOLbU",
        "duration": "72h"
    }
}
```

{% endtab %}

{% tab title="404: Not Found Your token was not recognized" %}

```json
{
    "data": null,
    "status": 404,
    "message": "Could not find client"
}
```

{% endtab %}

{% tab title="401: Unauthorized Your secret was not valid" %}

```javascript
{
    "data": null,
    "status": 401,
    "message": "Invalid secret"
}
```

{% endtab %}

{% tab title="400: Bad Request You need to pass a token and a secret" %}

```json
{
    data:null,
    status: 400,
    statusText: "Token required"    
}

```

{% endtab %}
{% endtabs %}
