Sign in or sign up to create your secrets
Use this free simple service to keep your API keys, passwords and other secrets out of your code. This works great with ChatGPT from OpenAI, Amazon AWS, MySql and other databases, etc. I created this secure by design service because I was running code on Kaggle, AWS and my local system and didn't want to accidentally expose my keys.
Check out samples of accessing your secrets using a single line of code with a helper function, a simple javascript website or use the REST API directly. With the powershell example a session is stored so you will only need to enter credentials once for the day. Run a simple Python ChatGPT chat program.
When using the helper function, you can optionally pass in parameters or allow the function to prompt for input. If you specify to cache the session token, then you won't be prompted again until the session times out (default 12 hours).
Python example using helper function to prompt once and store OpenAI key for ChatGPT:
from secrets import getSecret
# by default you will be prompted once for username and password to get value for keyname
open.api_key = getSecret('MyOpenAIKey')
Linux bash example fetching directly with user and password variables:
export secret="$(curl 'https://api.SimpleSecretService.com/value?user=USER&password=PASS!&key=NAME')"
Javascript example using helper function to prompt once and store secret:
import secretUtil from './secrets.js';
const { getSecret } = secretUtil;
const secret = getSecret('MyOpenAIKey');
Powershell example fetching directly with user and password variables:
$SimpleSecret = (curl "https://api.SimpleSecretService.com/value?user=$user&password=$password&key=$keyname").Content
Curl example fetching directly with user and password variables:
curl -X "GET" "https://api.simplesecretservice.com/value?user=USERNAME&password=PASSWORD!&key=MYKEYNAME"
Windows batch file
for /f "delims=" %%a in ('curl -X "GET" "https://api.simplesecretservice.com/value?user=USER&password=PASSWORD!&key=KEY"') do (
set "myVar=%%a"
)
Sign in or sign up to create your secrets
For a full professional or organizational solution try Delinea Platform or Delinea Secret Server