> ## 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.

# Delete an endpoint

> Delete a Frontier Gateway endpoint and stop routing its slug.

Delete an endpoint. The call tears down the endpoint and its targets and stops routing its slug. The slug is freed for reuse: you can `POST /v1/gateway/endpoints` again with the same value to provision a fresh endpoint.

### Errors

| Status          | Meaning                                                                                       |
| --------------- | --------------------------------------------------------------------------------------------- |
| `403 Forbidden` | The endpoint exists but isn't in your workspace, or the caller doesn't have management scope. |
| `404 Not Found` | No endpoint with this `id` in your workspace, or it has already been deleted.                 |

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

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


## OpenAPI

````yaml delete /v1/gateway/endpoints/{endpoint_id}
openapi: 3.1.0
info:
  description: REST API for management of Baseten resources
  title: Baseten management API
  version: 1.0.0
servers:
  - url: https://api.baseten.co
security:
  - BearerAuth: []
paths:
  /v1/gateway/endpoints/{endpoint_id}:
    parameters:
      - $ref: '#/components/parameters/endpoint_id'
    delete:
      summary: Deletes a Gateway endpoint
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EndpointTombstoneV1'
      x-codeSamples:
        - lang: bash
          source: |
            curl --request DELETE \
            --url https://api.baseten.co/v1/gateway/endpoints/{endpoint_id} \
            --header "Authorization: Bearer $BASETEN_API_KEY"
        - lang: python
          source: |-
            import requests
            import os
            API_KEY = os.environ.get("BASETEN_API_KEY", "<YOUR_API_KEY>")
            url = "https://api.baseten.co/v1/gateway/endpoints/{endpoint_id}"

            headers = {"Authorization": f"Bearer {API_KEY}"}

            response = requests.request(
                "DELETE",
                url,
                headers=headers,
                json={}
            )

            print(response.text)
components:
  parameters:
    endpoint_id:
      schema:
        type: string
      name: endpoint_id
      in: path
      required: true
  schemas:
    EndpointTombstoneV1:
      properties:
        id:
          description: Identifier of the deleted endpoint.
          title: Id
          type: string
        slug:
          description: Slug of the deleted endpoint.
          title: Slug
          type: string
      required:
        - id
        - slug
      title: EndpointTombstoneV1
      type: object
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: >-
        Send `Authorization: Bearer <api_key>`. The legacy `Authorization:
        Api-Key <api_key>` scheme is also accepted.

````