tokenbee-sdk 0.2.0__tar.gz → 0.2.3__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {tokenbee_sdk-0.2.0 → tokenbee_sdk-0.2.3}/PKG-INFO +9 -3
- {tokenbee_sdk-0.2.0 → tokenbee_sdk-0.2.3}/README.md +8 -2
- {tokenbee_sdk-0.2.0 → tokenbee_sdk-0.2.3}/pyproject.toml +1 -1
- {tokenbee_sdk-0.2.0 → tokenbee_sdk-0.2.3}/setup.py +1 -1
- {tokenbee_sdk-0.2.0 → tokenbee_sdk-0.2.3}/tokenbee/__init__.py +2 -3
- {tokenbee_sdk-0.2.0 → tokenbee_sdk-0.2.3}/tokenbee_sdk.egg-info/PKG-INFO +9 -3
- {tokenbee_sdk-0.2.0 → tokenbee_sdk-0.2.3}/setup.cfg +0 -0
- {tokenbee_sdk-0.2.0 → tokenbee_sdk-0.2.3}/tokenbee_sdk.egg-info/SOURCES.txt +0 -0
- {tokenbee_sdk-0.2.0 → tokenbee_sdk-0.2.3}/tokenbee_sdk.egg-info/dependency_links.txt +0 -0
- {tokenbee_sdk-0.2.0 → tokenbee_sdk-0.2.3}/tokenbee_sdk.egg-info/requires.txt +0 -0
- {tokenbee_sdk-0.2.0 → tokenbee_sdk-0.2.3}/tokenbee_sdk.egg-info/top_level.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: tokenbee-sdk
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.3
|
|
4
4
|
Summary: Official Python SDK for TokenBee LLM inference gateway and observability.
|
|
5
5
|
Author: TokenBee Inc.
|
|
6
6
|
Author-email: "TokenBee Inc." <founders@tokenbee.io>
|
|
@@ -35,9 +35,11 @@ pip install tokenbee-sdk
|
|
|
35
35
|
```python
|
|
36
36
|
from tokenbee import TokenBee, TokenBeeModel, CompressionRate
|
|
37
37
|
|
|
38
|
-
# Initialize the client
|
|
38
|
+
# Initialize the client with your TokenBee API key
|
|
39
|
+
# AND your LLM provider key (Bring Your Own Key - BYOK)
|
|
39
40
|
client = TokenBee(
|
|
40
|
-
api_key="
|
|
41
|
+
api_key="your_tokenbee_api_key",
|
|
42
|
+
llm_key="your_llm_provider_key", # e.g. OpenAI or Anthropic key
|
|
41
43
|
compression="auto",
|
|
42
44
|
rate=CompressionRate.MEDIUM
|
|
43
45
|
)
|
|
@@ -55,6 +57,10 @@ response = client.send(
|
|
|
55
57
|
print(response["choices"][0]["message"]["content"])
|
|
56
58
|
```
|
|
57
59
|
|
|
60
|
+
## Bring Your Own Key (BYOK)
|
|
61
|
+
|
|
62
|
+
TokenBee is a **stateless** gateway. We do not store your LLM provider API keys in our database. You pass your provider key (OpenAI, Anthropic, etc.) through the SDK's `llm_key` parameter. The SDK sends this in the `X-LLM-Key` header, allowing the TokenBee proxy to forward requests to the provider on your behalf while you maintain full control over your billing and security.
|
|
63
|
+
|
|
58
64
|
## Advanced Usage
|
|
59
65
|
|
|
60
66
|
### Compression Control
|
|
@@ -20,9 +20,11 @@ pip install tokenbee-sdk
|
|
|
20
20
|
```python
|
|
21
21
|
from tokenbee import TokenBee, TokenBeeModel, CompressionRate
|
|
22
22
|
|
|
23
|
-
# Initialize the client
|
|
23
|
+
# Initialize the client with your TokenBee API key
|
|
24
|
+
# AND your LLM provider key (Bring Your Own Key - BYOK)
|
|
24
25
|
client = TokenBee(
|
|
25
|
-
api_key="
|
|
26
|
+
api_key="your_tokenbee_api_key",
|
|
27
|
+
llm_key="your_llm_provider_key", # e.g. OpenAI or Anthropic key
|
|
26
28
|
compression="auto",
|
|
27
29
|
rate=CompressionRate.MEDIUM
|
|
28
30
|
)
|
|
@@ -40,6 +42,10 @@ response = client.send(
|
|
|
40
42
|
print(response["choices"][0]["message"]["content"])
|
|
41
43
|
```
|
|
42
44
|
|
|
45
|
+
## Bring Your Own Key (BYOK)
|
|
46
|
+
|
|
47
|
+
TokenBee is a **stateless** gateway. We do not store your LLM provider API keys in our database. You pass your provider key (OpenAI, Anthropic, etc.) through the SDK's `llm_key` parameter. The SDK sends this in the `X-LLM-Key` header, allowing the TokenBee proxy to forward requests to the provider on your behalf while you maintain full control over your billing and security.
|
|
48
|
+
|
|
43
49
|
## Advanced Usage
|
|
44
50
|
|
|
45
51
|
### Compression Control
|
|
@@ -52,7 +52,6 @@ class TokenBee:
|
|
|
52
52
|
self,
|
|
53
53
|
api_key: str,
|
|
54
54
|
llm_key: str,
|
|
55
|
-
base_url: str = "https://api.tokenbee.dev/v1",
|
|
56
55
|
compression: str = "auto",
|
|
57
56
|
rate: str = CompressionRate.MEDIUM,
|
|
58
57
|
model: str = "",
|
|
@@ -61,7 +60,7 @@ class TokenBee:
|
|
|
61
60
|
):
|
|
62
61
|
self.api_key = api_key
|
|
63
62
|
self.llm_key = llm_key
|
|
64
|
-
self.
|
|
63
|
+
self._base_url = "https://tokenbee.io/v1"
|
|
65
64
|
self.headers = {
|
|
66
65
|
"Authorization": f"Bearer {api_key}",
|
|
67
66
|
"X-LLM-Key": llm_key,
|
|
@@ -74,7 +73,7 @@ class TokenBee:
|
|
|
74
73
|
if provider:
|
|
75
74
|
self.headers["X-TokenBee-Provider"] = provider
|
|
76
75
|
|
|
77
|
-
self.client = httpx.Client(headers=self.headers, base_url=self.
|
|
76
|
+
self.client = httpx.Client(headers=self.headers, base_url=self._base_url)
|
|
78
77
|
|
|
79
78
|
def send(self, model: str, input: dict):
|
|
80
79
|
parts = model.split("/")
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: tokenbee-sdk
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.3
|
|
4
4
|
Summary: Official Python SDK for TokenBee LLM inference gateway and observability.
|
|
5
5
|
Author: TokenBee Inc.
|
|
6
6
|
Author-email: "TokenBee Inc." <founders@tokenbee.io>
|
|
@@ -35,9 +35,11 @@ pip install tokenbee-sdk
|
|
|
35
35
|
```python
|
|
36
36
|
from tokenbee import TokenBee, TokenBeeModel, CompressionRate
|
|
37
37
|
|
|
38
|
-
# Initialize the client
|
|
38
|
+
# Initialize the client with your TokenBee API key
|
|
39
|
+
# AND your LLM provider key (Bring Your Own Key - BYOK)
|
|
39
40
|
client = TokenBee(
|
|
40
|
-
api_key="
|
|
41
|
+
api_key="your_tokenbee_api_key",
|
|
42
|
+
llm_key="your_llm_provider_key", # e.g. OpenAI or Anthropic key
|
|
41
43
|
compression="auto",
|
|
42
44
|
rate=CompressionRate.MEDIUM
|
|
43
45
|
)
|
|
@@ -55,6 +57,10 @@ response = client.send(
|
|
|
55
57
|
print(response["choices"][0]["message"]["content"])
|
|
56
58
|
```
|
|
57
59
|
|
|
60
|
+
## Bring Your Own Key (BYOK)
|
|
61
|
+
|
|
62
|
+
TokenBee is a **stateless** gateway. We do not store your LLM provider API keys in our database. You pass your provider key (OpenAI, Anthropic, etc.) through the SDK's `llm_key` parameter. The SDK sends this in the `X-LLM-Key` header, allowing the TokenBee proxy to forward requests to the provider on your behalf while you maintain full control over your billing and security.
|
|
63
|
+
|
|
58
64
|
## Advanced Usage
|
|
59
65
|
|
|
60
66
|
### Compression Control
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|