Repeated 403 Errors Despite Available API Credits

Despite having 4,500 API credits remaining, I am consistently receiving 403 Forbidden errors when attempting to make API calls.

Can you share an example of how you’re calling the API?

    # Build the actual user content including the image
    user_content = f"{prompt}\n<img src=\"data:image/png;base64,{image_b64}\" />"

    # Prepare headers
    headers = {
        "Authorization": f"Bearer {config['NVIDIA_API_KEY']}",
        "Accept": "application/json"
    }

    # Build JSON payload
    payload = {
        "model": "meta/llama-3.2-90b-vision-instruct",
        "messages": [
            {
                "role": "user",
                "content": user_content
            }
        ],
        "max_tokens": 20000,  
        "temperature": 1,
        "stream": False
    }

    # Make the request
    response = requests.post(config["NVIDIA_INVOKE_URL"], headers=headers, json=payload)
    response.raise_for_status()

Response
{‘error’: ‘403 Client Error: Forbidden for url: https://ai.api.nvidia.com/v1/gr/meta/llama-3.2-90b-vision-instruct/chat/completions’}

I’m able to successfully complete this request as you’ve provided it.

Can you/have you tried rotating your key? Also, can you confirm that your key starts with nvapi-?

Yes, my API key starts with “nvapi-.” After generating a new key, I receive a few responses, but then encounter a 403 error again.

Is there any per-day limit to using API credits?

1 Like

We have encountered the same issue. Any news on this?