#How to fix this error in OpenAI Agents SDK
24 messages · Page 1 of 1 (latest)
There's an OpenAI Discord with lots of experts troubleshooting it?
❌ @primal patrol you are not allowed to share Discord invites in this channel.
❌ @primal patrol you are not allowed to share Discord invites in this channel.
I get what the bot is doing, we don't want to see jerks advertise but dang it's out of context on this one. LOL
discord.gg/CnaMJsSt
Can you share your code
I just checked and I can get the OpenAI package to connect to Gemini
it is the code
-# :warning: Files from unknown sources can be dangerous. Download with care. :warning:
pls man @limpid star do soemthing it is now midnight
my laptop is running down and i can't do like chainlit UI is showing but when I typed anythign it just didn't response to me
Is that code giving errors or just not responding?
I'll be honest, you may just be jumping into the deep end too fast. I've got Gemini working with openai using this script:
from openai import OpenAI
client = OpenAI(
api_key="GEMINI_TOKEN",
base_url="https://generativelanguage.googleapis.com/v1beta/openai/"
)
response = client.chat.completions.create(
model="gemini-2.5-flash",
messages=[
{"role": "system", "content": "You are a helpful assistant."},
{
"role": "user",
"content": "Explain to me how AI works"
}
]
)
print(response.choices[0].message)
Dead simple, doesn't do anything but connect to Gemini and get a response to a simple prompt.
Go step by step and build up to the working thing you want
thing was that it is like not answering to my questions in Chainlit
"error": {
"message": "Incorrect API key provided: sk-fakek**************cdef. You can find your API key at https://platform.openai.com/account/api-keys.",
"type": "invalid_request_error",
"param": null,
"code": "invalid_api_key"
this is the error
I assume you read the error message and checked your api key?