ChannelDocsOpen workspace ↗

Developer overview

Channel’s principles

Give each client one key, let the caller choose which providers receive their question, and make each charge traceable to a request. An agency can manage multiple client keys against one prepaid workspace balance and see model usage separately for each client.

Make your first request

Create a client key in the workspace and fund the workspace wallet. Keep the key on your server. Send a POST to https://app.westernrose.uk/v1/chat/completions with a bearer token and a JSON body. Use the returned channel.request to find the matching statement entry. The quickstart has examples for Python, Rust and C++.

Moving a chat integration to Channel

Configure the base URL and key together. Read the Channel key from a required environment variable so a missing setting fails before making a call. The gateway accepts an optional leading system message followed by up to 31 alternating user and assistant text messages, starting and ending with user, totalling up to 4,096 UTF-8 bytes. Read the reply from choices[0].message.content. Applications using streaming, native provider endpoints or tool calls need a compatibility check before switching.

Choose a model and input type

The catalogue helps you discover models. For an executable request, use an ID from the connected routes. A listing or a provider’s advertised capability alone does not establish that Channel can run it. The chat endpoint takes text. To ask about a PDF, extract the relevant text in your application and send an excerpt within the input limit. Sending a URL as text does not fetch the document. Image, audio, video and file-content blocks have no supported input path here.

Control where the question goes

A single model ID pins the request. To permit an alternative, send an ordered list in models and use provider.only to restrict eligible providers. A recognised availability failure can move the same question to the next eligible model. Check channel.attempts for the sequence and channel.provider for the provider that answered. Channel currently has one host per connected model. It offers no automatic cheapest-host selection, throughput guarantee or UK-only inference guarantee.

Billing FAQ

When do I pay the platform fee?
A £100 credit top-up carries a £4.50 fee. The wallet receives £100. Individual model requests draw down those credits, with the fee charged once at top-up.
What if two providers were tried?
For a successful fallback, the statement lists the attempts and records one usage charge for the model that answered. Use the client key with GET /v1/statement to read the current statement.
What if the connection drops?
When Channel records an uncertain outcome it stops forwarding. The client sees a pending hold. A scheduled check runs every ten minutes and releases eligible holds at zero once they are ten minutes old. Submitting the question again creates a separate request.
What does the statement store?
For a successful call, the usage record contains identifiers, model, token counts, routing attempts, currency conversion and charges. This describes the billing record only. It does not establish a provider retention policy.

What happens to a long prompt?

Channel measures the UTF-8 bytes in all message contents combined. Exactly 4,096 bytes is within the limit. By default, at 4,097 bytes, the gateway returns HTTP 400 before reserving credit or contacting a provider. Send the relevant earlier turns on each call. The gateway accepts a user question, a previous assistant reply and a user follow-up in that order. For long histories, set "plugins":[{"id":"context-compression"}]. Channel accepts up to 1,023 conversation messages plus one optional system message and 262,144 total content bytes before compression. It validates every role, then removes whole user/assistant exchanges from the middle until the forwarded history fits both limits. The system message and final user question always survive intact. If these alone exceed 4,096 bytes the request fails before inference. Read channel.messages_removed on success. Disable trimming by omitting the plugin or setting enabled to false. Omitted material is unavailable to the model.

Keep the original document in your application. Select the passage needed for the question, retain its source reference, then check the size of the complete question and excerpt together. For Python use len(message.encode("utf-8")). In Rust use message.len() on a UTF-8 string. In C++ use message.size() on a UTF-8 encoded std::string. For evidence-sensitive tasks, tell the user which excerpt was used.

Workspace and request compatibility

Workspaces and guardrails
A workspace wallet funds its clients. Client keys scope inference and statements. A wallet reservation enforces available credit. A caller can restrict providers on one request. Channel has no documented hierarchy of organisation policies, per-key guardrail assignments or policy preview. A request-level preference alone cannot enforce an organisation-wide rule.
Files and containers
Keep originals and execution environments in your application. The inference API has no file upload, reusable file ID, container mount or hosted runtime. Supply a text excerpt to the chat endpoint.
Presets, Body Builder and latest-model resolution
Store reusable request settings in application code. Build the request with a connected model ID or explicit fallback list. Channel offers no hosted preset lookup, natural-language request builder or model alias that tracks the latest release.
Structured outputs and decisions
For a classification such as “accepted” or “needs review”, validate the answer against the allowed values before using it. Channel returns generated text. It does not forward a JSON schema for enforcement or expose a dedicated Decisions endpoint. A successful HTTP response alone cannot establish schema compliance.
Batch jobs
Submit and track each chat request individually. Keep its receipt alongside your own job ID. There is no asynchronous batch submission, status endpoint or batch discount in the chat workflow. Retrying a submission creates a separate request.
App attribution
Use a client key for usage you want to identify on a client statement. Channel has no documented public app ranking or attribution-header workflow. Workspace totals describe usage billed through that workspace.