Select platform: [Android](https://developers.google.com/maps/documentation/places/android-sdk/using-session-tokens.md.txt "View this page for the Android platform docs.") [iOS](https://developers.google.com/maps/documentation/places/ios-sdk/using-session-tokens "View this page for the iOS platform docs.") [Web Service](https://developers.google.com/maps/documentation/places/web-service/using-session-tokens.md.txt "View this page for the Web Service platform docs.")

<br />

Session tokens group the query and selection phases of a user autocomplete
search into a discrete session for billing purposes.

## Create a session token

Users are responsible for generating unique session tokens for each session.
Google recommends using [version 4 UUIDs](https://tools.ietf.org/html/rfc4122).

> [!NOTE]
> **Note:** Session tokens can overlap across Google Cloud Console projects, but they must be unique per project. For example, an app using Project A and an app using Project B can use the same session token, but multiple apps using Project A cannot use the same session token.

## Example

As the user types a query, an autocomplete request is called every few
keystrokes (not per-character), and a list of possible results is returned. When
the user makes a selection from the result list, the selection counts as a
request, and all of the requests made during the search are bundled and counted
as a single request. If the user selects a place, the search query is available
at no charge, and only the Place data request is charged. If the user does not
make a selection within a few minutes of the beginning of the session, only the
search query is charged.

Let's examine this flow of events from the perspective of an app.

1. A user begins typing a query to search for "Paris, France".
2. Upon detecting user input, the app creates a new session token, "Token A".
3. As the user types, the API makes an autocomplete request every few characters, displaying a new list of potential results for each:  
   "P"   
   "Par"   
   "Paris,"   
   "Paris, Fr"   
4. When the user makes a selection:
   - All requests resulting from the query are grouped and added to the session represented by "Token A", as a single request.
   - The user's selection is counted as a Place Detail request, and added to the session represented by "Token A".
5. The session is concluded, and the app discards "Token A".

For more information about how Autocomplete requests are billed, see [Usage and
Billing](https://developers.google.com/maps/documentation/places/android-sdk/usage-and-billing).