Skip to content

Commit 67b4f07

Browse files
committed
Revert "feat: add api_token parameter support for legacy compatibility"
This reverts commit 8c05e64.
1 parent 8c05e64 commit 67b4f07

File tree

2 files changed

+0
-111
lines changed

2 files changed

+0
-111
lines changed

src/replicate/_client.py

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -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:

tests/test_api_token_compatibility.py

Lines changed: 0 additions & 89 deletions
This file was deleted.

0 commit comments

Comments
 (0)