I Connected the Google Maps API to Muse
This is an English translation of the Japanese original, made with an LLM (Claude Opus 5.5). If anything is unclear, the Japanese version is authoritative. Read the Japanese original
I connected Google Maps Platform APIs to Muse under my own account.
What I did was enable an API key in Google Cloud and add a custom connector to Muse that calls the APIs with that key. In this article, I first summarize the setup steps, the APIs I connected, the billing caps, and caveats. After that, I write about why I did this in the first place, the trial and error before the connection worked, and what changed once it was connected.
Setup steps
You need a Google Cloud project and a billing account linked to it. API usage is pay-as-you-go, but for the range an individual uses in everyday exchanges, it mostly fits within the free tier.
- Prepare a project in Google Cloud and enable three APIs: Routes API, Places API, and Geocoding API
- Issue an API key. Restrict the APIs the key can use to these three
- Give the API key to Muse. Since this involves handing over sensitive information, enter it using the secure method Muse guides you to
- Muse creates the connector. A custom connector that calls the three APIs with the shared key is set up, and the integration is complete
The part I did by hand was the preparation on the Google Cloud side. I prepared the project, enabled the APIs, and issued the API key; Muse took on the work of building the connector.
I verified the integration with real calls. The Places API returned the address and coordinates of Gamagori Station. The Routes API returned a driving route from Gamagori Station to Toyohashi Station: 18.2 km, 39 minutes. With the Geocoding API, both conversion from address to coordinates and the reverse worked.
The APIs I connected and the billing caps
I connected three Google Maps Platform APIs.
- The Routes API returns routes and travel times
- The Places API returns details such as a place's address and coordinates
- The Geocoding API converts between addresses and coordinates
The API key is a single key shared by all three. A Google Maps Platform API key is a single static value, so it could be placed directly into Muse's credentials mechanism.
I built a mechanism to stop runaway billing by setting daily caps on the Google Cloud side: 100 calls per day for the Places API, 300 per day for the Routes API, and 500 per day for the Geocoding API. Monthly caps can't be set, so I constrain it daily, with an allocation that keeps the total at around 1,000 yen a month even if the caps are hit every day. If a cap is exceeded and an error comes back, the rule is not to retry silently but to tell me about it.
Caveats
There is one thing this integration couldn't do: train routes.
When I specified transit in the Routes API, no routes within Japan came back. Gamagori to Toyohashi, Tokyo to Shinjuku: the results were empty. With the same implementation, a route from San Francisco to Oakland in the US did come back, so it wasn't a problem with the implementation or the key. Google's official FAQ also states that the Routes API supports transit data providers, with Japanese providers as an exception.
The escape route via the legacy Directions API was also closed. It has been treated as legacy since March 1, 2025, and it can't even be enabled in new projects.
So this API can't be used for train transfer directions in Japan.
Muse was looking at the browser
From here on is the story of why I did this.
Asking Muse about routes and places was an everyday exchange for me. Muse works by fetching all kinds of information. So what was it looking at for route searches?
On November 27, when I had it lay out how Muse accesses external information, I found out: it was actually opening and looking at exactly the same Google Maps we see in a browser. It waited for the screen to render, then read the displayed route the same way a human reads it.
Since it's a machine, I had assumed it was fetching things more smartly from an API. At least in my mind, Muse was something directly connected to data. But the reality was a machine going out of its way to look at a screen made for humans.
So the next day, November 28, I decided to call Google's APIs with my own billing account, and on November 29 the connection was complete.
Trial and error before connecting
The connection didn't work in one go; it got stuck in a few places.
First, I made a mistake handing over the API key. I pasted the actual key value directly into the chat. I didn't use that key; I deleted it in the Google Cloud console and issued a new one. I switched to handing over the new key through the secure input mechanism. The "secure method" in step 3 of the setup is the approach I settled on after this mistake.
Next, I got stuck on the Geocoding API cap setting. With the new v4 API, even though key authentication passed, the initial daily quota value was 0, so it stopped with a quota-exceeded error. The cap I thought I had set to 500 was a separate item on the old v3 side. I raised the v4 item to 500 and confirmed that conversion between addresses and coordinates worked in both directions.
The other one happened the day after connecting, when I actually went to fetch a route. The call path for the Routes API was wrong, and it returned 404. After correcting it to the right path and fetching again, I got a route from my home toward Lake Hiraya: 115 km, about 2 hours 4 minutes.
A mouth opened between machines
After connecting, the way I ask about routes changed.
It no longer goes through the browser screen. When Muse asks Google's machine directly how many minutes it takes by car from Gamagori Station to Toyohashi Station, the numbers 18.2 km and 39 minutes come back. Instead of re-reading a screen drawn for people to look at, it asks for the values it wants, machine to machine.
I was reminded of the scenes in Chōhei Kambayashi's science fiction where machines exchange information with each other where humans don't know about it.
The difference in feel appeared as a result of that difference in form. An exchange that took 3 minutes via the browser comes back in 3 seconds via the API. Rather than simply getting faster, the way of asking itself changed, from peering through a window made for humans to asking directly through a mouth between machines.
Here's how I divide things now. Car and walking routes, checking places, and converting between addresses and coordinates go through the API, and what used to take 3 minutes in the browser comes back in 3 seconds. Only train transfers go through the browser, and those still remain on the 3-minute side.