Can't access to dalle3 using the openai api

When I call this method:

                openai.api_key = self.personality_config.config["openai_key"]
                response = openai.images.generate(
                    prompt=self.previous_sd_positive_prompt.strip(),
                    quality="standard",
                    size=f"{self.personality_config.width}x{self.personality_config.height}",
                    n=1,
                    )

I get this error:
h11._util.LocalProtocolError: Illegal header value b’Bearer ’