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

# Create Agent

Create a new agent configuration. All agent configuration must be provided within the `system_config` object. The `name` field in the config is required and will be used to derive the `agent_key`.

## Request Body

<ParamField body="system_config" type="object" required>
  Complete agent configuration object

  <Expandable title="system_config Properties">
    <ParamField body="name" type="string" required>
      Agent name (used to derive agent\_key)
    </ParamField>

    <ParamField body="agent_type" type="string" required>
      Type of agent (e.g., "llm\_agent")
    </ParamField>

    <ParamField body="system_prompt" type="string" required>
      Instructions defining agent behavior
    </ParamField>

    <ParamField body="llm_config" type="object" required>
      LLM configuration settings

      <Expandable title="llm_config Properties">
        <ParamField body="model" type="string" required>
          Model to use (e.g., "gpt-4o")
        </ParamField>

        <ParamField body="temperature" type="number">
          Response randomness (0.0-1.0)
        </ParamField>

        <ParamField body="max_tokens" type="integer">
          Maximum response length
        </ParamField>
      </Expandable>
    </ParamField>

    <ParamField body="knowledge_bases" type="array">
      Connected knowledge bases for retrieval
    </ParamField>

    <ParamField body="tools" type="array">
      Available tools (e.g., \["tavily\_search"])
    </ParamField>
  </Expandable>
</ParamField>

<CodeGroup>
  ```bash cURL theme={null}
  curl -X POST https://api.artaios.ai/api/v1/agent/ \
    -H "x-api-key: YOUR_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{
      "system_config": {
        "name": "Support Agent",
        "agent_type": "llm_agent",
        "system_prompt": "You are a helpful customer support agent.",
        "llm_config": {
          "model": "gpt-4o",
          "temperature": 0.7
        }
      }
    }'
  ```

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

  data = {
      "system_config": {
          "name": "Support Agent",
          "agent_type": "llm_agent",
          "system_prompt": "You are a helpful customer support agent.",
          "llm_config": {
              "model": "gpt-4o",
              "temperature": 0.7
          }
      }
  }

  response = requests.post(
      "https://api.artaios.ai/api/v1/agent/",
      headers={"x-api-key": "YOUR_API_KEY"},
      json=data
  )
  agent = response.json()
  ```

  ```javascript JavaScript theme={null}
  const data = {
    system_config: {
      name: "Support Agent",
      agent_type: "llm_agent",
      system_prompt: "You are a helpful customer support agent.",
      llm_config: {
        model: "gpt-4o",
        temperature: 0.7
      }
    }
  };

  const response = await fetch('https://api.artaios.ai/api/v1/agent/', {
    method: 'POST',
    headers: {
      'x-api-key': 'YOUR_API_KEY',
      'Content-Type': 'application/json'
    },
    body: JSON.stringify(data)
  });

  const agent = await response.json();
  ```
</CodeGroup>

## Response

Returns the created agent configuration:

```json theme={null}
{
  "id": "550e8400-e29b-41d4-a716-446655440001",
  "agent_key": "support_agent",
  "name": "Support Agent",
  "architecture": "llm_agent",
  "entry_point": "main",
  "is_public": false,
  "is_shared": false,
  "origin_url": null,
  "owner": "user_123",
  "company": "company_456",
  "system_config": {
    "name": "Support Agent",
    "agent_type": "llm_agent",
    "system_prompt": "You are a helpful customer support agent.",
    "llm_config": {
      "model": "gpt-4o",
      "temperature": 0.7,
      "max_tokens": 1000
    },
    "knowledge_bases": [
      {
        "name": "support_docs",
        "knowledge_base_type": "milvus",
        "knowledge_base_id": "kb_123"
      }
    ]
  },
  "version_number": "1.0.0",
  "config_hash": "b2c3d4e5f6a7",
  "created_at": "2025-01-15T10:30:00Z",
  "updated_at": "2025-01-15T10:30:00Z"
}
```

<Note>
  The `agent_key` is automatically derived from the agent name and serves as a unique identifier for the agent.
</Note>
