# API setting: API as the user 'PythonAPI', but the supplied API key doesn't match our records

**URL:** <https://community.plotly.com/t/api-setting-api-as-the-user-pythonapi-but-the-supplied-api-key-doesnt-match-our-records/4612>\
**Category:** 📊 Plotly Python\
**Created:** [June 25, 2017, 6:25am UTC](https://community.plotly.com/t/api-setting-api-as-the-user-pythonapi-but-the-supplied-api-key-doesnt-match-our-records/4612 "2017-06-25T06:25:46Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![RamdayalSingh](https://avatars.discourse-cdn.com/v4/letter/r/ba9def/32.png) [@RamdayalSingh](https://community.plotly.com/u/RamdayalSingh)\
**Post date:** [June 25, 2017, 6:25am UTC](https://community.plotly.com/t/api-setting-api-as-the-user-pythonapi-but-the-supplied-api-key-doesnt-match-our-records/4612/1 "2017-06-25T06:25:46Z")

</div>

> import plotly as py  
> py.tools.set\_credentials\_file(username=‘RamdayalSingh’,api\_key=‘what should be given?’)  
> import plotly.plotly as py  
> py.iplot(fig)

Traceback (most recent call last):

File “”, line 1, in   
py.iplot(fig)

File “C:\Users\Ramdayal\Anaconda3\lib\site-packages\plotly\plotly\plotly.py”, line 134, in iplot  
url = plot(figure\_or\_data, \*\*plot\_options)

File “C:\Users\Ramdayal\Anaconda3\lib\site-packages\plotly\plotly\plotly.py”, line 227, in plot  
response = v1.clientresp(data, \*\*plot\_options)

File “C:\Users\Ramdayal\Anaconda3\lib\site-packages\plotly\api\v1\clientresp.py”, line 35, in clientresp  
response = request(‘post’, url, data=payload)

File “C:\Users\Ramdayal\Anaconda3\lib\site-packages\plotly\api\v1\utils.py”, line 86, in request  
validate\_response(response)

File “C:\Users\Ramdayal\Anaconda3\lib\site-packages\plotly\api\v1\utils.py”, line 38, in validate\_response  
raise exceptions.PlotlyRequestError(message, status\_code, content)

PlotlyRequestError: Aw, snap! You tried to use our API as the user ‘PythonAPI’, but the supplied API key doesn’t match our records. You can view your API key at plot.ly/settings.

You’re most likely getting this message because your local credentials file isn’t synced with the Plotly server you’re communicating with.

Go to plot.ly//getting-started (e.g., plot.ly/python/getting-started) for more information.

Make sure that you’re logged in as PythonAPI.

Need help? Please try searching Plotly’s [Stack Overflow channel](http://stackoverflow.com/questions/tagged/plotly).

How can I solve this error?

---

<div class="post-metadata">

**Author:** ![chelsea](https://sea2.discourse-cdn.com/flex024/user_avatar/community.plotly.com/chelsea/32/196_2.png) [@chelsea](https://community.plotly.com/u/chelsea)\
**Post date:** [June 26, 2017, 1:06pm UTC](https://community.plotly.com/t/api-setting-api-as-the-user-pythonapi-but-the-supplied-api-key-doesnt-match-our-records/4612/2 "2017-06-26T13:06:32Z")

</div>

You can log into Plotly and find your API key here: [https://plot.ly/settings/api](https://plot.ly/settings/api)  
You must select the Regenerate Key button to display the key in the box.

 ![](https://us1.discourse-cdn.com/flex024/uploads/plot/original/2X/4/4a7d658b8b79090ccd5ab50c5a61bb8ad227d7f0.png)
