Channels are the upstream AI provider connections that Newapi routes requests through — for example, OpenAI, Anthropic, Azure OpenAI, or any compatible provider. Use these endpoints to add, configure, test, and remove channels programmatically.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.
Endpoints
| Method | Path | Description |
|---|---|---|
GET | /api/channel/ | List all channels |
POST | /api/channel/ | Create a channel |
GET | /api/channel/{id} | Get a single channel |
PUT | /api/channel/ | Update a channel |
DELETE | /api/channel/{id} | Delete a channel |
GET | /api/channel/test | Test all channels |
GET | /api/channel/test/{id} | Test a specific channel |
List all channels
Query parameters
Page number (1-indexed). Defaults to
1.Number of channels to return per page. Defaults to
10.When
true, sorts results by channel ID instead of the default ordering.When
true, groups channels by tag in the response.Filter by channel status. For example,
"enabled" or "disabled".Filter by channel type identifier (corresponds to the provider type integer).
Example
Create a channel
Request body
The creation mode. One of:
"single"— create a single channel with one API key."batch"— create multiple channels, one per API key supplied."multi_to_single"— assign multiple API keys to a single channel.
The channel configuration object. Fields vary by provider type. Common fields include:
name(string) — display name for the channel.type(integer) — provider type identifier.key(string) — API key or comma-separated list of keys (for batch/multi-key modes).base_url(string) — custom base URL for the provider, if applicable.models(string[]) — models this channel supports.model_mapping(object) — maps request model names to provider-specific names.priority(integer) — routing priority; higher values are preferred.weight(integer) — weight for load balancing across channels with equal priority.
Example
Get a single channel
Path parameters
The numeric ID of the channel to retrieve.
Example
Update a channel
id field in the request body along with any fields you want to change. Accepts the same fields as the channel object in create a channel, plus:
The numeric ID of the channel to update.
Example
Delete a channel
Path parameters
The numeric ID of the channel to delete.
Example
Test all channels
Testing all channels may take several seconds if you have many channels configured. Each channel is tested individually.
Example
Test a specific channel
Path parameters
The numeric ID of the channel to test.