Skip to content

Quick Start

This page gets you from an API key to a working request.

1. Create a key

Open the rout.my dashboard, create an API key, and keep it private. API keys begin with sk_.

2. Save the key

macOS or Linux:

bash
export ROUTMY_API_KEY="sk_your_key_here"

Windows PowerShell:

powershell
$env:ROUTMY_API_KEY="sk_your_key_here"

3. Pick a model ID

List the models visible to your account:

bash
curl https://api.rout.my/v1/models \
  -H "Authorization: Bearer $ROUTMY_API_KEY"

Copy one exact id from the response. The examples below use provider/model-id as a placeholder.

4. Send a chat request

bash
curl https://api.rout.my/v1/chat/completions \
  -H "Authorization: Bearer $ROUTMY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "provider/model-id",
    "messages": [
      { "role": "user", "content": "Write one sentence about rout.my." }
    ]
  }'

Python

python
from openai import OpenAI
import os

client = OpenAI(
    base_url="https://api.rout.my/v1",
    api_key=os.environ["ROUTMY_API_KEY"],
)

response = client.chat.completions.create(
    model="provider/model-id",
    messages=[{"role": "user", "content": "Write one sentence about rout.my."}],
)

print(response.choices[0].message.content)

Node.js

js
import OpenAI from 'openai';

const client = new OpenAI({
  baseURL: 'https://api.rout.my/v1',
  apiKey: process.env.ROUTMY_API_KEY
});

const response = await client.chat.completions.create({
  model: 'provider/model-id',
  messages: [{ role: 'user', content: 'Write one sentence about rout.my.' }]
});

console.log(response.choices[0].message.content);

Next steps

API documentation for rout.my.