Unified Query Interface for Multiple Coding Agents

Swap between Claude Agent, OpenAI Agent, and Pi AI with a single query() function

Updated: 6/7/2026
Difficulty
easy
Time
5m
Use Case
Multi-provider agent orchestration, provider comparison, fallback routing
Popularity
0 views

About this automation

LiteHarness provides a single query() function that abstracts the differences between Claude Agent, OpenAI Agent, and Pi AI SDKs. Builders specify the harness and model as options and iterate over streamed messages without learning provider-specific APIs.

How to implement

1

Import query function from @lite-harness/sdk

2

Define prompt and options (harness type, model name)

3

Call query() with async iteration to stream responses

4

Switch harness by changing the harness option string

5

Handle messages uniformly across all providers