---
title: "CreateAgent"
method: POST
path: "/gitpod.v1.AgentService/CreateAgent"
tags: ["gitpod.v1.AgentService"]
---

# CreateAgent

`POST /gitpod.v1.AgentService/CreateAgent`

Creates a new agent.

 Use this method to:
 - Define new agents with custom prompts and tools

## Request body

- GitpodV1CreateAgentRequest
  - `description` string — A description of what the agent does
  - `name` string — The name of the agent
  - `spec` GitpodV1AgentSpec
    - `prompts` GitpodV1AgentSpecPrompts[] — The prompts configuration for each supported model. One cannot have multiple prompts for the same model - this will return an invalid argument error.
      - `improvePrompt` string — The prompt used to improve the agent's prompt
      - `initialMessage` string — The initial message sent to the user. If empty, the agent will start in WAITING_FOR_INPUT state
      - `judgementPrompt` string — The prompt used to evaluate agent's performance and provide final assessment
      - `model` 'SUPPORTED_MODEL_UNSPECIFIED' | 'SUPPORTED_MODEL_SONNET_3_5' | 'SUPPORTED_MODEL_SONNET_3_7' | 'SUPPORTED_MODEL_SONNET_3_7_EXTENDED' | 'SUPPORTED_MODEL_SONNET_4' | 'SUPPORTED_MODEL_SONNET_4_EXTENDED' | 'SUPPORTED_MODEL_OPUS_4' | 'SUPPORTED_MODEL_OPUS_4_EXTENDED' | 'SUPPORTED_MODEL_OPENAI_4O' | 'SUPPORTED_MODEL_OPENAI_4O_MINI' | 'SUPPORTED_MODEL_OPENAI_O1' | 'SUPPORTED_MODEL_OPENAI_O1_MINI'
      - `systemPrompt` string — The system prompt that defines the agent's role and capabilities
    - `requiredTools` string[] — The list of tools required by this agent to function

## Response `200`

Success

- GitpodV1CreateAgentResponse
  - `agent` GitpodV1Agent, required
    - `id` string
    - `metadata` GitpodV1AgentMetadata
      - `description` string
      - `name` string
    - `spec` GitpodV1AgentSpec
      - `prompts` GitpodV1AgentSpecPrompts[] — The prompts configuration for each supported model. One cannot have multiple prompts for the same model - this will return an invalid argument error.
        - `improvePrompt` string — The prompt used to improve the agent's prompt
        - `initialMessage` string — The initial message sent to the user. If empty, the agent will start in WAITING_FOR_INPUT state
        - `judgementPrompt` string — The prompt used to evaluate agent's performance and provide final assessment
        - `model` 'SUPPORTED_MODEL_UNSPECIFIED' | 'SUPPORTED_MODEL_SONNET_3_5' | 'SUPPORTED_MODEL_SONNET_3_7' | 'SUPPORTED_MODEL_SONNET_3_7_EXTENDED' | 'SUPPORTED_MODEL_SONNET_4' | 'SUPPORTED_MODEL_SONNET_4_EXTENDED' | 'SUPPORTED_MODEL_OPUS_4' | 'SUPPORTED_MODEL_OPUS_4_EXTENDED' | 'SUPPORTED_MODEL_OPENAI_4O' | 'SUPPORTED_MODEL_OPENAI_4O_MINI' | 'SUPPORTED_MODEL_OPENAI_O1' | 'SUPPORTED_MODEL_OPENAI_O1_MINI'
        - `systemPrompt` string — The system prompt that defines the agent's role and capabilities
      - `requiredTools` string[] — The list of tools required by this agent to function

## Other responses

- `default` — Error

## Changes

- **2025-06-10** `ca9a49ac7fbb` — 1 info
  - endpoint added

[Change history](https://skmtc.dev/gitpod-io/apis/gitpod-v1/changes/gitpod.v1.AgentService/CreateAgent/post.md)

---

[API](https://skmtc.dev/gitpod-io/apis/gitpod-v1.md) · [All operations](https://skmtc.dev/gitpod-io/apis/gitpod-v1/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/gitpod-io/gitpod-v1/revisions/ca9a49ac7fbb/schema)
