MCPcopy Index your code
hub / github.com/DeepL/deepl-python / get_usage

Method get_usage

deepl/translator.py:1032–1040  ·  view source on GitHub ↗

Requests the current API usage.

(self)

Source from the content-addressed store, hash-verified

1030 ]
1031
1032 def get_usage(self) -> Usage:
1033 """Requests the current API usage."""
1034 status, content, json = self._api_call("v2/usage", method="GET")
1035
1036 self._raise_for_status(status, content, json)
1037
1038 if not isinstance(json, dict):
1039 json = {}
1040 return Usage(json)
1041
1042 def create_glossary(
1043 self,

Callers 11

test_invalid_authkeyFunction · 0.95
test_invalid_server_urlFunction · 0.95
mainFunction · 0.95
mainFunction · 0.95
mainFunction · 0.95
action_usageFunction · 0.80
test_usageFunction · 0.80
test_proxy_usageFunction · 0.80
test_usage_no_responseFunction · 0.80
test_usage_overrunFunction · 0.80

Calls 3

_api_callMethod · 0.95
_raise_for_statusMethod · 0.95
UsageClass · 0.90

Tested by 7

test_invalid_authkeyFunction · 0.76
test_invalid_server_urlFunction · 0.76
test_usageFunction · 0.64
test_proxy_usageFunction · 0.64
test_usage_no_responseFunction · 0.64
test_usage_overrunFunction · 0.64