---
title: "Create an endpoint"
description: "Create an endpoint from the console, the API or a scenario file, preview it first, watch it reach serving, and call it."
url: "https://opod.io/docs/control-plane-endpoints/create/"
markdown_url: "https://opod.io/docs/control-plane-endpoints/create.md"
section: "Endpoints"
last_updated: "2026-10-31"
---

# Create an endpoint

> Create an endpoint from the console, the API or a scenario file, preview it first, watch it reach serving, and call it.

An endpoint is one model behind one URL. You create it with a name, a model and a plan. The control plane judges the plan, places it, and applies it. In 0.3.0 the create also runs as a [run](https://opod.io/docs/control-plane-endpoints/rollouts/) with steps and proofs.

## In short

You give the control plane three things: a name, a model and a plan (what to run and where). It checks the plan against the measured GPUs, places the workers, and starts one leader and its workers. When the leader returns a first token, the endpoint is `serving` and you call it with the OpenAI API.

## When you need it

- You want a model behind a URL for the first time.
- You want a second copy of a model under another name, for example for another team.
- You want to put an outside OpenAI-compatible API behind the same keys and usage (a [remote endpoint](#remote-endpoints)).

## Do it

1. **Set the two shell variables**

   ```bash
   CP=https://cp.example.com
   H="Authorization: Bearer <token>"      # an operator's session token, or the admin token
   ```

2. **Write the request body**

   The smallest body names the endpoint, the model and one worker. The placer picks the card.

   ```bash
   cat > chat.json <<'JSON'
   { "name": "chat", "model": "qwen2.5-7b-instruct",
     "plan": { "model": { "id": "qwen2.5-7b-instruct", "engine": "vllm" }, "workers": [ { "replicas": 1 } ] } }
   JSON
   ```

3. **Preview it**

   ```bash
   curl -s -H "$H" -H 'Content-Type: application/json' -X POST $CP/api/v1/endpoints/preview -d @chat.json \
     | jq '{claims, advisories}'
   ```

   Expect `claims` with one `{node, gpu, class, engine}` row and a list of `advisories`. Nothing is created. A refusal is a `400` with an `E-…` code; fix the plan and preview again.

4. **Create it**

   ```bash
   curl -s -H "$H" -H 'Content-Type: application/json' -X POST $CP/api/v1/endpoints -d @chat.json | jq '{id, name, url}'
   # {"id":"ep_…","name":"chat","url":"http://opodcp-ep-chat.opod.svc:8080"}
   ```

   The answer is `201`. Keep the `id`.

5. **Wait for serving**

   ```bash
   watch -n 5 "curl -s -H '$H' $CP/api/v1/endpoints/<id>/status | jq -c '{phase, waiting, lastError}'"
   ```

   The phase moves from `pending` to `converging` to `serving`. A first create pulls the weights, so it can take minutes.

6. **Mint a key and call it**

   ```bash
   KEY=$(opodcp key create --endpoint chat --cp $CP --token <token> first-key)
   curl -s http://opodcp-ep-chat.opod.svc:8080/v1/chat/completions -H "Authorization: Bearer $KEY" \
     -H 'Content-Type: application/json' \
     -d '{"model":"qwen2.5-7b-instruct","messages":[{"role":"user","content":"hello"}]}' | jq -r '.choices[0].message.content'
   ```

   A `*.svc` URL answers only inside the cluster. From your laptop, use the console's **Playground**, or see [Network and TLS](https://opod.io/docs/control-plane-security/network-tls/).

## Check it worked

```bash
curl -s -H "$H" $CP/api/v1/endpoints/<id>/status | jq '{phase, counts, proof}'
```

A good answer has `"phase": "serving"`, `counts.ready` equal to `counts.planned`, and a non-empty `proof`. In the console the endpoint's row on **Endpoints** reads **serving**, and its **Connect** card shows the URL.

## If it fails

| Symptom or code               | Cause                                                      | Fix                                                                                                                          |
| ----------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- |
| `409 conflict` on create      | an endpoint of that name exists                            | pick another `name`, or change the existing one's plan                                                                       |
| `400` with `E-FIT`            | the plan does not fit the measured free memory             | read `details`; see [Placement → What `E-FIT` says](https://opod.io/docs/control-plane-endpoints/placement/#what-e-fit-says) |
| `400` with another `E-…` code | the planner refused the plan                               | apply one of `details.alternatives`; see [Error codes](https://opod.io/docs/control-plane-reference/error-codes/)            |
| `400` "logging"               | the body carries the removed `logging` field               | delete it                                                                                                                    |
| `403`                         | you are a viewer, or you named another team                | ask for the operator role, or drop `team`                                                                                    |
| `phase` stays `converging`    | pods are starting or pulling weights; `waiting` says which | wait, or read the run log and the pod logs (below)                                                                           |
| `phase` is `degraded`         | a pod cannot schedule, or the engine failed                | read `lastError`, then `GET …/logs` for the leader and the worker                                                            |

## From the console

Open **Endpoints → New**.

1. Pick a model from the catalog, or add one from a Hugging Face repo on the **Models** page first.
   From the release after 0.3.6, each model in the list says whether the placer would fit it on this fleet now, for the colocation the form sends: `fits ×2`, `does not fit · E-AUTO-NOFIT` (the planner's code), `refused` (the planner refuses it for another reason, such as a catalog entry with no weights its engine can load) or `size unknown` (the catalog records no size, so the placer cannot tell). The field's hint gives the reason. The answer comes from [`GET /api/v1/capacity/fits`](https://opod.io/docs/control-plane-endpoints/placement/) and is advice: you can still choose a model that does not fit, and Preview judges your exact plan.
2. Pick a **recipe** or a **workload preset** if you know your traffic shape, or leave the defaults. See [Recipes](#recipes).
3. Leave placement on **Auto** to let the control plane choose engine, cards and split, or switch to explicit and name them.
   Placement is one or the other: **Auto** picks from every ready machine, and explicit uses the machines you choose. From the release after 0.3.6, a cell with more than eight ready machines shows a filter above **Node**, and the expert section's **More machines** shows one when more than eight other machines are ready. Type words from a machine's name, vendor or GPU model, for example `nvidia a6000`. Each word must match. The field lists up to 100 matches and counts the rest, and the machine you already chose stays in the list. In an expert gang, the machine in **Node** is the **head**, the part that serves the API. The machines you tick follow it, as in a plan, where `head` defaults to the first part.
4. Press **Preview**. It shows the shape, the cards it would claim, each placement step's reason and any advisories. Nothing is created. From the release after 0.3.6, Preview runs by itself once the form has a name and a model and you stop typing for a moment; the button asks again on demand.
5. Press **Create**. The endpoint page then follows the endpoint until it serves.

From a terminal, in the release after 0.3.6: `opodcp endpoint create --model qwen2.5-7b --dry-run chat` previews the same body, and without `--dry-run` creates it; see [the CLI reference](https://opod.io/docs/control-plane-reference/cli/#endpoint-create).

The **Apply YAML** dialog on the Endpoints page takes a scenario document (below).

In 0.3.0, the form also sets these fields. Each is sent only when you set it, and Preview shows the control plane's answer:

| Form control                                        | Where                                                        | Plan field                                                    | Example                                                                                                                                                                                                                                                                 |
| --------------------------------------------------- | ------------------------------------------------------------ | ------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Card**                                            | Placement, explicit and **shared** (the release after 0.3.6) | `workers[].gpu`                                               | `1 · 38 GB free · code (best fit)`: the card the budget goes on; the default is the card with the most free VRAM, and the budget may not pass the chosen card's free VRAM. A dedicated worker takes whole cards and the device plugin picks them, so it has no **Card** |
| **Longest request**                                 | Workload                                                     | `workload.maxContext`                                         | `32768` sizes each worker's KV cache for a 32k-token request instead of the model's full window                                                                                                                                                                         |
| **Below the CPU tier → auto**, **Grow up to · GiB** | Advanced → KV cache tier (explicit placement)                | `workers[].kvOffload {tier: auto, sizeGb, maxGb}`             | start at 4 GiB, and let the control plane resize it up to 32 GiB                                                                                                                                                                                                        |
| **KV cache precision**                              | Advanced (explicit placement)                                | `workers[].flags.kv_cache_dtype` (llama.cpp: `kv_cache_type`) | `fp8` on vLLM holds about twice the tokens of the 16-bit default                                                                                                                                                                                                        |
| **KV block events**                                 | Advanced → Prefix cache (vLLM, SGLang)                       | `kvEvents`                                                    | route a request to the worker that already holds its prompt's blocks                                                                                                                                                                                                    |
| **Who shares the prefix cache**                     | Advanced → Prefix cache                                      | `routing.cacheIsolation`                                      | `key`: no two keys share cached prompts                                                                                                                                                                                                                                 |
| **Gateway API InferencePool**                       | below Cell door alias                                        | `exposure.inferencePool`                                      | `pool-a`: your Gateway picks among every leader in that pool                                                                                                                                                                                                            |

To change these after create, use `opodcp endpoint kv` and `opodcp endpoint expose` ([CLI](https://opod.io/docs/control-plane-reference/cli/#endpoint-kv--policy--expose)).

## From the API

`POST /api/v1/endpoints/preview` and `POST /api/v1/endpoints` take the same body. Preview writes nothing and answers with the plan as it would be stored, the claims and the advisories, or with the create's own refusal, word for word.

```bash
H="Authorization: Bearer <token>"
cat > chat.json <<'EOF'
{
  "name": "chat",
  "model": "qwen2.5-7b-instruct",
  "protocol": "chat",
  "plan": {
    "placement": "explicit",
    "model": { "id": "qwen2.5-7b-instruct", "engine": "vllm" },
    "colocation": "dedicated",
    "workers": [ { "replicas": 2, "engine": "vllm" } ],
    "shardGroups": [],
    "autoscale": { "floor": 1, "max": 4, "unit": "workers" }
  }
}
EOF
curl -s -H "$H" -H 'Content-Type: application/json' -X POST https://cp.example.com/api/v1/endpoints/preview -d @chat.json
curl -s -H "$H" -H 'Content-Type: application/json' -X POST https://cp.example.com/api/v1/endpoints -d @chat.json
```

A worker row with no `node` is placed by the placer; `replicas: N` with no node becomes N single placements. You need the operator role. A team-scoped operator's endpoint lands in their team; naming another team is `403`.

> **There is no dry-run flag on create**
>
> `POST /api/v1/endpoints?dryRun=true` creates the endpoint. Use `POST /api/v1/endpoints/preview` for a dry run.

| Body field         | Meaning                                                                                                                                                                                                               |
| ------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `name`             | the endpoint's name: a DNS label, `a-z`, `0-9` and `-`, at most 40 characters; it appears in its Service and object names                                                                                             |
| `model`            | the catalog or user model id                                                                                                                                                                                          |
| `protocol`         | `chat`, `embeddings` or `rerank`. When omitted, the endpoint serves the protocol its model is from 0.3.0; in 0.2.1 an omitted protocol is `chat`, whatever the model                                                  |
| `team`             | the owning team; `default` when absent                                                                                                                                                                                |
| `plan`             | the [plan](https://opod.io/docs/control-plane-endpoints/plan/)                                                                                                                                                        |
| `slo`              | optional targets: `ttftMs`, `latencyMs`, `tpotMs` (milliseconds) and `availabilityPct` (1 to 100). Refused when negative or when `ttftMs` is above `latencyMs`. Change it later with `PUT /api/v1/endpoints/{id}/slo` |
| `remoteKey`        | write-only vendor key for a remote endpoint                                                                                                                                                                           |
| `cell`             | optional; defaults to this control plane's cell. Any other cell is refused `400`: endpoints are cell-scoped                                                                                                           |
| `tenant`, `region` | optional labels stored on the endpoint record as given; `""` when absent                                                                                                                                              |
| `workloadType`     | optional; `endpoint` when absent. From 0.3.0 any other value is refused `400` (a training run is a job: `POST /api/v1/jobs`); 0.2.1 stores it, and every usage row still says `endpoint`                              |

A body with every optional field:

```json
{
  "name": "search-chat",
  "model": "qwen2.5-7b-instruct",
  "protocol": "chat",
  "team": "search",
  "cell": "prod-east",
  "tenant": "acme",
  "region": "eu-west",
  "workloadType": "endpoint",
  "slo": { "ttftMs": 800, "latencyMs": 20000, "tpotMs": 60, "availabilityPct": 99 },
  "plan": { "model": { "id": "qwen2.5-7b-instruct", "engine": "vllm" }, "workers": [ { "replicas": 2 } ] }
}
```

\| `logging` | removed. A body that carries it is refused `400`: recording request content is not the control plane's job |

A create answers `201` with the endpoint record. A second endpoint of the same name is `409 conflict`. A refusal is a `400` with an `E-…` code; see [The plan → Refusals](https://opod.io/docs/control-plane-endpoints/plan/#refusals). A rerank endpoint on an engine that cannot score documents is refused `E-ENGINE-RERANK`.

The preview answer:

```json
{
  "plan":   { "…": "the plan as it would be stored" },
  "model":  { "id": "qwen2.5-7b-instruct", "engine": "vllm", "…": "…" },
  "claims": [ { "node": "node-a", "gpu": 0, "class": "dedicated", "engine": "vllm" },
              { "node": "node-b", "gpu": 0, "class": "dedicated", "engine": "vllm" } ],
  "advisories": [],
  "fronts": { "leader": { "nodes": ["node-c"], "placement": "gpu-less" } }
}
```

A claim carries `budgetGb` for a shared worker and `part` (the gang id) for a gang part. `fronts` names the nodes the leader and front doors will be pinned to, and is new in 0.3.0, as does `prefillDecode` (the prefill and decode sizing for a plan with a workload).

## From the CLI

```bash
opodcp preview -f chat.json --cp https://cp.example.com --token <token>
opodcp apply -f scenario.yaml --cp https://cp.example.com --token <token>
opodcp verify -f scenario.yaml --out report.json
```

`opodcp preview` is new in 0.3.0; `apply` and `verify` are in 0.2.1. `apply` creates or updates the endpoint a scenario names (`POST /api/v1/apply`). `verify` waits for it to serve, chats with it, and runs the scenario's `verify` block. A scenario is a YAML or JSON document:

```yaml
apiVersion: opod.io/v1
kind: Scenario
name: chat-rag
endpoint: { name: chat-rag, model: qwen2.5-1.5b-instruct, protocol: chat }
plan:
  placement: explicit
  model: { id: qwen2.5-1.5b-instruct, engine: vllm }
  workers:
    - { replicas: 1, engine: vllm, kvOffload: { tier: cpu, sizeGb: 8 } }
  workload: { inputTokens: 16000, outputTokens: 1000, peakConcurrency: 8 }
  autoscale: { floor: 1, max: 4, unit: workers }
verify:
  chat: { prompt: "What is the capital of France?", maxTokens: 16, expectContains: "Paris" }
  balance: { requests: 30, expectWorkersUsed: 2, maxSharePct: 70 }
```

| `verify` block | Checks                                                                                                                                                                          |
| -------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `chat`         | one completion of `prompt` with `maxTokens`; `expectTokens` requires a non-empty answer; `expectContains` requires the text, ignoring case (sent at temperature 0)              |
| `embed`        | one embeddings request over `inputs`; `expectDimensions` fixes the vector width                                                                                                 |
| `balance`      | `requests` sent `concurrency` at a time spread across at least `expectWorkersUsed` workers; `maxSharePct` caps any one worker's share                                           |
| `gpu`          | the measured VRAM on `node` and `index`: `expectUsedGbBetween`, `expectHolderGb`, `expectEndpointHolds`                                                                         |
| `autoscale`    | a `load` of `parallel` clients for `seconds` drives at least `expectWorkersAtLeast` workers, then `expectShrinkTo`, `expectSleepAfterIdle` or a wake within `wakeBudgetSeconds` |

`opodcp apply` defaults to explicit placement. A scenario may also carry `description`, `notes`, `remoteKey`, `timeoutSeconds`, `setup.teamQuotas` (admin) and `expectRefusal.contains`: a scenario that must be refused passes only when the refusal carries that text.

## Watch it reach serving

```bash
curl -s -H "$H" https://cp.example.com/api/v1/endpoints/<id>/status | jq '{phase, proof, waiting, lastError, counts}'
```

| Phase        | Meaning                                                                                                                                                                                                                                                                                                                  |
| ------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `pending`    | stored, nothing running yet                                                                                                                                                                                                                                                                                              |
| `converging` | pods are starting or the leader has not answered yet; `waiting` says why                                                                                                                                                                                                                                                 |
| `serving`    | the leader produced a first token for the plan's model; `proof` holds the evidence                                                                                                                                                                                                                                       |
| `degraded`   | something is wrong; `lastError` says what, for example `apply: …` or an unschedulable pod. From the release after 0.3.6 the endpoint page shows it under the header with a link to the pod logs, and the list shows it on the state's tooltip (a converging or pending endpoint shows its `waiting` reason the same way) |
| `sleeping`   | healthy and idle: every worker's engine is asleep (sleep tier), or a `floor: 0` endpoint is parked at zero workers and wakes on the next request                                                                                                                                                                         |
| `deleting`   | teardown in progress                                                                                                                                                                                                                                                                                                     |

The status document:

| Field                               | Meaning                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| ----------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `phase`, `observedAt`               | the phase and when it was read; the control plane observes every endpoint about every 5 s                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| `leader`, `workers[]`, `gateways[]` | each pod: `pod`, `node`, `ready`, `phase`, `loaded` (the models the leader routes to this worker; `[]` = none yet, `null` = not known: the leader is not ready, or it could not be read and the pod is new or restarted — an unchanged pod keeps its last list through a failed read; from the release after 0.3.6 — before it, always absent), `stale` (still on an old revision; it serves until it stops), `worker` (plan row), `nodeId`, `terminating`, `placement` (the rule that put a leader or door there), and from the release after 0.3.6 `restarts` (the container's restart count) and `waiting` (the reason it waits in — `CrashLoopBackOff`, `ImagePullBackOff`, …; absent while it starts normally) |
| `counts`                            | `planned`, `scheduled`, `running`, `ready`, `stale`, `terminating`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| `proof`, `waiting`, `lastError`     | the serving evidence, what a converge waits for, the last failure                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| `rollingOut`                        | the workloads (`leader`, `worker/<n>`) still on an older pod template                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| `gangs[]`                           | per gang: `id`, `render` (`leaderworkerset` or `per-part`), `reason`, `vendors`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| `scaling`                           | who scales the endpoint and why; see [Autoscaling](https://opod.io/docs/control-plane-endpoints/autoscaling/#what-it-is-doing)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| `doorsWanted`, `doorsAsked`         | the front-door count it runs and the count the plan asks for                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |

The proof is kept per set of pods: a leader restart or a worker change is proven again. From 0.3.0, the create's run log (`GET /api/v1/runs/{id}/log`) shows what each step saw, including what Kubernetes said about the pods.

`GET /api/v1/endpoints` lists every endpoint you may see; `?expand=plan` attaches each plan in the same answer. `GET /api/v1/endpoints/status` answers every visible endpoint's status in one call. `GET /api/v1/endpoints/{id}` adds the planner's `advisories` for the stored plan.

## Call it

The endpoint's `url` field is its in-cluster Service, for example `http://opodcp-ep-chat.opod.svc:8080`. It serves the OpenAI API under `/v1`: `GET /v1/models`, `POST /v1/chat/completions`, `POST /v1/completions`, `POST /v1/embeddings`, `POST /v1/rerank`. Send a key as `Authorization: Bearer sk-orc-<key>`.

```python
from openai import OpenAI
client = OpenAI(base_url="http://opodcp-ep-chat.opod.svc:8080/v1", api_key="sk-orc-<key>")
print(client.chat.completions.create(model="qwen2.5-7b-instruct",
      messages=[{"role": "user", "content": "hello"}]).choices[0].message.content)
```

The endpoint page's **Connect** card shows the URL, the public URL when a route exists (`publicUrl`), and code to copy. A leader that serves TLS also reports `tlsFingerprint` and `tlsNotAfter`. From outside the cluster, see [Network and TLS](https://opod.io/docs/control-plane-security/network-tls/). To test through the control plane, use the **Playground** or `POST /api/v1/endpoints/{id}/gateway/v1/chat/completions`.

## Remote endpoints

An endpoint can front a model served elsewhere, by any OpenAI-compatible API. Set `plan.model.source: remote`, `plan.model.remoteUrl` (an `http(s)` base URL; `/v1` optional) and `plan.model.id` (the vendor's model id), with no workers, gangs or autoscale. Give the vendor key as `remoteKey`. Only the leader runs; there is no GPU, ledger claim or placer. The stored plan's engine reads `openaicompat`. Keys, fallback, usage and the Connect card work unchanged. Rotate the vendor key with `PUT /api/v1/endpoints/{id}/remote-key {"key": "…"}` (it answers `{"set": true}`, or `false` for an empty key, which clears it); the leader is rolled to pick it up. No route ever returns the key.

## Logs

```bash
curl -s -H "$H" "https://cp.example.com/api/v1/endpoints/<id>/logs?tail=200"                 # the leader
curl -s -H "$H" "https://cp.example.com/api/v1/endpoints/<id>/logs?pod=<worker pod>&previous=true"
```

`tail` is 1 to 5000 (default 200), at most 1 MiB. Only pods of this endpoint can be read.

## Delete

`DELETE /api/v1/endpoints/{id}` (operator) answers `202` with `{"id": "…", "state": "deleting"}` and tears the endpoint down: remove objects, wait for pods to go, free the GPUs, remove the record. In 0.3.0 the delete is a run with those four steps (`remove objects`, `pods gone`, `GPUs freed`, `record removed`), it cannot be cancelled, and the endpoint's plan history stays readable by its id.

Every Kubernetes object of an endpoint names the endpoint's plan ConfigMap (`<prefix>-plan`) as its owner, and a delete removes that ConfigMap first. So a teardown the control plane does not live through (a crash or an upgrade mid-delete) is finished by Kubernetes garbage collection, and no worker is left holding a card the ledger already gave away. A plan edit or a rollout patches the ConfigMap in place, so it never removes a serving endpoint's objects.

## Recipes

Recipes and workload presets on the create form are new in 0.3.0. A recipe fills the create form for a traffic shape. The stored plan carries only the fields, never the recipe's name.

| Recipe                      | Your traffic                        | The shape                                                                                |
| --------------------------- | ----------------------------------- | ---------------------------------------------------------------------------------------- |
| Short and frequent          | many short requests                 | replicas under autoscale 1–4; 800 tokens in, 200 out, 64 at once                         |
| Shared long prefix          | RAG, agents, one long system prompt | a host-memory KV tier (8 GiB) per worker; 16,000 in, 1,000 out, 8 at once; autoscale 1–4 |
| Offline batch               | many independent requests           | 1,000 in, 300 out, 128 at once; autoscale 0–4, parked after 5 minutes idle               |
| Big model, one machine      | too big for one card                | tensor parallel 2 across one machine's cards (vLLM, SGLang, TensorRT-LLM)                |
| Big model, several machines | too big for one machine             | a pipeline gang across two machines; a plan file today                                   |

A recipe the chosen engine or machine cannot run is greyed with the planner's refusal code.
