Update Copy to cURL buttons to reference the new Runs API spec (#3765)

Co-authored-by: Shuchang Zheng <wintonzheng0325@gmail.com>
This commit is contained in:
Marc Kelechava
2025-10-30 01:26:45 -07:00
committed by GitHub
parent 5ec885ddd1
commit a87a255b7b
8 changed files with 310 additions and 53 deletions

View File

@@ -43,6 +43,19 @@ try {
newWssBaseUrl = wssBaseUrl.replace("/api", "");
}
// Base URL for the Runs API (strip a leading `/api` segment: /api/v1 -> /v1)
const runsApiBaseUrl = (() => {
try {
const url = new URL(apiBaseUrl);
if (url.pathname.startsWith("/api")) {
url.pathname = url.pathname.replace(/^\/api/, "");
}
return `${url.origin}${url.pathname}`;
} catch (e) {
return apiBaseUrl.replace("/api", "");
}
})();
let runtimeApiKey: string | null | undefined;
function readPersistedApiKey(): string | null {
@@ -83,6 +96,7 @@ function clearRuntimeApiKey(): void {
export {
apiBaseUrl,
runsApiBaseUrl,
environment,
artifactApiBaseUrl,
apiPathPrefix,