Back to articles
11 Free AI APIs You Can Use Without Paying OpenAI

11 Free AI APIs You Can Use Without Paying OpenAI

via Dev.to PythonAlex Spinov

OpenAI costs money. Claude costs money. But there are genuinely free AI APIs that are surprisingly good. I've tested all of these. Here are the ones worth your time. 1. Hugging Face Inference API — Free Tier 30+ model types: text generation, summarization, translation, image generation. import requests API_URL = " https://api-inference.huggingface.co/models/facebook/bart-large-cnn " headers = { " Authorization " : " Bearer hf_YOUR_FREE_TOKEN " } def summarize ( text ): response = requests . post ( API_URL , headers = headers , json = { " inputs " : text }) return response . json ()[ 0 ][ " summary_text " ] print ( summarize ( " Your long article text here... " )) Free tier: 30K characters/month. Good enough for side projects. 2. Google Gemini API — Free Tier Google's answer to GPT-4. Free tier is generous. import requests url = " https://generativelanguage.googleapis.com/v1beta/models/gemini-pro:generateContent " params = { " key " : " YOUR_FREE_KEY " } data = { " contents " : [{ " par

Continue reading on Dev.to Python

Opens in a new tab

Read Full Article
5 views

Related Articles