> 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 %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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://incubiq.gitbook.io/opensourceais/apis/client-apps/authenticate-into-osais.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.
