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.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.
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
| Property | Description |
|---|---|
| Name | A human-readable label for the channel (e.g., “OpenAI Production”) |
| Type | The provider type — OpenAI, Gemini, Azure OpenAI, etc. |
| API key | The credential used to authenticate with the upstream provider |
| Base URL | The provider’s API endpoint (defaults to the provider’s standard URL) |
| Models | The list of model names this channel supports |
| Priority | Channels with higher priority are preferred when routing |
| Weight | Relative weight for load balancing across channels with the same priority |
Adding a channel
Open Channels in the console
Log in to the Newapi console and click Channels in the sidebar. Then click Add Channel.
Select the provider type
Choose your upstream provider from the Type dropdown. Newapi pre-fills the base URL and other defaults for known providers.
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.
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.Testing a channel
After adding a channel, verify it can reach the upstream provider:- In the Channels list, find your channel and click the Test button (or the connectivity icon).
- Newapi sends a lightweight request to the upstream provider and reports whether the connection succeeded.
- If the test fails, check that your API key is valid, the base URL is correct, and the provider’s service is available.
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.
gpt-4o:
| Channel | Priority | Weight | Effect |
|---|---|---|---|
| OpenAI (primary) | 10 | — | Used first |
| OpenAI (backup) | 5 | — | Used if primary is unavailable |
| Azure OpenAI | 10 | 1 | Shares 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
- API Tokens — Create scoped API keys for your applications
- Available Models — Understand how model names map to channels
- Management API: Channels — Manage channels programmatically