Gateway request path
SkillDatabases & dataGuides your agent to edit the request-handling code of an LLM gateway, including routing, streaming, and logging.
Use Gateway request path in Claude, ChatGPT or Ahel Desktop
Free. Sign in, add Gateway request path and connect your AI. About a minute.
Also: Claude Code · Cursor · Codex
Then ask your AI: use the Gateway request path skill
Details
Instructions available. Your AI can read the instructions. Execution depends on the setup they require.
Account requirements not reviewed. Check the skill instructions before use; ahel provides instructions and does not run this skill.
No other account needed.
Add ahel to your AI once: Claude, ChatGPT, Cursor, Claude Code or Codex. Then ask it to use this.
About this skill
Change the LLM Gateway request path in apps/gateway, chat and other endpoints, routing and provider selection, error and finish-reason classification, streaming, request logging, Redis use, user-supplied content URLs, and graceful shutdown. Use when editing apps/gateway/src or packages/actions requ
What this skill tells your AI
The instructions your AI receives, as published by theopenco/llmgateway in .agents/skills/gateway/SKILL.md and read by ahel’s review.
The gateway is latency-critical and high-throughput.
Hot path
- Read no
logrows on the request path, however narrow the query or short the cache. Credit gates, spend and limit checks, and routing signals come from Redis counters maintained on the write path (incremented atinsertLog, settled by the billing worker) or small cached rows. - Route on the capability field curated for it (
supportedToolChoices,serviceTiers,supportsAssistantPrefill, …).supportedParametersis a partial list.
User-supplied URLs
Fetch every content URL from a request body through processImageUrl
(packages/actions/src/process-image-url.ts), or for non-image content
assertSafeUserContentUrl from @llmgateway/shared/url-safety-node followed by
a redirect: "error" fetch. Keep validateSsrf on; only trusted
provider-response URLs pass validateSsrf: false. The guard enforces
https-only in every environment, blocks internal hosts and private, reserved,
link-local, metadata, and IPv4-mapped IPv6 addresses, and refuses redirects.
When the guard rejects a URL, fail the request; forwarding it upstream lets the
provider fetch what we refused. Route every non-data: URL through the guard
wherever remote content is inlined (e.g. requiresBase64Images mappings).
Errors
Keep apps/gateway/src/chat/tools/get-finish-reason-from-error.ts conservative.
Generic 4xx wording such as "X is not supported for this model" or
unsupported_content_type stays a client error: users sending wrong requests
produce the same text, and reclassifying it triggers pointless fallback. When a
deployment rejects a capability the catalogue claims, fix that mapping's flag in
packages/models (e.g. vision: false). If asked for a broad reclassification,
raise the misclassification risk and confirm first.
Logging, streaming, shutdown
- Pass
{ retentionLevel }to everyinsertLogcall; the one-argument form drops payloads for retaining orgs. - Log a pre-provider rejection in
chat.tswithlogGatewayRejectionbefore throwing;app.onErrorwrites no log. - Import
streamSSEfromapps/gateway/src/lib/pending-work.ts, nothono/streaming, so graceful shutdown waits for the billing tail. - From response-lifecycle callbacks (
closehandlers, middlewarefinally), send Redis commands throughredisClient.pipeline().<cmd>().exec(). An auto-pipelined bare command there can wedge the shared client.
Signals
- GitHub stars
- 2k
- Forks
- 190
- Last commit
- Sep 2026
Advanced
- Item type
- skill
- Key
gateway-theopenco- Source
- github.com/theopenco/llmgateway
github.com/theopenco/llmgateway
More in Databases & data
Skill · supabase
More in Databases & dataconnect
Skill · composiohq
More in Databases & dataanalytics
Skill · coreyhaines31
More in Databases & dataazure-kusto
Skill · microsoft
More in Databases & dataagentic-os
Skill · affaan-m
More in Databases & dataai-regression-testing
Skill · affaan-m
More in Databases & data