Kimi K3 is now availableExplore Kimi K3
How to Use EvoLink Smart Router: API Setup and Production Testing
Tutorial

How to Use EvoLink Smart Router: API Setup and Production Testing

Jessie
Jessie
COO
March 11, 2026
Updated on July 16, 2026
11 min read
The fastest way to use EvoLink Smart Router is to send a normal OpenAI-compatible chat completion request to https://direct.evolink.ai/v1/chat/completions with model set to evolink/auto.
Your application keeps one request format, while the router selects a suitable model for supported text and agent requests. The selected model is returned in response.model, which means you can observe routing behavior instead of treating it as a black box.
This guide covers the complete path from the first API call to a production-safe evaluation. For the conceptual explanation of model routing, read What Is AI Model Routing?. For current product positioning and routing profiles, see EvoLink Smart Router.
SettingValueWhat it does
Endpointhttps://direct.evolink.ai/v1/chat/completionsAccepts OpenAI-compatible chat completion requests
AuthenticationAuthorization: Bearer $EVOLINK_API_KEYAuthenticates the request with your EvoLink API key
Model IDevolink/autoEnables Smart Router for supported text and agent requests
Request formatOpenAI-compatible messages arrayKeeps integration code compatible with common SDK patterns
Routed modelresponse.modelShows which model actually served the request
Current scopeText and agent workflowsImage and video generation should use explicit model IDs
The official EvoLink Auto Quickstart should remain the source of truth for endpoint and parameter changes.

1. Create an API key

Create an EvoLink API key in the dashboard, then store it in an environment variable rather than hardcoding it in application code:

export EVOLINK_API_KEY="your-api-key"

For PowerShell:

$env:EVOLINK_API_KEY="your-api-key"

Keep separate keys for local development, staging, and production so that usage can be reviewed and credentials can be rotated independently.

2. Send your first Smart Router request

The smallest useful request contains an API key, the evolink/auto model ID, and a messages array:
curl --request POST \
  --url https://direct.evolink.ai/v1/chat/completions \
  --header "Authorization: Bearer $EVOLINK_API_KEY" \
  --header "Content-Type: application/json" \
  --data '{
    "model": "evolink/auto",
    "messages": [
      {
        "role": "user",
        "content": "Classify this support request as billing, technical, or account access: I cannot sign in after resetting my password."
      }
    ],
    "temperature": 0.2,
    "stream": false
  }'
The API returns a standard chat completion response. The important field for routing observability is model:
{
  "id": "chatcmpl-example",
  "object": "chat.completion",
  "model": "actual-routed-model",
  "choices": [
    {
      "index": 0,
      "message": {
        "role": "assistant",
        "content": "account access"
      },
      "finish_reason": "stop"
    }
  ],
  "usage": {
    "prompt_tokens": 26,
    "completion_tokens": 3,
    "total_tokens": 29
  }
}
actual-routed-model is illustrative. The candidate pool can change with availability, pricing, performance, and routing policy. Always inspect the real model value returned by your request.

3. Use Smart Router with Python

If your application already uses the OpenAI Python SDK, point the client at EvoLink's text API base URL and change the model ID:

import os
import time
from openai import OpenAI

client = OpenAI(
    api_key=os.environ["EVOLINK_API_KEY"],
    base_url="https://direct.evolink.ai/v1",
)

started_at = time.perf_counter()

response = client.chat.completions.create(
    model="evolink/auto",
    messages=[
        {
            "role": "user",
            "content": "Summarize this incident report and list the next two engineering actions.",
        }
    ],
    temperature=0.2,
)

latency_ms = round((time.perf_counter() - started_at) * 1000)

print("routed_model:", response.model)
print("latency_ms:", latency_ms)
print("prompt_tokens:", response.usage.prompt_tokens if response.usage else None)
print("completion_tokens:", response.usage.completion_tokens if response.usage else None)
print("output:", response.choices[0].message.content)

Do not log raw prompts or responses if they may contain secrets, personal data, or customer content. Log operational metadata appropriate for your own privacy and retention requirements.

4. Use Smart Router with Node.js

The same integration pattern works with the OpenAI Node.js SDK:

import OpenAI from "openai";

const client = new OpenAI({
  apiKey: process.env.EVOLINK_API_KEY,
  baseURL: "https://direct.evolink.ai/v1",
});

const startedAt = performance.now();

const response = await client.chat.completions.create({
  model: "evolink/auto",
  messages: [
    {
      role: "user",
      content: "Extract the customer name, company, priority, and requested deadline as JSON.",
    },
  ],
  temperature: 0,
});

console.log({
  routedModel: response.model,
  latencyMs: Math.round(performance.now() - startedAt),
  promptTokens: response.usage?.prompt_tokens,
  completionTokens: response.usage?.completion_tokens,
  output: response.choices[0]?.message?.content,
});

For structured extraction, validate the returned data in application code. Routing does not remove the need for schema validation, retries, or workflow-specific quality checks.

For supported text requests, EvoLink describes the routing flow in five stages:

  1. Your application sends an OpenAI-compatible request using evolink/auto.
  2. The router evaluates the task type and complexity.
  3. The request is mapped to a routing profile such as Fast, Standard, or Reasoning.
  4. A suitable candidate model receives the request.
  5. The selected model is returned in response.model.

The profiles are task categories, not a permanent public list of models:

Routing profileTypical fitExample tasks
FastSimple, high-volume text workRewriting, classification, formatting
StandardGeneral text processingSummarization, extraction, support analysis
ReasoningMore complex analysis and planningMulti-step analysis, decision support, agent planning
Coding / Agentic CodingCoding-heavy workflows when supportedCode review, debugging, refactor planning
Do not build application logic around an assumed candidate pool. Model availability can change, while the returned response.model provides the evidence needed to analyze actual routing behavior.

