Customize the nekuda SDK for your production environment.
NekudaClient
once and reuse it throughout your application. Creating multiple clients with different configurations leads to confusion and bugs.Variable | Description | Default |
---|---|---|
NEKUDA_API_KEY | Required – Secret key identifying your nekuda account. Get this from the nekuda Dashboard. | – |
NEKUDA_BASE_URL | Override the API host. Defaults to production. Useful for pointing to staging or local mock servers. | https://api.nekuda.ai |
NekudaClient.from_env()
.
sk_live_
or sk_test_
). This is mandatory.https://
, removes trailing /
). Only change this if you need to point to a non-production environment like staging.httpx
client.sleep = (2 ** (retry_attempt - 1)) * backoff_factor
.base_url
. The default is https://api.nekuda.ai
.
URL Normalization Features
https://
if no protocol specified (assuming api.nekuda.ai
or similar public TLDs).localhost:8000
, ensure you include http://
if not using HTTPS.Production (Recommended)
NekudaClient.from_env()
. Ensure NEKUDA_API_KEY
is set.Explicit Production
Staging/Testing
from_env()
and override specific parameters.
Automatic Response Validation Details
NekudaApiError
.NekudaApiError
if parsing fails.NekudaValidationError
if data is malformed or missing.HTTP_PROXY
, HTTPS_PROXY
, NO_PROXY
).
Can I disable retries entirely?
max_retries=0
to the NekudaClient
constructor.Does the SDK support async calls?
AsyncNekudaClient
) is on the roadmap.How do I handle different environments (dev/staging/prod)?
NEKUDA_API_KEY
, NEKUDA_BASE_URL
) and NekudaClient.from_env()
. Your deployment process can set these variables appropriately for each environment.Alternatively, you can explicitly instantiate NekudaClient
with different parameters based on an environment flag: