Skip to main content

Module api

Module api 

Source
Expand description

Wire API implementations, one per API id, and dispatch by model.

Modules§

anthropic
anthropic-messages: the Anthropic Messages API and compatible endpoints.
bedrock
bedrock-converse-stream: Amazon Bedrock’s ConverseStream API.
classify
Classifier APIs: TypeSafe’s System One protocol, the same protocol on Cloudflare Workers AI, and classification with a llama.cpp chat model.
google
google-generative-ai: the Gemini API’s streamGenerateContent.
images
Image generation over OpenRouter’s chat completions endpoint.
mistral
mistral-conversations: Mistral’s native chat completions endpoint.
openai_completions
openai-completions: the OpenAI Chat Completions API and the many compatible endpoints, with per-provider compat flags.
openai_responses
The OpenAI Responses API and its two variants: openai-responses, azure-openai-responses and openai-codex-responses (ChatGPT’s Codex backend).
pi_messages
pi-messages: pi’s own message protocol, spoken by the Radius gateway.

Structs§

Apis
Wire APIs by id: the built-ins plus any registered by extensions.
CodexWebSocketStats
pi’s OpenAICodexWebSocketDebugStats for one session.

Traits§

ModelOperations
The classifier and image APIs that a provider registered by an extension implements (pi-ai’s classify and generateImages of the provider).

Functions§

builtin
The built-in implementation of a wire API id.
close_codex_websockets
pi’s closeOpenAICodexWebSocketSessions: closes the sockets session_id keeps, or every session’s. A socket in use closes when its request ends.
codex_websocket_stats
pi’s getOpenAICodexWebSocketDebugStats: what session_id’s WebSocket requests did in this process.
failed_stream
A stream that ends at once with message as its error.
reset_codex_websocket_stats
pi’s resetOpenAICodexWebSocketDebugStats: forgets the statistics and the SSE fallback of session_id, or of every session.