29 lines
734 B
C
Raw Normal View History

2025-01-04 15:54:48 +00:00
// Written by retoor@molodetz.nl
// This source code declares a constant character pointer variable with a value representing an API key.
// MIT License
#include <stdlib.h>
const char * resolve_api_key(){
2025-01-05 21:59:51 +00:00
char * api_key;
#ifndef FREE_VERSION
api_key = getenv("R_KEY");
2025-01-04 15:54:48 +00:00
if(api_key)
{
return api_key;
}
api_key = getenv("OPENAI_API_KEY");
if(api_key)
{
return api_key;
}
2025-01-04 16:04:14 +00:00
fprintf(stderr, "\nThere is no API key configured in environment.\n");
2025-01-05 21:59:51 +00:00
exit(1);
#endif
api_key = "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";
return api_key;
2025-01-04 15:54:48 +00:00
}