# ORVYX

> Source: https://docs.orvyx-ai.com/
>
> Part of the ORVYX documentation. ORVYX is an AI gateway that exposes more than 500 language, vision and reasoning models behind a single OpenAI-compatible endpoint, one API key and one bill. Base URL: https://api.orvyx-ai.com/v1. Models are addressed as orvyx/<name>. Authentication is a Bearer API key.

---

## Explore the documentation

## Built for one line of code

Since ORVYX speaks the same language as OpenAI, switching over is one address and one key. Nothing else in your project changes. Here is a support assistant that streams an answer, in the language you already use.

```python
from openai import OpenAI

client = OpenAI(
    base_url="https://api.orvyx-ai.com/v1",
    api_key="oryx_...",
)

stream = client.chat.completions.create(
    model="orvyx/claude-fable-5",
    messages=[
        {"role": "system", "content": "You are a concise support agent."},
        {"role": "user", "content": "My invoice shows a duplicate charge."},
    ],
    stream=True,
)

for chunk in stream:
    print(chunk.choices[0].delta.content or "", end="")
```

```ts
import OpenAI from "openai"

const client = new OpenAI({
  baseURL: "https://api.orvyx-ai.com/v1",
  apiKey: process.env.ORVYX_API_KEY,
})

const stream = await client.chat.completions.create({
  model: "orvyx/claude-fable-5",
  messages: [
    { role: "system", content: "You are a concise support agent." },
    { role: "user", content: "My invoice shows a duplicate charge." },
  ],
  stream: true,
})

for await (const chunk of stream) {
  process.stdout.write(chunk.choices[0]?.delta?.content ?? "")
}
```

```php
<?php
$ch = curl_init('https://api.orvyx-ai.com/v1/chat/completions');
curl_setopt_array($ch, [
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_POST => true,
    CURLOPT_HTTPHEADER => [
        'Authorization: Bearer ' . getenv('ORVYX_API_KEY'),
        'Content-Type: application/json',
    ],
    CURLOPT_POSTFIELDS => json_encode([
        'model' => 'orvyx/claude-fable-5',
        'messages' => [
            ['role' => 'system', 'content' => 'You are a concise support agent.'],
            ['role' => 'user', 'content' => 'My invoice shows a duplicate charge.'],
        ],
    ]),
]);

$res = json_decode(curl_exec($ch), true);
echo $res['choices'][0]['message']['content'] . PHP_EOL;
```

```php
<?php

use Illuminate\Support\Facades\Http;

$res = Http::withToken(config('services.orvyx.key'))
    ->post('https://api.orvyx-ai.com/v1/chat/completions', [
        'model' => 'orvyx/claude-fable-5',
        'messages' => [
            ['role' => 'system', 'content' => 'You are a concise support agent.'],
            ['role' => 'user', 'content' => 'My invoice shows a duplicate charge.'],
        ],
    ])
    ->throw()
    ->json();

echo $res['choices'][0]['message']['content'];
```

```go
package main

import (
	"bytes"
	"encoding/json"
	"fmt"
	"net/http"
	"os"
)

func main() {
	body, _ := json.Marshal(map[string]any{
		"model": "orvyx/claude-fable-5",
		"messages": []map[string]string{
			{"role": "system", "content": "You are a concise support agent."},
			{"role": "user", "content": "My invoice shows a duplicate charge."},
		},
	})

	req, _ := http.NewRequest("POST", "https://api.orvyx-ai.com/v1/chat/completions", bytes.NewReader(body))
	req.Header.Set("Authorization", "Bearer "+os.Getenv("ORVYX_API_KEY"))
	req.Header.Set("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)
	defer res.Body.Close()

	var out struct {
		Choices []struct {
			Message struct {
				Content string `json:"content"`
			} `json:"message"`
		} `json:"choices"`
	}
	json.NewDecoder(res.Body).Decode(&out)

	fmt.Println(out.Choices[0].Message.Content)
}
```

```rust
use serde_json::json;

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let res = reqwest::Client::new()
        .post("https://api.orvyx-ai.com/v1/chat/completions")
        .bearer_auth(std::env::var("ORVYX_API_KEY")?)
        .json(&json!({
            "model": "orvyx/claude-fable-5",
            "messages": [
                {"role": "system", "content": "You are a concise support agent."},
                {"role": "user", "content": "My invoice shows a duplicate charge."}
            ]
        }))
        .send()
        .await?
        .json::<serde_json::Value>()
        .await?;

    println!("{}", res["choices"][0]["message"]["content"]);
    Ok(())
}
```

```bash
curl https://api.orvyx-ai.com/v1/chat/completions \
  -H "Authorization: Bearer $ORVYX_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "orvyx/claude-fable-5",
    "messages": [
      { "role": "system", "content": "You are a concise support agent." },
      { "role": "user", "content": "My invoice shows a duplicate charge." }
    ]
  }'
```

## Pay your way

Top up with the money you already have. Prepaid balance, no subscription, and the same rates whichever way you pay.

## Start here

-

-

-

- 4

Handle errors properly

One error envelope, stable codes and standard rate-limit headers on every response.
