File size: 1,521 Bytes
7a344a8
b35cede
 
 
 
7a344a8
b35cede
7a344a8
b35cede
 
 
 
 
 
7a344a8
 
b35cede
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
---
title: FreeLLMAPI Cloud Proxy
emoji: πŸ”Œ
colorFrom: indigo
colorTo: purple
sdk: docker
app_port: 7860
pinned: false
short_description: FreeLLMAPI β€” one OpenAI-compatible endpoint
tags:
  - llm
  - openai-compatible
  - proxy
  - freellmapi
---

# FreeLLMAPI β€” Cloud Proxy on Hugging Face Spaces

This Space runs [tashfeenahmed/freellmapi](https://github.com/tashfeenahmed/freellmapi) from the prebuilt image
`ghcr.io/tashfeenahmed/freellmapi:latest` β€” **no local clone, no local disk used**.

- Dashboard + API on port `7860` (HF requirement)
- SQLite DB at `/data/freellmapi.db` (ephemeral β€” see persistence note)
- Secrets (`ENCRYPTION_KEY`, admin config) are set in **Space β†’ Settings β†’ Variables and secrets**, never committed here.

## Endpoints

- Dashboard: `https://<your-space>.hf.space/`
- Health: `https://<your-space>.hf.space/api/ping`
- OpenAI-compatible: `https://<your-space>.hf.space/v1/chat/completions`

```bash
curl https://<your-space>.hf.space/v1/chat/completions \
  -H "Authorization: Bearer freellmapi-YOUR-UNIFIED-KEY" \
  -H "Content-Type: application/json" \
  -d '{"model":"auto","messages":[{"role":"user","content":"Say hello from FreeLLMAPI."}]}'
```

## First-run setup

1. Open the Space URL, create the first dashboard account (or pre-create via `FREEAPI_CONFIG_JSON`, see below).
2. Go to **Keys** page β†’ add provider keys β†’ reorder **Fallback Chain**.
3. Copy your unified `freellmapi-...` key from the Keys page header β†’ point any OpenAI SDK at the Space URL.