package openrouter_api

  1. Overview
  2. Docs
OCaml client for the OpenRouter API

Install

dune-project
 Dependency

Authors

Maintainers

Sources

v0.1.0.tar.gz
md5=37c701d570788095f9a0690e401a4b0c
sha512=0f6e6d347094aff4efb50330d50ade3f1706929400498998a8d8f409f1ab45099d792cc469210e53c2ca06b0e1a9b20fdf8e89361a52969cc495812092fe584b

doc/openrouter_api/Openrouter_api/Generation/Stats/index.html

Module Generation.StatsSource

Stats for a single generation. Many fields are nullable on the wire; we keep them as options rather than papering over with defaults.

Sourcetype t = {
  1. id : string;
  2. model : string;
  3. provider_name : string option;
  4. created_at : string;
  5. api_type : string option;
  6. origin : string option;
  7. user_agent : string option;
  8. http_referer : string option;
  9. session_id : string option;
  10. request_id : string option;
  11. upstream_id : string option;
  12. app_id : Jsonaf.t option;
  13. external_user : Jsonaf.t option;
  14. router : Jsonaf.t option;
  15. streamed : bool option;
  16. cancelled : bool option;
  17. is_byok : bool option;
  18. finish_reason : string option;
  19. native_finish_reason : string option;
  20. service_tier : string option;
  21. latency : int option;
  22. moderation_latency : int option;
  23. generation_time : int option;
  24. tokens_prompt : int option;
  25. tokens_completion : int option;
  26. native_tokens_prompt : int option;
  27. native_tokens_completion : int option;
  28. native_tokens_completion_images : int option;
  29. native_tokens_reasoning : int option;
  30. native_tokens_cached : int option;
  31. num_media_prompt : int option;
  32. num_input_audio_prompt : int option;
  33. num_media_completion : int option;
  34. num_search_results : int option;
  35. num_fetches : int option;
  36. web_search_engine : string option;
  37. usage : float option;
  38. total_cost : float option;
  39. upstream_inference_cost : float option;
  40. cache_discount : float option;
  41. response_cache_source_id : string option;
  42. provider_responses : Provider_response.t list;
}
Sourcemodule Fields : sig ... end
include Sexplib0.Sexpable.S with type t := t
Sourceval t_of_sexp : Sexplib0.Sexp.t -> t
Sourceval sexp_of_t : t -> Sexplib0.Sexp.t