From f4048bc89055c18c8ce73856f8f6258d9d05c012 Mon Sep 17 00:00:00 2001 From: Ishaan Jaff Date: Fri, 26 Jul 2024 18:41:53 -0700 Subject: [PATCH] docs batches api --- docs/my-website/docs/batches.md | 81 +++++++++++++++++---------------- 1 file changed, 41 insertions(+), 40 deletions(-) diff --git a/docs/my-website/docs/batches.md b/docs/my-website/docs/batches.md index 51f3bb5cad2..6956a47bee7 100644 --- a/docs/my-website/docs/batches.md +++ b/docs/my-website/docs/batches.md @@ -18,6 +18,47 @@ Call an existing Assistant. + + +```bash +$ export OPENAI_API_KEY="sk-..." + +$ litellm + +# RUNNING on http://0.0.0.0:4000 +``` + +**Create File for Batch Completion** + +```shell +curl https://api.openai.com/v1/files \ + -H "Authorization: Bearer sk-1234" \ + -F purpose="batch" \ + -F file="@mydata.jsonl" +``` + +**Create Batch Request** + +```bash +curl http://localhost:4000/v1/batches \ + -H "Authorization: Bearer sk-1234" \ + -H "Content-Type: application/json" \ + -d '{ + "input_file_id": "file-abc123", + "endpoint": "/v1/chat/completions", + "completion_window": "24h" + }' +``` + +**Retrieve the Specific Batch** + +```bash +curl http://localhost:4000/v1/batches/batch_abc123 \ + -H "Authorization: Bearer sk-1234" \ + -H "Content-Type: application/json" \ +``` + + **Create File for Batch Completion** @@ -78,47 +119,7 @@ print("file content = ", file_content) ``` - -```bash -$ export OPENAI_API_KEY="sk-..." - -$ litellm - -# RUNNING on http://0.0.0.0:4000 -``` - -**Create File for Batch Completion** - -```shell -curl https://api.openai.com/v1/files \ - -H "Authorization: Bearer sk-1234" \ - -F purpose="batch" \ - -F file="@mydata.jsonl" -``` - -**Create Batch Request** - -```bash -curl http://localhost:4000/v1/batches \ - -H "Authorization: Bearer sk-1234" \ - -H "Content-Type: application/json" \ - -d '{ - "input_file_id": "file-abc123", - "endpoint": "/v1/chat/completions", - "completion_window": "24h" - }' -``` - -**Retrieve the Specific Batch** - -```bash -curl http://localhost:4000/v1/batches/batch_abc123 \ - -H "Authorization: Bearer sk-1234" \ - -H "Content-Type: application/json" \ -``` - - ## [👉 Proxy API Reference](https://litellm-api.up.railway.app/#/batch)