client sdks/Official SDKs

Python SDK Integration

Using openai-python with Unlocked AI Gateway.


Installation

pip install openai

Python Integration Snippet

import os
from openai import OpenAI

client = OpenAI(
    base_url="https://unlockedai.net/v1",
    api_key=os.environ.get("UNLOCKED_API_KEY"),
)

response = client.chat.completions.create(
    model="claude-sonnet-5.5",
    messages=[
        {"role": "user", "content": "Explain async IO in Python using a practical analogy."}
    ]
)

print(response.choices[0].message.content)

Need an Unlocked AI Key or Credits?

Generate secret API keys backed by non-expiring pay-as-you-go credits starting at $5. No monthly minimums.