import requests
import json
response = requests.post(
url="https://openrouter.ai/api/v1/chat/completions",
headers={
"Authorization": "Bearer <sk-or-v1-
c005bd1347138e8fc89616f1fe16da4f296875ebd9e0e993364a5f1eef96ca9d>",
"Content-Type": "application/json",
"HTTP-Referer": "<YOUR_SITE_URL>", # Optional. Site URL for rankings on
openrouter.ai.
"X-Title": "<YOUR_SITE_NAME>", # Optional. Site title for rankings on
openrouter.ai.
},
data=json.dumps({
"model": "google/gemini-2.0-flash-lite-preview-02-05:free",
"messages": [
{
"role": "user",
"content": [
{
"type": "text",
"text": "What is in this image?"
},
{
"type": "image_url",
"image_url": {
"url":
"https://upload.wikimedia.org/wikipedia/commons/thumb/d/dd/Gfp-wisconsin-madison-
the-nature-boardwalk.jpg/2560px-Gfp-wisconsin-madison-the-nature-boardwalk.jpg"
}
}
]
}
],
})
)