12345678910111213141516171819202122232425262728typefetch_fn=url:string->headers:(string*string)list->body:string->Yojson.Basic.tLwt.ttypet={api_key:stringoption;base_url:string;default_headers:(string*string)list;fetch:fetch_fnoption;}letcreate?api_key?base_url?(headers=[])?fetch()=letapi_key=matchapi_keywith|Some_->api_key|None->Sys.getenv_opt"ANTHROPIC_API_KEY"inletbase_url=matchbase_urlwith|Someurl->url|None->"https://api.anthropic.com/v1"in{api_key;base_url;default_headers=headers;fetch}letapi_key_exnt=matcht.api_keywith|Somekey->key|None->failwith"Anthropic API key not configured. Set ANTHROPIC_API_KEY environment variable or pass ~api_key to Config.create."