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

Billing for the Gemini API is based on two pricing tiers: free of charge (or free) and pay-as-you-go (or paid). Pricing and rate limits differ between these tiers and also vary by model. You can check out the rate limits and pricing pages for more into. For a model-by-model breakdown of capabilities, see the Gemini models page.

How to request an upgrade

To transition from the free tier to the pay-as-you-go plan, you need to enable billing for your Google Cloud project. The button you see in Google AI Studio depends on your project's current plan.

  • If you're on the free tier, you'll see a Set up Billing button for your project.
  • If you're already on the paid tier and meet the criteria for a plan change, you might see an Upgrade button.

To start the process, follow these steps:

  1. Go to the AI Studio API keys page.
  2. Find the project you want to move to the paid plan and click either Set up Billing or Upgrade, depending on the button displayed.
  3. The next step depends on the button you clicked:
    • If you clicked Set up Billing: You'll be redirected to the Google Cloud console to link a billing account to your project. Follow the on-screen instructions to complete the process.
    • If you clicked Upgrade: 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.

When you enable billing and use the paid tier, you benefit from higher rate limits, and your prompts and responses aren't used to improve Google products. For more information on data use for paid services, see the terms of service.

Cloud Billing

The Gemini API uses Cloud Billing for billing services. To use the paid tier, you must set up Cloud Billing on your cloud project. After you've enabled Cloud Billing, you can use Cloud Billing tools to track spending, understand costs, make payments, and access Cloud Billing support.

Enable billing

You can enable Cloud Billing starting from Google AI Studio:

  1. Open Google AI Studio.

  2. In the bottom of the left sidebar, select Dashboard > Usage and Billing > Billing tab.

  3. Click Set up Billing for your chosen project to enable Cloud Billing.

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.

How the prepayment process works

  1. Initiate an upgrade: 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 banner in the Google Cloud Console and receive an email informing you of the requirement.
  3. Make a payment: The banner and email will direct you to the Billing > Payments Overview page, where you can complete the one-time prepayment.
  4. Get upgraded: Once your payment is successfully processed (which is instant for most payment methods), your project will upgrade to the Gemini API paid tier, and your new rate limits will apply.

Monitor usage

After you enable Cloud Billing, you can monitor your usage of the Gemini API in Google AI Studio.

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 the Google Cloud console.

How do I request more quota?

To request more quota, follow the instructions at How to request an upgrade.

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?

No, Google AI Studio usage remains free of charge regardless of if you set up billing across all supported regions.

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.

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 free, but inference on tuned models is charged at the same rate as the base models.

Is GetTokens billed?

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

Refer to the terms 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.

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.