{
  "openapi": "3.0.1",
  "info": {
    "title": "HTTP Request Tool for AI Agents",
    "description": "Send batches of HTTP requests and get agent-ready results: parsed JSON, clean Markdown from HTML, retries with Retry-After, redirect chain, timing, TLS expiry, SSRF protection and redacted secrets. URL health mode for link checks. Priced per response.",
    "version": "1.0",
    "x-build-id": "vLzRiyDfgK1nofgKu"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/tinplatelabs~agent-http/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-tinplatelabs-agent-http",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/acts/tinplatelabs~agent-http/runs": {
      "post": {
        "operationId": "runs-sync-tinplatelabs-agent-http",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor and returns information about the initiated run in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/runsResponseSchema"
                }
              }
            }
          }
        }
      }
    },
    "/acts/tinplatelabs~agent-http/run-sync": {
      "post": {
        "operationId": "run-sync-tinplatelabs-agent-http",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "inputSchema": {
        "type": "object",
        "properties": {
          "mode": {
            "title": "Mode",
            "enum": [
              "request",
              "url-health"
            ],
            "type": "string",
            "description": "<b>request</b>: send each request and return status, headers and an agent-ready body. <b>url-health</b>: check each URL (status, final URL, redirect chain, response time, TLS days left, broken flag) without downloading bodies.",
            "default": "request"
          },
          "requests": {
            "title": "Requests",
            "type": "array",
            "description": "List of requests. Each is a URL string or an object: <code>{\"method\": \"POST\", \"url\": \"https://api.example.com/items\", \"headers\": {...}, \"query\": {\"page\": 2}, \"json\": {...}}</code>. Body: one of <code>json</code> (any JSON value), <code>form</code> (object, sent URL-encoded) or <code>body</code> (raw string). Optional per request: <code>timeoutSecs</code>, <code>followRedirects</code>, <code>label</code> (echoed in the output). Max 10,000 requests per run, together with <code>urls</code>."
          },
          "urls": {
            "title": "URLs",
            "type": "array",
            "description": "Plain URLs to GET (or to check in url-health mode). Added after <code>requests</code>. A bare domain like <code>example.com</code> is fetched over https.",
            "items": {
              "type": "string"
            }
          },
          "headers": {
            "title": "Headers for every request",
            "type": "object",
            "description": "Headers added to every request, e.g. <code>{\"Accept-Language\": \"en\"}</code>. A request's own <code>headers</code> override these. Credential-like headers are redacted in the output and log."
          },
          "authorization": {
            "title": "Authorization header",
            "type": "string",
            "description": "Optional value for the <code>Authorization</code> header of every request, e.g. <code>Bearer sk-...</code>. Stored encrypted, never shown in the output or log, and not sent to a different host after a redirect."
          },
          "userAgent": {
            "title": "User-Agent",
            "type": "string",
            "description": "User-Agent header. Default identifies this Actor: <code>Mozilla/5.0 (compatible; TinplateAgentHTTP/1.0; Apify Actor; +https://apify.com/tinplatelabs/agent-http)</code>."
          },
          "timeoutSecs": {
            "title": "Timeout per attempt (seconds)",
            "minimum": 1,
            "maximum": 300,
            "type": "integer",
            "description": "Time limit for one attempt, redirects included. A request without a complete response in time gets a TIMEOUT record and is not charged.",
            "default": 30
          },
          "maxRetries": {
            "title": "Max retries",
            "minimum": 0,
            "maximum": 5,
            "type": "integer",
            "description": "Retries on HTTP 429, 500, 502, 503, 504 and on connection failures, with exponential backoff (0.5 s, 1 s, 2 s, ...). Retry-After is honoured. POST and PATCH are retried only on 429 and connection failures unless <code>retryUnsafeMethods</code> is on.",
            "default": 2
          },
          "maxRetryWaitSecs": {
            "title": "Max wait before a retry (seconds)",
            "minimum": 0,
            "maximum": 120,
            "type": "integer",
            "description": "If the server's Retry-After asks for a longer wait, the response is returned (with a warning) instead of waiting.",
            "default": 30
          },
          "retryUnsafeMethods": {
            "title": "Retry POST/PATCH on 5xx and timeouts",
            "type": "boolean",
            "description": "Also retry non-idempotent requests on 5xx responses and timeouts. Only turn this on when sending the request twice is harmless.",
            "default": false
          },
          "followRedirects": {
            "title": "Follow redirects",
            "type": "boolean",
            "description": "Follow 301, 302, 303, 307 and 308 redirects. Every hop is listed in <code>redirects</code>. When off, the 3xx response itself is returned.",
            "default": true
          },
          "maxRedirects": {
            "title": "Max redirects",
            "minimum": 0,
            "maximum": 30,
            "type": "integer",
            "description": "More redirects than this gives a TOO_MANY_REDIRECTS record (not charged).",
            "default": 10
          },
          "htmlFormat": {
            "title": "HTML output",
            "enum": [
              "markdown",
              "markdown-full",
              "text",
              "html"
            ],
            "type": "string",
            "description": "How HTML bodies are returned: Markdown of the main content (navigation, cookie banners, sidebars and footers removed; links made absolute), Markdown of the whole page, plain text, or the raw HTML.",
            "default": "markdown"
          },
          "parseJson": {
            "title": "Parse JSON",
            "type": "boolean",
            "description": "Return JSON responses as parsed values. When off, JSON is returned as text.",
            "default": true
          },
          "maxBodyTokens": {
            "title": "Max body tokens",
            "minimum": 0,
            "maximum": 1000000,
            "type": "integer",
            "description": "Cut text bodies (Markdown, text, JSON text) to about this many tokens (4 characters per token), at a paragraph, line or word boundary. <code>truncated</code> is then true and <code>bodyChars</code> gives the full length. 0 = no token limit.",
            "default": 8000
          },
          "maxBodyChars": {
            "title": "Max body characters",
            "minimum": 0,
            "maximum": 10000000,
            "type": "integer",
            "description": "Optional hard character limit for text bodies. When both limits are set, the smaller applies. 0 = no character limit.",
            "default": 0
          },
          "maxResponseMb": {
            "title": "Max response size (MB)",
            "minimum": 1,
            "maximum": 50,
            "type": "integer",
            "description": "Download at most this much of each body. Larger bodies are cut and marked <code>truncated</code>; cut binaries are not stored.",
            "default": 10
          },
          "storeBinary": {
            "title": "Store binary bodies",
            "type": "boolean",
            "description": "Save images, PDFs and other binary bodies to the run's key-value store and return <code>bodyUrl</code>. When off, only their size and type are returned.",
            "default": true
          },
          "session": {
            "title": "Keep cookies across requests",
            "type": "boolean",
            "description": "When on, cookies set by one response are sent with later requests in this run (like a browser session). When off, each request starts without cookies.",
            "default": false
          },
          "verifyTls": {
            "title": "Verify TLS certificates",
            "type": "boolean",
            "description": "Reject servers with invalid, expired or self-signed certificates (TLS_FAILED). Turn off only for servers you trust.",
            "default": true
          },
          "maxConcurrency": {
            "title": "Max concurrency",
            "minimum": 1,
            "maximum": 20,
            "type": "integer",
            "description": "Requests in flight at the same time. Lowered automatically if large bodies would not fit in the run's memory.",
            "default": 5
          },
          "healthMethod": {
            "title": "Health check method",
            "enum": [
              "GET",
              "HEAD"
            ],
            "type": "string",
            "description": "url-health mode only. GET is the most reliable (some servers mishandle HEAD); the body is never downloaded either way.",
            "default": "GET"
          },
          "tlsWarningDays": {
            "title": "TLS expiry warning (days)",
            "minimum": 0,
            "maximum": 365,
            "type": "integer",
            "description": "url-health mode: <code>tlsExpiringSoon</code> is true when the certificate expires in fewer days than this.",
            "default": 14
          }
        }
      },
      "runsResponseSchema": {
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "actId": {
                "type": "string"
              },
              "userId": {
                "type": "string"
              },
              "startedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "finishedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "status": {
                "type": "string",
                "example": "READY"
              },
              "meta": {
                "type": "object",
                "properties": {
                  "origin": {
                    "type": "string",
                    "example": "API"
                  },
                  "userAgent": {
                    "type": "string"
                  }
                }
              },
              "stats": {
                "type": "object",
                "properties": {
                  "inputBodyLen": {
                    "type": "integer",
                    "example": 2000
                  },
                  "rebootCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "restartCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "resurrectCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "computeUnits": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "options": {
                "type": "object",
                "properties": {
                  "build": {
                    "type": "string",
                    "example": "latest"
                  },
                  "timeoutSecs": {
                    "type": "integer",
                    "example": 300
                  },
                  "memoryMbytes": {
                    "type": "integer",
                    "example": 1024
                  },
                  "diskMbytes": {
                    "type": "integer",
                    "example": 2048
                  }
                }
              },
              "buildId": {
                "type": "string"
              },
              "defaultKeyValueStoreId": {
                "type": "string"
              },
              "defaultDatasetId": {
                "type": "string"
              },
              "defaultRequestQueueId": {
                "type": "string"
              },
              "buildNumber": {
                "type": "string",
                "example": "1.0.0"
              },
              "containerUrl": {
                "type": "string"
              },
              "usage": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "integer",
                    "example": 1
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "usageTotalUsd": {
                "type": "number",
                "example": 0.00005
              },
              "usageUsd": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "number",
                    "example": 0.00005
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}