You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+16-13Lines changed: 16 additions & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,7 +10,7 @@ It is generated with [Stainless](https://www.stainlessapi.com/).
10
10
11
11
## Documentation
12
12
13
-
The REST API documentation can be found on [docs.usebrainbase.xyz](https://docs.usebrainbase.xyz). The full API of this library can be found in [api.md](api.md).
13
+
The REST API documentation can be found on [docs.brainbase.com](https://docs.brainbase.com). The full API of this library can be found in [api.md](api.md).
14
14
15
15
## Installation
16
16
@@ -24,32 +24,25 @@ pip install brainbase-labs
24
24
The full API of this library can be found in [api.md](api.md).
25
25
26
26
```python
27
-
import os
28
27
from brainbase import Brainbase
29
28
30
29
client = Brainbase(
31
-
api_key=os.environ.get("BRAINBASE_API_KEY"), # This is the default and can be omitted
30
+
api_key="My API Key",
32
31
)
33
32
34
33
client.workers.list()
35
34
```
36
35
37
-
While you can provide an `api_key` keyword argument,
38
-
we recommend using [python-dotenv](https://pypi.org/project/python-dotenv/)
39
-
to add `BRAINBASE_API_KEY="My API Key"` to your `.env` file
40
-
so that your API Key is not stored in source control.
41
-
42
36
## Async usage
43
37
44
38
Simply import `AsyncBrainbase` instead of `Brainbase` and use `await` with each API call:
45
39
46
40
```python
47
-
import os
48
41
import asyncio
49
42
from brainbase import AsyncBrainbase
50
43
51
44
client = AsyncBrainbase(
52
-
api_key=os.environ.get("BRAINBASE_API_KEY"), # This is the default and can be omitted
45
+
api_key="My API Key",
53
46
)
54
47
55
48
@@ -84,7 +77,9 @@ All errors inherit from `brainbase.APIError`.
84
77
import brainbase
85
78
from brainbase import Brainbase
86
79
87
-
client = Brainbase()
80
+
client = Brainbase(
81
+
api_key="My API Key",
82
+
)
88
83
89
84
try:
90
85
client.workers.list()
@@ -127,6 +122,7 @@ from brainbase import Brainbase
127
122
client = Brainbase(
128
123
# default is 2
129
124
max_retries=0,
125
+
api_key="My API Key",
130
126
)
131
127
132
128
# Or, configure per-request:
@@ -145,11 +141,13 @@ from brainbase import Brainbase
0 commit comments