How to call Google Gemini API

It is only one which provide free-limit used of LLMs API

Gemini API

  1. open https://aistudio.google.com/app/

Get API key

  1. click Create API key
  2. get key

3. you can test the key by curl command below

curl \
-H 'Content-Type: application/json' \
-d '{"contents":[{"parts":[{"text":"Write a story about a magic backpack"}]}]}' \
-X POST 'https://generativelanguage.googleapis.com/v1beta/models/gemini-pro:generateContent?key=YOUR_API_KEY'

change YOUR_API_KEY to you key then send it to make sure API is work fine

Get Demo Code

--

--

Wolke@林建宏 A Man Co-work with AI use coding tool
A Man Co-work with AI use coding tool

作為一名啟發者而存在。 -致力於分享經驗和知識,幫助開拓、行動、克服。 Badge: - LINE Expert - Google Developer Expert Books: - 應用詠唱釋放程式生產力 ... - 程式輕鬆入門到完整學習 ... Being: - 大學社群論壇