
How to Use EvoLink Smart Router: API Setup and Production Testing
https://direct.evolink.ai/v1/chat/completions with model set to evolink/auto.response.model, which means you can observe routing behavior instead of treating it as a black box.EvoLink Smart Router quick reference
| Setting | Value | What it does |
|---|---|---|
| Endpoint | https://direct.evolink.ai/v1/chat/completions | Accepts OpenAI-compatible chat completion requests |
| Authentication | Authorization: Bearer $EVOLINK_API_KEY | Authenticates the request with your EvoLink API key |
| Model ID | evolink/auto | Enables Smart Router for supported text and agent requests |
| Request format | OpenAI-compatible messages array | Keeps integration code compatible with common SDK patterns |
| Routed model | response.model | Shows which model actually served the request |
| Current scope | Text and agent workflows | Image and video generation should use explicit model IDs |
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
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
}'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.
How EvoLink Smart Router chooses a route
For supported text requests, EvoLink describes the routing flow in five stages:
- Your application sends an OpenAI-compatible request using
evolink/auto. - The router evaluates the task type and complexity.
- The request is mapped to a routing profile such as Fast, Standard, or Reasoning.
- A suitable candidate model receives the request.
- The selected model is returned in
response.model.
The profiles are task categories, not a permanent public list of models:
| Routing profile | Typical fit | Example tasks |
|---|---|---|
| Fast | Simple, high-volume text work | Rewriting, classification, formatting |
| Standard | General text processing | Summarization, extraction, support analysis |
| Reasoning | More complex analysis and planning | Multi-step analysis, decision support, agent planning |
| Coding / Agentic Coding | Coding-heavy workflows when supported | Code review, debugging, refactor planning |
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.
| Workload | Smart Router | Fixed model |
|---|---|---|
| Mixed classification, extraction, and reasoning | Good default to evaluate | Requires manual model-selection logic |
| Early product development | Useful while collecting workload data | Useful after a stable baseline is known |
| Strict model benchmark | Poor fit because the selected model can vary | Correct choice |
| Deterministic QA or regulated approval path | Requires careful controls | Usually the safer choice |
| Model-specific tools, context behavior, or output format | May not preserve the required capability | Required |
| Image or video generation | Not the current Smart Router scope | Use an explicit media model ID |
A practical production architecture often uses both:
evolink/autofor 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:
| Field | Why it matters |
|---|---|
| Feature or workflow name | Separates unrelated traffic patterns |
| Request ID | Connects application logs with API troubleshooting |
Returned model | Shows the actual routed model |
| Latency | Reveals whether routing meets the workflow's response-time target |
| Prompt and completion tokens | Supports usage and cost analysis |
| HTTP status and retry count | Exposes reliability problems hidden by averages |
| Quality result | Records 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
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:
| Status | Meaning | Recommended action |
|---|---|---|
400 | Invalid request parameters | Validate the JSON body, model ID, messages, and parameter types |
401 | Invalid or expired API key | Check the Bearer token and rotate the key if necessary |
402 | Insufficient quota | Review billing and available credits before retrying |
403 | Feature or account access denied | Confirm Smart Router is available for the account |
429 | Rate limit exceeded | Apply bounded retries with exponential backoff and jitter |
500 | Internal server error | Retry only idempotent requests and retain request metadata |
502 | Upstream service unavailable | Retry with backoff; escalate if failures persist |
503 | Service temporarily unavailable | Delay 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.
Recommended production pattern
Use Smart Router as an observable default, not an invisible dependency:
- Keep
evolink/autobehind an application configuration flag. - Log the returned model and operational metrics.
- Compare routed traffic with a fixed-model baseline.
- Pin explicit models for strict QA or model-specific features.
- Review routing results whenever your prompt distribution or product workflow changes.
FAQ
What endpoint should I use for EvoLink Smart Router?
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?
model field to evolink/auto.How can I see which model handled a request?
model field in the chat completion response. Store it with latency, token usage, status, and workflow metadata.Is EvoLink Smart Router always cheaper than a fixed model?
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?
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
evolink/auto and a fixed model. Compare quality, latency, token usage, errors, and the returned model before deciding which production paths should remain routed.

