# Trim API key when submitting requests to LLM providers \(\#37082\) · gitcafe/zed

[View on GitCafe](https://git.cafe/gitcafe/zed/commit/39d86eeb7f93001ba526eb97f58102034d522f8c)

Repository: [gitcafe/zed](https://git.cafe/gitcafe/zed)

Visibility: public

Requested revision: 39d86eeb7f93001ba526eb97f58102034d522f8c

Requested commit: 39d86eeb7f93001ba526eb97f58102034d522f8c

Commit: 39d86eeb7f93001ba526eb97f58102034d522f8c

Tree: 7066d6afac8e319b885491ad7c4d1c4f7caab8ef

Author: Antonio Scandurra

Committer: GitHub

## Message

```
Trim API key when submitting requests to LLM providers (#37082)

This prevents the common footgun of copy/pasting an API key
starting/ending with extra newlines, which would lead to a "bad request"
error.

Closes #37038 

Release Notes:

- agent: Support pasting language model API keys that contain newlines.
```

## Parents

- [4981c33bf36f3b2f40d91fbd9433e16e1a0e32c7](https://git.cafe/gitcafe/zed/commit/4981c33bf36f3b2f40d91fbd9433e16e1a0e32c7?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zed/tree/39d86eeb7f93001ba526eb97f58102034d522f8c?format=markdown)
