Skip to content

Guides

How to use multiple AI providers through one API

Use multiple LLM providers through one API with NuRoute Enterprise. Learn how this differs from standard Artemis-only access and what to test during migration.

Published 3 min read

On this page

A shared API removes much of the code needed to call different providers. It does not make every model behave the same way.

The NuRoute gateway setup in this guide is for Enterprise. Standard NuRoute offers Artemis only; it does not provide a user-selectable multi-provider catalogue. The practical goal of an Enterprise gateway is to keep your application’s request code stable while making model access, selection and policy explicit. You still need to test output formats, tools, streaming and errors for the routes you intend to use.

Separate the endpoint from the model decision

The endpoint determines which gateway receives the request. The model field asks for either a named model or automatic selection. Provider credentials determine which upstream services the gateway can call.

For NuRoute Platform API requests, model: "auto" invokes Artemis on Cloud, with documented fallback behavior when it cannot decide. On the Enterprise gateway, a specific model ID skips Artemis. Your provider keys can be used for Enterprise named-model requests; Artemis requests use NuRoute's provider keys. Routing, billing paths

This distinction matters if your migration is primarily about consolidating access. Enterprise customers can adopt the gateway with a fixed model first, then evaluate automatic selection separately.

Make a minimal request

Use the gateway URL supplied for your deployment. In this example, NUROUTE_GATEWAY_URL is the origin without a trailing slash or /v1; NUROUTE_API_KEY is a Platform API key. Keep the key in your environment rather than your source file.

import json
import os
import urllib.request

gateway = os.environ["NUROUTE_GATEWAY_URL"].rstrip("/")
body = {
    "model": "auto",
    "messages": [{
        "role": "user",
        "content": "Translate to German: Your export is ready."
    }],
}
request = urllib.request.Request(
    gateway + "/v1/chat/completions",
    data=json.dumps(body).encode("utf-8"),
    headers={
        "Authorization": "Bearer " + os.environ["NUROUTE_API_KEY"],
        "Content-Type": "application/json",
    },
    method="POST",
)
with urllib.request.urlopen(request, timeout=60) as response:
    result = json.load(response)
    print("Served model:", result["model"])
    print(result["choices"][0]["message"]["content"])

This standard-library example follows the NuRoute quickstart's request shape. It has not been tested with an authenticated account. It intentionally makes one attempt so failures remain visible during setup; production error handling needs an explicit policy.

For an Enterprise named-model test, replace auto with an exact model ID available in your catalogue. NuRoute's /v1/models lists real models, not the auto alias. A missing alias in a client's dropdown does not by itself mean routing is unavailable. Model-name behavior

Migrate in two steps

For an Enterprise gateway migration, first keep the existing model fixed while changing the access layer. Compare outputs and errors with the original integration. That isolates compatibility problems.

Next, test automatic selection on a small workload with clear acceptance criteria. Artemis runs on NuRoute Cloud; the self-hosted gateway currently uses the fallback router instead. Compare that route against the fixed model. Changing the prompt, provider and selection policy simultaneously makes a regression hard to diagnose.

Test the contract your application relies on

FeatureWhat to test
Text completionExpected response fields and empty-answer handling
StreamingChunk parsing and interruption after output begins
Tool useTool argument correctness and completed task success
Structured outputParsing, schema validation and invalid-output handling
ContextLong inputs, full history and overflow errors
FailuresAuthentication, policy, rate-limit and credit errors

NuRoute currently ignores response_format. It checks tool compatibility at provider level, and its capability matrix does not grade reliable tool use. Those are reasons for Enterprise customers to test an explicit model for critical workflows rather than infer support from a familiar API shape. Current limitations

Add scope and observability

Use project-scoped credentials when workloads need separate policy and budgets. Record the requested model, served model, router version, usage and completion outcome. Avoid retaining raw customer content in an extra diagnostic log unless you need it.

One API makes switching models easier. A good migration also preserves the behavior your product depends on. Use the router evaluation guide before expanding automatic selection, and the production docs for current setup details.

Keep reading

All articles

Test NuRoute on your own requests