Call AGS services and Extend apps
Overview
Your Extend app often needs to call other parts of the platform — AccelByte Gaming Services (AGS) endpoints such as IAM, and other Extend apps. This page explains how to address those calls using the app's base URL (AB_BASE_URL), and how to choose the right scheme (http:// or https://) when calling your app depending on where the call comes from.
Calls between apps and services inside the platform can now travel over the internal network. Routing your in-platform traffic this way lowers egress cost, reduces latency, and avoids public rate limits, while your app's existing public access stays intact.
Use AB_BASE_URL for in-platform calls
AB_BASE_URL is an environment variable available to your Extend app that points at the AccelByte platform. Using it as the base for your in-platform calls means:
- Your calls follow the platform's recommended network path automatically.
- You don't have to update your code if the platform address changes — the variable is managed for you.
- Your app benefits from internal routing where it's available, without losing public access.
How far AB_BASE_URL reaches depends on which cloud your app is hosted in:
- AGS Private Cloud — We strongly recommend using
AB_BASE_URLfor every in-platform call. In Private Cloud, all apps share one base URL, soAB_BASE_URLreaches any AGS service and any Extend app, including apps in a different namespace. - AGS Public Cloud — Each namespace has its own base URL.
AB_BASE_URLis the base URL for your app's own namespace, so use it for AGS services and for Extend apps in the same namespace. To reach an Extend app in a different namespace, you need that app's base URL instead of your ownAB_BASE_URL— see Reaching an Extend app in a different namespace for how to build the right address.
Read the value at runtime rather than hardcoding it. For example:
- C#
- Go
- Java
- Python
string? baseUrl = Environment.GetEnvironmentVariable("AB_BASE_URL");
// we can use the existing GetEnv() function from this repo, or the native os.Getenv()
baseURL := server.GetEnv("AB_BASE_URL", "")
@Value("${AB_BASE_URL}")
private String baseUrl;
base_url = env("AB_BASE_URL", "")
See Environment variables and secrets for how environment variables are provided to your app and how to add your own.
Choose http:// or https://
When something calls your app, use http:// or https:// depending on where that call starts.
- The call starts inside the platform → use
http://, so the call stays on the internal network. For example, another Extend app calling your app. These calls get lower latency, no egress cost, and no public rate limits. - The call starts outside the platform → use
https://, since the call comes over the public internet. The most common case is a game client on a player's device reaching your app over the public internet.
Here's the same guidance in a table for quick reference:
| Where the call starts | Use | Example |
|---|---|---|
| Inside the platform | http:// | Another Extend app → your app |
| Outside the platform | https:// | Game client → your app |
http:// safe for internal calls?Yes. Internal traffic never leaves the platform network and is encrypted in transit by the platform's service mesh (mutual TLS). The http:// scheme only tells the platform to route the call internally — it does not send your data unencrypted.
Reaching an Extend app in a different namespace (Public Cloud)
In AGS Public Cloud, each namespace has its own base URL, so your AB_BASE_URL only points at your own namespace. When you need to call an Extend app in another namespace, use that app's own address:
http://<namespace>.ext.prod.gamingservices.accelbyte.io/<basePath>
To get this address, open the target app's details page in the Admin Portal and copy its Service URL (see The Service URL row). Keep http://: the call still starts inside the platform, just crossing into another namespace. You don't need this in AGS Private Cloud, where the shared base URL already reaches other namespaces, so AB_BASE_URL is enough.
The Service URL row
The Service URL is the address other callers use to reach your app. It applies to the Extend app types that expose callable endpoints:
- Extend Service Extension — custom services that publish RESTful endpoints your game and other apps call.
- Extend Event Handler — apps that receive AGS events and can be reached at their service address.
In the AGS Admin Portal, the Service URL row on the details page of a Service Extension or Event Handler app shows both the http:// and https:// forms of this address and defaults to http://. Choose the form that matches where the caller runs, using the guidance above: http:// when the caller is another Extend app or an AGS service inside the platform, https:// when the caller is outside the platform.
