@@ -94,7 +94,7 @@ For supported JavaScript runtimes, please consult [RUNTIMES.md](RUNTIMES.md).
9494import { OpenRouter } from " open-router" ;
9595
9696const openRouter = new OpenRouter ({
97- bearerAuth : process .env [" OPENROUTER_BEARER_AUTH " ] ?? " " ,
97+ apiKey : process .env [" OPENROUTER_API_KEY " ] ?? " " ,
9898});
9999
100100async function run() {
@@ -125,16 +125,16 @@ run();
125125
126126This SDK supports the following security scheme globally:
127127
128- | Name | Type | Scheme | Environment Variable |
129- | ------------ | ---- | ----------- | ---- -------------------- |
130- | ` bearerAuth ` | http | HTTP Bearer | ` OPENROUTER_BEARER_AUTH ` |
128+ | Name | Type | Scheme | Environment Variable |
129+ | -------- | ---- | ----------- | -------------------- |
130+ | ` apiKey ` | http | HTTP Bearer | ` OPENROUTER_API_KEY ` |
131131
132- To authenticate with the API the ` bearerAuth ` parameter must be set when initializing the SDK client instance. For example:
132+ To authenticate with the API the ` apiKey ` parameter must be set when initializing the SDK client instance. For example:
133133``` typescript
134134import { OpenRouter } from " open-router" ;
135135
136136const openRouter = new OpenRouter ({
137- bearerAuth : process .env [" OPENROUTER_BEARER_AUTH " ] ?? " " ,
137+ apiKey : process .env [" OPENROUTER_API_KEY " ] ?? " " ,
138138});
139139
140140async function run() {
@@ -283,7 +283,7 @@ To change the default retry strategy for a single API call, simply provide a ret
283283import { OpenRouter } from " open-router" ;
284284
285285const openRouter = new OpenRouter ({
286- bearerAuth : process .env [" OPENROUTER_BEARER_AUTH " ] ?? " " ,
286+ apiKey : process .env [" OPENROUTER_API_KEY " ] ?? " " ,
287287});
288288
289289async function run() {
@@ -332,7 +332,7 @@ const openRouter = new OpenRouter({
332332 },
333333 retryConnectionErrors: false ,
334334 },
335- bearerAuth : process .env [" OPENROUTER_BEARER_AUTH " ] ?? " " ,
335+ apiKey : process .env [" OPENROUTER_API_KEY " ] ?? " " ,
336336});
337337
338338async function run() {
@@ -376,7 +376,7 @@ import { OpenRouter } from "open-router";
376376import * as errors from " open-router/models/errors" ;
377377
378378const openRouter = new OpenRouter ({
379- bearerAuth : process .env [" OPENROUTER_BEARER_AUTH " ] ?? " " ,
379+ apiKey : process .env [" OPENROUTER_API_KEY " ] ?? " " ,
380380});
381381
382382async function run() {
@@ -455,7 +455,7 @@ import { OpenRouter } from "open-router";
455455
456456const openRouter = new OpenRouter ({
457457 providerUrl: " https://ruddy-guacamole.info/" ,
458- bearerAuth : process .env [" OPENROUTER_BEARER_AUTH " ] ?? " " ,
458+ apiKey : process .env [" OPENROUTER_API_KEY " ] ?? " " ,
459459});
460460
461461async function run() {
@@ -486,7 +486,7 @@ import { OpenRouter } from "open-router";
486486
487487const openRouter = new OpenRouter ({
488488 serverURL: " https://openrouter.ai/api/v1" ,
489- bearerAuth : process .env [" OPENROUTER_BEARER_AUTH " ] ?? " " ,
489+ apiKey : process .env [" OPENROUTER_API_KEY " ] ?? " " ,
490490});
491491
492492async function run() {
0 commit comments