The Gemini API lives at https://generativelanguage.googleapis.com/v1beta. Google's quickstart now leads with the Interactions API; the older generateContent method is what most existing code uses. Both are below.
Create a key in Google AI Studio and send it as the x-goog-api-key header. In the examples it's written {{GEMINI_API_KEY}}.
Full reference: https://ai.google.dev/gemini-api/docs
The quickstart's current form: a model and an input string.
curl https://generativelanguage.googleapis.com/v1beta/interactions \
-H "x-goog-api-key: {{GEMINI_API_KEY}}" \
-H "Content-Type: application/json" \
-d '{"model": "gemini-3.8-flash", "input": "Explain how HTTP caching works in a few words."}'
The model goes in the URL; the reply is in candidates[0].content.parts[0].text.
curl https://generativelanguage.googleapis.com/v1beta/models/gemini-3.8-flash:generateContent \
-H "x-goog-api-key: {{GEMINI_API_KEY}}" \
-H "Content-Type: application/json" \
-d '{"contents": [{"parts": [{"text": "Write a haiku about REST APIs."}]}]}'
system_instruction sits beside contents, not inside it.
curl https://generativelanguage.googleapis.com/v1beta/models/gemini-3.8-flash:generateContent \
-H "x-goog-api-key: {{GEMINI_API_KEY}}" \
-H "Content-Type: application/json" \
-d '{
"system_instruction": {"parts": [{"text": "Answer in one sentence."}]},
"contents": [{"parts": [{"text": "What is a webhook?"}]}]
}'
Every model your key can use, with token limits and supported methods.
curl https://generativelanguage.googleapis.com/v1beta/models \
-H "x-goog-api-key: {{GEMINI_API_KEY}}"