NOIR
Integrations

Models and OpenRouter

Bring an AI SDK provider model directly, or use Noir's low-level OpenAI-compatible adapter when necessary.

Models are not Noir connectors. Create them with the provider's own package and pass the model directly to noir().

npm install ai @openrouter/ai-sdk-provider
import { noir } from '@noir-agent/agent'
import { createOpenRouter } from '@openrouter/ai-sdk-provider'

const openrouter = createOpenRouter({
  apiKey: process.env.OPENROUTER_API_KEY!,
})

export default noir({
  id: 'operator',
  instructions: 'Use tools for facts and keep answers concise.',
  model: openrouter(process.env.OPENROUTER_MODEL ?? 'openai/gpt-5-mini'),
  channels: { slack: slack() },
})

Noir converts the AI SDK model at the boundary. Tool calls still run locally through Noir, so input validation, effects, approvals, retries, and result projection remain enforceable.

Any AI SDK provider

The same shape works with Anthropic, OpenAI, Google, Amazon Bedrock, or another current AI SDK provider. Install the provider package, construct its language model, and pass it. Do not wait for Noir to publish a wrapper.

Low-level adapter

Use @noir-agent/agent/models/openai-compatible for an existing OpenAI-compatible endpoint when the provider has no AI SDK implementation:

import { openAICompatible } from '@noir-agent/agent/models/openai-compatible'

const model = openAICompatible({
  model: 'internal/model',
  baseUrl: 'https://models.example.com/v1',
  apiKey: process.env.MODEL_API_KEY,
  maxTokens: 4_000,
})

The adapter supports headers, temperature, token parameter selection, usage parsing, provider-safe tool names, and explicit prompt-cache behavior.

Operational guidance

Set a model ID through configuration so traces and evals can attribute behavior. Bound steps and total runtime independently from provider timeouts. Treat usage reported by the provider response as diagnostic; the provider bill is authoritative. Run live tool-call evals before switching models because schema adherence and parallel call behavior differ.

On this page