We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 08128b9 commit fc68c57Copy full SHA for fc68c57
openai/init.moon
@@ -366,8 +366,6 @@ class OpenAI
366
assert path, "missing path"
367
assert method, "missing method"
368
369
- assert @api_key, "missing api_key"
370
-
371
url = @api_base .. path
372
373
body = if payload
@@ -378,9 +376,11 @@ class OpenAI
378
376
"Accept": "application/json"
379
377
"Content-Type": "application/json"
380
"Content-Length": body and #body or nil
381
- "Authorization": "Bearer #{@api_key}"
382
}
383
+ if @api_key
+ headers["Authorization"] = "Bearer #{@api_key}"
+
384
if more_headers
385
for k,v in pairs more_headers
386
headers[k] = v
0 commit comments