Billing

This guide provides an overview of different Gemini API billing options, explains how to enable billing and monitor usage, and provides answers to frequently asked questions (FAQs) about billing.

About billing and tiers

Billing for the Gemini API is based on two pricing tiers: the Free Tier and the Paid Tier (pay-as-you-go or pay only for what you use). The Free Tier is available for certain models, which are documented on the Pricing page. Pricing and rate limits differ between tiers and vary by model.

Google AI Studio also provides free usage up to a limit for some models, separate from the API Free Tier. For access to Paid-only models and features in AI Studio, you can link a Paid API Key. You can unlink an API Key to return to the Free AIS quota.

Upgrading to the Paid Tier lets you access higher rate limits, use advanced models, and ensures your prompts and responses are not used to improve Google products (enterprise-grade data privacy). For more information on data use for paid services, see the Terms of Service.

Set up billing to access the Paid Tier

You can create a project and set up billing, or import an existing project to upgrade to the Paid Tier directly in Google AI Studio without switching to the Google Cloud console. You'll gain immediate billable status without any upfront costs, and pay later only for the specific resources you consume during the billing cycle (read the Cloud automated Billing setup for more information).

  1. Go to the AI Studio API keys page (or anywhere you see "Set up billing" in AI Studio).
  2. New users will have a project and API key created for them by default.
    1. If you need a new key, click Create API key and follow the dialog to add a key-project pair to the table.
  3. Find the project you want to upgrade to the Paid Tier and click Set up Billing under the Quota tier column.
    1. If a project is already on a Paid Tier, you might see the option to Upgrade.
  4. Setup differs for new and existing Cloud Billing users:
    1. New Cloud Billing users
    2. Existing Cloud Billing users

New users

This workflow is for users with no existing Google billing accounts.

  1. Follow the steps to choose your project and API key for set up.
  2. Select your country to agree to the Terms of Service in the Setup your Google Cloud billing account window.
  3. If you have any existing payment profiles linked to your account, you'll see your Contact information and Payment method filled in the Add your billing account details window. Click Change to edit either field.
  4. If you don't have an existing payment profile, click the + button for both Contact information and Payment method and follow the instructions to fill out your details in their respective windows.
  5. Click Finish account setup.
  6. The next window will inform you of your billing status.

Existing users

This workflow is for users who have previously set up Google billing with their account.

  1. Follow the steps to choose your project and API key for set up.
  2. You will have several options in the Set up your Cloud Billing account window:
    1. If you have multiple billing accounts, click the Select billing account menu to choose the one you'd like to link to your selected project.
    2. If you only have one billing account, that account will be automatically selected in the menu.
    3. If you don't want to use any of your existing accounts, click Add new billing account under the menu. This will trigger step 3 in the New Cloud Billing users section.
  3. Click Finish setup.
  4. The next window will inform you of your billing status.

Upgrade to the next Paid Tier

If you're already on a Paid Tier and meet the criteria for a plan change, go to the AI Studio API keys page and select Upgrade in the Quota tier column of the key-project row where it's available.

The system will automatically verify your project's eligibility. If your project meets all the requirements, it will be instantly upgraded to the next tier.

Verify billing status

After you Set up billing for the Paid Tier, you'll immediately be informed whether setup was successful. You can also verify that your Google Cloud Project is linked to the Google Cloud Billing account and ready for paid usage on the API keys page. Your key's billing status in the Quota tier column might show:

  • Tier 1, 2, or 3: Verifies your project is linked and immediately billable.
  • Action needed: You need to submit a one time prepayment that applies to your account usage.

One-time prepayment verification

Google may require a one-time prepayment to activate the paid tier for the Gemini API. This measure helps maintain the security and availability of our platform for all users. It is not a fee; it is a credit that is applied directly to your account for future use.

Prepayment process
  1. Set up billing: When you activate the Gemini API on a project linked to an eligible billing account, we'll notify you if a prepayment is required.
  2. Get notified: You'll see a dialog in AI Studio after billing account setup, and receive an email informing you of the requirement.
  3. Make a payment : On the API keys page, click Action needed under Quota tier for your newly linked key.
  4. Get upgraded: Once your payment is successfully processed (which is instant for most payment methods), your project will upgrade to the Paid Tier, and your new rate limits will apply.

