# HTTP 402 Payment Required (CreditsExceededError) when using webrtc-gpu-medium on Research Plan

**URL:** <https://discuss.roboflow.com/t/http-402-payment-required-creditsexceedederror-when-using-webrtc-gpu-medium-on-research-plan/11853>\
**Category:** 🤝  Community Help\
**Created:** [February 11, 2026, 10:15am UTC](https://discuss.roboflow.com/t/http-402-payment-required-creditsexceedederror-when-using-webrtc-gpu-medium-on-research-plan/11853 "2026-02-11T10:15:11Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Zibbberk](https://yyz1.discourse-cdn.com/flex029/user_avatar/discuss.roboflow.com/zibbberk/32/8932_2.png) [@Zibbberk](https://discuss.roboflow.com/u/Zibbberk)\
**Post date:** [February 11, 2026, 10:15am UTC](https://discuss.roboflow.com/t/http-402-payment-required-creditsexceedederror-when-using-webrtc-gpu-medium-on-research-plan/11853/1 "2026-02-11T10:15:11Z")

</div>

Hi everyone,

I am experiencing a sudden issue with cloud-hosted inference.

**The Situation:**

I am streaming video from a Raspberry Pi to Roboflow using inference\_sdk with webrtc-gpu-medium.

- **Yesterday:** This exact code worked perfectly on my Research Plan.

- **Today:** The exact same code fails immediately with an HTTP 402 Payment Required error.

**Context:**

- **Plan:** Research Plan

- **Credits:** Dashboard shows ~50 credits remaining (0.6 used).

- **Code:** No changes were made to the code between yesterday (working) and today (broken).

**Code:**

```python
import cv2
import sys
import os
from inference_sdk import InferenceHTTPClient
from inference_sdk.webrtc import WebcamSource, StreamConfig, VideoMetadata

# --- CONFIGURATION ---
# API Key hidden for security
API_KEY = "YOUR_API_KEY"

# Initialize client
client = InferenceHTTPClient.init(
    api_url="https://serverless.roboflow.com",
    api_key=API_KEY
)

# Configure video source
# On Pi Camera 3, we often need libcamerify
source = WebcamSource(resolution=(1280, 720))

# Configure streaming options
config = StreamConfig(
    stream_output=["output_image"],
    data_output=["output_deduplicated", "count_objects", "predictions"],
    requested_plan="webrtc-gpu-medium", # Options: webrtc-gpu-small, webrtc-gpu-medium, webrtc-gpu-large
    requested_region="eu",
)

# Create streaming session
session = client.webrtc.stream(
    source=source,
    workflow="your-workflow-id", # Replaced specific workflow ID
    workspace="your-workspace-id", # Replaced specific workspace ID
    image_input="image",
    config=config
)

# Handle incoming video frames
@session.on_frame
def show_frame(frame, metadata):
    # Only show popup window if a monitor is attached (avoids crash on SSH)
    if os.environ.get('DISPLAY') is not None:
        cv2.imshow("Workflow Output", frame)
        if cv2.waitKey(1) & 0xFF == ord("q"):
            session.close()

# Handle prediction data
@session.on_data()
def on_data(data: dict, metadata: VideoMetadata):
    # Print counts to terminal
    if "count_objects" in data:
        print(f"Frame {metadata.frame_id}: Counts: {data['count_objects']}")
    else:
        print(f"Frame {metadata.frame_id}: {data}")

# Run the session
print("Stream starting... Press Ctrl+C to stop.")
try:
    session.run()
except KeyboardInterrupt:
    print("\nStopping...")
    session.close()

```

**The Error:**

```auto
RuntimeError: Failed to initialize WebRTC session (HTTP 402).
Response: {"message":"Not enough credits to perform this request.","error_type":"CreditsExceededError"}

```

**My Question:**

Since this was working fine yesterday and I still have credits displayed on my dashboard, I am confused why it is now throwing a payment error?

 ![Screenshot 2026-02-11 101143](https://canada1.discourse-cdn.com/flex029/uploads/roboflow1/original/2X/e/e32868a9fbf87196831ad3b76ed67832d623da67.png)

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex029/uploads/roboflow1/original/1X/bb6edbfa56d0cf2ee603f061e9e09103502cc8cc.png) [@system](https://discuss.roboflow.com/u/system)\
**Post date:** [March 4, 2026, 10:15am UTC](https://discuss.roboflow.com/t/http-402-payment-required-creditsexceedederror-when-using-webrtc-gpu-medium-on-research-plan/11853/2 "2026-03-04T10:15:55Z")

</div>

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.
