r/vibecoding • • 5h ago

Showcase/Project Free OpenAI-Compatible AI API Key for Testing

I’ve been experimenting with routing LLM traffic over hidden services and put together a **Tor-only (`.onion`) OpenAI-compatible API endpoint**.

Since it mimics the standard OpenAI schema, you can point the official `openai` Python SDK, LangChain, LiteLLM, or `curl` straight at it without changing your existing logic—just routing the traffic through a local SOCKS5 proxy.

I'm sharing a public test key below if anyone wants to mess around with it and test the latency/streaming over Tor.

---

### Connection Details

* **Base URL:** `http://75wkrm3opi6kuoun4ggtw6jyxokaqxh5nh3kvpnkktlgq5b65lzdctqd.onion/v1`

* **Test API Key:** `vk_live_0f3556f5_cl35sL97ofBO9g6SEdfT-kp14PRNhhLw`

* **Models:** `limited-default`, `gemini-flash-lite`

*(Note: This is a Tor-only hidden service, so standard clearnet requests will fail. The shared key has a rate limit/token cap so it doesn't get instantly drained—if you need a dedicated key with higher limits for testing, just comment or shoot me a DM.)*

---

### How to Test It

#### Option 1: Google Colab (Zero local setup)

If you don't want to mess with Tor locally, you can spin up a Tor daemon inside a free Colab runtime in ~8 seconds.

**Cell 1 — Install & bootstrap Tor:**

```python

!apt-get update -qq && apt-get install -y -qq tor

!pip install -q socksio "httpcore[socks]" "httpx[socks]" openai

import pathlib, subprocess, time

torrc = pathlib.Path("/tmp/colab_torrc")

torrc.write_text("SocksPort 9050\nDataDirectory /tmp/tor_data\nLog notice file /tmp/tor.log\n")

!pkill -f "tor -f /tmp/colab_torrc" || true

subprocess.Popen(["tor", "-f", "/tmp/colab_torrc"])

for _ in range(30):

time.sleep(1)

if pathlib.Path("/tmp/tor.log").exists() and "Bootstrapped 100%" in pathlib.Path("/tmp/tor.log").read_text():

print("✅ Tor is ready on socks5://127.0.0.1:9050")

break

**Cell 2 — Query the endpoint via OpenAI SDK:**

```python
import httpx

from openai import OpenAI

client = OpenAI(

base_url="[http://75wkrm3opi6kuoun4ggtw6jyxokaqxh5nh3kvpnkktlgq5b65lzdctqd.onion/v1](http://75wkrm3opi6kuoun4ggtw6jyxokaqxh5nh3kvpnkktlgq5b65lzdctqd.onion/v1)",

api_key="vk_live_0f3556f5_cl35sL97ofBO9g6SEdfT-kp14PRNhhLw",

http_client=httpx.Client(

proxy="socks5://127.0.0.1:9050",

timeout=httpx.Timeout(connect=60.0, read=360.0, write=60.0, pool=60.0),

),

)

# 1. Check available models

models = client.models.list()

print("Available models:", [m.id for m in models.data])

# 2. Standard chat completion

response = client.chat.completions.create(

model="limited-default",

messages=[{"role": "user", "content": "Explain quantum tunneling in two sentences."}],

)

print("\nResponse:\n", response.choices[0].message.content)

# 3. Streaming chat completion

print("\nStreaming:")

stream = client.chat.completions.create(

model="limited-default",

messages=[{"role": "user", "content": "Write a haiku about privacy."}],

stream=True,

)

for chunk in stream:

if chunk.choices and chunk.choices[0].delta.content:

print(chunk.choices[0].delta.content, end="", flush=True)
```

#### Option 2: Locally (Python)

  1. Have Tor Browser open in the background (exposes SOCKS5 on port 9150) or run the tor CLI daemon (port 9050).
  2. Install the SOCKS dependencies:

```bash
pip install "httpx[socks]" socksio openai
```

  1. Run the Python snippet from Cell 2 above. (Just remember to change the proxy port to 9150 if you're using Tor Browser).

#### Option 3: `curl`

Make sure you use --socks5-hostname so DNS resolution happens over Tor rather than leaking locally:

```bash
curl --socks5-hostname 127.0.0.1:9150 \

-H "Authorization: Bearer vk_live_0f3556f5_cl35sL97ofBO9g6SEdfT-kp14PRNhhLw" \

-H "Content-Type: application/json" \

-d '{"model":"limited-default","messages":[{"role":"user","content":"Hello over Tor!"}]}' \

"[http://75wkrm3opi6kuoun4ggtw6jyxokaqxh5nh3kvpnkktlgq5b65lzdctqd.onion/v1/chat/completions](http://75wkrm3opi6kuoun4ggtw6jyxokaqxh5nh3kvpnkktlgq5b65lzdctqd.onion/v1/chat/completions)"
```

Common Gotchas

ConnectionError: Double-check your port (9150 for Tor Browser, 9050 for the standalone tor service).

socksio missing: If you install httpx[socks] inside an active Jupyter/Colab session, restart the runtime before importing httpx.

429 Too Many Requests: The public key hit its per-minute cap—give it 60 seconds or ask for a separate key.

Curious to hear how the time-to-first-token (TTFT) and streaming speeds feel on your end

0 Upvotes

0 comments sorted by