Authentication
The Maitai SDK uses API keys for authentication.
You can create API keys via the Maitai Portal.
Initialize the SDK with your Maitai API key, and you’re all set to start using Maitai.
This can be done via environment variable:
export MAITAI_API_KEY='<YOUR_MAITAI_API_KEY>'
Global initialization:
Client initialization:
If you prefer to bring your own AI provider keys, you can do so in two ways.
- By setting environment variables:
export OPENAI_API_KEY=<YOUR_OPENAI_API_KEY>
export GROQ_API_KEY=<YOUR_GROQ_API_KEY>
export ANTHROPIC_API_KEY=<YOUR_ANTHROPIC_API_KEY>
or by passing it directly into the Maitai client:
api_key
parameter refers to the specific AI provider key for the model you choose, and overrides all other keys. Make sure this key is changed to reflect the correct provider when changing models. Any keys passed in through the SDK are never stored.Managing API Keys in the Portal
To better organize your credentials, you can create new Maitai keys in the Portal. Then, easily map your provider keys to the Maitai keys, so you only ever need to set your MAITAI_API_KEY
in your application.
For best practice, we recommend creating a new Maitai key for each of your environments. Then, decide which of your provider keys (or use our provisioned keys) you’d like to associate with that Maitai key. We safely and securely store your provider keys, so you don’t have to worry about exposing them in your code. Your keys never leave our servers, and are only used to make API calls on your behalf.
Was this page helpful?