---
title: "Create or update an agent"
method: POST
path: "/agents"
---

# Create or update an agent

`POST /agents`

## Request body

- AgentRequest
  - `id` string
  - `name` string
  - `description` string
  - `image` string
  - `privacy` 'public' | 'private' | 'team'
  - `isAutonomous` boolean
  - `prompt` string
  - `welcome` string
  - `model` 'gpt-3.5-turbo' | 'gpt-3.5-turbo-16k' | 'gpt-4' | 'palm-2' | 'llama-2-13b-chat' | 'llama-2-70b-chat' | 'codellama-13b-instruct' | 'codellama-13b-python' | 'mistral-7b' | 'zephyr-7b' | 'mistrallite-7b' | 'llava-13b' | 'fuyu-8b' | 'causallm-14b' — Name of the LLM model to use.
  - `params` ModelParameters — Model parameters
    - `temperature` number — model temperature between 0 and 1.0
    - `topP` number
    - `frequencePenalty` number
    - `presencePenalty` number
  - `tools` Tool[]
    - `id` string
    - `checked` boolean — Set to true if you want to include the tool as a plugin to the LLM call
  - `collections` string[]

## Response `200`

The result of the agent creation or update.

- AgentResponse
  - `ok` boolean
  - `agentId` string

## Other responses

- `400` — Invalid name or description.
- `403` — Exceeded agent allowance.
- `500` — Error creating or updating agent.

---

[API](https://skmtc.net/openindex/apis/openindex-ai-api.md) · [All operations](https://skmtc.net/openindex/apis/openindex-ai-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/openindex/openindex-ai-api/versions/c3a8b22ba407/schema)
