Skip to main content

Documentation Index

Fetch the complete documentation index at: https://doc.hitopen.com/llms.txt

Use this file to discover all available pages before exploring further.

A channel is a connection to an upstream AI provider — for example, an OpenAI API key, a Google Gemini account, or any other provider that exposes an API. Channels are the backbone of Newapi: every request you send to Newapi is routed through one or more channels to reach the actual model.
Channel management requires administrator permissions. If you don’t see the Channels section in the console, contact your Newapi administrator.

How Newapi uses channels

When your application sends a request to Newapi (for example, POST /v1/chat/completions with "model": "gpt-4o"), Newapi looks up which channels support that model and forwards the request to one of them. The response is returned to your application in the standard OpenAI format — regardless of which underlying provider handled it. This means you can:
  • Switch providers without changing your application code
  • Run multiple providers in parallel for redundancy or cost optimization
  • Use custom model names that map to whichever provider you prefer

Key channel properties

PropertyDescription
NameA human-readable label for the channel (e.g., “OpenAI Production”)
TypeThe provider type — OpenAI, Gemini, Azure OpenAI, etc.
API keyThe credential used to authenticate with the upstream provider
Base URLThe provider’s API endpoint (defaults to the provider’s standard URL)
ModelsThe list of model names this channel supports
PriorityChannels with higher priority are preferred when routing
WeightRelative weight for load balancing across channels with the same priority

Adding a channel

1

Open Channels in the console

Log in to the Newapi console and click Channels in the sidebar. Then click Add Channel.
2

Select the provider type

Choose your upstream provider from the Type dropdown. Newapi pre-fills the base URL and other defaults for known providers.
3

Enter your API key

Paste your upstream provider’s API key into the API Key field. For providers that require additional headers or tokens, add them in the extended settings.
4

Set the model list

Enter the model names this channel supports (e.g., gpt-4o, gpt-4o-mini). These names are what callers use in their requests. You can add multiple models, one per line.
5

Save the channel

Click Submit. The channel appears in the Channels list and is immediately available for routing.

Testing a channel

After adding a channel, verify it can reach the upstream provider:
  1. In the Channels list, find your channel and click the Test button (or the connectivity icon).
  2. Newapi sends a lightweight request to the upstream provider and reports whether the connection succeeded.
  3. If the test fails, check that your API key is valid, the base URL is correct, and the provider’s service is available.
Test channels after any change to the API key or base URL to catch authentication issues before they affect live traffic.

Load balancing with priority and weight

When multiple channels support the same model, Newapi distributes traffic across them using priority and weight:
  • Priority — Newapi always prefers the channel with the highest priority. Lower-priority channels act as fallbacks.
  • Weight — Among channels with equal priority, traffic is split proportionally by weight. A channel with weight 3 receives three times as many requests as a channel with weight 1.
Example: You have two OpenAI channels and one Azure OpenAI channel, all supporting gpt-4o:
ChannelPriorityWeightEffect
OpenAI (primary)10Used first
OpenAI (backup)5Used if primary is unavailable
Azure OpenAI101Shares load with OpenAI primary (50/50)
If a channel returns an error, Newapi automatically retries the request on the next available channel. You don’t need to handle failover in your application code.

Organizing channels with tags

You can assign tags to channels to group them logically — for example, by team, environment, or cost tier. Tags make it easier to filter channels in the console and can be used for bulk operations such as enabling or disabling a group of channels at once. To add a tag, edit a channel and enter one or more tag names in the Tags field.

Next steps