mirror of
https://github.com/diegosouzapw/OmniRoute.git
synced 2026-08-12 02:02:13 +03:00
Add examples/quickstart/ with minimal copy-paste scripts that let new users get a response from a local OmniRoute server in under a minute, without needing to read the full docs first. Files added: - examples/quickstart/python_requests.py (requests library) - examples/quickstart/nodejs_axios.js (axios) - examples/quickstart/curl_terminal.sh (bash one-liner) - examples/quickstart/php_curl.php (cURL extension) - examples/quickstart/README.md (table + key-settings cheatsheet) README.md: add one sub-line pointer to examples/quickstart/ below the existing zero-config curl snippet, matching the surrounding <sub> style.
40 lines
1.2 KiB
Markdown
40 lines
1.2 KiB
Markdown
# 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
|
|
|
|
| File | Language | Dependency |
|
|
|------|----------|------------|
|
|
| [`python_requests.py`](python_requests.py) | Python | `pip install requests` |
|
|
| [`nodejs_axios.js`](nodejs_axios.js) | Node.js | `npm install axios` |
|
|
| [`curl_terminal.sh`](curl_terminal.sh) | Bash / cURL | `curl` (pre-installed on Mac/Linux) |
|
|
| [`php_curl.php`](php_curl.php) | PHP | PHP 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)
|
|
|
|
| Setting | Value | Why |
|
|
|---------|-------|-----|
|
|
| `model` | `felo/auto` | Keyless provider, works out of the box |
|
|
| `stream` | `false` | Returns standard JSON instead of SSE stream |
|
|
| `Authorization` | `Bearer dummy-key` | Any 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
|
|
```
|