Skip to main content

Custom Executors

Executors handle the actual communication with AI service providers. You can create custom executors to integrate new providers or modify existing behavior.

Executor Interface

To create a custom executor, implement the Executor interface:

Executor Types

The SDK defines key types for request/response handling:

Complete Executor Example

Here’s a complete custom executor implementation:

Registering Executors

Register your executor with the core auth manager:

Using Executors

Executors are automatically selected based on the auth provider:
Requests to models from “myprovider” will use MyExecutor.

Custom Translators

Translators convert requests and responses between different API formats (e.g., OpenAI ↔ Custom Provider).

Translator Interface

Register translators between format pairs:

Request Transformation

Response Transformation

Complete Translator Example

Next Steps

Access Providers

Implement custom authentication

File Watching

Configuration and auth file watching

Usage Tracking

Monitor API usage

Examples

Browse complete examples