How to use Obscurify with the OpenAI client
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 the OpenAI client with your Obscurify URL and API key (Python):
client = OpenAI(
base_url="https://obscurify.ai/v1",
api_key="sk-obs1_AbCd...",
)
completion = client.chat.completions.create(
model="anthropic/claude-sonnet-4.5",
messages=[
{
"role": "system",
"content": "You are a poetic assistant, skilled in explaining complex programming concepts with creative flair.",
},
{
"role": "user",
"content": "Compose a poem that explains the concept of recursion in programming.",
},
],
)
print(completion.choices[0].message.content)
Response:
ChatCompletionMessage(content="In the realm of code, a concept lies\nRecursion, a trick that's rather wise\nA function that calls itself with pride\nUntil a base case is satisfied\n\nLike Russian dolls that nest inside\nEach one contains a smaller size\nRecursion works in similar ways\nSolving problems in elegant phase\n\nImagine a tree with branches grand\nEach branch divides, like a fractal's hand\nRecursion traverses every part\nFrom leaf to root, it plays its art\n\nFibonacci's sequence, a classic case\nRecursion shines in this number chase\nEach term, the sum of two before\nIt builds the sequence, forever more\n\nBut be cautious, dear programmer's mind\nLest infinite loops leave you in a bind\nEnsure a base case, a stopping point\nOr else, recursion will disappoint\n\nSo when complex problems come to play\nAnd iteration just won't make the grade\nThink recursion, with its clever might\nA powerful tool, in the coder's sight\n\nRecursion, a concept that's deep and vast\nIn programming's world, it's unsurpassed\nA elegant way to break things down\nAnd solve the puzzles that come", role='assistant', function_call=None, tool_calls=None)