Openrouter_api.CompletionsChat completions and streaming chat completions.
module Reasoning_detail : sig ... endmodule Image : sig ... endmodule Audio_output : sig ... endmodule Tool : sig ... endTool definition for function calling and OpenRouter server-side tools. Server tools (web search, web fetch, datetime, image generation) are executed by OpenRouter on your behalf and their results fed back to the model — no local function dispatch required.
module Tool_choice : sig ... endTool choice configuration
module Tool_call : sig ... endTool call made by the model
module Plugin : sig ... endPlugin configuration for OpenRouter plugins. See https://openrouter.ai/docs/guides/features/plugins/overview
module Citation : sig ... endURL citation from web search results.
module Message : sig ... endmodule Request : sig ... endmodule Logprobs : sig ... endmodule Response : sig ... endmodule Stream_chunk : sig ... endval create :
api_key:string ->
?app_info:Http.App_info.t ->
?on_response_body:(string -> unit Async.Deferred.t) ->
[ `Non_streaming ] Request.t ->
Response.t Core.Or_error.t Async.Deferred.tval create_stream :
api_key:string ->
?app_info:Http.App_info.t ->
?on_stream_chunk:(string -> unit Async.Deferred.t) ->
[ `Streaming ] Request.t ->
Stream_chunk.t Core.Or_error.t Async.Pipe.Reader.t Async.Deferred.tmodule For_testing : sig ... end