interlens.participant.participants.api_client¶
interlens.participant.participants.api_client
¶
AnthropicClient
¶
Bases: _RetryingClient
Claude via the anthropic SDK (the default provider). Uses Anthropic's separate system param.
Source code in src/interlens/participant/participants/api_client.py
submit_batch
¶
Anthropic Message Batches API: one messages.batches.create submits every request (tagged with a
positional custom_id), then poll retrieve until processing_status == 'ended' and stream
results back, reassembled into input order. A non-succeeded per-request result raises.
Source code in src/interlens/participant/participants/api_client.py
OpenAIClient
¶
Bases: _OpenAICompatClient
OpenAI directly via the openai SDK (provider="openai"). Reads OPENAI_API_KEY. Supports the
asynchronous Batch API for large rollouts.
Source code in src/interlens/participant/participants/api_client.py
submit_batch
¶
OpenAI Batch API: upload a JSONL of /v1/chat/completions requests (positional custom_id),
batches.create with a 24h window, poll until status == 'completed', then download + parse the
output file back into input order. A failed/expired/cancelled batch raises.
Source code in src/interlens/participant/participants/api_client.py
OpenRouterClient
¶
Bases: _OpenAICompatClient
OpenRouter (https://openrouter.ai) via the OpenAI-compatible openai SDK — one endpoint proxying many
providers' models (e.g. anthropic/claude-sonnet-5, openai/gpt-5, meta-llama/llama-3.1-70b-instruct).
Reads OPENROUTER_API_KEY. OpenRouter has no batch API, so submit_batch inherits the base's raise —
requesting batch mode on an OpenRouter participant fails loudly.