gateway.ts
import OpenAI from "openai"
 
const client = new OpenAI({
baseURL: "https://hypery.ai/v1",
apiKey: process.env.GATEWAY_API_KEY,
})
 
const res = await client.chat.completions.create({
model: "anthropic/claude-3.5-sonnet",
messages: [{ role: "user", content: "explain quantum computing" }],
stream: true,
})
 

providers

every provider behind one url

route to the model you want without wiring a client per provider. the gateway handles keys, routing, and fallbacks.

01

openrouter

200+ language models and the default routing target.

02

replicate

image, video, audio, and 3d models via /v1/predictions.

03

huggingface

open models served through the same /v1 surface.

04

vercel ai gateway

additional catalog routed through hypery's endpoint.

capabilities

chat, images, and predictions

one api key, one base url, and the full set of inference primitives.

01

chat completions

POST /v1/chat/completions, openai-sdk compatible.

02

streaming (sse)

token-by-token server-sent-event streams out of the box.

03

function calling

tool calls passed straight through to capable models.

04

vision

send images inline for multimodal models.

05

images

POST /v1/images/generate for flux and friends.

06

predictions

POST /v1/predictions to run replicate models.

images

generate images the same way

the same key and base url reach image and prediction models. swap the path and the model id — the auth stays identical.

  • POST /v1/images/generate for image models
  • black-forest-labs/flux-schnell and other replicate models
  • GET /v1/models and GET /v1/providers to discover what you can route to
curl https://hypery.ai/v1/images/generate \
-H "Authorization: Bearer $GATEWAY_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"black-forest-labs/flux-schnell","prompt":"a red fox in snow"}'
 

faq

questions

is it really openai-compatible?

yes. point the openai sdk at https://hypery.ai/v1, keep your existing chat.completions calls, and just change the model id to provider/model like anthropic/claude-3.5-sonnet.

which providers and models are available?

openrouter (200+ models, default routing), replicate (image/video/audio/3d), huggingface, and vercel ai gateway. see the live list on the models page.

do you support streaming, function calling, and vision?

yes — server-sent-event streaming, function calling, and vision are all supported through the same /v1/chat/completions endpoint.

how do i generate images or run replicate models?

post to /v1/images/generate for images and /v1/predictions for replicate models. /v1/models and /v1/providers list what you can route to.

get started

point your sdk at the gateway

change one line — the base url — and route across every provider from a single key.

$npm install openai