تنظيم صفحاتك في مجموعات
يمكنك حفظ المحتوى وتصنيفه حسب إعداداتك المفضّلة.
انقر على مزوّد Gemini API لعرض المحتوى والرمز الخاصين بالمزوّد على هذه الصفحة.
تضع حدود المعدّل (المعروفة باسم الحصص) قيودًا على عدد الطلبات التي يمكنك إرسالها إلى Gemini API خلال إطار زمني محدّد. تساعد هذه الحدود في ضمان الاستخدام العادل والحماية من إساءة الاستخدام والحفاظ على أداء النظام لجميع المستخدمين.
عند استخدام Firebase AI Logic لإرسال طلبات إلى نماذج Gemini وImagen، تعتمد حدود المعدّل في مشروعك على مقدّم خدمة "Gemini API" الذي اخترته. توفّر Firebase AI Logic أيضًا طريقة
لضبط حدود المعدل "لكل مستخدم".
يتم قياس حدود المعدّل (الحصص) على مستوى أربعة أبعاد:
الطلبات في الدقيقة (RPM)
الطلبات في اليوم (RPD)
الرموز المميزة في الدقيقة (TPM)
الرموز المميزة في اليوم (TPD)
يتم تقييم استخدامك مقارنةً بكل حد، وسيؤدي تجاوز أي منها إلى ظهور الخطأ 429 الذي يشير إلى تجاوز الحصة. على سبيل المثال، إذا كان الحد الأقصى لعدد الطلبات في الدقيقة هو 20، سيؤدي تقديم 21 طلبًا خلال دقيقة واحدة إلى حدوث خطأ، حتى إذا لم تتجاوز الحد الأقصى لعدد الطلبات في الدقيقة أو الحدود الأخرى.
يتم تطبيق حدود المعدّل على مستوى المشروع، وهي تنطبق على جميع التطبيقات وعناوين IP التي تستخدم مشروع Firebase هذا.
تختلف الحدود القصوى حسب الطراز المحدّد المستخدَم، ولا تنطبق بعض الحدود إلا على طُرز محدّدة. على سبيل المثال، يتم احتساب عدد الصور في الدقيقة (IPM) فقط للنماذج القادرة على إنشاء الصور (Imagen 3)، ولكنها تشبه من الناحية النظرية عدد الرموز المميزة في الدقيقة (TPM).
تكون حدود الاستخدام أكثر تقييدًا للنماذج التجريبية ونماذج المعاينة.
لاستخدام Firebase AI Logic، يجب تفعيل موفِّر Gemini API الذي اخترته في مشروعك، كما يجب تفعيل واجهة برمجة التطبيقات Firebase AI Logic التي تعمل كبوابة بين حِزم تطوير البرامج (SDK) الخاصة بالعملاء وموفِّر Gemini API. يتم تفعيل واجهة برمجة التطبيقات هذه عند إعداد Firebase AI Logic لأول مرة في مشروعك على Firebase.
يمكنك استخدام الحدّ الأقصى لعدد الطلبات في الدقيقة لواجهة برمجة التطبيقات Firebase AI Logic (الحصة) كحدّ أقصى لعدد الطلبات في الدقيقة لكل مستخدم في تطبيقك، وتحديدًا لميزات الذكاء الاصطناعي التي تعتمد على Firebase AI Logic. عليك ضبط هذا الحدّ بما يتناسب مع
استخدام فردي لميزات الذكاء الاصطناعي، مع ضمان عدم تجاوز أي مستخدم واحد لحدود مزوّد Gemini API (المخصّص للاستخدام من جميع المستخدمين).
تفاصيل حول الحد الأقصى لمعدّل الإرسال "لكل مستخدم"
في ما يلي بعض التفاصيل المهمة حول الحدود القصوى لعدد الطلبات في الدقيقة (الحصص) في واجهة برمجة التطبيقات Firebase AI Logic:
ويستند هذا الحدّ إلى "طلبات إنشاء المحتوى" وليس إلى النموذج، وذلك على أساس كل مستخدم وكل منطقة وكل دقيقة.
وهو الحد الأقصى للمعدّل الذي يتم تطبيقه على جميع المستخدمين. في الوقت الحالي، لا تتوفّر طريقة
لضبط الحد الأقصى لعدد الطلبات لمستخدم معيّن أو
مجموعة محدّدة من المستخدمين*.
ويتم تطبيقها على مستوى المشروع، وعلى جميع التطبيقات وعناوين IP التي تستخدم مشروع Firebase هذا.
وينطبق ذلك على أي مكالمة واردة من أي حزمة تطوير برامج (SDK).Firebase AI Logic
يبلغ الحدّ التلقائي لعدد الطلبات في الدقيقة 100 طلب لكل مستخدم.
يُرجى العِلم أنّه عليك مراعاة
حدود مزوّد خدمة Gemini API (راجِع ما ورد أعلاه)،
التي لها الأولوية على واجهة برمجة التطبيقات Firebase AI Logic.
*إذا كنت تستخدم Vertex AI Gemini API وكان تطبيقك يوجّه المستخدمين إلى مناطق مختلفة (على سبيل المثال، باستخدام Firebase Remote Config)، يمكنك ضبط حدّ معدّل طلبات محدّد للمستخدمين في منطقة معيّنة.
تعديل الحدّ الأقصى لعدد الطلبات لكل مستخدم
لتعديل الحدّ الأقصى لعدد الطلبات (الحصة)، يجب أن يكون لديك إذن serviceusage.quotas.update، وهو مضمّن تلقائيًا في دورَي "المالك" و"المحرّر".
في ما يلي كيفية تعديل الحد الأقصى لعدد الطلبات (الحصة) أو طلب زيادته:
في أسفل الصفحة، انقر على علامة التبويب الحصص وحدود النظام.
فلتر الجدول لعرض الحصص التي تهمّك، مثل الإمكانية (طلبات إنشاء المحتوى) والمنطقة.
على سبيل المثال، لعرض الحصص المخصّصة لكل مستخدم لإنشاء طلبات محتوى في أي من المناطق الآسيوية المتوافقة، سيبدو الفلتر مشابهاً لما يلي:
Generate content requests + Dimension:region:asia
ضَع علامة في مربّع الاختيار على يمين كل حصة تهمّك.
في نهاية صف الحصة، انقر على
more_vert،
ثم اختَر تعديل الحصة.
في نموذج تغييرات الحصة، اتّبِع الخطوات التالية:
أدخِل الحصة المتزايدة في حقل القيمة الجديدة.
تنطبق هذه الحصة على مستوى المشروع ويتم مشاركتها بين جميع التطبيقات وعناوين IP التي تستخدم مشروع Firebase هذا.
تاريخ التعديل الأخير: 2025-09-05 (حسب التوقيت العالمي المتفَّق عليه)
[[["يسهُل فهم المحتوى.","easyToUnderstand","thumb-up"],["ساعَدني المحتوى في حلّ مشكلتي.","solvedMyProblem","thumb-up"],["غير ذلك","otherUp","thumb-up"]],[["لا يحتوي على المعلومات التي أحتاج إليها.","missingTheInformationINeed","thumb-down"],["الخطوات معقدة للغاية / كثيرة جدًا.","tooComplicatedTooManySteps","thumb-down"],["المحتوى قديم.","outOfDate","thumb-down"],["ثمة مشكلة في الترجمة.","translationIssue","thumb-down"],["مشكلة في العيّنات / التعليمات البرمجية","samplesCodeIssue","thumb-down"],["غير ذلك","otherDown","thumb-down"]],["تاريخ التعديل الأخير: 2025-09-05 (حسب التوقيت العالمي المتفَّق عليه)"],[],[],null,["\u003cbr /\u003e\n\n\n|-------------------------------------------------------------------------------------------------------------------------------------|\n| *Click your Gemini API provider to view provider-specific content and code on this page.* Gemini Developer API Vertex AI Gemini API |\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\nRate limits (commonly called quotas) regulate the number of requests you can\nmake to the Gemini API within a given timeframe. These limits help ensure\nfair usage, protect against abuse, and help maintain system performance for all\nusers.\n\nWhen using Firebase AI Logic to send requests to Gemini and\nImagen models, your project's rate limits depend on your chosen\n\"Gemini API\" provider. Firebase AI Logic also provides a way to\n[set \"per user\" rate limits](#per-user-rate-limits).\n\n[View rate limits for the Gemini Developer API](https://ai.google.dev/gemini-api/docs/rate-limits)\n| The rate limits (like requests per minute (RPM)) that are listed in the documentation are the *maximum* that the Gemini Developer API supports.\n|\n| The *actual maximum quota\n| **available to your Firebase project** and the model that\n| you're using* are dependent on several factors (for example,\n| the standing of your linked Cloud Billing account and capacity of the\n| overall system).\n\nHow rate limits (quotas) work\n\nRate limits (quotas) are measured across four dimensions:\n\n- Requests per minute (RPM)\n- Requests per day (RPD)\n- Tokens per minute (TPM)\n- Tokens per day (TPD)\n\nYour usage is evaluated against each limit, and exceeding any of them will\ntrigger a 429 quota-exceeded error. For example, if your RPM limit is 20, then\nmaking 21 requests within a minute will result in an error, even if you haven't\nexceeded your TPM or other limits.\n\nRate limits are applied at the project-level and apply to all applications and\nIP addresses that use that Firebase project.\n\nLimits vary depending on the specific model being used, and some limits only\napply to specific models. For example, images per minute (IPM) is only\ncalculated for models capable of generating images (Imagen 3), but is\nconceptually similar to TPM.\n\nRate limits are more restricted for experimental and preview models.\n\nRequest a rate limit increase\n\nIf you're on a \"paid tier\" for the Gemini Developer API, then you can\n[request a rate limit increase](https://ai.google.dev/gemini-api/docs/rate-limits#request-rate-limit-increase).\n\nSet \"per user\" rate limits\n\nTo use Firebase AI Logic, your project needs your chosen\nGemini API provider enabled, but you also need the\n[Firebase AI Logic API](https://console.cloud.google.com/apis/library/firebasevertexai.googleapis.com?project=_) enabled,\nwhich acts as a gateway between our client SDKs and your Gemini API\nprovider. This API is enabled for you when you initially set up\nFirebase AI Logic in your Firebase project.\n\n**You can use the Firebase AI Logic API rate limit (quota) as a\n\"per user\" rate limit for your app** , specifically for the AI features that rely\non Firebase AI Logic. You should\n[set this limit](#edit-quota-or-request-quota-increase) to reasonably\naccommodate a single user accessing your AI features, while also ensuring that\nno single user overwhelms the limits of your Gemini API provider (which is\nmeant to be shared by all your users).\n| **Note:** The Firebase AI Logic API rate limit is set quite high by default (100 RPM) to be usable for any app's use case. We recommend that you [adjust this rate limit](#edit-quota-or-request-quota-increase) to meet the actual needs of your app and use case.\n\nDetails about the \"per user\" rate limit\n\nHere are some important details about the Firebase AI Logic API\nrate limits (quotas) -- specifically, requests per minute (RPM):\n\n- It's based on \"Generate content requests\"\n on a per-user per-region per-minute basis, and it's *not* based on model.\n\n- It's the rate limit applied to *all* your users. Currently, there isn't a way\n to set the rate limit for a specific user or\n specific group of users^**\\***^.\n\n- It applies at the project-level and applies to all applications and IP\n addresses that use that Firebase project.\n\n- It applies to any call that specifically comes from any\n Firebase AI Logic SDK.\n\n- The default rate limit is 100 RPM per user. \n\n Note that you still need to consider the\n limits for your Gemini API provider (see above),\n which take precedence over the Firebase AI Logic API.\n\n^**\\*** *If you're using the Vertex AI Gemini API and your\napp directs users to different regions (for example, using\n[Firebase Remote Config](/docs/ai-logic/solutions/remote-config?api=vertex)),\nthen you could set a specific rate limit for users in a specific region.*^\n\nAdjust the \"per user\" rate limit\n\nTo adjust a rate limit (quota), you must have the `serviceusage.quotas.update`\npermission, which is included by default in the Owner and Editor role.\n\nHere's how to edit your rate limit (quota) or request an increase:\n\n1. In the Google Cloud console, go to the page for the\n [Firebase AI Logic API](https://console.cloud.google.com/apis/library/firebasevertexai.googleapis.com?project=_).\n\n2. Click **Manage**.\n\n3. Lower on the page, click the **Quotas \\& System Limits** tab.\n\n4. Filter the table to show the quotas of interest, like the capability\n (requests for generating content) and region.\n\n For example, to view the per-user quotas for generating content requests\n in any of the supported Asian regions, your filter would look similar to\n this:\n `Generate content requests` + `Dimension:region:asia`\n | **Note:** To create a `Dimension` filter, you need to use the filter tooling, rather than just copy-pasting the values in this example above. Also, the `(default)` quota row doesn't apply to Firebase AI Logic.\n5. Select the checkbox to the left of each quota of interest.\n\n6. At the end of the quota's row, click\n more_vert,\n and then select **Edit quota**.\n\n7. In the **Quota changes** form, do the following:\n\n 1. Enter the increased quota in the *New value* field.\n\n This quota applies at the project-level and is shared across\n all applications and IP addresses that use that Firebase project.\n 2. Complete any additional fields in the form, and then click **Done**.\n\n 3. Click **Submit request**."]]