@@ -62,12 +62,12 @@ class Asktable(SyncAPIClient):
6262 with_streaming_response : AsktableWithStreamedResponse
6363
6464 # client options
65- bearer_token : str
65+ api_key : str
6666
6767 def __init__ (
6868 self ,
6969 * ,
70- bearer_token : str | None = None ,
70+ api_key : str | None = None ,
7171 base_url : str | httpx .URL | None = None ,
7272 timeout : Union [float , Timeout , None , NotGiven ] = NOT_GIVEN ,
7373 max_retries : int = DEFAULT_MAX_RETRIES ,
@@ -89,15 +89,15 @@ def __init__(
8989 ) -> None :
9090 """Construct a new synchronous asktable client instance.
9191
92- This automatically infers the `bearer_token ` argument from the `ASKTABLE_BEARER_TOKEN ` environment variable if it is not provided.
92+ This automatically infers the `api_key ` argument from the `ASKTABLE_API_KEY ` environment variable if it is not provided.
9393 """
94- if bearer_token is None :
95- bearer_token = os .environ .get ("ASKTABLE_BEARER_TOKEN " )
96- if bearer_token is None :
94+ if api_key is None :
95+ api_key = os .environ .get ("ASKTABLE_API_KEY " )
96+ if api_key is None :
9797 raise AsktableError (
98- "The bearer_token client option must be set either by passing bearer_token to the client or by setting the ASKTABLE_BEARER_TOKEN environment variable"
98+ "The api_key client option must be set either by passing api_key to the client or by setting the ASKTABLE_API_KEY environment variable"
9999 )
100- self .bearer_token = bearer_token
100+ self .api_key = api_key
101101
102102 if base_url is None :
103103 base_url = os .environ .get ("ASKTABLE_BASE_URL" )
@@ -138,8 +138,8 @@ def qs(self) -> Querystring:
138138 @property
139139 @override
140140 def auth_headers (self ) -> dict [str , str ]:
141- bearer_token = self .bearer_token
142- return {"Authorization" : f"Bearer { bearer_token } " }
141+ api_key = self .api_key
142+ return {"Authorization" : f"Bearer { api_key } " }
143143
144144 @property
145145 @override
@@ -153,7 +153,7 @@ def default_headers(self) -> dict[str, str | Omit]:
153153 def copy (
154154 self ,
155155 * ,
156- bearer_token : str | None = None ,
156+ api_key : str | None = None ,
157157 base_url : str | httpx .URL | None = None ,
158158 timeout : float | Timeout | None | NotGiven = NOT_GIVEN ,
159159 http_client : httpx .Client | None = None ,
@@ -187,7 +187,7 @@ def copy(
187187
188188 http_client = http_client or self ._client
189189 return self .__class__ (
190- bearer_token = bearer_token or self .bearer_token ,
190+ api_key = api_key or self .api_key ,
191191 base_url = base_url or self .base_url ,
192192 timeout = self .timeout if isinstance (timeout , NotGiven ) else timeout ,
193193 http_client = http_client ,
@@ -252,12 +252,12 @@ class AsyncAsktable(AsyncAPIClient):
252252 with_streaming_response : AsyncAsktableWithStreamedResponse
253253
254254 # client options
255- bearer_token : str
255+ api_key : str
256256
257257 def __init__ (
258258 self ,
259259 * ,
260- bearer_token : str | None = None ,
260+ api_key : str | None = None ,
261261 base_url : str | httpx .URL | None = None ,
262262 timeout : Union [float , Timeout , None , NotGiven ] = NOT_GIVEN ,
263263 max_retries : int = DEFAULT_MAX_RETRIES ,
@@ -279,15 +279,15 @@ def __init__(
279279 ) -> None :
280280 """Construct a new async asktable client instance.
281281
282- This automatically infers the `bearer_token ` argument from the `ASKTABLE_BEARER_TOKEN ` environment variable if it is not provided.
282+ This automatically infers the `api_key ` argument from the `ASKTABLE_API_KEY ` environment variable if it is not provided.
283283 """
284- if bearer_token is None :
285- bearer_token = os .environ .get ("ASKTABLE_BEARER_TOKEN " )
286- if bearer_token is None :
284+ if api_key is None :
285+ api_key = os .environ .get ("ASKTABLE_API_KEY " )
286+ if api_key is None :
287287 raise AsktableError (
288- "The bearer_token client option must be set either by passing bearer_token to the client or by setting the ASKTABLE_BEARER_TOKEN environment variable"
288+ "The api_key client option must be set either by passing api_key to the client or by setting the ASKTABLE_API_KEY environment variable"
289289 )
290- self .bearer_token = bearer_token
290+ self .api_key = api_key
291291
292292 if base_url is None :
293293 base_url = os .environ .get ("ASKTABLE_BASE_URL" )
@@ -328,8 +328,8 @@ def qs(self) -> Querystring:
328328 @property
329329 @override
330330 def auth_headers (self ) -> dict [str , str ]:
331- bearer_token = self .bearer_token
332- return {"Authorization" : f"Bearer { bearer_token } " }
331+ api_key = self .api_key
332+ return {"Authorization" : f"Bearer { api_key } " }
333333
334334 @property
335335 @override
@@ -343,7 +343,7 @@ def default_headers(self) -> dict[str, str | Omit]:
343343 def copy (
344344 self ,
345345 * ,
346- bearer_token : str | None = None ,
346+ api_key : str | None = None ,
347347 base_url : str | httpx .URL | None = None ,
348348 timeout : float | Timeout | None | NotGiven = NOT_GIVEN ,
349349 http_client : httpx .AsyncClient | None = None ,
@@ -377,7 +377,7 @@ def copy(
377377
378378 http_client = http_client or self ._client
379379 return self .__class__ (
380- bearer_token = bearer_token or self .bearer_token ,
380+ api_key = api_key or self .api_key ,
381381 base_url = base_url or self .base_url ,
382382 timeout = self .timeout if isinstance (timeout , NotGiven ) else timeout ,
383383 http_client = http_client ,
0 commit comments