Documentation Index
Fetch the complete documentation index at: https://docs.routeway.ai/llms.txt
Use this file to discover all available pages before exploring further.
1. Get Your API Key
Go to routeway.ai and log in.
- Open the API Keys section.
- Click Create API Key.
- Copy your key and keep it secure (e.g.
.env or secrets manager).
Never share your API key. Anyone with it can use your quota and access your
account.
2. Set Your API Key
Store your API key as an environment variable.export Routeway_API_KEY="your_key_here"
setx Routeway_API_KEY "your_key_here"
set Routeway_API_KEY="your_key_here"
3. Make Your First Request
Python (openai SDK)
cURL
NodeJS (openai SDK)
Install the OpenAI SDK:Then use it:import os
from openai import OpenAI
client = OpenAI(
base_url="https://api.routeway.ai/v1",
api_key=os.getenv("Routeway_API_KEY")
)
response = client.chat.completions.create(
model="gpt-4o-mini",
messages=[
{"role": "user", "content": "Write a short story about a robot and a cat."}
]
)
print(response.choices[0].message.content)
curl https://api.routeway.ai/v1/chat/completions \
-H "Authorization: Bearer $Routeway_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "gpt-4o-mini",
"messages": [
{"role": "user", "content": "Write a short story about a robot and a cat"}
]
}'
const axios = require('axios')
const apiKey = 'your_routeway_api_key'
const url = 'https://api.routeway.ai/v1/chat/completions'
const data = {
model: 'gpt-4o',
messages: [
{
role: 'user',
content: 'Say this is a test!',
},
],
}
const headers = {
'Content-Type': 'application/json',
Authorization: `Bearer ${apiKey}`,
}
axios
.post(url, data, { headers })
.then(response => {
console.log(response.data)
})
.catch(error => {
console.error('Error:', error)
})