Skip to content

USE CASE / DEVICES & TOOLS

AI application connectivity proxy workflows

Test network behavior in an AI application with non-sensitive requests, deterministic fixtures, and a clear separation between model output and connection errors.

In this guide

WORKFLOW SNAPSHOT

  • Validate how your application handles a timeout, reconnect, and successful response through a supported route.
  • Suggested starting behavior: Static assignment
  • Validate the real application and destination

A practical AI application connectivity workflow

Validate how your application handles a timeout, reconnect, and successful response through a supported route.

  • Use a small fixed test prompt without private user data.
  • Record request identifiers and redacted timing information.
  • Assert the application’s retry budget and error handling.

Why keep AI application recovery tests on a stable assignment?

Keep the route stable while testing timeouts, reconnects and successful responses. Use a fixed non-sensitive fixture so model variation does not become the explanation for a network change. Routing and model-output quality are independent variables.

What should an AI client prove before increasing request volume?

A proxy does not improve model quality or remove service limits. Unbounded retries can duplicate work and consume usage without fixing a network issue.

Test response completeness and application recovery in addition to basic connectivity.

Verify the AI application connectivity connection boundary

Record the client version, completion state, redacted request identifier and retry budget. An uncertain timeout after submission may represent work that already completed; unbounded retries can multiply usage without resolving the failure.

Check an AI client's deterministic JSON fixture

Fetch a deterministic AI-client fixture and record the HTTP response before testing timeout and reconnect handling in the application.

  1. 01
    Generate your endpoint

    Choose HTTP / HTTPS and Sticky session for the complete workflow in Configure proxies.

  2. 02
    Set your proxy URL

    Set PS_PROXY_URL to http://USERNAME:PASSWORD@HOST:PORT using your generated endpoint. For IP authentication, whitelist your machine and use http://HOST:PORT. Percent-encode special characters in credentials; these are proxy credentials, separate from your account password or API key.

  3. 03
    Choose the destination

    Set PS_TARGET_URL before running the code. Use an existing read-only JSON fixture that your AI application team controls or has approved, with a deterministic non-sensitive body and no secret query parameters.

    Example URL · replace placeholders with your targethttps://example.com/qa/ai-client-response.json

    Set PS_EXPECT_TEXT to the deterministic expected result or fixture version. This optional check inspects the returned text without running JavaScript.

ps_ai_dev.pyFetch a deterministic AI-client fixture and record the HTTP response before testing timeout and reconnect handling in the application.
Before you runPython 3.10+ · python -m pip install requests · python ps_ai_dev.py
# Fetch a deterministic AI-client fixture and record the HTTP response before testing timeout and reconnect handling in the application.
# Use an existing read-only JSON fixture that your AI application team controls or has approved, with a deterministic non-sensitive body and no secret query parameters.
import hashlib
import json
import os
import time
from pathlib import Path
from urllib.parse import urlsplit

import requests

class InspectSession(requests.Session):
    # Leave redirect bodies streamed instead of preparing the next request.
    def resolve_redirects(self, *args, **kwargs):
        return iter(())

proxy = os.environ["PS_PROXY_URL"]  # HTTP endpoint from ProxySight
target = os.environ["PS_TARGET_URL"]  # https://example.com/qa/ai-client-response.json
if urlsplit(proxy).scheme != "http":
    raise ValueError("Use your generated HTTP proxy endpoint for this example.")
if urlsplit(target).scheme not in ("http", "https"):
    raise ValueError("PS_TARGET_URL must be an HTTP or HTTPS URL.")

with InspectSession() as client:
    client.trust_env = False  # No ambient proxy, NO_PROXY or netrc overrides
    started = time.monotonic()
    with client.get(
        target,
        proxies={"http": proxy, "https": proxy},
        headers={"Accept-Language": "en-US,en;q=0.9"},
        timeout=(10, 20), allow_redirects=False, stream=True,
    ) as response:
        body = bytearray()
        for chunk in response.iter_content(16384):
            body.extend(chunk)
            if len(body) > 1048576:
                raise RuntimeError("Response exceeds this example's 1 MiB limit.")
        Path("ai-client-baseline.json").write_bytes(body)
        print(json.dumps({
            "workflow": "ai-dev", "status": response.status_code,
            "elapsed_ms": round((time.monotonic() - started) * 1000),
            "bytes": len(body), "sha256": hashlib.sha256(body).hexdigest(),
            "headers": {name: response.headers.get(name) for name in ['Content-Type', 'Retry-After', 'X-RateLimit-Remaining']},
        }, indent=2))
        expected = os.getenv("PS_EXPECT_TEXT", "")
        if expected:
            text = body.decode(response.encoding or "utf-8", errors="replace")
            print("Expected text:", "found" if expected in text else "absent")
        # A 200 status alone does not prove the intended page was returned.
        # Inspect redirects, login prompts, 403 and 429 before another request.
Understand the result

Verify the expected fixture value, JSON structure and completion of the saved body. One successful GET does not inject a timeout, exercise retries, consume a model stream or evaluate answer quality; run those cases through the actual application with its supported client configuration.

Response bodies are limited to 1 MiB for a small diagnostic. TLS verification stays enabled; redirects are left for you to inspect. Connection guide

Example: test timeout and recovery with a deterministic fixture

Use a fixed non-sensitive input, a named model configuration where relevant, and a small bounded request budget. Separate connection failure, incomplete response, and application assertion failures.

An uncertain response should not trigger unlimited retries. Record completion and available request identifiers so the application can distinguish a failed connection from work that may already have completed.

Illustrative observation record · replace with your test data
{
  "fixture": "NON_SENSITIVE_FIXTURE",
  "client_version": "RECORD_VERSION",
  "completion": "RECORD_STATE",
  "retry_count": "RECORD_COUNT"
}

AI application connectivity verification checklist

For this AI application connectivity workflow, record fixture, network and recovery alongside the actual result. Use the evidence below to decide whether another observation is comparable before increasing the workload.

CheckpointHold constant or recordExpected evidence
FixtureFixed input and model settingsComparable request
NetworkClient, timeout, and routeConnection behavior observed
RecoveryRetry budget and completion statePredictable application handling

Troubleshoot AI application connectivity results and connection errors

SymptomCheck nextWhat the result tells you
Output changesCompare model and input settingsNot necessarily routing
Timeout after submissionInspect completion and identifiersWork may have been performed
Retries multiplyCheck budget and stopping ruleApplication control issue

Measure AI request completion and retry behavior separately

Run one bounded fixture through the application’s real client stack. Assert expected recovery behavior and count attempts. Compare the same scenario directly and through the supported endpoint, separating connection failure, incomplete response and an application assertion failure.

A LITTLE CLARITY

Common questions.

Will rotating exits improve AI response quality?

No. Routing and model output quality are separate concerns.

What is the useful distinction between the two AI use-case guides?

This guide tests application connectivity and recovery; the research-data guide covers provenance, data rights, and ingestion quality.

What should an AI client prove before increasing request volume?

Record the client version, completion state, redacted request identifier and retry budget. An uncertain timeout after submission may represent work that already completed; unbounded retries can multiply usage without resolving the failure.

PUT THE KNOWLEDGE TO WORK

Your workflow.
Your next connection.

Try the controls, choose your IP behavior, and start with one clear connection check.

Explore the configurator ↗