Routescope APIRoutescope API
Client Tool Setup

Switch from OpenAI API to RouteScope

Minimal changes for moving an existing OpenAI SDK, curl request, or OpenAI-compatible client to RouteScope.

If your project already calls the OpenAI API, switching to RouteScope usually means changing three values: Base URL, API Key, and model name. The request format can stay OpenAI-compatible.

SettingOpenAIRouteScope
Base URLhttps://api.openai.com/v1https://api.routescope.ai/v1
API KeyOpenAI keyRouteScope API Key starting with sk-...
ModelOpenAI model nameA model copied from Model Plaza or /v1/models

Use the /v1 Base URL

OpenAI-compatible clients should use https://api.routescope.ai/v1. Do not use the website URL, and do not omit /v1.

Step 1: Create a RouteScope API Key

Create an API Key in the RouteScope console and copy the full sk-... value.

If you are not sure which models your account can call, check Model Plaza or call:

curl https://api.routescope.ai/v1/models \
  -H "Authorization: Bearer sk-your-token"

Step 2: Update your OpenAI SDK settings

JavaScript / TypeScript

import OpenAI from "openai";

const client = new OpenAI({
  apiKey: process.env.ROUTESCOPE_API_KEY,
  baseURL: "https://api.routescope.ai/v1",
});

const completion = await client.chat.completions.create({
  model: "your-routescope-model",
  messages: [{ role: "user", content: "Reply with RouteScope connected" }],
});

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

If your application already reads OPENAI_API_KEY, you can keep that environment variable name. Set its value to the RouteScope API Key and change the Base URL.

Python

from openai import OpenAI

client = OpenAI(
    api_key="sk-your-token",
    base_url="https://api.routescope.ai/v1",
)

resp = client.chat.completions.create(
    model="your-routescope-model",
    messages=[{"role": "user", "content": "Reply with RouteScope connected"}],
)

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

curl

curl https://api.routescope.ai/v1/chat/completions \
  -H "Authorization: Bearer sk-your-token" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "your-routescope-model",
    "messages": [
      {
        "role": "user",
        "content": "Reply with RouteScope connected"
      }
    ]
  }'

Step 3: Keep the OpenAI-compatible paths

CapabilityRouteScope path
Model listGET /v1/models
Chat completionsPOST /v1/chat/completions
Image generationPOST /v1/images/generations
Image editsPOST /v1/images/edits

For example, chat completions use https://api.routescope.ai/v1/chat/completions.

Step 4: Verify the request

After a successful request, open operation records and check:

ItemWhat to verify
ModelIt matches the RouteScope model you requested.
TokenIt matches the API Key you created.
StatusThe request succeeded, or the failure reason is clear.
UsageToken usage and cost were recorded.

Common issues

SymptomFix
401 or 403Check that the API Key is complete, enabled, and has quota and permission.
404 or model not foundCopy a model name from Model Plaza or /v1/models.
Requests still go to OpenAICheck whether an old Base URL remains in the SDK, proxy, or client.
Claude-native calls failClaude Messages uses https://api.routescope.ai/v1/messages; do not send it through an OpenAI SDK path.

Last updated on