File tree Expand file tree Collapse file tree 4 files changed +12
-12
lines changed Expand file tree Collapse file tree 4 files changed +12
-12
lines changed Original file line number Diff line number Diff line change 11configured_endpoints : 35
22openapi_spec_url : https://storage.googleapis.com/stainless-sdk-openapi-specs/replicate%2Freplicate-client-efbc8cc2d74644b213e161d3e11e0589d1cef181fb318ea02c8eb6b00f245713.yml
33openapi_spec_hash : 13da0c06c900b61cd98ab678e024987a
4- config_hash : e25b98bb6202d27e54fc6e08c7de80d8
4+ config_hash : 8e80c2bf93f71823213f5773dd297921
Original file line number Diff line number Diff line change @@ -28,7 +28,7 @@ import os
2828from replicate import Replicate
2929
3030client = Replicate(
31- api_key = os.environ.get(" REPLICATE_CLIENT_API_KEY " ), # This is the default and can be omitted
31+ api_key = os.environ.get(" REPLICATE_API_TOKEN " ), # This is the default and can be omitted
3232)
3333
3434account = client.account.get()
@@ -37,7 +37,7 @@ print(account.type)
3737
3838While you can provide an ` api_key ` keyword argument,
3939we recommend using [ python-dotenv] ( https://pypi.org/project/python-dotenv/ )
40- to add ` REPLICATE_CLIENT_API_KEY ="My API Key"` to your ` .env ` file
40+ to add ` REPLICATE_API_TOKEN ="My API Key"` to your ` .env ` file
4141so that your API Key is not stored in source control.
4242
4343## Async usage
@@ -50,7 +50,7 @@ import asyncio
5050from replicate import AsyncReplicate
5151
5252client = AsyncReplicate(
53- api_key = os.environ.get(" REPLICATE_CLIENT_API_KEY " ), # This is the default and can be omitted
53+ api_key = os.environ.get(" REPLICATE_API_TOKEN " ), # This is the default and can be omitted
5454)
5555
5656
Original file line number Diff line number Diff line change @@ -83,13 +83,13 @@ def __init__(
8383 ) -> None :
8484 """Construct a new synchronous Replicate client instance.
8585
86- This automatically infers the `api_key` argument from the `REPLICATE_CLIENT_API_KEY ` environment variable if it is not provided.
86+ This automatically infers the `api_key` argument from the `REPLICATE_API_TOKEN ` environment variable if it is not provided.
8787 """
8888 if api_key is None :
89- api_key = os .environ .get ("REPLICATE_CLIENT_API_KEY " )
89+ api_key = os .environ .get ("REPLICATE_API_TOKEN " )
9090 if api_key is None :
9191 raise ReplicateError (
92- "The api_key client option must be set either by passing api_key to the client or by setting the REPLICATE_CLIENT_API_KEY environment variable"
92+ "The api_key client option must be set either by passing api_key to the client or by setting the REPLICATE_API_TOKEN environment variable"
9393 )
9494 self .api_key = api_key
9595
@@ -305,13 +305,13 @@ def __init__(
305305 ) -> None :
306306 """Construct a new async AsyncReplicate client instance.
307307
308- This automatically infers the `api_key` argument from the `REPLICATE_CLIENT_API_KEY ` environment variable if it is not provided.
308+ This automatically infers the `api_key` argument from the `REPLICATE_API_TOKEN ` environment variable if it is not provided.
309309 """
310310 if api_key is None :
311- api_key = os .environ .get ("REPLICATE_CLIENT_API_KEY " )
311+ api_key = os .environ .get ("REPLICATE_API_TOKEN " )
312312 if api_key is None :
313313 raise ReplicateError (
314- "The api_key client option must be set either by passing api_key to the client or by setting the REPLICATE_CLIENT_API_KEY environment variable"
314+ "The api_key client option must be set either by passing api_key to the client or by setting the REPLICATE_API_TOKEN environment variable"
315315 )
316316 self .api_key = api_key
317317
Original file line number Diff line number Diff line change @@ -340,7 +340,7 @@ def test_validate_headers(self) -> None:
340340 assert request .headers .get ("Authorization" ) == f"Bearer { api_key } "
341341
342342 with pytest .raises (ReplicateError ):
343- with update_env (** {"REPLICATE_CLIENT_API_KEY " : Omit ()}):
343+ with update_env (** {"REPLICATE_API_TOKEN " : Omit ()}):
344344 client2 = Replicate (base_url = base_url , api_key = None , _strict_response_validation = True )
345345 _ = client2
346346
@@ -1092,7 +1092,7 @@ def test_validate_headers(self) -> None:
10921092 assert request .headers .get ("Authorization" ) == f"Bearer { api_key } "
10931093
10941094 with pytest .raises (ReplicateError ):
1095- with update_env (** {"REPLICATE_CLIENT_API_KEY " : Omit ()}):
1095+ with update_env (** {"REPLICATE_API_TOKEN " : Omit ()}):
10961096 client2 = AsyncReplicate (base_url = base_url , api_key = None , _strict_response_validation = True )
10971097 _ = client2
10981098
You can’t perform that action at this time.
0 commit comments