How to use Obscurify with curl
First, create an account. You get a random 16-digit account number: save it, it is the only way to sign in and we can’t show it again.
curl -X POST https://obscurify.ai/create_account \
-H 'Content-Type: application/json' \
-d '{"accept_tos": true}'
Response:
{"message": "Account created. Save your account number: it is the only way to sign in.",
"account_number": "1234 5678 9012 3456"}
Then get your API key from the account number. The key is computed from your account and never stored, so asking again returns the same key:
curl -X POST https://obscurify.ai/generate_token \
-H 'Content-Type: application/json' \
-d '{"account_number": "1234 5678 9012 3456"}'
Response:
{"message": "This is your API key. You can get it again from your account number.",
"token": "sk-obs1_AbCd..."}
Add credit with a voucher. Buy one on your account page with crypto or card: your browser blinds it, so we can’t link the payment to your account. To redeem a voucher code over the API:
curl -X POST https://obscurify.ai/vouchers/redeem \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer sk-obs1_AbCd...' \
-d '{"vouchers": ["obv1.2000...."]}'
Signed up with a username and password? Password sign-in and old
sk-tokens withoutobs1are being retired. Sign in once at obscurify.ai/account to get your account number, then use the key above.
Then use curl to interact with the API:
curl -X POST https://obscurify.ai/chat/completions \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer sk-obs1_AbCd...' \
-d '{"messages": [{"role": "system", "content": "You are a helpful assistant."},
{"role": "user", "content": "Hello, AI!"}],
"model": "openai/gpt-3.5-turbo"
}'
Response:
{... "choices": [{..., "message":
{"content": "Hello! How can I assist you today?", "role": "assistant",
...}}],...}