Back to Omniroute

Quickstart Code Examples

examples/quickstart/README.md

3.8.491.2 KB
Original Source

Quickstart Code Examples

Simple, copy-paste scripts to get your first response from a local OmniRoute server in under a minute.

Prerequisites

Start OmniRoute locally first:

bash
npx omniroute
# Server is now live at http://localhost:20128/v1

Examples

FileLanguageDependency
python_requests.pyPythonpip install requests
nodejs_axios.jsNode.jsnpm install axios
curl_terminal.shBash / cURLcurl (pre-installed on Mac/Linux)
php_curl.phpPHPPHP 7.4+ with cURL

All examples use felo/auto — a keyless, zero-configuration model that works immediately with no provider sign-up required.

Key Settings (same in all examples)

SettingValueWhy
modelfelo/autoKeyless provider, works out of the box
streamfalseReturns standard JSON instead of SSE stream
AuthorizationBearer dummy-keyAny non-empty string satisfies the header requirement

What to Change

To use a different model, replace felo/auto with any model ID from:

bash
curl http://localhost:20128/v1/models