Anthropic
AI research company that makes the Claude models, the Claude apps and the Claude API.
9 tools you can use instead of OpenAI API, ranked by live GitHub stars and npm downloads. Anthropic, Ollama and Hugging Face are the most used. Stats updated 5 hours ago.
Anthropic is the closest alternative, with the Claude API billed per token. Mistral AI and Cohere also sell API access to their own models. Together AI hosts open source models, and Ollama runs them locally for free.
The OpenAI API gives developers pay-per-token access to OpenAI's GPT model family for building AI features into their own products, separate from the consumer ChatGPT apps. As of September 2026 the current flagship family is GPT-6, offered in tiers such as Astra, Sol and Luna at different price and speed points, alongside continued access to the earlier GPT-5.6 line. There's no free tier; usage is billed per million tokens and varies by model.
It is a weaker choice for:
Most used first.
AI research company that makes the Claude models, the Claude apps and the Claude API.
Run open source AI models locally, with an optional hosted cloud and Pro plan.
Hub for open source AI models, datasets and demo apps, plus paid hosting for inference and Spaces.
French AI company building open-weight and proprietary language models, accessed via API or Le Chat.
Run and deploy machine learning models in the cloud through a simple API, billed by the second.
Enterprise-focused AI company offering language, embedding and rerank models through an API.
Cloud platform for running and fine-tuning open source AI models, with serverless inference and GPU clusters.
Desktop app for downloading and running open-weight language models locally, with a chat UI and local API.
AI-powered answer engine that searches the web and cites sources, with a free tier and paid Pro/Max plans.
| Tool | Pricing | Free plan | Paid from | Open source | GitHub stars |
|---|---|---|---|---|---|
| OpenAI API | Pay as you go | No, the API has no free tier and is billed per token from the first request | $0.10 input / $0.50 output per million tokens on GPT-6 Luna | No | 11.2k |
| Anthropic | Pay as you go | Yes, in the Claude apps. The API is billed per token. | $20 a month for Claude Pro; API from $1 per million input tokens (Haiku 4.5) | No | 2.1k |
| Ollama | Freemium | Yes, running models locally is always free | $20 a month for the Pro plan, including $60 of usage credit for cloud models | Yes, MIT | 182k |
| Hugging Face | Freemium | Yes: unlimited public model, dataset and Space hosting, free CPU and limited ZeroGPU compute | $9 a month for a PRO account | Yes, Open source libraries (e.g. Transformers) are Apache-2.0; hosted models and datasets carry their own individual licenses | 167k |
| Mistral AI | Pay as you go | Yes, in Le Chat, with limited usage and $10 a month in API credits | $5.99 a month for Le Chat Pro (student pricing), $14.99 a month standard | No | None |
| Replicate | Pay as you go | No ongoing free plan; billing is pay-as-you-go with no monthly minimum | about $0.000025 a second for small CPU instances, varying by model and hardware | No | 598 |
| Cohere | Pay as you go | Yes: evaluation API keys are free but limited in usage | $0.30 input / $0.60 output per million tokens on Command-light; current flagship Command A models are priced on request | No | None |
| Together AI | Pay as you go | Limited free credits are typically available for new accounts to try the platform | $0.09 per million input tokens (lowest-cost serverless models) | No | None |
| LM Studio | Freemium | Yes, the core app and running local models is free | Not listed | No | None |
| Perplexity AI | Freemium | Yes: free tier available with standard search and limited access to advanced features | About $20 a month (Pro plan) | No | None |
Pricing facts come from each tool's official pricing page, with the checked date on the tool's own page.
By GitHub stars, Anthropic is the most used alternative to OpenAI API listed on ScratchDB, with 2.1k stars.
Ollama and Hugging Face are open source.
Anthropic, Ollama, Hugging Face, Mistral AI, Cohere, LM Studio and Perplexity AI have a free plan. The table on this page shows what each one includes.