---
title: "Create an Agent."
method: POST
path: "/v1/agents"
tags: ["agents"]
---

# Create an Agent.

`POST /v1/agents`

Create a new Agent with a name and optional public visibility. The Agent will be assigned a unique ID.

## Request body

- AgentCreateParameters — Parameters for creating a new Agent.
  - `name` string, required — The name of the Agent.
  - `version` string, nullable — Optional version identifier for the Agent. For npm/pip sources this is typically a semver string (e.g. '2.0.65'). For git sources it can be a branch or tag. Semantics are user-defined for object sources.
  - `source` AgentSource — Agent source configuration.
    - `type` string, required — Source type: npm, pip, object, or git
    - `npm` NpmSource — NPM-based agent source configuration.
      - `package_name` string, required — NPM package name
      - `registry_url` string, nullable — NPM registry URL
      - `agent_setup` string[], nullable — Setup commands to run after installation
    - `pip` PipSource — Pip-based agent source configuration.
      - `package_name` string, required — Pip package name
      - `registry_url` string, nullable — Pip registry URL
      - `agent_setup` string[], nullable — Setup commands to run after installation
    - `object` ObjectSource — Object store agent source configuration.
      - `object_id` string, required — Object ID
      - `agent_setup` string[], nullable — Setup commands to run after unpacking
    - `git` GitSource — Git-based agent source configuration.
      - `repository` string, required — Git repository URL
      - `ref` string, nullable — Optional Git ref (branch/tag/commit), defaults to main/HEAD
      - `agent_setup` string[], nullable — Setup commands to run after cloning

## Response `200`

Agent created successfully. Returns the Agent with metadata.

- AgentView — An Agent represents a registered AI agent entity.
  - `id` string, required — The unique identifier of the Agent.
  - `name` string, required — The name of the Agent.
  - `version` string, nullable — Optional version identifier for the Agent. For npm/pip sources this is typically a semver string (e.g. '2.0.65'). For git sources it can be a branch or tag. Omitted for object sources or when not provided.
  - `create_time_ms` integer, required — The creation time of the Agent (Unix timestamp milliseconds).
  - `is_public` boolean, required — Whether the Agent is publicly accessible.
  - `source` AgentSource — Agent source configuration.
    - `type` string, required — Source type: npm, pip, object, or git
    - `npm` NpmSource — NPM-based agent source configuration.
      - `package_name` string, required — NPM package name
      - `registry_url` string, nullable — NPM registry URL
      - `agent_setup` string[], nullable — Setup commands to run after installation
    - `pip` PipSource — Pip-based agent source configuration.
      - `package_name` string, required — Pip package name
      - `registry_url` string, nullable — Pip registry URL
      - `agent_setup` string[], nullable — Setup commands to run after installation
    - `object` ObjectSource — Object store agent source configuration.
      - `object_id` string, required — Object ID
      - `agent_setup` string[], nullable — Setup commands to run after unpacking
    - `git` GitSource — Git-based agent source configuration.
      - `repository` string, required — Git repository URL
      - `ref` string, nullable — Optional Git ref (branch/tag/commit), defaults to main/HEAD
      - `agent_setup` string[], nullable — Setup commands to run after cloning

## Other responses

- `400` — Bad request. Invalid name or parameters.
- `401` — Unauthorized. Invalid or missing authentication.
- `403` — Forbidden. Account does not have devbox capability.
- `500` — Internal server error.

---

[API](https://skmtc.dev/runloopai/apis/runloop-api.md) · [All operations](https://skmtc.dev/runloopai/apis/runloop-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/runloopai/runloop-api/revisions/e9dc776053e4/schema)
