> ## Documentation Index
> Fetch the complete documentation index at: https://docs.baseten.co/llms.txt
> Use this file to discover all available pages before exploring further.

# Manage endpoints

> Create and manage the endpoints that route Frontier Gateway traffic to Baseten, third-party, and custom targets.

An **endpoint** is the routing slug your callers use, like `my-org/glm-5.2`, plus the target it points to. When a request reaches the gateway with that slug, the gateway routes it to the target. As the Gateway operator, you manage endpoints through the [REST API](/reference/gateway/overview), so you can stand up a new slug, re-point it at a different target, or retire it.

<Note>
  To enable Frontier Gateway for your workspace, [talk to us](https://www.baseten.co/talk-to-us/).
</Note>

## Concepts

An endpoint has two parts:

* **Slug**: a globally-unique routing identifier of the form `{org_prefix}/{name}`, such as `my-org/glm-5.2`, where the prefix is one your organization owns. A slug is immutable after creation: to serve traffic under a different slug, create a new endpoint and delete the old one. Because the target is what changes, not the slug, callers keep using the same name.
* **Target**: where the slug routes, expressed as a `provider` plus the fields that provider needs. A target is Baseten-hosted, third-party, or custom. An endpoint takes a list of targets but holds exactly one today.

### Supported targets

The target determines where the model runs. The endpoint slug, group access, federated keys, and limits stay the same when you change targets.

| `provider`          | Category    | Routes to                                   | Required fields                              |
| ------------------- | ----------- | ------------------------------------------- | -------------------------------------------- |
| `BASETEN`           | Baseten     | Dedicated deployment                        | `model_id`                                   |
| `BASETEN_MODEL_API` | Baseten     | [Model API](/inference/model-apis/overview) | `secret_id`, `target_model`                  |
| `ANTHROPIC`         | Third party | Anthropic                                   | `secret_id`, `target_model`                  |
| `OPENAI`            | Third party | OpenAI                                      | `secret_id`, `target_model`                  |
| `VERTEX`            | Third party | Google Vertex AI                            | `secret_id`, `target_model`, `vertex_config` |
| `OPENAI_COMPATIBLE` | Custom      | OpenAI-compatible HTTPS server              | `secret_id`, `target_model`, `base_url`      |

`BASETEN` also accepts optional `environment_name` and `target_model`.

Field meanings:

* **`secret_id`**: the Baseten secret containing the upstream credential. For `BASETEN_MODEL_API`, store a Baseten API key that can call Model APIs. For `VERTEX`, the secret value must be the base64 encoding of Google service-account JSON authorized to call Vertex AI.
* **`target_model`**: the model name sent upstream.
* **`base_url`**: the publicly reachable HTTPS URL for `OPENAI_COMPATIBLE`. It can't include embedded credentials or a port, and it can't use private, loopback, link-local, reserved, multicast, unspecified, internal, local, or Baseten hosts.
* **`vertex_config`**: the Google Cloud configuration for `VERTEX`. Both `project_id` and `location` are required.

### Endpoints and groups

Endpoints and [groups](/frontier-gateway/api-keys) answer two different questions:

* An **endpoint** defines *what a slug routes to*: which upstream target serves traffic for `my-org/glm-5.2`.
* A **group** defines *who can call a slug and how much*: the model slugs a federated key may call, plus its rate and usage limits.

To serve a model to a caller, create an endpoint for the slug, then grant a group access to that same slug and mint the caller a key under it. The slug ties the two together.

## Create an endpoint

Create an endpoint to give callers a stable slug to use. The request body takes the `slug` and a `targets` list with one target. For a `BASETEN` Dedicated deployment target, omit `environment_name` to use production, or pass a non-production environment such as `staging`. The response is the new endpoint; save the `id`, which is the path parameter for every per-endpoint operation that follows.

**To create an endpoint for a Dedicated deployment**:

<CodeGroup>
  ```bash Request theme={"system"}
  curl --request POST \
    --url https://api.baseten.co/v1/gateway/endpoints \
    --header "Authorization: Api-Key $BASETEN_API_KEY" \
    --header "Content-Type: application/json" \
    --data '{
      "slug": "my-org/glm-5.2",
      "targets": [
        {
          "provider": "BASETEN",
          "model_id": "3kZ9xqd",
          "environment_name": "staging"
        }
      ]
    }'
  ```

  ```json Output theme={"system"}
  {
    "id": "abc123hash",
    "slug": "my-org/glm-5.2",
    "targets": [
      {
        "provider": "BASETEN",
        "model_id": "3kZ9xqd",
        "environment_name": "staging"
      }
    ],
    "created_at": "2026-06-17T12:00:00Z",
    "updated_at": "2026-06-17T12:00:00Z"
  }
  ```
</CodeGroup>

To point a slug at a third-party provider, send that provider with the secret holding its credential and the model name to send upstream. Before sending the Anthropic request, you must first create a [Baseten secret](/organization/secrets) containing the Anthropic API key. The example below fronts Anthropic behind your own slug.

**To create an endpoint for a third-party provider**:

<CodeGroup>
  ```bash Request theme={"system"}
  curl --request POST \
    --url https://api.baseten.co/v1/gateway/endpoints \
    --header "Authorization: Api-Key $BASETEN_API_KEY" \
    --header "Content-Type: application/json" \
    --data '{
      "slug": "my-org/sonnet",
      "targets": [
        {
          "provider": "ANTHROPIC",
          "secret_id": "9pQ4rtz",
          "target_model": "claude-sonnet-4-5"
        }
      ]
    }'
  ```

  ```json Output theme={"system"}
  {
    "id": "ghi789hash",
    "slug": "my-org/sonnet",
    "targets": [
      {
        "provider": "ANTHROPIC",
        "secret_id": "9pQ4rtz",
        "target_model": "claude-sonnet-4-5"
      }
    ],
    "created_at": "2026-06-17T12:10:00Z",
    "updated_at": "2026-06-17T12:10:00Z"
  }
  ```
</CodeGroup>

For more information, see [`POST /v1/gateway/endpoints`](/reference/gateway/endpoints/create-an-endpoint).

## List endpoints

List your endpoints to see every slug you've published and where each one routes. Results are cursor-paginated: pass `limit` and `cursor` query parameters to page through results, and follow `pagination.cursor` while `pagination.has_more` is `true`.

**To list endpoints**:

<CodeGroup>
  ```bash Request theme={"system"}
  curl --request GET \
    --url https://api.baseten.co/v1/gateway/endpoints \
    --header "Authorization: Api-Key $BASETEN_API_KEY"
  ```

  ```json Output theme={"system"}
  {
    "items": [
      {
        "id": "abc123hash",
        "slug": "my-org/glm-5.2",
        "targets": [
          {
            "provider": "BASETEN",
            "model_id": "3kZ9xqd",
            "environment_name": "staging"
          }
        ],
        "created_at": "2026-06-17T12:00:00Z",
        "updated_at": "2026-06-17T12:00:00Z"
      }
    ],
    "pagination": {
      "has_more": true,
      "cursor": "aVd2Yk54T2d2V0dFWE13R1l4R2k5UVE="
    }
  }
  ```
</CodeGroup>

To fetch the next page, pass the previous response's cursor. You've drained the result set when the response has `"has_more": false` and `"cursor": null`.

**To retrieve the next page of endpoints**:

<CodeGroup>
  ```bash Request theme={"system"}
  curl --request GET \
    --url "https://api.baseten.co/v1/gateway/endpoints?cursor=aVd2Yk54T2d2V0dFWE13R1l4R2k5UVE=" \
    --header "Authorization: Api-Key $BASETEN_API_KEY"
  ```

  ```json Output theme={"system"}
  {
    "items": [
      {
        "id": "def456hash",
        "slug": "my-org/glm-5.2-canary",
        "targets": [
          {
            "provider": "BASETEN",
            "model_id": "7mP2wqe",
            "environment_name": "staging"
          }
        ],
        "created_at": "2026-06-17T12:05:00Z",
        "updated_at": "2026-06-17T12:05:00Z"
      }
    ],
    "pagination": {
      "has_more": false,
      "cursor": null
    }
  }
  ```
</CodeGroup>

For more information, see [`GET /v1/gateway/endpoints`](/reference/gateway/endpoints/list-endpoints).

## Get an endpoint

Get an endpoint by its `id` to check where a single slug currently routes, for example to confirm a change took effect.

**To get an endpoint**:

<CodeGroup>
  ```bash Request theme={"system"}
  curl --request GET \
    --url https://api.baseten.co/v1/gateway/endpoints/abc123hash \
    --header "Authorization: Api-Key $BASETEN_API_KEY"
  ```

  ```json Output theme={"system"}
  {
    "id": "abc123hash",
    "slug": "my-org/glm-5.2",
    "targets": [
      {
        "provider": "BASETEN",
        "model_id": "3kZ9xqd",
        "environment_name": "staging"
      }
    ],
    "created_at": "2026-06-17T12:00:00Z",
    "updated_at": "2026-06-17T12:00:00Z"
  }
  ```
</CodeGroup>

For more information, see [`GET /v1/gateway/endpoints/{endpoint_id}`](/reference/gateway/endpoints/get-an-endpoint).

## Re-point an endpoint

Re-point an endpoint to move a live slug to a different target, like promoting a new model version or moving a slug from a third-party provider to your own deployment, without asking callers to change the name they use. The slug stays the same; you replace the endpoint's full target list, and the new target can use a different provider than the old one.

**To re-point an endpoint**:

<CodeGroup>
  ```bash Request theme={"system"}
  curl --request PATCH \
    --url https://api.baseten.co/v1/gateway/endpoints/abc123hash \
    --header "Authorization: Api-Key $BASETEN_API_KEY" \
    --header "Content-Type: application/json" \
    --data '{
      "targets": [
        {
          "provider": "BASETEN",
          "model_id": "7mP2wqe",
          "environment_name": "staging"
        }
      ]
    }'
  ```

  ```json Output theme={"system"}
  {
    "id": "abc123hash",
    "slug": "my-org/glm-5.2",
    "targets": [
      {
        "provider": "BASETEN",
        "model_id": "7mP2wqe",
        "environment_name": "staging"
      }
    ],
    "created_at": "2026-06-17T12:00:00Z",
    "updated_at": "2026-06-17T13:30:00Z"
  }
  ```
</CodeGroup>

The response confirms the slug's current target.

For more information, see [`PATCH /v1/gateway/endpoints/{endpoint_id}`](/reference/gateway/endpoints/replace-endpoint-targets).

## Delete an endpoint

Delete an endpoint to take a slug out of service, whether you're retiring a model or freeing the slug for reuse. The gateway stops routing the slug.

**To delete an endpoint**:

<CodeGroup>
  ```bash Request theme={"system"}
  curl --request DELETE \
    --url https://api.baseten.co/v1/gateway/endpoints/abc123hash \
    --header "Authorization: Api-Key $BASETEN_API_KEY"
  ```

  ```json Output theme={"system"}
  {
    "id": "abc123hash",
    "slug": "my-org/glm-5.2"
  }
  ```
</CodeGroup>

For more information, see [`DELETE /v1/gateway/endpoints/{endpoint_id}`](/reference/gateway/endpoints/delete-an-endpoint).

## Next steps

* **[Manage groups and API keys](/frontier-gateway/api-keys)**: Grant a group access to your endpoint's slug and mint a key for it.
* **[Rate and usage limits](/frontier-gateway/rate-limits)**: Control per-group, per-model usage on the slug.
* **[Endpoints API reference](/reference/gateway/endpoints/create-an-endpoint)**: Full request and response shapes for every endpoint operation.
