anthropic / Exports / IAnthropicProviderOptions
Interface: IAnthropicProviderOptions
Anthropic provider options
Note: Anthropic API doesn't support response format configuration. JSON output can be requested through prompt instructions.
Hierarchy
↳
IAnthropicProviderOptions
Table of contents
Properties
Properties
apiKey
• Optional apiKey: string
Anthropic API key (required when client is not provided)
Defined in
timeout
• Optional timeout: number
API request timeout (milliseconds)
Defined in
baseURL
• Optional baseURL: string
API base URL
Defined in
client
• Optional client: Anthropic
Anthropic client instance (optional: will be created from apiKey if not provided)
Defined in
executor
• Optional executor: IExecutor
Optional executor for handling AI requests
When provided, the provider will delegate all chat operations to this executor instead of making direct API calls. This enables remote execution capabilities.
Example
typescript
import { LocalExecutor, RemoteExecutor } from '@robota-sdk/agent-core';
// Local execution (registers this provider)
const localExecutor = new LocalExecutor();
localExecutor.registerProvider('anthropic', new AnthropicProvider({ apiKey: 'sk-ant-...' }));
// Remote execution
const remoteExecutor = new RemoteExecutor({
serverUrl: 'https://api.robota.io',
userApiKey: 'user-token-123',
});
const provider = new AnthropicProvider({
executor: remoteExecutor, // No direct API key needed
});