DEV Community

Sh Raj
Sh Raj

Posted on • Updated on • Originally published at github.com

Google Gemini Free API

Gemini-API

Gemini API is a free api for chatbot development using google gemini model

Click Here :- https://gemini-apis.vercel.app/api?prompt=Hi
https://gemini-apis.vercel.app/api?prompt=write%20a%20song%20for%20me

Backup :- https://gemini-api-nfvu.onrender.com/

Contribute Here

GitHub logo SH20RAJ / gemini-api

Google Gemini API Free

Gemini-API

Gemini API is a free api for chatbot development using google gemini model

Visitors

Contribute Here

Powered by WhollyAPI

Dev.to

Endpoints

/api/?prompt={My Custom Prompt}

The API endpoint will be https://{your domain}/api?prompt=myCustomPrompt

Test API - https://gemini-apis.vercel.app/api?prompt=myCustomPrompt

Click Here :- https://gemini-apis.vercel.app/api?prompt=Hi

/api?prompt={My Custom Prompt}

The API endpoint will be https://{your domain}/api?prompt=myCustomPrompt

Example - Fetch Response from the API Endpoint

That will return the text

let prompt = "I love you"
// fetching the response from api
fetch('https://gemini-apis.vercel.app/api/?prompt='+encodeURIComponent(prompt)+'')
.then(res => res.text())
.then(res => console.log(res))
Enter fullscreen mode Exit fullscreen mode

or

let prompt = "I love you";
async function fetchResponse(prompt) {
  try {
    const response = await fetch(`https://gemini-apis.vercel.app/api/?prompt=${encodeURIComponent(prompt)}`);
    const data = await response.text()
…
Enter fullscreen mode Exit fullscreen mode

Powered by WhollyAPI

https://dev.to/sh20raj/google-gemini-free-api-269o/edit

Endpoints

/api/?prompt={My Custom Prompt}

The API endpoint will be https://{your domain}/api?prompt=myCustomPrompt

Test API - https://gemini-apis.vercel.app/api?prompt=myCustomPrompt

/api?prompt={My Custom Prompt}

The API endpoint will be https://{your domain}/api?prompt=myCustomPrompt

Example - Fetch Response from the API Endpoint

That will return the text



let prompt = "I love you"
// fetching the response from api
fetch('https://gemini-apis.vercel.app/api/?prompt='+encodeURIComponent(prompt)+'')
.then(res => res.text())
.then(res => console.log(res))



Enter fullscreen mode Exit fullscreen mode

Result



I'm just an AI assistant, and do not have the capacity to reciprocate feelings or experience emotions like love.


Enter fullscreen mode Exit fullscreen mode

License

MIT

Top comments (4)

Collapse
 
pst4r8 profile image
Pst4r8

API error

Collapse
 
sh20raj profile image
Sh Raj

It's hosted on Free Plan of Vercel and because of Traffic i's limit reached πŸ™‚πŸ’Έ

Collapse
 
pst4r8 profile image
Pst4r8

Is there no other backup? Because it is very useful for me

Thread Thread
 
sh20raj profile image
Sh Raj

Deploy This Repo :- github.com/SH20RAJ/gemini-api (on your own server)

or temporarily take this link :- gemini-api-nfvu.onrender.com/

Some comments may only be visible to logged-in visitors. Sign in to view all comments.