Skip to content

Gateways (OpenRouter, Requesty)

Gateways like OpenRouter and Requesty are not providers in their own right: one key fronts hundreds of models, with routing and billing on top. You reach them through the protocol adapters, so this page is wiring, not a new API.

Both speak the Responses protocol, so prefer it; drop to Chat Completions only for a model a gateway routes that way.

GatewaybaseUrlResponses
OpenRouterhttps://openrouter.ai/api/v1beta, stateless
Requestyhttps://router.requesty.ai/v1native via openai-responses/ ids

Responses at a gateway

Point the Responses layer’s baseUrl at the gateway; everything else is identical.

import { layer as responsesLayer } from "@effect-uai/responses"
responsesLayer({ apiKey, baseUrl: "https://openrouter.ai/api/v1" })

Chat Completions at a gateway

import { layer as chatLayer } from "@effect-uai/chat-completions/ChatCompletions"
chatLayer({
apiKey,
baseUrl: "https://openrouter.ai/api/v1",
provider: "openrouter",
extraHeaders: { "HTTP-Referer": "https://your.app", "X-Title": "Your App" },
})

Other capabilities

Both gateways clone OpenAI’s brand endpoints, so the OpenAI speech and embedding layers reach them by setting baseUrl. These are less standardized than chat: OpenRouter’s TTS returns mp3/pcm only, transcription verbose_json depends on the upstream model, and Requesty’s audio is OpenAI-models-only. Requesty exposes /v1/embeddings; OpenRouter does not.