Worklog — OpenAI-Compatible Gateway

Native engine: Val Town std/openai (ValTownOpenAI proxy, ambient valtown token, no external key).

#StageStatus
Environment discovery (native AI, no keys)std/openai found (ValTownOpenAI)
1Generated gateway key, stored PROVIDER_API_KEYsk-q7X2mN9vTzQ4rL8pKc3eF6sUa1dB5hYw
2lib/bridge.ts — bridge, sanitizer, clamp, auto-heal, SSE
3main.ts http router (/api/provider/v1/*, config, /health, assets)
4Frontend RTL / (playground, info, snippets, usage)
5curl / fetch — 401 on missing key✅ verified
6curl / fetch — 200 + SSE streaming (data:[DONE])✅ verified
7Non-streaming 200 + usage✅ verified
8Endpoints: /health, /models, /config, /, /app.ts✅ verified
9Subdomain openai-gateway-city.val.run

Verification evidence

  • GET /health{"status":"ok","service":"internal-bridge"}
  • GET /api/provider/v1/models → OpenAI object:"list", id:"gpt-5.4-nano"
  • POST /v1/chat/completions without key → 401 (OpenAI error shape)
  • POST with key + stream:true200 Content-Type: text/event-stream, token-by-token data: {...} chunks ending data: [DONE]
  • POST with key + stream:false200 {"content":"نعم","usage":{...}}
  • / serves lang="ar" dir="rtl" HTML; /app.ts transpiles to text/javascript