package ocaml-ai-sdk

  1. Overview
  2. Docs
Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source

Module Ai_provider_openrouter.Openrouter_optionsSource

OpenRouter-specific provider options.

Matches the upstream TypeScript @openrouter/ai-sdk-provider OpenRouterChatSettings type.

Sourcetype reasoning_effort =
  1. | Xhigh
  2. | High
  3. | Medium
  4. | Low
  5. | Minimal
  6. | None_
Sourcetype reasoning_config = {
  1. enabled : bool option;
  2. exclude : bool option;
  3. budget : reasoning_budget;
}
Sourceand reasoning_budget =
  1. | Max_tokens of int
  2. | Effort of reasoning_effort
  3. | No_budget
Sourcetype cache_control = {
  1. type_ : string;
  2. ttl : string option;
}
Sourcetype debug_config = {
  1. echo_upstream_body : bool option;
}
Sourcetype web_search_options = {
  1. max_results : int option;
  2. search_prompt : string option;
  3. engine : string option;
  4. search_context_size : string option;
}
Sourcetype usage_config = {
  1. include_ : bool;
}
Sourcetype max_price = {
  1. prompt : float option;
  2. completion : float option;
  3. image : float option;
  4. audio : float option;
  5. request : float option;
}
Sourcetype throughput_percentile = {
  1. percentile : float;
  2. min_provider_count : int option;
}
Sourcetype latency_percentile = {
  1. percentile : float;
  2. max_provider_count : int option;
}
Sourcetype throughput_preference =
  1. | Throughput_value of float
  2. | Throughput_percentile of throughput_percentile
Sourcetype latency_preference =
  1. | Latency_value of float
  2. | Latency_percentile of latency_percentile
Sourcetype provider_prefs = {
  1. order : string list;
  2. allow_fallbacks : bool option;
  3. require_parameters : bool option;
  4. data_collection : string option;
  5. only : string list;
  6. ignore_ : string list;
  7. quantizations : string list;
  8. sort : string option;
  9. max_price : max_price option;
  10. zdr : bool option;
  11. preferred_min_throughput : throughput_preference option;
  12. preferred_max_latency : latency_preference option;
  13. enforce_distillable_text : bool option;
}
Sourcetype plugin =
  1. | File_parser of file_parser_plugin_config option
  2. | Auto_router of auto_router_plugin_config option
  3. | Moderation
  4. | Response_healing
Sourceand web_search_plugin_config = {
  1. max_results : int option;
  2. search_prompt : string option;
  3. engine : string option;
  4. include_domains : string list;
  5. exclude_domains : string list;
}
Sourceand file_parser_plugin_config = {
  1. max_files : int option;
  2. pdf_engine : string option;
}
Sourceand auto_router_plugin_config = {
  1. allowed_models : string list;
}
Sourcetype t = {
  1. models : string list;
  2. logit_bias : (int * float) list;
  3. logprobs : [ `Bool of bool | `Int of int ] option;
  4. parallel_tool_calls : bool option;
  5. user : string option;
  6. reasoning : reasoning_config option;
  7. include_reasoning : bool option;
  8. plugins : plugin list;
  9. web_search_options : web_search_options option;
  10. provider : provider_prefs option;
  11. cache_control : cache_control option;
  12. debug : debug_config option;
  13. usage : usage_config option;
  14. extra_body : (string * Yojson.Basic.t) list;
  15. strict_json_schema : bool;
  16. system_message_mode : Model_catalog.system_message_mode option;
}
Sourceval default : t
Sourceval to_provider_options : t -> Ai_provider.Provider_options.t
Sourceval of_provider_options : Ai_provider.Provider_options.t -> t option

JSON serialization functions.

Sourceval reasoning_effort_to_string : reasoning_effort -> string
Sourceval reasoning_config_to_json : reasoning_config -> Melange_json.t
Sourceval cache_control_to_json : cache_control -> Melange_json.t
Sourceval debug_config_to_json : debug_config -> Melange_json.t
Sourceval web_search_options_to_json : web_search_options -> Melange_json.t
Sourceval usage_config_to_json : usage_config -> Melange_json.t
Sourceval max_price_to_json : max_price -> Melange_json.t
Sourceval provider_prefs_to_json : provider_prefs -> Melange_json.t
Sourceval plugin_to_json : plugin -> Melange_json.t
Sourceval plugins_to_json : plugin list -> Melange_json.t list
Sourceval logit_bias_to_json : (int * float) list -> Melange_json.t
Sourceval logprobs_to_json : [ `Bool of bool | `Int of int ] -> Melange_json.t * Melange_json.t option