How to Deploy an AI Application on Google Cloud

Short answer: Package your app in a container, deploy it to Cloud Run with one command, keep API keys in Secret Manager, set a maximum instance count, and watch the bill. Cloud Run charges only for resources you use, rounded to the nearest 100 milliseconds, and includes a monthly free tier.
Getting an AI app running on your laptop is the easy half. Putting it on the internet, keeping keys safe and not getting a surprise bill is the other half. Google Cloud Run is a common choice for small AI apps because it runs containers without servers to manage and scales down when nobody is using it. This guide covers the path from working app to live URL. Pricing details are checked against Google Cloud's official Cloud Run pricing page in December 2026.
Why Cloud Run for an AI app
Cloud Run runs a container and scales instances with traffic, including down to zero. You do not provision machines in advance, and you pay for used container instances. For a chatbot, an internal tool or an API that calls a model provider, that fits well. For work needing GPUs, Cloud Run also lists GPU options such as NVIDIA L4, billed per second.
What it costs (checked December 2026)
From cloud.google.com/run/pricing, billing is by CPU per vCPU-second, memory per GiB-second and, for request-based services, requests. Examples for default pricing on the page:
- Instance-based billing: $0.000018 per vCPU-second and $0.000002 per GiB-second. Free tier based on us-central1: first 240,000 vCPU-seconds and 450,000 GiB-seconds each month.
- Request-based billing: $0.000024 per vCPU-second of active time, $0.0000025 per GiB-second, and $0.40 per million requests. Free tier: first 180,000 vCPU-seconds, 360,000 GiB-seconds and 2 million requests each month.
- Prices depend on the region you pick, and committed use discounts lower the cost of continuous use.
For a low-traffic app this often stays at or near the free tier. Note that your model provider's API charges are separate and usually larger.
Step 1: Containerise the app
Write a Dockerfile that installs your dependencies and starts the server on the port Cloud Run provides through the PORT environment variable. Test it locally with Docker before you deploy.
Step 2: Deploy
Create a Google Cloud project, enable billing and the Cloud Run API, install the gcloud command line tool and deploy from your source folder. Cloud Run builds the container and gives you an HTTPS address. Choose a region close to your users and, if relevant, close to your data.

Step 3: Keep secrets out of the code
Store model API keys in Secret Manager and attach them to the service as environment variables or mounted secrets. Never commit keys to your repository or bake them into the container image. Give the service its own service account with only the permissions it needs.
Step 4: Set limits before you set traffic
Set a maximum number of instances so a traffic spike or a bug cannot scale cost without limit. Set a request timeout that fits your app, and add a budget alert in billing so you hear about spend early. If your app calls a paid model API, add per-user rate limits too.
Step 5: Decide on authentication
By default you choose whether the service is public. A public chatbot needs abuse controls. An internal tool should require authentication so only your team can call it. Requests denied by IAM policy are not billed.
Step 6: Watch it run
Use the logs and metrics in the console to check errors and latency. Cold starts, when an instance spins up after being idle, can add delay for the first request. If that matters, setting a minimum instance keeps one warm, but idle minimum instances are billed at a lower rate on the pricing page, so factor that in.
A realistic first-day checklist
Containerised and tested locally. Deployed to one region. Secrets in Secret Manager. Maximum instances set. Budget alert on. Authentication decision made. Logs checked after a test request. If all seven are done, you have a deployment you can leave running without worrying overnight.
Estimating your own bill
Do not guess. Take the number of requests you expect per month, the average time each request keeps an instance busy, and the CPU and memory you allocate. Multiply seconds by the per-second rates on the pricing page, subtract the free tier, and add the request charge if you use request-based billing. Then run the same sum for ten times the traffic so you know what success costs. Google also provides a pricing calculator for this. Check the sum again after your first week using real metrics from the console, and adjust CPU and memory down if the app is over-provisioned.
Common mistakes
- Leaving the instance count unlimited. A loop or a bot flood becomes a bill.
- Hard-coding API keys. They end up in repositories.
- Ignoring region. Latency and price both depend on it.
- Forgetting the model API cost. Cloud Run is usually the smaller line.

FAQ
Is Cloud Run free?
There is a monthly free tier, aggregated by billing account, and you are billed only for usage past it.
Do I need to know Docker?
Basic Docker helps. You write a short Dockerfile, and Cloud Run builds and runs the container.
Can Cloud Run run AI models with GPUs?
Google lists GPU options, such as NVIDIA L4 and RTX PRO 6000, with per-second pricing on the pricing page.
How do I stop surprise bills?
Set a maximum instance count, add a budget alert and rate-limit calls to paid APIs.
Related guides
- How to Use Cursor AI to Build Applications Without Starting From Scratch
- How to Build a Website Using AI Without Hiring a Developer
- How to Use Replit AI to Build and Deploy Your First App
Sources
- Cloud Run pricing: https://cloud.google.com/run/pricing
Key takeaways
- Cloud Run is a simple home for small AI apps and scales to zero.
- Pricing is per vCPU-second, memory and requests, with a monthly free tier.
- Secrets go in Secret Manager, never in code.
- Set an instance cap and budget alert before launch.
Want your AI app deployed safely and cost-controlled? Book a free 30 minute call with Tech AI Labs and we will plan it with you.
FAQ
Quick answers
Is Cloud Run free?
There is a monthly free tier, aggregated by billing account, and you are billed only for usage past it.
Do I need to know Docker?
Basic Docker helps. You write a short Dockerfile, and Cloud Run builds and runs the container.
Can Cloud Run run AI models with GPUs?
Google lists GPU options, such as NVIDIA L4 and RTX PRO 6000, with per-second pricing on the pricing page.
How do I stop surprise bills?
Set a maximum instance count, add a budget alert and rate-limit calls to paid APIs.


