Skip to content

Instantly share code, notes, and snippets.

@cristianchaparroa
Created November 20, 2024 06:17
Show Gist options
  • Save cristianchaparroa/73c8abb1d470932a9c637b7d435e0ef3 to your computer and use it in GitHub Desktop.
Save cristianchaparroa/73c8abb1d470932a9c637b7d435e0ef3 to your computer and use it in GitHub Desktop.
OpenAI API error: AuthenticationError: 401 Incorrect API key provided: sk-proj-********************************************************************************************************************************************************FcoA. You can find your API key at https://platform.openai.com/account/api-keys.
at APIError.generate (file:///Users/cristian/projects/hashtracker/bots/hashtracker/node_modules/openai/error.mjs:44:20)
at OpenAI.makeStatusError (file:///Users/cristian/projects/hashtracker/bots/hashtracker/node_modules/openai/core.mjs:286:25)
at OpenAI.makeRequest (file:///Users/cristian/projects/hashtracker/bots/hashtracker/node_modules/openai/core.mjs:330:30)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async textGeneration (file:///Users/cristian/projects/hashtracker/bots/hashtracker/node_modules/@xmtp/message-kit/dist/index.js:1212:26)
at async file:///Users/cristian/projects/hashtracker/bots/hashtracker/dist/index.js:10:27
at async handleMessage (file:///Users/cristian/projects/hashtracker/bots/hashtracker/node_modules/@xmtp/message-kit/dist/index.js:771:21) {
status: 401,
headers: {
'alt-svc': 'h3=":443"; ma=86400',
'cf-cache-status': 'DYNAMIC',
'cf-ray': '8e564f0fb9d2e19a-MRS',
connection: 'keep-alive',
'content-length': '414',
'content-type': 'application/json; charset=utf-8',
date: 'Wed, 20 Nov 2024 06:16:01 GMT',
server: 'cloudflare',
'set-cookie': '__cf_bm=3BRth6m40nCgxxTscOvzgi0xl.Uw3tF7hRye0y._S_I-1732083361-1.0.1.1-U8N9VMIkPNee.EaqHWvU1wVPlCC5XAxSlJ5qBoHX0iSQNAxaBxQnTaLJtWU3KShcROHzDnkfbb7lbJUYUPDBCQ; path=/; expires=Wed, 20-Nov-24 06:46:01 GMT; domain=.api.openai.com; HttpOnly; Secure; SameSite=None, _cfuvid=XC13jyfpgdCkN5VVGZzwJnv1HP6IY82uGmReGbAy1VU-1732083361573-0.0.1.1-604800000; path=/; domain=.api.openai.com; HttpOnly; Secure; SameSite=None',
'strict-transport-security': 'max-age=31536000; includeSubDomains; preload',
vary: 'Origin',
'x-content-type-options': 'nosniff',
'x-request-id': 'req_1a4ad74a9e99fd43e9044fee31d6843d'
},
request_id: 'req_1a4ad74a9e99fd43e9044fee31d6843d',
error: {
message: 'Incorrect API key provided: sk-proj-********************************************************************************************************************************************************FcoA. You can find your API key at https://platform.openai.com/account/api-keys.',
type: 'invalid_request_error',
param: null,
code: 'invalid_api_key'
},
code: 'invalid_api_key',
param: null,
type: 'invalid_request_error'
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment