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

# Delete a deployment

> Permanently deletes a deployment from its endpoint. Remove the deployment from live traffic first; use `etag` to reject the request if it changed after it was read.



## OpenAPI

````yaml openapi.yaml DELETE /v2/projects/{projectId}/endpoints/{endpointId}/deployments/{id}
openapi: 3.1.0
info:
  title: Together APIs
  description: The Together REST API. See https://docs.together.ai for more details.
  version: 2.0.0
  termsOfService: https://www.together.ai/terms-of-service
  contact:
    name: Together Support
    url: https://www.together.ai/contact
  license:
    name: MIT
    url: https://github.com/togethercomputer/openapi/blob/main/LICENSE
servers:
  - url: https://api.together.ai
    description: Default environment for APIs
security:
  - bearerAuth: []
paths:
  /v2/projects/{projectId}/endpoints/{endpointId}/deployments/{id}:
    delete:
      tags:
        - DeploymentService
      summary: Delete a deployment
      description: >-
        Permanently deletes a deployment from its endpoint. Remove the
        deployment from live traffic first; use `etag` to reject the request if
        it changed after it was read.
      operationId: DeploymentService_DeleteDeployment
      parameters:
        - name: projectId
          in: path
          required: true
          schema:
            type: string
            description: Project identifier.
        - name: endpointId
          in: path
          required: true
          schema:
            description: Endpoint identifier.
            type: string
        - name: id
          in: path
          required: true
          schema:
            description: Deployment identifier.
            type: string
        - name: etag
          in: query
          schema:
            type: string
            description: >-
              Etag for optimistic concurrency. If set, the delete is rejected if
              the current etag does not match.
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DE.DeleteResponse'
        default:
          description: Default error response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorData'
      x-codeSamples:
        - lang: Python
          label: Together AI SDK (Python)
          source: |
            from together import Together

            client = Together()
            identity = client.whoami()
            if identity.type != "project_api_key":
                raise RuntimeError("TOGETHER_API_KEY must be a project API key")
            project_id = identity.project.id

            client.endpoints.deployments.delete(
                "dep_abc123",
                project_id=project_id,
                endpoint_id="ep_abc123",
            )
        - lang: TypeScript
          label: Together AI SDK (TypeScript)
          source: |
            import Together from "together-ai";

            const client = new Together();
            const identity = await client.whoami();
            if (identity.type !== "project_api_key") {
              throw new Error("TOGETHER_API_KEY must be a project API key");
            }
            const projectId = identity.project.id;

            await client.endpoints.deployments.delete("dep_abc123", {
              projectId,
              endpointId: "ep_abc123",
            });
        - lang: JavaScript
          label: Together AI SDK (JavaScript)
          source: |
            import Together from "together-ai";

            const client = new Together();
            const identity = await client.whoami();
            if (identity.type !== "project_api_key") {
              throw new Error("TOGETHER_API_KEY must be a project API key");
            }
            const projectId = identity.project.id;

            await client.endpoints.deployments.delete("dep_abc123", {
              projectId,
              endpointId: "ep_abc123",
            });
components:
  schemas:
    DE.DeleteResponse:
      type: object
      properties: {}
      additionalProperties: false
      x-stainless-empty-object: true
      description: Empty response returned after a successful delete operation.
    ErrorData:
      type: object
      required:
        - error
      properties:
        error:
          type: object
          properties:
            message:
              type: string
              nullable: false
            type:
              type: string
              nullable: false
            param:
              type: string
              nullable: true
              default: null
            code:
              type: string
              nullable: true
              default: null
          required:
            - type
            - message
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      x-bearer-format: bearer
      x-default: default

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.