•   5 months ago

API key not working

I tried to run:
curl -i -X POST \
https://engine.prod.bria-api.com/v2/image/generate \
-H 'Content-Type: application/json' \
-H 'api_token: MY_KEY' \
-d '{
"prompt": "A photorealistic, high-resolution rendering of balloon lettering spelling out \"HAPPY NEW YEAR 2026\" against a pristine white backdrop. The balloons are meticulously crafted with a metallic, reflective surface, showcasing a vibrant color palette of Pantone Bran, Crocus, and Deja vu blue. The composition is perfectly aligned and balanced, emphasizing the celebratory message with natural, soft lighting that creates subtle, elegant reflections and shadows."
}'

from https://docs.bria.ai/image-generation/v2-endpoints/image-generate in many ways. I did add my production api key (I tried other 3 as well) in place of "MY_KEY" but it doesn't work. I tried python code too, but still get:
{
"error": {
"code": 401,
"message": "The server could not verify that you are authorized to access the URL requested. You either supplied the wrong credentials (e.g. a bad password), or your browser doesn't understand how to supply the credentials required.",
"details": "401 Unauthorized: The server could not verify that you are authorized to access the URL requested. You either supplied the wrong credentials (e.g. a bad password), or your browser doesn't understand how to supply the credentials required."
},
"request_id": "35cd41a1024a462097ec21a5a004f103"
}

It worked via playground but not via api.

  • 1 comment

  • Manager   •   5 months ago

    Hi Nishtha, there might be an issue with your API key. It could be an extra space or something similar. If you’re unable to resolve it, we’ll have an office hour on Thursday and ill try to help you with it

Comments are closed.