Skip to content

Commit

Permalink
feat: Making API Key optional is self hosted gateway
Browse files Browse the repository at this point in the history
  • Loading branch information
csgulati09 committed Oct 10, 2024
1 parent 87c58a4 commit ee363eb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,13 +108,13 @@ export class Portkey extends ApiClient {
mistralFimCompletion,
});

this.baseURL = baseURL || PORTKEY_BASE_URL;
this.apiKey = apiKey;
if (!this.apiKey) {
if (this.baseURL === PORTKEY_BASE_URL && !this.apiKey) {
throw castToError(MISSING_API_KEY_ERROR_MESSAGE);
}
this.virtualKey = virtualKey || null;
this.config = config || null;
this.baseURL = baseURL || PORTKEY_BASE_URL;
this.provider = provider;
this.traceID = traceID;
this.metadata = metadata;
Expand Down

0 comments on commit ee363eb

Please sign in to comment.