> ## Documentation Index
> Fetch the complete documentation index at: https://guide.gpt-trainer.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Create Agent

> Create an agent for a chatbot specified by chatbot uuid

### Path

**uuid** `string` *required*

Chatbot uuid

### Body

**name** `string` *required*

**type** `string` *required*

One of the following values: `user-facing`, `background`, `human-escalation`,
`pre-canned`, `spam-defense`

**description** `string`

**prompt** `string`

**temperature** `float`

**meta** `meta Object`

**Chatbot meta**

**model** `string`| Model | Message Credits |
\|-------|-----------------| | gpt-3.5-turbo | 1 | | gpt-3.5-turbo-16k | 8 |
\| gpt-4-0125-preview-8k | 35 | | gpt-4-1106-preview-1k | 5 | |
gpt-4-1106-preview-2k | 10 | | gpt-4-1106-preview-4k | 20 | |
gpt-4-1106-preview-16k | 60 | | gpt-4o-1k | 3 | | gpt-4o-2k | 5 | |
gpt-4o-4k | 10 | | gpt-4o-8k | 20 | | gpt-4o-16k | 40 | | gpt-4o-mini-4k | 1
\| | gpt-4o-mini-16k | 8 | Only for `user-facing` and&#x20;
`background` agents.

**temperature** `float`

Between `0` and `1`

Only for `user-facing` agents.

**bias** `float`

Between `0` and `1`.\\

Only for `user-facing`, `human-escalation`, `pre-canned` and `spam-defense` agents.

**stickness** `float`

Between `0` and `1`.\\

Only for `user-facing`, `human-escalation`, `pre-canned` and `spam-defense` agents.

**default\_message** `string`

Only for `pre-canned` and `spam-defense` agents.

**tags** `tags Object`

Only for `background` agents.

**use\_all\_sources** `boolean`

Only for `user-facing` agents.

### Response

**uuid** `string`

**name** `string`

**prompt** `string`

**description** `string`

**type** `string`

**created\_at** `string`

**modified\_at** `string`

**enabled** `boolean`

> [!NOTE]
>
> By default, a newly created agent is disabled

**meta** `meta Object`

**data\_source\_uuids** `List[string]`

**human\_escalation\_settings** `HumanEscalationSettings Object`

**tool\_functions** `List[ToolFunction]`

**variables** `List[AgentVariable]`

```bash Curl theme={null}
curl --location --request POST 'https://app.gpt-trainer.com/api/v1/chatbot/{uuid}/agent/create' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer <token>' \
--data-raw '{
  "name": "string",
  "type": "string",
  "description": "string",
  "prompt": "string",
  "model": "string",
}'
```

```py Python theme={null}
import requests

url = 'https://app.gpt-trainer.com/api/v1/chatbot/{uuid}/agent/create'
headers = {
    'Content-Type': 'application/json',
    'Authorization': 'Bearer <token>'
}

data = {
  "name": "string",
  "type": "user-facing",
  "description": "string",
  "prompt": "string",
  "model": "gpt-4o-mini-4k",
}

response = requests.post(url, headers=headers, json=data)

if response.status_code == 200:
    print("Request successful!")
    print(response.json())
else:
    print("Request failed with status code:", response.status_code)
    print(response.text)
```

```ts JavaScript theme={null}
const axios = require("axios");

const url = "https://app.gpt-trainer.com/api/v1/chatbot/{uuid}/agent/create";
const headers = {
  "Content-Type": "application/json",
  Authorization: "Bearer <token>",
};

const data = {
  name: "string",
  prompt: "string",
  temperature: 0,
  model: "gpt-3.5-turbo",
  rate_limit: [20, 240],
  rate_limit_message: "Too many messages",
  show_citations: false,
  visibility: "private",
};

axios
  .post(url, data, { headers })
  .then((response) => {
    console.log("Request successful!");
    console.log(response.data);
  })
  .catch((error) => {
    console.error("Request failed:", error);
  });
```

```json Response theme={null}
{
  "created_at": "2024-07-25T21:19:01Z",
  "description": "test for creating new agents",
  "enabled": 0,
  "meta": {
    "model": "gpt-4o-mini-4k",
    "tags": [],
    "temperature": 0.0
  },
  "modified_at": "2024-07-25T21:19:01Z",
  "name": "TEST create new agent",
  "prompt": "a test user-facing agent",
  "type": "user-facing",
  "uuid": "43474da7ae3b4b7191ee29c2de798257",
  "variables": []
}
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.