litellm icon indicating copy to clipboard operation
litellm copied to clipboard

[Feature]: Make Proxy Authentication Errors OpenAI Compatible

Open ishaan-jaff opened this issue 1 year ago • 0 comments

The Feature

When I cross my Budget on an API Key I see the following exception from the proxy. There is no body set

got this exception from server
AuthenticationError: 401 status code (no body)
    at APIError.generate (/Users/ishaanjaffer/Github/litellm/litellm/proxy/tests/node_modules/openai/error.js:47:20)
    at OpenAI.makeStatusError (/Users/ishaanjaffer/Github/litellm/litellm/proxy/tests/node_modules/openai/core.js:255:33)
    at OpenAI.makeRequest (/Users/ishaanjaffer/Github/litellm/litellm/proxy/tests/node_modules/openai/core.js:294:30)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async runOpenAI (/Users/ishaanjaffer/Github/litellm/litellm/proxy/tests/test_openai_js.js:12:22) {
  status: 401,
  headers: {
    'content-length': '117',
    'content-type': 'application/json',
    date: 'Mon, 22 Jan 2024 21:21:14 GMT',
    server: 'uvicorn'
  },
  error: undefined,
  code: undefined,
  param: undefined,
  type: undefined
}
done with exception from proxy

Motivation, pitch

Twitter / LinkedIn details

No response

ishaan-jaff avatar Jan 22 '24 21:01 ishaan-jaff