+
+ {selectedBudget && (
+
+ )}
+
+ Create a budget to assign to customers.
+
+
+
+ Budget ID
+ Max Budget
+ TPM
+ RPM
+
+
-
- {budgetList
- .slice() // Creates a shallow copy to avoid mutating the original array
- .sort((a, b) => new Date(b.updated_at).getTime() - new Date(a.updated_at).getTime()) // Sort by updated_at in descending order
- .map((value: budgetItem, index: number) => (
-
- {value.budget_id}
- {value.max_budget ? value.max_budget : "n/a"}
- {value.tpm_limit ? value.tpm_limit : "n/a"}
- {value.rpm_limit ? value.rpm_limit : "n/a"}
- handleEditCall(value)}
- />
- handleDeleteClick(value)}
- />
-
- ))}
-
-
-
-
-
- How to use budget id
-
-
- Assign Budget to Customer
- Test it (Curl)
-
- Test it (OpenAI SDK)
-
-
-
-
- {`
-curl -X POST --location '/end_user/new' \
-
--H 'Authorization: Bearer ' \
-
--H 'Content-Type: application/json' \
-
--d '{"user_id": "my-customer-id', "budget_id": ""}' # 👈 KEY CHANGE
-
- `}
-
-
-
-
- {`
-curl -X POST --location '/chat/completions' \
-
--H 'Authorization: Bearer ' \
-
--H 'Content-Type: application/json' \
-
--d '{
- "model": "gpt-3.5-turbo',
- "messages":[{"role": "user", "content": "Hey, how's it going?"}],
- "user": "my-customer-id"
-}' # 👈 KEY CHANGE
-
- `}
-
-
-
-
- {`from openai import OpenAI
-client = OpenAI(
- base_url="",
- api_key=""
-)
-
-completion = client.chat.completions.create(
- model="gpt-3.5-turbo",
- messages=[
- {"role": "system", "content": "You are a helpful assistant."},
- {"role": "user", "content": "Hello!"}
- ],
- user="my-customer-id"
-)
-
-print(completion.choices[0].message)`}
-
-
-
-
-
+
+ {budgetList
+ .slice() // Creates a shallow copy to avoid mutating the original array
+ .sort((a, b) => new Date(b.updated_at).getTime() - new Date(a.updated_at).getTime()) // Sort by updated_at in descending order
+ .map((value: budgetItem, index: number) => (
+
+ {value.budget_id}
+ {value.max_budget ? value.max_budget : "n/a"}
+ {value.tpm_limit ? value.tpm_limit : "n/a"}
+ {value.rpm_limit ? value.rpm_limit : "n/a"}
+ handleEditCall(value)}
+ dataTestId="edit-budget-button"
+ />
+ handleDeleteClick(value)}
+ dataTestId="delete-budget-button"
+ />
+
+ ))}
+
+