Python is adding "" to string when using it to create a concatenated string if read in from file

I am just starting to learn python and trying to build a cURL API request in python and can get the headers to work when I create a string directly in python, but not if I read in some of the data from a file.

I want to not hard code the API key, but pull it in from a file.

The following works

apikey = 'apikey'
headers = {
'x-api-key': apikey,
'Content-Type': 'application/json'

This gives an output of: {'x-api-key': 'apikey', 'Content-Type': 'application/json'}

However if I read it from a file

with open(os.path.join(sys.path[0], "api.txt"), "r") as f:
apikey =

This gives an output of: {'x-api-key': "'apikey'", 'Content-Type': 'application/json'}

This has a set of "" around the variable. The main difference I can see is that the first code variable is a literal and the second a str.

If I do a print(apikey) then neither have the "".

Any ideas how to correct this so that I can read from a file and not end up with the extra ""?

Many thanks for any help