Skip to content
robotadocs

Providers Reference

Every chat provider implements the same IAIProvider interface from @robota-sdk/agent-core. You can pass any of them to Robota, createQuery() or createAgentRuntime(), and the calling code does not change.

Swap with zero code changes. The only thing you change when switching providers is which provider object you construct and pass in. All agent logic, tools, and session handling remain identical.


Provider Overview

Each provider is a protocol client, not a model-vendor lock: it speaks an API surface, and any endpoint speaking that surface works via baseURL — AI gateways (Vercel AI Gateway, LiteLLM, OpenRouter), Azure, vLLM, Ollama, LM Studio. Model slugs pass through verbatim, so routing anthropic/claude-* or meta-llama/* through an OpenAI-protocol gateway is a one-line config.

ProviderImport pathAPI surface it speaksAuth method
OpenAI@robota-sdk/agent-provider-openaiOpenAI API — official or ANY compatible endpoint (gateways, Azure, vLLM, local)OPENAI_API_KEY (or gateway key)
Anthropic@robota-sdk/agent-provider-anthropicAnthropic Messages APIANTHROPIC_API_KEY
Gemini@robota-sdk/agent-provider-geminiGoogle GenAI APIGEMINI_API_KEY
DeepSeek@robota-sdk/agent-provider-openai-compatibleOpenAI-compatible (DeepSeek endpoint default)DEEPSEEK_API_KEY
Qwen (Alibaba)@robota-sdk/agent-provider-openai-compatibleOpenAI-compatible (DashScope endpoint default)DASHSCOPE_API_KEY
Gemma / OpenAI-compatible@robota-sdk/agent-provider-openai-compatibleOpenAI-compatible (bring your own endpoint)none for local servers

AI gateways (Vercel AI Gateway, LiteLLM, OpenRouter): Use the OpenAIProvider with the gateway's baseURL and a gateway model slug — see Through an AI gateway.

Local models (Ollama, LM Studio, llama.cpp): Use the GemmaProvider with a custom baseURL. See Local LLM Setup for a step-by-step guide.


Anthropic

Claude models. Best for long-context tasks, code generation, and nuanced reasoning.

Install

npm install @robota-sdk/agent-provider-anthropic

The package depends on the Anthropic SDK itself; install @anthropic-ai/sdk in your project only if you build the client yourself (below).

Basic usage

import { AnthropicProvider } from '@robota-sdk/agent-provider-anthropic';
 
const provider = new AnthropicProvider({
  apiKey: process.env.ANTHROPIC_API_KEY!,
});

Configuration options

OptionTypeRequiredDescription
apiKeystringYes (unless client provided)Anthropic API key
clientAnthropicNoPre-built Anthropic SDK client
baseURLstringNoAny Anthropic-Messages-API-compatible endpoint (proxy/gateway)
timeoutnumberNoRequest timeout in milliseconds
executorIExecutorNoRemote or local executor override

With a pre-built client

import Anthropic from '@anthropic-ai/sdk';
import { AnthropicProvider } from '@robota-sdk/agent-provider-anthropic';
 
const client = new Anthropic({
  apiKey: process.env.ANTHROPIC_API_KEY,
  maxRetries: 3,
});
 
const provider = new AnthropicProvider({ client });

OpenAI

The OpenAI protocol client. Official OpenAI models (GPT and o-series) with native JSON mode, structured outputs, and the Responses API — and, via baseURL, any OpenAI-compatible endpoint: AI gateways, Azure OpenAI, vLLM, Ollama, LM Studio.

Install

npm install @robota-sdk/agent-provider-openai

Basic usage

import { OpenAIProvider } from '@robota-sdk/agent-provider-openai';
 
const provider = new OpenAIProvider({
  apiKey: process.env.OPENAI_API_KEY!,
});

Configuration options

OptionTypeRequiredDescription
apiKeystringYes (unless client provided)OpenAI API key
clientOpenAINoPre-built OpenAI SDK client
organizationstringNoOpenAI organization ID
baseURLstringNoAny OpenAI-compatible endpoint — gateways, Azure, vLLM, local
defaultModelstringNoModel used when a request names none
timeoutnumberNoRequest timeout in milliseconds
apiSurface'responses' | 'chat-completions'NoAPI surface (default: responses for OpenAI, chat-completions when baseURL is set)
responseFormat'text' | 'json_object' | 'json_schema'NoResponse format
jsonSchemaIOpenAIJsonSchemaDefinitionNoSchema for responseFormat: 'json_schema'
reasoningIOpenAIResponsesReasoningOptionsNoReasoning effort and summary for reasoning models (Responses API)
storebooleanNoWhether OpenAI stores Responses API results
includeEncryptedReasoningbooleanNoInclude encrypted reasoning items for stateless continuation
strictToolsbooleanNoStrict function-parameter validation (rewrites tool schemas for strict mode)
nativeWebToolsIOpenAINativeWebToolsOptionsNoOpenAI's hosted webSearch / webFetch tools (not available on custom endpoints)
includeStreamUsagebooleanNoRequest token usage on streaming turns (default true; turn off for endpoints that reject it)
payloadLoggerIPayloadLoggerNoReceives a summary of each Chat Completions request (loggers in .../agent-provider-openai/loggers)
executorIExecutorNoRemote or local executor override
loggerILoggerNoInternal logger (default: silent)

Through an AI gateway

Point baseURL at any OpenAI-compatible gateway and use the gateway's model slug — non-OpenAI models route through the same provider. Streaming and tool calling work unchanged; the slug is passed to the endpoint verbatim.

import { OpenAIProvider } from '@robota-sdk/agent-provider-openai';
 
// Vercel AI Gateway serving an Anthropic model
const provider = new OpenAIProvider({
  apiKey: process.env.AI_GATEWAY_API_KEY!,
  baseURL: 'https://ai-gateway.vercel.sh/v1',
  defaultModel: 'anthropic/claude-sonnet-4-5',
});

The same pattern covers LiteLLM (http://localhost:4000/v1), OpenRouter (https://openrouter.ai/api/v1), and Azure OpenAI deployments. Setting baseURL switches the default apiSurface to chat-completions for endpoint compatibility.

JSON output

import { OpenAIProvider } from '@robota-sdk/agent-provider-openai';
 
const provider = new OpenAIProvider({
  apiKey: process.env.OPENAI_API_KEY!,
  responseFormat: 'json_object',
});

o-series reasoning

import { OpenAIProvider } from '@robota-sdk/agent-provider-openai';
 
const provider = new OpenAIProvider({
  apiKey: process.env.OPENAI_API_KEY!,
  reasoning: { effort: 'high', summary: 'auto' },
});

Gemini

Google's Gemini models. Supports image generation, thinking mode, and native multimodal inputs.

Install

npm install @robota-sdk/agent-provider-gemini

Basic usage

import { GeminiProvider } from '@robota-sdk/agent-provider-gemini';
 
const provider = new GeminiProvider({
  apiKey: process.env.GEMINI_API_KEY!,
});

Configuration options

OptionTypeRequiredDescription
apiKeystringYesGoogle AI API key
defaultModelstringNoModel used when a request names none
responseMimeType'text/plain' | 'application/json'NoResponse format
responseSchemaobjectNoSchema for JSON output
responseJsonSchemaobjectNoJSON Schema for structured output (instead of responseSchema)
thinkingConfigIGeminiThinkingConfigNoThinking mode settings
safetySettingsIGeminiSafetySetting[]NoPer-category safety thresholds
toolConfigobjectNoFunction-calling config passed to Gemini
defaultResponseModalitiesArray<'TEXT' | 'IMAGE'>NoDefault response modalities, e.g. text and image
imageCapableModelsstring[]NoModels allowed to return images; others are refused
executorIExecutorNoRemote or local executor override

Thinking mode

import { GeminiProvider } from '@robota-sdk/agent-provider-gemini';
import type { IGeminiThinkingConfig } from '@robota-sdk/agent-provider-gemini';
 
const thinkingConfig: IGeminiThinkingConfig = {
  includeThoughts: true,
  thinkingBudget: 8192,
};
 
const provider = new GeminiProvider({
  apiKey: process.env.GEMINI_API_KEY!,
  thinkingConfig,
});

DeepSeek

DeepSeek models including the R-series reasoning models. Uses the OpenAI-compatible API under the hood.

Install

npm install @robota-sdk/agent-provider-openai-compatible

Basic usage

import { DeepSeekProvider } from '@robota-sdk/agent-provider-openai-compatible';
 
const provider = new DeepSeekProvider({
  apiKey: process.env.DEEPSEEK_API_KEY!,
});

Configuration options

OptionTypeRequiredDescription
apiKeystringYes (unless client provided)DeepSeek API key
clientOpenAINoPre-built OpenAI SDK client pointed at DeepSeek
baseURLstringNoDefault: https://api.deepseek.com
defaultModelstringNoDefault: deepseek-v4-flash
thinking'enabled' | 'disabled'NoEnable extended thinking
reasoningEffort'low' | 'medium' | 'high' | 'xhigh' | 'max'NoReasoning depth
timeoutnumberNoRequest timeout in milliseconds
executorIExecutorNoRemote or local executor override
loggerILoggerNoInternal logger

Reasoning model with extended thinking

import { DeepSeekProvider } from '@robota-sdk/agent-provider-openai-compatible';
 
const provider = new DeepSeekProvider({
  apiKey: process.env.DEEPSEEK_API_KEY!,
  thinking: 'enabled',
  reasoningEffort: 'high',
});

Qwen (Alibaba Cloud)

Alibaba's Qwen models, accessed via DashScope. Supports built-in web search and web extraction tools.

Install

npm install @robota-sdk/agent-provider-openai-compatible

Basic usage

import { QwenProvider } from '@robota-sdk/agent-provider-openai-compatible';
 
const provider = new QwenProvider({
  apiKey: process.env.DASHSCOPE_API_KEY!,
});

Configuration options

OptionTypeRequiredDescription
apiKeystringYes (unless client provided)DashScope API key
clientOpenAINoPre-built OpenAI SDK client pointed at DashScope
baseURLstringNoRegional endpoint (see below)
responsesBaseURLstringNoEndpoint for DashScope's Responses-compatible API
defaultModelstringNoDefault: qwen-plus
builtInWebToolsIQwenBuiltInWebToolsOptionsNoQwen-native web search / web fetch
timeoutnumberNoRequest timeout in milliseconds
executorIExecutorNoRemote or local executor override
loggerILoggerNoInternal logger

Regional endpoints

DashScope has region-specific endpoints. The default is Singapore (https://dashscope-intl.aliyuncs.com/compatible-mode/v1). QWEN_PROVIDER_BASE_URLS holds the endpoints for singapore, usVirginia, beijing and hongKong:

import { QwenProvider } from '@robota-sdk/agent-provider-openai-compatible';
import { QWEN_PROVIDER_BASE_URLS } from '@robota-sdk/agent-provider-openai-compatible';
 
const provider = new QwenProvider({
  apiKey: process.env.DASHSCOPE_API_KEY!,
  baseURL: QWEN_PROVIDER_BASE_URLS.usVirginia,
});

Native web tools

import { QwenProvider } from '@robota-sdk/agent-provider-openai-compatible';
 
const provider = new QwenProvider({
  apiKey: process.env.DASHSCOPE_API_KEY!,
  builtInWebTools: { webSearch: true, webFetch: true },
});

Gemma / OpenAI-Compatible

A generic OpenAI-compatible provider. Use it for:

  • Ollama, LM Studio and the llama.cpp server (local)
  • Any other endpoint that implements the OpenAI Chat Completions API

In the robota CLI this is the provider type gemma, listed in setup as "Ollama / LM Studio / llama.cpp"; its setup defaults are LM Studio's http://localhost:1234/v1 and the placeholder key lm-studio.

Install

npm install @robota-sdk/agent-provider-openai-compatible

Basic usage

import { GemmaProvider } from '@robota-sdk/agent-provider-openai-compatible';
 
const provider = new GemmaProvider({
  apiKey: 'any-value', // many local servers do not validate this
  baseURL: 'http://localhost:11434/v1', // Ollama default
  defaultModel: 'llama3.2',
});

Configuration options

OptionTypeRequiredDescription
apiKeystringNoAPI key (required by the SDK but not validated by most local servers)
baseURLstringNoServer URL including /v1 path
defaultModelstringNoModel name as recognised by the server
timeoutnumberNoRequest timeout in milliseconds
clientOpenAINoPre-built OpenAI SDK client
executorIExecutorNoRemote or local executor override
loggerILoggerNoInternal logger

LM Studio

import { GemmaProvider } from '@robota-sdk/agent-provider-openai-compatible';
 
const provider = new GemmaProvider({
  apiKey: 'lm-studio',
  baseURL: 'http://localhost:1234/v1',
  defaultModel: 'gemma-3-12b', // the model name LM Studio shows for the loaded model
});

See the Local LLM Setup guide for Ollama, LM Studio, and llama.cpp configuration details.


Other provider packages

  • @robota-sdk/agent-provider-bytedance — BytedanceProvider, a video-generation provider for ByteDance ModelArk (Seedance). It implements IVideoGenerationProvider (createVideo, getVideoJob, cancelVideoJob) rather than the chat IAIProvider, so it is not an agent's chat model.
  • @robota-sdk/agent-builtin-providers — createDefaultProviderDefinitions(), the provider definitions (setup steps, defaults, model catalogs) the robota CLI offers for anthropic, openai, gemini, gemma, qwen and deepseek. Use it when your own host wants the same settings-driven provider selection.

Switching Providers

Because all providers implement IAIProvider, switching is a one-line change:

import { Robota } from '@robota-sdk/agent-core';
import { AnthropicProvider } from '@robota-sdk/agent-provider-anthropic';
import { OpenAIProvider } from '@robota-sdk/agent-provider-openai';
import { GeminiProvider } from '@robota-sdk/agent-provider-gemini';
 
// Register multiple providers — agent picks the right one from defaultModel.provider
const agent = new Robota({
  name: 'MultiProviderAgent',
  aiProviders: [
    new AnthropicProvider({ apiKey: process.env.ANTHROPIC_API_KEY! }),
    new OpenAIProvider({ apiKey: process.env.OPENAI_API_KEY! }),
    new GeminiProvider({ apiKey: process.env.GEMINI_API_KEY! }),
  ],
  defaultModel: {
    provider: 'anthropic',
    model: 'claude-sonnet-4-6',
  },
  systemMessage: 'You are a helpful assistant.',
});
 
// Use default provider
const r1 = await agent.run('Summarise this document.');
 
// Switch provider and model at runtime — no other code changes needed
agent.setModel({ provider: 'openai', model: 'gpt-4o' });
const r2 = await agent.run('Now translate that summary to French.');
 
// Switch to Gemini
agent.setModel({ provider: 'gemini', model: 'gemini-2.0-flash' });
const r3 = await agent.run('Rate the translation quality.');

The same pattern works with createQuery and createAgentRuntime — simply pass a different provider object at construction time.