> ## Documentation Index
> Fetch the complete documentation index at: https://docs.rapidagent.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# /agents

> Create new agent.

### Body

<ParamField body="name" type="string">
  A name for the agent
</ParamField>

<ParamField body="type" type="string">
  The agent type, valid values: `OPENAI`, `REACT`
</ParamField>

<ParamField body="llm" type="object">
  The large language model you want to use with the agent.

  <Expandable title="llm object">
    <ResponseField name="provider" type="string">
      The LLM provider, options: `openai`, `openai-chat`, `anthropic`, `cohere`
    </ResponseField>

    <ResponseField name="model" type="string">
      The specific model you want to run, e.g `gpt-3.5-turbo`, `gpt-4`,
      'claude-v1\` etc.
    </ResponseField>

    <ResponseField name="api_key" type="string">
      Enter an optional API key if you want to use your own account for the
      specific LLM provider.
    </ResponseField>
  </Expandable>
</ParamField>

<ParamField body="hasMemory" type="boolean">
  If the agent should have memory
</ParamField>

<ParamField body="promptId" type="string">
  A valid `promptId`
</ParamField>

<ParamField body="tags" type="object">
  An array of valid `tag` objects
</ParamField>

### Response

<ResponseField name="success" type="boolean">
  Indicates whether the call was successful.
</ResponseField>

<ResponseField name="data" type="object">
  Agent object
</ResponseField>

<RequestExample>
  ```bash Example Request theme={null}
  curl --location --request POST 'https://api.rapidagent.ai/api/v1/agents' \
  --header 'Content-Type: application/json' \
  --header 'Autorization: Bearer <token>'
  --data-raw '{
      "name": "My agent",
      "type": "OPENAI",
      "llm": {
        "model": "openai-chat",
        "provider": "gpt-3.5-turbo"
      }
      "hasMemory": true,
  }'
  ```
</RequestExample>

<ResponseExample>
  ```json Response theme={null}
  {
    "success": true,
    "data": {
        "id": "clhjk4hab00016iewrghkbs28",
        "userId": "clhj28u1300006ig02ptpm1sh",
        "user": {},
        "name": "Test Agent",
        "type": "REACT",
        "tags": [],
        "llm": {
            "model": "gpt-3.5-turbo",
            "provider": "openai-chat"
        },
        "hasMemory": true,
        "AgentMemory": null
      }
  }
  ```
</ResponseExample>
