From a4e47bd886ac06a1de79ad49f8ae460df083d9ff Mon Sep 17 00:00:00 2001 From: Nikitha Suryadevara Date: Thu, 23 Oct 2025 15:27:40 -0700 Subject: [PATCH 01/13] Added two new filters to the CLI. usage_type and mine --- src/together/resources/endpoints.py | 26 ++++++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/src/together/resources/endpoints.py b/src/together/resources/endpoints.py index e40238a..fd60e04 100644 --- a/src/together/resources/endpoints.py +++ b/src/together/resources/endpoints.py @@ -13,13 +13,18 @@ def __init__(self, client: TogetherClient) -> None: self._client = client def list( - self, type: Optional[Literal["dedicated", "serverless"]] = None + self, + type: Optional[Literal["dedicated", "serverless"]] = None, + usage_type: Optional[Literal["on-demand", "reserved"]] = None, + mine: Optional[bool] = None, ) -> List[ListEndpoint]: """ - List all endpoints, can be filtered by type. + List all endpoints, can be filtered by type, usage type, and ownership. Args: type (str, optional): Filter endpoints by type ("dedicated" or "serverless"). Defaults to None. + usage_type (str, optional): Filter by usage type ("on-demand" or "reserved"). Defaults to None. + mine (bool, optional): If True, return only endpoints owned by the caller. If False, return endpoints not owned by the caller. Defaults to None. Returns: List[ListEndpoint]: List of endpoint objects @@ -31,6 +36,10 @@ def list( params = {} if type is not None: params["type"] = type + if usage_type is not None: + params["usage_type"] = usage_type + if mine is not None: + params["mine"] = str(mine).lower() response, _, _ = requestor.request( options=TogetherRequest( @@ -263,13 +272,18 @@ def __init__(self, client: TogetherClient) -> None: self._client = client async def list( - self, type: Optional[Literal["dedicated", "serverless"]] = None + self, + type: Optional[Literal["dedicated", "serverless"]] = None, + usage_type: Optional[Literal["on-demand", "reserved"]] = None, + mine: Optional[bool] = None, ) -> List[ListEndpoint]: """ - List all endpoints, can be filtered by type. + List all endpoints, can be filtered by type, usage type, and ownership. Args: type (str, optional): Filter endpoints by type ("dedicated" or "serverless"). Defaults to None. + usage_type (str, optional): Filter by usage type ("on-demand" or "reserved"). Defaults to None. + mine (bool, optional): If True, return only endpoints owned by the caller. If False, return endpoints not owned by the caller. Defaults to None. Returns: List[ListEndpoint]: List of endpoint objects @@ -281,6 +295,10 @@ async def list( params = {} if type is not None: params["type"] = type + if usage_type is not None: + params["usage_type"] = usage_type + if mine is not None: + params["mine"] = str(mine).lower() response, _, _ = await requestor.arequest( options=TogetherRequest( From 89ead8138742995ba6136f0297ff615b4078c0c6 Mon Sep 17 00:00:00 2001 From: Nikitha Suryadevara Date: Thu, 23 Oct 2025 15:53:30 -0700 Subject: [PATCH 02/13] fixed pre-commit merge issues --- src/together/cli/api/endpoints.py | 12 ++++++++++++ src/together/resources/endpoints.py | 6 +++--- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/src/together/cli/api/endpoints.py b/src/together/cli/api/endpoints.py index 3b1da3f..10b7d48 100644 --- a/src/together/cli/api/endpoints.py +++ b/src/together/cli/api/endpoints.py @@ -337,6 +337,18 @@ def delete(client: Together, endpoint_id: str) -> None: type=click.Choice(["dedicated", "serverless"]), help="Filter by endpoint type", ) +@click.option( + "--usage-type", + type=click.Choice(["on-demand", "reserved"]), + help="Filter by usage type", +) +@click.option( + "--mine", + is_flag=True, + default=False, + help="Show only endpoints owned by you", +) + @click.pass_obj @handle_api_errors def list( diff --git a/src/together/resources/endpoints.py b/src/together/resources/endpoints.py index fd60e04..b871bb8 100644 --- a/src/together/resources/endpoints.py +++ b/src/together/resources/endpoints.py @@ -33,7 +33,7 @@ def list( client=self._client, ) - params = {} + params: Dict[str, str] = {} if type is not None: params["type"] = type if usage_type is not None: @@ -247,7 +247,7 @@ def list_hardware(self, model: Optional[str] = None) -> List[HardwareWithStatus] client=self._client, ) - params = {} + params: Dict[str, str] = {} if model is not None: params["model"] = model @@ -292,7 +292,7 @@ async def list( client=self._client, ) - params = {} + params: Dict[str, str] = {} if type is not None: params["type"] = type if usage_type is not None: From 174f79adee837441e3c78e739faba3af44d14da9 Mon Sep 17 00:00:00 2001 From: Nikitha Suryadevara Date: Thu, 23 Oct 2025 15:55:40 -0700 Subject: [PATCH 03/13] fixed pre-commit merge issues --- src/together/cli/api/endpoints.py | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/src/together/cli/api/endpoints.py b/src/together/cli/api/endpoints.py index 10b7d48..50f9bf4 100644 --- a/src/together/cli/api/endpoints.py +++ b/src/together/cli/api/endpoints.py @@ -337,17 +337,6 @@ def delete(client: Together, endpoint_id: str) -> None: type=click.Choice(["dedicated", "serverless"]), help="Filter by endpoint type", ) -@click.option( - "--usage-type", - type=click.Choice(["on-demand", "reserved"]), - help="Filter by usage type", -) -@click.option( - "--mine", - is_flag=True, - default=False, - help="Show only endpoints owned by you", -) @click.pass_obj @handle_api_errors From 9c6ca9cc64c055ba81967e3628415e88a6304953 Mon Sep 17 00:00:00 2001 From: Nikitha Suryadevara Date: Thu, 23 Oct 2025 16:09:21 -0700 Subject: [PATCH 04/13] Apply Black formatting --- src/together/cli/api/endpoints.py | 1 - 1 file changed, 1 deletion(-) diff --git a/src/together/cli/api/endpoints.py b/src/together/cli/api/endpoints.py index 50f9bf4..3b1da3f 100644 --- a/src/together/cli/api/endpoints.py +++ b/src/together/cli/api/endpoints.py @@ -337,7 +337,6 @@ def delete(client: Together, endpoint_id: str) -> None: type=click.Choice(["dedicated", "serverless"]), help="Filter by endpoint type", ) - @click.pass_obj @handle_api_errors def list( From 7efccd088b39612fbfece981c8e3dc2ceb9fb43d Mon Sep 17 00:00:00 2001 From: Nikitha Suryadevara Date: Thu, 23 Oct 2025 16:19:40 -0700 Subject: [PATCH 05/13] clarified difference between endpoint type and usage type --- src/together/resources/endpoints.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/together/resources/endpoints.py b/src/together/resources/endpoints.py index b871bb8..5046244 100644 --- a/src/together/resources/endpoints.py +++ b/src/together/resources/endpoints.py @@ -19,10 +19,10 @@ def list( mine: Optional[bool] = None, ) -> List[ListEndpoint]: """ - List all endpoints, can be filtered by type, usage type, and ownership. + List all endpoints, can be filtered by endpointtype, usage type, and ownership. Args: - type (str, optional): Filter endpoints by type ("dedicated" or "serverless"). Defaults to None. + type (str, optional): Filter endpoints by endpoint type ("dedicated" or "serverless"). Defaults to None. usage_type (str, optional): Filter by usage type ("on-demand" or "reserved"). Defaults to None. mine (bool, optional): If True, return only endpoints owned by the caller. If False, return endpoints not owned by the caller. Defaults to None. From ccdd9b2ed712062f3794461b27727c27132e2b01 Mon Sep 17 00:00:00 2001 From: Nikitha Suryadevara Date: Thu, 23 Oct 2025 16:20:42 -0700 Subject: [PATCH 06/13] typo --- src/together/resources/endpoints.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/together/resources/endpoints.py b/src/together/resources/endpoints.py index 5046244..feb5e19 100644 --- a/src/together/resources/endpoints.py +++ b/src/together/resources/endpoints.py @@ -19,7 +19,7 @@ def list( mine: Optional[bool] = None, ) -> List[ListEndpoint]: """ - List all endpoints, can be filtered by endpointtype, usage type, and ownership. + List all endpoints, can be filtered by endpoint type, usage type, and ownership. Args: type (str, optional): Filter endpoints by endpoint type ("dedicated" or "serverless"). Defaults to None. From e439329c71c1fbb31ec49101b4d2b64aebc38afe Mon Sep 17 00:00:00 2001 From: mitali401 Date: Fri, 24 Oct 2025 09:44:39 -0700 Subject: [PATCH 07/13] only add mine --- src/together/cli/api/endpoints.py | 12 ++++++++++-- src/together/resources/endpoints.py | 12 ++++-------- 2 files changed, 14 insertions(+), 10 deletions(-) diff --git a/src/together/cli/api/endpoints.py b/src/together/cli/api/endpoints.py index 3b1da3f..96c5bf9 100644 --- a/src/together/cli/api/endpoints.py +++ b/src/together/cli/api/endpoints.py @@ -337,13 +337,21 @@ def delete(client: Together, endpoint_id: str) -> None: type=click.Choice(["dedicated", "serverless"]), help="Filter by endpoint type", ) +@click.option( + "--mine", + is_flag=True, + help="Show only endpoints owned by me", +) @click.pass_obj @handle_api_errors def list( - client: Together, json: bool, type: Literal["dedicated", "serverless"] | None + client: Together, + json: bool, + type: Literal["dedicated", "serverless"] | None, + mine: bool | None, ) -> None: """List all inference endpoints (includes both dedicated and serverless endpoints).""" - endpoints: List[ListEndpoint] = client.endpoints.list(type=type) + endpoints: List[ListEndpoint] = client.endpoints.list(type=type, mine=mine) if not endpoints: click.echo("No dedicated endpoints found", err=True) diff --git a/src/together/resources/endpoints.py b/src/together/resources/endpoints.py index feb5e19..51e9d02 100644 --- a/src/together/resources/endpoints.py +++ b/src/together/resources/endpoints.py @@ -33,13 +33,11 @@ def list( client=self._client, ) - params: Dict[str, str] = {} + params = {} if type is not None: params["type"] = type - if usage_type is not None: - params["usage_type"] = usage_type if mine is not None: - params["mine"] = str(mine).lower() + params["mine"] = mine response, _, _ = requestor.request( options=TogetherRequest( @@ -292,13 +290,11 @@ async def list( client=self._client, ) - params: Dict[str, str] = {} + params = {} if type is not None: params["type"] = type - if usage_type is not None: - params["usage_type"] = usage_type if mine is not None: - params["mine"] = str(mine).lower() + params["mine"] = mine response, _, _ = await requestor.arequest( options=TogetherRequest( From 5eea56bf2b8ce0060e3d809f0124755960d6bc16 Mon Sep 17 00:00:00 2001 From: mitali401 Date: Fri, 24 Oct 2025 09:46:27 -0700 Subject: [PATCH 08/13] remove usage type --- src/together/resources/endpoints.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/together/resources/endpoints.py b/src/together/resources/endpoints.py index 51e9d02..665c69a 100644 --- a/src/together/resources/endpoints.py +++ b/src/together/resources/endpoints.py @@ -15,15 +15,13 @@ def __init__(self, client: TogetherClient) -> None: def list( self, type: Optional[Literal["dedicated", "serverless"]] = None, - usage_type: Optional[Literal["on-demand", "reserved"]] = None, mine: Optional[bool] = None, ) -> List[ListEndpoint]: """ - List all endpoints, can be filtered by endpoint type, usage type, and ownership. + List all endpoints, can be filtered by endpoint type and ownership. Args: type (str, optional): Filter endpoints by endpoint type ("dedicated" or "serverless"). Defaults to None. - usage_type (str, optional): Filter by usage type ("on-demand" or "reserved"). Defaults to None. mine (bool, optional): If True, return only endpoints owned by the caller. If False, return endpoints not owned by the caller. Defaults to None. Returns: @@ -272,15 +270,13 @@ def __init__(self, client: TogetherClient) -> None: async def list( self, type: Optional[Literal["dedicated", "serverless"]] = None, - usage_type: Optional[Literal["on-demand", "reserved"]] = None, mine: Optional[bool] = None, ) -> List[ListEndpoint]: """ - List all endpoints, can be filtered by type, usage type, and ownership. + List all endpoints, can be filtered by type and ownership. Args: type (str, optional): Filter endpoints by type ("dedicated" or "serverless"). Defaults to None. - usage_type (str, optional): Filter by usage type ("on-demand" or "reserved"). Defaults to None. mine (bool, optional): If True, return only endpoints owned by the caller. If False, return endpoints not owned by the caller. Defaults to None. Returns: From 4130d28c59c3b813d88e3e8cb7eec4415ad8ecee Mon Sep 17 00:00:00 2001 From: mitali401 Date: Fri, 24 Oct 2025 10:03:14 -0700 Subject: [PATCH 09/13] make mine true, false, none --- src/together/cli/api/endpoints.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/together/cli/api/endpoints.py b/src/together/cli/api/endpoints.py index 96c5bf9..36ee0d3 100644 --- a/src/together/cli/api/endpoints.py +++ b/src/together/cli/api/endpoints.py @@ -339,8 +339,9 @@ def delete(client: Together, endpoint_id: str) -> None: ) @click.option( "--mine", - is_flag=True, - help="Show only endpoints owned by me", + type=click.BOOL, + default=None, + help="true (only mine), false (exclude mine), default=all", ) @click.pass_obj @handle_api_errors From b36b99666a35eed59a3cde2c1f1777656d29f09e Mon Sep 17 00:00:00 2001 From: mitali401 Date: Fri, 24 Oct 2025 10:14:03 -0700 Subject: [PATCH 10/13] fix params type --- log1.txt | 1 + src/together/resources/endpoints.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) create mode 100644 log1.txt diff --git a/log1.txt b/log1.txt new file mode 100644 index 0000000..c92db52 --- /dev/null +++ b/log1.txt @@ -0,0 +1 @@ +{"object":"list","data":[{"id":"endpoint-2f8539d4-3266-41d4-9f80-cd772114d123","object":"endpoint","name":"cursor/deepseek-v3-agent-mystery-2-7","display_name":"DeepSeek V3-0324","model":"cursor/deepseek-v3-agent-mystery-2-7","model_type":"chat","hardware":"4x_nvidia_b200_180gb_sxm","type":"dedicated","owner":"anysphere_2893","state":"STARTED","inactive_timeout":0,"autoscaling":{"min_replicas":176,"max_replicas":176,"current_replicas":176},"created_at":"2025-10-04T03:38:57.054Z"}]} diff --git a/src/together/resources/endpoints.py b/src/together/resources/endpoints.py index 665c69a..9bbc03b 100644 --- a/src/together/resources/endpoints.py +++ b/src/together/resources/endpoints.py @@ -243,7 +243,7 @@ def list_hardware(self, model: Optional[str] = None) -> List[HardwareWithStatus] client=self._client, ) - params: Dict[str, str] = {} + params = {} if model is not None: params["model"] = model From 8a50bb7df2596d67f7f188e0249cce7f5236a5b5 Mon Sep 17 00:00:00 2001 From: mitali401 Date: Fri, 24 Oct 2025 10:15:51 -0700 Subject: [PATCH 11/13] remove log file --- log1.txt | 1 - 1 file changed, 1 deletion(-) delete mode 100644 log1.txt diff --git a/log1.txt b/log1.txt deleted file mode 100644 index c92db52..0000000 --- a/log1.txt +++ /dev/null @@ -1 +0,0 @@ -{"object":"list","data":[{"id":"endpoint-2f8539d4-3266-41d4-9f80-cd772114d123","object":"endpoint","name":"cursor/deepseek-v3-agent-mystery-2-7","display_name":"DeepSeek V3-0324","model":"cursor/deepseek-v3-agent-mystery-2-7","model_type":"chat","hardware":"4x_nvidia_b200_180gb_sxm","type":"dedicated","owner":"anysphere_2893","state":"STARTED","inactive_timeout":0,"autoscaling":{"min_replicas":176,"max_replicas":176,"current_replicas":176},"created_at":"2025-10-04T03:38:57.054Z"}]} From 0b802efbf93153606976864235ffe8ab25973e56 Mon Sep 17 00:00:00 2001 From: Nikitha Suryadevara Date: Wed, 29 Oct 2025 16:20:37 -0700 Subject: [PATCH 12/13] fixed integration tests and added back usage_type filtering since PR got merged https://github.com/togethercomputer/together-dedicated-endpoints/pull/92 --- poetry.lock | 18 +++++++++--------- pyproject.toml | 1 + src/together/cli/api/endpoints.py | 14 +++++++++++--- src/together/resources/endpoints.py | 26 ++++++++++++++++++++++++-- 4 files changed, 45 insertions(+), 14 deletions(-) diff --git a/poetry.lock b/poetry.lock index 78745bb..b41ddc9 100644 --- a/poetry.lock +++ b/poetry.lock @@ -1,4 +1,4 @@ -# This file is automatically @generated by Poetry 2.1.3 and should not be changed by hand. +# This file is automatically @generated by Poetry 2.2.1 and should not be changed by hand. [[package]] name = "aiohappyeyeballs" @@ -188,7 +188,7 @@ version = "25.9.0" description = "The uncompromising code formatter." optional = false python-versions = ">=3.9" -groups = ["quality"] +groups = ["main", "quality"] files = [ {file = "black-25.9.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:ce41ed2614b706fd55fd0b4a6909d06b5bab344ffbfadc6ef34ae50adba3d4f7"}, {file = "black-25.9.0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:2ab0ce111ef026790e9b13bd216fa7bc48edd934ffc4cbf78808b235793cbc92"}, @@ -1038,7 +1038,7 @@ version = "1.1.0" description = "Type system extensions for programs checked with the mypy type checker." optional = false python-versions = ">=3.8" -groups = ["quality"] +groups = ["main", "quality"] files = [ {file = "mypy_extensions-1.1.0-py3-none-any.whl", hash = "sha256:1be4cccdb0f2482337c4743e60421de3a356cd97508abadd57d47403e94f5505"}, {file = "mypy_extensions-1.1.0.tar.gz", hash = "sha256:52e68efc3284861e772bbcd66823fde5ae21fd2fdb51c62a211403730b916558"}, @@ -1127,7 +1127,7 @@ version = "25.0" description = "Core utilities for Python packages" optional = false python-versions = ">=3.8" -groups = ["examples", "quality", "tests"] +groups = ["main", "examples", "quality", "tests"] files = [ {file = "packaging-25.0-py3-none-any.whl", hash = "sha256:29572ef2b1f17581046b3a2227d5c611fb25ec70ca1ba8554b24b0e69331a484"}, {file = "packaging-25.0.tar.gz", hash = "sha256:d443872c98d677bf60f6a1f2f8c1cb748e8fe762d2bf9d3148b5599295b0fc4f"}, @@ -1226,7 +1226,7 @@ version = "0.12.1" description = "Utility library for gitignore style pattern matching of file paths." optional = false python-versions = ">=3.8" -groups = ["quality"] +groups = ["main", "quality"] files = [ {file = "pathspec-0.12.1-py3-none-any.whl", hash = "sha256:a0d503e138a4c123b27490a4f7beda6a01c6f288df0e4a8b79c7eb0dc7b4cc08"}, {file = "pathspec-0.12.1.tar.gz", hash = "sha256:a482d51503a1ab33b1c67a6c3813a26953dbdc71c31dacaef9a838c4e29f5712"}, @@ -1363,7 +1363,7 @@ version = "4.4.0" description = "A small Python package for determining appropriate platform-specific dirs, e.g. a `user data dir`." optional = false python-versions = ">=3.9" -groups = ["quality", "tests"] +groups = ["main", "quality", "tests"] files = [ {file = "platformdirs-4.4.0-py3-none-any.whl", hash = "sha256:abd01743f24e5287cd7a5db3752faf1a2d65353f38ec26d98e25a6db65958c85"}, {file = "platformdirs-4.4.0.tar.gz", hash = "sha256:ca753cf4d81dc309bc67b0ea38fd15dc97bc30ce419a7f58d13eb3bf14c4febf"}, @@ -1857,7 +1857,7 @@ version = "0.1.10" description = "A Fast, spec compliant Python 3.12+ tokenizer that runs on older Pythons." optional = false python-versions = ">=3.8" -groups = ["quality"] +groups = ["main", "quality"] files = [ {file = "pytokens-0.1.10-py3-none-any.whl", hash = "sha256:db7b72284e480e69fb085d9f251f66b3d2df8b7166059261258ff35f50fb711b"}, {file = "pytokens-0.1.10.tar.gz", hash = "sha256:c9a4bfa0be1d26aebce03e6884ba454e842f186a59ea43a6d3b25af58223c044"}, @@ -2231,7 +2231,7 @@ version = "2.2.1" description = "A lil' TOML parser" optional = false python-versions = ">=3.8" -groups = ["quality", "tests"] +groups = ["main", "quality", "tests"] markers = "python_version == \"3.10\"" files = [ {file = "tomli-2.2.1-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:678e4fa69e4575eb77d103de3df8a895e1591b48e740211bd1067378c69e8249"}, @@ -2831,4 +2831,4 @@ pyarrow = ["pyarrow"] [metadata] lock-version = "2.1" python-versions = "^3.10" -content-hash = "394883338926938b8fca8e0feefa887251f11117b69f6ab902f0409686e26641" +content-hash = "3d3ebb33bcfa42854b82a80147fcfd055101d4a38485850a6720ac72f6ecb176" diff --git a/pyproject.toml b/pyproject.toml index e6d6063..fc9c08a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -43,6 +43,7 @@ numpy = [ { version = ">=1.26.0", python = ">=3.12" }, ] pillow = "^11.1.0" +black = "^25.9.0" [tool.poetry.extras] pyarrow = ["pyarrow"] diff --git a/src/together/cli/api/endpoints.py b/src/together/cli/api/endpoints.py index 36ee0d3..4588edc 100644 --- a/src/together/cli/api/endpoints.py +++ b/src/together/cli/api/endpoints.py @@ -343,16 +343,24 @@ def delete(client: Together, endpoint_id: str) -> None: default=None, help="true (only mine), false (exclude mine), default=all", ) +@click.option( + "--usage-type", + type=click.Choice(["on-demand", "reserved"]), + help="Filter by endpoint usage type", +) @click.pass_obj @handle_api_errors def list( - client: Together, - json: bool, + client: Together, + json: bool, type: Literal["dedicated", "serverless"] | None, + usage_type: Literal["on-demand", "reserved"] | None, mine: bool | None, ) -> None: """List all inference endpoints (includes both dedicated and serverless endpoints).""" - endpoints: List[ListEndpoint] = client.endpoints.list(type=type, mine=mine) + endpoints: List[ListEndpoint] = client.endpoints.list( + type=type, usage_type=usage_type, mine=mine + ) if not endpoints: click.echo("No dedicated endpoints found", err=True) diff --git a/src/together/resources/endpoints.py b/src/together/resources/endpoints.py index 9bbc03b..3f9cd7b 100644 --- a/src/together/resources/endpoints.py +++ b/src/together/resources/endpoints.py @@ -15,6 +15,7 @@ def __init__(self, client: TogetherClient) -> None: def list( self, type: Optional[Literal["dedicated", "serverless"]] = None, + usage_type: Optional[Literal["on-demand", "reserved"]] = None, mine: Optional[bool] = None, ) -> List[ListEndpoint]: """ @@ -22,6 +23,7 @@ def list( Args: type (str, optional): Filter endpoints by endpoint type ("dedicated" or "serverless"). Defaults to None. + usage_type (str, optional): Filter endpoints by usage type ("on-demand" or "reserved"). Defaults to None. mine (bool, optional): If True, return only endpoints owned by the caller. If False, return endpoints not owned by the caller. Defaults to None. Returns: @@ -31,9 +33,18 @@ def list( client=self._client, ) - params = {} + params: Dict[ + str, + Union[ + Literal["dedicated", "serverless"], + Literal["on-demand", "reserved"], + bool, + ], + ] = {} if type is not None: params["type"] = type + if usage_type is not None: + params["usage_type"] = usage_type if mine is not None: params["mine"] = mine @@ -270,6 +281,7 @@ def __init__(self, client: TogetherClient) -> None: async def list( self, type: Optional[Literal["dedicated", "serverless"]] = None, + usage_type: Optional[Literal["on-demand", "reserved"]] = None, mine: Optional[bool] = None, ) -> List[ListEndpoint]: """ @@ -277,6 +289,7 @@ async def list( Args: type (str, optional): Filter endpoints by type ("dedicated" or "serverless"). Defaults to None. + usage_type (str, optional): Filter endpoints by usage type ("on-demand" or "reserved"). Defaults to None. mine (bool, optional): If True, return only endpoints owned by the caller. If False, return endpoints not owned by the caller. Defaults to None. Returns: @@ -286,9 +299,18 @@ async def list( client=self._client, ) - params = {} + params: Dict[ + str, + Union[ + Literal["dedicated", "serverless"], + Literal["on-demand", "reserved"], + bool, + ], + ] = {} if type is not None: params["type"] = type + if usage_type is not None: + params["usage_type"] = usage_type if mine is not None: params["mine"] = mine From dc5fbcee0bf33ecec815f3a9b668f94bab838e1c Mon Sep 17 00:00:00 2001 From: Nikitha Suryadevara Date: Thu, 30 Oct 2025 10:40:37 -0700 Subject: [PATCH 13/13] removed all indications of mine is false since we don't support it --- src/together/cli/api/endpoints.py | 2 +- src/together/resources/endpoints.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/together/cli/api/endpoints.py b/src/together/cli/api/endpoints.py index 4588edc..25c3cd2 100644 --- a/src/together/cli/api/endpoints.py +++ b/src/together/cli/api/endpoints.py @@ -341,7 +341,7 @@ def delete(client: Together, endpoint_id: str) -> None: "--mine", type=click.BOOL, default=None, - help="true (only mine), false (exclude mine), default=all", + help="true (only mine), default=all", ) @click.option( "--usage-type", diff --git a/src/together/resources/endpoints.py b/src/together/resources/endpoints.py index 3f9cd7b..993f73d 100644 --- a/src/together/resources/endpoints.py +++ b/src/together/resources/endpoints.py @@ -24,7 +24,7 @@ def list( Args: type (str, optional): Filter endpoints by endpoint type ("dedicated" or "serverless"). Defaults to None. usage_type (str, optional): Filter endpoints by usage type ("on-demand" or "reserved"). Defaults to None. - mine (bool, optional): If True, return only endpoints owned by the caller. If False, return endpoints not owned by the caller. Defaults to None. + mine (bool, optional): If True, return only endpoints owned by the caller. Defaults to None. Returns: List[ListEndpoint]: List of endpoint objects @@ -290,7 +290,7 @@ async def list( Args: type (str, optional): Filter endpoints by type ("dedicated" or "serverless"). Defaults to None. usage_type (str, optional): Filter endpoints by usage type ("on-demand" or "reserved"). Defaults to None. - mine (bool, optional): If True, return only endpoints owned by the caller. If False, return endpoints not owned by the caller. Defaults to None. + mine (bool, optional): If True, return only endpoints owned by the caller. Defaults to None. Returns: List[ListEndpoint]: List of endpoint objects