# Why does my Python API client send extra requests after a single failure?

I work on CloudGPU. Check for two retry owners: the SDK and your application. A single call in your code can become several HTTP attempts if both layers retry. In the OpenAI Python SDK, `max_retries=0` disables its automatic retries so an application can make that policy explicit.

## 1. Find both layers before changing the prompt

Search the call path for an outer retry decorator, queue redelivery and SDK configuration. The official SDK documentation describes two automatic retries by default for eligible errors. That is a client-library behavior, not evidence that a model endpoint offers an idempotency contract.

Do not infer an HTTP attempt count from the number of calls you can see at the application level. Record a local operation ID and an attempt counter without recording credentials or prompt contents.

## 2. Configure one request boundary

Set `${CLOUDGPU_API_KEY}` and `${CLOUDGPU_BASE_URL}` in your process environment using your normal secret-handling method. The base value must be the current API base from the CloudGPU documentation, including its version prefix. Do not append that prefix twice, put a secret into source code, or commit a session environment.

This example deliberately has no outer retry loop:

```python
import os
from openai import OpenAI, APIConnectionError, APIStatusError


def request_once():
    with OpenAI(
        api_key=os.environ["CLOUDGPU_API_KEY"],
        base_url=os.environ["CLOUDGPU_BASE_URL"],
        max_retries=0,
    ) as client:
        try:
            result = client.chat.completions.create(
                model="deepseek-v4-flash",
                messages=[{"role": "user", "content": "Name one Python collection."}],
            )
        except APIStatusError as failure:
            print({"http_status": failure.status_code})
            raise SystemExit(1) from None
        except APIConnectionError:
            print({"state": "no confirmed response"})
            raise SystemExit(1) from None
        if not result.choices:
            raise SystemExit("Response has no choices")
        print(result.choices[0].message.content)


if __name__ == "__main__":
    request_once()
```

This is a live-call recipe for a separately approved request, not a test performed during preparation. It does not disable retries in a reverse proxy or another process. Record the installed SDK version with `python3 -m pip show openai` when diagnosing a real integration.

## 3. Add an application policy only after defining the operation

If the application owns retries, define a bounded attempt count, cancellation behavior and which response categories are eligible. A timeout leaves the remote outcome uncertain. Do not borrow the GPU Jobs idempotency contract for a chat request merely because both APIs accept HTTP traffic. For a rejected configuration or invalid key, correct the underlying cause rather than repeating the same request.

Official references: [SDK retry configuration](https://github.com/openai/openai-python#retries) and [CloudGPU API contract and error codes](https://cloudgpu.app/api/docs?utm_source=hashnode&utm_medium=article&utm_campaign=202611_seg06_indiedev_api&utm_content=geoextra1111_04_retries). The model identifier above was present in today's public model catalog; recheck the catalog before a later live call.

Related CloudGPU video: **This Video Was Made by AI. Now Run AI Yourself**. It introduces the compute context; it does not demonstrate this SDK failure path.

%[https://www.youtube.com/watch?v=lS1mz_gTIV4]

Only local syntax checks were performed. No model request or retry experiment was sent, and no service result is claimed.

