Skip to content

Commit 9d84133

Browse files
fix(litai): README: Add information about billing for openai package (#45)
* update * update * update * update * update * update * update * update * update * update * update * Update README.md --------- Co-authored-by: William Falcon <waf2107@columbia.edu>
1 parent 51ae9b4 commit 9d84133

1 file changed

Lines changed: 34 additions & 0 deletions

File tree

README.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -233,6 +233,40 @@ completion = client.chat.completions.create(
233233
print(completion.choices[0].message.content)
234234
```
235235

236+
<details>
237+
<summary>Granular billing</summary>
238+
239+
<br/>
240+
241+
Organize billing for API calls at organization, teamspace and user level.
242+
243+
# Example
244+
245+
```python
246+
from openai import OpenAI
247+
248+
client = OpenAI(
249+
base_url="https://lightning.ai/api/v1",
250+
api_key="LIGHTNING_API_KEY/organization/teamspace",
251+
)
252+
253+
completion = client.chat.completions.create(
254+
model="openai/gpt-4o",
255+
messages=[
256+
{
257+
"role": "user",
258+
"content": "What is a fun fact about space?"
259+
}
260+
]
261+
)
262+
263+
print(completion.choices[0].message.content)
264+
```
265+
266+
Read all the [formats here](https://lightning.ai/docs/litai/features/granular-billing)
267+
268+
</details>
269+
236270
<details>
237271
<summary>Tools</summary>
238272

0 commit comments

Comments
 (0)