public static void initFromContext(ApiKeyData proxyApiKeyData, ProxyContext context) {
        ApiKeyData apiKeyData = context.getApiKeyData();
        List<String> currentPath;
        proxyApiKeyData.setHttpHeaders(collectHttpHeaders(context));

        if (apiKeyData.getPerRequestKey() == null) {
            proxyApiKeyData.setOriginalKey(context.getKey());
            proxyApiKeyData.setExtractedClaims(context.getExtractedClaims());
            proxyApiKeyData.setTraceId(context.getTraceId());
            currentPath = new ArrayList<>();
        } else {
            proxyApiKeyData.setOriginalKey(apiKeyData.getOriginalKey());
            proxyApiKeyData.setExtractedClaims(apiKeyData.getExtractedClaims());
            proxyApiKeyData.setTraceId(apiKeyData.getTraceId());
            currentPath = new ArrayList<>(context.getApiKeyData().getExecutionPath());
        }
        if (context.getDeployment() != null) {
            currentPath.add(context.getDeployment().getName());
            proxyApiKeyData.setSourceDeployment(context.getDeployment().getName());
        } else if (context.getRoute() != null) {
            currentPath.add(context.getRoute().getName());
            proxyApiKeyData.setSourceDeployment(context.getRoute().getName());
        }
        proxyApiKeyData.setExecutionPath(currentPath);
        proxyApiKeyData.setSpanId(context.getSpanId());
    }
The container keeps data associated with API key.
<p>
    There are two types of API keys:
    <ul>
        <li>Project key is supplied from the Core config</li>
        <li>Per request key is generated in runtime and valid during the request</li>
    </ul>
</p>
server/src/main/java/com/epam/aidial/core/server/data/ApiKeyData.java