> ## 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](https://docs.baseten.co/reference/gateway/overview.md), so you can stand up a new slug, re-point it at a different target, or retire it.

> [!TIP]
>
> To call a hosted model directly with the OpenAI or Anthropic SDK, use [Model APIs](https://docs.baseten.co/inference/model-apis/overview.md). Frontier Gateway routes one set of slugs across Baseten-hosted, third-party, and custom targets. See [Frontier Gateway versus Model APIs](https://docs.baseten.co/frontier-gateway/overview.md#frontier-gateway-versus-model-apis).

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

## 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](https://docs.baseten.co/inference/model-apis/overview.md) | `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](https://docs.baseten.co/frontier-gateway/api-keys.md) 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**:

```bash Request theme={"system"}
curl --request POST \
  --url https://api.baseten.co/v1/gateway/endpoints \
  --header "Authorization: Bearer $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"
}
```

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](https://docs.baseten.co/organization/secrets.md) containing the Anthropic API key. The example below fronts Anthropic behind your own slug.

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

```bash Request theme={"system"}
curl --request POST \
  --url https://api.baseten.co/v1/gateway/endpoints \
  --header "Authorization: Bearer $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"
}
```

For more information, see [`POST /v1/gateway/endpoints`](https://docs.baseten.co/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**:

```bash Request theme={"system"}
curl --request GET \
  --url https://api.baseten.co/v1/gateway/endpoints \
  --header "Authorization: Bearer $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="
  }
}
```

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**:

```bash Request theme={"system"}
curl --request GET \
  --url "https://api.baseten.co/v1/gateway/endpoints?cursor=aVd2Yk54T2d2V0dFWE13R1l4R2k5UVE=" \
  --header "Authorization: Bearer $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
  }
}
```

For more information, see [`GET /v1/gateway/endpoints`](https://docs.baseten.co/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**:

```bash Request theme={"system"}
curl --request GET \
  --url https://api.baseten.co/v1/gateway/endpoints/abc123hash \
  --header "Authorization: Bearer $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"
}
```

For more information, see [`GET /v1/gateway/endpoints/{endpoint_id}`](https://docs.baseten.co/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**:

```bash Request theme={"system"}
curl --request PATCH \
  --url https://api.baseten.co/v1/gateway/endpoints/abc123hash \
  --header "Authorization: Bearer $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"
}
```

The response confirms the slug's current target.

For more information, see [`PATCH /v1/gateway/endpoints/{endpoint_id}`](https://docs.baseten.co/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**:

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

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

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

## Next steps

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