Providers

Providers

noumen supports OpenAI, Anthropic, and Google Gemini as AI providers, all behind a unified interface.

noumen is provider-agnostic. Every provider implements the AIProvider interface, which accepts OpenAI-compatible chat parameters and returns an async iterable of streaming chunks. You can swap providers without changing any application code.

Supported providers

The AIProvider interface

All providers implement this interface:

interface AIProvider {
  chat(params: ChatParams): AsyncIterable<ChatStreamChunk>;
}

The ChatParams type includes:

FieldTypeDescription
modelstringModel identifier
messagesChatMessage[]Conversation history
toolsToolDefinition[]Available tool definitions
max_tokensnumberMaximum output tokens
systemstringSystem prompt
temperaturenumberSampling temperature

Each provider internally converts these to their native SDK format and normalizes the streaming output back to a common ChatStreamChunk shape.

Token usage

All three providers populate a usage field on the final streaming chunk:

interface ChatCompletionUsage {
  prompt_tokens: number;
  completion_tokens: number;
  total_tokens: number;
}

This is automatically captured by the Thread and emitted as usage and turn_complete stream events. See Stream Events for details.