Quickstart

Get your first API call working in under 5 minutes.

Prerequisites

  • A Routic account with an active API Key. If you don't have one yet, sign up and create a key.
  • Your Base URL: https://api.routic.ai/v1
  • Any HTTP client (curl, Python, Node.js, etc.)

Step 1 — Pick a model

Browse the Model catalog and choose a canonical model name. For your first call, try a general-purpose model:

Use caseModel name
General chatdeepseek-v3
Reasoningdeepseek-r1
Cost-effectivedeepseek-r1-distill-qwen-14b

If your account has routing aliases enabled, you can also use public aliases like auto/chat or auto/reasoning — Routic picks an available model that matches the capability.

Step 2 — Send a request

curl

curl -sS "https://api.routic.ai/v1/chat/completions" \
  -H "Authorization: Bearer $ROUTIC_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "deepseek-v3",
    "messages": [{"role": "user", "content": "ping"}]
  }'

Set ROUTIC_API_KEY in your environment before running the command.

Python (OpenAI SDK)

from openai import OpenAI

client = OpenAI(
    base_url="https://api.routic.ai/v1",
    api_key="sk-xxxxxxxx",   # your Routic API Key
)

response = client.chat.completions.create(
    model="deepseek-v3",
    messages=[{"role": "user", "content": "ping"}],
)

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

Node.js (OpenAI SDK)

import OpenAI from "openai";

const client = new OpenAI({
  baseURL: "https://api.routic.ai/v1",
  apiKey: "sk-xxxxxxxx",   // your Routic API Key
});

const response = await client.chat.completions.create({
  model: "deepseek-v3",
  messages: [{ role: "user", content: "ping" }],
});

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

Step 3 — Verify the response

A successful response looks like this:

{
  "id": "chatcmpl-abc123",
  "object": "chat.completion",
  "model": "deepseek-v3",
  "choices": [
    {
      "index": 0,
      "message": {
        "role": "assistant",
        "content": "pong"
      },
      "finish_reason": "stop"
    }
  ],
  "usage": {
    "prompt_tokens": 8,
    "completion_tokens": 2,
    "total_tokens": 10
  }
}

If you get an error instead, check these common issues:

SymptomLikely causeFix
401 invalid_api_keyWrong or missing API KeyVerify the key starts with sk- and matches your dashboard
401 missing_api_keyNo Authorization headerAdd Authorization: Bearer sk-xxx to your request
400 invalid_modelModel name not recognizedCheck the Model catalog for valid names
402 insufficient_balanceAccount balance depletedTop up in your dashboard

For all error codes, see HTTP semantics & error payloads.

Next steps

Now that you're up and running:

  1. Understand billingModels, SKUs & usage
  2. Handle errors properlyErrors & retries
  3. Explore featuresStreaming, Tool calls, Thinking mode
  4. Connect your toolsCursor, Claude Code, Aider