From 1a7ebac36f8e7a6346c841ac591a5239f48c6b26 Mon Sep 17 00:00:00 2001 From: lgunreddi Date: Wed, 26 Aug 2026 13:16:52 -0400 Subject: [PATCH 1/9] Create Pod-logs-metrics --- pods/Pod-logs-metrics | 52 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 pods/Pod-logs-metrics diff --git a/pods/Pod-logs-metrics b/pods/Pod-logs-metrics new file mode 100644 index 00000000..633725ab --- /dev/null +++ b/pods/Pod-logs-metrics @@ -0,0 +1,52 @@ +--- +title: "Pod logs and metrics" +sidebarTitle: "Logs and metrics" +description: "Pull Pod logs and metrics from the Runpod API into your data lake, monitoring stack, or Prometheus instance." +--- + +Use the Runpod API to retrieve logs and metrics for your Pods programmatically. Both endpoints authenticate with your Runpod API key. + +## Prerequisites + +- A Runpod API key. Generate one in the [console](https://www.runpod.io/console/user/settings) under **Settings → API Keys**. +- Your Pod ID. Find it on the [Pods page](https://www.runpod.io/console/pods) in the console. +- For team-scoped Pods: your Team ID. Find it in the console under **Settings → Team**, or copy the `X-Team-Id` value from any authenticated request in your browser's DevTools Network tab. + +## Pod logs + +Retrieve the log stream for a running Pod. + +```bash +curl -sS \ + -H "Authorization: Bearer $API_KEY" \ + -H "X-Team-Id: $TEAM_ID" \ + "https://hapi.runpod.net/v1/pod/$POD_ID/logs" +``` + +Omit the `X-Team-Id` header for personal (non-team) Pods. + +## Pod metrics + +Retrieve metrics for a running Pod. + +```bash +curl -sS \ + -H "Authorization: Bearer $API_KEY" \ + "https://hapi.runpod.net/v1/pods/$POD_ID/metrics" +``` + +A successful response returns JSON with `pod_id`, `timestamp`, and a `metrics` object. + + +The metrics endpoint does not require an `X-Team-Id` header. + + +## Response codes + +| Code | Cause | +|------|-------| +| `200` | Success | +| `401` | Missing or malformed `Authorization` header | +| `403` | Invalid API key, or missing `X-Team-Id` for a team-scoped Pod | +| `404` | Pod not found or not owned by this API key | +| `502`/`503` | Pod host agent unreachable | From dae1a1796de97dbb6dd0daefa41b0556c9a7005f Mon Sep 17 00:00:00 2001 From: lgunreddi Date: Wed, 26 Aug 2026 13:20:41 -0400 Subject: [PATCH 2/9] Update docs.json --- docs.json | 1 + 1 file changed, 1 insertion(+) diff --git a/docs.json b/docs.json index 06c89912..950235db 100644 --- a/docs.json +++ b/docs.json @@ -213,6 +213,7 @@ "pods/templates/secrets" ] }, + "pods/logs-and-metrics", { "group": "Troubleshooting", "pages": [ From 47e57714fef864718f934976f69ef596e49883c1 Mon Sep 17 00:00:00 2001 From: lgunreddi Date: Wed, 26 Aug 2026 13:21:10 -0400 Subject: [PATCH 3/9] Rename Pod-logs-metrics to Pod-logs-metrics.mdx --- pods/{Pod-logs-metrics => Pod-logs-metrics.mdx} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename pods/{Pod-logs-metrics => Pod-logs-metrics.mdx} (100%) diff --git a/pods/Pod-logs-metrics b/pods/Pod-logs-metrics.mdx similarity index 100% rename from pods/Pod-logs-metrics rename to pods/Pod-logs-metrics.mdx From 26230348c13cea26bb01d4e18212b0826caef2bf Mon Sep 17 00:00:00 2001 From: lgunreddi Date: Wed, 26 Aug 2026 13:37:23 -0400 Subject: [PATCH 4/9] Update docs.json --- docs.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs.json b/docs.json index 950235db..3401209c 100644 --- a/docs.json +++ b/docs.json @@ -213,7 +213,7 @@ "pods/templates/secrets" ] }, - "pods/logs-and-metrics", + "pods/Pod-logs-metrics", { "group": "Troubleshooting", "pages": [ From 41dfb99d0267bf99eb2df96aaf8109a858175e1a Mon Sep 17 00:00:00 2001 From: lgunreddi Date: Wed, 26 Aug 2026 16:16:58 -0400 Subject: [PATCH 5/9] Update Pod-logs-metrics.mdx --- pods/Pod-logs-metrics.mdx | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/pods/Pod-logs-metrics.mdx b/pods/Pod-logs-metrics.mdx index 633725ab..9af26504 100644 --- a/pods/Pod-logs-metrics.mdx +++ b/pods/Pod-logs-metrics.mdx @@ -10,37 +10,38 @@ Use the Runpod API to retrieve logs and metrics for your Pods programmatically. - A Runpod API key. Generate one in the [console](https://www.runpod.io/console/user/settings) under **Settings → API Keys**. - Your Pod ID. Find it on the [Pods page](https://www.runpod.io/console/pods) in the console. -- For team-scoped Pods: your Team ID. Find it in the console under **Settings → Team**, or copy the `X-Team-Id` value from any authenticated request in your browser's DevTools Network tab. +- If you're using a team account: your Team ID. In the left navigation, go to **Account → Team**. Your Team ID is shown in the top right of the page next to **ID**. You must be a team Owner or Admin to access this page. + + +Team ID is only required if you're using a team account. The X-Team-Id header is not required for personal accounts. + ## Pod logs Retrieve the log stream for a running Pod. ```bash -curl -sS \ +curl -sS -D - \ -H "Authorization: Bearer $API_KEY" \ -H "X-Team-Id: $TEAM_ID" \ "https://hapi.runpod.net/v1/pod/$POD_ID/logs" ``` -Omit the `X-Team-Id` header for personal (non-team) Pods. +Omit the `X-Team-Id` header if you're using a personal account. ## Pod metrics Retrieve metrics for a running Pod. ```bash -curl -sS \ +curl -sS -D - \ -H "Authorization: Bearer $API_KEY" \ + -H "X-Team-Id: $TEAM_ID" \ "https://hapi.runpod.net/v1/pods/$POD_ID/metrics" ``` A successful response returns JSON with `pod_id`, `timestamp`, and a `metrics` object. - -The metrics endpoint does not require an `X-Team-Id` header. - - ## Response codes | Code | Cause | From f837d58fc34f53538aef49753b52c736b4d6857e Mon Sep 17 00:00:00 2001 From: lgunreddi Date: Wed, 26 Aug 2026 16:34:25 -0400 Subject: [PATCH 6/9] Update Pod-logs-metrics.mdx --- pods/Pod-logs-metrics.mdx | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/pods/Pod-logs-metrics.mdx b/pods/Pod-logs-metrics.mdx index 9af26504..a7e59227 100644 --- a/pods/Pod-logs-metrics.mdx +++ b/pods/Pod-logs-metrics.mdx @@ -8,13 +8,13 @@ Use the Runpod API to retrieve logs and metrics for your Pods programmatically. ## Prerequisites -- A Runpod API key. Generate one in the [console](https://www.runpod.io/console/user/settings) under **Settings → API Keys**. -- Your Pod ID. Find it on the [Pods page](https://www.runpod.io/console/pods) in the console. -- If you're using a team account: your Team ID. In the left navigation, go to **Account → Team**. Your Team ID is shown in the top right of the page next to **ID**. You must be a team Owner or Admin to access this page. +You can find all of the following in the [Runpod console](https://console.runpod.io). - -Team ID is only required if you're using a team account. The X-Team-Id header is not required for personal accounts. - +- A Runpod API key. Generate one under **Settings → API Keys**. +- Your Pod ID. Find it on the **Pods** page. +- Your Team ID. Required for team accounts only and not required for personal accounts. + - Go to **Account → Team** in the left navigation. Your Team ID is shown in the top right of the page next to **ID**. + - You must be a team owner or admin to access this page. ## Pod logs From 18699bc9953c00b2de36e6e3f958ec42b422e7b4 Mon Sep 17 00:00:00 2001 From: lgunreddi Date: Wed, 26 Aug 2026 16:40:32 -0400 Subject: [PATCH 7/9] Update Pod-logs-metrics.mdx --- pods/Pod-logs-metrics.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pods/Pod-logs-metrics.mdx b/pods/Pod-logs-metrics.mdx index a7e59227..82c66d32 100644 --- a/pods/Pod-logs-metrics.mdx +++ b/pods/Pod-logs-metrics.mdx @@ -8,7 +8,7 @@ Use the Runpod API to retrieve logs and metrics for your Pods programmatically. ## Prerequisites -You can find all of the following in the [Runpod console](https://console.runpod.io). +You can find all of the following in the [console](https://console.runpod.io). - A Runpod API key. Generate one under **Settings → API Keys**. - Your Pod ID. Find it on the **Pods** page. From 7a176ddc9580870fb0c8d4a2dcffaca82632f1c9 Mon Sep 17 00:00:00 2001 From: lgunreddi Date: Wed, 26 Aug 2026 16:43:32 -0400 Subject: [PATCH 8/9] Update Pod-logs-metrics.mdx --- pods/Pod-logs-metrics.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pods/Pod-logs-metrics.mdx b/pods/Pod-logs-metrics.mdx index 82c66d32..ebc08a7d 100644 --- a/pods/Pod-logs-metrics.mdx +++ b/pods/Pod-logs-metrics.mdx @@ -27,7 +27,7 @@ curl -sS -D - \ "https://hapi.runpod.net/v1/pod/$POD_ID/logs" ``` -Omit the `X-Team-Id` header if you're using a personal account. +The X-Team-Id header is not required for personal accounts. ## Pod metrics From fb6601ac219462df1a65c6d9c05dc1c6fc93c38f Mon Sep 17 00:00:00 2001 From: lgunreddi Date: Thu, 27 Aug 2026 08:03:31 -0400 Subject: [PATCH 9/9] Update Pod-logs-metrics.mdx --- pods/Pod-logs-metrics.mdx | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/pods/Pod-logs-metrics.mdx b/pods/Pod-logs-metrics.mdx index ebc08a7d..a968c878 100644 --- a/pods/Pod-logs-metrics.mdx +++ b/pods/Pod-logs-metrics.mdx @@ -18,7 +18,10 @@ You can find all of the following in the [console](https://console.runpod.io). ## Pod logs -Retrieve the log stream for a running Pod. +The logs endpoint supports two modes: + +- **Streaming** (`?stream=true`): Returns a live log stream. Limited to 5 concurrent connections per Pod. Additional connections return `429` with `"too many concurrent log streams"`. +- **Snapshot** (default): Returns a point-in-time snapshot of logs. ```bash curl -sS -D - \ @@ -26,6 +29,7 @@ curl -sS -D - \ -H "X-Team-Id: $TEAM_ID" \ "https://hapi.runpod.net/v1/pod/$POD_ID/logs" ``` +For a live stream, append `?stream=true` to the URL. The X-Team-Id header is not required for personal accounts. @@ -42,6 +46,10 @@ curl -sS -D - \ A successful response returns JSON with `pod_id`, `timestamp`, and a `metrics` object. +## Rate limits + +Both endpoints share the same rate limit: one request every 5 seconds per Pod, with a burst of 3 requests. Requests over the limit return `429`. + ## Response codes | Code | Cause | @@ -50,4 +58,5 @@ A successful response returns JSON with `pod_id`, `timestamp`, and a `metrics` o | `401` | Missing or malformed `Authorization` header | | `403` | Invalid API key, or missing `X-Team-Id` for a team-scoped Pod | | `404` | Pod not found or not owned by this API key | +| `429` | Rate limit exceeded, or too many concurrent log streams | | `502`/`503` | Pod host agent unreachable |