Bắt đầu
1 2 3 4
5 6 7
An toàn Lỗi thường gặp
API key là gì?
API key là một chuỗi ký tự dài, giống như chiếc thẻ ra vào cấp riêng cho bạn. Khi bạn dán khoá này vào ứng dụng (ví dụ ứng dụng soạn đề, chấm bài, tạo hình ảnh), ứng dụng sẽ dùng nó để thay mặt bạn gọi trí tuệ nhân tạo Gemini của Google, gói gọn trong hạn mức miễn phí trên chính tài khoản của bạn.
Cần chuẩn bị
Một tài khoản Google (Gmail) cá nhân. Bạn cần từ 18 tuổi trở lên.
Máy tính có trình duyệt (Chrome, Edge, Cốc Cốc… đều được).
Không cần thẻ ngân hàng / thẻ tín dụng, vì gói miễn phí không yêu cầu thanh toán.
Mẹo Hãy đổi sang dùng Gmail cá nhân nếu bạn gặp báo lỗi không vào được trang. Tài khoản email của trường hoặc cơ quan (Google Workspace) đôi khi bị quản trị viên chặn truy cập Google AI Studio.
1 Bước 1 Mở Google AI Studio
Bạn mở trình duyệt, gõ địa chỉ aistudio.google.com rồi nhấn Enter. Khi trang web hiện ra, hãy bấm nút Get started ở góc trên bên phải (số 1 trong hình).
Hình 1. Trang chào của Google AI Studio khi chưa đăng nhập.
2 Bước 2 Đăng nhập bằng tài khoản Google
Bạn nhập địa chỉ Gmail vào ô Email or phone (số 2), bấm Next , rồi điền mật khẩu như khi đăng nhập Gmail. Nếu máy đã đăng nhập sẵn Gmail, hệ thống có thể tự động bỏ qua bước này.
Hình 2. Màn hình đăng nhập tài khoản Google.
Lần đầu sử dụng Nếu Google hiện hộp chào mừng kèm Điều khoản sử dụng (Terms of Service), bạn hãy đọc qua, đánh dấu vào ô đồng ý rồi bấm Continue / Tiếp tục . Với câu hỏi có muốn nhận email cập nhật hay không, bạn chọn tuỳ ý vì phần này không ảnh hưởng tới việc lấy khoá.
3 Bước 3 Vào trang API Keys
Sau khi đăng nhập vào màn hình chính (Playground), bạn mở trang quản lý khoá (số 3) theo một trong hai cách:
Bấm Dashboard ở cột menu bên trái; hoặc
Bấm biểu tượng chìa khoá ở góc dưới bên trái (tên là “Get API key”).
Để nhanh nhất, bạn có thể gõ thẳng địa chỉ aistudio.google.com/api-keys vào thanh địa chỉ.
Hình 3. Màn hình chính của Google AI Studio. Email ở góc dưới đã được làm mờ.
4 Bước 4 Bấm “Create API key”
Bạn bấm nút Create API key ở góc trên bên phải của trang API Keys (số 4).
Nếu tài khoản của bạn mới tạo, danh sách khoá bên dưới sẽ trống hoặc chỉ có sẵn một khoá mặc định. Trên hình minh hoạ, phần danh sách khoá cũ đã làm mờ đi.
Hình 4. Trang API Keys và nút Create API key.
5 Bước 5 Đặt tên khoá, chọn dự án, bấm “Create key”
Khi hộp thoại Create a new key hiện ra, bạn lần lượt điền các mục:
A Name your key: đặt một cái tên dễ nhớ, ví dụ “Khoá dùng cho app soạn đề”, hoặc cứ giữ nguyên tên mặc định.
B Choose an imported project: chọn một dự án (project). Tài khoản mới thường có sẵn dự án mặc định, bạn cứ giữ nguyên lựa chọn đó.
C Create key: bấm vào đây để tạo khoá.
Hình 5. Hộp thoại tạo khoá mới.
Nếu ô B trống (chưa có dự án nào)
Bạn bấm vào ô B , sau đó chọn + Create project ở đầu danh sách.
Hình 6. Danh sách dự án, chọn Create project. Tên các dự án riêng đã được làm mờ.
Hãy đặt tên cho dự án (ví dụ “Gemini Project”) rồi bấm Create project . Xong xuôi, bạn quay lại hộp thoại như ở Hình 5 và bấm Create key .
Hình 7. Hộp thoại tạo dự án mới.
6 Bước 6 Sao chép (copy) khoá
Bạn bấm Copy key (hoặc biểu tượng hai tờ giấy cạnh dòng API Key, số D) trong hộp API key details vừa hiện ra để chép khoá, rồi dán (Ctrl + V) vào ô API key trên ứng dụng đang dùng.
Khoá mới tạo sẽ bắt đầu bằng chữ AQ. kèm một dãy ký tự dài phía sau, còn khoá tạo từ trước có thể bắt đầu bằng AIza. Cả hai dạng này đều dùng được bình thường.
Hình 8. Hộp API key details. Chuỗi khoá và số dự án trong hình đã được thay bằng dấu chấm.
Quên chép khoá? Không sao Để lấy lại khoá bất cứ lúc nào, bạn chỉ cần vào trang API Keys , bấm vào tên khoá (dòng chữ xanh ở cột Key) để mở hộp API key details rồi bấm Copy key .
7 Bước 7 Kiểm tra bạn đang dùng gói miễn phí
Bạn nhìn vào cột Billing Tier trên trang API Keys , dòng trạng thái của khoá phải ghi là Free tier (miễn phí).
Đừng bấm nút “Set up billing” nếu bạn chỉ muốn dùng miễn phí. Nút này dùng để gắn thẻ thanh toán và chuyển tài khoản sang gói trả phí.
Hình 9. Cột Billing Tier ghi “Free tier”.
Giữ khoá an toàn
Quan trọng Bạn hãy giữ kín API key như mật khẩu cá nhân. Bất kỳ ai có khoá này đều có thể dùng hết hạn mức của bạn.
Không đăng khoá lên Facebook, nhóm Zalo, đính kèm trong bài nộp hay gửi cho người lạ.
Chỉ dán khoá vào những ứng dụng mà bạn tin tưởng.
Khi nghi ngờ khoá bị lộ, bạn hãy mở lại khoá (bấm tên khoá), chọn Delete key để xoá đi, rồi làm lại theo Bước 4–6 để tạo khoá mới.
Gói miễn phí có giới hạn gì?
Tài khoản có giới hạn số lượt gọi mỗi phút và mỗi ngày. Nếu dùng vượt mức, ứng dụng sẽ tạm báo lỗi; bạn chỉ cần chờ một lúc (hoặc sang ngày hôm sau) là dùng tiếp được, không bị trừ tiền.
Bạn có thể kiểm tra hạn mức của tài khoản tại mục Rate Limit ở menu bên trái trang API Keys .
Bạn không nên gửi thông tin cá nhân nhạy cảm (ví dụ họ tên, số điện thoại của học sinh) qua ứng dụng. Theo điều khoản áp dụng cho gói miễn phí, Google có thể dùng nội dung bạn gửi đi để cải thiện sản phẩm.
Một số lỗi thường gặp
Không vào được AI Studio, báo tài khoản không được phép Đổi sang Gmail cá nhân (không dùng email trường/cơ quan) và kiểm tra xem tài khoản đã đủ 18 tuổi chưa.
Ứng dụng báo “API key not valid” / khoá không hợp lệ Bấm Copy key lần nữa rồi dán lại, vì có thể bạn đã chép thiếu ký tự hoặc dính thêm dấu cách.
Ứng dụng báo lỗi 429 hoặc “quota / rate limit” Chờ vài phút hoặc để sang ngày hôm sau rồi thử lại, do bạn đã dùng hết lượt miễn phí trong phút hoặc trong ngày.
Ứng dụng báo lỗi 503 “high demand” / máy chủ quá tải Thử lại sau ít phút. Lúc này máy chủ Google đang đông người truy cập chứ không phải lỗi do khoá.
Không thấy nút Create API key Kiểm tra xem bạn đã đăng nhập và mở đúng trang aistudio.google.com/api-keys chưa.
Theo thời gian, giao diện Google AI Studio có thể thay đổi đôi chút về tên nút và vị trí so với hình chụp, nhưng các bước thao tác chính vẫn giữ nguyên. Cập nhật 15/11/2026.
Start
1 2 3 4
5 6 7
Safety Common errors
What is an API key?
An API key is a long string of characters, a bit like an access card issued just to you. When you paste it into an app (for example an app that writes tests, marks work or makes pictures), the app uses it to call Google’s Gemini AI on your behalf, within the free quota of your own account.
What you need
A personal Google (Gmail) account. You must be 18 or older.
A computer with a web browser (Chrome, Edge, Cốc Cốc… any will do).
No bank or credit card: the free tier does not ask for payment.
Tip If you see an error saying you cannot open the page, switch to a personal Gmail account. School or work accounts (Google Workspace) are sometimes blocked from Google AI Studio by their administrator.
1 Step 1 Open Google AI Studio
Open your browser, type aistudio.google.com and press Enter. When the page loads, click Get started in the top right corner (number 1 in the picture).
Figure 1. The Google AI Studio welcome page before you sign in.
2 Step 2 Sign in with your Google account
Type your Gmail address in Email or phone (number 2), click Next , then enter your password as you would for Gmail. If you are already signed in to Gmail on this computer, this step may be skipped.
Figure 2. The Google account sign-in screen.
First time? If Google shows a welcome box with its Terms of Service, read it, tick the box to agree and click Continue . Whether you want update emails is up to you; it does not affect getting a key.
3 Step 3 Go to the API Keys page
After you sign in you land on the main screen (Playground). Open the key page (number 3) in one of two ways:
Click Dashboard in the left menu; or
Click the key icon in the bottom left corner (it is called “Get API key”).
The quickest way is to type aistudio.google.com/api-keys straight into the address bar.
Figure 3. The Google AI Studio main screen. The email in the bottom corner is blurred.
4 Step 4 Click “Create API key”
Click Create API key in the top right corner of the API Keys page (number 4).
On a new account the list of keys below is empty or holds one default key. In the picture, the older keys are blurred.
Figure 4. The API Keys page and the Create API key button.
5 Step 5 Name the key, choose a project, click “Create key”
When the Create a new key box opens, fill it in from top to bottom:
A Name your key: any name you will recognise, for example “Key for my test app”, or keep the default name.
B Choose an imported project: pick a project. New accounts usually have a default project already; just keep it.
C Create key: click to create the key.
Figure 5. The dialog for creating a new key.
If box B is empty (no project yet)
Click box B , then choose + Create project at the top of the list.
Figure 6. The project list; choose Create project. Private project names are blurred.
Name the project (for example “Gemini Project”) and click Create project . Then go back to the box in Figure 5 and click Create key .
Figure 7. The dialog for creating a new project.
6 Step 6 Copy the key
In the API key details box that opens, click Copy key (or the two-sheets icon next to the API Key line, marked D), then paste it (Ctrl + V) into the API key box of the app you are using.
New keys start with AQ. followed by a long string of characters; older keys may start with AIza. Both kinds work.
Figure 8. The API key details box. The key and project number are replaced with dots.
Forgot to copy it? No problem You can get the key again at any time: open the API Keys page, click the key’s name (the blue text in the Key column) to open API key details , and click Copy key .
7 Step 7 Check that you are on the free tier
On the API Keys page, look at the Billing Tier column. Your key should say Free tier .
Do not click “Set up billing” if you only want to use it for free. That button adds a payment card and moves your account to a paid plan.
Figure 9. The Billing Tier column says “Free tier”.
Keep your key safe
Important Treat your API key like a password. Anyone who has it can use up your quota.
Do not post it on Facebook or Zalo groups, attach it to homework, or send it to strangers.
Only paste it into apps you trust.
If you think the key has leaked, open it (click its name), choose Delete key , then follow Steps 4–6 again to make a new one.
What are the free tier limits?
There is a limit on calls per minute and per day. Go over it and the app shows an error for a while; wait a bit (or until the next day) and it works again. You are not charged.
You can see your account’s limits under Rate Limit in the left menu of the API Keys page.
Do not send sensitive personal information (for example students’ names or phone numbers) through the app. Under the free tier terms, Google may use what you send to improve its products.
Common errors
Cannot open AI Studio; the account is not allowed Switch to a personal Gmail account (not a school or work one) and check that the account holder is 18 or older.
The app says “API key not valid” Click Copy key again and paste it again; part of the key may be missing or an extra space may have slipped in.
The app shows error 429 or “quota / rate limit” You have used up the free calls for this minute or day. Wait a few minutes, or until tomorrow, and try again.
The app shows error 503 “high demand” / server overloaded Try again in a few minutes. Google’s servers are busy; your key is fine.
There is no Create API key button Check that you are signed in and on aistudio.google.com/api-keys.
Google AI Studio changes over time, so button names and positions may differ a little from the pictures, but the main steps stay the same. Updated 15/11/2026.