Withdrawing money after deleting a message

Why is the assistant charged after deleting a message? I don’t create a new assistant or create a new thread, but I am charged when I submit a request and delete a message. I am deleting previous messages in order to reduce the cost of the current request.
I delete the message using the following command :
= client.beta.threads.messages.delete(
message_id=message.id,
thread_id=thread_id,
)