The example REST request to the openAI compatibility endpoint from here fails with a 400:
$ curl "https://generativelanguage.googleapis.com/v1beta/openai/chat/completions" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $GEMINI_API_KEY" \
-d '{
"model": "gemini-1.5-flash",
"messages": [
{"role": "user", "content": "Explain to me how AI works"}
]
}'
[{
"error": {
"code": 400,
"message": "Request contains an invalid argument.",
"status": "INVALID_ARGUMENT"
}
}
]%
Am I doing something wrong?