---
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, required — The version of the Agent. Must be a semver string (e.g., '2.0.65') or a SHA.
  - `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, required — The version of the Agent. A semver string (e.g., '2.0.65') or a SHA.
  - `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.

## Changes

- **2025-12-13** `370a5d676ff0` — 1 breaking, 4 warning, 1 info
  - added the new required request property `version`
  - removed the request property `source/npm/npm_version`
  - removed the request property `source/pip/pip_version`
  - removed the optional property `source/npm/npm_version` from the response with the `200` status
  - …2 more
- **2025-11-19** `5f33221208c1` — 1 info
  - endpoint added

[Change history](https://skmtc.dev/runloopai/apis/runloop-api/changes/v1/agents/post.md)

---

[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/f0eb12cf4df4/schema)
