# Delete a chat completion
URL: https://docs.munito.ai/api/deleteChatCompletion

DELETE /chat/completions/{completion_id}

Deletes a completion that was created with `store: true`, before the 30-day retention window ends. A deleted completion can no longer be retrieved.

```json
{
  "operationId": "deleteChatCompletion",
  "summary": "Delete a chat completion",
  "tags": [
    "Completions"
  ],
  "description": "Deletes a completion that was created with `store: true`, before the 30-day retention window ends. A deleted completion can no longer be retrieved.",
  "parameters": [
    {
      "name": "completion_id",
      "in": "path",
      "required": true,
      "description": "The completion id to delete.",
      "schema": {
        "type": "string"
      }
    }
  ],
  "responses": {
    "200": {
      "description": "Deletion confirmation.",
      "content": {
        "application/json": {
          "example": {
            "id": "chatcmpl-7f3c1a",
            "object": "chat.completion.deleted",
            "deleted": true
          }
        }
      }
    },
    "401": {
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "required": [
              "error"
            ],
            "properties": {
              "error": {
                "type": "object",
                "required": [
                  "message",
                  "type",
                  "param",
                  "code"
                ],
                "properties": {
                  "message": {
                    "type": "string"
                  },
                  "type": {
                    "type": "string"
                  },
                  "param": {
                    "type": "string",
                    "nullable": true
                  },
                  "code": {
                    "type": "string",
                    "nullable": true
                  }
                }
              }
            }
          }
        }
      },
      "headers": {
        "x-request-id": {
          "description": "The id that Munito makes for each request. Quote it to support. OpenAI sends the same header.",
          "schema": {
            "type": "string"
          }
        },
        "retry-after": {
          "description": "Seconds to wait before a retry.",
          "schema": {
            "type": "string"
          }
        },
        "www-authenticate": {
          "description": "The scheme that a 401 resource accepts.",
          "schema": {
            "type": "string"
          }
        },
        "allow": {
          "description": "The methods that a 405 resource allows.",
          "schema": {
            "type": "string"
          }
        }
      },
      "description": "Credentials are missing or invalid. Public model discovery also returns this error for invalid credentials."
    },
    "403": {
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "required": [
              "error"
            ],
            "properties": {
              "error": {
                "type": "object",
                "required": [
                  "message",
                  "type",
                  "param",
                  "code"
                ],
                "properties": {
                  "message": {
                    "type": "string"
                  },
                  "type": {
                    "type": "string"
                  },
                  "param": {
                    "type": "string",
                    "nullable": true
                  },
                  "code": {
                    "type": "string",
                    "nullable": true
                  }
                }
              }
            }
          }
        }
      },
      "headers": {
        "x-request-id": {
          "description": "The id that Munito makes for each request. Quote it to support. OpenAI sends the same header.",
          "schema": {
            "type": "string"
          }
        },
        "retry-after": {
          "description": "Seconds to wait before a retry.",
          "schema": {
            "type": "string"
          }
        },
        "www-authenticate": {
          "description": "The scheme that a 401 resource accepts.",
          "schema": {
            "type": "string"
          }
        },
        "allow": {
          "description": "The methods that a 405 resource allows.",
          "schema": {
            "type": "string"
          }
        }
      },
      "description": "The account or key does not permit this request."
    },
    "404": {
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "required": [
              "error"
            ],
            "properties": {
              "error": {
                "type": "object",
                "required": [
                  "message",
                  "type",
                  "param",
                  "code"
                ],
                "properties": {
                  "message": {
                    "type": "string"
                  },
                  "type": {
                    "type": "string"
                  },
                  "param": {
                    "type": "string",
                    "nullable": true
                  },
                  "code": {
                    "type": "string",
                    "nullable": true
                  }
                }
              }
            }
          }
        }
      },
      "headers": {
        "x-request-id": {
          "description": "The id that Munito makes for each request. Quote it to support. OpenAI sends the same header.",
          "schema": {
            "type": "string"
          }
        },
        "retry-after": {
          "description": "Seconds to wait before a retry.",
          "schema": {
            "type": "string"
          }
        },
        "www-authenticate": {
          "description": "The scheme that a 401 resource accepts.",
          "schema": {
            "type": "string"
          }
        },
        "allow": {
          "description": "The methods that a 405 resource allows.",
          "schema": {
            "type": "string"
          }
        }
      },
      "description": "No completion with this id is stored in your workspace."
    },
    "421": {
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "required": [
              "error"
            ],
            "properties": {
              "error": {
                "type": "object",
                "required": [
                  "message",
                  "type",
                  "param",
                  "code"
                ],
                "properties": {
                  "message": {
                    "type": "string"
                  },
                  "type": {
                    "type": "string"
                  },
                  "param": {
                    "type": "string",
                    "nullable": true
                  },
                  "code": {
                    "type": "string",
                    "nullable": true
                  }
                }
              }
            }
          }
        }
      },
      "headers": {
        "x-request-id": {
          "description": "The id that Munito makes for each request. Quote it to support. OpenAI sends the same header.",
          "schema": {
            "type": "string"
          }
        },
        "retry-after": {
          "description": "Seconds to wait before a retry.",
          "schema": {
            "type": "string"
          }
        },
        "www-authenticate": {
          "description": "The scheme that a 401 resource accepts.",
          "schema": {
            "type": "string"
          }
        },
        "allow": {
          "description": "The methods that a 405 resource allows.",
          "schema": {
            "type": "string"
          }
        }
      },
      "description": "The requested region does not permit this request on this endpoint. Read the error before a retry."
    },
    "429": {
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "required": [
              "error"
            ],
            "properties": {
              "error": {
                "type": "object",
                "required": [
                  "message",
                  "type",
                  "param",
                  "code"
                ],
                "properties": {
                  "message": {
                    "type": "string"
                  },
                  "type": {
                    "type": "string"
                  },
                  "param": {
                    "type": "string",
                    "nullable": true
                  },
                  "code": {
                    "type": "string",
                    "nullable": true
                  }
                }
              }
            }
          }
        }
      },
      "headers": {
        "x-request-id": {
          "description": "The id that Munito makes for each request. Quote it to support. OpenAI sends the same header.",
          "schema": {
            "type": "string"
          }
        },
        "retry-after": {
          "description": "Seconds to wait before a retry.",
          "schema": {
            "type": "string"
          }
        },
        "www-authenticate": {
          "description": "The scheme that a 401 resource accepts.",
          "schema": {
            "type": "string"
          }
        },
        "allow": {
          "description": "The methods that a 405 resource allows.",
          "schema": {
            "type": "string"
          }
        }
      },
      "description": "A request, token, page, or spend limit refuses the request. See [Errors](https://docs.munito.ai/errors) before a retry."
    },
    "500": {
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "required": [
              "error"
            ],
            "properties": {
              "error": {
                "type": "object",
                "required": [
                  "message",
                  "type",
                  "param",
                  "code"
                ],
                "properties": {
                  "message": {
                    "type": "string"
                  },
                  "type": {
                    "type": "string"
                  },
                  "param": {
                    "type": "string",
                    "nullable": true
                  },
                  "code": {
                    "type": "string",
                    "nullable": true
                  }
                }
              }
            }
          }
        }
      },
      "headers": {
        "x-request-id": {
          "description": "The id that Munito makes for each request. Quote it to support. OpenAI sends the same header.",
          "schema": {
            "type": "string"
          }
        },
        "retry-after": {
          "description": "Seconds to wait before a retry.",
          "schema": {
            "type": "string"
          }
        },
        "www-authenticate": {
          "description": "The scheme that a 401 resource accepts.",
          "schema": {
            "type": "string"
          }
        },
        "allow": {
          "description": "The methods that a 405 resource allows.",
          "schema": {
            "type": "string"
          }
        }
      },
      "description": "An unexpected error prevents a response."
    },
    "503": {
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "required": [
              "error"
            ],
            "properties": {
              "error": {
                "type": "object",
                "required": [
                  "message",
                  "type",
                  "param",
                  "code"
                ],
                "properties": {
                  "message": {
                    "type": "string"
                  },
                  "type": {
                    "type": "string"
                  },
                  "param": {
                    "type": "string",
                    "nullable": true
                  },
                  "code": {
                    "type": "string",
                    "nullable": true
                  }
                }
              }
            }
          }
        }
      },
      "headers": {
        "x-request-id": {
          "description": "The id that Munito makes for each request. Quote it to support. OpenAI sends the same header.",
          "schema": {
            "type": "string"
          }
        },
        "retry-after": {
          "description": "Seconds to wait before a retry.",
          "schema": {
            "type": "string"
          }
        },
        "www-authenticate": {
          "description": "The scheme that a 401 resource accepts.",
          "schema": {
            "type": "string"
          }
        },
        "allow": {
          "description": "The methods that a 405 resource allows.",
          "schema": {
            "type": "string"
          }
        }
      },
      "description": "The service cannot complete the request now. Follow Retry-After when present."
    },
    "default": {
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "required": [
              "error"
            ],
            "properties": {
              "error": {
                "type": "object",
                "required": [
                  "message",
                  "type",
                  "param",
                  "code"
                ],
                "properties": {
                  "message": {
                    "type": "string"
                  },
                  "type": {
                    "type": "string"
                  },
                  "param": {
                    "type": "string",
                    "nullable": true
                  },
                  "code": {
                    "type": "string",
                    "nullable": true
                  }
                }
              }
            }
          }
        }
      },
      "headers": {
        "x-request-id": {
          "description": "The id that Munito makes for each request. Quote it to support. OpenAI sends the same header.",
          "schema": {
            "type": "string"
          }
        },
        "retry-after": {
          "description": "Seconds to wait before a retry.",
          "schema": {
            "type": "string"
          }
        },
        "www-authenticate": {
          "description": "The scheme that a 401 resource accepts.",
          "schema": {
            "type": "string"
          }
        },
        "allow": {
          "description": "The methods that a 405 resource allows.",
          "schema": {
            "type": "string"
          }
        }
      },
      "description": "An HTTP error before a response stream starts. See [Errors](https://docs.munito.ai/errors) for status codes and retry rules."
    }
  }
}
```

# Shared API schemas
{
  "securitySchemes": {
    "BearerAuth": {
      "type": "http",
      "scheme": "bearer",
      "description": "Your Munito API key."
    },
    "ApiKeyAuth": {
      "type": "apiKey",
      "in": "header",
      "name": "x-api-key",
      "description": "Your Munito API key."
    }
  }
}