Quickstart
Make your first RouteMarket request in a few minutes.
This page assumes one goal: make a working request as fast as possible.
Prerequisites
You need:
- a RouteMarket API key
- the gateway URL
https://api.routemarket.ai - a logical model name such as
gpt-5.4
1. Set your API key
export ROUTELAB_API_KEY="your_key_here"2. Make your first request
curl https://api.routemarket.ai/v1/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $ROUTELAB_API_KEY" \
-d '{
"model": "gpt-5.4",
"messages": [
{ "role": "user", "content": "Say hello from RouteMarket." }
]
}'3. Use an OpenAI-compatible SDK
import OpenAI from "openai";
const client = new OpenAI({
apiKey: process.env.ROUTELAB_API_KEY,
baseURL: "https://api.routemarket.ai/v1"
});
const completion = await client.chat.completions.create({
model: "gpt-5.4",
messages: [{ role: "user", content: "Explain RouteMarket in one sentence." }]
});
console.log(completion.choices[0]?.message?.content);4. Add routing control when you need it
The default request can stay simple.
When you need more control, RouteMarket also supports fields like:
providerrouterouting_preferencesource_policy
Example:
{
"model": "gpt-5.4",
"messages": [
{ "role": "user", "content": "hello" }
],
"routing_preference": "highest_reliability"
}5. Know what model means
In RouteMarket, model usually means a logical model name.
That is not always the same thing as the final upstream provider model chosen at runtime.
If you need the deeper explanation, continue with Models and Routing.
Local docs preview
corepack pnpm --filter @route-lab/docs devThe docs app starts on port 3004.
Next step
- Read Authentication
- Read Chat Completions
- Read Routing