# Create runner in project

`POST /v1/projects/{project}/runnerPools/{pool}/runners`, operation `environments.CreateRunnerInProject`

Adds a runner to a pool and returns a one-time registration token valid for one hour.

The runner counts against the organization's environments.runners quota from creation until deleted (or until its registration token expires unused). Run kosem-runner register with the token; kosem stores only its hash.

## Parameters

| Name | In | Required | Type | Description |
| --- | --- | --- | --- | --- |
| `project` | path | Yes | `string` | The project's ID. |
| `pool` | path | Yes | `string` | The runner pool's ID. |

## Request body

Content-Type: `application/json` (required)

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `displayName` | `string` | Yes | Name shown in user interfaces, such as the host's. |

## Responses

### 201

Created

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `registrationToken` | `string` | Yes | One-time token valid for one hour, passed to kosem-runner register --token. kosem stores only its hash, so it isn't shown again. |
| `runner` | `Runner` | Yes |  |
| `runner.createTime` | `string (date-time)` | Yes |  |
| `runner.displayName` | `string` | Yes | Name shown in user interfaces. |
| `runner.host` | `RunnerHost` | No | Last reported host metadata; absent until the runner registers. |
| `runner.name` | `string` | Yes | Resource name, {pool}/runners/{runner_id}. |
| `runner.paused` | `boolean` | Yes | Whether the runner is paused from accepting new environments. Existing environments stay on the runner because their disks live on its host. |
| `runner.registerTime` | `string (date-time)` | No |  |
| `runner.registrationExpireTime` | `string (date-time)` | No | When the registration token expires while pending. |
| `runner.state` | `string` | Yes | Runner status: PENDING (awaiting host registration), EXPIRED (token expired unused), ONLINE (actively syncing) or OFFLINE (no sync for 30 seconds). Counts toward organization runner quota from creation until deletion, except when EXPIRED. Values: `PENDING`, `EXPIRED`, `ONLINE`, `OFFLINE`. |
| `runner.syncTime` | `string (date-time)` | No | When it last synced. |
| `runner.updateTime` | `string (date-time)` | Yes |  |
| `runner.usage` | `RunnerUsage` | No | The environments on it, and how much of its host they use, as kosem counts it when placing environments. Absent until it registers. |

### default

Error

Base URL: `https://api.kosem.ai`. See [API conventions](https://docs.kosem.ai/reference/api-conventions.md) for authentication, pagination and errors, and [https://docs.kosem.ai/openapi.yaml](https://docs.kosem.ai/openapi.yaml) for the full OpenAPI document.