Files
wehub-resource-sync 3cd11ababe
Check Markdown links / linkChecker (push) Has been cancelled
chore: import upstream snapshot with attribution
2026-07-13 13:38:56 +08:00

1.9 KiB
Vendored

AI Gateway

Route to 100+ LLMs with 1 fast & friendly API.



Portkey's AI Gateway is the interface between your app and hosted LLMs. It streamlines API requests to OpenAI, Anthropic, Mistral, LLama2, Anyscale, Google Gemini and more with a unified API.

  Blazing fast (9.9x faster) with a tiny footprint (~45kb installed)
  Load balance across multiple models, providers, and keys
  Fallbacks make sure your app stays resilient
  Automatic Retries with exponential fallbacks come by default
  Plug-in middleware as needed
  Battle tested over 100B tokens

Deploy on Replit

  1. Fork the AI gateway published by Portkey with a preferred name into your Replit account.
  2. Click [Run] to run the gateway for your apps.
  3. Open a new tab to grab the gateway URL. It typically looks like https://unique-random-numbers.xxx.repl.co/
  4. Click [Deploy] in the top right for a production-ready app gateway (Requires Replit Core).
  5. The gateway will be deployed for production use at https://chosen-subdomain.replit.app.

Example usage

Let's try making a chat completions call to OpenAI through the AI gateway:

curl 'https://chosen-subdomain.replit.app/v1/chat/completions' \
  -H 'x-portkey-provider: openai' \
  -H "Authorization: Bearer $OPENAI_KEY" \
  -H 'Content-Type: application/json' \
  -d '{"messages": [{"role": "user","content": "Say this is test."}], "max_tokens": 20, "model": "gpt-4"}'

Portkey