@@ -116,7 +116,12 @@ export function LogDetailsDialog({
{totalModels === 0 && (
-
+
No models found for this provider
-
-
Common issues:
-
+
+
+ Common issues:
+
+
- API credentials: Check if the API key is correct and has the right permissions
+ API credentials:{' '}
+ Check if the API key is correct
+ and has the right permissions
- Base URL: Verify the base URL is correct for your provider
+ Base URL: Verify
+ the base URL is correct for your
+ provider
- Network access: Ensure the server can reach the provider's API endpoint
+ Network access:{' '}
+ Ensure the server can reach the
+ provider's API endpoint
- Provider status: The upstream provider might be temporarily unavailable
+ Provider status:{' '}
+ The upstream provider might be
+ temporarily unavailable
{groupData?.group_url && (
-
- Current endpoint: {groupData.group_url}
+
+ Current endpoint:{' '}
+
+ {groupData.group_url}
+
) : errorData ? (
) : null}
diff --git a/ui/app/providers/page.tsx b/ui/app/providers/page.tsx
index f431f101..4624f26a 100644
--- a/ui/app/providers/page.tsx
+++ b/ui/app/providers/page.tsx
@@ -76,7 +76,11 @@ function ProviderBalance({
);
const queryClient = useQueryClient();
- const { data: balanceData, isLoading, error } = useQuery({
+ const {
+ data: balanceData,
+ isLoading,
+ error,
+ } = useQuery({
queryKey: ['provider-balance', providerId],
queryFn: () => AdminService.getProviderBalance(providerId),
refetchInterval: 30000,
@@ -108,7 +112,10 @@ function ProviderBalance({
mutationFn: async (amount: number) => {
console.log('Calling top-up API with:', { providerId, amount });
try {
- const result = await AdminService.initiateProviderTopup(providerId, amount);
+ const result = await AdminService.initiateProviderTopup(
+ providerId,
+ amount
+ );
console.log('API returned:', result);
return result;
} catch (err) {
@@ -120,11 +127,8 @@ function ProviderBalance({
console.log('Top-up response:', data);
console.log('Type of data:', typeof data);
console.log('Keys in data:', Object.keys(data || {}));
-
- if (
- data?.topup_data?.payment_request &&
- data?.topup_data?.invoice_id
- ) {
+
+ if (data?.topup_data?.payment_request && data?.topup_data?.invoice_id) {
setInvoiceData({
payment_request: data.topup_data.payment_request as string,
invoice_id: data.topup_data.invoice_id as string,
@@ -172,19 +176,23 @@ function ProviderBalance({
// The backend throws 500/400 if not implemented.
// A better approach is to check if we have a platform URL and maybe redirect there
// if we know it's not supported.
-
+
// BUT, we don't know for sure if it's supported without checking metadata or trying.
// Let's rely on the "can_topup" metadata if available, but currently we only have "can_show_balance".
-
+
// Simple heuristic: If platformUrl exists and we suspect no direct topup, redirect?
// Actually, let's try to open the dialog, but if it's OpenRouter/OpenAI, maybe we just redirect?
// The user specifically mentioned "like in openrouter".
-
- if (platformUrl && (platformUrl.includes('openrouter.ai') || platformUrl.includes('openai.com'))) {
- window.open(platformUrl, '_blank');
- return;
+
+ if (
+ platformUrl &&
+ (platformUrl.includes('openrouter.ai') ||
+ platformUrl.includes('openai.com'))
+ ) {
+ window.open(platformUrl, '_blank');
+ return;
}
-
+
setIsTopupDialogOpen(true);
};
@@ -266,9 +274,7 @@ function ProviderBalance({
-
- Top-up successful!
-
+
Top-up successful!
) : invoiceData ? (
@@ -482,7 +488,9 @@ export default function ProvidersPage() {
...formData,
api_key: String(response.account_data.api_key),
});
- toast.success('Account created successfully! API key has been filled in.');
+ toast.success(
+ 'Account created successfully! API key has been filled in.'
+ );
} else {
toast.success('Account created, but no API key returned.');
}
@@ -778,8 +786,7 @@ export default function ProvidersPage() {
)}
/>
- 1.01 means +1% e.g. currency exchange, card
- fees, etc.
+ 1.01 means +1% e.g. currency exchange, card fees, etc.
@@ -856,9 +863,11 @@ export default function ProvidersPage() {