This guide walks through connecting AMAPI Commander to your Google Cloud project, so you can start querying your Android device fleet.
Before you begin, make sure you have:
The assistant that translates your natural-language queries into AMAPI calls is powered by OpenAI. You'll need a project API key.
AMAPI Commander authenticates against your Google Cloud project using OAuth. You'll need to configure the OAuth consent screen if you haven't already.
If your project already has an OAuth consent screen configured, you can skip this step.
AMAPI Commander needs a Web application OAuth client to handle the authorisation flow.
For the hosted multi-tenant platform, the redirect URIs will be displayed on the Connect screen within AMAPI Commander. Add both:
https://amapi-commander.bayton.org/auth/google/callbackhttps://amapi-commander.bayton.org/workspace/google-oauth/callbackThe Google account that authorises the workspace needs specific IAM roles on the Cloud project. Run the following commands in Cloud Shell or your local terminal with the gcloud CLI:
Enable AMAPI MCP beta:
gcloud beta services mcp enable androidmanagement.googleapis.com \
--project=<PROJECT_ID>
Grant required IAM roles:
gcloud projects add-iam-policy-binding <PROJECT_ID> \
--member=user:<YOUR_EMAIL> \
--role=roles/serviceusage.serviceUsageAdmin
gcloud projects add-iam-policy-binding <PROJECT_ID> \
--member=user:<YOUR_EMAIL> \
--role=roles/mcp.toolUser
gcloud projects add-iam-policy-binding <PROJECT_ID> \
--member=user:<YOUR_EMAIL> \
--role=roles/androidmanagement.user
Replace <PROJECT_ID> with your Google Cloud project ID and <YOUR_EMAIL> with the Google account email that will authorise the workspace.
If you use custom roles internally, make sure they cover the same access as these three predefined roles: Service Usage Admin, MCP Tool User, and Android Management User.
If your account has admin/owner permissions, the above is not needed.
For more detail, see the AMAPI MCP documentation.
When you first open AMAPI Commander, you'll land on the Connect screen. The setup has two steps:
On the multi-tenant platform, enter your email address and click Send Magic Link. Open the link from your inbox in the same browser session to authenticate.
The platform is invite-only at present, so authentication will fail unless you've been invited in. Get in touch for an invite.
Once signed in, click Continue To Workspace Configuration.
The workspace setup checklist on screen will track your progress. Once all three items show green (OpenAI Key, Google Client, Google OAuth), you're ready to go.
Click Proceed To Workspace to start querying your fleet.
With your workspace connected, you can ask AMAPI Commander questions in plain English. Here are some examples to get started:
enterpriseId"The assistant works out which API calls to make, in what order, and how to combine the results. You can also use voice interaction, and larger queries will process in the background automatically.
If you don't wish to engage with the LLM, you can also click around your Google Cloud Project, accessing all enterprises, policies, apps, and devices visually through the dashboard - this is not LLM-driven.
Caching will allow temporary storage of your AMAPI project data, encrypted at rest. It is disabled by default to respect privacy, however will dramatically increase the responsiveness of the LLM
OAuth is configured to obtain and refresh access to the Google Cloud Project automatically. To disconnect your account from AMAPI Commander, use the Disconnect button in Connect under OAuth States.
OAuth fails or returns an error
Check that your redirect URIs exactly match what's configured in your Google Cloud OAuth client. Ensure first-party cookies are enabled in your browser.
"Forbidden" or permission errors when querying
Verify that the Google account you authorised with has all three IAM roles assigned on the correct project. The roles must be on the same project ID you entered during workspace creation.
Assistant returns empty or unhelpful responses
Confirm your OpenAI API key is valid and has available credit. You can rotate the key from the workspace configuration screen at any time.
Assistant is slow or hits API limits
Try enabling cache.
For deeper technical detail on the platform architecture, security model, and data flows, see the Technical Whitepaper.
Are you in need of further help, or would you like to raise a feature request? You can: