@@ -102,7 +102,6 @@ def __init__(
102102 self ,
103103 * ,
104104 bearer_token : str | None = None ,
105- api_token : str | None = None , # Legacy compatibility parameter
106105 base_url : str | httpx .URL | None = None ,
107106 timeout : Union [float , Timeout , None , NotGiven ] = NOT_GIVEN ,
108107 max_retries : int = DEFAULT_MAX_RETRIES ,
@@ -125,17 +124,7 @@ def __init__(
125124 """Construct a new synchronous Replicate client instance.
126125
127126 This automatically infers the `bearer_token` argument from the `REPLICATE_API_TOKEN` environment variable if it is not provided.
128-
129- For legacy compatibility, you can also pass `api_token` instead of `bearer_token`.
130127 """
131- # Handle legacy api_token parameter
132- if api_token is not None and bearer_token is not None :
133- raise ReplicateError (
134- "Cannot specify both 'bearer_token' and 'api_token'. Please use 'bearer_token' (recommended) or 'api_token' for legacy compatibility."
135- )
136- if api_token is not None :
137- bearer_token = api_token
138-
139128 if bearer_token is None :
140129 bearer_token = _get_api_token_from_environment ()
141130 if bearer_token is None :
@@ -488,7 +477,6 @@ def __init__(
488477 self ,
489478 * ,
490479 bearer_token : str | None = None ,
491- api_token : str | None = None , # Legacy compatibility parameter
492480 base_url : str | httpx .URL | None = None ,
493481 timeout : Union [float , Timeout , None , NotGiven ] = NOT_GIVEN ,
494482 max_retries : int = DEFAULT_MAX_RETRIES ,
@@ -511,17 +499,7 @@ def __init__(
511499 """Construct a new async AsyncReplicate client instance.
512500
513501 This automatically infers the `bearer_token` argument from the `REPLICATE_API_TOKEN` environment variable if it is not provided.
514-
515- For legacy compatibility, you can also pass `api_token` instead of `bearer_token`.
516502 """
517- # Handle legacy api_token parameter
518- if api_token is not None and bearer_token is not None :
519- raise ReplicateError (
520- "Cannot specify both 'bearer_token' and 'api_token'. Please use 'bearer_token' (recommended) or 'api_token' for legacy compatibility."
521- )
522- if api_token is not None :
523- bearer_token = api_token
524-
525503 if bearer_token is None :
526504 bearer_token = _get_api_token_from_environment ()
527505 if bearer_token is None :
0 commit comments