Cloud Billing

The Gemini API uses Cloud Billing for billing services, which you can set up directly in AI Studio. After you've enabled Cloud Billing, you can use Cloud Billing tools to track spending, understand costs, make payments and access Cloud Billing support.

New users are set up immediately with a Paid Google Cloud Billing account and granted $300 welcome credits.

Existing users who already have either a Paid or Free Trial Google Cloud Billing account can select an existing Google Cloud Billing account in AI Studio without navigating to the Google Cloud console. Existing users are not granted $300 welcome credits.

Read more about the Cloud automated Billing setup.

Monitor usage

After you enable Cloud Billing, you can monitor your usage of the Gemini API in Google AI Studio in Dashboard > Usage and Limits.

Frequently asked questions

This section provides answers to frequently asked questions.

What am I billed for?

Gemini API pricing is based on the following:

  • Input token count
  • Output token count
  • Cached token count
  • Cached token storage duration

For pricing information, see the Pricing page.

Where can I view my quota?

You can view your quota and system limits in AI Studio or the Google Cloud console.

How do I request more quota?

To request more quota, follow the instructions under Upgrade to the next Paid Tier.

Can I use the Gemini API for free in EEA (including EU), the UK, and CH?

Yes, we make the free tier and paid tier available in many regions.

If I set up billing with the Gemini API, will I be charged for my Google AI Studio usage?

AI Studio usage remains free of charge unless users link a paid API key for access to paid features. Once you link a paid API key as part of a paid project in AI Studio, you will be charged for AI Studio usage for that key. You can switch between Paid Tier projects and Free Tier projects in AI Studio as needed.

Can I use 1M tokens in the free tier?

The free tier for Gemini API differs based on the model selected. For now, you can try the 1M token context window in the following ways:

  • In Google AI Studio
  • With pay-as-you-go plans
  • With free-of-charge plans for select models

How can I calculate the number of tokens I'm using?

Use the GenerativeModel.count_tokens method to count the number of tokens. Refer to the Tokens guide to learn more about tokens.

Can I use my Google Cloud credits with the Gemini API?

Yes, Google Cloud credits can be used towards Gemini API usage.

How is billing handled?

Billing for the Gemini API is handled by the Cloud Billing system. Learn about the automated Billing setup in the Cloud Billing documentation.

Am I charged for failed requests?

If your request fails with a 400 or 500 error, you won't be charged for the tokens used. However, the request will still count against your quota.

Is there a charge for fine-tuning the models?

Model tuning is no longer supported in the Gemini API or AIS.

Is GetTokens billed?

Requests to the GetTokens API are not billed, and they don't count against inference quota.

Refer to the Terms of Service for details on how data is handled when Cloud billing is enabled (see "How Google Uses Your Data" under "Paid Services"). Note that your Google AI Studio prompts are treated under the same "Paid Services" terms so long as at least 1 API project has billing enabled, which you can validate on the Gemini API Key page if you see any projects marked as "Paid" under "Plan".

What happens to my prepayment?

The full amount is added as a credit to your Cloud Billing account. This credit will automatically be used to pay for any usage you accrue on Google Cloud, including the Gemini API or other services like Compute Engine and Cloud Storage. It does not affect your Free Trial credits.

What if I don't prepay?

No problem. Your project will remain on the Gemini API free tier. You won't lose any access, but you'll be subject to the free tier's rate limits. You can choose to complete the prepayment at any time in the future to upgrade.

Can I get a refund for my prepayment?

Yes. If you have a credit balance on your account, you can request a refund through the Cloud Console, subject to our standard refund policies.

Does prepayment affect my $300 Free Trial credit?

No. This is separate from your Free Trial credits. You can still use your Free Trial credits for eligible products.

What happens if I spend beyond the prepaid amount?

Once your prepaid credit balance is exhausted, your account will transition to standard billing. Any additional usage will be charged to the primary payment method linked to your Cloud Billing account.

Where can I get help with billing?

To get help with billing, see Get Cloud Billing support.