> For the complete documentation index, see [llms.txt](https://judini.gitbook.io/api-judini/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://judini.gitbook.io/api-judini/reference/api-reference/agents.md).

# Agents

In this section you can interact with your agents. To get the response from an agent check the "completion" endpoint

## Get all agents

Get the complete list of agents you have created in your account

## get all agents

<mark style="color:blue;">`GET`</mark> `plus.codegpt.co/api/v1/agent`

#### Headers

| Name                                            | Type   | Description     |
| ----------------------------------------------- | ------ | --------------- |
| Authorization<mark style="color:red;">\*</mark> | string | Bearer {apiKey} |

{% tabs %}
{% tab title="200 Array of agents" %}

```javascript
{
    "status":200,
    "body":
        {
            "agents":[
                "name": "Agent 1"
                "id": "xxxxx-xxxxxx-xxxxxx"
            ]
        }
}
```

{% endtab %}

{% tab title="401 Permission denied" %}

{% endtab %}
{% endtabs %}

## Get single agent

## get a single agent

<mark style="color:blue;">`GET`</mark> `plus.codegpt.co/api/v1/agent/{id}`

#### Headers

| Name                                            | Type   | Description     |
| ----------------------------------------------- | ------ | --------------- |
| Authorization<mark style="color:red;">\*</mark> | string | Bearer {apiKey} |

{% tabs %}
{% tab title="200 Array of agents" %}

```javascript
{
    "status":200,
    "body":
        {
            "agents":[
                "name": "Agent 1"
                "id": "xxxxx-xxxxxx-xxxxxx"
            ]
        }
}
```

{% endtab %}

{% tab title="401 Permission denied" %}

{% endtab %}
{% endtabs %}

## Completion from an agent

Send a message and the agent will respond via stream according to the configuration it has

## Get the completion from an agent

<mark style="color:green;">`POST`</mark> `plus.codegpt.co/api/agent/{id}`

#### Headers

| Name                                            | Type   | Description     |
| ----------------------------------------------- | ------ | --------------- |
| Authorization<mark style="color:red;">\*</mark> | string | Bearer {apiKey} |

#### Request Body

| Name                                       | Type  | Description                                                                                                                                                                                                            |
| ------------------------------------------ | ----- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| messages<mark style="color:red;">\*</mark> | array | <p>\[</p><p>    { role: "user", content: "Hello" },</p><p>    { role: "assistant", content: "Hi, how can i help you?" },</p><p>    { role: "user", content: "How can I make a calculator in javascript?" }</p><p>]</p> |

{% tabs %}
{% tab title="200 Stream => { "data": ""}" %}

```javascript
{
    "status": 200,
    "body": {
        "data": "text"
    }
}
```

{% endtab %}

{% tab title="401 Permission denied" %}

{% endtab %}
{% endtabs %}

## Completion without an agent

## Get the completion without an agent

<mark style="color:green;">`POST`</mark> `plus.codegpt.co/api/v1/agent`

#### Headers

| Name                                            | Type   | Description     |
| ----------------------------------------------- | ------ | --------------- |
| Authorization<mark style="color:red;">\*</mark> | string | Bearer {apiKey} |

#### Request Body

| Name                                       | Type  | Description                                                                                                                                                                                                            |
| ------------------------------------------ | ----- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| messages<mark style="color:red;">\*</mark> | array | <p>\[</p><p>    { role: "user", content: "Hello" },</p><p>    { role: "assistant", content: "Hi, how can i help you?" },</p><p>    { role: "user", content: "How can I make a calculator in javascript?" }</p><p>]</p> |

{% tabs %}
{% tab title="200 Stream => { "data": ""}" %}

```javascript
{
    "status": 200,
    "body": {
        "data": "text"
    }
}
```

{% endtab %}

{% tab title="401 Permission denied" %}

{% endtab %}
{% endtabs %}
