What Is the FreeLLMAPI Base URL for OpenAI‑Compatible Endpoints?
The FreeLLMAPI base URL for OpenAI‑compatible endpoints is https://api.freellmapi.com/v1.
When integrating tashfeenahmed/freellmapi into applications that expect an OpenAI‑style interface, you must point your HTTP client to this specific gateway address. This open‑source proxy aggregates multiple large language model providers behind a single REST API, routing requests to upstream services based on your API key configuration.
Understanding the Base URL Configuration
The canonical FreeLLMAPI base URL follows the standard OpenAI versioning pattern. According to the repository’s README.md, all API requests must target https://api.freellmapi.com/v1.
This design mirrors the provider registration logic found in server/src/providers/index.ts. In that file, similar OpenAI‑compatible gateways—such as OpenCode Zen at https://opencode.ai/zen/v1—are registered using the /v1 path prefix to denote the API version. FreeLLMAPI adopts this same structure to ensure drop‑in compatibility with existing OpenAI clients.
How to Configure Your Client
To send requests through FreeLLMAPI instead of the official OpenAI servers, override the basePath (legacy SDK) or baseURL (modern SDK) during client initialization while retaining the standard endpoint paths.
TypeScript and JavaScript Example
import { OpenAIApi } from "openai";
const client = new OpenAIApi({
apiKey: "your-free-llmapi-key",
basePath: "https://api.freellmapi.com/v1",
});
const response = await client.chat.completions.create({
model: "openai-fast",
messages: [{ role: "user", content: "Hello!" }],
});
console.log(response);
cURL HTTP Request
curl https://api.freellmapi.com/v1/chat/completions \
-H "Authorization: Bearer YOUR_FREE_LLMAPI_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "openai-fast",
"messages": [{"role":"user","content":"Hello!"}]
}'
Supported Endpoints and Request Routing
In server/src/lib/proxy.ts, the server handles incoming paths such as /v1/chat/completions and /v1/models by forwarding them to the appropriate upstream provider. This means any client expecting the standard OpenAI REST contract can communicate with FreeLLMAPI by simply changing the host to api.freellmapi.com while maintaining the /v1/* path structure.
The proxy logic inspects the request route and API key to determine which backend service should fulfill the request, allowing a single base URL to access multiple underlying LLM providers.
Summary
- FreeLLMAPI base URL:
https://api.freellmapi.com/v1is the root address for all OpenAI‑compatible calls. - Configuration: Set your client’s
baseURL(orbasePath) to this address and use your FreeLLMAPI key for authentication. - Routing: The file
server/src/lib/proxy.tsforwards standard OpenAI endpoints—such as/v1/chat/completions—to the correct upstream provider based on your API key. - Pattern Consistency: As shown in
server/src/providers/index.ts, the/v1suffix follows the same convention used by other OpenAI‑compatible gateways in the codebase.
Frequently Asked Questions
What endpoints should I append to the FreeLLMAPI base URL?
You should use standard OpenAI path prefixes such as /v1/chat/completions, /v1/models, and /v1/completions. The proxy handler in server/src/lib/proxy.ts routes these requests to the appropriate backend provider while maintaining full API compatibility.
Can I use the new OpenAI SDK v4 with FreeLLMAPI?
Yes. While older code samples may use the basePath property, modern SDK versions require setting baseURL: "https://api.freellmapi.com/v1" in the configuration constructor. The underlying HTTP interface remains identical because the server implements the OpenAI REST specification.
Does FreeLLMAPI support streaming responses?
Yes. Because server/src/lib/proxy.ts forwards requests to upstream providers that support Server‑Sent Events (SSE), you can set stream: true in your request body when calling /v1/chat/completions. Consume the chunked response exactly as you would with the official OpenAI endpoint.
Where is the base URL documented in the source code?
The public endpoint https://api.freellmapi.com/v1 is explicitly documented in the repository’s README.md. Additionally, the architectural pattern for provider‑specific base URLs is visible in server/src/providers/index.ts, where external services are registered with their respective /v1 endpoints.
Have a question about this repo?
These articles cover the highlights, but your codebase questions are specific. Give your agent direct access to the source. Share this with your agent to get started:
curl -s "https://instagit.com/install.md" Maintain an open-source project? Get it listed too →