Smart Router vs a fixed model

Smart Router is useful when one workflow contains different kinds of text tasks. A fixed model is better when the model itself is part of the product contract.

WorkloadSmart RouterFixed model
Mixed classification, extraction, and reasoningGood default to evaluateRequires manual model-selection logic
Early product developmentUseful while collecting workload dataUseful after a stable baseline is known
Strict model benchmarkPoor fit because the selected model can varyCorrect choice
Deterministic QA or regulated approval pathRequires careful controlsUsually the safer choice
Model-specific tools, context behavior, or output formatMay not preserve the required capabilityRequired
Image or video generationNot the current Smart Router scopeUse an explicit media model ID

A practical production architecture often uses both:

  • evolink/auto for mixed or evolving text workloads
  • explicit model IDs for evaluated, model-specific, or tightly controlled paths

What to log for every routed request

Routing becomes useful only when you can compare its results with a baseline. At minimum, capture:

FieldWhy it matters
Feature or workflow nameSeparates unrelated traffic patterns
Request IDConnects application logs with API troubleshooting
Returned modelShows the actual routed model
LatencyReveals whether routing meets the workflow's response-time target
Prompt and completion tokensSupports usage and cost analysis
HTTP status and retry countExposes reliability problems hidden by averages
Quality resultRecords whether the output passed your task-specific eval

The quality result can be a deterministic validator, a human review label, a test-suite result, or another task-appropriate evaluation. Avoid reducing every workflow to one generic quality score.

How to test Smart Router before production

Do not switch all traffic after one successful request. Use a staged evaluation:

Step 1: Build a representative fixture set

Collect real examples from the workflow you plan to route. Include normal requests, ambiguous inputs, long prompts, malformed inputs, and cases where a wrong answer creates meaningful product risk.

Step 2: Choose a fixed-model baseline

Run the same fixture set against the fixed model your application currently uses. Keep prompts, parameters, and evaluation rules consistent.

Step 3: Run the Smart Router path

Send the same inputs through evolink/auto. Record the routed model, latency, token usage, errors, and quality result for every case.

Step 4: Compare by workflow, not by average alone

A router can perform well overall and still be unsuitable for one high-risk feature. Review results by task type, customer tier, latency requirement, and failure impact.

Step 5: Roll out low-risk traffic first

Start with workflows where output can be reviewed or retried. Keep fixed-model paths for strict QA, sensitive actions, and features that depend on one model's specific behavior.

Common API errors and what to do

The Smart Router endpoint uses normal HTTP error handling:

StatusMeaningRecommended action
400Invalid request parametersValidate the JSON body, model ID, messages, and parameter types
401Invalid or expired API keyCheck the Bearer token and rotate the key if necessary
402Insufficient quotaReview billing and available credits before retrying
403Feature or account access deniedConfirm Smart Router is available for the account
429Rate limit exceededApply bounded retries with exponential backoff and jitter
500Internal server errorRetry only idempotent requests and retain request metadata
502Upstream service unavailableRetry with backoff; escalate if failures persist
503Service temporarily unavailableDelay the retry and keep an application-level fallback plan

Set explicit client timeouts. Avoid unlimited retries: they increase latency, duplicate work, and can turn a temporary failure into an expensive retry storm.

Common Smart Router mistakes

Assuming Smart Router always chooses the cheapest model

Smart Router is positioned around cost-quality control, not a guarantee that every request uses the lowest-priced model. Evaluate effective cost on your own workload.

Treating the routed model as stable

The same task may not always resolve to the same candidate model. Use a fixed model when repeatability or model identity is required.

Sending image or video generation requests to evolink/auto

The current Smart Router scope is supported text and agent requests. Use explicit model IDs and the relevant image or video endpoint for media generation.

Ignoring response.model

If you do not record the selected model, you lose the main signal needed to explain changes in quality, latency, and usage.

Publishing a hardcoded candidate-model list

Candidate models can change. Link to the current documentation and analyze the models returned by real requests instead.

Use Smart Router as an observable default, not an invisible dependency:

  1. Keep evolink/auto behind an application configuration flag.
  2. Log the returned model and operational metrics.
  3. Compare routed traffic with a fixed-model baseline.
  4. Pin explicit models for strict QA or model-specific features.
  5. Review routing results whenever your prompt distribution or product workflow changes.
Explore EvoLink Smart Router

FAQ

Use POST https://direct.evolink.ai/v1/chat/completions, which is the endpoint shown in the official EvoLink Auto Quickstart. Authenticate with a Bearer API key.

What model ID enables Smart Router?

Set the request's model field to evolink/auto.

How can I see which model handled a request?

Inspect the model field in the chat completion response. Store it with latency, token usage, status, and workflow metadata.

No. It is designed to manage cost-quality tradeoffs across mixed workloads, but effective cost depends on the requests, routed models, output length, retries, and quality requirements.

Does Smart Router always return the same model for the same prompt?

Do not rely on that behavior. Candidate availability and routing policy can change. Use an explicit model ID when model identity or deterministic evaluation matters.

Can Smart Router route image and video generation?

The current product scope is supported text and agent requests. Use explicit image or video model IDs for media generation.

Can I use streaming?

The official request schema includes the stream parameter. Test the streaming response behavior in your account and client before making it part of a production contract.

When should I replace Smart Router with a fixed model?

Pin a fixed model when a workflow has a proven winner, requires model-specific features, needs strict regression testing, or follows a controlled approval process.

Next step

Run one representative fixture set through both evolink/auto and a fixed model. Compare quality, latency, token usage, errors, and the returned model before deciding which production paths should remain routed.

Ready to Reduce Your AI Costs by 89%?

Start using EvoLink today and experience the power of intelligent API routing.